/* Storybook template. Colours are sampled from the pack's art; fonts are self-hosted per pack. */
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/Figtree-normal-400.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/Figtree-normal-600.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/Figtree-normal-800.woff2') format('woff2'); }
@font-face { font-family: 'Gentium Book Plus'; font-style: italic; font-weight: 400; font-display: swap; src: url('../fonts/GentiumBookPlus-italic-400.woff2') format('woff2'); }
@font-face { font-family: 'Gentium Book Plus'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/GentiumBookPlus-normal-400.woff2') format('woff2'); }
@font-face { font-family: 'Mrs Saint Delafield'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/MrsSaintDelafield-normal-400.woff2') format('woff2'); }
:root {
  --paper: #f7ebe3;
  --paper-2: #eddacf;
  --ink: #302117;
  --ink-soft: #624e41;
  --accent: #e98549;
  --accent-deep: #aa4f18;
  --deep: #392518;
  --night: #18100c;
  --on-night: #f6eeea;
  --on-night-soft: #cbbcb4;
  --serif: 'Gentium Book Plus', Georgia, 'Times New Roman', serif;
  --sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --script: 'Mrs Saint Delafield', 'Brush Script MT', cursive;
  --r: 999px;
  --wrap: min(1160px, 100% - 32px);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.rm { scroll-behavior: auto; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--sans); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.05; margin: 0; letter-spacing: -0.01em; overflow-wrap: break-word; }
h1 em, h2 em { font-style: italic; color: var(--accent-deep); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.script { font-family: var(--script); font-weight: 700; font-size: clamp(40px, 6vw, 60px); line-height: 1; color: var(--accent-deep); margin: 0 0 12px; }
.kicker, .ca__label, .card__num, .toy__count, .foot__name { font-family: var(--sans); font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; font-size: 12px; }

/* ---- Pills ---- */
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: var(--r); font: 600 15px/1 var(--sans); text-decoration: none; border: 1.5px solid transparent; cursor: pointer; transition: transform .15s ease, filter .15s ease; }
.pill:hover { transform: translateY(-1px); filter: brightness(1.08); }
.pill img { width: 18px; height: 18px; }
.pill--accent { background: var(--accent); color: var(--night); }
.pill--light { background: var(--paper); color: var(--ink); }
.pill--ghost { background: rgba(0, 0, 0, .35); color: #fff; border-color: rgba(255, 255, 255, .55); backdrop-filter: blur(6px); }
.pill--ghost img { filter: invert(1); }

/* ---- Header ---- */
.top { position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; gap: 16px; padding: 12px max(16px, (100% - 1160px) / 2); background: linear-gradient(to bottom, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0)); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 400 26px/1 var(--serif); }
.brand img { border-radius: 50%; border: 2px solid var(--accent); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.nav > a:not(.pill) { text-decoration: none; font-weight: 600; font-size: 15px; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.nav > a:not(.pill):hover { text-decoration: underline; text-underline-offset: 4px; }
.burger { display: none; margin-left: auto; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .6); background: rgba(0, 0, 0, .35); cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 6px; }
.burger span { display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s ease; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---- Hero ---- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; color: #fff; background: var(--night); }
.hero picture, .hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__bg { object-fit: cover; object-position: 66% 55%; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .85) 0%, rgba(0, 0, 0, .45) 38%, rgba(0, 0, 0, 0) 65%); pointer-events: none; }
.hero__copy { position: relative; z-index: 2; width: var(--wrap); margin: 0 auto; padding: 120px 0 56px; }
.hero__copy > * { max-width: 640px; }
.hero__copy > h1 { max-width: 900px; }
.kicker { color: var(--accent); margin: 0 0 14px; }
.hero h1 { font-size: clamp(40px, 6.2vw, 82px); text-shadow: 0 2px 24px rgba(0, 0, 0, .5); }
.hero h1 em { color: var(--accent); }
.lede { font-size: 19px; margin: 18px 0 22px; color: rgba(255, 255, 255, .88); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.ca { margin: 0 0 22px; }
.ca__label { display: block; color: var(--accent); margin-bottom: 8px; }
.ca__btn { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 560px; padding: 14px 18px; border-radius: 14px; cursor: pointer; text-align: left; color: var(--ink); background: var(--paper); border: 2px solid var(--accent); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.ca__btn code { flex: 1; min-width: 0; font: 600 14px/1.3 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.ca__tap { flex: none; font: 800 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; background: var(--night); color: var(--accent); padding: 8px 10px; border-radius: var(--r); }

/* Sparks (decorative motion) */
.sparks { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.sparks i { position: absolute; bottom: 30%; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px 3px var(--accent); opacity: 0; }
.sparks i:nth-child(1) { left: 64%; } .sparks i:nth-child(2) { left: 67%; } .sparks i:nth-child(3) { left: 70%; } .sparks i:nth-child(4) { left: 62%; }
.sparks i:nth-child(5) { left: 69%; } .sparks i:nth-child(6) { left: 65%; } .sparks i:nth-child(7) { left: 72%; } .sparks i:nth-child(8) { left: 60%; }
html:not(.rm) .sparks i { animation: rise 6s linear infinite; }
.sparks i:nth-child(2n) { animation-delay: -1.5s; } .sparks i:nth-child(3n) { animation-delay: -3s; } .sparks i:nth-child(4n) { animation-delay: -4.5s; }
@keyframes rise { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: .9; } 100% { transform: translate(-30px, -55vh); opacity: 0; } }

/* ---- Story ---- */
.story, .play { width: var(--wrap); margin: 0 auto; padding: 96px 0; }
.story h2, .play h2, .coin h2 { font-size: clamp(32px, 4.6vw, 56px); max-width: 820px; }
.story__fig { margin: 40px 0 0; border-radius: 22px; overflow: hidden; position: relative; box-shadow: 0 24px 60px rgba(0, 0, 0, .22); }
.story__fig img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.story__fig figcaption { position: absolute; left: 18px; bottom: 16px; right: 18px; width: fit-content; background: rgba(0, 0, 0, .7); color: #fff; padding: 8px 14px; border-radius: 18px; font-size: 14px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; }
.card { background: var(--paper-2); border: 1px solid rgba(0, 0, 0, .1); border-radius: 20px; padding: 26px; }
.card__num { color: var(--accent-deep); }
.card h3 { font-size: 30px; margin: 8px 0 10px; }
.card p { margin: 0; color: var(--ink-soft); }

/* ---- Gallery ---- */
.gallery { width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gallery figure { margin: 0; border-radius: 18px; overflow: hidden; background: var(--paper-2); }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.gallery figcaption { padding: 10px 14px 14px; font-size: 15px; color: var(--ink-soft); }

/* ---- Toy ---- */
.play { text-align: center; }
.play h2 { margin: 0 auto; }
.toy { --p: 0; margin: 40px auto 0; max-width: 520px; background: radial-gradient(circle at 50% 30%, var(--deep), var(--night)); color: var(--on-night); border-radius: 28px; padding: 34px 24px 26px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.toy__stage { position: relative; width: 220px; height: 240px; margin: 0 auto 22px; display: grid; place-items: end center; }
.toy__glow { position: absolute; inset: 20px; border-radius: 50%; background: var(--accent); filter: blur(30px); opacity: calc(.15 + var(--p) * .7); }
.toy__face { position: relative; width: 200px; height: 200px; border-radius: 50%; border: 4px solid var(--accent); object-fit: cover; transition: transform .25s ease; }
.toy__btn.is-held ~ * .toy__face, .is-held .toy__face { transition: none; }
.toy__btn { min-height: 52px; padding: 14px 26px; border-radius: var(--r); border: 0; background: var(--accent); color: var(--night); font: 800 16px/1 var(--sans); cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; }
.toy__btn.is-held { filter: brightness(1.1); transform: scale(.98); }
.toy__meter { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .18); margin: 18px auto 0; max-width: 320px; overflow: hidden; }
.toy__meter span { display: block; height: 100%; width: 0; background: var(--accent); }
.toy__msg { min-height: 1.6em; margin: 16px 0 4px; font: italic 400 22px/1.3 var(--serif); }
.toy__count { margin: 0; color: var(--on-night-soft); }
.toy__count b { color: var(--accent); }
html:not(.rm) .toy.is-won .toy__stage { animation: shake .4s ease 2; }
@keyframes shake { 25% { transform: translateX(-4px) rotate(-2deg); } 75% { transform: translateX(4px) rotate(2deg); } }

/* ---- Coin / how to buy ---- */
.coin { background: var(--night); color: var(--on-night); padding: 96px max(16px, (100% - 1160px) / 2); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: center; margin-top: 96px; }
.coin__img { width: 100%; max-width: 480px; border-radius: 50%; box-shadow: 0 0 80px var(--accent-glow, rgba(255, 255, 255, .15)); justify-self: center; }
.coin h2 em, .coin .script { color: var(--accent); }
.steps { margin: 26px 0 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.steps li { counter-increment: s; position: relative; padding: 16px 18px 16px 62px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px; color: var(--on-night-soft); }
.steps li::before { content: counter(s); position: absolute; left: 18px; top: 14px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--night); font: 800 15px/30px var(--sans); text-align: center; }
.steps b { color: var(--on-night); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: var(--r); background: #fff; color: #111; text-decoration: none; font-weight: 600; font-size: 15px; }

/* ---- Footer ---- */
.foot { background: var(--night); color: var(--on-night-soft); text-align: center; padding: 8px 16px 64px; border-top: 1px solid rgba(255, 255, 255, .08); }
.foot img { margin: 40px auto 14px; border-radius: 50%; border: 2px solid var(--accent); }
.foot__name { color: var(--accent); margin: 0 0 10px; }
.foot__links a, .foot__report a { color: var(--on-night); font-weight: 600; }
.foot__small { max-width: 620px; margin: 14px auto 0; font-size: 14px; }
.foot__report { margin: 14px 0 0; font-size: 13px; }

/* ---- 404 ---- */
.lost { min-height: 100svh; display: grid; place-items: center; background: var(--night); color: var(--on-night); text-align: center; padding: 16px; }
.lost__box img { margin: 0 auto 20px; border-radius: 50%; border: 2px solid var(--accent); }
.lost h1 { font-size: clamp(34px, 6vw, 56px); margin-bottom: 24px; }
.lost h1 em { color: var(--accent); }

/* ---- Reveal (only with JS and motion) ---- */
html.js:not(.rm) .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
html.js:not(.rm) .reveal.seen { opacity: 1; transform: none; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .cards, .gallery { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .coin { grid-template-columns: 1fr; gap: 36px; }
  .coin__img { max-width: 320px; }
}
@media (max-width: 760px) {
  .burger { display: flex; }
  .top > .pill { display: none; }
  .nav { position: absolute; top: 68px; left: 16px; right: 16px; flex-direction: column; align-items: stretch; gap: 4px; padding: 12px; border-radius: 18px; background: rgba(0, 0, 0, .92); display: none; }
  .nav.is-open { display: flex; }
  .nav > a:not(.pill) { padding: 12px; }
  .hero__copy { padding-bottom: 40px; }
  .story, .play { padding: 72px 0; }
  .coin { padding-top: 72px; padding-bottom: 72px; margin-top: 72px; }
}
@media (max-width: 480px) {
  .gallery { grid-template-columns: 1fr; }
}
