/* Tokens: the client's two palettes (ash-eci/app/globals.css) and the warm
   mood from src/EciCas.Host/appearances. Type is the client's: Chakra Petch
   for headings, IBM Plex for everything else. */
@font-face { font-family: "Chakra Petch"; font-weight: 600; font-display: swap; src: url("fonts/chakra-petch-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400 600; font-display: swap; src: url("fonts/plex-sans.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("fonts/plex-mono-400.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch Fallback"; src: local(Arial); ascent-override: 96.77%; descent-override: 30.05%; line-gap-override: 0%; size-adjust: 102.51%; }
@font-face { font-family: "IBM Plex Sans Fallback"; src: local(Arial); ascent-override: 101.32%; descent-override: 27.18%; line-gap-override: 0%; size-adjust: 101.17%; }

:root {
  color-scheme: light dark;
  --background: #ffffff;
  --foreground: #171717;
  --light: #fcd34d;
  --deep: #d97706;
  --accent-ink: #9a5a06;
  --housing: #07080c;
  --muted: color-mix(in srgb, var(--foreground) 72%, var(--background));
  --surface: color-mix(in srgb, var(--foreground) 4%, var(--background));
  --line: color-mix(in srgb, var(--foreground) 14%, var(--background));
  --display: "Chakra Petch", "Chakra Petch Fallback", ui-sans-serif, sans-serif;
  --sans: "IBM Plex Sans", "IBM Plex Sans Fallback", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 0.75rem;
  --gap: clamp(1rem, 3vw, 2rem);
}
@media (prefers-color-scheme: dark) {
  :root { --background: #0a0a0a; --foreground: #ededed; --accent-ink: #fcd34d; --surface: color-mix(in srgb, var(--foreground) 6%, var(--background)); }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--background); color: var(--foreground); font: 400 1.0625rem/1.6 var(--sans); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 5.5vw, 3.6rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: inherit; text-underline-offset: 0.2em; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--deep); outline-offset: 3px; border-radius: 4px; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }

.wrap { width: min(100% - 2 * var(--gap), 68rem); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 10; padding: 0.6rem 1rem; background: var(--light); color: #171717; border-radius: var(--radius); }
.skip:focus { top: 1rem; }

/* Header */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--background) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 4rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; font: 600 1.5rem var(--display); text-decoration: none; }
.brand img { width: 2rem; height: 2rem; }
.top nav { margin-left: auto; }
.top nav ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--foreground); }
.top .button { padding: 0.55rem 1rem; }
@media (max-width: 52rem) { .top nav { display: none; } .top .button { margin-left: auto; } }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0.8rem 1.4rem; border-radius: 999px; background: var(--light); color: #171717; font-weight: 600; text-decoration: none; border: 2px solid var(--light); }
.button:hover { background: #fde68a; color: #171717; }
.button.ghost { background: transparent; color: var(--foreground); border-color: var(--line); }
.button.ghost:hover { border-color: var(--foreground); }
.button[aria-disabled="true"] { background: var(--line); border-color: var(--line); color: var(--muted); cursor: not-allowed; }

/* Hero */
.hero { padding-block: clamp(3rem, 9vw, 7rem); }
.hero .wrap { display: grid; gap: var(--gap); align-items: center; grid-template-columns: 1.15fr 1fr; }
.eyebrow { font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink); }
.pitch { font-size: 1.2rem; color: var(--muted); max-width: 34rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 1rem; }
.fine { font-size: 0.95rem; color: var(--muted); }
.hero .wrap.one { grid-template-columns: minmax(0, 44rem); }
.facecol { display: grid; justify-items: center; gap: 1.25rem; justify-self: center; width: min(100%, 26rem); }
.face { position: relative; width: min(100%, 26rem); aspect-ratio: 1; }
.face::before { content: ""; pointer-events: none; position: absolute; inset: -12%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--light) 38%, transparent), transparent); }
.face { --light: #fcd34d; }
.face img { position: relative; display: block; width: 100%; height: 100%; }
.face canvas { position: absolute; inset: -10%; width: 120%; height: 120%; }
.face.live img { visibility: hidden; }
@media (max-width: 52rem) {
  .hero .wrap { grid-template-columns: 1fr; }
  .facecol { order: -1; }
  .face { width: min(60%, 14rem); }
}

/* Sections */
section { padding-block: clamp(3rem, 8vw, 5.5rem); }
section > .wrap > header { max-width: 40rem; margin-bottom: 2rem; }
section > .wrap > header p { color: var(--muted); font-size: 1.1rem; }
.band { background: var(--surface); border-block: 1px solid var(--line); }
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); list-style: none; margin: 0; padding: 0; }
@media (min-width: 52rem) {
  .cards.five { grid-template-columns: repeat(6, 1fr); }
  .cards.five > :nth-child(-n+3) { grid-column: span 2; }
  .cards.five > :nth-child(n+4) { grid-column: span 3; }
}
.card { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--background); }
.card p { margin: 0; color: var(--muted); }
.note { margin: 1.5rem 0 0; }
.card h3::before { content: ""; display: block; width: 2rem; height: 3px; margin-bottom: 0.9rem; border-radius: 2px; background: var(--deep); }

.promises { display: grid; gap: 1.25rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); list-style: none; margin: 0; padding: 0; }
.promises li { padding-left: 1.5rem; position: relative; }
.promises li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--light); box-shadow: 0 0 0 3px color-mix(in srgb, var(--deep) 45%, transparent); }
.promises strong { display: block; }
.promises span { color: var(--muted); }

.table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
th, td { padding: 0.8rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
tr:last-child > * { border-bottom: 0; }
thead th { font-family: var(--display); background: var(--surface); }
tbody th { font-weight: 600; white-space: nowrap; }
caption { text-align: left; padding: 0 0 0.75rem; color: var(--muted); }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.5rem; margin: 0 0 1.5rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

footer { padding-block: 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}


/* Interactive parts (site.js). Without the script the chips and tabs are absent and nothing is missing. */
.moods { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.moods button, .tabs button { min-height: 2.75rem; padding: 0.4rem 0.9rem; border-radius: 999px; border: 2px solid var(--line); background: transparent; color: var(--foreground); font: inherit; font-size: 0.95rem; cursor: pointer; }
.moods button::before { content: ""; display: inline-block; width: 0.6rem; height: 0.6rem; margin-right: 0.5rem; border-radius: 50%; background: var(--chip); }
.moods button:hover, .moods button[aria-pressed="true"], .tabs button:hover { border-color: var(--foreground); }

.stage { display: grid; place-items: center; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: var(--radius); background: var(--housing); color: #ededed; overflow: hidden; text-align: center; }
.stage p { margin: 0; padding: 1rem; font: 600 clamp(1.1rem, 3vw, 1.6rem) var(--display); }
.stage video { width: 100%; height: 100%; }

.tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.tabs button[aria-selected="true"] { background: var(--light); border-color: var(--light); color: #171717; }
.stories { display: grid; gap: 1rem; }
.stories article { padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--background); }
.beats { display: grid; gap: 0.9rem; margin: 0; padding: 0; list-style: none; counter-reset: beat; max-width: 46rem; }
.beats li { position: relative; padding-left: 2.75rem; color: var(--muted); counter-increment: beat; }
.beats li::before { content: counter(beat); position: absolute; left: 0; top: 0; width: 1.9rem; height: 1.9rem; display: grid; place-items: center; border-radius: 50%; background: var(--light); color: #171717; font: 600 0.95rem var(--display); }
.beats q { color: var(--foreground); font-weight: 600; }
.js .stories article:not([hidden]) .beats li { animation: beat 0.5s both; }
.js .beats li:nth-child(2) { animation-delay: 0.15s; }
.js .beats li:nth-child(3) { animation-delay: 0.3s; }
.js .beats li:nth-child(4) { animation-delay: 0.45s; }
@keyframes beat { from { opacity: 0; transform: translateY(0.6rem); } }

.think { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); align-items: start; }
#board { display: grid; gap: 0.5rem; }
#board label { display: flex; align-items: center; gap: 0.75rem; min-height: 3rem; padding: 0.6rem 1rem; border: 2px solid var(--line); border-radius: var(--radius); background: var(--background); cursor: pointer; transition: border-color 0.3s; }
#board label.hit { border-color: var(--deep); }
#board input { width: 1.25rem; height: 1.25rem; accent-color: var(--deep); }
.result { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--background); }
.step { font: 600 clamp(1.4rem, 3.5vw, 2rem)/1.2 var(--display); min-height: 2.4em; }
.big { margin: 0; color: var(--muted); }
.big span { display: inline-block; width: 0.7rem; height: 0.7rem; margin-right: 0.5rem; border-radius: 50%; background: var(--line); transition: background 0.3s; }
.big .woken, .big.awake .asleep { display: none; }
.big.awake .woken { display: inline; color: var(--foreground); }
.big.awake span { background: var(--light); }

.js-only { display: none; }
.js .js-only { display: block; }
.face { cursor: pointer; }
.says { cursor: pointer; }
.says:hover, .saying { text-decoration: underline; text-decoration-color: var(--deep); text-decoration-thickness: 2px; text-underline-offset: 0.25em; }

.js .reveal { opacity: 0; transform: translateY(1.5rem); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .beats li { animation: none !important; }
}
