/* All the Presents! - design system: tokens, type, header, footer, buttons.
   Storybook look of the game: cream paper, pine, candy red, gold, over a night sky. Light and dark follow the device.
   Self-only: no external fonts, images or scripts. The landing page adds css/home.css on top of this file. */

@font-face { font-family: "Alegreya"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/alegreya-400.woff2?v=65ccb61acb") format("woff2"); }
@font-face { font-family: "Alegreya"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/assets/fonts/alegreya-700.woff2?v=f10147ab49") format("woff2"); }
@font-face { font-family: "ATP Display"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/atp-display-400.woff2?v=e60e42a2dc") format("woff2"); }

:root {
  color-scheme: light dark;

  /* ---- colour: light ("storybook paper") ---- */
  --paper: #f6ead3;
  --paper-deep: #ecdab6;
  --card: #fffaf0;
  --ink: #3b1f0f;
  --muted: #6b4a30;
  --line: #e4cfa9;
  --red: #b3261e;          /* candy red: buttons */
  --candy: #ee3b43;        /* the same candy red, brighter, for small marks on the night footer (the heart) */
  --red-deep: #7c160f;
  --red-ink: #fff7e6;      /* text on candy red */
  --link: #a8231b;
  --link-hover: #7c160f;
  --pine: #1f6b45;
  --pine-deep: #124a2e;
  --gold: #c98a1a;         /* borders and ornaments, never body text */
  --gold-light: #f2c25a;
  --cream: #fff7e6;
  --note-bg: #fdf1d6;
  --note-line: #e7c77d;
  --focus: #1b3a8a;
  --night: #010c43;        /* top of the village sky */
  --night-2: #142a8c;      /* horizon glow */
  --aurora: rgba(63, 214, 160, 0.35);
  --shadow: 0 1px 2px rgba(59, 31, 15, 0.08), 0 8px 28px rgba(59, 31, 15, 0.1);

  /* ---- type ---- */
  --display: "ATP Display", "Iowan Old Style", Palatino, Georgia, serif;
  --serif: "Alegreya", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --fs-body: clamp(1.125rem, 1.06rem + 0.3vw, 1.3125rem);
  --fs-small: 0.95rem;
  --fs-h3: clamp(1.35rem, 1.2rem + 0.6vw, 1.65rem);
  --fs-h2: clamp(1.9rem, 1.4rem + 2vw, 3rem);
  --fs-h1: clamp(2.4rem, 1.6rem + 3.4vw, 4.4rem);
  --lh-body: 1.55;

  /* ---- space, shape ---- */
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem; --sp-5: 1.5rem;
  --sp-6: 2rem; --sp-7: 3rem; --sp-8: 4.5rem; --sp-9: 7rem;
  --gutter: max(16px, env(safe-area-inset-left));
  --wrap: 72rem;
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b1430;
    --paper-deep: #070d24;
    --card: #142046;
    --ink: #f6ead3;
    --muted: #c8b797;
    --line: #2a3b72;
    --link: #ff9d8f;
    --link-hover: #ffc2b8;
    --pine: #7fdcb0;
    --gold: #f2c25a;
    --note-bg: #1c2a58;
    --note-line: #3d5196;
    --focus: #ffd978;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 32px rgba(0, 0, 0, 0.4);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: auto; background: var(--paper); }
body {
  margin: 0; min-height: 100vh;
  background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: var(--fs-body); line-height: var(--lh-body);
  overflow-wrap: break-word; text-rendering: optimizeLegibility;
}
img, picture, video { max-width: 100%; }
img { height: auto; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0 0 var(--sp-3); color: var(--ink); text-wrap: balance; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p, ul, ol { margin: 0 0 var(--sp-4); }
strong, b { font-weight: 700; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { color: var(--link-hover); }

/* Focus: a 3px ring that keeps 3:1 against both paper and night. */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--card); color: var(--ink); padding: 0.6rem 1rem; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.skip:focus { top: 0.75rem; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

/* ---- Buttons ----------------------------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--red); --btn-ink: var(--red-ink); --btn-line: var(--gold-light);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 3.25rem; padding: 0.7rem 1.6rem;
  font: 700 clamp(1.1rem, 1.02rem + 0.35vw, 1.3rem)/1.15 var(--serif); text-align: center; text-decoration: none;
  color: var(--btn-ink); background: var(--btn-bg);
  border: 3px solid var(--btn-line); border-radius: 999px;
  box-shadow: 0 3px 0 var(--red-deep), 0 10px 24px rgba(0, 0, 0, 0.3);
  cursor: pointer; transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), filter 0.15s;
}
.btn:hover { color: var(--btn-ink); filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--red-deep), 0 4px 12px rgba(0, 0, 0, 0.3); }
.btn .btn-icon { width: 1.35em; height: 1.35em; flex: none; }
/* Cream button for the second action */
.btn--cream { --btn-bg: var(--cream); --btn-ink: #3b1f0f; --btn-line: var(--gold-light); box-shadow: 0 3px 0 #c8a56a, 0 10px 24px rgba(0, 0, 0, 0.25); }
.btn--cream:hover { color: #3b1f0f; }
/* "Not yet": visible, readable, not a link */
.btn--soon {
  --btn-bg: rgba(1, 12, 67, 0.62); --btn-ink: #fff7e6; --btn-line: rgba(255, 247, 230, 0.6);
  box-shadow: none; cursor: default; border-style: dashed;
}
.btn--soon:hover, .btn--soon:active { filter: none; transform: none; box-shadow: none; }
.btn-note { display: block; font: 400 0.82rem/1.2 var(--serif); letter-spacing: 0.04em; opacity: 0.9; }

/* ---- Header ------------------------------------------------------------------------------------------------ */
.site-header { position: relative; z-index: 20; color: var(--cream); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding-block: 0.7rem; }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; color: inherit; text-decoration: none; font-family: var(--display); font-size: 1.3rem; line-height: 1; }
.brand:hover { color: inherit; }
.brand img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); }
.brand-name { display: none; }
@media (min-width: 30rem) { .brand-name { display: inline; } }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: inline-block; padding: 0.45rem 0.85rem; border-radius: 999px;
  color: inherit; text-decoration: none; font-weight: 700; font-size: 1.02rem; line-height: 1.2;
  background: rgba(255, 247, 230, 0.1); border: 1px solid rgba(255, 247, 230, 0.28);
}
.nav a:hover { background: rgba(255, 247, 230, 0.22); color: inherit; }
.nav-wide { display: none; }
@media (min-width: 56rem) { .nav-wide { display: list-item; } }
.nav a[aria-current="page"] { background: var(--cream); color: #3b1f0f; border-color: var(--cream); }
.site-header :focus-visible, .site-footer :focus-visible { --focus: #ffd978; }

/* Header laid over a hero (landing page) */
.site-header--overlay { position: absolute; inset: 0 0 auto 0; text-shadow: 0 1px 8px rgba(1, 12, 67, 0.7); }
/* Header as its own night-sky bar (inner pages) */
.site-header--bar {
  background:
    radial-gradient(ellipse 70% 120% at 85% 0%, var(--aurora), transparent 70%),
    radial-gradient(3px 3px at 20% 40%, #fff 0, rgba(255, 255, 255, 0.55) 40%, transparent 100%),
    radial-gradient(2.5px 2.5px at 62% 70%, #fff 0, rgba(255, 255, 255, 0.5) 40%, transparent 100%),
    radial-gradient(2.5px 2.5px at 88% 30%, #fff 0, rgba(255, 255, 255, 0.5) 40%, transparent 100%),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 140%);
  border-bottom: 4px solid var(--gold);
}

/* ---- Footer ------------------------------------------------------------------------------------------------ */
.site-footer {
  position: relative; color: var(--cream); font-size: 1.05rem;
  background: linear-gradient(180deg, #0a1550 0%, var(--night) 100%);
  border-top: 4px solid var(--gold);
  padding: var(--sp-7) 0 calc(var(--sp-6) + env(safe-area-inset-bottom));
}
.site-footer .wrap { display: grid; gap: var(--sp-5); }
.site-footer a { color: var(--cream); text-decoration-color: rgba(255, 247, 230, 0.5); }
.site-footer a:hover { color: #fff; text-decoration-color: currentColor; }
.foot-brand { display: flex; align-items: center; gap: 0.8rem; font-family: var(--display); font-size: 1.5rem; white-space: nowrap; }
.foot-brand img { width: 52px; height: 52px; border-radius: 13px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 1.4rem; list-style: none; margin: 0; padding: 0; font-weight: 700; }
.foot-links a { display: inline-block; padding: 0.55rem 0; } /* a 44 px tall target */
.foot-small { margin: 0; font-size: 0.95rem; opacity: 0.85; }
.foot-made { font-size: 1.05rem; opacity: 0.95; }
.heart { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -0.17em; fill: var(--candy); margin-inline: 0.05em; }
@media (min-width: 48rem) { .site-footer .wrap { grid-template-columns: 1fr auto; align-items: start; } .foot-small { grid-column: 1 / -1; } }

/* ---- Phone frame ---- */
.phone {
  position: relative; width: var(--phone-w, 15rem); padding: 1.35rem 0.6rem 1.25rem; margin: 0;
  border-radius: 2.4rem; background: linear-gradient(150deg, #3a2a1d 0%, #1a110b 60%, #0e0906 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.14), 0 0 0 2px #000, 0 28px 50px -18px rgba(0, 0, 0, 0.65), 0 0 60px -10px rgba(63, 214, 160, 0.18);
}
.phone::before { content: ""; position: absolute; top: 0.5rem; left: 50%; width: 26%; height: 0.32rem; translate: -50% 0; border-radius: 99px; background: #000; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); }
.phone .screen { position: relative; aspect-ratio: 720 / 1560; overflow: hidden; border-radius: 1.7rem; background: #050a2b; }
.phone .screen :is(video, img) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.phone .screen picture { display: contents; }
/* a loop is a still picture until the script has it playing; then the video fades in over the still */
.phone .screen video.loop { opacity: 0; transition: opacity 0.4s; }
.phone .screen video.loop.is-playing { opacity: 1; }

/* ---- The Android switch: <html data-android-beta="off|on"> (tools/android_beta.py flips it with the texts that follow it) ----------
   Anything marked data-android-on shows only when the Android beta is open, anything marked data-android-off only while it is not. */
html[data-android-beta="off"] [data-android-on], html[data-android-beta="on"] [data-android-off] { display: none !important; }

/* ---- Question rows (<details><summary>) --------------------------------------------------------------------
   The browser's own triangle is hidden and a chevron is drawn inside the card, on the right edge, in the link colour (candy red). It
   points right when closed and down when open; the whole row is the button. Reduced motion: no rotation animation (the global rule
   below drops transitions), just the end state. */
.faq summary, .page details > summary {
  display: block; position: relative; list-style: none; cursor: pointer; padding-inline-end: 2.1rem; text-wrap: pretty;
}
.faq summary::-webkit-details-marker, .page details > summary::-webkit-details-marker { display: none; }
.faq summary::marker, .page details > summary::marker { content: ""; }
.faq summary::after, .page details > summary::after {
  content: ""; position: absolute; inset-inline-end: 0.2rem; top: 50%; width: 0.6rem; height: 0.6rem; box-sizing: border-box;
  border-right: 0.18rem solid var(--link); border-bottom: 0.18rem solid var(--link); border-radius: 0.04rem;
  transform: translateY(-50%) rotate(-45deg); transition: transform 0.18s var(--ease);
}
.faq details[open] > summary::after, .page details[open] > summary::after { transform: translateY(-72%) rotate(45deg); }
.faq summary:hover::after, .page details > summary:hover::after { border-color: var(--link-hover); }

/* ---- Motion ------------------------------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer { background: none; color: #000; border: 0; }
  .btn { box-shadow: none; }
}
