/* Black/white with one blue accent, #2563EB in every appearance.
   White on blue is 5.17:1; blue on black is reserved for large text and focus rings. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #6e6e73;
  --solid: #f5f5f7;
  --line: rgba(0, 0, 0, .10);
  --accent: #2563eb;
  --fill: var(--accent);
  --ring: var(--accent);
  --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 96px;
  --h: 44px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --fg: #ffffff;
  --muted: #ffffff;  /* all text white in dark mode */
  --solid: #141416;
  --line: rgba(255, 255, 255, .14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, dl, dd, ol, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); font-size: .9em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--fill); color: #fff; }
.accent { color: var(--accent); }
.skip-link { position: absolute; z-index: 10; top: -100px; left: var(--s4); padding: var(--s2) var(--s3); background: var(--fill); color: #fff; border-radius: 8px; }
.skip-link:focus { top: var(--s3); }

/* one column width for everything */
.site-header, main, .site-footer { width: min(1120px, 100% - 2 * var(--s5)); margin-inline: auto; }

.site-header { display: flex; align-items: center; gap: var(--s5); min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand img { display: block; }
.site-nav { display: flex; gap: var(--s5); margin-left: auto; font-size: 14px; color: var(--muted); }
.site-nav a:hover, .site-footer a:hover { color: var(--accent); }
html[data-theme="dark"] .site-nav a:hover, html[data-theme="dark"] .site-footer a:hover { color: var(--fg); }

/* BB-8: artwork untouched and unframed (no outline, like the app); just size and a focusable checkbox (bb8.css hides it with display:none) */
.bb8-toggle { --toggle-size: 6.3px; flex: none; }
.bb8-toggle__checkbox { display: block !important; position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.bb8-toggle__checkbox:focus-visible + .bb8-toggle__container { outline: 3px solid var(--ring); outline-offset: 4px; }

.hero { padding: 120px 0 var(--s8); text-align: center; }
h1 { margin: 0 0 var(--s5); font-size: clamp(42px, 7.5vw, 88px); font-weight: 800; line-height: 1; letter-spacing: -.04em; text-wrap: balance; }
.lede { max-width: 34rem; margin-inline: auto; color: var(--muted); font-size: clamp(17px, 2vw, 20px); line-height: 1.5; text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s3); margin-top: var(--s6); }
.button { display: inline-flex; align-items: center; gap: 10px; min-height: var(--h); padding: 0 22px; border: 1px solid var(--line); border-radius: 999px; font-size: 15px; font-weight: 600; transition: background-color .2s, border-color .2s; }
.button:hover { border-color: var(--fg); }
.button.primary { background: var(--fill); border-color: transparent; color: #fff; }
.button.primary:hover { border-color: var(--fg); } /* outline, not a lighter blue: #2563EB stays the only blue */
.button.primary:active { transform: scale(.98); }

.preview { margin-top: 88px; text-align: left; }
.preview figcaption { margin-top: var(--s4); font-size: 13px; color: var(--muted); text-align: center; }
/* the video sits on a quiet surface "stage"; its fill matches the footage (white light demo, black dark demo), so nothing flashes before the poster loads */
.preview-player { position: relative; padding: clamp(8px, 1.6vw, 20px); border-radius: 24px; background: var(--solid); }
.preview video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 14px; background: #000;
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, .22); }
.preview video[data-demo="light"] { display: none; background: #fff; }
html[data-theme="light"] .preview video[data-demo="light"] { display: block; }
html[data-theme="light"] .preview video[data-demo="dark"] { display: none; }
html[data-theme="dark"] .preview video { box-shadow: 0 24px 64px -16px rgba(0, 0, 0, .9); }
/* clean poster until it plays: hide the native control bar while the Play button shows (script.js hides it on play) */
.preview-player:has(.preview-play:not([hidden])) video::-webkit-media-controls { display: none !important; }
.preview-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 24px 0 20px; border: 0; border-radius: 999px; background: var(--fill); color: #fff; font: 600 15px var(--font); white-space: nowrap; cursor: pointer;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .55), 0 12px 32px rgba(0, 0, 0, .25); transition: transform .2s; }
.preview-play:hover { transform: translate(-50%, -50%) scale(1.04); }
.preview-play:active { transform: translate(-50%, -50%) scale(.98); }
.preview-play[hidden] { display: none; }

.section { padding: var(--s8) 0; }
h2 { max-width: 20ch; font-size: clamp(30px, 4.5vw, 52px); font-weight: 800; line-height: 1.06; letter-spacing: -.035em; text-wrap: balance; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s6); margin-top: var(--s7); padding: 0; list-style: none; }
.steps li { padding-top: var(--s4); }
.steps h3 { margin: 0 0 var(--s2); font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.steps p, .principle-list dd { color: var(--muted); font-size: 15px; }
.principle-list { margin-top: var(--s7); }
.principle-list div { display: grid; grid-template-columns: 220px 1fr; gap: var(--s4); padding: var(--s5) 0; }
.principle-list dt { font-weight: 700; font-size: 17px; }

.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); padding: var(--s6) 0 var(--s7); font-size: 14px; color: var(--muted); }

@media (max-width: 800px) {
  .steps { grid-template-columns: 1fr; gap: var(--s5); }
  .principle-list div { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 600px) {
  .site-header, main, .site-footer { width: calc(100% - 2 * var(--s4)); }
  .site-header { gap: var(--s3); min-height: 64px; }
  .site-nav { display: none; }
  /* padding grows the tap target to 44px; negative margin keeps the artwork in place */
  .bb8-toggle { --toggle-size: 5.8px; margin: -8px -8px -8px auto; padding: 8px; }
  .hero { padding: 64px 0 var(--s7); }
  .preview { margin-top: var(--s7); }
  .preview-player { border-radius: 16px; }
  .preview video { border-radius: 10px; }
  .preview-play { min-height: 44px; padding: 0 18px 0 16px; font-size: 14px; box-shadow: 0 0 0 4px rgba(255, 255, 255, .55), 0 8px 24px rgba(0, 0, 0, .25); }
  .button { min-width: 200px; justify-content: center; }
  .section { padding: var(--s7) 0; }
}

@media (prefers-reduced-motion: reduce) {
  /* no blanket transform:none: BB-8 positions its parts with transforms */
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
/* Increase Contrast keeps the same blue and strengthens neutral text. */
@media (prefers-contrast: more) {
  :root { --line: #8e8e93; --muted: #3a3a3c; }
  html[data-theme="dark"] { --line: #8e8e93; }
}
