/* ============================================================
   NiKAL STUDiO — digito showcase
   Design system mirrors the digito app (notebook light / ink dark).
   Tokens are authoritative from lib/core/theme/digito_colors.dart.
   ============================================================ */

:root {
  /* Light "Notebook" theme (default) */
  --bg: #E8E4D8;
  --grid: rgba(52, 86, 139, .09);
  --surface: #F4F1E8;
  --ink: #222A3D;
  --muted: #7C8398;
  --line: #D2CDBC;
  --accent: #34568B;
  --accent2: #C0473A;
  --good: #3F7A4F;
  --warm: #C28A2E;
  --card-shadow: #D2CDBC;
  --accent-soft: #E4E9F2;
  --open-soft: #F5ECDB;
  --red-soft: #FBEAE8;
  --on-accent: #EAF0FA;
  --accent-btn-shadow: #243D63;
  --accent-grad: #34568B;
  --accent-grad-2: #34568B;

  --radius: 14px;
  --radius-lg: 22px;
  --grid-size: 22px;
  --maxw: 1080px;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;
}

html[data-theme='dark'] {
  /* Dark "Ink" theme */
  --bg: #0D0F14;
  --grid: rgba(127, 224, 203, .05);
  --surface: #161A22;
  --ink: #EDEFF4;
  --muted: #737B8C;
  --line: #262C38;
  --accent: #7FE0CB;
  --accent2: #F0625A;
  --good: #7FE0CB;
  --warm: #E7B55F;
  --card-shadow: rgba(0, 0, 0, .5);
  --accent-soft: #13302B;
  --open-soft: #1F1A10;
  --red-soft: #2A1614;
  --on-accent: #06231D;
  --accent-btn-shadow: rgba(0, 0, 0, .5);
  --accent-grad: #1C6557;
  --accent-grad-2: #13302B;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  /* 22px graph-paper grid, signature digito background */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; letter-spacing: -.02em; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* --- Wordmark: "digito." with red accent2 dot --- */
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -.03em;
  color: var(--ink);
}
.wordmark .dot { color: var(--accent2); }
.wordmark--lg { font-size: clamp(3rem, 9vw, 5.5rem); }

.studio {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- Signature card: hard 2px offset shadow, no blur --- */
.card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--card-shadow);
}

/* ============================================================
   Header — the toolbar itself is ../css/nav.css (.nk-toolbar etc.),
   shared verbatim with the studio landing's own nav. Only digito's own
   "digito." brand (its own .wordmark/.dot, used in the hero/footer too)
   needs anything here.
   ============================================================ */

/* Groups the studio back-link + crumb + digito's own wordmark as one
   flex item, so header.site .wrap (from nav.css) still sees exactly two
   children — the same left/right split the landing's nav has. */
.header-brands { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* digito's own wordmark, recolored for the now-fixed-dark bar (the page
   content below it still flips light/dark independently). The dot stays
   digito's own brand red, fixed regardless of page theme — same value as
   the dot in favicon.svg — not the studio's blue accent. */
header.site .wordmark { color: #EAF3FF; line-height: 1; }
header.site .wordmark .dot { color: #C0473A; }

/* ============================================================
   Hero
   ============================================================ */
.hero { padding: clamp(48px, 9vw, 110px) 0 64px; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
.hero .eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 22px;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: 20px; }
.hero p.lead { font-size: 1.18rem; color: var(--muted); max-width: 46ch; margin-bottom: 32px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* Store badges (Google Play / App Store) */
.play-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 12px;
  padding: 12px 20px;
  box-shadow: 4px 4px 0 var(--accent-btn-shadow);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
a.play-badge { color: var(--bg); text-decoration: none; }
a.play-badge:hover {
  text-decoration: none;
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--accent-btn-shadow);
}
a.play-badge:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--accent-btn-shadow); }
.play-badge svg { width: 26px; height: 26px; flex: none; }
.play-badge .pb-small { font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; opacity: .8; font-family: var(--font-mono); }
.play-badge .pb-big { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
/* "Play in browser" link — deliberately lighter than the store badges.
   The install rail sells the app; this sells a 30-second try. Same accent
   token as the eyebrow pill, dashed underline instead of a filled button so
   it never competes with the two store badges above it. */
.play-web-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1.5px dashed var(--accent);
  padding-bottom: 2px;
  transition: opacity .12s ease;
}
.play-web-link:hover { opacity: .7; }
.play-web-link span[aria-hidden] { font-size: .68em; }
.web-link-wrap { width: 100%; text-align: center; }

.soon-pill {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--warm);
  border: 1px dashed var(--warm);
  border-radius: 999px;
  padding: 6px 12px;
}

/* ============================================================
   Phone mockup (pure CSS reproduction of the game screen)
   ============================================================ */
.phone {
  justify-self: center;
  width: 300px;
  max-width: 80vw;
  aspect-ratio: 300 / 620;
  background: var(--surface);
  border: 3px solid var(--ink);
  border-radius: 38px;
  padding: 14px;
  box-shadow: 10px 12px 0 var(--card-shadow);
  position: relative;
}
.phone::before { /* notch */
  content: '';
  position: absolute;
  top: 14px; left: 50%; transform: translateX(-50%);
  width: 96px; height: 6px; border-radius: 999px;
  background: var(--line);
}
.screen {
  height: 100%;
  border-radius: 26px;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 18px 18px;
  padding: 30px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}
.screen .scr-label { font-family: var(--font-mono); font-size: .58rem; letter-spacing: .18em; color: var(--muted); text-transform: uppercase; }
.screen .target {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.6rem;
  color: var(--ink);
}
.screen .target b { color: var(--accent); }
.screen .expr {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 2px 2px 0 var(--card-shadow);
}
.screen .expr .eq { color: var(--good); }
.screen .status { font-family: var(--font-mono); font-size: .62rem; color: var(--good); letter-spacing: .1em; }
.keypad { margin-top: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.key {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  text-align: center;
  padding: 12px 0;
  border-radius: 10px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  box-shadow: 2px 2px 0 var(--card-shadow);
}
.key.op { color: var(--accent2); }
.key.next {
  grid-column: 1 / -1;
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  box-shadow: 2px 2px 0 var(--accent-btn-shadow);
}

/* ============================================================
   Features
   ============================================================ */
section.block { padding: clamp(48px, 8vw, 90px) 0; }
.section-head { max-width: 56ch; margin-bottom: 44px; }
.section-head .kicker {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent2);
}
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 10px 0 14px; }
.section-head p { color: var(--muted); font-size: 1.1rem; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature { padding: 26px; }
.feature .fi {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-mono); font-size: 1.3rem; font-weight: 700;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}
.feature h3 { font-size: 1.2rem; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: .98rem; }

/* Modes strip */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.mode { padding: 26px; }
.mode .tag {
  font-family: var(--font-mono); font-size: .64rem; letter-spacing: .16em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
  display: inline-block; margin-bottom: 14px;
}
.mode.daily .tag { color: var(--accent2); background: var(--red-soft); }
.mode.weekly .tag { color: var(--warm); background: var(--open-soft); }
.mode.worlds .tag { color: var(--accent); background: var(--accent-soft); }
.mode h3 { font-size: 1.25rem; margin-bottom: 8px; }
.mode p { color: var(--muted); font-size: .98rem; }

/* CTA band */
.cta-band { text-align: center; padding: clamp(56px, 9vw, 96px) 0; }
.cta-band h2 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 16px; }
.cta-band p { color: var(--muted); font-size: 1.15rem; margin-bottom: 28px; }
.cta-band .cta-row { justify-content: center; }

/* ============================================================
   Footer
   ============================================================ */
footer.site {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  margin-top: 20px;
}
footer.site .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
footer.site .fnav { margin-left: auto; display: flex; gap: 22px; flex-wrap: wrap; }
footer.site .fnav a { color: var(--muted); font-size: .92rem; }
footer.site .copy { color: var(--muted); font-size: .85rem; font-family: var(--font-mono); }

/* ============================================================
   Legal / privacy page
   ============================================================ */
.legal { padding: clamp(40px, 7vw, 80px) 0 70px; }
.legal .wrap { max-width: 760px; }
.legal h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 8px; }
.legal .updated { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); margin-bottom: 36px; }
.legal h2 { font-size: 1.4rem; margin: 36px 0 12px; }
.legal h3 { font-size: 1.1rem; margin: 22px 0 8px; }
.legal p, .legal li { color: var(--ink); margin-bottom: 12px; }
.legal ul { padding-left: 22px; }
.legal .card { padding: 22px 26px; margin: 24px 0; }
.legal a { font-weight: 600; }
.legal .muted { color: var(--muted); }

/* ============================================================
   Press kit page (extends .legal)
   ============================================================ */
.press .wrap { max-width: 880px; }
.press .grid-3 { margin: 24px 0 8px; }
.press .grid-3 .feature p { margin-bottom: 0; }

/* Fact sheet — label/value pairs, collapses to stacked on narrow */
.factsheet dl {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  column-gap: 24px;
  row-gap: 10px;
}
.factsheet dt {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  align-self: baseline;
}
.factsheet dd { color: var(--ink); }

/* Screenshot strip — horizontal scroll, never widens the page */
.press-shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 150px;
  gap: 14px;
  overflow-x: auto;
  padding: 6px 0 14px;
  margin: 18px 0 10px;
  scroll-snap-type: x proximity;
}
.press-shots a { scroll-snap-align: start; }
.press-shots img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.asset-list { list-style: none; padding-left: 0; }
.asset-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}
.asset-list li::before {
  content: '↓';
  font-family: var(--font-mono);
  color: var(--muted);
  margin-right: 10px;
}

/* ============================================================
   Language note + reveal
   ============================================================ */
[data-i18n] { /* nothing — JS swaps textContent */ }
.lang-current { font-weight: 700; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero p.lead { margin-left: auto; margin-right: auto; }
  .cta-row { justify-content: center; }
  .phone { order: -1; }
  .grid-3, .modes { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .factsheet dl { grid-template-columns: 1fr; row-gap: 4px; }
  .factsheet dd { margin-bottom: 10px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto; }
}
