/* Sudoku Cube — site styles. Shared by index.html and privacy-policy/.
   Palette and type follow the Sep 2026 promo kit (ads-promo/Sep-05-2026):
   navy ground, cyan / orange / magenta accents, Chakra Petch headings,
   Manrope body, IBM Plex Mono eyebrows. Fonts are self-hosted (OFL) so no
   visitor request goes to a font CDN. */

@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/chakra-petch-600.woff2') format('woff2'); }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/chakra-petch-700.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('fonts/manrope-var.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/ibm-plex-mono-400.woff2') format('woff2'); }

:root {
  --ground: #0a1018;
  --panel: #101a29;
  --panel-2: #152238;
  --line: #1f2f46;
  --text: #e9eff7;
  --muted: #93a4bd;
  --dim: #5d7190;
  --cyan: #20d9a8;
  --orange: #f5a20b;
  --magenta: #e94fc1;
  --blue: #28a0ff;
  --max: 1120px;
  --radius: 14px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--ground);
  color: var(--text);
  font-family: Manrope, 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); }
a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
img, video { max-width: 100%; height: auto; display: block; }
code { font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace; font-size: 0.92em; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

h1, h2, h3 { font-family: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif; line-height: 1.12; letter-spacing: -0.005em; text-wrap: balance; }
h1 { font-size: clamp(38px, 6vw, 68px); font-weight: 700; }
h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 700; }
h3 { font-size: 19px; font-weight: 600; }

.eyebrow {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
}

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

/* ── Header ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.wordmark { font-family: 'Chakra Petch', sans-serif; font-weight: 700; font-size: 18px; letter-spacing: 0.02em; }
.wordmark b { color: var(--orange); font-weight: 700; }
.site-nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 14px; padding: 8px 10px; border-radius: 8px; transition: color 0.15s, background 0.15s; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--text); background: var(--panel-2); outline: none; }
.site-nav a.cta { color: var(--ground); background: var(--cyan); font-weight: 700; }
.site-nav a.cta:hover { background: #4ee6bf; }

/* The Roadmap link is the one menu item meant to catch the eye: a live
   gradient ring (cyan, orange, magenta, the three roadmap states) and a
   pulsing dot. It stays visible on phones, where the other links hide. */
@property --ring { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.site-nav a.nav-roadmap {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--text); font-weight: 700;
  border: 1.5px solid transparent; border-radius: 999px; padding: 6.5px 13px;
  background:
    linear-gradient(var(--ground), var(--ground)) padding-box,
    conic-gradient(from var(--ring), var(--cyan), var(--orange), var(--magenta), var(--cyan)) border-box;
  animation: ring-turn 4s linear infinite;
}
.site-nav a.nav-roadmap::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto;
  background: var(--orange); box-shadow: 0 0 0 0 rgba(245,162,11,.6);
  animation: ring-dot 2s ease-out infinite;
}
.site-nav a.nav-roadmap:hover, .site-nav a.nav-roadmap:focus-visible,
.site-nav a.nav-roadmap[aria-current="page"] {
  background:
    linear-gradient(var(--panel-2), var(--panel-2)) padding-box,
    conic-gradient(from var(--ring), var(--cyan), var(--orange), var(--magenta), var(--cyan)) border-box;
}
.site-nav a.nav-roadmap:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
@keyframes ring-turn { to { --ring: 360deg; } }
@keyframes ring-dot { 70% { box-shadow: 0 0 0 7px rgba(245,162,11,0); } 100% { box-shadow: 0 0 0 0 rgba(245,162,11,0); } }
@media (prefers-reduced-motion: reduce) {
  .site-nav a.nav-roadmap, .site-nav a.nav-roadmap::before { animation: none; }
}

/* ── Language picker ────────────────────────────────────────────────────
   A <details> menu so it opens with JavaScript disabled. The flags are
   inline SVG (see i18n/flags.py) — self-hosted like the fonts, no CDN. */
.flag { border-radius: 2px; display: block; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(255,255,255,.18); }
.lang { position: relative; }
.lang > summary {
  display: flex; align-items: center; gap: 7px; cursor: pointer; list-style: none;
  color: var(--muted); font-size: 14px; padding: 7px 9px; border-radius: 8px;
  transition: color .15s, background .15s;
}
.lang > summary::-webkit-details-marker { display: none; }
.lang > summary:hover, .lang[open] > summary { color: var(--text); background: var(--panel-2); }
.lang > summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.lang-code { font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: .06em; }
.lang .chev { width: 12px; height: 12px; opacity: .7; transition: transform .15s; }
.lang[open] .chev { transform: rotate(180deg); }
.lang-menu {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 20;
  min-width: 190px; list-style: none; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
}
.site-nav .lang-menu a.lang-opt {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 14px;
}
.site-nav .lang-menu a.lang-opt.is-current { color: var(--text); background: var(--panel-2); }
.en-note { display: block; margin-top: 6px; font-size: 12px; color: var(--dim); }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--cyan); color: var(--ground);
  font-weight: 800; font-size: 15px; letter-spacing: 0.01em;
  padding: 14px 24px; border-radius: 12px; text-decoration: none;
  transition: transform 0.15s, background 0.15s;
}
.btn:hover { background: #4ee6bf; transform: translateY(-1px); }
.btn svg { width: 20px; height: 20px; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 600; }
.btn.ghost:hover { background: var(--panel-2); }

/* ── Sections ───────────────────────────────────────────────────────── */
section { padding-block: 72px; border-top: 1px solid var(--line); }
section:first-of-type { border-top: 0; }
.sec-head { max-width: 62ch; margin-bottom: 32px; }
.sec-head h2 { margin-top: 8px; }
.sec-head p { color: var(--muted); margin-top: 8px; }

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero { padding-block: 56px 72px; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 80% 10%, rgba(32, 217, 168, 0.14), transparent 60%),
    radial-gradient(50% 45% at 10% 90%, rgba(233, 79, 193, 0.12), transparent 60%);
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; }
.hero h1 { margin: 14px 0 18px; }
.hero h1 span { color: var(--cyan); }
.hero .lede { font-size: 20px; color: var(--muted); max-width: 50ch; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero .fine { margin-top: 14px; font-size: 13px; color: var(--dim); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 32px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat .n { font-family: 'Chakra Petch', sans-serif; font-size: 30px; font-weight: 700; color: var(--cyan); font-variant-numeric: tabular-nums; line-height: 1; }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 6px; }

.cube-media {
  position: relative; aspect-ratio: 1 / 1; border-radius: 22px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(32, 217, 168, 0.08) inset;
}
.cube-media video, .cube-media img { width: 100%; height: 100%; object-fit: cover; }
.cube-media .tag {
  position: absolute; left: 14px; bottom: 14px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text); background: rgba(10, 16, 24, 0.7); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
}

/* ── Features ───────────────────────────────────────────────────────── */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; border-top: 3px solid var(--line); }
.feature.cyan { border-top-color: var(--cyan); }
.feature.orange { border-top-color: var(--orange); }
.feature.magenta { border-top-color: var(--magenta); }
.feature.blue { border-top-color: var(--blue); }
.feature .k { font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.feature h3 { margin: 8px 0 8px; }
.feature p { color: var(--muted); font-size: 15px; }

/* ── Modes ──────────────────────────────────────────────────────────── */
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.mode { display: flex; gap: 12px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.mode .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 8px; background: var(--cyan); }
.mode.orange .dot { background: var(--orange); }
.mode.magenta .dot { background: var(--magenta); }
.mode.blue .dot { background: var(--blue); }
.mode b { display: block; font-family: 'Chakra Petch', sans-serif; font-size: 16px; }
.mode span { color: var(--muted); font-size: 14px; }

/* ── Screens strip — the promo kit's layout: fixed-width cards in a
   horizontal scroller, images at their natural 9:16. `height: auto` matters:
   the img's height="…" attribute is a presentational hint that would
   otherwise stretch the picture once CSS sets the width. */
.strip { display: flex; gap: 16px; overflow-x: auto; padding: 6px 0 18px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.strip figure { flex: 0 0 232px; margin: 0; scroll-snap-align: start; }
.strip img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.strip figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* Square cube tiles — the theme and effect carousels. */
/* Story 56.3: the link from the theme carousel to the Looks page. */
.looks-link { margin: 2px 0 36px; }
.looks-link a { color: var(--cyan); font-weight: 700; text-decoration: none; }
.looks-link a:hover, .looks-link a:focus-visible { text-decoration: underline; }
.strip.tiles figure { flex: 0 0 176px; }
.strip.tiles img { aspect-ratio: 1 / 1; object-fit: cover; }
.strip.tiles figcaption { font-size: 12px; margin-top: 6px; letter-spacing: .01em; }
@media (max-width: 560px) { .strip.tiles figure { flex: 0 0 146px; } }

/* Each carousel scrolls on its own; the buttons only drive their own strip. */
.carousel { position: relative; }
.carousel + .carousel { margin-top: 38px; padding-top: 34px; border-top: 1px solid var(--line); }
.carousel .trailer-meta { margin-top: 2px; }
.carousel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.carousel-head h3 { font-size: 17px; }
.carousel-head .hint { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--dim); }
.carousel-nav { display: flex; gap: 8px; }
.carousel-nav button {
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  font: inherit; font-size: 15px; line-height: 1; display: grid; place-items: center;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}
.carousel-nav button:hover:not(:disabled) { background: var(--panel); border-color: var(--cyan); }
.carousel-nav button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.carousel-nav button:disabled { opacity: .35; cursor: default; }

/* ── Trailer ────────────────────────────────────────────────────────── */
.trailer { background: #000; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; }
.trailer video { width: 100%; height: 100%; }
.trailer-meta { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ── Support / FAQ ──────────────────────────────────────────────────── */
.support-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.support-item { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.support-item h3 { font-size: 15px; margin-bottom: 6px; }
.support-item p { font-size: 14px; color: var(--muted); }
.support-item a { font-size: 14px; }
.faq { display: grid; gap: 10px; margin-top: 40px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 0; font-family: 'Chakra Petch', sans-serif; font-weight: 600; font-size: 16px; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--cyan); font-family: 'IBM Plex Mono', monospace; }
.faq details[open] summary::after { content: '−'; }
.faq details p { color: var(--muted); font-size: 15px; padding-bottom: 16px; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); padding-block: 28px; font-size: 13px; color: var(--dim); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer .legal { flex-basis: 100%; margin: 4px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }

/* ── Document pages (privacy policy) ────────────────────────────────── */
.doc { max-width: 76ch; margin: 0 auto; padding: 40px 24px 72px; }
.doc h1 { font-size: clamp(30px, 4vw, 42px); }
.doc .meta { font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.08em; color: var(--muted); margin: 10px 0 24px; }
.doc .highlight { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--cyan); border-radius: 12px; padding: 16px 18px; color: var(--text); margin-bottom: 8px; }
.doc h2 { font-size: 22px; margin: 40px 0 12px; padding-top: 8px; }
.doc p, .doc li { color: #c6d0e0; font-size: 16px; }
.doc p { margin: 0 0 12px; }
.doc ul { margin: 0 0 14px 22px; }
.doc li { margin-bottom: 6px; }
.doc strong { color: var(--text); }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .cube-media { max-width: 460px; margin: 0 auto; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  section { padding-block: 52px; }
  .features-grid { grid-template-columns: 1fr; }
  /* Direct children only — the language menu's own links must survive. */
  .site-nav > a:not(.cta):not(.nav-roadmap) { display: none; }
  /* No room in the bar on a phone: the Roadmap link becomes a slim strip
     hanging under the header, still carrying the ring colours on its edge. */
  .site-nav a.nav-roadmap {
    position: absolute; top: 100%; inset-inline: 0; justify-content: center;
    font-size: 13px; padding: 7px 16px; border: 0; border-radius: 0;
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    border-bottom: 1.5px solid transparent;
    border-image: linear-gradient(90deg, var(--cyan), var(--orange), var(--magenta)) 1;
    animation: none;
  }
  .site-nav a.nav-roadmap:hover, .site-nav a.nav-roadmap:focus-visible,
  .site-nav a.nav-roadmap[aria-current="page"] { background: var(--panel-2); }
  .hero .lede { font-size: 18px; }
}

/* ── Right-to-left (Arabic) ─────────────────────────────────────────────
   Flex and grid mirror themselves from dir="rtl"; only the two physically
   positioned things in this sheet need an explicit flip. */
[dir="rtl"] .cube-media .tag { left: auto; right: 14px; }
[dir="rtl"] .doc .highlight { border-left: 0; border-right: 3px solid var(--cyan); }

/* Tracking breaks Arabic: letter-spacing forces the cursive joins apart, so
   every tracked style has to go back to `normal` when the page is RTL. */
[dir="rtl"] .eyebrow,
[dir="rtl"] .cube-media .tag,
[dir="rtl"] .feature .k,
[dir="rtl"] .strip.tiles figcaption,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: normal; }
/* The mono face has no Arabic; fall back to the body face where text is Arabic.
   `.trailer-meta` carries dir="ltr" on the file-size line, which keeps its mono
   look; the carousel hints below inherit RTL and need the body face. */
[dir="rtl"] .eyebrow,
[dir="rtl"] .cube-media .tag,
[dir="rtl"] .feature .k,
[dir="rtl"] .trailer-meta:not([dir="ltr"]) { font-family: 'Manrope', system-ui, sans-serif; letter-spacing: normal; }
