/* Refract — Aperture. An image API presented as a photography-led marketplace.
   White paper, near-black ink, one hue of red, soft corners everywhere,
   a single shadow tier, and photography carrying the visual weight. */

/* ---------- Fonts (self-hosted woff2, no CDN) ---------- */

@font-face {
  font-family: "Inter";
  src: url("./assets/fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("./assets/fonts/inter-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("./assets/fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("./assets/fonts/inter-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("./assets/fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("./assets/fonts/jetbrains-mono-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  /* Palette — white paper, near-black ink, one hue of red in three stops */
  --canvas: #ffffff;
  --canvas-soft: #f7f7f7;
  --canvas-strong: #f2f2f2;
  --ink: #222222;
  --ink-body: #3f3f3f;
  --ink-soft: #6a6a6a;
  --ink-faint: #929292;
  --hairline: #dddddd;
  --hairline-soft: #ebebeb;
  --hairline-strong: #c1c1c1;
  --accent: #ff385c;        /* Rausch — non-text marks only (orb, selected rule) */
  --accent-deep: #b00f35;   /* every red that carries text: CTA fill, red text */
  --accent-press: #8e0a2a;  /* press state of --accent-deep, fill only */
  --on-accent: #ffffff;

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Spacing scale — 4px base, 2px micro-step */
  --s-2: 2px;
  --s-4: 4px;
  --s-8: 8px;
  --s-12: 12px;
  --s-16: 16px;
  --s-24: 24px;
  --s-32: 32px;
  --s-48: 48px;
  --s-64: 64px;
  --s-96: 96px;

  /* Radii — no 0px corner anywhere */
  --r-btn: 8px;
  --r-card: 12px;
  --r-lg: 16px;
  --r-pill: 9999px;

  /* Elevation — exactly one shadow tier */
  --shadow: rgba(0, 0, 0, 0.02) 0 0 0 1px, rgba(0, 0, 0, 0.04) 0 2px 6px 0,
    rgba(0, 0, 0, 0.1) 0 4px 8px 0;

  --container: 1280px;
  --container-docs: 1080px;
}

/* ---------- Reset ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img {
  max-width: 100%;
  display: block;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
a {
  color: var(--ink);
  text-decoration: none;
}
h1,
h2,
h3,
h4,
p,
figure,
dl,
dd {
  margin: 0;
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Focus — 2px --ink ring, never removed, never red */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

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

.t-display-xl {
  font-weight: 600;
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.6px;
}
.t-display-l {
  font-weight: 600;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.4px;
}
.t-display-m {
  font-weight: 600;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.2px;
}
.t-display-s {
  font-weight: 500;
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: -0.44px;
}
.t-readout {
  font-weight: 700;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -1px;
  font-feature-settings: "tnum";
}
.t-title {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
}
.t-body {
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
}
.t-body-s {
  font-weight: 400;
  font-size: 14px;
  line-height: 1.43;
}
.t-figure {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.4;
  font-feature-settings: "tnum";
}
.t-caption {
  font-weight: 400;
  font-size: 13px;
  line-height: 1.23;
}
.t-tag {
  font-weight: 600;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-feature-settings: "case";
}
.t-mono-url {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "zero";
}
.t-mono-code {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.6;
  font-feature-settings: "zero";
}
.ink-body {
  color: var(--ink-body);
}
.ink-soft {
  color: var(--ink-soft);
}

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--s-24);
}
.container--docs {
  max-width: var(--container-docs);
}
.band {
  padding-block: var(--s-64);
}
.band--soft {
  background: var(--canvas-soft);
}
.band--soft + .band--soft {
  border-top: 1px solid var(--hairline);
}
.band--hero {
  padding-block: var(--s-96);
}
.section-head {
  margin-bottom: var(--s-32);
}
.eyebrow {
  color: var(--ink-soft);
  display: inline-block;
  margin-bottom: var(--s-16);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-8);
  height: 48px;
  padding: 0 var(--s-24);
  border-radius: var(--r-btn);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.25;
  border: 0;
  transition: background-color 120ms ease-out, border-color 120ms ease-out;
}
.btn-primary {
  background: var(--accent-deep);
  color: var(--on-accent);
}
.btn-primary:hover {
  background: var(--accent-deep);
}
.btn-primary:active {
  background: var(--accent-press);
}
.btn-secondary {
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-secondary:hover {
  background: var(--canvas-soft);
}
.btn-secondary--block {
  width: 100%;
}
.btn-tertiary {
  height: auto;
  padding: 0;
  background: none;
  color: var(--ink);
  border: 0;
}
.btn-tertiary:hover {
  text-decoration: underline;
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  height: 80px;
  display: flex;
  align-items: center;
  gap: var(--s-24);
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--s-24);
}
.wordmark {
  font-weight: 500;
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: -0.44px;
  color: var(--ink);
}
.nav-dock {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.nav-tabs {
  display: flex;
  gap: var(--s-24);
}
.nav-tab {
  position: relative;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
  color: var(--ink);
  padding-block: var(--s-8);
}
.nav-tab[aria-current="page"] {
  border-bottom: 2px solid var(--ink);
}
.nav-cta {
  flex-shrink: 0;
}
.nav-menu-btn {
  display: none;
  height: 44px;
  width: 44px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  border-radius: var(--r-btn);
  flex-shrink: 0;
}
.nav-menu-btn .bar {
  position: relative;
  width: 20px;
  height: 2px;
  background: var(--ink);
  display: block;
}
.nav-menu-btn .bar::before,
.nav-menu-btn .bar::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--ink);
}
.nav-menu-btn .bar::before {
  top: -6px;
}
.nav-menu-btn .bar::after {
  top: 6px;
}

/* Collapsed aperture pill docked in nav (index, on scroll) */
.nav-mini {
  display: none;
  align-items: center;
  gap: var(--s-8);
  height: 44px;
  padding: 0 var(--s-4) 0 var(--s-16);
  border-radius: var(--r-pill);
  background: var(--canvas);
  box-shadow: var(--shadow);
  max-width: 360px;
}
.nav-mini.is-visible {
  display: inline-flex;
}
.nav-mini .mini-url {
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
}
.nav-mini .mini-orb {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
}
.nav-mini .mini-orb svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--on-accent);
  stroke-width: 2;
}

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

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s-48);
  align-items: center;
}
.hero-copy {
  max-width: 520px;
}
.hero-title {
  margin-bottom: var(--s-16);
}
.hero-sub {
  color: var(--ink-body);
  margin-bottom: var(--s-32);
}

/* ---------- Aperture bar ---------- */

.aperture {
  margin-bottom: var(--s-16);
}
.aperture-bar {
  display: flex;
  align-items: stretch;
  height: 64px;
  padding: var(--s-8);
  gap: 0;
  background: var(--canvas);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow);
  width: fit-content;
  max-width: 100%;
}
.segment-cell {
  position: relative;
  display: flex;
}
.segment-cell + .segment-cell::before {
  content: "";
  align-self: center;
  width: 1px;
  height: 28px;
  background: var(--hairline);
}
.segment {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: var(--s-8) var(--s-16);
  background: transparent;
  border: 0;
  border-radius: var(--r-pill);
  text-align: left;
  transition: background-color 120ms ease-out, box-shadow 120ms ease-out;
}
.segment:hover {
  background: var(--canvas-soft);
}
.segment-label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.29;
  color: var(--ink);
  font-feature-settings: "zero";
}
.segment-value {
  font-size: 16px;
  line-height: 1.2;
  color: var(--ink-soft);
}
.segment-value.is-placeholder {
  color: var(--ink-faint);
}
.segment.is-set .segment-value {
  color: var(--ink);
  font-weight: 500;
}
.segment.is-open {
  background: var(--canvas);
  box-shadow: var(--shadow);
}
.segment.is-open .segment-label {
  font-weight: 600;
}
.segment.is-open::after {
  content: "";
  position: absolute;
  left: var(--s-24);
  right: var(--s-24);
  bottom: 6px;
  height: 2px;
  border-radius: var(--r-pill);
  background: var(--accent);
}
.segment[aria-disabled="true"] {
  cursor: default;
}
.segment[aria-disabled="true"] .segment-label,
.segment[aria-disabled="true"] .segment-value {
  color: var(--ink-faint);
}
.segment[aria-disabled="true"]:hover {
  background: transparent;
}

.run-orb {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  align-self: center;
  margin-left: var(--s-8);
  border-radius: 50%;
  background: var(--accent);
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.run-orb svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--on-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Popover */
.popover {
  position: absolute;
  top: calc(100% + var(--s-8));
  left: 0;
  z-index: 40;
  min-width: 240px;
  background: var(--canvas);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: var(--s-24);
}
.popover[hidden] {
  display: none;
}
@media (prefers-reduced-motion: no-preference) {
  .popover {
    animation: pop-in 150ms ease-out;
  }
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.popover-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: var(--s-16);
  color: var(--ink);
}
.stepper {
  display: flex;
  align-items: center;
  gap: var(--s-16);
}
.stepper-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--canvas-strong);
  border: 0;
  font-size: 20px;
  line-height: 1;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.stepper-field {
  width: 96px;
  height: 44px;
  border-radius: var(--r-btn);
  border: 1px solid var(--hairline-strong);
  text-align: center;
  font: inherit;
  font-feature-settings: "tnum";
  color: var(--ink);
  background: var(--canvas-soft);
}
.stepper-unit {
  color: var(--ink-soft);
  font-size: 14px;
}
.option-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--s-12) var(--s-16);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-btn);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  font-feature-settings: "zero";
}
.option:hover {
  background: var(--canvas-soft);
}
.option[aria-pressed="true"] {
  border-color: var(--ink);
  font-weight: 700;
}
.option .check {
  position: relative;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.option[aria-pressed="true"] .check::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 0;
  width: 5px;
  height: 9px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
}
.slider {
  width: 100%;
}
.slider-row {
  display: flex;
  align-items: center;
  gap: var(--s-16);
}
.slider-val {
  min-width: 40px;
  text-align: right;
  font-feature-settings: "tnum";
  color: var(--ink);
  font-weight: 500;
}
input[type="range"] {
  accent-color: var(--accent-deep);
}
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--s-8);
  margin-bottom: var(--s-16);
}
.swatch {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-btn);
  border: 1px solid var(--hairline);
  padding: 0;
}
.swatch[aria-pressed="true"] {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.hex-field {
  display: flex;
  align-items: center;
  gap: var(--s-8);
}
.hex-input {
  flex: 1;
  height: 44px;
  border-radius: var(--r-btn);
  border: 1px solid var(--hairline-strong);
  padding: 0 var(--s-12);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  background: var(--canvas-soft);
  font-feature-settings: "zero";
}
.hex-input.is-invalid {
  border-color: var(--accent-deep);
}
.hex-error {
  margin-top: var(--s-8);
  color: var(--accent-deep);
  font-size: 13px;
  min-height: 16px;
}

/* Live URL string */
.url-string {
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "zero";
  color: var(--ink);
  word-break: break-all;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-8);
}
.url-string .url-set {
  color: var(--ink);
}
.url-string .url-negotiated {
  color: var(--ink-soft);
}

/* Photo plates & preview */
.plate {
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--canvas-strong);
}
.plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.preview {
  display: flex;
  flex-direction: column;
  gap: var(--s-12);
}
.preview-plate {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--canvas-strong);
  transition: width 120ms ease-out, height 120ms ease-out;
}
.preview-plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
.caption {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.23;
}

/* ---------- Capability card grid ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-16);
}
.transform-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  overflow: hidden;
  transition: box-shadow 120ms ease-out;
}
.transform-card:hover {
  box-shadow: var(--shadow);
}
.transform-card .card-plate {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--canvas-strong);
  overflow: hidden;
}
.transform-card .card-plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.transform-card .card-meta {
  padding: var(--s-24);
  display: flex;
  flex-direction: column;
  gap: var(--s-8);
}
.card-title {
  color: var(--ink);
}
.card-desc {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.43;
}
.card-params {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  font-feature-settings: "zero";
  margin-top: var(--s-4);
}

/* ---------- Demo band (before / after) ---------- */

.demo-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-16);
}
.demo-col {
  display: flex;
  flex-direction: column;
  gap: var(--s-12);
}
.demo-col .demo-label {
  color: var(--ink-soft);
  font-size: 14px;
}
.demo-plate {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--canvas-strong);
}
.demo-plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
.demo-caption {
  margin-top: var(--s-16);
  color: var(--ink-soft);
  font-size: 13px;
}
.demo-caption .mono {
  font-family: var(--font-mono);
  color: var(--ink);
  font-feature-settings: "zero";
}

/* ---------- Stats band (trust readout) ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-24);
}
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--s-8);
}
.stat-figure {
  color: var(--ink);
}
.stat-label {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.43;
}

/* ---------- CTA band ---------- */

.cta-band {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  text-align: center;
}
.cta-band .cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-24);
}

/* ---------- Docs ---------- */

.page-opener {
  max-width: 720px;
}
.page-opener .opener-sub {
  color: var(--ink-body);
  margin-top: var(--s-16);
}
.quickstart {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--s-48);
  align-items: start;
}
.quickstart-plate {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--canvas-strong);
  position: sticky;
  top: 96px;
}
.quickstart-plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.qs-rows {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.qs-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: var(--s-24);
  padding-block: var(--s-24);
}
.qs-row + .qs-row {
  border-top: 1px solid var(--hairline-soft);
}
.qs-num {
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  font-feature-settings: "tnum";
}
.qs-body {
  min-width: 0;
}
.qs-body .qs-title {
  color: var(--ink);
  margin-bottom: var(--s-8);
}
.qs-body .qs-text {
  color: var(--ink-soft);
  font-size: 16px;
}
.inline-url {
  margin-top: var(--s-16);
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--ink);
  background: var(--canvas-soft);
  border-radius: var(--r-card);
  padding: var(--s-16);
  font-feature-settings: "zero";
  word-break: break-all;
}

/* Code block */
.code-block {
  position: relative;
  margin-top: var(--s-16);
  background: var(--canvas-soft);
  border-radius: var(--r-card);
  padding: var(--s-24);
}
.code-block pre {
  margin: 0;
  overflow-x: auto;
}
.code-block code {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  font-feature-settings: "zero";
  white-space: pre;
}
.code-block .code-strong {
  font-weight: 700;
  color: var(--ink);
}
.code-copy {
  position: absolute;
  top: var(--s-16);
  right: var(--s-16);
  height: 36px;
  padding: 0 var(--s-16);
}

/* Parameter table */
.param-table {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.param-head,
.param-row {
  display: grid;
  grid-template-columns: 140px 220px 1fr;
  gap: var(--s-24);
  padding-block: var(--s-12);
  align-items: baseline;
}
.param-head {
  border-bottom: 1px solid var(--hairline);
}
.param-head span {
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
}
.param-row + .param-row {
  border-top: 1px solid var(--hairline-soft);
}
.param-name {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  font-feature-settings: "zero";
  display: flex;
  align-items: center;
  gap: var(--s-8);
  flex-wrap: wrap;
}
.param-values {
  font-size: 14px;
  color: var(--ink);
}
.param-desc {
  font-size: 14px;
  color: var(--ink-soft);
}
.negotiated-tag {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-feature-settings: "case";
  color: var(--ink);
  background: var(--canvas-strong);
  border-radius: var(--r-pill);
  padding: 2px 8px;
}

/* Caching & limits rows */
.limit-rows {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.limit-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--s-24);
  padding-block: var(--s-24);
  align-items: baseline;
}
.limit-row + .limit-row {
  border-top: 1px solid var(--hairline-soft);
}
.limit-term {
  color: var(--ink);
  font-weight: 500;
  font-size: 16px;
  font-feature-settings: "tnum";
}
.limit-desc {
  color: var(--ink-soft);
  font-size: 16px;
  font-feature-settings: "tnum";
}

/* ---------- Pricing ---------- */

.pricing-opener {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--s-48);
  align-items: center;
}
.pricing-hero-plate {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--canvas-strong);
}
.pricing-hero-plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-24);
}
.tier-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: var(--s-24);
  display: flex;
  flex-direction: column;
  gap: var(--s-16);
}
.tier-name {
  color: var(--ink);
}
.tier-price {
  display: flex;
  align-items: baseline;
  gap: var(--s-8);
  color: var(--ink);
}
.tier-price .per {
  font-weight: 400;
  font-size: 16px;
  color: var(--ink-soft);
  letter-spacing: 0;
}
.tier-quota {
  border-top: 1px solid var(--hairline-soft);
  padding-top: var(--s-16);
  display: flex;
  flex-direction: column;
  gap: var(--s-12);
}
.tier-quota li {
  display: flex;
  gap: var(--s-8);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  font-feature-settings: "tnum";
}
.tier-quota li .q-value {
  color: var(--ink);
}

/* Overage / billing rows */
.billing-rows {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.billing-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--s-24);
  padding-block: var(--s-24);
  align-items: baseline;
}
.billing-row + .billing-row {
  border-top: 1px solid var(--hairline-soft);
}
.billing-term {
  color: var(--ink);
  font-weight: 500;
  font-size: 16px;
}
.billing-desc {
  color: var(--ink-soft);
  font-size: 16px;
  font-feature-settings: "tnum";
}

/* FAQ */
.faq {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.faq-item {
  border-bottom: 1px solid var(--hairline-soft);
}
.faq-item:last-child {
  border-bottom: 0;
}
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-16);
  padding-block: var(--s-24);
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-q {
  font-weight: 500;
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: -0.44px;
  color: var(--ink);
}
.faq-chevron {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--canvas-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.faq-chevron::before {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
  margin-top: -3px;
  transition: transform 150ms ease-out;
}
.faq-item[open] .faq-chevron::before {
  transform: rotate(-135deg);
  margin-top: 3px;
}
.faq-answer {
  color: var(--ink-body);
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: var(--s-24);
  max-width: 760px;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: var(--canvas);
  padding: var(--s-12) var(--s-24);
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease-out, transform 150ms ease-out;
  z-index: 100;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

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

.footer {
  background: var(--canvas);
  border-top: 1px solid var(--hairline);
}
.footer-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--s-48) var(--s-24) var(--s-32);
}
.footer-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--s-24);
  padding-bottom: var(--s-32);
}
.footer-brand .wordmark {
  display: inline-block;
  margin-bottom: var(--s-12);
}
.footer-brand p {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.43;
  max-width: 260px;
}
.footer-col h4 {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: var(--s-12);
}
.footer-col li {
  margin-bottom: var(--s-8);
}
.footer-col a {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.43;
}
.footer-col a:hover {
  text-decoration: underline;
}
.footer-legal {
  border-top: 1px solid var(--hairline);
  padding-top: var(--s-24);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.23;
}

/* ---------- Responsive ---------- */

@media (max-width: 1128px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--s-32);
  }
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tier-grid {
    grid-template-columns: 1fr;
    max-width: 520px;
  }
  .t-display-xl {
    font-size: 32px;
    letter-spacing: -0.4px;
  }
}

@media (max-width: 743px) {
  .container {
    padding-inline: var(--s-16);
  }
  .nav-inner {
    padding-inline: var(--s-16);
  }
  .nav-tabs {
    display: none;
  }
  .nav-cta {
    display: none;
  }
  .nav-menu-btn {
    display: inline-flex;
  }
  .nav.menu-open .nav-tabs {
    display: flex;
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--canvas);
    border-bottom: 1px solid var(--hairline);
    padding: var(--s-8) var(--s-16) var(--s-16);
  }
  .nav.menu-open .nav-tab {
    padding-block: var(--s-16);
    border-bottom: 1px solid var(--hairline-soft);
  }
  .nav.menu-open .nav-tab[aria-current="page"] {
    border-bottom: 2px solid var(--ink);
  }
  .nav.menu-open .nav-cta {
    display: inline-flex;
    position: absolute;
    top: calc(80px + 132px);
    left: var(--s-16);
    right: var(--s-16);
    width: auto;
  }
  .t-display-xl,
  .t-display-l {
    font-size: 28px;
    letter-spacing: -0.2px;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .demo-pair {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--s-32) var(--s-24);
  }
  .quickstart {
    grid-template-columns: 1fr;
    gap: var(--s-24);
  }
  .quickstart-plate {
    position: static;
    max-width: 220px;
  }
  .param-head {
    display: none;
  }
  .param-row {
    grid-template-columns: 1fr;
    gap: var(--s-4);
  }
  .limit-row,
  .billing-row {
    grid-template-columns: 1fr;
    gap: var(--s-4);
  }
  .pricing-opener {
    grid-template-columns: 1fr;
  }
  .pricing-hero-plate {
    max-width: 280px;
  }
  .footer-cols {
    grid-template-columns: 1fr 1fr;
  }
  /* Aperture bar collapses to a single tappable pill showing the live URL */
  .aperture-bar {
    width: 100%;
    height: auto;
    flex-wrap: wrap;
    border-radius: var(--r-lg);
    gap: 0;
  }
  .segment-cell {
    flex: 1 1 33%;
  }
  .segment-cell + .segment-cell::before {
    display: none;
  }
  .segment {
    width: 100%;
    padding: var(--s-12) var(--s-16);
  }
  .popover {
    left: 0;
    right: 0;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
