/* ÄrränTäry – sivuston tyylit.
   Brändivärit ja kirjasimet ovat samat kuin pelissä (artifacts/den-practice/src/brand.ts). */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('assets/fonts/bricolage-grotesque-latin.woff2') format('woff2-variations'), url('assets/fonts/bricolage-grotesque-latin.woff2') format('woff2');
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('assets/fonts/dm-sans-latin.woff2') format('woff2-variations'), url('assets/fonts/dm-sans-latin.woff2') format('woff2');
  font-weight: 100 1000; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Spline Sans Mono';
  src: url('assets/fonts/spline-sans-mono-latin.woff2') format('woff2-variations'), url('assets/fonts/spline-sans-mono-latin.woff2') format('woff2');
  font-weight: 300 700; font-style: normal; font-display: swap;
}

:root {
  --navy: #152238;
  --space: #120f2a;
  --ivory: #FAF6EF;
  --teal: #55E6D2;
  --lavender: #B39CFF;
  --gold: #FFD46A;
  --gold-hover: #ffc247;
  --cream-text: #fbf1e4;
  --ink: #152238;
  --ink-soft: #3f4a61;
  --cyan: #a8f7ff;

  --display: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, sans-serif;
  --mono: 'Spline Sans Mono', ui-monospace, monospace;

  --wrap: 1120px;
  --gutter: clamp(18px, 4vw, 40px);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--navy);
  overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; margin: 0; }
h2 { font-size: clamp(2rem, 4.4vw, 3rem); }
h3 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }
p { margin: 0; }
a { color: inherit; }
em { font-style: normal; font-weight: 700; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }

.skip { position: absolute; left: 12px; top: -60px; background: var(--gold); color: var(--navy); padding: 10px 14px; border-radius: 10px; font-weight: 700; z-index: 100; }
.skip:focus { top: 12px; }

/* ---------- Painikkeet ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 26px;
  border-radius: 999px; border: 2px solid transparent;
  font: 700 1.05rem/1 var(--body); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--navy); box-shadow: 0 8px 28px rgba(255, 212, 106, .28); }
.btn-gold:hover { background: var(--gold-hover); }
.btn-teal { background: var(--teal); color: var(--navy); }
.btn-teal:hover { background: #7eefdf; }
.btn-ghost { background: transparent; color: var(--cream-text); border-color: rgba(251, 241, 228, .35); }
.btn-soon { cursor: default; opacity: .8; }
.btn-small { min-height: 42px; padding: 8px 18px; font-size: .95rem; }

/* ---------- Yläpalkki ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 12px var(--gutter);
  background: rgba(21, 34, 56, .72);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  color: var(--cream-text);
}
.top-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.top-brand b { color: var(--lavender); font-weight: 800; }
.spark-mini { width: 32px; height: 32px; }
.top-nav { display: none; gap: 24px; margin-left: auto; margin-right: 8px; }
.top-nav a { text-decoration: none; font-weight: 600; opacity: .85; }
.top-nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--teal); }
.top > .btn { margin-left: auto; }
@media (min-width: 840px) { .top-nav { display: flex; } .top > .btn { margin-left: 0; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: radial-gradient(900px 500px at 70% -10%, #33465c66, transparent 70%), var(--navy);
  color: var(--cream-text);
  padding: clamp(40px, 7vw, 96px) 0 clamp(56px, 8vw, 112px);
}
.stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.hero-grid {
  width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto;
  display: grid; gap: clamp(32px, 5vw, 64px); align-items: center;
}
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }
.hero-logo { width: min(420px, 78vw); height: auto; margin: 0 0 clamp(20px, 3vw, 36px) -4px; }
.hero-title { font-size: clamp(2.4rem, 5.6vw, 4.25rem); max-width: 14ch; }
.hero-lead { margin-top: 20px; font-size: clamp(1.1rem, 1.6vw, 1.3rem); max-width: 48ch; color: rgba(251, 241, 228, .88); }
.hero-lead em { color: var(--cyan); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-note { margin-top: 16px; font-size: .95rem; color: rgba(251, 241, 228, .62); }

/* Demo: pelin ydin suoraan sivulla */
.demo {
  background: rgba(32, 28, 68, .62);
  border: 1px solid rgba(168, 247, 255, .16);
  border-radius: 28px;
  padding: clamp(24px, 3vw, 36px);
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.demo-spark { display: flex; align-items: center; justify-content: center; gap: 10px; height: 150px; }
.arcs { width: 48px; height: 128px; transform-origin: center; transition: opacity .2s, transform .15s ease-out; opacity: .35; }
.arcs path { transition: opacity .2s; }
.demo.listening .arcs-l { transform: translateX(calc(var(--lvl, 0) * -8px)); }
.demo.listening .arcs-r { transform: translateX(calc(var(--lvl, 0) * 8px)); }
.spark-core { position: relative; width: 120px; height: 120px; }
.spark-core svg { position: relative; width: 100%; height: 100%; filter: drop-shadow(0 0 8px rgba(255, 212, 106, .5)); transition: transform .12s ease-out; }
.spark-glow { position: absolute; inset: 10%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 212, 106, .55), transparent 65%); transform: scale(var(--glow, .4)); opacity: var(--glow, .4); transition: transform .12s ease-out, opacity .12s ease-out; }
.demo[data-level] .spark-core svg { transform: scale(calc(1 + var(--lvl, 0) * .22)); }
.demo.listening .arcs { opacity: calc(.35 + var(--lvl, 0) * .65); }
.demo-word { margin-top: 10px; font-size: 1.05rem; color: rgba(251, 241, 228, .7); }
.demo-word strong { display: inline-block; margin-left: 8px; font: 700 2rem/1 var(--display); color: var(--cyan); letter-spacing: -0.02em; }
.demo-meter { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.demo-meter span { width: 34px; height: 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); transition: background .25s, box-shadow .25s; }
.demo-meter span.on { background: linear-gradient(90deg, #ffcf9a, #ff8a5c); box-shadow: 0 0 10px rgba(255, 170, 110, .6); }
.demo-status { margin-top: 14px; min-height: 2.6em; font-size: .98rem; color: rgba(251, 241, 228, .82); }
.demo-status strong { color: var(--gold); }
.demo .btn { margin-top: 10px; }
.demo-privacy { margin-top: 12px; font-size: .82rem; color: rgba(251, 241, 228, .5); }
.demo-count { font-family: var(--mono); font-weight: 600; color: var(--gold); }

/* ---------- Traileri ---------- */
.trailer { background: linear-gradient(180deg, var(--navy), var(--space)); color: var(--cream-text); padding: clamp(56px, 8vw, 110px) 0; }
.trailer-grid { display: grid; gap: clamp(32px, 5vw, 72px); align-items: center; }
@media (min-width: 900px) { .trailer-grid { grid-template-columns: 1.1fr .9fr; } }
.trailer-copy p { margin-top: 18px; max-width: 46ch; font-size: 1.1rem; color: rgba(251, 241, 228, .85); }
.trailer-copy em { color: var(--cyan); }
.trailer-meta { font-family: var(--mono); font-size: .9rem !important; color: rgba(251, 241, 228, .55) !important; }
.trailer-phone { display: flex; justify-content: center; }
/* The trailer is 9:16, so the screen is too: nothing is cropped. Height is capped so
   the whole phone fits on a laptop screen. */
.trailer-phone .phone { position: relative; aspect-ratio: auto; width: min(400px, 88vw, calc((100svh - 120px) * 9 / 16 + 20px)); }
.trailer-phone .phone-screen { display: block; height: auto; aspect-ratio: 9 / 16; object-fit: contain; background: #0b0a1c; }
.trailer-play {
  position: absolute; left: 50%; top: 64%; transform: translate(-50%, -50%); width: 88px; height: 88px;
  border: 0; border-radius: 50%; cursor: pointer;
  background: var(--gold); color: var(--navy);
  box-shadow: 0 12px 40px rgba(255, 212, 106, .45);
  display: grid; place-items: center;
  transition: transform .15s ease;
}
.trailer-play:hover { transform: translate(-50%, -50%) scale(1.06); }
.trailer-play svg { width: 44px; height: 44px; fill: currentColor; margin-left: 4px; }
.trailer-phone.playing .trailer-play { display: none; }
.trailer-phone .phone-screen::cue { font-family: var(--body); font-size: .95rem; }

/* ---------- Maailmat ---------- */
.worlds {
  color: var(--cream-text);
  padding: clamp(56px, 8vw, 110px) 0;
  transition: background .6s ease;
  background: radial-gradient(800px 420px at 20% 0%, rgba(168, 247, 255, .12), transparent 70%), var(--space);
}
.worlds[data-world="unicorn"] {
  background: radial-gradient(800px 420px at 80% 0%, rgba(255, 159, 200, .22), transparent 70%), linear-gradient(180deg, #302448, #5a4a96);
  color: #fff8fb;
}
.worlds-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: clamp(28px, 4vw, 48px); }
.world-switch { display: inline-flex; padding: 5px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); }
.world-switch button {
  border: 0; background: transparent; color: inherit; cursor: pointer;
  padding: 10px 22px; border-radius: 999px; font: 700 1rem var(--body);
  transition: background .25s, color .25s;
}
.world-switch button[aria-selected="true"] { background: var(--cyan); color: var(--navy); }
.worlds[data-world="unicorn"] .world-switch button[aria-selected="true"] { background: linear-gradient(100deg, #ff9fc8, #c6a0ff 55%, #8fd4ff); color: #3b2457; }

.world-panel { display: grid; gap: clamp(28px, 4vw, 48px); align-items: center; }
.world-panel[hidden] { display: none; }
@media (min-width: 900px) { .world-panel { grid-template-columns: 1fr 1fr; } }
.world-art img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: 0 30px 70px rgba(0, 0, 0, .45); }
.world-tag { margin-top: 8px; font-size: 1.1rem; font-weight: 600; color: var(--cyan); }
.worlds[data-world="unicorn"] .world-tag { color: #ffd6f4; }
.world-copy > p + p { margin-top: 14px; }
.world-facts { margin: 24px 0 0; display: grid; gap: 10px 20px; grid-template-columns: 1fr 1fr; }
.world-facts div:last-child { grid-column: 1 / -1; }
.world-facts dt { font-size: .82rem; font-weight: 600; opacity: .6; }
.world-facts dd { margin: 2px 0 0; font-weight: 600; }
.phone {
  width: min(250px, 70vw); aspect-ratio: 390 / 844;
  border-radius: 36px; padding: 10px;
  background: #0b0f1c; box-shadow: 0 30px 70px rgba(0, 0, 0, .55), inset 0 0 0 2px rgba(255, 255, 255, .12);
}
.phone-screen { width: 100%; height: 100%; object-fit: cover; border-radius: 27px; background: #120f2a; }
.worlds-foot { margin-top: clamp(28px, 4vw, 48px); max-width: 60ch; opacity: .78; }

/* ---------- Näin se toimii ---------- */
.how, .activities, .faq { background: var(--ivory); color: var(--ink); }
.how { padding: clamp(56px, 8vw, 110px) 0 clamp(36px, 5vw, 64px); }
.how-lead { margin-top: 18px; max-width: 58ch; font-size: 1.15rem; color: var(--ink-soft); }
.steps { list-style: none; margin: clamp(32px, 4vw, 56px) 0 0; padding: 0; display: grid; gap: 28px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 36px; } }
.steps li { position: relative; padding-top: 70px; }
.step-n {
  position: absolute; top: 0; left: 0;
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--navy); color: var(--gold);
  font: 700 1.4rem var(--mono);
  box-shadow: 0 10px 24px rgba(21, 34, 56, .22);
}
.steps li:nth-child(2) .step-n { background: var(--teal); color: var(--navy); }
.steps li:nth-child(3) .step-n { background: var(--lavender); color: var(--navy); }
.steps p { margin-top: 10px; color: var(--ink-soft); }
.how-note { margin-top: clamp(28px, 4vw, 44px); max-width: 60ch; padding: 18px 22px; border-left: 4px solid var(--gold); background: rgba(255, 212, 106, .14); border-radius: 0 14px 14px 0; }

/* ---------- Tehtävät ---------- */
.activities { padding: clamp(36px, 5vw, 64px) 0 clamp(56px, 8vw, 110px); }
.activities-lead { margin-top: 14px; max-width: 58ch; color: var(--ink-soft); }
.activity-list { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 0 40px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.activity-list li { display: grid; gap: 2px; padding: 16px 0; border-top: 1px solid rgba(21, 34, 56, .14); }
.activity-list strong { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.activity-list span { color: var(--ink-soft); font-size: .98rem; }

/* ---------- Vanhemmille ---------- */
.parents { background: var(--navy); color: var(--cream-text); padding: clamp(56px, 8vw, 110px) 0; }
.parents-grid { display: grid; gap: clamp(32px, 5vw, 72px); }
@media (min-width: 900px) { .parents-grid { grid-template-columns: .9fr 1.1fr; } }
.parents p { margin-top: 18px; max-width: 48ch; color: rgba(251, 241, 228, .85); font-size: 1.08rem; }
.promise-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.promise-list li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; }
.promise-list svg { width: 44px; height: 44px; padding: 9px; border-radius: 14px; background: rgba(85, 230, 210, .14); fill: none; stroke: var(--teal); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.promise-list strong { display: block; font-family: var(--display); font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
.promise-list span { display: block; margin-top: 4px; color: rgba(251, 241, 228, .75); }

/* ---------- UKK ---------- */
.faq { padding: clamp(56px, 8vw, 110px) 0; }
.faq-wrap { max-width: 760px; }
.faq details { border-top: 1px solid rgba(21, 34, 56, .16); }
.faq details:first-of-type { margin-top: 28px; }
.faq details:last-of-type { border-bottom: 1px solid rgba(21, 34, 56, .16); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 44px 18px 0; position: relative;
  font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 12px; height: 12px;
  border-right: 2.5px solid var(--navy); border-bottom: 2.5px solid var(--navy);
  transform: translateY(-70%) rotate(45deg); transition: transform .25s;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(225deg); }
.faq details p { padding: 0 0 20px; max-width: 62ch; color: var(--ink-soft); }
.faq a { color: var(--ink); text-decoration-color: var(--lavender); text-underline-offset: 3px; }

/* ---------- Kehotus ---------- */
.cta { background: radial-gradient(700px 380px at 50% 100%, rgba(179, 156, 255, .25), transparent 70%), var(--space); color: var(--cream-text); padding: clamp(64px, 9vw, 120px) 0; text-align: center; }
.cta-inner { display: grid; justify-items: center; }
.spark-big { width: 96px; height: 96px; margin-bottom: 18px; }
.cta p { margin-top: 14px; max-width: 42ch; font-size: 1.12rem; color: rgba(251, 241, 228, .8); }
.cta .hero-actions { justify-content: center; }

/* ---------- Alatunniste ---------- */
.foot { background: #0d1526; color: rgba(251, 241, 228, .75); padding: 32px 0 40px; font-size: .95rem; }
.foot-inner { display: grid; gap: 14px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 20px; }
.foot a { text-decoration-color: rgba(85, 230, 210, .5); text-underline-offset: 4px; }
.foot-small { font-size: .82rem; opacity: .7; }

/* ---------- Tietosuojasivu ---------- */
.doc { background: var(--ivory); color: var(--ink); padding: clamp(40px, 6vw, 80px) 0 clamp(64px, 8vw, 110px); }
.doc-wrap { max-width: 720px; }
.doc h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.doc .doc-meta { margin-top: 10px; color: var(--ink-soft); }
.doc h2 { font-size: 1.5rem; margin-top: 40px; }
.doc p, .doc li { margin-top: 12px; color: var(--ink-soft); max-width: 66ch; }
.doc ul { padding-left: 22px; }
.doc a { color: var(--ink); text-decoration-color: var(--lavender); text-underline-offset: 3px; }
.doc .back { display: inline-block; margin-bottom: 28px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .arcs, .spark-core svg, .spark-glow, .demo-meter span, .world-switch button, .faq summary::after { transition: none; }
}
