/* ============================================================
   Jarvis — e-ink · thin grid · curves
   ============================================================ */

:root {
  color-scheme: light;

  --paper: #f4f1ea;
  --paper-soft: #ebe7de;
  --surface: #faf8f3;
  --ink: #1a1a1a;
  --ink-muted: #5a5650;
  --ink-faint: #8a847a;
  --line: rgba(26, 26, 26, 0.12);
  --line-strong: rgba(26, 26, 26, 0.35);
  --line-grid: rgba(26, 26, 26, 0.06);

  --nav-bg: rgba(244, 241, 234, 0.92);
  --guide-nav-bg: rgba(250, 248, 243, 0.94);
  --selection-bg: rgba(26, 26, 26, 0.1);
  --btn-ink-hover-bg: #000;
  --btn-ink-hover-border: #000;
  --grain-opacity: 0.03;
  --media-filter: grayscale(0.12) contrast(1.03);

  --radius: 4px;
  --radius-lg: 8px;
  --serif: "Fraunces", Georgia, serif;
  --body: "Literata", Georgia, serif;
  --nav-h: 64px;
}

[data-theme="dark"] {
  color-scheme: dark;

  --paper: #1a1917;
  --paper-soft: #22211e;
  --surface: #252420;
  --ink: #e8e4dc;
  --ink-muted: #a8a299;
  --ink-faint: #787269;
  --line: rgba(232, 228, 220, 0.1);
  --line-strong: rgba(232, 228, 220, 0.22);
  --line-grid: rgba(232, 228, 220, 0.05);

  --nav-bg: rgba(26, 25, 23, 0.92);
  --guide-nav-bg: rgba(37, 36, 32, 0.94);
  --selection-bg: rgba(232, 228, 220, 0.15);
  --btn-ink-hover-bg: #f4f1ea;
  --btn-ink-hover-border: #f4f1ea;
  --grain-opacity: 0.05;
  --media-filter: grayscale(0.08) contrast(1.05) brightness(0.92);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: clip;
}

::selection {
  background: var(--selection-bg);
}

a { color: inherit; text-decoration: none; }

/* ---------- Grid field ---------- */
.grid-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--line-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-grid) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* subtle paper grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Decorative curves ---------- */
.curve-deco {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  color: var(--line-strong);
  opacity: 0.5;
}

.curve-tl {
  top: 80px;
  left: -20px;
  width: min(200px, 30vw);
  height: auto;
}

.curve-br {
  bottom: 40px;
  right: -20px;
  width: min(240px, 35vw);
  height: auto;
}

.curve-divider {
  width: 100%;
  height: 48px;
  margin-bottom: 32px;
  color: var(--line-strong);
}

.curve-divider svg {
  width: 100%;
  height: 100%;
}

.curve-divider-up {
  margin-bottom: 0;
  margin-top: -24px;
}

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
}

.nav {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(20px, 4vw, 48px);
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.site-nav.scrolled .nav {
  border-bottom-color: var(--line);
}

.nav-logo {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  justify-self: start;
}

.nav-links {
  display: flex;
  gap: clamp(18px, 3vw, 32px);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-muted);
}

@media (min-width: 769px) {
  .nav-links {
    position: fixed;
    left: 50%;
    top: 0;
    height: var(--nav-h);
    align-items: center;
    transform: translateX(-50%);
    z-index: 101;
    pointer-events: none;
  }

  .nav-links a {
    pointer-events: auto;
  }
}

.nav-links a {
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

.nav-toggle,
.nav-close,
.nav-drawer-head,
.nav-drawer-cta,
.nav-backdrop {
  display: none;
}

.nav-toggle,
.nav-close {
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.nav-toggle:hover,
.nav-close:hover {
  color: var(--ink);
  background: var(--paper-soft);
}

.nav-toggle svg,
.nav-close svg {
  width: 20px;
  height: 20px;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  color: var(--ink);
  background: var(--paper-soft);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

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

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

@media (max-width: 768px) {
  .nav {
    grid-template-columns: 1fr auto auto;
    gap: 8px;
  }

  .nav-toggle {
    display: grid;
    justify-self: end;
  }

  .nav-actions {
    gap: 8px;
  }

  .nav-actions .nav-download {
    display: none;
  }

  .nav-actions .btn.sm {
    padding: 9px 14px;
    font-size: 12px;
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 220;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: min(300px, 88vw);
    padding: 0 0 24px;
    margin: 0;
    color: var(--ink);
    background: var(--surface);
    border-right: 1px solid var(--line-strong);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.12);
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    pointer-events: none;
  }

  .nav-links.open {
    transform: translateX(0);
    pointer-events: auto;
  }

  .nav-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: var(--nav-h);
    padding: 0 16px 0 20px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
  }

  .nav-drawer-title {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 600;
    color: var(--ink);
  }

  .nav-close {
    display: grid;
    flex-shrink: 0;
  }

  .nav-links a:not(.nav-drawer-cta) {
    padding: 16px 20px;
    font-size: 16px;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }

  .nav-links a:not(.nav-drawer-cta):hover {
    background: var(--paper-soft);
    border-bottom-color: var(--line);
  }

  .nav-drawer-cta {
    display: inline-flex;
    margin: 20px 20px 0;
    min-height: 44px;
    justify-content: center;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 210;
    background: color-mix(in srgb, var(--ink) 40%, transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
  }

  .nav-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  body.nav-open {
    overflow: hidden;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn.sm { padding: 9px 18px; font-size: 13px; }
.btn.lg { padding: 15px 32px; font-size: 15px; }

.btn-ink {
  background: var(--ink);
  color: var(--surface);
  border: 1.5px solid var(--ink);
}

.btn-ink:hover {
  background: var(--btn-ink-hover-bg);
  border-color: var(--btn-ink-hover-border);
}

.btn[aria-disabled="true"] {
  pointer-events: none;
  cursor: default;
  opacity: 0.72;
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}

.btn-outline:hover {
  background: var(--paper-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  max-width: 1140px;
  margin: 0 auto;
  padding: clamp(48px, 9vh, 88px) clamp(20px, 4vw, 48px) clamp(40px, 6vh, 64px);
}

.hero-zigzag {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) auto minmax(0, 1fr);
  column-gap: clamp(20px, 3vw, 36px);
  align-items: center;
  min-height: 0;
}

.hero-copy {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  position: relative;
  z-index: 1;
  max-width: 520px;
  transform: translate3d(0, var(--hero-copy-y, 0), 0);
  will-change: transform;
}

.hero-divide {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 24px;
  height: clamp(160px, 28vh, 240px);
  z-index: 1;
}

.hero-divide-cap {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--paper);
  opacity: var(--hero-divide-cap, 0);
  transform: scale(var(--hero-divide-cap, 0));
}

.hero-divide-line {
  flex: 1;
  width: 1px;
  min-height: 32px;
  background: var(--line-strong);
  transform: scaleY(var(--hero-divide-scale, 0));
  transform-origin: top center;
  opacity: var(--hero-divide-scale, 0);
}

.hero-shot--scroll {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  transform: translate3d(var(--hero-shot-x, 0), var(--hero-shot-y, 0), 0);
  opacity: var(--hero-shot-opacity, 1);
  will-change: transform, opacity;
}

@media (max-width: 900px) {
  .hero {
    padding: clamp(36px, 7vh, 56px) clamp(16px, 4vw, 28px) clamp(32px, 5vh, 48px);
  }

  .hero-zigzag {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    row-gap: clamp(20px, 4vh, 28px);
    min-height: 0;
  }

  .hero-copy {
    grid-column: 1;
    grid-row: 1;
    max-width: none;
    width: 100%;
    text-align: center;
    margin-inline: auto;
    transform: none !important;
  }

  .hero-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero-divide {
    grid-column: 1;
    grid-row: 2;
    flex-direction: row;
    width: min(100%, 280px);
    height: auto;
    min-height: 0;
    margin-inline: auto;
  }

  .hero-divide-line {
    flex: 1;
    width: auto;
    height: 1px;
    min-height: 0;
    min-width: 40px;
    transform: scaleX(var(--hero-divide-scale, 1));
    transform-origin: center;
  }

  .hero-shot--scroll {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    max-width: none;
    margin-inline: auto;
    transform: none !important;
    opacity: 1 !important;
  }
}

@media (max-width: 640px) {
  .hero-zigzag {
    row-gap: 24px;
  }

  .hero-divide {
    display: none;
  }

  .hero-copy {
    text-align: left;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  .hero h1 {
    font-size: clamp(30px, 8.2vw, 40px);
    margin-bottom: 16px;
  }

  .lead {
    font-size: 16px;
    line-height: 1.65;
    max-width: none;
    margin-bottom: 22px;
  }

  .hero-shot--scroll {
    grid-row: 2;
  }

  .hero-copy {
    grid-row: 1;
  }
}

@media (max-width: 900px) {
  .lead { margin-inline: auto; max-width: 36ch; }
}

@media (max-width: 640px) {
  .lead { margin-inline: 0; max-width: none; }
}

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 16px;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(38px, 5.5vw, 58px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero h1 em {
  font-style: italic;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.1em;
  text-decoration-color: var(--line-strong);
}

.lead {
  font-size: 18px;
  color: var(--ink-muted);
  max-width: 44ch;
  margin-bottom: 28px;
}

.device-frame {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

.device-frame img:not(.hero-demo-fallback) {
  display: block;
  width: 100%;
  height: auto;
  filter: var(--media-filter);
}

.hero-demo {
  position: relative;
  line-height: 0;
}

.hero-demo-video {
  display: block;
  width: 100%;
  height: auto;
  filter: var(--media-filter);
  vertical-align: top;
}

[data-theme="dark"] .hero-demo-video {
  filter: none;
}

.hero-demo-fallback {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .hero-demo-video { display: none !important; }
  .hero-demo .hero-demo-fallback { display: block; }
}

/* ---------- Strip ---------- */
.strip {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface);
}

.strip-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
  padding: 16px 24px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.03em;
}

.strip-inner i {
  width: 1px;
  height: 14px;
  background: var(--line-strong);
}

/* ---------- Metrics ---------- */
.metrics {
  position: relative;
  z-index: 1;
  max-width: 1140px;
  margin: 0 auto;
  padding: clamp(28px, 4vh, 40px) clamp(20px, 4vw, 48px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
}

@media (max-width: 768px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
  .metrics { grid-template-columns: 1fr; }
}

.metric-card {
  background: var(--surface);
  padding: 22px 18px;
  text-align: center;
}

.metric-card strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(26px, 3.5vw, 32px);
  font-weight: 600;
  margin-bottom: 4px;
}

.metric-card span:last-child {
  font-size: 13px;
  color: var(--ink-muted);
}

/* ---------- Dump & think ---------- */
.duothink-section {
  padding-top: clamp(48px, 8vh, 72px);
  padding-bottom: clamp(48px, 8vh, 72px);
}

.duothink-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 56px);
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: clamp(28px, 4vw, 40px);
}

@media (max-width: 900px) {
  .duothink-grid {
    grid-template-columns: 1fr;
  }
  .duothink-illustration { order: -1; }
}

.duothink-illustration {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
}

.duothink-svg {
  display: block;
  width: 100%;
  height: auto;
  color: var(--ink);
}

.illus-label {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  fill: var(--ink);
}

.illus-label-sm {
  font-family: var(--body);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: var(--ink-faint);
}

.illus-q {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  fill: var(--ink);
}

.illus-dump path,
.illus-think path,
.illus-flow path {
  vector-effect: non-scaling-stroke;
}

.duothink-copy h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-bottom: 14px;
}

.duothink-copy h2 em {
  font-style: italic;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.1em;
  text-decoration-color: var(--line-strong);
}

.duothink-lead {
  font-size: 17px;
  color: var(--ink-muted);
  margin-bottom: 28px;
  line-height: 1.65;
}

.duothink-cards {
  display: grid;
  gap: 1px;
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
}

.duothink-card {
  background: var(--paper);
  padding: 22px 20px;
  position: relative;
}

.duothink-num {
  position: absolute;
  top: 18px;
  right: 18px;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}

.duothink-card h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.duothink-card p {
  font-size: 15px;
  color: var(--ink-muted);
  line-height: 1.6;
  padding-right: 28px;
}

/* subtle draw-in on reveal */
.duothink-grid.reveal.in .illus-dump path,
.duothink-grid.reveal.in .illus-flow path,
.duothink-grid.reveal.in .illus-think path,
.duothink-grid.reveal.in .illus-think line,
.duothink-grid.reveal.in .illus-core path,
.duothink-grid.reveal.in .illus-core circle {
  animation: ink-draw 1.2s ease forwards;
}

.duothink-grid.reveal.in .illus-dump path:nth-child(2) { animation-delay: 0.05s; }
.duothink-grid.reveal.in .illus-dump path:nth-child(3) { animation-delay: 0.1s; }
.duothink-grid.reveal.in .illus-flow path { animation-delay: 0.25s; }
.duothink-grid.reveal.in .illus-core circle { animation-delay: 0.35s; }
.duothink-grid.reveal.in .illus-think path { animation-delay: 0.45s; }

@keyframes ink-draw {
  from { stroke-dashoffset: 400; stroke-dasharray: 400; }
  to { stroke-dashoffset: 0; stroke-dasharray: 400; }
}

@media (prefers-reduced-motion: reduce) {
  .duothink-grid.reveal.in .illus-dump path,
  .duothink-grid.reveal.in .illus-flow path,
  .duothink-grid.reveal.in .illus-think path,
  .duothink-grid.reveal.in .illus-think line,
  .duothink-grid.reveal.in .illus-core path,
  .duothink-grid.reveal.in .illus-core circle {
    animation: none;
  }
}

.illus-node-label {
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  fill: var(--ink-muted);
}

/* ---------- Input modes ---------- */
.inputs-section {
  padding-top: clamp(48px, 8vh, 72px);
}

.inputs-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(28px, 4vw, 40px);
  align-items: start;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: clamp(24px, 3vw, 36px);
}

@media (max-width: 960px) {
  .inputs-layout {
    grid-template-columns: 1fr;
  }
  .inputs-illustration { max-width: 420px; margin-inline: auto; }
}

.inputs-illustration {
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
}

.inputs-svg {
  display: block;
  width: 100%;
  height: auto;
  color: var(--ink);
}

.inputs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
}

@media (max-width: 540px) {
  .inputs-grid { grid-template-columns: 1fr; }
}

.input-card {
  background: var(--paper);
  padding: 18px 16px;
}

.input-card-voice {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.input-card-voice .input-icon {
  grid-row: 1 / 3;
  margin-bottom: 0;
}

.input-card-voice h3,
.input-card-voice p {
  grid-column: 2;
}

.input-icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  background: var(--surface);
}

.input-icon svg {
  width: 18px;
  height: 18px;
}

.input-card h3 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.input-card p {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.55;
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  z-index: 1;
  max-width: 1140px;
  margin: 0 auto;
  padding: clamp(64px, 10vh, 96px) clamp(20px, 4vw, 48px);
}

.section-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto clamp(40px, 5vh, 52px);
}

.section-head h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 12px;
}

.section-head p {
  font-size: 17px;
  color: var(--ink-muted);
}

.reveal {
  opacity: 0;
  translate: 0 16px;
  transition: opacity 0.6s ease, translate 0.6s ease;
}

.reveal.in { opacity: 1; translate: 0 0; }

/* ---------- Features ---------- */
.feature-grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(2, 1fr);
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
}

@media (max-width: 640px) {
  .feature-grid { grid-template-columns: 1fr; }
}

.feature-card {
  background: var(--surface);
  padding: 28px 24px;
}

.feature-card h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 15px;
  color: var(--ink-muted);
  line-height: 1.65;
}

/* ---------- Flow ---------- */
.flow-section {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  max-width: calc(1140px - 48px);
}

.flow-diagram {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  padding: 0 12px 32px;
  flex-wrap: wrap;
}

.flow-step {
  flex: 1;
  min-width: 140px;
  max-width: 200px;
  text-align: center;
}

.flow-step h3 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  margin: 12px 0 6px;
}

.flow-step p {
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.55;
}

.flow-circle {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  background: var(--paper);
}

.flow-circle-ring {
  width: 56px;
  height: 56px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-width: 1px;
  box-shadow: 0 0 0 8px var(--paper), 0 0 0 9px var(--line);
}

.flow-curve {
  width: 60px;
  height: 30px;
  color: var(--line-strong);
  flex-shrink: 0;
  margin-top: 8px;
}

@media (max-width: 700px) {
  .flow-curve { display: none; }
  .flow-step { max-width: 100%; flex: 1 1 100%; }
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding-bottom: 8px;
}

.tag {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-muted);
  background: var(--paper);
}

/* ---------- How to use guide ---------- */
.guide-section {
  max-width: calc(1140px - 48px);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding-bottom: clamp(48px, 8vh, 72px);
}

.guide-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: clamp(32px, 5vh, 48px);
  padding: 0 clamp(16px, 3vw, 24px);
}

.guide-nav a {
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-muted);
  transition: color 0.2s, background 0.2s;
}

.guide-nav a:hover {
  color: var(--ink);
  background: var(--paper-soft);
}

.guide-body {
  display: grid;
  gap: 1px;
  background: var(--line-strong);
  border-top: 1px solid var(--line-strong);
}

.guide-chapter {
  background: var(--paper);
  padding: clamp(28px, 4vw, 40px) clamp(20px, 4vw, 32px);
  position: relative;
  scroll-margin-top: calc(var(--nav-h) + 3.75rem);
}

.guide-num {
  position: absolute;
  top: clamp(28px, 4vw, 40px);
  right: clamp(20px, 4vw, 32px);
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
}

.guide-chapter h3 {
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  margin-bottom: 10px;
  padding-right: 40px;
}

.guide-lead {
  font-size: 16px;
  color: var(--ink-muted);
  margin-bottom: 22px;
  max-width: 62ch;
  line-height: 1.65;
}

.guide-chapter > p {
  font-size: 15px;
  color: var(--ink-muted);
  line-height: 1.65;
  margin-bottom: 16px;
}

.guide-cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 700px) {
  .guide-cols { grid-template-columns: 1fr; }
}

.guide-block {
  border: 1px solid var(--line);
  padding: 18px 16px;
  background: var(--surface);
}

.guide-block h4 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
}

.guide-block p {
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.6;
}

.guide-code {
  margin: 0 0 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow-x: auto;
}

.guide-code code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}

.guide-note {
  font-size: 14px;
  color: var(--ink-faint);
  font-style: italic;
  padding: 14px 16px;
  border-left: 2px solid var(--line-strong);
  background: var(--surface);
}

.guide-table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
  border: 1px solid var(--line-strong);
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.guide-table th,
.guide-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.guide-table th {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 13px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
}

.guide-table tbody tr:last-child td {
  border-bottom: none;
}

.guide-table td {
  color: var(--ink-muted);
  background: var(--paper);
}

.guide-table td strong {
  color: var(--ink);
}

.guide-table-compact td,
.guide-table-compact th {
  padding: 10px 12px;
}

.guide-status h4 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}

.guide-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.guide-tags li {
  font-size: 13px;
  color: var(--ink-muted);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.guide-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .guide-cards { grid-template-columns: 1fr; }
}

.guide-mini-card {
  background: var(--surface);
  padding: 18px 16px;
}

.guide-mini-card h4 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.guide-mini-card p {
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.55;
  margin: 0;
}

.guide-steps {
  margin: 0 0 20px 20px;
  display: grid;
  gap: 10px;
}

.guide-steps li {
  font-size: 15px;
  color: var(--ink-muted);
  line-height: 1.6;
}

.guide-steps li::marker {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
}

.guide-tips {
  list-style: none;
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.guide-tips li {
  font-size: 14px;
  color: var(--ink-muted);
  padding-left: 18px;
  position: relative;
}

.guide-tips li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-faint);
}

/* ---------- Guide page (standalone) ---------- */
.guide-page {
  padding: clamp(40px, 8vh, 72px) clamp(20px, 4vw, 48px) clamp(64px, 10vh, 96px);
  max-width: 1140px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.guide-page-hero {
  text-align: center;
  margin-bottom: clamp(32px, 5vh, 48px);
}

.guide-page-hero h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  margin-bottom: 12px;
}

.guide-page-hero .guide-lead {
  margin: 0 auto 24px;
}

.guide-page-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.guide-shell {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
}

.guide-page .guide-nav {
  position: sticky;
  top: var(--nav-h);
  z-index: 50;
  background: var(--guide-nav-bg);
  backdrop-filter: blur(8px);
  padding: 14px clamp(16px, 3vw, 24px);
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.guide-page .guide-body {
  border-top: none;
}

.guide-page .guide-body .guide-chapter:last-child {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.nav-links a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

.footer-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink-muted);
}

.footer-links a:hover {
  color: var(--ink);
}

code, kbd {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  font-size: 12px;
  line-height: 1.3;
}

/* ---------- App showcase ---------- */
.platform-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 12px;
  flex-wrap: wrap;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  width: fit-content;
  margin-inline: auto;
}

.platform-tab {
  font-family: var(--body);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 22px;
  border: none;
  border-right: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.platform-tab:last-child { border-right: none; }

.platform-tab:hover {
  color: var(--ink);
  background: var(--paper-soft);
}

.platform-tab.active {
  background: var(--ink);
  color: var(--surface);
}

.platform-desc {
  text-align: center;
  max-width: 520px;
  margin: 0 auto 24px;
  font-size: 15px;
  color: var(--ink-muted);
}

.shot-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 28px;
}

.shot-tab {
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.shot-tab:hover { color: var(--ink); }

.shot-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}

.showcase {
  display: grid;
  gap: clamp(28px, 4vw, 44px);
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  margin-bottom: 40px;
}

@media (max-width: 900px) {
  .showcase { grid-template-columns: 1fr; }
}

.showcase-copy h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
}

.showcase-copy > p {
  color: var(--ink-muted);
  margin-bottom: 16px;
  font-size: 15px;
}

.shot-bullets {
  list-style: none;
  display: grid;
  gap: 8px;
}

.shot-bullets li {
  font-size: 14px;
  color: var(--ink-muted);
  padding-left: 18px;
  position: relative;
}

.shot-bullets li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-faint);
}

.showcase-frame.panel-frame {
  max-width: min(260px, 68vw);
  margin-inline: auto;
}

.showcase-frame.mobile-frame {
  max-width: min(220px, 52vw);
  margin-inline: auto;
  border-radius: 20px;
}

.browser-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-soft);
}

.browser-chrome.hidden { display: none; }

.browser-chrome span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
}

.browser-url {
  flex: 1;
  margin-left: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 10px;
  color: var(--ink-faint);
  text-align: center;
  font-family: ui-monospace, monospace;
  background: var(--surface);
}

#shot-img { transition: opacity 0.25s ease; }

.platform-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
}

@media (max-width: 768px) {
  .platform-gallery { grid-template-columns: 1fr; }
}

.platform-column {
  background: var(--surface);
  padding: 18px;
}

.platform-label {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
}

.gallery-thumb {
  margin: 0;
  border: 1px solid var(--line);
  overflow: hidden;
}

.gallery-thumb img {
  display: block;
  width: 100%;
  height: auto;
  filter: var(--media-filter);
}

.gallery-thumb.panel-thumb img,
.gallery-thumb.mobile-thumb img {
  max-height: 220px;
  width: auto;
  max-width: 100%;
  margin-inline: auto;
  object-fit: contain;
}

.gallery-thumb figcaption {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--ink-faint);
  text-align: center;
  border-top: 1px solid var(--line);
  font-style: italic;
}

/* ---------- Open source ---------- */
.opensource-section {
  padding-top: 0;
}

.opensource-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.7fr);
  gap: clamp(32px, 5vw, 48px);
  align-items: center;
  padding: clamp(36px, 5vw, 52px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

@media (max-width: 768px) {
  .opensource-card { grid-template-columns: 1fr; }
  .opensource-visual { order: -1; }
}

.opensource-copy h2 {
  font-family: var(--serif);
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.15;
}

.opensource-copy > p {
  color: var(--ink-muted);
  margin-bottom: 20px;
  font-size: 16px;
}

.check-list {
  list-style: none;
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.check-list li {
  font-size: 15px;
  color: var(--ink-muted);
  padding-left: 20px;
  position: relative;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.opensource-visual {
  display: grid;
  place-items: center;
  color: var(--line-strong);
}

.curve-orbit {
  width: min(160px, 40vw);
  height: auto;
}

/* ---------- CTA ---------- */
.cta-section {
  padding-top: clamp(48px, 8vh, 72px);
}

.cta-card {
  text-align: center;
  padding: clamp(44px, 7vh, 64px) 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.cta-card h2 {
  font-family: var(--serif);
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 600;
  margin-bottom: 8px;
}

.cta-sub {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 24px;
}

.cta-note {
  margin-top: 16px;
  font-size: 14px;
  color: var(--ink-faint);
  font-style: italic;
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line-strong);
  padding: 28px 24px 40px;
  background: var(--paper-soft);
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  text-align: center;
  font-size: 14px;
  color: var(--ink-faint);
  font-style: italic;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; translate: 0 0; }
  .hero-copy,
  .hero-shot--scroll {
    transform: none !important;
    opacity: 1 !important;
  }
  .hero-divide-line,
  .hero-divide-cap {
    transform: none !important;
    opacity: 1 !important;
  }
}
