/* FLOV Games studio site. Direction B, Studio Clay + one road line
   (Vera's template, spacetales docs/analysis/studio-design-template-2026-10.md). */

@font-face { font-family: "Manrope"; src: url("/fonts/manrope-var.woff2") format("woff2"); font-weight: 500 800; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/fonts/literata-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: light;
  --fs-hero: clamp(2.5rem, 7vw, 5rem);
  --fs-h2: clamp(1.75rem, 4vw, 2.75rem);
  --fs-h3: 1.5rem;
  --fs-lead: clamp(1.15rem, 2vw, 1.4rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.875rem;
  --fs-eyebrow: 0.75rem;
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-xl: 32px;
  --ease-move: cubic-bezier(.4, 1, .4, 1);
  --ease-pop: cubic-bezier(.2, 1.55, .4, 1);
  --dur-tap: .18s; --dur-enter: .5s; --dur-travel: 1.1s;
  --gutter: clamp(16px, 5vw, 48px);
  --sect: 96px;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* game slot: SpaceTales. Only read inside .game */
  --game-accent: #FF2A6D; --game-ground: #e8e6ff;
}
:root[data-theme="dark"] { --game-ground: #0a0720; }
@media (max-width: 640px) { :root { --sect: 64px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--s-bg); color: var(--s-ink);
  font: 500 var(--fs-body)/1.6 var(--sans);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--s-accent); text-underline-offset: 3px; }
a:hover { color: var(--s-accent); }
:focus-visible { outline: 2px solid var(--s-accent); outline-offset: 2px; border-radius: 4px; }
p { margin: 0 0 16px; }

.wrap { max-width: 1200px; margin: 0 auto; padding-inline: var(--gutter); }

/* header */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding-block: 20px; }
.top > a { flex: none; padding-block: 8px; }
.top img { height: 34px; width: auto; }
.top nav { display: flex; gap: 16px; font-size: var(--fs-small); font-weight: 600; }
.top nav a { text-decoration: none; padding: 11px 4px; }
@media (max-width: 480px) { .top nav { gap: 6px; margin-left: -4px; } .top img { height: 28px; } }
.top nav { align-items: center; }
.top .logo-dark, [data-theme="dark"] .top .logo-light { display: none; }
[data-theme="dark"] .top .logo-dark { display: block; }
/* theme switch: system -> light -> dark; one icon shows the current choice */
.theme { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: var(--s-bg); color: var(--s-ink); box-shadow: var(--s-raised-sm); cursor: pointer; }
.theme[hidden] { display: none; }
.theme:hover { color: var(--s-accent); }
.theme svg { display: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
[data-choice="system"] .theme .i-system, [data-choice="light"] .theme .i-light, [data-choice="dark"] .theme .i-dark { display: block; }

/* type */
.eyebrow { font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--s-accent); margin: 0 0 12px; }
h1, h2 { margin: 0; }
h1 { font-size: var(--fs-hero); line-height: 1.02; font-weight: 800; letter-spacing: -0.03em; }
h1 .dim { display: block; color: var(--s-ink-dim); }
h2 { font-size: var(--fs-h2); line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 16px; }
.h3 { font-size: var(--fs-h3); line-height: 1.2; font-weight: 700; letter-spacing: normal; margin-bottom: 8px; }
.lead { font: 400 var(--fs-lead)/1.45 var(--serif); color: var(--s-ink-dim); max-width: 34em; }
.body { max-width: 66ch; color: var(--s-ink-dim); }

/* hero */
.hero { padding-block: 64px var(--sect); }
.hero .lead { margin-top: 24px; }
.actions a:not(.btn) { padding-block: 9px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 32px; }
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px; border-radius: var(--r-md);
  background: var(--s-ink); color: var(--s-bg); font-weight: 700; text-decoration: none; }
.btn:hover { color: var(--s-bg); transform: translateY(-1px); }

/* sections */
section { padding-block: var(--sect) 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 16px 0 0; }
.tags li { font-size: var(--fs-small); padding: 4px 12px; border-radius: 999px; }

/* the game (SpaceTales) */
.game .h3 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
.game .blurb { font: 400 var(--fs-lead)/1.45 var(--serif); }

/* claims */
.claims { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); list-style: none; padding: 0; margin: 32px 0 0; }
.claims strong { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.claims span { color: var(--s-ink-dim); }

/* next */
.next .body { margin-top: 8px; }

/* footer */
footer { padding-block: 40px 56px; font-size: var(--fs-small); color: var(--s-ink-dim); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 48px; justify-content: space-between; }
footer p { margin: 0 0 6px; }
footer a { display: inline-block; min-width: 44px; padding-block: 13px; margin-block: -13px; }

/* the road: draws once on load */
.road path { fill: none; stroke: var(--s-ink); stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw var(--dur-travel) var(--ease-move) forwards; }
.road .r2 { animation-delay: .35s; }
.road circle { fill: var(--s-accent); transform-box: fill-box; transform-origin: center; transform: scale(0);
  animation: pop .4s var(--ease-pop) forwards; animation-delay: 1.1s; }
.road .dim { fill: var(--s-bg); stroke: var(--s-accent); stroke-width: 3; }
.road text { font: 600 15px var(--sans); fill: var(--s-ink-dim); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .road path { stroke-dashoffset: 0; }
  .road circle { transform: none; }
}

/* B colour tokens and direction rules */
:root {
  --s-bg:#EFECE6; --s-bg-deep:#E4E0D8; --s-surface:#F7F5F0; --s-surface-2:#FBFAF7;
  --s-ink:#1C1E22; --s-ink-dim:#55585F; --s-line:rgb(28 30 34 / .14); --s-accent:#7A6238;
  --s-sh-dark:#D3CEC4; --s-sh-light:#FFFFFF;
  --s-raised: 6px 6px 16px var(--s-sh-dark), -6px -6px 14px var(--s-sh-light);
  --s-raised-sm: 3px 3px 8px var(--s-sh-dark), -3px -3px 7px var(--s-sh-light);
  --s-inset: inset 3px 3px 7px var(--s-sh-dark), inset -3px -3px 7px var(--s-sh-light);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --s-bg:#15161A; --s-bg-deep:#0F1013; --s-surface:#1C1D22; --s-surface-2:#24262C;
  --s-ink:#EDEAE3; --s-ink-dim:#A3A19B; --s-line:rgb(237 234 227 / .12); --s-accent:#C9AE80;
  --s-sh-dark:#08090B; --s-sh-light:#26282E;
  --s-raised: 8px 8px 22px var(--s-sh-dark), -6px -6px 16px var(--s-sh-light);
  --s-raised-sm: 4px 4px 10px var(--s-sh-dark), -3px -3px 8px var(--s-sh-light);
  --s-inset: inset 4px 4px 9px var(--s-sh-dark), inset -3px -3px 8px var(--s-sh-light);
}

.btn { box-shadow: var(--s-raised-sm); }
.btn:active { box-shadow: var(--s-inset); transform: none; }

/* the rail: one road line down the left, a dot at each section head */
.rail { position: relative; padding-left: calc(var(--gutter) + 56px); }
.rail::before { content: ""; position: absolute; left: calc(var(--gutter) + 4px); top: 120px; bottom: 0; width: 1.5px;
  background: var(--s-line); transform-origin: top; animation: grow 2.2s var(--ease-move) both; }
.rail .eyebrow { position: relative; }
.rail .eyebrow::before { content: ""; position: absolute; left: -56px; top: 50%; width: 10px; height: 10px; margin-top: -5px;
  border-radius: 50%; background: var(--s-accent); }
@keyframes grow { from { transform: scaleY(0); } }
@media (max-width: 640px) {
  .rail { padding-left: var(--gutter); }
  .rail::before { display: none; }
  .rail .eyebrow { padding-left: 18px; }
  .rail .eyebrow::before { left: 0; }
}

.hero { display: grid; grid-template-columns: 7fr 5fr; gap: 32px; align-items: center; }
.hero .road { width: 100%; max-width: 420px; justify-self: end; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; } .hero .road { max-width: 300px; justify-self: start; } }

.plate { background: var(--s-surface); border-radius: var(--r-xl); box-shadow: var(--s-raised); padding: 24px;
  display: grid; grid-template-columns: 6fr 5fr; gap: 40px; align-items: center; }
.well { border-radius: var(--r-lg); box-shadow: var(--s-inset); min-height: 340px; display: grid; place-items: center; padding: 32px 16px; overflow: hidden; }
@media (max-width: 800px) { .plate { grid-template-columns: 1fr; gap: 24px; padding: 16px; } .well { min-height: 260px; } }

.game.plate { background: var(--s-surface-2); }
.game .well { background: var(--game-ground); }
.fan { display: flex; justify-content: center; width: 100%; max-width: 440px; }
.fan picture { width: 36%; margin-inline: -4%; transition: transform var(--dur-enter) var(--ease-move); }
.fan img { border-radius: var(--r-sm); border: 2px solid color-mix(in srgb, var(--game-accent) 50%, transparent);
  aspect-ratio: 2 / 3; object-fit: cover; box-shadow: 0 10px 24px rgb(0 0 0 / .35); }
.fan picture:nth-child(1) { transform: rotate(-6deg) translateY(10px); }
.fan picture:nth-child(2) { z-index: 1; }
.fan picture:nth-child(3) { transform: rotate(6deg) translateY(10px); }
@media (hover: hover) {
  .game.plate { transition: box-shadow var(--dur-enter) var(--ease-move); }
  .game.plate:hover .fan picture:nth-child(1) { transform: rotate(-10deg) translate(-8px, 10px); }
  .game.plate:hover .fan picture:nth-child(3) { transform: rotate(10deg) translate(8px, 10px); }
}
@media (hover: hover) {
  [data-theme="dark"] .game.plate:hover { box-shadow: var(--s-raised), 0 0 28px color-mix(in srgb, var(--game-accent) 40%, transparent); }
}
.game .text { padding: 8px 16px 8px 0; }
.game .tags li, .claims li { background: var(--s-bg-deep); box-shadow: var(--s-inset); color: var(--s-ink-dim); }
.game .tags li { border-radius: var(--r-sm); }

.next.plate { background: var(--s-surface); }
.next .well { background: var(--s-bg-deep); min-height: 200px; }
.next .well svg { width: 90%; max-width: 340px; }
.next .h3, .next .body { color: var(--s-ink-dim); }

.claims li { border-radius: var(--r-lg); padding: 24px; }

main.rail { padding-bottom: var(--sect); }
.page { padding-top: 64px; }
/* short pages: footer sits on the screen bottom */
body:has(.page) { min-height: 100vh; display: flex; flex-direction: column; }
body:has(.page) > .wrap { width: 100%; }
body:has(.page) > main { flex: 1; }
.page h1 { font-size: var(--fs-h2); margin-bottom: 24px; }
.page.rail::before { top: 64px; }
footer { background: var(--s-bg-deep); box-shadow: var(--s-inset); position: relative; }
footer .end { display: none; }
@media (min-width: 641px) {
  footer .end { display: block; position: absolute; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--s-accent);
    left: calc(max(0px, (100% - 1200px) / 2) + var(--gutter)); }
}
