/* My Tiny Zoo website. The app's colours (src/theme) and its heading font; nothing is
   loaded from other sites. Light by day, the app's "night sky" when the device is dark.
   Written by hand: the pages are built by scripts/site/build.ts. */
@font-face {
  font-family: 'Fredoka';
  src: url('/fonts/fredoka-600.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --background: #fff8e7;
  --surface: #ffffff;
  --surface-alt: #ffefc2;
  --sky: #cdeefc;
  --text: #3a2614;
  --text-muted: #755a40;
  --text-on-primary: #3a2614;
  --primary: #4db6ec;
  --link: #1c6fae;
  --accent: #ffc93c;
  --grass: #7cc242;
  --tangerine: #ff8a3d;
  --border: #eadbb8;
  --outline: #3a2614;
  --focus: #1f6fb2;
  --privacy: #e3f4d3;
  --privacy-text: #2f5e14;
  --radius-md: 18px;
  --radius-lg: 28px;
}
/* Dark: the device's setting, unless the visitor picked light or dark with the switch
   (theme.js sets data-theme on <html>). The two blocks hold the same values. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --background: #10202f;
    --surface: #192c3f;
    --surface-alt: #233a50;
    --sky: #1b3a55;
    --text: #fff6e3;
    --text-muted: #b4c4d3;
    --primary: #5cc0f2;
    --link: #8fd3fa;
    --border: #34506a;
    --outline: #08131d;
    --focus: #ffd866;
    --privacy: #1d3a24;
    --privacy-text: #bde8a0;
    --field-border: #6f8aa3;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --background: #10202f;
  --surface: #192c3f;
  --surface-alt: #233a50;
  --sky: #1b3a55;
  --text: #fff6e3;
  --text-muted: #b4c4d3;
  --primary: #5cc0f2;
  --link: #8fd3fa;
  --border: #34506a;
  --outline: #08131d;
  --focus: #ffd866;
  --privacy: #1d3a24;
  --privacy-text: #bde8a0;
  --field-border: #6f8aa3;
}
:root[data-theme='light'] { color-scheme: light; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, 'Segoe UI', sans-serif;
}
h1, h2, h3, .brand, .button { font-family: 'Fredoka', system-ui, sans-serif; font-weight: 600; }
h1, h2, h3 { line-height: 1.15; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); }
a:focus-visible, .button:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 10px; }
.skip:focus { left: 12px; }

/* Buttons: a bright fill, a 2px outline and a hard drop, as in the app. */
.button {
  display: inline-block; margin: 6px 0; padding: 14px 26px;
  border: 2px solid var(--outline); border-radius: 999px; box-shadow: 0 4px 0 var(--outline);
  background: var(--primary); color: var(--text-on-primary);
  font-size: 18px; text-align: center; text-decoration: none; cursor: pointer;
}
.button:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--outline); }
.button.secondary { background: var(--surface-alt); color: var(--text); }

.promise {
  background: var(--privacy); color: var(--privacy-text);
  border-radius: var(--radius-md); padding: 14px 18px; font-weight: 600;
}

/* ---- header and footer ---- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  max-width: 1080px; margin: 0 auto; padding: 18px 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 21px; }
.brand img, .foot img { border-radius: 22%; border: 2px solid var(--outline); box-shadow: 0 3px 0 var(--outline); }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-weight: 600; }
.nav a { color: var(--text); text-decoration: none; }
.nav a:hover { text-decoration: underline; }
/* Logo, menu, then the light/dark switch; on phones the switch sits next to the logo. */
.top { justify-content: flex-start; }
.top .nav { margin-left: auto; align-items: center; }
@media (max-width: 640px) {
  .top .theme-switch { order: 2; margin-left: auto; }
  .top .nav { order: 3; flex-basis: 100%; margin-left: 0; }
}
.nav .lang { padding: 2px 12px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--border); }
.theme-switch {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; cursor: pointer;
  border-radius: 50%; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text);
}
.theme-switch:hover { border-color: var(--text-muted); }
.theme-switch:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.theme-switch svg { fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.theme-switch .sun path { fill: none; }
.theme-switch .moon { stroke: none; }
.theme-switch .sun, .theme-switch[aria-checked='true'] .moon { display: none; }
.theme-switch[aria-checked='true'] .sun { display: block; }
.foot {
  max-width: 1080px; margin: 48px auto 0; padding: 32px 20px 48px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 15px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 28px 48px;
}
.foot p { margin: 6px 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.foot .small { font-size: 13px; }
.foot .social a {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-alt); border: 1px solid var(--border); color: var(--text);
}
.foot .social a:hover { border-color: var(--text-muted); }
.foot .social a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.foot .social { gap: 8px; }

/* ---- home ---- */
main section { max-width: 1080px; margin: 0 auto; padding: 40px 20px; }
main h2 { font-size: clamp(28px, 4vw, 38px); margin: 0 0 12px; }
.section-lead { color: var(--text-muted); margin: 0 0 24px; max-width: 640px; }

.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding-top: 24px; }
.hero h1 { font-size: clamp(36px, 5.5vw, 58px); margin: 0 0 18px; }
.hero .lead { font-size: 19px; color: var(--text-muted); margin: 0 0 24px; max-width: 560px; }
.hero-art picture img {
  border-radius: var(--radius-lg); border: 3px solid var(--outline); box-shadow: 0 8px 0 var(--outline);
  aspect-ratio: 1; width: 100%;
}
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.soon { display: inline-block; margin: 0; padding: 10px 18px; border-radius: 999px; background: var(--accent); color: #3a2614; font-weight: 700; }

/* Waitlist signup (hero and footer): a pill field next to the app's button. */
.waitlist { margin: 22px 0 0; max-width: 540px; }
.waitlist > label { display: block; font-weight: 700; margin: 0 0 8px; color: var(--text); }
.waitlist-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.waitlist input[type='email'] {
  flex: 1 1 220px; min-width: 0; padding: 13px 20px; font: inherit; font-size: 17px;
  border: 2px solid var(--field-border, var(--outline)); border-radius: 999px; background: var(--surface); color: var(--text);
}
.waitlist input[type='email']::placeholder { color: var(--text-muted); opacity: 1; }
.waitlist input[type='email']:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.waitlist .button { flex: 0 0 auto; margin: 0 0 4px; font-family: 'Fredoka', system-ui, sans-serif; }
.waitlist .button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.waitlist .button:disabled { opacity: 0.6; cursor: progress; }
.waitlist-note { margin: 10px 0 0; font-size: 14px; color: var(--text-muted); }
.waitlist-status { margin: 12px 0 0; font-weight: 600; border-radius: var(--radius-md); }
.waitlist-status:empty { display: none; }
.waitlist-status.done { background: var(--privacy); color: var(--privacy-text); padding: 10px 14px; }
.waitlist-status.error { background: var(--surface-alt); color: var(--text); border: 2px solid var(--tangerine); padding: 10px 14px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.foot .waitlist { margin: 0; flex: 0 1 480px; }
.foot .waitlist p { display: block; }
@media (max-width: 640px) {
  .waitlist .button { flex: 1 1 100%; }
  .foot .waitlist { flex-basis: 100%; order: -1; } /* on a phone, the signup comes first */
}

.promise-section { background: var(--sky); border-radius: var(--radius-lg); max-width: 1040px; }
.promise-section .promise { font-size: 19px; max-width: 720px; }
.checks { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 10px; }
.checks li { padding-left: 34px; position: relative; }
.checks li::before {
  content: '✓'; position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--grass); color: #3a2614; font-weight: 800; font-size: 14px; display: grid; place-items: center;
  border: 2px solid var(--outline);
}

.steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.steps li {
  counter-increment: step; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 22px; box-shadow: 0 6px 18px rgba(58, 38, 20, 0.08);
}
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 12px;
  border-radius: 50%; background: var(--accent); color: #3a2614; border: 2px solid var(--outline); box-shadow: 0 3px 0 var(--outline);
  font-family: 'Fredoka', system-ui, sans-serif; font-weight: 600; font-size: 22px;
}
.steps li:nth-child(2)::before { background: var(--primary); }
.steps li:nth-child(3)::before { background: var(--grass); }
.steps h3, .features h3 { font-size: 22px; margin: 0 0 6px; }
.steps p, .features p { margin: 0; color: var(--text-muted); }

.animals { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.animals figure { margin: 0; }
.animals img { aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-md); border: 2px solid var(--outline); box-shadow: 0 4px 0 var(--outline); }
.animals figcaption { margin-top: 10px; text-align: center; font-weight: 700; }

.features { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.features li { background: var(--surface-alt); border-radius: var(--radius-md); padding: 22px; }

.faq { display: grid; gap: 12px; max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 4px 20px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 700; font-size: 18px; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; font-family: 'Fredoka', system-ui, sans-serif; font-size: 24px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin: 0 0 16px; color: var(--text-muted); }

.cta { text-align: center; }
.cta p:not(.soon) { color: var(--text-muted); margin: 0 0 20px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .hero-art { max-width: 420px; }
  .steps, .features { grid-template-columns: 1fr; }
  .animals { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .animals { grid-template-columns: repeat(2, 1fr); }
  .nav { gap: 4px 14px; font-size: 15px; }
}

/* ---- a page of text: the privacy policy ---- */
.policy { max-width: 760px; margin: 0 auto; padding: 8px 20px 32px; }
.policy h1 { font-size: clamp(30px, 5vw, 40px); margin: 24px 0 8px; }
.policy h2 { font-size: 22px; margin: 32px 0 8px; }
.policy ul { padding-left: 22px; }
.policy li { margin: 6px 0; }
.policy mark.todo { background: var(--accent); color: #3a2614; border-radius: 4px; padding: 0 3px; }
.policy .draft { margin: 16px 0 0; padding: 10px 14px; border-radius: 14px; background: var(--accent); color: #3a2614; font-weight: 700; font-size: 15px; }
.crumbs { font-size: 14px; color: var(--text-muted); margin-top: 8px; }
.crumbs a { color: var(--text-muted); }

/* ---- not found ---- */
.lost { max-width: 520px; margin: 0 auto; padding: 64px 20px; text-align: center; }
.lost-icon { margin: 0 auto 16px; border-radius: 22%; border: 2px solid var(--outline); box-shadow: 0 4px 0 var(--outline); }
.lost section + section { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--border); }

/* ---- the invite page (i/) ---- */
body.invite { min-height: 100vh; display: grid; place-items: center; }
.invite main { width: min(420px, 100% - 48px); text-align: center; padding: 32px 0; }
.invite .icon { width: 112px; height: 112px; margin: 0 auto; border-radius: 25px; border: 2px solid var(--outline); box-shadow: 0 4px 0 var(--outline); }
.invite h1 { font-size: 30px; margin: 16px 0 12px; }
.invite p { margin: 0 0 20px; color: var(--text-muted); }
.invite .button { display: block; width: 100%; }
.invite .promise { margin-top: 20px; font-weight: 400; font-size: 15px; }
.invite .code { font-size: 15px; margin-top: 20px; }
.invite .code strong { color: var(--text); letter-spacing: 2px; }
.invite .legal { font-size: 14px; margin-top: 28px; }

@media print {
  .top nav, .policy .draft, .skip { display: none; }
}
