/* Night-blue header, white gift rows, candle gold for the one action. Works for Hanukkah and birthdays. */
:root {
  --bg: #eef1f8; --surface: #fff; --ink: #151d33; --ink-2: #4a5470; --line: #d2d8e8;
  --head: #182c61; --on-head: #fff; --on-head-2: #c9d4f2;
  --gold: #f0b434; --on-gold: #1c1503; --focus: #2f55c9; --warn: #9b2c2c;
  --ok: #1d4a9e; --ok-bg: #e4ebfb;
  --plate: #fff; --plate-ink: #182c61; --shadow: 0 2px 4px rgb(24 44 97 / .06), 0 10px 28px rgb(24 44 97 / .09);
  --display: "Young Serif", Georgia, serif;
  --body: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c101c; --surface: #171d2e; --ink: #eef1fa; --ink-2: #aab4d0; --line: #2e3754;
    --head: #121f47; --focus: #8fa8ff; --warn: #ff9c9c; --ok: #a9c0ff; --ok-bg: #1d2a52; --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.big { font-size: 125%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.125rem/1.5 var(--body); }
::selection { background: var(--gold); color: var(--on-gold); }
.wrap { max-width: 920px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
h1, h2 { font-family: var(--display); font-weight: 400; margin: 0; text-wrap: balance; font-variant-numeric: lining-nums; }
p { margin: 0; text-wrap: pretty; }
ul { list-style: none; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.gift:focus:not(:focus-visible), .bought:focus:not(:focus-visible) { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
svg { width: 1em; height: 1em; flex: none; }

.top { background: var(--head); color: var(--on-head); padding-block: 36px 24px; }
h1 { font-size: clamp(2rem, 5.5vw, 3.25rem); line-height: 1.1; letter-spacing: -.015em; }
#intro { margin-top: 12px; color: var(--on-head-2); }
.top :focus-visible { outline-color: var(--gold); }
.index { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.jump { display: flex; flex-direction: column; align-items: stretch; width: 100%; height: 100%; gap: 6px; padding: 0; border: 0; background: none; color: inherit; font: 400 .95rem/1.25 var(--body); text-align: center; cursor: pointer; }
.jump .thumb { position: relative; aspect-ratio: 1; border-radius: 14px; background: var(--plate); overflow: hidden; display: grid; place-items: center; transition: transform .2s cubic-bezier(.16, 1, .3, 1); }
.jump:hover .thumb { transform: translateY(-3px); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.thumb img.cover { object-fit: cover; padding: 0; }
.plate-name { color: var(--plate-ink); font: 400 1.3rem var(--display); }
.jump .state { font-size: .9rem; color: var(--on-head-2); }
.jump.taken .state { color: var(--gold); font-weight: 700; }
.jump.taken img { opacity: .35; }
.tick { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--gold); color: var(--on-gold); font-size: 1.5rem; }

main { padding-block: 24px 48px; }
.top .wrap { display: flex; flex-direction: column; }
.bigger { align-self: flex-end; min-height: 44px; margin-bottom: 12px; padding: 6px 16px; border: 2px solid rgb(255 255 255 / .45); border-radius: 999px; background: none; color: inherit; font: 700 1rem/1.2 var(--body); cursor: pointer; }
.bigger:hover { border-color: var(--gold); }
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; margin: 0 0 16px; padding: 0; list-style: none; counter-reset: step; }
.steps li { display: flex; align-items: center; gap: 12px; counter-increment: step; font-weight: 700; line-height: 1.3; }
.steps li::before { content: counter(step); display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--head); color: var(--on-head); font: 400 1.3rem var(--display); }
.stores { width: 100%; display: grid; gap: 6px; }
.stores > p { font-weight: 700; font-size: 1rem; }
.stores .button { padding-inline: 16px; }
.store-price { font-weight: 400; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin-bottom: 24px; }
.banner.ask { border: 2px solid var(--gold); }
.gifts { display: grid; gap: 20px; }
.gift { display: grid; grid-template-columns: 280px minmax(0, 1fr); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 16px; }
.photo { background: var(--plate); display: grid; place-items: center; min-height: 260px; position: relative; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 20px; }
.photo img.cover { object-fit: cover; padding: 0; }
.photo .model { font: 400 2.5rem/1.1 var(--display); color: var(--plate-ink); text-align: center; padding: 20px; }
.photo .model small { display: block; margin-top: 8px; font: 400 1.05rem/1.4 var(--body); }
.gift.taken .photo img { opacity: .45; }
.stamp { position: absolute; left: 16px; top: 16px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--gold); color: var(--on-gold); font-weight: 700; }
.info { padding: 24px 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0; }
h2 { font-size: 1.6rem; line-height: 1.2; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.price strong { font: 400 2rem/1.1 var(--display); font-variant-numeric: lining-nums; }
.price span { color: var(--ink-2); font-size: 1rem; }
.price .flag { align-self: center; padding: 2px 12px; border-radius: 999px; border: 2px solid var(--gold); color: var(--ink); font-weight: 700; }

.buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 20px; border-radius: 12px; border: 2px solid var(--line); background: transparent; color: var(--ink); font: 600 1.05rem/1.2 var(--body); text-decoration: none; cursor: pointer; transition: border-color .15s, filter .15s, transform .1s; }
.button:hover { border-color: var(--ink-2); }
.button:active, .choice:active { transform: scale(.98); }
.button.main { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.button.main:hover { filter: brightness(1.08); }
.button:disabled { opacity: .55; cursor: progress; }

.choices { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 16px; border-top: 1px solid var(--line); }
.choice { display: flex; flex-direction: column; height: 100%; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; line-height: 1.3; transition: border-color .15s, transform .1s; }
.choice:hover { border-color: var(--focus); }
.choice.picked { border-color: var(--gold); border-width: 3px; }
.choice img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--plate); padding: 6px; }
.words { display: flex; flex-direction: column; flex: 1; min-width: 0; padding: 10px; }
.choice .name { font-weight: 700; }
.choice .detail { font-size: .95rem; color: var(--ink-2); }
.choice .cost { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; font-variant-numeric: tabular-nums; }
.choices.amounts .words { align-items: center; text-align: center; }
.choices.amounts .name { font: 400 1.8rem/1.2 var(--display); font-variant-numeric: lining-nums; }
.choices.amounts .cost { justify-content: center; font-size: .95rem; }

.claim { width: 100%; margin-top: auto; padding-top: 4px; display: grid; gap: 10px; }
.checking { color: var(--ink-2); min-height: 52px; }
.bought { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; background: var(--ok-bg); border-radius: 12px; padding: 12px 16px; }
.bought:focus { animation: settle .45s cubic-bezier(.16, 1, .3, 1); }
.bought div { min-width: 0; overflow-wrap: anywhere; }
.bought strong { display: block; color: var(--ok); }
.bought .button { min-height: 44px; font-size: 1rem; }
@keyframes settle { from { transform: scale(.96); } to { transform: scale(1); } }
form { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); padding-top: 14px; }
label { display: grid; align-content: start; gap: 4px; font-weight: 600; font-size: 1rem; min-width: 0; }
label.wide, form .buttons, form .error { grid-column: 1 / -1; }
input, select { width: 100%; min-width: 0; min-height: 48px; font: 400 1.05rem var(--body); color: var(--ink); background: var(--surface); border: 2px solid var(--line); border-radius: 10px; padding: 8px 12px; caret-color: var(--focus); }
.error { color: var(--warn); font-weight: 700; }
.fine { margin-top: 28px; font-size: .95rem; color: var(--ink-2); }
#to-top { position: fixed; z-index: 2; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); background: var(--head); border-color: var(--head); color: var(--on-head); box-shadow: 0 6px 20px rgb(0 0 0 / .3); }

.about { margin-top: 14px; max-width: 68ch; color: var(--on-head-2); }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.facts li { padding: 4px 14px; border-radius: 999px; background: var(--gold); color: var(--on-gold); font-weight: 700; }
.index.groups { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.group-jump { justify-content: center; min-height: 64px; padding: 10px; border: 2px solid rgb(255 255 255 / .35); border-radius: 14px; }
.group-jump:hover { border-color: var(--gold); }
.group-jump .label { font-weight: 700; }
.group { scroll-margin-top: 16px; }
.group:focus:not(:focus-visible) { outline: none; }
.group + .group { margin-top: 20px; }
.group > h2 { margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid .gift { grid-template-columns: 120px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 16px; padding: 16px; }
.grid .photo { align-self: start; aspect-ratio: 1; min-height: 0; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; }
.grid .photo img { padding: 6px; }
.grid .stamp { left: 4px; top: 4px; padding: 2px 8px; font-size: .85rem; }
.top-line { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.grid .info { grid-column: 1 / -1; padding: 12px 0 0; }
.grid .gift.plain { grid-template-columns: minmax(0, 1fr); }
.grid h3 { margin: 0; font: 700 1.15rem/1.3 var(--body); text-wrap: balance; }
.grid .price strong { font-size: 1.5rem; }
.grid form { grid-template-columns: minmax(0, 1fr); }
.grid label.wide, .grid form .buttons, .grid form .error { grid-column: 1; }
.stamp.inline { position: static; }
.thanks { display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 700; }
body:has(form) #to-top { display: none; }
.about details { margin-top: 10px; }
.about summary { min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--on-head); cursor: pointer; }
.about summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid; border-bottom: 2px solid; transform: rotate(45deg) translate(-2px, -2px); }
.about details[open] summary::after { transform: rotate(225deg); }

@media (max-width: 760px) {
  .index.groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .grid .gift { grid-template-columns: 104px minmax(0, 1fr); }
  .grid .photo { min-height: 0; }
  .grid .info { padding: 12px 0 0; }
  main { padding-block-end: 96px; }
  .steps { grid-auto-flow: row; }
  .stores .buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stores li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .stores .button { width: 100%; height: 100%; flex-direction: column; gap: 0; padding-inline: 8px; text-align: center; }
  .stores .button svg { display: none; }
  .steps { gap: 8px; }
  .steps li::before { width: 32px; height: 32px; font-size: 1.1rem; }
  .top { padding-block: 10px 14px; }
  .bigger { margin-bottom: 4px; font-size: .95rem; }
  h1 { font-size: 1.75rem; }
  #intro { display: none; }
  .about { margin-top: 8px; font-size: 1rem; }
  .facts { margin-top: 8px; }
  .index { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
  .jump { gap: 3px; font-size: .875rem; }
  .jump .thumb { aspect-ratio: 4 / 3; }
  .jump .state { font-size: .8125rem; }
  .group-jump { min-height: 52px; padding: 6px; }
  .gift { grid-template-columns: minmax(0, 1fr); }
  .photo { min-height: 220px; }
  .info { padding: 20px; }
  .choices { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .choice { flex-direction: row; }
  .choice img { width: 120px; flex: none; aspect-ratio: auto; min-height: 104px; }
  .choices.amounts { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .choices.amounts li { grid-column: span 2; }
  .choices.amounts li:nth-child(n+4) { grid-column: span 3; }
  .choices.amounts .choice { flex-direction: column; }
  form { grid-template-columns: minmax(0, 1fr); }
  .start .button, form .button, .bought .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
