/* FLIPD website — "Dusk Watercolour", the same palette as the game (src/ui/theme.ts).
   Soft skies, cream cards, indigo ink. No neon, no glow, no black. Calm motion only,
   and none at all with prefers-reduced-motion. */

@font-face { font-family: Fredoka; font-weight: 500; font-display: swap; src: url(../assets/fonts/fredoka-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Fredoka; font-weight: 600; font-display: swap; src: url(../assets/fonts/fredoka-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Fredoka; font-weight: 700; font-display: swap; src: url(../assets/fonts/fredoka-latin-700-normal.woff2) format('woff2'); }

:root {
  --sky-top: #9fb1c6;
  --sky-bottom: #ebcdb8;
  --ink: #3c4a63;
  --ink-soft: #7488aa;
  --text: #3c4a63;
  --text-dim: #535d72;
  --panel: #f4eee6;
  --panel-deep: #e8dfd2;
  --panel-edge: #d6cbbb;
  --cream: #fbf8f3;
  --good: #6f9e78;
  --good-deep: #4f7d5a;
  --gold: #e6b45a;
  --gold-text: #8f6222;
  --danger: #d9735b;
  --danger-text: #a4513a;
  --shadow: 60 74 99; /* indigo, used as rgb(var(--shadow) / a) */

  --font-display: Fredoka, ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;

  --r-sm: 14px;
  --r-md: 22px;
  --r-lg: 32px;
  --wrap: min(1120px, 100% - 40px);
  --ease: cubic-bezier(.22, .8, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 17px/1.6 var(--font-body);
  color: var(--text);
  background: var(--panel);
  overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--good-deep); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 5.6vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.wrap { width: var(--wrap); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--cream); padding: 10px 16px; border-radius: 10px; z-index: 50; }
.skip:focus { left: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Soft paper grain over everything (very faint, like watercolour paper). */
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .24 0 0 0 0 .29 0 0 0 0 .39 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- buttons ---------- */
.btn {
  --bg: var(--good); --edge: var(--good-deep); --fg: var(--cream);
  display: inline-flex; align-items: center; gap: .55em; min-height: 52px; padding: .7em 1.4em;
  font: 600 1.1rem/1 var(--font-display); color: var(--fg); background: var(--bg); text-decoration: none;
  border: 0; border-radius: 999px; cursor: pointer;
  box-shadow: 0 5px 0 var(--edge), 0 12px 24px rgb(var(--shadow) / .16);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover { color: var(--fg); transform: translateY(-2px); box-shadow: 0 7px 0 var(--edge), 0 16px 28px rgb(var(--shadow) / .18); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--edge), 0 6px 14px rgb(var(--shadow) / .14); }
.btn.soft { --bg: var(--cream); --edge: var(--panel-edge); --fg: var(--ink); }
.btn.small { min-height: 44px; font-size: 1rem; padding: .55em 1.1em; }
.btn svg { width: 1.1em; height: 1.1em; }

/* Store badges: drawn here (not the official artwork) and marked "coming soon" until FLIPD is live. */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 18px 8px 14px;
  color: var(--cream); background: var(--ink); border-radius: 16px; text-decoration: none;
  box-shadow: 0 10px 22px rgb(var(--shadow) / .18);
}
.store svg { width: 26px; height: 26px; flex: none; }
.store small { display: block; font: 500 .72rem/1.1 var(--font-body); opacity: .85; letter-spacing: .02em; }
.store b { display: block; font: 600 1.12rem/1.15 var(--font-display); }
.store[aria-disabled='true'] { cursor: default; }
.store:hover { color: var(--cream); }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 40;
  background: rgb(244 238 230 / .86); backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid rgb(214 203 187 / .7);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 1.5rem/1 var(--font-display); color: var(--ink); text-decoration: none; letter-spacing: .02em; }
.brand img { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 4px 10px rgb(var(--shadow) / .18); }
.brand .flip { display: inline-block; transform: scaleX(-1); }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { font: 600 1rem/1 var(--font-display); color: var(--ink); text-decoration: none; padding: 12px 12px; border-radius: 12px; }
.nav a:hover { background: var(--panel-deep); color: var(--ink); }
.nav .btn { margin-left: 6px; }
@media (max-width: 760px) { .nav a:not(.btn) { display: none; } }

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, #c7c3c9 55%, var(--sky-bottom) 100%);
  padding: clamp(48px, 8vw, 96px) 0 0;
}
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 5vw, 64px); align-items: center; position: relative; z-index: 2; }
.hero h1 { color: var(--ink); }
.hero h1 .twist { display: inline-block; color: var(--cream); background: var(--ink); padding: 0 .22em .04em; border-radius: .22em; transform: rotate(-2deg); }
.tagline { font: 600 clamp(1.15rem, 2.2vw, 1.4rem)/1.35 var(--font-display); color: var(--ink); margin-bottom: .7em; }
.tagline .mirror { display: inline-block; transform: scaleX(-1); opacity: .55; }
.lead { font-size: 1.12rem; color: #44506a; max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 26px 0 18px; }
.soon { font: 600 .95rem/1.3 var(--font-display); color: #44506a; margin: 0 0 6px; }
.hero-art { position: relative; justify-self: center; padding-bottom: clamp(60px, 9vw, 110px); }

.phone {
  position: relative; width: min(300px, 70vw); padding: 12px;
  background: #2f3a50; border-radius: 46px;
  box-shadow: inset 0 0 0 2px #4a5670, 0 30px 60px rgb(var(--shadow) / .30), 0 8px 18px rgb(var(--shadow) / .18);
}
.phone::before { content: ''; position: absolute; top: 20px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #1f2737; z-index: 2; }
.phone .screen { width: 100%; aspect-ratio: 9 / 16; border-radius: 35px; overflow: hidden; background: var(--panel); }
.phone video, .phone img { width: 100%; height: 100%; object-fit: cover; }
.hero-art .pip { position: absolute; width: 92px; left: -48px; bottom: clamp(70px, 10vw, 120px); filter: drop-shadow(0 10px 12px rgb(var(--shadow) / .22)); animation: bob 5s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-4deg); } }

/* Layered silhouettes at the bottom of skies (city, waves, spires...). */
.skyline { position: absolute; left: 0; right: 0; bottom: -1px; height: clamp(90px, 14vw, 170px); z-index: 1; pointer-events: none; }
.skyline svg { width: 200%; height: 100%; }
.skyline .far { position: absolute; inset: 0; opacity: .55; animation: drift 160s linear infinite; }
.skyline .near { position: absolute; inset: 0; animation: drift 110s linear infinite; }
@keyframes drift { to { transform: translateX(-50%); } }
.cloud { position: absolute; z-index: 0; fill: var(--cream); opacity: .55; animation: float 70s linear infinite; }
.cloud.c1 { width: 260px; top: 12%; left: -10%; }
.cloud.c2 { width: 190px; top: 30%; left: 55%; animation-duration: 95s; opacity: .4; }
.cloud.c3 { width: 320px; top: 6%; left: 70%; animation-duration: 120s; opacity: .35; }
@keyframes float { to { transform: translateX(40vw); } }

/* ---------- sections ---------- */
section { padding: clamp(64px, 9vw, 112px) 0; position: relative; }
.eyebrow { display: inline-block; font: 600 .9rem/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-text); margin-bottom: 14px; }
.section-head { max-width: 40em; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head p { color: var(--text-dim); font-size: 1.1rem; }
.center { text-align: center; margin-inline: auto; }

.card {
  background: var(--cream); border: 1px solid var(--panel-edge); border-radius: var(--r-lg);
  box-shadow: 0 2px 0 var(--panel-edge), 0 18px 40px rgb(var(--shadow) / .08);
}

/* ---------- try it (mirror demo) ---------- */
.try { background: linear-gradient(180deg, var(--sky-bottom) 0%, var(--panel) 38%); }
.demo { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }
.demo-stage { padding: 14px; }
.demo canvas {
  width: 100%; aspect-ratio: 8 / 5; display: block; border-radius: var(--r-md); touch-action: none; cursor: crosshair;
  background: linear-gradient(180deg, #a9b9cc, #e6cdbb);
}
.demo-side { padding: 24px; display: grid; gap: 18px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode {
  min-height: 48px; font: 600 1rem/1.1 var(--font-display); color: var(--ink); background: var(--panel);
  border: 2px solid var(--panel-edge); border-radius: 14px; cursor: pointer; transition: background .2s, border-color .2s;
}
.mode[aria-pressed='true'] { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.meter { height: 14px; border-radius: 99px; background: var(--panel-deep); overflow: hidden; box-shadow: inset 0 1px 2px rgb(var(--shadow) / .18); }
.meter i { display: block; height: 100%; width: 100%; background: var(--ink-soft); border-radius: inherit; transition: width .1s linear; }
.demo-status { font: 600 1.15rem/1.35 var(--font-display); min-height: 3em; margin: 0; }
.demo-status.win { color: var(--good-deep); }
.demo-status.fail { color: var(--danger-text); }
.demo-note { font-size: .95rem; color: var(--text-dim); margin: 0; }
.label { font: 600 .85rem/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); margin: 0 0 8px; }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
.step { padding: 28px; position: relative; }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 16px;
  font: 700 1.3rem/1 var(--font-display); color: var(--cream); background: var(--ink); border-radius: 50%;
}
.step p { color: var(--text-dim); margin: 0; }
.step svg { width: 100%; height: 120px; margin-bottom: 16px; }

/* ---------- worlds ---------- */
.worlds { background: var(--panel-deep); }
.world-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.world {
  --a: #9fb1c6; --b: #ebcdb8; --c: #4f6d96; --s: #a9b3c4;
  position: relative; overflow: hidden; min-height: 250px; padding: 24px 24px 92px; border-radius: var(--r-lg); color: var(--ink);
  background: linear-gradient(180deg, var(--a), var(--b));
  box-shadow: 0 18px 36px rgb(var(--shadow) / .12);
  transition: transform .3s var(--ease);
}
.world:hover { transform: translateY(-4px); }
.world .num { font: 700 1rem/1 var(--font-display); color: var(--cream); background: var(--c); display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; }
.world h3 { margin: 14px 0 6px; font-size: 1.45rem; }
.world .chip { display: inline-block; font: 600 .85rem/1 var(--font-display); padding: 7px 12px; border-radius: 99px; background: rgb(251 248 243 / .8); color: var(--c); margin-bottom: 10px; }
.world p { position: relative; z-index: 1; margin: 0; max-width: 18em; color: #3f4b62; }
.world svg.sil { position: absolute; left: 0; right: 0; bottom: -2px; width: 100%; height: 70px; fill: var(--s); opacity: .9; }

/* ---------- numbers strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 34px; }
.stat { text-align: center; padding: 20px 10px; }
.stat b { display: block; font: 700 clamp(2rem, 4vw, 2.8rem)/1 var(--font-display); color: var(--ink); }
.stat span { color: var(--text-dim); font-size: .98rem; }

/* ---------- screenshots ---------- */
.gallery { position: relative; }
.shots {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(240px, 62vw); gap: 22px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px 4px 26px; scrollbar-width: thin;
  scrollbar-color: var(--panel-edge) transparent;
}
.shots figure { margin: 0; scroll-snap-align: start; }
.shots .phone { width: 100%; border-radius: 34px; padding: 9px; }
.shots .phone::before { top: 16px; width: 9px; height: 9px; margin-left: -4.5px; }
.shots .phone .screen { border-radius: 26px; }
.shots figcaption { text-align: center; font: 600 1rem/1.3 var(--font-display); margin-top: 14px; color: var(--text-dim); }
.gallery-nav { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 10px; }
.round {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--panel-edge);
  background: var(--cream); color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 var(--panel-edge);
}
.round:hover { background: var(--panel-deep); }
.round svg { width: 22px; height: 22px; }

/* ---------- features ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { padding: 26px; }
.feature .ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--panel); margin-bottom: 16px; color: var(--ink); }
.feature .ico svg { width: 28px; height: 28px; }
.feature p { color: var(--text-dim); margin: 0; }

/* ---------- honest note ---------- */
.honest { background: var(--ink); color: var(--cream); }
.honest h2 { color: var(--cream); }
.honest p { color: #dfe3ec; font-size: 1.12rem; max-width: 46em; }
.honest .eyebrow { color: var(--gold); }
.honest a { color: var(--cream); }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; }
.pillar { padding: 22px; border-radius: var(--r-md); background: rgb(251 248 243 / .07); border: 1px solid rgb(251 248 243 / .14); }
.pillar h3 { color: var(--cream); font-size: 1.15rem; }
.pillar p { font-size: 1rem; margin: 0; color: #d3d8e3; }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; margin-inline: auto; display: grid; gap: 12px; }
.faq details { padding: 0 24px; border-radius: var(--r-md); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 0; font: 600 1.15rem/1.35 var(--font-display);
  display: flex; justify-content: space-between; gap: 16px; align-items: center; min-height: 44px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.6rem; line-height: 1; color: var(--ink-soft); transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-dim); margin: 0 0 20px; }

/* ---------- final CTA + footer ---------- */
.final { overflow: hidden; background: linear-gradient(180deg, var(--panel) 0%, var(--sky-bottom) 45%, #c9b5ad 100%); text-align: center; padding-bottom: clamp(140px, 18vw, 220px); }
.final .stores { justify-content: center; margin-top: 24px; }
.final p { color: #44506a; font-size: 1.12rem; }
footer { background: #34405a; color: #d3d8e3; padding: 40px 0 46px; font-size: .97rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 18px 30px; align-items: center; justify-content: space-between; }
footer a { color: var(--cream); }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
footer nav a { padding: 8px 0; }

/* ---------- reading pages (privacy, support) ---------- */
.page-hero { background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom)); padding: 64px 0 120px; position: relative; overflow: hidden; }
.page-hero p { color: #44506a; font-size: 1.1rem; margin: 0; }
.doc { margin-top: -80px; position: relative; z-index: 3; padding: clamp(24px, 5vw, 56px); max-width: 860px; margin-inline: auto; }
.doc h2 { font-size: 1.6rem; margin-top: 1.8em; }
.doc h2:first-child { margin-top: 0; }
.doc h3 { margin-top: 1.4em; }
.doc ul { padding-left: 1.25em; }
.doc li { margin-bottom: .45em; }
.doc table { width: 100%; border-collapse: collapse; margin: 1em 0 1.4em; font-size: .97rem; }
.doc th, .doc td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--panel-edge); vertical-align: top; }
.doc th { font-family: var(--font-display); font-weight: 600; }
.doc .updated { color: var(--text-dim); font-size: .95rem; }
.doc .box { background: var(--panel); border-radius: var(--r-md); padding: 18px 22px; margin: 1.2em 0; }
.table-scroll { overflow-x: auto; }
.page-wrap { padding-bottom: 80px; }

/* ---------- about ---------- */
.about .me { display: flex; align-items: center; gap: 22px; margin-bottom: 1.4em; }
.about .me h2 { margin: 0 0 .15em; font-size: 2rem; }
.about .role { margin: 0; color: var(--text-dim); font: 600 1.02rem/1.3 var(--font-display); }
.avatar { position: relative; flex: none; width: 104px; height: 104px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; box-shadow: 0 10px 24px rgb(var(--shadow) / .2); }
.avatar span { font: 700 2.2rem/1 var(--font-display); color: var(--cream); letter-spacing: .02em; }
.avatar .peek { position: absolute; width: 46px; right: -12px; bottom: -6px; }
.road { list-style: none; padding: 0; margin: 1em 0 0; border-left: 3px solid var(--panel-edge); }
.road li { position: relative; padding: 0 0 18px 26px; }
.road li::before { content: ''; position: absolute; left: -9px; top: 6px; width: 15px; height: 15px; border-radius: 50%; background: var(--cream); border: 3px solid var(--ink-soft); }
.road li:last-child::before { background: var(--gold); border-color: var(--gold-text); }
.road b { display: block; font: 600 1.1rem/1.3 var(--font-display); }
.road span { color: var(--text-dim); }
.about .links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: left; }
  .hero-art { justify-self: center; }
  .demo { grid-template-columns: 1fr; }
  .world-grid, .features { grid-template-columns: 1fr 1fr; }
  .pillars { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .steps, .world-grid, .features { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .hero-art .pip { left: -18px; width: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
