/* Public site pages (index.html, about.html). Loaded AFTER theme.css: it reuses theme.css's
   tokens and controls so the site reads as the same product as the app, and only adds what a
   scrolling document needs (theme.css is built for full-screen app shells: no page scroll,
   13 px text). Dark-first; [data-theme="light"] swaps the tokens. The 3D stage and the demo
   slots stay dark in both themes on purpose: the hologram is additive light and only reads
   on a dark ground.
   Photosafety (BUGS #14): only eased opacity/transform transitions, nothing blinks, and all
   motion stops under prefers-reduced-motion. */

:root {
  --maxw: 1160px;
  --gutter: 16px;
  --on-accent: #06131a;
  --link: #7fdfff;
  --card: linear-gradient(180deg, rgba(16, 22, 29, .92), rgba(12, 17, 23, .92));
  --nav-bg: rgba(10, 13, 17, .86);
  --stage: radial-gradient(120% 90% at 50% 20%, #12202c 0%, #0a0f15 60%, #070a0e 100%);
  --hero-glow: radial-gradient(900px 520px at 70% -10%, rgba(79, 209, 255, .14), rgba(79, 209, 255, 0) 70%);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f7fa;
  --panel: #ffffff;
  --panel-2: #eef3f7;
  --line: #d5dee6;
  --line-2: #bfcdd9;
  --text: #0e1a24;
  --muted: #45596a;    /* 6.8:1 on --bg */
  --faint: #5b6e80;    /* 5.0:1 on --bg */
  --accent: #006f96;   /* 5.7:1 on white: used for text too */
  --accent-soft: rgba(0, 111, 150, .10);
  --on-accent: #ffffff;
  --link: #005d80;
  --ok: #1d7a45;
  --card: linear-gradient(180deg, #ffffff, #f8fbfd);
  --nav-bg: rgba(244, 247, 250, .88);
  --hero-glow: radial-gradient(900px 520px at 70% -10%, rgba(0, 111, 150, .10), rgba(0, 111, 150, 0) 70%);
  color-scheme: light;
}

html.site, html.site body { height: auto; overflow-x: hidden; overflow-y: auto; }
html.site { background: var(--hero-glow), var(--bg); }
html.site body { font: 16px/1.6 var(--sans); background: transparent; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html.site { scroll-behavior: smooth; } }

.site a { color: var(--link); }
.site a:hover { color: var(--text); }
.site :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 8px 12px; background: var(--panel); color: var(--text); border-radius: 6px; }
.skip:focus { left: 16px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.site main section { padding: 56px 0 8px; }
.site h1, .site h2, .site h3 { line-height: 1.2; text-wrap: balance; }
.site h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); margin: 0 0 8px; }
.kicker {
  margin: 0 0 10px; font: 700 12px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.lede { color: var(--muted); max-width: 62ch; margin: 0 0 24px; }

/* Buttons as links ("Try it"): same look as theme.css buttons, sized for touch. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text) !important;
  font-weight: 600; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent) !important; }
.btn.primary:hover { filter: brightness(1.08); }
@media (prefers-reduced-motion: no-preference) { .btn { transition: background .15s, border-color .15s, filter .15s; } }

/* ---- hero ---- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: center; padding: 32px 0 16px; }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; padding-top: 56px; } }
.hero h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.4rem); margin: 0 0 14px; letter-spacing: -.015em; }
.hero h1 span { color: var(--accent); }
.hero .pitch { font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); color: var(--muted); margin: 0 0 24px; max-width: 34ch; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.hero .small { color: var(--muted); font-size: 14px; margin: 0; }

.stage {
  position: relative; width: 100%; max-width: 640px; justify-self: center; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden;
  background: var(--stage); border: 1px solid #1d2935; box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.stage img, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage img { object-fit: cover; }
.stage canvas { opacity: 0; }
.stage.live canvas { opacity: 1; }
.stage.live img { opacity: 0; }
@media (prefers-reduced-motion: no-preference) { .stage img, .stage canvas { transition: opacity .6s ease; } }
.stage-note {
  position: absolute; left: 12px; bottom: 10px; right: 12px; margin: 0; font: 12px/1.4 var(--mono); color: #9fb3c4;
  pointer-events: none; text-shadow: 0 1px 2px #000;
}
.stage-load {
  position: absolute; right: 12px; top: 12px; min-height: 36px; padding: 0 12px; border-radius: 8px;
  color: #d6e4ef; background: rgba(10, 13, 17, .7); border: 1px solid #2a3a4a; font: 600 13px var(--sans); cursor: pointer;
}

/* ---- feature gallery ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card);
}
.card h3 { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; margin: 0; }
.card h3 .ico { font-size: 1.2rem; }
.card .body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.card .try { font-weight: 600; text-decoration: none; padding: 10px 0; }
.card .try:hover { text-decoration: underline; }
.tag {
  font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 8px; white-space: nowrap;
}
.tag.soon { color: var(--warm); border-color: rgba(255, 209, 102, .5); }
:root[data-theme="light"] .tag.soon { color: #7a5600; border-color: rgba(122, 86, 0, .45); }

/* Demo slot: always dark (see the header). The canvas is drawn by assets/site/demo-slot.js. */
.demo { position: relative; aspect-ratio: 16 / 10; margin: 0; background: var(--stage); border-bottom: 1px solid #1d2935; }
.demo canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.demo .pp {
  position: absolute; right: 8px; top: 8px; width: 36px; height: 36px; padding: 0; border-radius: 50%;
  color: #d6e4ef; background: rgba(10, 13, 17, .6); border: 1px solid #2a3a4a; font-size: 13px; cursor: pointer;
}
.demo .pp:focus-visible { outline: 2px solid #4fd1ff; outline-offset: 2px; }
.demo .src {
  position: absolute; left: 10px; top: 8px; font: 11px var(--mono); color: #8196a8; letter-spacing: .06em; pointer-events: none;
}

/* ---- needs / privacy / footer ---- */
.needs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.needs li { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--card); }
.needs b { display: block; margin-bottom: 4px; }
.needs span { color: var(--muted); font-size: 15px; }
.privacy {
  display: flex; gap: 12px; align-items: flex-start; margin: 24px 0 0; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--line); border-left: 3px solid var(--ok); background: var(--card); color: var(--muted);
}
.privacy b { color: var(--text); }
.site-foot { margin-top: 64px; padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-foot ul { margin: 8px 0 0; padding-left: 18px; }
.site-foot li { margin: 4px 0; }

/* ---- about page (document layout, like the ASL about page) ---- */
.doc { max-width: 46rem; margin: 0 auto; padding: 32px var(--gutter) 24px; }
.doc header.page { border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 8px; }
.doc header.page h1 { font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.2rem); margin: 0 0 8px; }
.doc header.page p { color: var(--muted); margin: 0; font-size: 1.05rem; }
.site .doc section { margin: 32px 0; padding: 0; }
.doc h2 { font: 800 12px/1.4 var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
.doc p { margin: 10px 0; }
.doc .box { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 14px 18px; }
.doc .box.good { border-left: 3px solid var(--ok); }
.doc .box.warn { border-left: 3px solid var(--warm); }
:root[data-theme="light"] .doc .box.warn { border-left-color: #b07d00; }
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding-left: 26px; margin: 10px 0; }
.ticks li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.good .ticks li::before { content: "✓"; color: var(--ok); }
.warn .ticks li::before { content: "–"; color: var(--warm); }
:root[data-theme="light"] .warn .ticks li::before { color: #8a6300; }
.ticks li span, .steps li { color: var(--muted); }
.ticks li b, .steps li b { color: var(--text); }
.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; }
.steps li { position: relative; padding-left: 36px; margin: 12px 0; }
.steps li::before {
  counter-increment: s; content: counter(s); position: absolute; left: 0; top: 2px; width: 24px; height: 24px;
  display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); color: var(--accent);
  font: 700 12px var(--mono);
}
.site code { font: .9em var(--mono); background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
