/* ============================================================
   Here Comes the Son — pulled from the invitation
   ============================================================ */
:root {
  --paper:      #FBF7F0;
  --paper-2:    #FFFFFF;
  --sun:        #F2B84B;   /* mustard */
  --sun-soft:   #F7D89A;
  --coral:      #E88B63;
  --clay:       #D9744C;
  --sky:        #8CB8DC;   /* powder blue */
  --sky-deep:   #5B87B5;
  --ink:        #3F4E60;
  --ink-soft:   #7A8899;
  --line:       rgba(63, 78, 96, .12);

  --shadow: 0 2px 0 rgba(63,78,96,.05), 0 10px 30px -18px rgba(63,78,96,.45);
  --r: 20px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Jost", ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  overflow-x: hidden;
}

a { color: var(--sky-deep); }

button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---------- signature sunburst ---------- */
.sunwrap {
  position: fixed;
  top: -128px;
  left: -128px;
  width: 320px;
  height: 320px;
  pointer-events: none;
  z-index: 0;
  opacity: .95;
}
.sun { width: 100%; height: 100%; overflow: visible; }
.sun .ray {
  /* No transform-origin here on purpose. Each ray's rotate() attribute already
     carries its own centre (100 100); adding a CSS origin applies that centre a
     second time and throws the rays far out across the page. */
  opacity: .22;
  transition: opacity .7s ease;
}
.sun .ray.lit { opacity: 1; }
.sun .core { fill: var(--sun-soft); }

@media (min-width: 720px) {
  .sunwrap { width: 460px; height: 460px; top: -180px; left: -180px; }
}
/* On a 320px phone the burst would come within ~12px of the wordmark. Pull it
   in so "Here" keeps clear air around it. */
@media (max-width: 360px) {
  .sunwrap { width: 260px; height: 260px; top: -104px; left: -104px; }
}

/* ---------- shell ---------- */
.shell {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 56px;
}

.masthead { text-align: right; padding: 8px 0 22px; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 10.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
  /* This line runs the full width, so the corner sunburst passes behind it on
     anything narrower than a tablet. A paper halo keeps it legible even where a
     fully lit ray sits underneath; it's invisible against the plain background. */
  text-shadow: 0 0 4px var(--paper), 0 0 7px var(--paper);
}

.wordmark {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 900;
  line-height: .82;
  letter-spacing: -.015em;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.wordmark span { display: block; }
.w1 { font-size: 46px; color: var(--coral); }
.w2 { font-size: 46px; color: var(--sun); }
.w3 { font-size: 30px; color: var(--clay); }
.w4 { font-size: 62px; color: var(--sky); letter-spacing: -.03em; }

.dedication {
  margin: 14px 0 0;
  font-size: 12.5px;
  font-style: italic;
  color: var(--ink-soft);
}

/* ---------- cards ---------- */
.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.center { text-align: center; }
.muted { color: var(--ink-soft); font-size: 14px; }

.lead { margin: 0 0 18px; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.lead strong { color: var(--clay); font-weight: 600; }

.label {
  display: block;
  font-size: 10.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
  margin-bottom: 9px;
}
.hint { text-transform: none; letter-spacing: .02em; opacity: .8; font-weight: 400; }

.input {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  padding: 14px 15px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  color: var(--ink);
  margin-bottom: 14px;
}
.input::placeholder { color: rgba(122,136,153,.65); }

.btn {
  width: 100%;
  font-family: "Fraunces", serif;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 800;
  font-size: 17px;
  padding: 15px;
  border: none;
  border-radius: 14px;
  background: var(--coral);
  color: #fff;
  cursor: pointer;
  margin-bottom: 10px;
  transition: transform .12s ease, background .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.sky { background: var(--sky-deep); }
.btn.sunny { background: var(--sun); color: var(--ink); }

.ghost {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  padding: 11px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  margin-bottom: 8px;
}
.ghost:disabled { opacity: .4; }
.ghost.danger { color: var(--clay); border-color: rgba(217,116,76,.3); }

.linkbtn {
  background: none; border: none; padding: 0;
  font-family: inherit; font-size: 12px; color: var(--ink-soft);
  text-decoration: underline; cursor: pointer;
}

.banner {
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 14px;
  margin-bottom: 14px;
  background: rgba(140,184,220,.16);
  color: var(--sky-deep);
}
.banner.win { background: rgba(242,184,75,.2); color: var(--clay); font-weight: 500; }
.banner.warn { background: rgba(217,116,76,.12); color: var(--clay); }

/* ---------- lobby ---------- */
.waiting { display: flex; align-items: center; gap: 11px; font-size: 16px; margin-bottom: 14px; }
.blip {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--sun);
  animation: blip 1.7s ease-in-out infinite;
}
@keyframes blip { 0%,100% { opacity:.3; transform:scale(.75); } 50% { opacity:1; transform:scale(1.2); } }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- timer bar ---------- */
.hud {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding: 0 4px;
}
.hud .count {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 500;
}
.clock {
  font-family: "Fraunces", serif;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 800; font-size: 26px; color: var(--clay);
  font-variant-numeric: tabular-nums;
}

/* ---------- word grid ---------- */
.gridcard { padding: 12px; }
.grid {
  position: relative;
  display: grid;
  gap: 1px;
  aspect-ratio: 1 / 1;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.cell {
  display: flex; align-items: center; justify-content: center;
  font-family: "Jost", sans-serif;
  font-weight: 500;
  font-size: clamp(11px, 3.2vw, 16px);
  color: var(--ink);
  border-radius: 4px;
}
.strokes { position: absolute; inset: 0; pointer-events: none; }

.words { margin-bottom: 14px; }
.word {
  display: inline-block;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  letter-spacing: .08em;
  color: var(--ink);
  transition: all .3s ease;
}
.word.found {
  color: rgba(122,136,153,.6);
  text-decoration: line-through;
  background: transparent;
  border-color: transparent;
}
.found-flash { color: var(--clay); font-weight: 500; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- cake gallery ---------- */
.shotgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 14px; }
@media (min-width: 620px) { .shotgrid { grid-template-columns: repeat(3, 1fr); } }

.shot {
  border: 2px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--paper-2);
  cursor: zoom-in;
  padding: 0;
  width: 100%;
  text-align: left;
  transition: border-color .2s ease, transform .12s ease;
  /* Flex column, not block. A <button> centres its content vertically, so in a
     grid row stretched by a taller neighbour the shorter tiles pushed their
     image down — up to 12px of phantom white space above the photo. */
  display: flex;
  flex-direction: column;
}
.shot:active { transform: scale(.98); }
@media (hover: hover) { .shot:hover { border-color: var(--sun); } }
.shot img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  display: block; background: var(--paper);
  flex: 0 0 auto;   /* never let the flex column squash the square */
}
/* Takes the leftover height, so any slack in a stretched row collects under the
   text instead of shifting the photo. */
.shotcap { display: block; padding: 9px 10px 11px; flex: 1 1 auto; }
/* Name left, year right — the year is what makes the chronological run readable
   while scrolling. baseline alignment keeps them on one line even when the name
   wraps to nothing. Fixed height so a tile with no name is no shorter than one
   with a name; that alone accounted for 3px of row-to-row variance. */
.shottop {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  min-height: 18px;
}
/* One line, always. On a 320px screen a longer name wrapped and added 12px to
   the tile, which was the last source of uneven row heights. The year beside it
   is flex: 0 0 auto, so the name is the part that has to give. */
.shotwho {
  font-size: 13px; font-weight: 500; color: var(--ink);
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shotyear {
  margin-left: auto; flex: 0 0 auto;
  font-size: 11px; letter-spacing: .06em; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
/* Reserve exactly two lines so every tile in a row is the same height. Nothing
   is currently longer than two lines at phone width; the clamp is insurance for
   the narrower tiles in the 3-column desktop layout, and the lightbox always
   shows the caption in full anyway. */
.shotwhat {
  font-size: 12px; line-height: 1.35; color: var(--ink-soft);
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(28, 34, 42, .93);
  display: flex; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  animation: lbin .18s ease-out;
}
@keyframes lbin { from { opacity: 0; } to { opacity: 1; } }

.lbfig {
  margin: 0; max-width: 100%; max-height: 100%;
  display: flex; flex-direction: column; gap: 12px; align-items: center;
  touch-action: pan-y;
}
.lbfig img {
  max-width: 100%;
  /* leave room for the caption under the photo */
  max-height: calc(100vh - 190px);
  object-fit: contain;
  border-radius: 14px;
  background: #1c222a;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .8);
}
.lbfig figcaption {
  color: var(--paper); text-align: center;
  display: flex; flex-direction: column; gap: 3px;
  font-size: 14px; line-height: 1.4; max-width: 34ch;
}
.lbfig figcaption strong { font-weight: 600; font-size: 16px; }
.lbfig figcaption span { color: rgba(251, 247, 240, .78); }
.lbyear, .lbcount {
  font-size: 12px !important; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(251, 247, 240, .5) !important;
}

.lbclose, .lbnav {
  position: absolute; z-index: 2;
  border: none; background: rgba(251, 247, 240, .14); color: var(--paper);
  cursor: pointer; font-family: inherit; line-height: 1;
  border-radius: 999px; backdrop-filter: blur(6px);
  display: grid; place-items: center;
}
.lbclose {
  top: max(14px, env(safe-area-inset-top)); right: 14px;
  width: 44px; height: 44px; font-size: 28px;
}
.lbnav { top: 50%; transform: translateY(-50%); width: 46px; height: 46px; font-size: 30px; }
.lbnav.prev { left: 10px; }
.lbnav.next { right: 10px; }
@media (hover: hover) {
  .lbclose:hover, .lbnav:hover { background: rgba(251, 247, 240, .26); }
}
/* On a narrow phone the arrows would sit on top of the photo — swiping works,
   and the arrows drop to the bottom corners where they don't cover anything. */
@media (max-width: 460px) {
  .lbnav { top: auto; bottom: max(14px, env(safe-area-inset-bottom)); transform: none; }
  .lbnav.prev { left: 16px; }
  .lbnav.next { right: 16px; }
  .lbfig img { max-height: calc(100vh - 230px); }
}

/* ---------- board ---------- */
.board { list-style: none; margin: 0; padding: 0; }
.board li {
  display: grid;
  grid-template-columns: 26px 1fr auto auto;
  gap: 10px; align-items: center;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.board li:first-child { border-top: none; }
.board li.me .nm { color: var(--clay); font-weight: 600; }
.rk {
  font-family: "Fraunces", serif; font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 800; font-size: 15px; color: var(--sun);
}
.board li:nth-child(1) .rk { color: var(--clay); font-size: 19px; }
.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc {
  font-family: "Fraunces", serif; font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 800; font-size: 18px; color: var(--sky-deep);
  min-width: 24px; text-align: right;
}
.tm { font-size: 13px; color: var(--ink-soft); min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }

.fine { font-size: 11.5px; color: var(--ink-soft); line-height: 1.55; margin: 14px 0 0; }

.statusrow { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.status {
  font-family: "Fraunces", serif; font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 800; font-size: 24px; text-transform: capitalize; color: var(--clay);
}

.footer {
  margin-top: 28px; text-align: center;
  font-size: 12px; color: var(--ink-soft);
}
/* Three links plus the credit is too much for one line on a phone, so the
   links wrap among themselves and the credit always sits on its own line. */
.footlinks {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center;
}
.footer .dot { margin: 0 7px; }
.credit { margin: 9px 0 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- wishes ---------- */
.area {
  resize: vertical;
  min-height: 92px;
  line-height: 1.55;
  font-size: 15px;
  margin-bottom: 18px;
}
.saved { font-size: 12.5px; color: var(--sky-deep); margin: 2px 0 0; }

.wall { display: flex; flex-direction: column; gap: 12px; }
.note {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--sun);
  border-radius: 12px;
  padding: 13px 15px;
}
.note:nth-child(3n+2) { border-left-color: var(--coral); }
.note:nth-child(3n+3) { border-left-color: var(--sky); }
.notefrom {
  font-family: "Fraunces", serif;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 800;
  font-size: 15px;
  color: var(--clay);
  margin: 0 0 6px;
}
.notebody {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.notebody + .notebody { margin-top: 9px; }

/* A note with a headshot puts the photo in a fixed first column so every
   entry on the wall lines up whether or not someone added one. */
.note.haspic { display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: start; }
.notepic {
  width: 54px; height: 54px; border-radius: 50%;
  object-fit: cover; display: block;
  border: 2px solid var(--paper-2);
  box-shadow: 0 0 0 1px var(--line);
  background: var(--paper);
}

/* ---------- selfie picker ---------- */
.picker { display: flex; align-items: center; gap: 14px; margin: 2px 0 4px; }
.pickpic {
  width: 62px; height: 62px; border-radius: 50%;
  object-fit: cover; flex: 0 0 auto;
  border: 2px dashed var(--line);
  background: var(--paper);
  display: grid; place-items: center;
  font-size: 26px; color: var(--ink-soft);
}
.pickpic:not(.empty) { border-style: solid; border-color: var(--sun); }
.pickbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.pickbtns .ghost { margin: 0; width: auto; }

.notetag {
  display: inline-block;
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sky-deep);
  margin-right: 7px;
  vertical-align: 1px;
}

/* ---------- quiz ---------- */
.qcard {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 16px 13px;
  margin-bottom: 11px;
  position: relative;
  box-shadow: var(--shadow);
}
.qnum {
  position: absolute; top: 13px; left: 15px;
  font-family: "Fraunces", serif; font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 800; font-size: 13px; color: var(--sun);
}
.qprompt {
  text-align: center;
  font-size: 40px;
  line-height: 1.25;
  letter-spacing: .04em;
  padding: 6px 0 14px;
  word-break: break-word;
}
.qprompt.small { font-size: 24px; padding: 0; text-align: left; }
/* Word-based sets (baby animals, the price is right) read as a sentence, not as
   oversized glyphs. Left-aligned so long product names don't look ragged. */
.qprompt.words {
  font-size: 17px; line-height: 1.4; letter-spacing: 0;
  text-align: left; padding: 2px 0 12px 22px; font-weight: 500;
}
/* In the results list the prompt sits beside the answer, so it needs to be
   small and allowed to shrink rather than shove the answer off the row. */
.qprompt.small.words { font-size: 14px; padding: 0; font-weight: 400; flex: 1 1 auto; min-width: 0; }

.qchoices { display: grid; gap: 7px; }
.qchoice {
  font-family: inherit;
  font-size: 14.5px;
  text-align: left;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.qchoice.on {
  background: var(--sun);
  border-color: var(--sun);
  color: var(--ink);
  font-weight: 500;
}

.qresult {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.qresult:first-of-type { border-top: none; }
.qanswer { font-size: 13.5px; line-height: 1.4; }
.qresult.right .qanswer { color: var(--sky-deep); }
.qresult.miss .qanswer { color: var(--ink-soft); }
.qresult.miss .qanswer strong { color: var(--clay); font-weight: 600; }

/* ---------- the name ---------- */
.namestory {
  margin: 4px 0 18px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--coral);
  border-radius: 12px;
}
.namestory p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
}
