/* Minimal landing page — clean, readable, light/dark via data-theme. */

:root,
[data-theme="light"] {
  --bg: #fafafa;
  --fg: #1a1a1a;
  --muted: #5c5c5c;
  --border: #e5e5e5;
  /* Brand green (app --color-primary; logo + links) */
  --brand: #0a9208;
  --link: var(--brand);
  --link-hover: #087a06;
  --demo-bg: #ffffff;
  --code-bg: #f4f4f5;
  --tok-comment: #6a737d;
  --tok-string: #032f62;
  --tok-cmd: #0a9208;
  --tok-flag: #6f42c1;
  --tok-path: #005cc5;
  --tok-op: #d73a49;
  --frame-h: min(72vh, 720px);
  --max: 960px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #111;
  --fg: #f0f0f0;
  --muted: #a0a0a0;
  --border: #2a2a2a;
  --brand: #4ade80;
  --link: var(--brand);
  --link-hover: #86efac;
  --demo-bg: #1a1a1a;
  --code-bg: #1a1a1a;
  --tok-comment: #8b949e;
  --tok-string: #a5d6ff;
  --tok-cmd: #4ade80;
  --tok-flag: #d2a8ff;
  --tok-path: #79c0ff;
  --tok-op: #ff7b72;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
  background: var(--bg);
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.5;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--fg);
  font-weight: 650;
  text-decoration: none;
}

.brand:hover {
  color: var(--fg);
  text-decoration: none;
  opacity: 0.85;
}

.logo {
  display: block;
  flex-shrink: 0;
  color: var(--brand);
}

.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.1rem;
  font-size: 0.95rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--muted);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}

/* Show the icon for the *other* theme (action affordance) */
[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
}

.hero {
  padding: 1.5rem 0 1.25rem;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.tagline {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.tagline strong {
  color: var(--fg);
  font-weight: 600;
}

.cta {
  margin: 1.15rem 0 0.35rem;
  color: var(--fg);
  font-size: 1.05rem;
  font-weight: 550;
}

.cta-note {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.95rem;
  opacity: 0.9;
}

.btn {
  display: inline-block;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-size: 0.95rem;
  font-weight: 550;
  text-decoration: none;
  background: transparent;
}

.btn:hover {
  color: var(--fg);
  text-decoration: none;
  border-color: var(--muted);
}

.demo {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--demo-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .demo {
  box-shadow: none;
}

.demo iframe {
  display: block;
  width: 100%;
  height: var(--frame-h);
  border: 0;
  background: var(--demo-bg);
  color-scheme: light dark;
}

.demo-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0.65rem 0 0;
}

.section {
  margin-top: 2.5rem;
  scroll-margin-top: 1rem;
}

.section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.section h3 {
  margin: 1.35rem 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

.section p {
  margin: 0 0 0.85rem;
  color: var(--muted);
}

.section p:last-child {
  margin-bottom: 0;
}

.section strong {
  color: var(--fg);
  font-weight: 600;
}

.section em {
  font-style: italic;
}

.section .more {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.shot {
  margin: 1rem 0 1.15rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--demo-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .shot {
  box-shadow: none;
}

.shot img,
.shot video {
  display: block;
  width: 100%;
  height: auto;
}

.shot video {
  background: #000;
  max-height: min(70vh, 640px);
  object-fit: contain;
  /* Decorative looping demo — no interactive control bar */
  pointer-events: none;
}

/* Theme-aware scripting screenshots */
.shot .shot-dark {
  display: none;
}

[data-theme="dark"] .shot .shot-light {
  display: none;
}

[data-theme="dark"] .shot .shot-dark {
  display: block;
}

.code-block {
  margin: 0.85rem 0 1rem;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.55;
}

.code-block code {
  font-size: inherit;
  font-family: inherit;
  white-space: pre;
  color: inherit;
  background: none;
  padding: 0;
}

/* Syntax tokens (applied by inline highlighter) */
.tok-comment { color: var(--tok-comment); font-style: italic; }
.tok-string  { color: var(--tok-string); }
.tok-cmd     { color: var(--tok-cmd); font-weight: 600; }
.tok-flag    { color: var(--tok-flag); }
.tok-path    { color: var(--tok-path); }
.tok-op      { color: var(--tok-op); }

code {
  font-family: var(--mono);
  font-size: 0.9em;
}

footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

footer p {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
