/* Public pages: the landing page and the guide. Rightful Labs design system,
   ink on warm paper with one green, in light and dark. */
@font-face { font-family: Geist; src: url("/fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --ground: #f4f3ef;
  --surface: #ffffff;
  --card: #ffffff;
  --sunk: #ecebe6;
  --ink: #161615;
  --text-2: #56554f;
  --text-3: #7c7b75;
  --line: #16161517;
  --line-strong: #16161529;
  --wash: #1616150a;
  --accent: #13694b;
  --accent-hover: #105840;
  --on-accent: #ffffff;
  --accent-tint: #d6e9e0;
  --on-accent-tint: #0d4a35;
  --warn-tint: #f5e4c3;
  --on-warn-tint: #6a4100;
  --error-tint: #f8dad6;
  --on-error-tint: #8a1d15;
  --shadow-med: 0 1px 2px #1616150f, 0 8px 24px #16161514;
  --shadow-high: 0 2px 4px #16161514, 0 16px 40px #1616151f;
  --radius-inner: 6px;
  --radius-element: 8px;
  --radius-container: 12px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-move: cubic-bezier(0.77, 0, 0.175, 1);
  --page: min(1200px, calc(100% - 32px));
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ground: #0c0c0b;
  --surface: #141413;
  --card: #1a1a18;
  --sunk: #212120;
  --ink: #f4f3ef;
  --text-2: #b5b3ad;
  --text-3: #a3a29b;
  --line: #ffffff17;
  --line-strong: #ffffff29;
  --wash: #ffffff0d;
  --accent: #4cc38a;
  --accent-hover: #7ccaa5;
  --on-accent: #0a3426;
  --accent-tint: #0d4a35;
  --on-accent-tint: #d6e9e0;
  --warn-tint: #6a4100;
  --on-warn-tint: #f5e4c3;
  --error-tint: #8a1d15;
  --on-error-tint: #f8dad6;
  --shadow-med: 0 1px 2px #0000004d, 0 8px 24px #00000066;
  --shadow-high: 0 2px 4px #00000059, 0 16px 40px #00000080;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-tint); color: var(--on-accent-tint); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 500; letter-spacing: -0.022em; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-underline-offset: .2em; }
code, .mono { font-family: "Geist Mono", ui-monospace, monospace; }
:where(a, button, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 50; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-element); }
.skip-link:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Navigation */
.site-nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--ground) 94%, transparent); border-bottom: 1px solid transparent; transition: border-color 180ms var(--ease-out); }
.site-nav[data-scrolled] { border-bottom-color: var(--line); }
.site-nav-inner { display: flex; align-items: center; gap: 24px; width: var(--page); height: 56px; margin: 0 auto; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; letter-spacing: -0.022em; text-decoration: none; }
.wordmark img { width: 24px; height: 24px; }
[data-theme="dark"] .wordmark img { filter: invert(1); }
.alpha-tag { padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 9999px; color: var(--text-2); font-size: 12px; font-weight: 500; line-height: 20px; }
.site-links { display: flex; gap: 4px; margin-left: auto; }
.site-links a { padding: 6px 10px; border-radius: var(--radius-element); color: var(--text-2); font-size: 14px; text-decoration: none; }
@media (hover: hover) { .site-links a:hover { color: var(--ink); background: var(--wash); } }
.site-links a[aria-current="page"] { color: var(--ink); }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-element); background: var(--card); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background-color 120ms var(--ease-out), border-color 120ms var(--ease-out); }
.button svg { width: 16px; height: 16px; }
.button.large { min-height: 44px; padding: 10px 18px; font-size: 16px; }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.button.quiet { background: transparent; border-color: transparent; }
@media (hover: hover) {
  .button:hover { background: color-mix(in srgb, var(--card) 92%, var(--ink)); }
  .button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
  .button.quiet:hover { background: var(--wash); }
}
.button:disabled { opacity: .5; cursor: default; }

/* Shared layout */
.section { width: var(--page); margin: 0 auto; padding: 96px 0 0; }
.section-head { max-width: 640px; margin-bottom: 32px; }
.section-head h2 { font-size: 36px; line-height: 1.2; }
.section-head p { margin-top: 12px; color: var(--text-2); font-size: 17px; }
.kicker { margin-bottom: 12px; color: var(--accent); font-size: 14px; font-weight: 500; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-container); }
.sample-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 12px; }
.sample-tag::before { content: ""; width: 6px; height: 6px; border-radius: 9999px; background: var(--text-3); }

/* Hero */
.hero { width: var(--page); margin: 0 auto; padding: 96px 0 48px; }
.hero h1 { max-width: 15ch; font-size: clamp(40px, 6vw, 72px); line-height: 1.04; letter-spacing: -0.035em; }
.hero-lead { max-width: 56ch; margin-top: 24px; color: var(--text-2); font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.hero-note { margin-top: 16px; color: var(--text-3); font-size: 14px; }

/* The stage: a dithered landscape with the product on top. */
.stage { position: relative; width: var(--page); margin: 0 auto; border-radius: var(--radius-container); overflow: hidden; border: 1px solid var(--line); background: var(--ground); isolation: isolate; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; z-index: -1; }
.stage-inner { position: relative; max-width: 1040px; margin: 0 auto; padding: clamp(48px, 10vw, 128px) clamp(16px, 5vw, 64px) 0; }
.stage .sample-tag { position: absolute; left: 16px; top: 12px; padding: 2px 8px; border-radius: 9999px; background: var(--card); color: var(--text-2); box-shadow: var(--shadow-med); }

/* Product window */
.window { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-container) var(--radius-container) 0 0; box-shadow: var(--shadow-high); }
.window.floating { border-radius: var(--radius-container); }
.window-bar { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 12px; }
.window-dots { display: flex; gap: 6px; }
.window-dots span { width: 10px; height: 10px; border-radius: 9999px; background: var(--line-strong); }
.window-title { flex: 1; text-align: center; margin-right: 46px; }

/* Miniature product UI */
.ui { display: grid; grid-template-columns: 184px minmax(0, 1fr); min-height: 420px; font-size: 13px; background: var(--ground); }
.ui-side { display: grid; align-content: start; gap: 2px; padding: 12px 10px; border-right: 1px solid var(--line); }
.ui-brand { display: flex; align-items: center; gap: 8px; padding: 4px 8px 12px; font-weight: 500; }
.ui-brand img { width: 18px; height: 18px; }
[data-theme="dark"] .ui-brand img { filter: invert(1); }
.ui-org { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-element); background: var(--card); }
.ui-org small { display: block; color: var(--text-3); font-size: 11px; }
.ui-emblem { display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--radius-inner); background: var(--sunk); font-size: 11px; font-weight: 500; }
.ui-nav { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid transparent; border-radius: var(--radius-inner); color: var(--text-2); }
.ui-nav svg { width: 14px; height: 14px; }
.ui-nav.on { background: var(--card); border-color: var(--line); color: var(--ink); font-weight: 500; }
.ui-main { min-width: 0; padding: 20px; }
.ui-title { font-size: 22px; font-weight: 500; letter-spacing: -0.022em; }
.ui-sub { margin-top: 2px; color: var(--text-2); }
.ui-card { margin-top: 16px; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-container); }
.ui-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 500; }
.ui-table { width: 100%; border-collapse: collapse; }
.ui-table th { padding: 8px 12px; color: var(--text-3); font-size: 11px; font-weight: 500; text-align: left; border-bottom: 1px solid var(--line); }
.ui-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ui-table tr:last-child td { border-bottom: 0; }
.ui-table small { display: block; color: var(--text-3); font-size: 11px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border-radius: 9999px; background: var(--sunk); color: var(--text-2); font-size: 11px; line-height: 18px; white-space: nowrap; }
.chip.green { background: var(--accent-tint); color: var(--on-accent-tint); }
.chip.amber { background: var(--warn-tint); color: var(--on-warn-tint); }
.chip.red { background: var(--error-tint); color: var(--on-error-tint); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 9999px; background: currentColor; }
.ui-select { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 112px; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-inner); background: var(--card); }
.ui-select::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(45deg) translateY(-2px); }
.ui-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); }
.ui-button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-inner); background: var(--card); font-weight: 500; white-space: nowrap; }
.ui-button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ui-field { display: grid; gap: 4px; color: var(--text-2); font-size: 12px; }
.ui-input { min-height: 28px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-inner); background: var(--card); color: var(--ink); font-size: 13px; }
.ui-input.tall { min-height: 52px; }
.ui-form { display: grid; gap: 10px; padding: 12px; }
.ui-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ui-file { margin: 0; padding: 12px; background: var(--card); color: var(--ink); font-family: "Geist Mono", ui-monospace, monospace; font-size: 11.5px; line-height: 1.6; white-space: pre-wrap; }
.ui-file .h { color: var(--accent); }
.ui-file .m { color: var(--text-3); }

/* Hero composition: app window with a floating instructions.md */
.hero-shot { position: relative; }
.hero-shot > .window:first-child { width: 80%; }
.hero-shot .floating { position: absolute; right: clamp(16px, 5vw, 64px); bottom: 40px; width: min(330px, 36%); }
.hero-shot .floating .ui-file { max-height: 260px; overflow: hidden; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: step; margin: 0; padding: 0; list-style: none; }
.step { display: grid; align-content: start; gap: 8px; padding: 16px; }
.step-number { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line-strong); border-radius: 9999px; color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.step h3 { margin-top: 8px; font-size: 17px; }
.step p { color: var(--text-2); font-size: 14px; }

/* Feature rows */
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: center; padding: 48px; }
.feature + .feature { margin-top: 24px; }
.feature.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.feature.flip .feature-copy { order: 2; }
.feature-copy h3 { font-size: 28px; line-height: 1.25; }
.feature-copy p { margin-top: 12px; color: var(--text-2); }
.feature-copy ul { display: grid; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; color: var(--text-2); font-size: 15px; }
.feature-copy li { display: grid; grid-template-columns: 16px 1fr; gap: 10px; }
.feature-copy li svg { width: 16px; height: 16px; margin-top: 3px; color: var(--accent); }
.feature-visual { padding: 24px; border-radius: var(--radius-container); background: var(--sunk); }
.feature-visual .window { border-radius: var(--radius-container); box-shadow: var(--shadow-med); }
.org-menu { width: min(300px, 100%); margin-left: auto; padding: 6px; background: var(--card); border-radius: var(--radius-container); box-shadow: var(--shadow-high); font-size: 13px; }
.org-menu-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-inner); }
.org-menu-item small { display: block; color: var(--text-3); font-size: 11px; }
.org-menu-item.on { background: var(--wash); }
.org-menu-item svg { width: 14px; height: 14px; margin-left: auto; color: var(--accent); }
.org-menu hr { margin: 6px 0; border: 0; border-top: 1px solid var(--line); }

/* Alpha scope */
.scope { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.scope .card { padding: 24px; }
.scope h3 { font-size: 17px; }
.scope ul { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; color: var(--text-2); font-size: 15px; }
.scope li { display: flex; gap: 10px; }
.scope li .dot { margin-top: 9px; flex: none; }
.scope .works .dot { color: var(--accent); }
.scope .later .dot { color: var(--text-3); }

/* Closing */
.closing { width: var(--page); margin: 96px auto 0; padding: 64px 48px; text-align: left; background: var(--ink); color: var(--ground); border-radius: var(--radius-container); }
.closing h2 { max-width: 20ch; font-size: 40px; line-height: 1.15; }
.closing p { max-width: 52ch; margin-top: 12px; color: color-mix(in srgb, var(--ground) 72%, transparent); }
.closing .hero-actions .button:not(.primary) { background: transparent; border-color: color-mix(in srgb, var(--ground) 30%, transparent); color: var(--ground); }
[data-theme="dark"] .closing { background: var(--card); color: var(--ink); border: 1px solid var(--line); } [data-theme="dark"] .closing p { color: var(--text-2); } [data-theme="dark"] .closing .hero-actions .button:not(.primary) { color: var(--ink); border-color: var(--line-strong); }
.site-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; width: var(--page); margin: 64px auto 0; padding: 24px 0 40px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 14px; }
.site-footer nav { display: flex; gap: 16px; margin-left: auto; }
.site-footer a { color: var(--text-2); }

/* Guide */
.guide-hero { width: var(--page); margin: 0 auto; padding: 64px 0 32px; }
.guide-hero h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.08; letter-spacing: -0.03em; }
.guide-hero p { max-width: 60ch; margin-top: 16px; color: var(--text-2); font-size: 18px; }
.player { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; width: var(--page); margin: 0 auto; }
.chapters { display: grid; align-content: start; gap: 4px; margin: 0; padding: 0; list-style: none; }
.chapter { display: grid; grid-template-columns: 28px 1fr; gap: 12px; width: 100%; padding: 10px; border: 1px solid transparent; border-radius: var(--radius-element); background: none; color: var(--text-2); font: inherit; text-align: left; cursor: pointer; }
.chapter .step-number { width: 28px; height: 28px; transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out); }
.chapter strong { display: block; color: var(--ink); font-size: 14px; font-weight: 500; }
.chapter small { display: block; margin-top: 2px; font-size: 13px; }
@media (hover: hover) { .chapter:hover { background: var(--wash); } }
.chapter[aria-current="step"] { background: var(--card); border-color: var(--line); }
.chapter[aria-current="step"] .step-number, .chapter.done .step-number { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.screen { position: relative; }
.screen .window { border-radius: var(--radius-container); }
.screen-body { position: relative; overflow: hidden; }
.screen-body .ui { min-height: 460px; }
.pointer { position: absolute; left: 0; top: 0; z-index: 3; width: 22px; height: 22px; pointer-events: none; transition: transform 320ms var(--ease-move), opacity 180ms var(--ease-out); filter: drop-shadow(0 1px 2px #16161540); }
.ring { position: absolute; z-index: 2; border: 2px solid var(--accent); border-radius: var(--radius-element); pointer-events: none; opacity: 0; transition: opacity 180ms var(--ease-out); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.ring[data-on] { opacity: 1; }
.callout { position: absolute; z-index: 4; max-width: 260px; padding: 10px 12px; background: var(--ink); color: var(--ground); border-radius: var(--radius-element); font-size: 13px; line-height: 1.45; box-shadow: var(--shadow-med); opacity: 0; transition: opacity 180ms var(--ease-out); }
.callout[data-on] { opacity: 1; }
.player-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.progress { flex: 1; min-width: 120px; height: 4px; border-radius: 9999px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 9999px; transition: width 240ms var(--ease-out); }
.step-text { margin-top: 24px; padding: 20px; }
.step-text h2 { font-size: 22px; }
.step-text p { margin-top: 8px; color: var(--text-2); }
.step-text ol { margin: 12px 0 0; padding-left: 20px; color: var(--text-2); }
.step-text li + li { margin-top: 4px; }
.guide-all { width: var(--page); margin: 0 auto; }
.guide-all details { padding: 0; }
.guide-all summary { padding: 16px 20px; font-weight: 500; cursor: pointer; }
.guide-all .all-steps { display: grid; gap: 20px; padding: 0 20px 20px; }
.guide-all .all-steps h3 { font-size: 16px; }
.guide-all .all-steps p { margin-top: 4px; color: var(--text-2); font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  .pointer, .ring, .callout, .progress span, .site-nav, .chapter .step-number, .button { transition: none; }
}
@media (max-width: 1000px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature, .feature.flip { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 24px; }
  .feature.flip .feature-copy { order: 0; }
  .player { grid-template-columns: minmax(0, 1fr); }
  .chapters { grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); overflow-x: auto; padding-bottom: 4px; }
}
@media (max-width: 720px) {
  .site-links a:not(.keep) { display: none; }
  .site-nav-inner { gap: 10px; }
  .wordmark, .site-nav .button, .site-links a { white-space: nowrap; }
  .site-nav .alpha-tag { display: none; }
  .hero { padding-top: 56px; }
  .section { padding-top: 64px; }
  .section-head h2 { font-size: 28px; }
  .steps, .scope { grid-template-columns: minmax(0, 1fr); }
  .ui { grid-template-columns: minmax(0, 1fr); }
  .ui-side { display: none; }
  .hero-shot > .window:first-child { width: 100%; }
  .hero-shot .floating { position: static; width: auto; margin: 16px 0 0; }
  .ui-row { grid-template-columns: minmax(0, 1fr); }
  .closing { padding: 40px 24px; }
  .closing h2 { font-size: 30px; }
  .ui-table .hide-sm { display: none; }
  .callout { max-width: 200px; }
}
.guide-hero p.kicker { margin-top: 0; color: var(--accent); font-size: 14px; }

/* Theme toggle */
.theme-toggle { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-element); background: transparent; color: var(--ink); cursor: pointer; }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .sun, [data-theme="dark"] .theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
@media (hover: hover) { .theme-toggle:hover { background: var(--wash); } }
