/* Nooc landing — tokens mirror apps/mobile/src/theme.ts so the site reads as the app. */

:root {
  color-scheme: light;

  --bg: #f5f5f5;
  --card: #ffffff;
  --ink: #171717;
  --ink-2: #404040;
  --muted: #737373;
  --faint: rgba(23, 23, 23, 0.4);
  --subtle: rgba(0, 0, 0, 0.04);
  --border: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.1);
  --accent: #111111;
  --accent-hover: #2b2b2b;
  --on-accent: #ffffff;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-2xl: 32px;

  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.08);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --text-display: clamp(2.5rem, 1.55rem + 4.2vw, 4.75rem);
  --text-h2: clamp(1.875rem, 1.35rem + 2.3vw, 3.125rem);
  --text-h3: 1.25rem;
  --text-lead: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  --text-body: 1rem;
  --text-sm: 0.875rem;
  --text-xs: 0.8125rem;

  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1200px;
  --section-y: clamp(80px, 9vw, 144px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-kerning: normal;
  line-break: strict;
  overflow-x: clip;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure,
blockquote,
pre {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

code,
pre {
  font-family: var(--mono);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--r-sm);
  font-weight: 600;
}

.skip-link:focus {
  top: 16px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Type ---------- */

.display,
.h2 {
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
  text-spacing-trim: trim-start;
}

.display {
  font-size: var(--text-display);
  line-height: 1.1;
}

.h2 {
  font-size: var(--text-h2);
  line-height: 1.18;
}

.h3 {
  font-size: var(--text-h3);
  line-height: 1.4;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.lead {
  font-size: var(--text-lead);
  line-height: 1.8;
  color: var(--ink-2);
  max-width: 34em;
  text-wrap: pretty;
}

.muted {
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--subtle);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1;
  white-space: nowrap;
}

.tag-mono {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0;
}

.serif {
  font-family: var(--serif);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: var(--r-md);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn .icon {
  font-size: 18px;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

.btn-sm {
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  font-size: 14px;
}

.btn-sm .icon {
  font-size: 16px;
}

.btn-invert {
  background: var(--card);
  color: var(--ink);
}

.btn-invert:hover {
  background: #ebebeb;
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 12px;
  z-index: 40;
  margin-top: 12px;
}

.nav-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 64px;
  padding: 0 10px 0 12px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding-right: 8px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
}

.nav-links {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-links a:hover {
  background: var(--subtle);
  color: var(--ink);
}

.nav-cta {
  margin-left: 8px;
}

@media (max-width: 860px) {
  .nav-links {
    display: none;
  }

  .nav-cta {
    margin-left: auto;
  }
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(48px, 7vw, 104px) clamp(64px, 8vw, 120px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.release-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 8px 0 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  transition: border-color 0.15s ease;
}

.release-pill:hover {
  border-color: var(--border-strong);
}

.release-pill b {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 650;
}

.release-pill .icon {
  font-size: 15px;
  color: var(--muted);
}

.hero h1 {
  margin-top: 28px;
}

.hero .lead {
  margin-top: 24px;
  max-width: 30em;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

@media (max-width: 480px) {
  .cta-row .btn {
    flex: 1 1 100%;
  }
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 28px;
  font-size: var(--text-sm);
  color: var(--muted);
}

.meta-row li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.meta-row .icon {
  font-size: 15px;
  color: var(--ink);
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  padding-block: 8px 72px;
}

/* Sits over the empty foot of the phone screen, never over its content. */
.evidence-card {
  position: absolute;
  left: max(-24px, calc(50% - 300px));
  bottom: 0;
  width: 268px;
  padding: 16px 16px 14px;
  border-radius: var(--r-md);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-float);
}

.evidence-card .ev-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.evidence-card blockquote {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
}

.evidence-card .ev-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 1040px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-visual {
    padding-top: 16px;
  }

  .evidence-card {
    left: calc(50% - 330px);
  }
}

@media (max-width: 720px) {
  .evidence-card {
    position: relative;
    left: auto;
    bottom: auto;
    width: 100%;
    max-width: 380px;
    margin: -72px auto 0;
  }

  .hero-visual {
    flex-direction: column;
    align-items: center;
    padding-bottom: 0;
  }
}

/* ---------- Device mock (393 × 852 pt screen, scaled) ---------- */

.device {
  --s: 0.74;
  --bezel: 11px;
  position: relative;
  flex: none;
  width: calc(393px * var(--s) + var(--bezel) * 2);
  padding: var(--bezel);
  border-radius: calc(55px * var(--s) + var(--bezel));
  background: #1b1b1d;
  box-shadow:
    inset 0 0 0 1.5px #3b3b3e,
    0 40px 80px -32px rgba(0, 0, 0, 0.32),
    0 16px 32px -16px rgba(0, 0, 0, 0.18);
}

.device-viewport {
  position: relative;
  width: calc(393px * var(--s));
  height: calc(852px * var(--s));
  overflow: hidden;
  border-radius: calc(55px * var(--s));
  background: var(--bg);
}

.device-screen {
  position: absolute;
  inset: 0 auto auto 0;
  width: 393px;
  height: 852px;
  transform: scale(var(--s));
  transform-origin: 0 0;
  background: var(--bg);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  text-align: left;
}

@media (max-width: 480px) {
  .device {
    --s: 0.68;
    --bezel: 10px;
  }
}

.ios-status {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 6px 30px 0 44px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ios-island {
  position: absolute;
  left: 50%;
  top: 11px;
  width: 124px;
  height: 36px;
  margin-left: -62px;
  border-radius: 20px;
  background: #000;
}

.ios-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ios-icons svg {
  height: 13px;
  width: auto;
  fill: var(--ink);
}

.ios-home {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 140px;
  height: 5px;
  margin-left: -70px;
  border-radius: 3px;
  background: var(--ink);
}

.app-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  height: 52px;
  padding: 0 8px;
}

.app-header .back {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: 20px;
}

.app-header .title {
  text-align: center;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.25;
}

.app-header .title small {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
}

.app-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 14px 0;
}

.a-card {
  padding: 16px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.a-card h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.4;
}

.a-card .a-sub {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}

.a-card p,
.a-card li {
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-2);
}

.a-card ul {
  margin-top: 6px;
}

.a-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.a-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  font-size: 14px;
  font-weight: 600;
}

.a-btn .icon {
  font-size: 16px;
}

.a-btn.is-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.a-tabbar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 30px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 64px;
  padding: 6px 0;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.a-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  line-height: 12px;
  color: rgba(23, 23, 23, 0.72);
}

.a-tab .icon {
  font-size: 17px;
}

.a-tab.is-active {
  color: var(--ink);
}

.a-tab.is-active .icon {
  stroke-width: 2.35;
}

.device-caption {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* Chat screen */

.a-identity {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 2px auto 0;
  font-size: 12px;
  color: var(--muted);
}

.a-identity b {
  color: var(--ink);
  font-weight: 600;
}

.a-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 0;
}

.a-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.65;
}

.a-msg.from-user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--on-accent);
  border-bottom-right-radius: 6px;
}

.a-msg.from-char {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
}

.a-msg .who {
  display: block;
  margin-bottom: 2px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.a-refs {
  align-self: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 88%;
  margin-top: -2px;
}

.a-refs .tag {
  height: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
}

.a-refs .a-src {
  display: inline-flex;
  align-items: center;
  height: 22px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong);
}

.a-composer {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 108px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 6px 0 16px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 14px;
  color: var(--faint);
}

.a-composer > span:first-child {
  flex: 1;
}

.a-send {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 18px;
}

/* ---------- Film ---------- */

.film {
  padding-bottom: var(--section-y);
}

.film-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-2xl);
  background: #0f0e0c;
  aspect-ratio: 16 / 9;
  box-shadow: var(--shadow-card);
}

@media (max-width: 640px) {
  .film-frame {
    border-radius: var(--r-lg);
  }
}

.film-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.film-play {
  position: absolute;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: flex-start;
  padding: clamp(16px, 3vw, 32px);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0) 45%);
}

.js .film-play {
  display: flex;
}

.film-play[hidden] {
  display: none;
}

.film-play span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px 0 16px;
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.12s ease;
}

.film-play:hover span {
  background: #f0f0f0;
}

.film-play:active span {
  transform: scale(0.98);
}

.film-play .icon {
  font-size: 18px;
  fill: currentColor;
  stroke: none;
}

.film-play small {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

/* ---------- Sections ---------- */

.section {
  padding-block: var(--section-y);
}

.section + .section {
  padding-top: 0;
}

.section-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: clamp(40px, 5vw, 72px);
}

.section-head .lead {
  max-width: 36em;
}

/* ---------- Why ---------- */

.why-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}

.pitfalls li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 4px 12px;
  padding-block: 28px;
  border-top: 1px solid var(--border-strong);
}

.pitfalls li:last-child {
  border-bottom: 1px solid var(--border-strong);
}

.pit-no {
  padding-top: 3px;
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pit-eg {
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--muted);
}

.pit-fix {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-2);
  text-wrap: pretty;
}

.pit-fix strong {
  color: var(--ink);
  font-weight: 650;
}

.pit-fix code {
  font-size: 0.86em;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--subtle);
  white-space: nowrap;
}

.compare {
  position: sticky;
  top: 100px;
  padding: clamp(20px, 2.4vw, 28px);
  border-radius: var(--r-xl);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.compare-title {
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--muted);
}

.compare-source {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.85;
}

.compare-source cite {
  display: block;
  margin-top: 6px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

.compare-block {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.compare-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
}

.compare-naive {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--subtle);
  font-size: 15px;
  color: var(--ink-2);
}

.compare-note {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.rel-steps {
  position: relative;
  margin-top: 12px;
}

.rel-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0 7px 18px;
  font-size: 14px;
  line-height: 1.6;
}

.rel-steps li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 15px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

.rel-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 25px;
  bottom: -9px;
  width: 1px;
  background: var(--border-strong);
}

.rel-steps .when {
  font-size: 12.5px;
  color: var(--muted);
}

@media (max-width: 960px) {
  .why-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .compare {
    position: static;
  }
}

@media (max-width: 420px) {
  .rel-steps li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

/* ---------- Pipeline ---------- */

.pipeline {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.steps {
  display: flex;
  flex-direction: column;
}

.step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 2px 12px;
  width: 100%;
  padding: 18px 16px 18px 12px;
  border-radius: var(--r-md);
  text-align: left;
  transition: background-color 0.15s ease;
}

.step + .step {
  margin-top: 4px;
}

.step:hover {
  background: rgba(255, 255, 255, 0.6);
}

.step[aria-selected="true"] {
  background: var(--card);
  box-shadow: var(--shadow-card);
  outline: 1px solid var(--border);
  outline-offset: -1px;
}

.step[aria-selected="true"]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.step-no {
  grid-row: span 3;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.step[aria-selected="true"] .step-no {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.step-name {
  font-size: 17px;
  font-weight: 650;
  line-height: 1.5;
}

.step-desc {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--muted);
}

.step-file {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
}

.file-card {
  position: sticky;
  top: 100px;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.file-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.file-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-name .icon {
  font-size: 15px;
  color: var(--muted);
}

.panel[hidden] {
  display: none;
}

.panel pre {
  padding: 18px 20px;
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
}

.panel pre .k {
  color: var(--muted);
}

.panel pre .h {
  color: var(--ink);
  font-weight: 700;
}

.panel pre mark {
  background: rgba(0, 0, 0, 0.07);
  color: var(--ink);
  border-radius: 3px;
  padding: 0 2px;
}

.panel-note {
  display: flex;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
}

.panel-note .icon {
  margin-top: 4px;
  font-size: 15px;
  color: var(--muted);
}

.js .panel {
  animation: panel-in 0.2s ease;
}

@keyframes panel-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.resilience {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
  gap: 24px clamp(24px, 4vw, 56px);
  margin-top: clamp(48px, 6vw, 88px);
  padding-top: 32px;
  border-top: 1px solid var(--border-strong);
}

.resilience ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 32px;
}

.resilience li {
  display: flex;
  gap: 10px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-2);
}

.resilience li .icon {
  margin-top: 5px;
  font-size: 15px;
  color: var(--ink);
}

@media (max-width: 960px) {
  .pipeline {
    grid-template-columns: minmax(0, 1fr);
  }

  .file-card {
    position: static;
  }

  .resilience {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .js .steps {
    flex-direction: row;
    gap: 8px;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    padding-bottom: 4px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .js .steps::-webkit-scrollbar {
    display: none;
  }

  .js .step {
    flex: none;
    width: auto;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 8px 8px;
    border-radius: 999px;
    background: var(--card);
    outline: 1px solid var(--border);
    outline-offset: -1px;
    scroll-snap-align: start;
  }

  .js .step + .step {
    margin-top: 0;
  }

  .js .step-no {
    grid-row: auto;
    width: 28px;
    height: 28px;
    margin: 0;
    font-size: 12px;
  }

  .js .step-name {
    font-size: 15px;
    white-space: nowrap;
  }

  .js .step-desc,
  .js .step-file {
    display: none;
  }

  .js .step[aria-selected="true"] {
    background: var(--accent);
    color: var(--on-accent);
    outline-color: var(--accent);
  }

  .js .step[aria-selected="true"] .step-no {
    background: var(--card);
    border-color: var(--card);
    color: var(--ink);
  }

  .panel-desc {
    display: block;
  }

  .resilience ul {
    grid-template-columns: minmax(0, 1fr);
  }
}

.panel-desc {
  display: none;
  padding: 14px 20px 0;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink-2);
}

/* ---------- Results bento ---------- */

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.tile {
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 2.4vw, 28px);
  border-radius: var(--r-xl);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.tile-7 {
  grid-column: span 7;
}

.tile-5 {
  grid-column: span 5;
}

.tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tile-kicker {
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--muted);
}

.tile-foot {
  margin-top: auto;
  padding-top: 18px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted);
}

.char-name {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 16px;
}

.char-name strong {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.char-traits {
  margin-top: 16px;
  counter-reset: trait;
}

.char-traits li {
  position: relative;
  padding: 9px 0 9px 28px;
  border-top: 1px solid var(--border);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
}

.char-traits li::before {
  counter-increment: trait;
  content: counter(trait);
  position: absolute;
  left: 0;
  top: 12px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.evidence-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--muted);
}

.graph {
  width: 100%;
  max-width: 460px;
  height: auto;
  margin: 12px auto auto;
  overflow: visible;
}

.graph .edge {
  stroke: var(--ink);
  stroke-width: 1.25;
  fill: none;
  opacity: 0.28;
  transition: opacity 0.15s ease, stroke-width 0.15s ease;
}

.graph .edge.is-strong {
  stroke-width: 2;
  opacity: 0.85;
}

.graph .edge-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  fill: var(--muted);
  transition: opacity 0.15s ease;
}

.graph .edge-label-bg {
  fill: var(--card);
}

.graph .node {
  cursor: pointer;
  outline: none;
}

.graph .node circle {
  fill: var(--card);
  stroke: var(--ink);
  stroke-width: 1.5;
  transition: fill 0.15s ease;
}

.graph .node.is-main circle {
  fill: var(--ink);
}

.graph .node text {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 650;
  fill: var(--ink);
}

.graph .node .role {
  font-size: 11px;
  font-weight: 500;
  fill: var(--muted);
}

.graph .node:focus-visible circle {
  stroke-width: 3;
}

.graph[data-focus] .edge,
.graph[data-focus] .edge-label {
  opacity: 0.08;
}

.graph[data-focus] .node {
  opacity: 0.35;
}

.graph[data-focus] .edge.is-on {
  opacity: 0.9;
  stroke-width: 2;
}

.graph[data-focus] .edge-label.is-on,
.graph[data-focus] .node.is-on {
  opacity: 1;
}

.timeline {
  margin-top: 16px;
}

.timeline li {
  position: relative;
  padding: 0 0 18px 22px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: var(--card);
}

.timeline li:last-child::before {
  background: var(--ink);
}

.timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 21px;
  bottom: 0;
  width: 1px;
  background: var(--border-strong);
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline .when {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.timeline p {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.7;
}

.files {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin-top: 12px;
}

.files li {
  display: flex;
  flex-direction: column;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}

.files code {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.files span {
  font-size: 13.5px;
  color: var(--muted);
}

@media (max-width: 960px) {
  .tile-7,
  .tile-5 {
    grid-column: span 12;
  }
}

@media (max-width: 480px) {
  .files {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Split (chat / write) ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}

.split-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.split .section-head {
  margin-bottom: 32px;
}

.features {
  display: grid;
  gap: 0;
}

.features div {
  padding: 20px 0;
  border-top: 1px solid var(--border-strong);
}

.features div:last-child {
  border-bottom: 1px solid var(--border-strong);
}

.features dt {
  font-size: 17px;
  font-weight: 650;
  line-height: 1.5;
}

.features dd {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-2);
  text-wrap: pretty;
}

@media (max-width: 960px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .split-visual {
    order: 2;
  }
}

/* ---------- Write ---------- */

.write-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.prompts {
  display: flex;
  flex-direction: column;
}

.prompts ol {
  margin-top: 8px;
}

.prompts li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 18px 0;
  border-top: 1px solid var(--border);
}

.prompts li:first-child {
  border-top: 0;
}

.prompts .tag {
  justify-self: start;
}

.prompts li p {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
}

.ctx {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.ctx-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}

.ctx-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
  margin-top: 10px;
}

.ctx-list dt {
  font-size: 14px;
  font-weight: 650;
}

.ctx-list dd {
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 420px) {
  .ctx-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

.creator h3 {
  margin-top: 14px;
}

.creator > p {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-2);
}

.picks {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.pick-label {
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}

.pick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.opt {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
}

.opt.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.creator-note {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px dashed var(--border-strong);
  font-size: 14px;
  color: var(--faint);
}

.creator-cta {
  margin-top: 16px;
  width: 100%;
  pointer-events: none;
}

@media (max-width: 960px) {
  .write-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Privacy (inverted) ---------- */

.privacy {
  padding: clamp(32px, 6vw, 80px);
  border-radius: var(--r-2xl);
  background: var(--accent);
  color: #f5f5f5;
}

.privacy .chip {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e5e5e5;
}

.privacy .lead {
  color: #c7c7c7;
  line-height: 1.85;
}

.privacy .section-head {
  margin-bottom: clamp(32px, 5vw, 64px);
}

.privacy-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px clamp(24px, 3vw, 48px);
}

.privacy-cols div {
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.privacy-cols dt {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 650;
  color: #fff;
}

.privacy-cols dt .tag {
  background: rgba(255, 255, 255, 0.1);
  color: #d4d4d4;
}

.privacy-cols dd {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.85;
  color: #bdbdbd;
  text-wrap: pretty;
}

.privacy-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(32px, 4vw, 56px);
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 14px;
  color: #a3a3a3;
}

.privacy-foot a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: #fff;
  font-weight: 600;
}

.privacy-foot a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.privacy :focus-visible {
  outline-color: #fff;
}

@media (max-width: 860px) {
  .privacy-cols {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- FAQ ---------- */

.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}

.faq-grid .section-head {
  position: sticky;
  top: 100px;
  margin-bottom: 0;
}

.faq details {
  border-top: 1px solid var(--border-strong);
}

.faq details:last-child {
  border-bottom: 1px solid var(--border-strong);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 16px 0;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.5;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary .icon {
  font-size: 18px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.faq details[open] summary .icon {
  transform: rotate(45deg);
}

.faq summary:hover .icon {
  color: var(--ink);
}

.faq details p {
  max-width: 38em;
  padding-bottom: 22px;
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--ink-2);
  text-wrap: pretty;
}

.faq details p a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong);
}

@media (max-width: 960px) {
  .faq-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .faq-grid .section-head {
    position: static;
  }
}

/* ---------- Final CTA ---------- */

.final {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  padding: clamp(28px, 5vw, 64px);
  border-radius: var(--r-2xl);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.final-icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  border: 1px solid var(--border);
}

.final h2 {
  margin-top: 28px;
}

.final .lead {
  margin-top: 16px;
}

.final .cta-row {
  margin-top: 32px;
}

.qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.qr img {
  width: 168px;
  height: 168px;
  padding: 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--card);
}

.qr p {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: center;
  line-height: 1.5;
}

.qr p span {
  display: block;
  font-weight: 500;
  color: var(--muted);
}

@media (max-width: 760px) {
  .final {
    grid-template-columns: minmax(0, 1fr);
  }

  .qr {
    display: none;
  }
}

/* ---------- Footer ---------- */

.footer {
  padding-block: 48px 56px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border-strong);
  font-size: 14px;
  color: var(--muted);
}

.footer .brand {
  font-size: 15px;
}

.footer .brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 4px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--ink-2);
  font-weight: 500;
}

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

/* ---------- Document pages (support / privacy / 404) ---------- */

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

.doc {
  padding-block: clamp(48px, 7vw, 96px) var(--section-y);
}

.doc-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  max-width: 760px;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.doc-note {
  display: flex;
  gap: 10px;
  max-width: 760px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-2);
}

.doc-note .icon {
  margin-top: 5px;
  font-size: 16px;
  color: var(--muted);
}

.doc-body {
  max-width: 980px;
}

.doc-section {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: 8px 40px;
  padding-block: 28px;
  border-top: 1px solid var(--border-strong);
}

.doc-section:last-child {
  border-bottom: 1px solid var(--border-strong);
}

.doc-section h2 {
  font-size: 18px;
  font-weight: 650;
  line-height: 1.6;
}

.doc-section > div {
  display: grid;
  gap: 10px;
  max-width: 40em;
}

.doc-section p,
.doc-section li {
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink-2);
  text-wrap: pretty;
}

.doc-section ul {
  display: grid;
  gap: 4px;
  padding-left: 1.25em;
  list-style: disc;
}

.doc-section li::marker {
  color: var(--faint);
}

.doc-section strong {
  color: var(--ink);
  font-weight: 650;
}

.doc-section a,
.doc-note a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--border-strong);
}

.doc-section a:hover,
.doc-note a:hover {
  text-decoration-color: var(--ink);
}

.doc-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 760px) {
  .doc-section {
    grid-template-columns: minmax(0, 1fr);
  }
}

.notfound {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  min-height: 60vh;
  justify-content: center;
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
