/* ─────────────────────────────────────────────────────────────────────────
   Lens suite design system
   One minimal, well-aligned system shared by every tool. A tool overrides
   --accent / --accent-ink and nothing else.

   Scale: 4px rhythm. Container 1120px. Hairline borders, no heavy shadows.
   Light is the default; dark follows the OS or [data-theme="dark"].
   ───────────────────────────────────────────────────────────────────────── */

/* ── Typeface ───────────────────────────────────────────────────────────────
   Geist and Geist Mono, self-hosted (SIL Open Font License 1.1). Variable
   weights 100–900. No external requests. */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;

  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
    Consolas, "Liberation Mono", monospace;

  /* Accent is set per tool. These are the iconlens defaults. */
  --accent: #e11d48;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 35%, transparent);

  --canvas: #ffffff;
  --surface: #fafafa;
  --surface-2: #f4f4f5;
  --hairline: #e6e6e8;
  --hairline-strong: #d4d4d8;

  --ink: #0a0a0a;
  --body: #3f3f46;
  --mute: #71717a;
  --faint: #6f6f78;

  --success: #15803d;
  --warning: #b45309;
  --error: #b91c1c;
  --info: #1d4ed8;

  --r-xs: 3px;
  --r-sm: 5px;
  --r-md: 7px;
  --r-lg: 10px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  --container: 1120px;
  --gutter: 24px;
  --nav-h: 56px;

  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --dur: 160ms;
}

[data-theme="dark"] {
  color-scheme: dark;
  --accent-ink: #0a0a0a;

  --canvas: #0a0a0a;
  --surface: #111112;
  --surface-2: #18181b;
  --hairline: #232326;
  --hairline-strong: #33333a;

  --ink: #fafafa;
  --body: #c4c4ca;
  --mute: #8b8b93;
  --faint: #8b8b93;

  --success: #4ade80;
  --warning: #fbbf24;
  --error: #f87171;
  --info: #93c5fd;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --accent-ink: #0a0a0a;
    --canvas: #0a0a0a;
    --surface: #111112;
    --surface-2: #18181b;
    --hairline: #232326;
    --hairline-strong: #33333a;
    --ink: #fafafa;
    --body: #c4c4ca;
    --mute: #8b8b93;
    --faint: #8b8b93;
    --success: #4ade80;
    --warning: #fbbf24;
    --error: #f87171;
    --info: #93c5fd;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" on, "cv11" on;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

p {
  margin: 0;
}

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

a:hover {
  text-decoration: underline;
}

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

::selection {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--ink);
}

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

hr {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 0;
}

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

[hidden] {
  display: none !important;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.section--tight {
  padding-block: var(--s-8);
}

.section + .section {
  border-top: 1px solid var(--hairline);
}

.section__head {
  max-width: 62ch;
  margin-bottom: var(--s-6);
}

.section__head h2 {
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  margin-bottom: var(--s-3);
}

.section__head p {
  color: var(--mute);
  font-size: 1.0625rem;
}

.grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: var(--s-3) var(--s-4);
  background: var(--ink);
  color: var(--canvas);
  border-radius: var(--r-sm);
}

.skip-link:focus {
  left: var(--s-4);
  top: var(--s-4);
}

/* ── Nav ────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--hairline);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  height: var(--nav-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
}

.brand__name {
  font-size: 1rem;
}

.brand__tag {
  color: var(--faint);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.nav__links {
  display: flex;
  gap: var(--s-1);
  margin-left: auto;
}

.nav__links a {
  padding: 6px 10px;
  border-radius: var(--r-sm);
  color: var(--mute);
  font-size: 0.875rem;
  font-weight: 500;
}

.nav__links a:hover {
  color: var(--ink);
  background: var(--surface-2);
  text-decoration: none;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.nav .nav__toggle {
  display: none;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur) var(--ease),
    border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.btn:hover {
  text-decoration: none;
}

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

.btn--primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, var(--ink));
}

.btn--outline {
  border-color: var(--hairline-strong);
  color: var(--ink);
}

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

.btn--ghost {
  color: var(--mute);
}

.btn--ghost:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.btn--sm {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.8125rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
}

/* ── Icon ───────────────────────────────────────────────────────────────── */
.icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--lg {
  width: 20px;
  height: 20px;
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(56px, 8vw, 104px) var(--s-8);
}

.hero__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    50% 55% at 12% 0%,
    var(--accent-soft),
    transparent 70%
  );
}

.hero__inner {
  max-width: 720px;
}

.hero__meta {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
  color: var(--mute);
  font-size: 0.875rem;
}

.hero__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  font-size: clamp(2.5rem, 5.4vw, 3.75rem);
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin-bottom: var(--s-4);
}

.hero__lede {
  max-width: 60ch;
  color: var(--body);
  font-size: 1.125rem;
  margin-bottom: var(--s-6);
}

/* ── Install block ──────────────────────────────────────────────────────── */
.install {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  max-width: 760px;
  margin-top: var(--s-6);
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--surface);
}

.install::before {
  content: "$";
  flex: none;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
}

.install__cmd {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.install__note {
  max-width: 60ch;
  margin-top: var(--s-3);
  color: var(--mute);
  font-size: 0.875rem;
}

/* ── Code ───────────────────────────────────────────────────────────────── */
.code {
  position: relative;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}

.code pre,
pre.code {
  margin: 0;
  padding: var(--s-4) var(--s-5);
  overflow-x: auto;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  tab-size: 2;
}

pre.code > code,
.code pre > code {
  font: inherit;
  white-space: pre;
}

.code--wrap pre,
pre.code--wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-x: hidden;
}

.code__copy {
  position: absolute;
  top: 8px;
  right: 8px;
}

.copy {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-xs);
  background: var(--canvas);
  color: var(--mute);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.copy:hover {
  color: var(--ink);
  border-color: var(--hairline-strong);
}

.copy[data-copied="true"] {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
}

/* ── Card ───────────────────────────────────────────────────────────────── */
.card {
  padding: var(--s-5);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--canvas);
}

.card h3 {
  font-size: 0.9375rem;
  margin-bottom: var(--s-2);
}

.card p {
  color: var(--mute);
  font-size: 0.9375rem;
}

.card__meta {
  color: var(--faint);
  font-size: 0.8125rem;
}

/* ── Table ──────────────────────────────────────────────────────────────── */
.table-wrap {
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

caption {
  padding: var(--s-3) var(--s-4);
  color: var(--mute);
  font-size: 0.8125rem;
  text-align: left;
  border-bottom: 1px solid var(--hairline);
}

th,
td {
  padding: 10px var(--s-4);
  text-align: left;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}

th {
  color: var(--mute);
  font-weight: 550;
  font-size: 0.8125rem;
}

tr:last-child td {
  border-bottom: 0;
}

td code {
  color: var(--ink);
  font-size: 0.8125rem;
}

/* ── Chip ───────────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--surface);
  color: var(--mute);
  font-size: 0.75rem;
  font-weight: 550;
  white-space: nowrap;
}

.chip--error {
  color: var(--error);
  border-color: color-mix(in srgb, var(--error) 30%, transparent);
  background: color-mix(in srgb, var(--error) 8%, transparent);
}

.chip--warning {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 30%, transparent);
  background: color-mix(in srgb, var(--warning) 8%, transparent);
}

.chip--info {
  color: var(--info);
  border-color: color-mix(in srgb, var(--info) 30%, transparent);
  background: color-mix(in srgb, var(--info) 8%, transparent);
}

.chip--ok {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
  background: color-mix(in srgb, var(--success) 8%, transparent);
}

/* ── Callout ────────────────────────────────────────────────────────────── */
.callout {
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.callout p {
  color: var(--body);
  font-size: 0.9375rem;
}

/* ── Steps ──────────────────────────────────────────────────────────────── */
.steps {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  counter-increment: step;
}

.step::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: var(--s-2);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.step h3 {
  font-size: 0.9375rem;
  margin-bottom: var(--s-1);
}

.step p {
  color: var(--mute);
  font-size: 0.875rem;
}

/* ── FAQ ────────────────────────────────────────────────────────────────── */
.faq {
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  overflow: hidden;
}

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

.faq summary {
  padding: var(--s-4) var(--s-5);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 550;
  cursor: pointer;
  list-style: none;
}

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

.faq summary::after {
  content: "+";
  float: right;
  color: var(--mute);
  font-weight: 400;
}

.faq details[open] summary::after {
  content: "−";
}

.faq .faq__body {
  padding: 0 var(--s-5) var(--s-4);
  color: var(--mute);
  font-size: 0.9375rem;
}

/* ── Playground ─────────────────────────────────────────────────────────── */
.playground {
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}

.playground__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--hairline);
}

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--canvas);
}

.segmented button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--mute);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 550;
  cursor: pointer;
}

.segmented button[aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.playground__hint {
  margin-left: auto;
  color: var(--mute);
  font-size: 0.8125rem;
}

.playground__body {
  padding: var(--s-5);
}

.pane {
  display: grid;
  min-height: 292px;
}

.pane[hidden] {
  display: none;
}

.field {
  display: block;
  margin-bottom: var(--s-2);
  color: var(--mute);
  font-size: 0.8125rem;
  font-weight: 550;
}

textarea.input,
.input {
  display: block;
  width: 100%;
  min-height: 260px;
  padding: var(--s-4);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.65;
  resize: vertical;
}

textarea.input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: transparent;
}

.dropzone {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--s-2);
  min-height: 260px;
  padding: var(--s-6);
  border: 1px dashed var(--hairline-strong);
  border-radius: var(--r-md);
  background: var(--canvas);
  text-align: center;
  transition: border-color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}

.dropzone.is-drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  color: var(--mute);
  margin-bottom: var(--s-1);
}

.dropzone p {
  color: var(--mute);
  font-size: 0.875rem;
}

.dropzone strong {
  display: block;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 550;
}

.dropzone .file-input {
  margin-top: var(--s-2);
  font-size: 0.8125rem;
  color: var(--mute);
}

.playground__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  padding: 0 var(--s-5) var(--s-5);
}

.status {
  color: var(--mute);
  font-size: 0.875rem;
}

.status[data-tone="error"] {
  color: var(--error);
}

.playground__results {
  padding: 0 var(--s-5) var(--s-5);
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--hairline);
  padding-block: var(--s-7);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-6) var(--s-7);
}

.footer__inner > * {
  flex: 1 1 140px;
  min-width: 0;
}

.footer__inner > *:first-child {
  flex: 2 1 280px;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--ink);
  font-weight: 600;
}

.footer h2 {
  margin-bottom: var(--s-3);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer ul {
  display: grid;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer a {
  color: var(--body);
  font-size: 0.875rem;
}

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

.footer__meta {
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  justify-content: space-between;
  color: var(--faint);
  font-size: 0.8125rem;
}

/* ── Utilities ──────────────────────────────────────────────────────────── */
.mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.label {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

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

.prose p + p {
  margin-top: var(--s-3);
}

.stack > * + * {
  margin-top: var(--s-4);
}

/* ── Motion ─────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 400ms var(--ease), transform 400ms var(--ease);
  }

  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  :root {
    --gutter: 20px;
    --s-9: 64px;
    --s-8: 48px;
  }

  .nav__links {
    display: none;
  }

  .nav__actions {
    margin-left: auto;
  }

  .nav .nav__toggle {
    display: inline-flex;
  }

  .nav__links[data-open="true"] {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    margin-left: 0;
    padding: var(--s-3);
    gap: 2px;
    background: var(--canvas);
    border-bottom: 1px solid var(--hairline);
  }

  .footer__inner {
    gap: var(--s-5) var(--s-6);
  }

  .footer__inner > * {
    flex-basis: 160px;
  }
}

@media (max-width: 520px) {
  .footer__inner > *,
  .footer__inner > *:first-child {
    flex-basis: 100%;
  }

  .playground__hint {
    display: none;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   v2 — product surfaces
   A real terminal window and editorial (label + body) layouts. These exist
   so a page can show what the tool actually does instead of a grid of
   bordered boxes.
   ───────────────────────────────────────────────────────────────────────── */

/* ── Terminal ───────────────────────────────────────────────────────────── */
.term {
  --term-bg: #0b0b0e;
  --term-bar: #121216;
  --term-line: #1e1e24;
  --term-ink: #e8e8ef;
  --term-mute: #8f8f9b;
  --term-dim: #63636e;
  position: relative;
  border: 1px solid var(--term-line);
  border-radius: var(--r-lg);
  background: var(--term-bg);
  overflow: hidden;
  font-family: var(--font-mono);
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.6);
}

.term::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.term__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--term-line);
  background: var(--term-bar);
}

.term__dots {
  display: flex;
  gap: 6px;
}

.term__dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2b2b32;
}

.term__dots i:nth-child(1) {
  background: #ff5f57;
}
.term__dots i:nth-child(2) {
  background: #febc2e;
}
.term__dots i:nth-child(3) {
  background: #28c840;
}

.term__title {
  color: var(--term-mute);
  font-size: 0.75rem;
  letter-spacing: 0.01em;
}

.term__body {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  color: var(--term-ink);
  font-size: 0.8125rem;
  line-height: 1.78;
  tab-size: 2;
}

.term__body .ln {
  display: block;
  white-space: pre;
}

.term__body .ln--wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.term__body--wrap,
.term__body--wrap .ln {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.term__body--wrap {
  overflow-x: hidden;
}

.term .p {
  color: var(--term-dim);
}
.term .cmd {
  color: #f2f2f7;
}
.term .err {
  color: #f87171;
}
.term .warn {
  color: #fbbf24;
}
.term .info {
  color: #93c5fd;
}
.term .ok {
  color: #4ade80;
}
.term .dim {
  color: var(--term-dim);
}
.term .acc {
  color: #a5b4fc;
}
.term .b {
  font-weight: 700;
}

/* ── Split hero ─────────────────────────────────────────────────────────── */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.split > * {
  min-width: 0;
}

.split--top {
  align-items: start;
}

.split__copy {
  min-width: 0;
}

.split__aside {
  min-width: 0;
}

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

/* ── Eyebrow ────────────────────────────────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--mute);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ── Ledger rows ────────────────────────────────────────────────────────── */
.rows {
  border-top: 1px solid var(--hairline);
}

.trow {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) 238px 22px;
  align-items: baseline;
  gap: 24px;
  padding: 22px 10px;
  border-bottom: 1px solid var(--hairline);
  color: var(--body);
  transition: background var(--dur) var(--ease);
}

.trow:hover {
  background: var(--surface);
  text-decoration: none;
}

.trow__id {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.trow__name {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.trow__fmt {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.trow__desc {
  color: var(--mute);
  font-size: 0.9375rem;
}

.trow__cmd {
  color: var(--body);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.trow__go {
  justify-self: end;
  color: var(--faint);
  transition: transform var(--dur) var(--ease), color var(--dur) var(--ease);
}

.trow:hover .trow__go {
  color: var(--accent);
  transform: translateX(3px);
}

@media (max-width: 900px) {
  .trow {
    grid-template-columns: minmax(0, 1fr) 24px;
    gap: 8px 16px;
  }

  .trow__id {
    grid-column: 1 / 2;
  }

  .trow__go {
    grid-row: 1 / 2;
    grid-column: 2 / 3;
  }

  .trow__desc,
  .trow__cmd {
    grid-column: 1 / -1;
  }
}

/* ── Editorial band ─────────────────────────────────────────────────────── */
.band {
  display: grid;
  grid-template-columns: minmax(0, 190px) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.band__body {
  min-width: 0;
}

.band__label {
  position: sticky;
  top: calc(var(--nav-h) + 28px);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.band__body > * + * {
  margin-top: 20px;
}

.band__lead {
  max-width: 46ch;
  color: var(--ink);
  font-size: 1.1875rem;
  line-height: 1.5;
  letter-spacing: -0.015em;
}

.band__body p {
  max-width: 68ch;
  color: var(--body);
  font-size: 0.9375rem;
}

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

  .band__label {
    position: static;
  }
}

/* Let terminals wrap instead of scrolling sideways on small screens. */
@media (max-width: 640px) {
  .term__body,
  .term__body .ln {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    overflow-x: hidden;
  }
}

/* ── Definition list ────────────────────────────────────────────────────── */
.deflist {
  border-top: 1px solid var(--hairline);
}

.defrow {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 32px;
  padding: 20px 0;
  border-bottom: 1px solid var(--hairline);
}

.defrow__term {
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.defrow__term code {
  font-size: 0.8125rem;
}

.defrow__def {
  max-width: 66ch;
  margin: 0;
  color: var(--mute);
  font-size: 0.9375rem;
}

.defrow__def strong {
  color: var(--body);
  font-weight: 600;
}

.defrow__def code {
  color: var(--ink);
  font-size: 0.8125rem;
}

.defrow__def + .defrow__def {
  margin-top: 8px;
}

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

/* ── Feature grid (no boxes) ────────────────────────────────────────────── */
.defgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px 48px;
  margin: 0;
}

.defgrid > div {
  min-width: 0;
}

.defgrid dt {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.defgrid dd {
  margin: 0;
  color: var(--mute);
  font-size: 0.9375rem;
}

.defgrid code {
  color: var(--ink);
  font-size: 0.8125rem;
}

@media (max-width: 720px) {
  .defgrid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ── Accent wash behind an aside ────────────────────────────────────────── */
.wash {
  position: relative;
}

.wash::before {
  content: "";
  position: absolute;
  inset: -12% -8%;
  z-index: -1;
  background: radial-gradient(
    46% 52% at 70% 30%,
    var(--accent-soft),
    transparent 72%
  );
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────────────────
   Docs — a reference page with a sticky side nav and a reading column.
   ───────────────────────────────────────────────────────────────────────── */

.docs {
  display: grid;
  grid-template-columns: minmax(0, 196px) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding-block: var(--s-8) var(--s-9);
}

.docs__nav {
  position: sticky;
  top: calc(var(--nav-h) + 28px);
  min-width: 0;
}

.docs__nav h2 {
  margin-bottom: var(--s-3);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.docs__nav ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs__nav a {
  display: block;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  color: var(--mute);
  font-size: 0.875rem;
  font-weight: 500;
}

.docs__nav a:hover {
  color: var(--ink);
  background: var(--surface-2);
  text-decoration: none;
}

.docs__nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.docs__body {
  min-width: 0;
  max-width: 76ch;
}

.docs__body > * + * {
  margin-top: var(--s-5);
}

.docs__body h2 {
  margin-top: var(--s-7);
  font-size: 1.4375rem;
}

.docs__body > h2:first-child {
  margin-top: 0;
}

.docs__body h3 {
  margin-top: var(--s-6);
  font-size: 1.0625rem;
}

.docs__body p {
  color: var(--body);
}

.docs__body ul,
.docs__body ol {
  padding-left: 1.25em;
  color: var(--body);
}

.docs__body li + li {
  margin-top: 6px;
}

.docs__head {
  margin-bottom: var(--s-7);
}

.docs__head .eyebrow {
  margin-bottom: var(--s-3);
}

.docs__head h1 {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  letter-spacing: -0.03em;
  margin-bottom: var(--s-3);
}

.docs__head p {
  max-width: 62ch;
  color: var(--mute);
  font-size: 1.0625rem;
}

.docs__foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  justify-content: space-between;
  margin-top: var(--s-8);
  padding-top: var(--s-5);
  border-top: 1px solid var(--hairline);
  font-size: 0.875rem;
}

.docs__foot a {
  color: var(--mute);
}

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

@media (max-width: 820px) {
  .docs {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding-block: var(--s-6) var(--s-8);
  }

  .docs__nav {
    position: static;
  }

  .docs__nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .docs__nav a {
    border: 1px solid var(--hairline);
  }
}
