/* Friend Advent Calendar — winter paper at night.
   One memory device for the whole site: the 24-door grid. */

:root {
  --bg: #0e1b2c;
  --card: #14263c;
  --ink: #eef3f8;
  --muted: #9fb2c7;
  --gold: #e8b04b;
  --berry: #c4473c;
  --line: rgba(238, 243, 248, 0.14);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 10px;
  --head: "Playfair Display", Georgia, serif;
  --body: "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, #16304a 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--head);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 16px;
}

p { margin: 0 0 16px; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: #f3c877; }
img { max-width: 100%; height: auto; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--bg);
  padding: 12px 16px; z-index: 60;
}
.skip:focus { left: 12px; top: 12px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap--narrow { max-width: 700px; }

/* ---------- top bar ---------- */

.bar { border-bottom: 1px solid var(--line); }
.bar__in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px;
}
.logo {
  font-family: var(--head); font-size: 22px; color: var(--ink); text-decoration: none;
}
.logo span { color: var(--gold); }
.nav { display: flex; gap: 20px; font-size: 15px; font-weight: 700; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--gold); text-decoration: underline; }

/* ---------- hero ---------- */

.hero { padding: 64px 0 32px; }
.hero__kicker {
  margin: 0 0 12px; color: var(--gold);
  font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.hero h1 { font-size: 48px; letter-spacing: -0.01em; }
.hero__lede { font-size: 19px; color: var(--muted); max-width: 60ch; }

/* ---------- the door grid (site memory device) ---------- */

.doors {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}
.door {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, #17304a 0%, #12233a 100%);
  font-size: 15px; font-weight: 700; color: var(--muted);
  box-shadow: var(--shadow-1);
}

/* ---------- editor ---------- */

.maker { padding: 16px 0 64px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-2);
}

.field { margin-bottom: 16px; }
.field > label, .field__label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #0b1626; color: var(--ink);
  font-family: inherit; font-size: 17px;
}
.input::placeholder { color: #6d8299; }
textarea.input { resize: vertical; min-height: 64px; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.notes {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin: 0 0 16px; padding: 0; list-style: none;
}
.note { display: grid; grid-template-columns: 46px 1fr; gap: 8px; align-items: start; }
.note__n {
  grid-column: 1 / -1;
  font-size: 12px; font-weight: 700; color: var(--gold); letter-spacing: 0.08em;
}
.note__emoji { text-align: center; font-size: 17px; }
.note__text { font-size: 16px; }

.emoji-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 20px; }
.emoji-pick {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #0b1626; font-size: 18px; line-height: 1;
  padding: 8px 10px; min-height: 40px; cursor: pointer;
}
.emoji-pick:hover { border-color: var(--gold); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px;
  border: 1px solid var(--gold); border-radius: var(--radius);
  background: var(--gold); color: #1a1206;
  font-family: inherit; font-size: 17px; font-weight: 700;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: #f3c877; border-color: #f3c877; }
.btn--ghost { background: transparent; color: var(--gold); }
.btn--ghost:hover { background: rgba(232, 176, 75, 0.12); }
.btn--sm { min-height: 44px; padding: 0 16px; font-size: 16px; }

.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.out { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.out[hidden] { display: none; }
.out .input { font-size: 14px; }
.hint { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.err { font-size: 15px; color: #ff9a90; margin: 12px 0 0; }
.err[hidden] { display: none; }

/* ---------- share view ---------- */

.view { padding: 40px 0 64px; }
.view__head { margin-bottom: 24px; }
.view__title { font-size: 40px; margin-bottom: 6px; }
.view__from { color: var(--muted); font-size: 17px; margin: 0; }
.view__count {
  display: inline-block; margin-top: 12px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 14px; color: var(--gold);
}

.cal { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; }
.cell {
  position: relative; aspect-ratio: 1 / 1;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(160deg, #17304a 0%, #12233a 100%);
  color: var(--muted); font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: default; padding: 0;
  box-shadow: var(--shadow-1);
}
.cell--open { cursor: pointer; border-color: rgba(232, 176, 75, 0.5); color: var(--ink); }
.cell--open:hover { border-color: var(--gold); }
.cell--today { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(232, 176, 75, 0.35); }
.cell--read { background: #1c3b57; }
.cell__n { font-size: 13px; opacity: 0.75; }
.cell__e { font-size: 22px; display: block; line-height: 1.2; }

.reader {
  margin-top: 24px; padding: 20px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-2);
}
.reader[hidden] { display: none; }
.reader__meta { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.reader__text { margin: 0; font-size: 19px; }

/* ---------- long copy ---------- */

.prose { max-width: 70ch; }
.prose h2 { font-size: 28px; margin-top: 40px; }
.prose h3 { font-size: 21px; margin-top: 28px; }
.prose ul, .prose ol { padding-left: 24px; margin: 0 0 16px; }
.prose li { margin-bottom: 8px; color: var(--ink); }
.prose > :first-child { margin-top: 0; }

.section { padding: 56px 0; }
.section--alt { background: #0b1626; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.faq { max-width: 70ch; }
.faq__item { border-top: 1px solid var(--line); padding: 16px 0; }
.faq__item:last-child { border-bottom: 1px solid var(--line); }
.faq__q {
  cursor: pointer; font-family: var(--head); font-size: 21px; font-weight: 700;
  list-style: none; padding-right: 28px; position: relative;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after { content: "+"; position: absolute; right: 0; top: 0; color: var(--gold); }
.faq__item[open] .faq__q::after { content: "\2212"; }
.faq__a { padding-top: 12px; color: var(--muted); }
.faq__a p { margin: 0; }

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--line); padding: 40px 0 64px; font-size: 15px; color: var(--muted); }
.foot__top { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; margin-bottom: 16px; }
.foot__brand { font-family: var(--head); font-size: 20px; color: var(--ink); margin: 0; }
.foot__nav { display: flex; flex-wrap: wrap; gap: 16px; }
.foot__nav a { color: var(--muted); text-decoration: none; }
.foot__nav a:hover { color: var(--gold); text-decoration: underline; }
.foot__note { max-width: 70ch; margin: 0 0 8px; }
.foot__copy { margin: 0; }

@media (max-width: 720px) {
  body { font-size: 17px; }
  .hero { padding: 40px 0 24px; }
  .hero h1 { font-size: 30px; }
  .hero__lede { font-size: 17px; }
  .two { grid-template-columns: 1fr; }
  .notes { grid-template-columns: 1fr; }
  .doors, .cal { grid-template-columns: repeat(4, 1fr); }
  .view__title { font-size: 28px; }
  .panel { padding: 16px; }
  .btn { width: 100%; }
  .row .btn { width: 100%; }
  .bar__in { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 0; }
}
