/* Sprachstube: a warm, lamp-lit room for language courses.
   Paper + espresso ink + terracotta; every course is a tilted postcard with its own pattern. */

/* ---------- Fonts (self-hosted subsets, see scripts/build-fonts.py) ---------- */
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/assets/fraunces-normal-9f549dff.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/assets/fraunces-ext-normal-f66f3a9f.woff2") format("woff2");
  unicode-range: U+0100-0101, U+0112-0113, U+012A-012B, U+014C-014D, U+016A-016B; }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 400 800; font-display: swap;
  src: url("/assets/fraunces-italic-17fe05c3.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 400 800; font-display: swap;
  src: url("/assets/fraunces-ext-italic-7ceb0cc1.woff2") format("woff2");
  unicode-range: U+0100-0101, U+0112-0113, U+012A-012B, U+014C-014D, U+016A-016B; }
/* Fraunces has no pinyin caron vowels (ǎ ǐ ǒ ǔ); these come from Noto Serif at the same weights. */
@font-face { font-family: "Caron Fallback"; font-weight: 400 800; font-display: swap;
  src: url("/assets/fallback-caron-a6e476d2.woff2") format("woff2"); unicode-range: U+01CD-01DC; }
@font-face { font-family: "Nunito"; font-weight: 400 800; font-display: swap;
  src: url("/assets/nunito-beb0d9b4.woff2") format("woff2"); }
/* Big greetings on the postcards: only the handful of glyphs used, in three scripts. */
@font-face { font-family: "Stube Glyphs"; font-weight: 500; font-display: swap;
  src: url("/assets/glyphs-greek-a4f88e8f.woff2") format("woff2"); unicode-range: U+0370-03FF, U+1F00-1FFF; }
@font-face { font-family: "Stube Glyphs"; font-weight: 600; font-display: swap;
  src: url("/assets/glyphs-hanzi-200af0ca.woff2") format("woff2"); unicode-range: U+4E00-9FFF, U+FF01; }
@font-face { font-family: "Stube Glyphs"; font-weight: 600; font-display: swap;
  src: url("/assets/glyphs-kana-0cd353ca.woff2") format("woff2"); unicode-range: U+3040-309F; }

/* ---------- Tokens ---------- */
:root {
  --paper: #fbf3e4;
  --paper-2: #f3e5cb;
  --card: #fffaf0;
  --ink: #3a2a21;
  --ink-soft: #6b5445;
  --line: #e6d5b8;
  --terracotta: #b4452d;
  --terracotta-ink: #fff8ec;   /* text on terracotta buttons */
  --honey: #e3a02f;
  --glow: rgba(240, 170, 80, 0.30);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 14px 34px -16px rgba(94, 55, 28, 0.45), 0 2px 6px rgba(94, 55, 28, 0.12);
  --shadow-hover: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 26px 44px -18px rgba(94, 55, 28, 0.55), 0 4px 10px rgba(94, 55, 28, 0.14);
  --grain-opacity: 0.35;

  --serif: "Fraunces", "Caron Fallback", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --glyph: "Stube Glyphs", "Fraunces", "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif CJK JP", "Songti SC", Georgia, serif;
  --sans: "Nunito", system-ui, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(18px, 4.5vw, 44px);
  --maxw: 1180px;
  --radius: 22px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #1f1511;
  --paper-2: #2a1d16;
  --card: #2f221a;
  --ink: #f6e9d4;
  --ink-soft: #cdb89f;
  --line: #4a3629;
  --terracotta: #ee8f72;       /* lighter, so text stays readable on the dark paper */
  --terracotta-ink: #2a140c;
  --honey: #f0b546;
  --glow: rgba(255, 168, 70, 0.26);
  --shadow: 0 1px 0 rgba(255, 220, 170, 0.06) inset, 0 16px 36px -14px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 1px 0 rgba(255, 220, 170, 0.08) inset, 0 28px 48px -16px rgba(0, 0, 0, 0.8), 0 4px 10px rgba(0, 0, 0, 0.45);
  --grain-opacity: 0.22;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1f1511;
    --paper-2: #2a1d16;
    --card: #2f221a;
    --ink: #f6e9d4;
    --ink-soft: #cdb89f;
    --line: #4a3629;
    --terracotta: #ee8f72;
    --terracotta-ink: #2a140c;
    --honey: #f0b546;
    --glow: rgba(255, 168, 70, 0.26);
    --shadow: 0 1px 0 rgba(255, 220, 170, 0.06) inset, 0 16px 36px -14px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 1px 0 rgba(255, 220, 170, 0.08) inset, 0 28px 48px -16px rgba(0, 0, 0, 0.8), 0 4px 10px rgba(0, 0, 0, 0.45);
    --grain-opacity: 0.22;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s ease, color 0.5s ease;
  overflow-x: hidden;
}
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
svg { display: block; }
:focus-visible { outline: 3px solid var(--terracotta); outline-offset: 3px; border-radius: 8px; }

.skip {
  position: absolute; left: var(--gutter); top: -60px; z-index: 50;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; text-decoration: none;
  transition: top 0.2s ease;
}
.skip:focus { top: 12px; }

/* Warm lamp light + paper grain sit behind everything. */
.glow {
  position: fixed; inset: -20% -10% auto auto; width: min(900px, 120vw); height: min(900px, 120vw);
  background: radial-gradient(closest-side, var(--glow), transparent 72%);
  pointer-events: none; z-index: 0; transition: opacity 0.6s ease;
  animation: breathe 7s ease-in-out infinite;
}
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 60; opacity: var(--grain-opacity); mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .32  0 0 0 0 .2  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
:root[data-theme="dark"] .grain { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .grain { mix-blend-mode: screen; } }

main, .top, .foot { position: relative; z-index: 1; }
.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Top bar ---------- */
.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-weight: 650; font-size: 1.3rem; letter-spacing: -0.01em; }
.brand svg { width: 34px; height: 34px; }
.lamp {
  display: none; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px 8px 12px;
  border: 1.5px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--card) 70%, transparent);
  color: var(--ink); font: 700 0.9rem/1 var(--sans); cursor: pointer; transition: background-color 0.3s, border-color 0.3s, transform 0.2s;
}
.js .lamp { display: inline-flex; }
.lamp:hover { border-color: var(--honey); transform: translateY(-1px); }
.lamp svg { width: 22px; height: 22px; color: var(--honey); }
.lamp .lamp__light { transition: opacity 0.4s; opacity: 0.25; }
.lamp[aria-pressed="true"] .lamp__light { opacity: 1; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(8px, 4vw, 56px); align-items: center; padding: clamp(18px, 5vw, 64px) 0 clamp(8px, 2vw, 24px); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--terracotta); margin-bottom: 18px; }
.eyebrow::before { content: ""; width: 34px; height: 2px; background: currentColor; border-radius: 2px; }
h1 {
  font-family: var(--serif); font-weight: 650; font-size: clamp(2.7rem, 6.4vw, 5.4rem); line-height: 1.02; letter-spacing: -0.025em;
  text-wrap: balance;
}
h1 em {
  font-style: italic; font-weight: 600; color: var(--terracotta); position: relative; white-space: nowrap;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'><path d='M2 7 Q 25 1 50 6 T 100 6 T 150 6 T 198 5' fill='none' stroke='%23e3a02f' stroke-width='3.5' stroke-linecap='round'/></svg>") no-repeat 0 100% / 100% 0.2em;
  padding-bottom: 0.12em;
}
.lede { margin-top: 24px; max-width: 34em; font-size: clamp(1.08rem, 1.6vw, 1.28rem); color: var(--ink-soft); text-wrap: pretty; }

.hero__art { position: relative; justify-self: center; width: min(100%, 360px); aspect-ratio: 1 / 0.95; container-type: inline-size; }
.hero__art > svg { width: 100%; height: 100%; overflow: visible; }
.steam path { fill: none; stroke: var(--ink-soft); stroke-width: 6; stroke-linecap: round; opacity: 0; animation: steam 4.2s ease-in-out infinite; transform-origin: center bottom; }
.steam path:nth-child(2) { animation-delay: 1.3s; }
.steam path:nth-child(3) { animation-delay: 2.5s; }
.sign {
  position: absolute; right: -2%; top: 0; width: 62%; padding: 12px 10px 10px; text-align: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--honey) 92%, #fff), var(--honey));
  color: #3a2a21; border-radius: 12px; box-shadow: var(--shadow); rotate: 3.5deg; transform-origin: 50% -22px;
  animation: sway 6s ease-in-out infinite;
}
.sign::before, .sign::after { content: ""; position: absolute; top: -22px; width: 2px; height: 24px; background: var(--ink-soft); }
.sign::before { left: 22%; rotate: -8deg; } .sign::after { right: 22%; rotate: 8deg; }
.sign__word { display: block; white-space: nowrap; font-family: var(--glyph); font-weight: 600; font-size: clamp(1.3rem, 8.5cqw, 2rem); line-height: 1.2; transition: opacity 0.35s ease, translate 0.35s ease; }
.sign__lang { display: block; margin-top: 2px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.75; transition: opacity 0.35s ease; }
.sign.is-swapping .sign__word { opacity: 0; translate: 0 6px; }
.sign.is-swapping .sign__lang { opacity: 0; }

/* Teacup illustration (hero + logo), coloured through the tokens so it follows the theme. */
.cup-body { fill: var(--terracotta); }
.cup-handle { stroke: var(--terracotta); }
.cup-band { stroke: var(--card); stroke-opacity: 0.45; }
.cup-rim { fill: color-mix(in srgb, var(--terracotta) 80%, #000); }
.tea { fill: #5a2f1c; }
.tea-shine { fill: #fff; opacity: 0.2; }
.saucer { fill: var(--paper-2); stroke: var(--line); stroke-width: 3; }
.saucer-well { fill: var(--line); opacity: 0.55; }
.table-shadow { fill: #000; opacity: 0.1; }
.steam-mini { stroke: var(--honey); }
.brand .saucer { stroke-width: 1.5; }

/* ---------- Goal picker ---------- */
.picker { display: none; padding: 26px 0 6px; }
.js .picker { display: block; }
.picker h2 { font-family: var(--serif); font-weight: 650; font-size: 1.35rem; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  min-height: 44px; padding: 8px 20px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card);
  color: var(--ink); font: 700 0.98rem/1 var(--sans); cursor: pointer; transition: transform 0.2s, background-color 0.25s, border-color 0.25s, color 0.25s;
}
.chip:hover { border-color: var(--terracotta); transform: translateY(-2px) rotate(-1deg); }
.chip[aria-pressed="true"] { background: var(--terracotta); border-color: var(--terracotta); color: var(--terracotta-ink); }
.picker__status { margin-top: 12px; min-height: 1.6em; color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- Shelves ---------- */
.shelf { padding: clamp(28px, 5vw, 56px) 0 0; }
.shelf__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 18px; margin-bottom: clamp(22px, 3vw, 34px); }
.shelf__head h2 { font-family: var(--serif); font-weight: 650; font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -0.015em; }
.shelf__head h2 span { color: var(--terracotta); font-style: italic; font-weight: 600; }
.shelf__head p { color: var(--ink-soft); max-width: 36em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: clamp(26px, 3.4vw, 40px) clamp(20px, 2.8vw, 32px); }

/* ---------- Postcards ---------- */
.card {
  --tilt: 0deg; --i: 0;
  position: relative; display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--line);
  rotate: var(--tilt); translate: 0 0;
  animation: rise 0.8s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i) * 110ms + 150ms);
  transition: translate 0.35s cubic-bezier(.2, .8, .2, 1), rotate 0.35s cubic-bezier(.2, .8, .2, 1), box-shadow 0.35s, opacity 0.4s, filter 0.4s, scale 0.4s;
}
.cards > li:nth-child(3n + 1) { --tilt: -0.7deg; --i: 0; }
.cards > li:nth-child(3n + 2) { --tilt: 0.55deg; --i: 1; }
.cards > li:nth-child(3n + 3) { --tilt: -0.35deg; --i: 2; }
.card--live:hover, .card--live:focus-within { translate: 0 -8px; rotate: 0deg; box-shadow: var(--shadow-hover); }
.card[inert] { opacity: 0.32; filter: grayscale(0.7); scale: 0.97; }

.card__top { position: relative; }
.card__art { position: relative; height: 168px; border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; overflow: hidden; }
.card__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(255, 255, 255, 0.12), transparent 40%, rgba(40, 20, 8, 0.2)); }
.tape {
  position: absolute; z-index: 3; top: -6px; left: 22px; width: 84px; height: 26px; rotate: -5deg;
  background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--tape, var(--honey)) 78%, transparent) 0 8px, color-mix(in srgb, var(--tape, var(--honey)) 52%, transparent) 8px 16px);
  box-shadow: 0 1px 3px rgba(60, 30, 10, 0.25);
  clip-path: polygon(0 8%, 4% 0, 8% 10%, 12% 0, 16% 8%, 84% 8%, 88% 0, 92% 10%, 96% 0, 100% 8%, 100% 92%, 96% 100%, 92% 90%, 88% 100%, 84% 92%, 16% 92%, 12% 100%, 8% 90%, 4% 100%, 0 92%);
}
.stamp {
  position: absolute; z-index: 3; top: 16px; right: 16px; rotate: 7deg; padding: 5px 12px 4px;
  font: 800 0.74rem/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--stamp, var(--terracotta));
  background: color-mix(in srgb, var(--card) 88%, transparent); border: 2px solid currentColor; border-radius: 8px;
  outline: 2px solid color-mix(in srgb, currentColor 40%, transparent); outline-offset: 2px;
}
/* The rubber stamp keeps its course colour in daylight; at night it is lightened so it still reads. */
:root[data-theme="dark"] .stamp { color: color-mix(in srgb, var(--stamp, var(--terracotta)) 45%, #fff); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stamp { color: color-mix(in srgb, var(--stamp, var(--terracotta)) 45%, #fff); } }
.greeting {
  position: absolute; z-index: 2; left: 18px; bottom: -26px; max-width: calc(100% - 36px); rotate: -2deg;
  padding: 10px 18px 9px; background: var(--card); border-radius: 14px; border: 1px solid var(--line);
  box-shadow: 0 8px 18px -8px rgba(60, 30, 10, 0.45);
}
.greeting__text { display: block; font-family: var(--glyph); font-weight: 600; font-size: 2rem; line-height: 1.15; color: var(--ink); }
.greeting__gloss { display: block; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }

.card__body { display: flex; flex: 1; flex-direction: column; padding: 46px 22px 22px; gap: 6px; }
.card__pair { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.card__pair svg { width: 16px; height: 16px; }
.badge { margin-left: auto; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--honey) 28%, transparent); color: var(--ink); letter-spacing: 0.06em; font-size: 0.7rem; }
.card__title { font-family: var(--serif); font-weight: 650; font-size: 1.75rem; line-height: 1.12; letter-spacing: -0.015em; margin-top: 4px; }
.card__title a { text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); z-index: 4; }   /* whole card is the link */
.card__native { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--terracotta); font-size: 1.05rem; }
.card__native[lang="el"] { font-family: var(--glyph); font-style: normal; font-size: 1.12rem; }
.card__blurb { margin-top: 8px; color: var(--ink-soft); text-wrap: pretty; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.facts li { padding: 4px 12px; border-radius: 999px; background: var(--paper-2); font-size: 0.84rem; font-weight: 700; }
.card__note { margin-top: 10px; padding: 8px 12px; border-left: 3px solid var(--honey); background: color-mix(in srgb, var(--honey) 12%, transparent); border-radius: 4px 10px 10px 4px; font-size: 0.9rem; }
.card__cta {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 10px; margin-top: auto; padding: 12px 20px 12px 22px; min-height: 44px;
  border-radius: 999px; background: var(--terracotta); color: var(--terracotta-ink); font-weight: 800; transition: gap 0.25s, padding 0.25s;
}
.card__body > :nth-last-child(2) { margin-bottom: 20px; }
.card__cta svg { width: 18px; height: 18px; transition: translate 0.25s; }
.card--live:hover .card__cta svg, .card--live:focus-within .card__cta svg { translate: 5px 0; }

/* Upcoming courses: same postcard, a little hazier, with an honest progress track. */
.card--soon .card__art { filter: saturate(0.78) brightness(0.98); }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 18px; }
.steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 0.7rem; font-weight: 700; color: var(--ink-soft); text-align: center; }
.steps li::before { content: ""; position: absolute; top: 9px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.steps li:first-child::before { display: none; }
.steps li.done::before, .steps li.current::before { background: var(--terracotta); }
.steps .dot { position: relative; z-index: 1; width: 20px; height: 20px; border-radius: 50%; background: var(--card); border: 2px solid var(--line); display: grid; place-items: center; }
.steps li.done .dot { background: var(--terracotta); border-color: var(--terracotta); color: var(--terracotta-ink); }
.steps li.done .dot svg { width: 11px; height: 11px; }
.steps li.current { color: var(--ink); }
.steps li.current .dot { border-color: var(--terracotta); animation: pulse 2.2s ease-out infinite; }
.steps li.current .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--terracotta); }
.progress__label { margin-top: 12px; font-weight: 700; font-size: 0.95rem; }
.progress__label::before { content: "🥖 "; }

/* ---------- Patterns, one per course ---------- */
.theme-aegean { --tape: #2e6485; --stamp: #2e6485; }
.theme-aegean .card__art {
  background-color: #2e6485;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='36' height='28'><path d='M0 25 H36 M4 25 V4 H32 V19 H14 V11 H23' fill='none' stroke='%23f6eedd' stroke-opacity='.55' stroke-width='3' stroke-linecap='square' stroke-linejoin='miter'/></svg>"),
    radial-gradient(120% 90% at 20% 0%, #3d7aa0, #2e6485 60%, #234f6b);
  background-size: 36px 28px, 100% 100%; background-position: 4px 6px, 0 0; background-repeat: repeat-x, no-repeat;
}
.theme-lacquer { --tape: #c9962f; --stamp: #9a2f23; }
.theme-lacquer .card__art {
  background-color: #8f2f25;
  background-image:
    radial-gradient(circle at 78% 52%, transparent 0 46px, rgba(227, 176, 75, 0.9) 46px 49px, transparent 49px),
    radial-gradient(circle at 78% 52%, transparent 0 58px, rgba(227, 176, 75, 0.35) 58px 60px, transparent 60px),
    linear-gradient(rgba(227, 176, 75, 0.28) 2px, transparent 2px), linear-gradient(90deg, rgba(227, 176, 75, 0.28) 2px, transparent 2px),
    radial-gradient(120% 90% at 20% 0%, #a53a2e, #8f2f25 60%, #732219);
  background-size: auto, auto, 30px 30px, 30px 30px, 100% 100%;
}
.theme-weissblau { --tape: #3f7fb5; --stamp: #2f6aa0; }
.theme-weissblau .card__art {
  background-color: #f4f0e4;
  background-image: linear-gradient(45deg, #4d8abf 25%, transparent 25%, transparent 75%, #4d8abf 75%), linear-gradient(45deg, #4d8abf 25%, transparent 25%, transparent 75%, #4d8abf 75%);
  background-size: 44px 44px; background-position: 0 0, 22px 22px;
}
.theme-sun { --tape: #d9822f; --stamp: #b5471f; }
.theme-sun .card__art {
  background-color: #f2b560;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='44' height='14'><path d='M0 8 Q 11 0 22 8 T 44 8' fill='none' stroke='%23f6eedd' stroke-opacity='.7' stroke-width='2.5' stroke-linecap='round'/></svg>"),
    linear-gradient(to top, #2e6485 0 38%, transparent 38%),
    radial-gradient(circle at 76% 38%, #fff3cf 0 28px, rgba(255, 243, 207, 0.35) 29px 44px, transparent 45px),
    linear-gradient(#f7c872, #ee8f58);
  background-size: 44px 14px, 100% 100%, 100% 100%, 100% 100%; background-position: 0 66%, 0 0, 0 0, 0 0; background-repeat: repeat-x, no-repeat, no-repeat, no-repeat;
}
.theme-awning { --tape: #6f7b45; --stamp: #a8412a; }
.theme-awning .card__art {
  background-color: #f6eedd;
  background-image: repeating-linear-gradient(90deg, #c4573a 0 30px, #f6eedd 30px 60px);
}
.theme-awning .card__art::before {   /* scalloped awning edge */
  content: ""; position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; height: 18px;
  background: radial-gradient(circle at 15px 0, transparent 14px, var(--card) 15px) 0 0 / 30px 18px repeat-x;
}
.theme-indigo { --tape: #cf7a82; --stamp: #2f4468; }
.theme-indigo .card__art {
  background-color: #2f4468;
  background-image:
    radial-gradient(circle at 100% 150%, #2f4468 24%, #f1e9d6 25%, #f1e9d6 28%, #2f4468 29%, #2f4468 36%, #f1e9d6 36%, #f1e9d6 40%, transparent 40%, transparent),
    radial-gradient(circle at 0 150%, #2f4468 24%, #f1e9d6 25%, #f1e9d6 28%, #2f4468 29%, #2f4468 36%, #f1e9d6 36%, #f1e9d6 40%, transparent 40%, transparent),
    radial-gradient(circle at 50% 100%, #f1e9d6 10%, #2f4468 11%, #2f4468 23%, #f1e9d6 24%, #f1e9d6 30%, #2f4468 31%, #2f4468 43%, #f1e9d6 44%, #f1e9d6 50%, #2f4468 51%, #2f4468 63%, #f1e9d6 64%, #f1e9d6 71%, transparent 71%, transparent),
    radial-gradient(circle at 100% 50%, #f1e9d6 5%, #2f4468 6%, #2f4468 15%, #f1e9d6 16%, #f1e9d6 20%, #2f4468 21%, #2f4468 30%, #f1e9d6 31%, #f1e9d6 35%, #2f4468 36%, #2f4468 45%, #f1e9d6 46%, #f1e9d6 49%, transparent 50%, transparent),
    radial-gradient(circle at 0 50%, #f1e9d6 5%, #2f4468 6%, #2f4468 15%, #f1e9d6 16%, #f1e9d6 20%, #2f4468 21%, #2f4468 30%, #f1e9d6 31%, #f1e9d6 35%, #2f4468 36%, #2f4468 45%, #f1e9d6 46%, #f1e9d6 49%, transparent 50%, transparent);
  background-size: 60px 30px;
}

/* ---------- 404 ---------- */
.lost { display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(40px, 9vw, 110px) 0; }
.lost svg { width: min(60vw, 240px); margin-bottom: 18px; overflow: visible; }
.lost .lede { margin-bottom: 28px; }
.tea-empty { fill: color-mix(in srgb, var(--terracotta) 55%, #000); }

/* ---------- Good to know ---------- */
.know { padding: clamp(44px, 7vw, 88px) 0 0; }
.know__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 18px; }
.know__item { padding: 22px 22px 24px; border-radius: var(--radius); background: color-mix(in srgb, var(--paper-2) 70%, transparent); border: 1.5px dashed var(--line); }
.know__item svg { width: 34px; height: 34px; color: var(--terracotta); margin-bottom: 10px; }
.know__item h3 { font-family: var(--serif); font-weight: 650; font-size: 1.25rem; margin-bottom: 4px; }
.know__item p { color: var(--ink-soft); font-size: 0.98rem; text-wrap: pretty; }

/* ---------- Footer ---------- */
.foot { margin-top: clamp(48px, 8vw, 96px); padding: 34px 0 calc(40px + env(safe-area-inset-bottom)); border-top: 1.5px solid var(--line); color: var(--ink-soft); font-size: 0.92rem; }
.foot__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 32px; }
.foot strong { color: var(--ink); font-family: var(--serif); font-size: 1.05rem; }

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; translate: 0 26px; } to { opacity: 1; translate: 0 0; } }
@keyframes steam { 0% { opacity: 0; transform: translateY(14px) scaleY(0.8); } 25% { opacity: 0.55; } 100% { opacity: 0; transform: translateY(-34px) scaleY(1.15); } }
@keyframes sway { 0%, 100% { rotate: 3.5deg; } 50% { rotate: 1deg; } }
@keyframes breathe { 0%, 100% { opacity: 0.85; } 50% { opacity: 1; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--terracotta) 55%, transparent); } 80%, 100% { box-shadow: 0 0 0 10px transparent; } }
.hero__text > * { animation: rise 0.9s cubic-bezier(.2, .8, .2, 1) both; }
.hero__text > :nth-child(2) { animation-delay: 0.1s; }
.hero__text > :nth-child(3) { animation-delay: 0.2s; }
.hero__art { animation: rise 1s 0.25s cubic-bezier(.2, .8, .2, 1) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .steam path { opacity: 0.35; }
}

/* ---------- Small screens ---------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero__art { width: min(78%, 320px); margin-top: 6px; }
  .lamp span { display: none; }
  .lamp { padding: 8px 12px; }
}
@media (max-width: 420px) {
  .card__art { height: 150px; }
  .greeting__text { font-size: 1.7rem; }
  .card__title { font-size: 1.55rem; }
  .steps li { font-size: 0.64rem; }
}
