/* ==========================================================================
   PremiumWeblap — "Ultramarin" design system
   Concept: a studio poster that reads twice — once for people, once for
   machines. Bone-paper chapters alternate with ultramarine chapters; a
   monospace layer carries the real machine metadata of the page.
   Notes: Mobile-first, GPU-friendly, prefers-reduced-motion aware.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Brand constants */
  --ultra: #2a1fe8;
  --ultra-deep: #1a11b0;
  --ultra-ink: #0c0740;
  --bone: #f3f0e7;
  --bone-2: #e9e4d7;
  --ink: #100d24;
  --ink-soft: #4a4560;
  --flame: #ff5a24;
  --haze: #c6c1ff;

  /* Contextual palette — paper is the default chapter */
  --bg: var(--bone);
  --fg: var(--ink);
  --fg-soft: var(--ink-soft);
  --rule: rgba(16, 13, 36, 0.16);
  --rule-strong: rgba(16, 13, 36, 0.42);
  --panel: #fffdf8;
  --panel-2: var(--bone-2);
  --shadow-color: var(--ink);
  /* Flame is a fill colour; text set in it needs its own readable tint per ground. */
  --accent-text: #c2380a;

  /* Typography */
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", "Cascadia Mono", monospace;

  /* Fluid type scale */
  --fs-display: clamp(2.9rem, 7.4vw, 6.2rem);
  --fs-h1: clamp(2.2rem, 5vw, 3.7rem);
  --fs-h2: clamp(1.9rem, 4vw, 3rem);
  --fs-h3: clamp(1.2rem, 1.9vw, 1.5rem);
  --fs-lead: clamp(1.05rem, 1.5vw, 1.28rem);
  --fs-body: 1.0625rem;
  --fs-mono: 0.78rem;

  /* Spacing & layout */
  --container: 1220px;
  --container-narrow: 820px;
  --gap: clamp(1rem, 2.2vw, 1.5rem);
  --section-y: clamp(4rem, 9vw, 7.5rem);
  --radius: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* Effects — hard offset shadows, no glow */
  --lift: 5px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

/* Ultramarine chapter: same components, inverted ground */
.band--ultra {
  --bg: var(--ultra);
  --fg: var(--bone);
  --fg-soft: var(--haze);
  --rule: rgba(255, 255, 255, 0.26);
  --rule-strong: rgba(255, 255, 255, 0.6);
  --panel: rgba(255, 255, 255, 0.07);
  --panel-2: rgba(255, 255, 255, 0.12);
  --shadow-color: var(--ultra-ink);
  --accent-text: #ffab84;
  background: var(--bg);
  color: var(--fg);
}

/* Deepest chapter — used by the footer */
.band--night {
  --bg: var(--ultra-ink);
  --fg: var(--bone);
  --fg-soft: var(--haze);
  --rule: rgba(255, 255, 255, 0.18);
  --rule-strong: rgba(255, 255, 255, 0.45);
  --panel: rgba(255, 255, 255, 0.05);
  --panel-2: rgba(255, 255, 255, 0.1);
  --shadow-color: #000;
  --accent-text: #ffab84;
  background: var(--bg);
  color: var(--fg);
}

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

* { margin: 0; }

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.62;
  color: var(--ink);
  background: var(--bone);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

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

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

button,
input,
textarea,
select { font: inherit; color: inherit; }

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

/* The ring takes the chapter's foreground, not the accent: flame sits at 2.7:1
   on both bone and ultramarine, and vanishes entirely on a flame button. --fg
   is the one colour guaranteed to contrast with its own ground. */
:focus-visible {
  outline: 3px solid var(--fg);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--flame); color: #fff; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -120%;
  z-index: 1000;
  background: var(--flame);
  color: var(--ink);
  padding: 0.7rem 1.1rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  font-weight: 700;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* Legacy ambience layers from the previous system — retired. */
.bg-aurora,
.bg-grid { display: none; }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2.2rem);
}
.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(2.5rem, 6vw, 4rem); }

.stack > * + * { margin-top: 1rem; }
.center { text-align: center; }
.measure { max-width: 62ch; }
.mx-auto { margin-inline: auto; }

/* Chapters paint edge-to-edge; the container keeps the measure. */
.band--ultra,
.band--night { position: relative; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 48;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variation-settings: "opsz" 24;
}
p { color: var(--fg-soft); }
strong { color: var(--fg); font-weight: 700; }

/* The studio's red pen: an emphasised phrase gets a flame rule beneath it.
   Sits below the descenders, so contrast never depends on the fill. */
.gradient-text {
  color: inherit;
  background-image: linear-gradient(var(--flame), var(--flame));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 0.075em;
  padding-bottom: 0.04em;
  /* Each wrapped line gets its own rule instead of one stretched box. */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.js .reveal .gradient-text { background-size: 0 0.075em; transition: background-size 0.7s 0.35s var(--ease-out); }
.js .reveal.is-visible .gradient-text { background-size: 100% 0.075em; }

/* Machine layer: real metadata, set in mono. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-soft);
}
.eyebrow::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: none;
  background: var(--flame);
}

.section-head {
  max-width: 760px;
  margin-bottom: clamp(2rem, 5vw, 3.4rem);
}
.section-head h2 { margin-top: 1rem; }
.section-head .lead { font-size: var(--fs-lead); margin-top: 1rem; }
.section-head.center { margin-inline: auto; }

.lead { font-size: var(--fs-lead); color: var(--fg-soft); }

/* Mono annotation — the schema type a block actually maps to.
   No opacity: --fg-soft already sets the muted level, and dimming it further
   pushed this below 4.5:1 on the ultramarine ground. */
.meta {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.06em;
  color: var(--fg-soft);
}

/* Ruled section divider carrying a mono label. */
.rule-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-soft);
}
.rule-label span + span { margin-left: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  border: 2px solid var(--fg);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--lift) var(--lift) 0 var(--shadow-color);
  /* Hover is the press and nothing else — colours hold, so only the two
     properties that actually move are transitioned. */
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.btn svg { width: 1.05em; height: 1.05em; flex: none; }
.btn:hover,
.btn:active {
  transform: translate(var(--lift), var(--lift));
  box-shadow: 0 0 0 var(--shadow-color);
}

.btn-primary {
  background: var(--flame);
  border-color: var(--ink);
  color: var(--ink);
  --shadow-color: var(--ink);
}

.btn-ghost {
  background: transparent;
  border-color: var(--fg);
  color: var(--fg);
}

.btn-block { width: 100%; }
.btn-lg { padding: 1.05rem 1.9rem; font-size: 1.05rem; }

/* ---------- Navbar ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav.scrolled {
  background: var(--bone);
  border-bottom-color: var(--ink);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 78px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.045em;
  color: var(--fg);
}
.brand__mark {
  width: 36px;
  height: 36px;
  flex: none;
}
.nav__menu {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.nav__menu a:not(.btn) {
  position: relative;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--fg);
  white-space: nowrap;
}
.nav__menu a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.3rem;
  height: 2px;
  background: var(--flame);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav__menu a:not(.btn):hover::after { transform: scaleX(1); }
.nav__menu .btn { display: none; }
.nav__cta { display: flex; align-items: center; gap: 0.7rem; }
.nav__cta .btn { --lift: 3px; padding: 0.65rem 1.15rem; font-size: 0.9rem; }

.nav__toggle {
  display: none;
  width: 46px;
  height: 46px;
  border: 2px solid var(--fg);
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav__toggle span,
.nav__toggle span::before,
.nav__toggle span::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--fg);
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.nav__toggle span::before { transform: translateY(-6px); }
.nav__toggle span::after { transform: translateY(4px); }
.nav[data-open="true"] .nav__toggle span { background: transparent; }
.nav[data-open="true"] .nav__toggle span::before { transform: rotate(45deg); }
.nav[data-open="true"] .nav__toggle span::after { transform: rotate(-45deg) translateY(-1.4px); }

/* Over an ultramarine hero the nav inherits bone ink until it sticks. */
/* The bar is transparent here, floating over the ultramarine hero — so --bg has
   to name what is actually behind it. Ghost buttons invert to --bg on hover and
   would otherwise fill bone with bone text. */
/* --bg names the ground behind this transparent fixed bar — the one thing the
   DOM cannot reveal on its own, and what contrast checks resolve against. */
.nav:not(.scrolled) { --fg: var(--bone); --bg: var(--ultra); --shadow-color: var(--ultra-ink); color: var(--bone); }
.nav.scrolled { --fg: var(--ink); --shadow-color: var(--ink); color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(8rem, 15vw, 11rem);
  padding-bottom: clamp(3.5rem, 8vw, 6rem);
  overflow: hidden;
}
/* Faint ruled field — the studio's setting grid, not decoration for its own sake */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: calc(100% / 12) 100%;
  mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
}
.hero > .container { position: relative; z-index: 1; }

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.9rem 0.35rem 0.35rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--fg);
  margin-bottom: 1.8rem;
}
.hero__badge b {
  background: var(--flame);
  color: var(--ink);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
}
/* Sub-page heroes speak; the home page shouts. */
.hero h1 {
  font-size: var(--fs-h1);
  font-variation-settings: "opsz" 72;
  max-width: 18ch;
}
.hero__panel--human h1 {
  font-size: var(--fs-display);
  font-variation-settings: "opsz" 96;
  max-width: 15ch;
}
.hero__lead {
  font-size: var(--fs-lead);
  color: var(--fg-soft);
  max-width: 54ch;
  margin-top: 1.6rem;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.2rem;
}
.hero__trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 2.2rem;
  margin-top: 3rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--fg-soft);
}

/* ---------- Signature: the dual-read hero ----------
   The business claim is that a page reads twice. The hero proves it: the same
   content, rendered for a person and rendered for a machine. */
.hero__switch {
  display: inline-flex;
  padding: 3px;
  margin-bottom: 1.6rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-pill);
}
.hero__switch-btn {
  padding: 0.45rem 1.1rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--fg-soft);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.hero__switch-btn[aria-pressed="true"] {
  background: var(--flame);
  color: var(--ink);
  font-weight: 500;
}
html:not(.js) .hero__switch { display: none; }

/* Both panels stack in one grid cell, so the stage reserves the height of the
   taller one and nothing jumps or spills when the view flips. */
.hero__stage { display: grid; }
.hero__stage > .hero__panel { grid-area: 1 / 1; align-self: start; }
.hero__panel--machine {
  opacity: 0;
  visibility: hidden;
  clip-path: inset(0 0 100% 0);
  transition: opacity 0.35s var(--ease), clip-path 0.5s var(--ease-out), visibility 0s 0.5s;
}
.hero__stage[data-view="machine"] .hero__panel--human {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0s 0.3s;
}
.hero__stage[data-view="machine"] .hero__panel--machine {
  opacity: 1;
  visibility: visible;
  clip-path: inset(0 0 0 0);
  transition: opacity 0.35s 0.1s var(--ease), clip-path 0.55s var(--ease-out), visibility 0s;
}
.hero__panel--human { transition: opacity 0.3s 0.15s var(--ease), visibility 0s; }
/* Keep the machine rendering to a document measure rather than a full-bleed bar. */
.hero__panel--machine .codeblock { max-width: 780px; }

.codeblock {
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  background: rgba(12, 7, 64, 0.5);
  overflow: hidden;
}
.codeblock__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.7rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--fg-soft);
}
.codeblock__bar b {
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  background: var(--flame);
  color: var(--ink);
  font-weight: 500;
}
.codeblock__bar span:last-child { margin-left: auto; }
.codeblock pre {
  margin: 0;
  padding: 1.1rem 1.2rem 1.4rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.15vw, 0.85rem);
  line-height: 1.85;
  color: var(--fg-soft);
}
.codeblock .k { color: var(--accent-text); }
.codeblock .v { color: var(--bone); }
.codeblock .c { opacity: 0.82; }

/* Line-by-line reveal when the machine view comes up. */
.hero__stage[data-view="machine"] .codeblock pre > span {
  display: block;
  animation: line-in 0.4s both var(--ease-out);
  animation-delay: calc(var(--i, 0) * 45ms + 150ms);
}
@keyframes line-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Cards ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--gap);
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 2px solid var(--fg);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 2.4vw, 1.9rem);
  box-shadow: var(--lift) var(--lift) 0 var(--shadow-color);
}
/* Cards hold still. The press belongs to buttons, so it keeps meaning something;
   a card that pushes reads as a control, which the ones without a link are not.
   Affordance on the linked cards comes from the arrow nudge below. */
.card__icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--flame);
  border: 2px solid var(--ink);
  color: var(--ink);
  margin-bottom: 1.2rem;
}
.card__icon svg { width: 26px; height: 26px; }
.card h3 { margin-bottom: 0.55rem; }
.card p { font-size: 0.97rem; }
.card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
}
.card__link svg { width: 1.1em; height: 1.1em; transition: transform 0.25s var(--ease); }
.card:hover .card__link svg { transform: translateX(5px); }
.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }

/* The lead offer wears the ultramarine, so the eye lands there first. */
.card--feature {
  --panel: var(--ultra);
  --fg: var(--bone);
  --fg-soft: var(--haze);
  --shadow-color: var(--ink);
  background: var(--ultra);
  color: var(--bone);
  border-color: var(--ink);
}

/* Corner-set, so a tagged card keeps its heading on the same baseline as its
   untagged neighbours. */
.tag {
  position: absolute;
  top: clamp(1.4rem, 2.4vw, 1.9rem);
  right: clamp(1.4rem, 2.4vw, 1.9rem);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--flame);
  color: var(--ink);
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.stat {
  padding: clamp(1.4rem, 3vw, 2.2rem) clamp(0.6rem, 2vw, 1.4rem);
  border-left: 1px solid var(--rule);
}
.stat:first-child { border-left: 0; }
.stat__num {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 800;
  font-variation-settings: "opsz" 72;
  letter-spacing: -0.05em;
  line-height: 0.9;
  color: var(--fg);
}
.stat__label {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--fg-soft);
  margin-top: 0.8rem;
}

/* ---------- Process ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 2px solid var(--fg);
}
.step {
  position: relative;
  padding: 1.8rem 1.4rem 2rem;
  border-left: 1px solid var(--rule);
}
.step:first-child { border-left: 0; }
/* The sequence is real: four stages in order, so the marker carries it. */
.step__num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.step h3 { margin: 0.9rem 0 0.6rem; }
.step p { font-size: 0.95rem; }
.step::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 0;
  height: 6px;
  background: var(--flame);
  transition: width 0.5s var(--ease-out);
}
.step.is-visible::before { width: 100%; }

/* ---------- Feature list ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem 2.4rem;
}
.feature {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}
.feature__check {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--flame);
  color: var(--ink);
  margin-top: 3px;
}
.feature__check svg { width: 15px; height: 15px; }
/* The heading level inside .feature depends on how deep the component sits, so
   the look is pinned to the class instead of the tag: the includes grid renders
   an h3 under the section h2, the sidePoints list an h4 one level lower, and
   both must read identically. */
.feature h4,
.feature .feature__title {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--fg);
  margin-bottom: 0.2rem;
}
/* Blog cards sit directly under the page h1, so their title is an h2 — kept at
   h3 size, which is what it rendered at before the level was corrected. */
.feature .feature__post-title {
  font-size: var(--fs-h3);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variation-settings: "opsz" 24;
  margin-bottom: 0.5rem;
}
.feature p { font-size: 0.92rem; }

/* ---------- Split section ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

/* ---------- Tech marquee ---------- */
.marquee {
  overflow: hidden;
  padding-block: 1.2rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  align-items: center;
  gap: 2.4rem;
  width: max-content;
  animation: marquee 42s linear infinite;
}
.marquee__track span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 2.6vw, 2rem);
  letter-spacing: -0.03em;
  color: var(--fg);
  white-space: nowrap;
}
.marquee__track span::after {
  content: "◆";
  margin-left: 2.4rem;
  font-size: 0.5em;
  vertical-align: middle;
  color: var(--flame);
}
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- Pricing ---------- */
.pricing {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  align-items: start;
}
.price {
  display: flex;
  flex-direction: column;
  padding: clamp(1.6rem, 3vw, 2.2rem);
  border: 2px solid var(--fg);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--lift) var(--lift) 0 var(--shadow-color);
}
.price--featured {
  --panel: var(--ultra);
  --fg: var(--bone);
  --fg-soft: var(--haze);
  --rule: rgba(255, 255, 255, 0.26);
  --shadow-color: var(--ink);
  background: var(--ultra);
  color: var(--bone);
  border-color: var(--ink);
}
.price__name {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-soft);
}
.price__desc { font-size: 0.93rem; color: var(--fg-soft); margin-top: 0.8rem; min-height: 2.8em; }
.price__amount {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4vw, 2.8rem);
  font-weight: 800;
  font-variation-settings: "opsz" 48;
  letter-spacing: -0.05em;
  line-height: 1;
  margin: 1.2rem 0 0.2rem;
  color: var(--fg);
}
.price__amount small {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--fg-soft);
}
.price ul { margin: 1.4rem 0; display: grid; gap: 0.75rem; padding-top: 1.4rem; border-top: 1px solid var(--rule); }
.price li { display: flex; gap: 0.65rem; font-size: 0.94rem; color: var(--fg-soft); }
.price li svg { flex: none; width: 18px; height: 18px; color: var(--accent-text); margin-top: 4px; }
.price .btn { margin-top: auto; }
.price__badge {
  align-self: flex-start;
  margin-bottom: 0.9rem;
  padding: 0.22rem 0.6rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--flame);
  color: var(--ink);
}

/* ---------- FAQ ---------- */
.faq { display: grid; max-width: 860px; margin-inline: auto; border-top: 1px solid var(--rule); }
.faq__item { border-bottom: 1px solid var(--rule); }
.faq__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  text-align: left;
  padding: 1.35rem 0.2rem;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.02rem, 1.7vw, 1.22rem);
  letter-spacing: -0.02em;
  color: var(--fg);
}
.faq__q:hover { color: var(--accent-text); }
.faq__q .icon {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 2px solid var(--fg);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.faq__item[data-open="true"] .faq__q .icon {
  transform: rotate(45deg);
  background: var(--flame);
  border-color: var(--ink);
  color: var(--ink);
}
.faq__a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease);
}
/* Collapsing to 0fr hides the answer visually but leaves it in the
   accessibility tree, which makes aria-expanded="false" a lie. visibility
   takes it out properly, delayed so the open/close animation still plays. */
.faq__a > div {
  overflow: hidden;
  visibility: hidden;
  transition: visibility 0s 0.35s;
}
.faq__item[data-open="true"] .faq__a { grid-template-rows: 1fr; }
.faq__item[data-open="true"] .faq__a > div { visibility: visible; transition: visibility 0s; }
.faq__a p { padding: 0 3rem 1.5rem 0.2rem; font-size: 0.98rem; max-width: 68ch; }

/* ---------- CTA ---------- */
.cta {
  position: relative;
  text-align: center;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: clamp(2.6rem, 6vw, 5rem) clamp(1.5rem, 4vw, 3rem);
  background: var(--ultra);
  color: var(--bone);
  box-shadow: 10px 10px 0 var(--ink);
  overflow: hidden;
  --fg: var(--bone);
  --fg-soft: var(--haze);
  --rule-strong: rgba(255, 255, 255, 0.6);
  --shadow-color: var(--ultra-ink);
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: calc(100% / 8) 100%;
}
.cta > * { position: relative; }
.cta h2 {
  font-size: var(--fs-h1);
  font-variation-settings: "opsz" 72;
  max-width: 17ch;
  margin: 1rem auto 0;
}
.cta p { font-size: var(--fs-lead); max-width: 52ch; margin: 1.2rem auto 0; }
.cta .hero__actions { justify-content: center; }

/* ---------- Contact form ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}
.contact-info { display: grid; gap: 1rem; }
.contact-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.15rem 1.25rem;
  border: 2px solid var(--fg);
  border-radius: var(--radius);
  background: var(--panel);
}
.contact-item .ic {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--flame);
  color: var(--ink);
}
.contact-item strong { display: block; font-size: 0.95rem; color: var(--fg); }
.contact-item a,
.contact-item span { color: var(--fg-soft); font-size: 0.95rem; }
.contact-item a:hover { color: var(--accent-text); text-decoration: underline; }

.form {
  display: grid;
  gap: 1.15rem;
  padding: clamp(1.6rem, 3vw, 2.2rem);
  border: 2px solid var(--fg);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--lift) var(--lift) 0 var(--shadow-color);
}
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.15rem; }
.field { display: grid; gap: 0.4rem; }
.field label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-soft);
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 2px solid var(--rule-strong);
  background: var(--bone);
  color: var(--ink);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-soft); opacity: 0.7; }
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--ultra);
  box-shadow: 3px 3px 0 var(--ultra);
}
.field textarea { resize: vertical; min-height: 140px; }
.form__note { font-family: var(--font-mono); font-size: 0.74rem; line-height: 1.6; color: var(--fg-soft); }
.form__status { font-size: 0.92rem; font-weight: 700; min-height: 1.2em; }
.form__status[data-state="ok"] { color: #0f7a4a; }
.form__status[data-state="error"] { color: var(--accent-text); }

/* The submit handler intercepts every branch, so with JavaScript off the form
   cannot send anything at all — showing it would just waste the visitor's
   typing. The .js class comes from the inline script in <head>, so this hides
   the form before first paint rather than flashing it. */
html:not(.js) #contact-form { display: none; }
.form__fallback {
  background: var(--panel);
  border: 2px solid var(--fg);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 2.4vw, 1.9rem);
  box-shadow: var(--lift) var(--lift) 0 var(--shadow-color);
}
.form__fallback h2 { font-size: var(--fs-h3); margin-bottom: 0.6rem; }
.form__fallback p { margin-bottom: 0.8rem; }
.form__fallback a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Footer ---------- */
/* Sections already carry their own bottom padding — no extra gap here. */
.footer { padding-block: clamp(3.5rem, 7vw, 5.5rem) 2rem; }
.footer__top {
  display: grid;
  grid-template-columns: 1.7fr repeat(3, 1fr);
  gap: 2.5rem;
}
.footer__brand p { font-size: 0.95rem; margin-top: 1.1rem; max-width: 36ch; }
/* Footer column labels are h2: they follow the page's h1 or a section h2, and as
   h4 they skipped a level on every page in the site. The mono/uppercase styling
   is unchanged — only the tag moved. */
.footer h2 {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 1.1rem;
}
.footer__links { display: grid; gap: 0.65rem; font-size: 0.95rem; color: var(--fg-soft); }
.footer__links a { color: var(--fg-soft); transition: color 0.2s var(--ease); }
.footer__links a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }
.footer__socials { display: flex; gap: 0.6rem; margin-top: 1.4rem; }
.footer__socials a {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid var(--rule-strong);
  border-radius: var(--radius);
  color: var(--fg);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.footer__socials a:hover { background: var(--flame); border-color: var(--flame); color: var(--ink); }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  margin-top: 3.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--fg-soft);
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--fg-soft);
  margin-bottom: 1.6rem;
}
.breadcrumb a { color: var(--fg); }
.breadcrumb a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Prose (legal / article) ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 2.4rem; margin-bottom: 0.9rem; }
.prose h3 { margin-top: 1.8rem; margin-bottom: 0.6rem; }
.prose p, .prose li { color: var(--fg-soft); }
.prose ul { display: grid; gap: 0.7rem; margin: 1.1rem 0; }
.prose ul li { position: relative; padding-left: 1.6rem; }
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  background: var(--flame);
}

/* ---------- Reveal animation ---------- */
/* Only hide when JS is available (html.js); without JS everything stays visible. */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
/* Tabbing can reach a block before the scroll observer has revealed it. Show it
   the moment anything inside takes focus, so focus is never on invisible content. */
.js .reveal:focus-within { opacity: 1; transform: none; transition-delay: 0s; }
.reveal[data-delay="1"] { transition-delay: 0.07s; }
.reveal[data-delay="2"] { transition-delay: 0.14s; }
.reveal[data-delay="3"] { transition-delay: 0.21s; }
.reveal[data-delay="4"] { transition-delay: 0.28s; }
.reveal[data-delay="5"] { transition-delay: 0.35s; }

/* Hero opens with one orchestrated sequence rather than scattered effects. */
.js .hero .reveal { transition-duration: 0.8s; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .footer__top { grid-template-columns: 1fr 1fr; gap: 2.2rem; }
  .split { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

/* Nav collapses to a hamburger menu earlier than the content grids */
@media (max-width: 1024px) {
  .nav__cta { display: none; }
  .nav__toggle { display: inline-flex; }
  .nav__menu {
    position: fixed;
    inset: 78px 0 auto 0;
    display: grid;
    align-content: start;
    gap: 0.2rem;
    padding: 1.2rem clamp(1.1rem, 4vw, 2.2rem) 1.8rem;
    background: var(--bone);
    border-bottom: 2px solid var(--ink);
    max-height: calc(100dvh - 78px);
    overflow-y: auto;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    /* visibility, not just opacity: a transparent menu still holds its links in
       the tab order, so a keyboard user would tab into a panel they cannot see.
       Delaying it by the fade duration keeps the close animation intact. */
    visibility: hidden;
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease), visibility 0s 0.3s;
  }
  .nav[data-open="true"] .nav__menu {
    transform: none;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease), visibility 0s;
  }
  .nav__menu a:not(.btn) {
    padding: 0.9rem 0.6rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    border-bottom: 1px solid rgba(16, 13, 36, 0.12);
  }
  .nav__menu a:not(.btn)::after { display: none; }
  .nav__menu .btn { display: inline-flex; margin-top: 1rem; --shadow-color: var(--ink); }
}

@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .col-2, .col-3, .col-4, .col-6 { grid-column: span 2; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .step:nth-child(odd) { border-left: 0; }
  .step:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .pricing { grid-template-columns: 1fr; max-width: 480px; margin-inline: auto; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero::before { background-size: calc(100% / 6) 100%; }
}

@media (max-width: 560px) {
  :root { --lift: 4px; }
  .bento { grid-template-columns: 1fr; }
  .col-2, .col-3, .col-4, .col-6 { grid-column: span 1; }
  .stats { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
  .step { border-left: 0; }
  .step:nth-child(n + 2) { border-top: 1px solid var(--rule); }
  .form__row { grid-template-columns: 1fr; }
  .footer__top { grid-template-columns: 1fr; }
  .hero__actions .btn { width: 100%; }
  .faq__a p { padding-right: 0.5rem; }
  /* The schema annotation is a refinement — on a phone the section name is enough. */
  .rule-label span + span { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .js .reveal .gradient-text { background-size: 100% 0.075em; }
  .step::before { width: 100%; }
}

/* ---------- Print ---------- */
@media print {
  .nav, .cta, .footer__socials, .marquee, .hero__switch { display: none; }
  body { background: #fff; color: #000; }
  .band--ultra, .band--night { background: #fff; color: #000; }
  .card, .price, .form { box-shadow: none; }
}

/* ---------- Diagrams ---------- */
/* Inline SVG rather than raster: no extra request, scales cleanly, and the
   strokes inherit currentColor so a diagram never fights the surface it sits on. */
.figure { margin: 1.8rem 0; }
/* Diagrams scroll rather than shrink. Letting a 672-unit viewBox fit a 340px
   phone scaled the 11px captions to 5.6px on screen — measured in the browser,
   not guessed. min-width holds the drawing at a legible size and the wrapper
   absorbs the overflow, so the page body never scrolls sideways. */
.figure__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.figure svg { display: block; width: 100%; min-width: 560px; height: auto; overflow: visible; }
.figure figcaption {
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  line-height: 1.5;
  color: var(--fg-soft);
}
.figure .dg-label { font-family: var(--font-body); font-size: 13px; fill: var(--fg); }
.figure .dg-sub   { font-family: var(--font-mono); font-size: 11px; fill: var(--fg-soft); }
.figure .dg-bar   { fill: var(--ultra); }
.figure .dg-bar--wide { fill: var(--flame); }
.figure .dg-track { fill: var(--rule); }
.figure .dg-box   { fill: var(--panel); stroke: var(--rule-strong); stroke-width: 1.5; }
.figure .dg-box--accent { stroke: var(--ultra); }
.figure .dg-arrow { stroke: var(--fg-soft); stroke-width: 1.5; fill: none; }
.figure .dg-boundary { fill: none; stroke: var(--ultra); stroke-width: 1.5; stroke-dasharray: 6 4; }
