/* Vero Labs v2 · "Field Report"
   Ink on paper, one red pen. Soft paper white end to end (a deliberate,
   owner-approved softening of the build guide's pure #FFFFFF; kept neutral,
   not cream); --paper-tint only on evidence blocks; --redline used
   sparingly. No gradients, no shadows. */

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

:root {
  --paper: #F8F8F5;
  --paper-tint: #F1F1EC;
  --ink: #171715;
  --ink-soft: #55554F;
  --rule: #D9D9D4;
  --redline: #C8371E;
  --redline-ink: #A32C16;

  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-text: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  --measure: 68ch;
  --section-pad: 7rem;
  --wrap-max: 1120px;
  --wrap-pad: clamp(1.25rem, 5vw, 2.5rem);
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

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

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

::selection {
  background: var(--ink);
  color: var(--paper);
}

/* Links: real underlines, editorial */
a {
  color: var(--redline-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--redline);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--wrap-max);
  margin-inline: auto;
  padding-inline: var(--wrap-pad);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--paper);
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  z-index: 100;
}

.skip-link:focus-visible {
  left: 0;
}

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

.mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.measure {
  max-width: var(--measure);
}

/* ---------- Masthead ---------- */

.masthead {
  padding-top: 2.5rem;
}

.masthead-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ink);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

a.wordmark:hover {
  text-decoration: none;
}

.masthead-desc {
  font-family: var(--font-text);
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.masthead-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.contents-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
}

.contents-nav a {
  color: var(--ink);
  text-decoration: none;
}

.contents-nav a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.contents-label {
  color: var(--ink-soft);
}

/* ---------- Sticky bar ---------- */

.stickybar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  transform: translateY(-100%);
  visibility: hidden;
}

.stickybar.is-visible {
  transform: translateY(0);
  visibility: visible;
}

.stickybar-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.6rem;
}

.stickybar .wordmark {
  font-size: 1.05rem;
}

.stickybar-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.stickybar-nav a {
  color: var(--ink);
  text-decoration: none;
}

.stickybar-nav a:hover {
  text-decoration: underline;
}

.stickybar-cta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--redline);
  white-space: nowrap;
}

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

.hero {
  padding-block: clamp(4rem, 9vw, 7rem);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.8rem, 6vw, 4.3rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.hero-sub {
  margin-top: 2rem;
  max-width: var(--measure);
}

.hero .section-title {
  margin-top: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  margin-top: 2.5rem;
}

.hero-tags {
  margin-top: 2.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

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

.btn {
  display: inline-block;
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1;
  padding: 0.8rem 1.6rem;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--redline);
  border-color: var(--redline);
  color: #FFFFFF;
}

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

.btn-secondary {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--paper-tint);
}

.textlink {
  font-family: var(--font-text);
  font-size: 1rem;
}

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

.section {
  padding-block: calc(var(--section-pad) / 2);
  scroll-margin-top: 3.25rem;
}

.section:last-of-type {
  padding-bottom: var(--section-pad);
}

.section-head {
  max-width: var(--measure);
}

.kicker {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.75rem;
}

.kicker-no {
  font-weight: 500;
  color: var(--redline);
}

.kicker-name,
h2.kicker-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-top: 1.5rem;
}

.section-dek {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.section-intro {
  margin-top: 1.5rem;
  max-width: var(--measure);
}

/* Annotated rows: text column + outer margin column (>=1100px) */

.annotated {
  margin-top: 1.75rem;
}

.annotated-close {
  margin-top: 2.5rem;
}

.prose > p + p {
  margin-top: 1.1rem;
}

.margin-note {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 32ch;
}

@media (min-width: 1100px) {
  .annotated {
    display: grid;
    grid-template-columns: minmax(0, var(--measure)) minmax(11rem, 1fr);
    column-gap: clamp(2.5rem, 5vw, 5rem);
    align-items: start;
  }

  .annotated > .margin-note {
    grid-column: 2;
    grid-row: 1;
    padding-top: 0.35rem;
  }

  .annotated > :not(.margin-note) {
    grid-column: 1;
  }
}

@media (max-width: 1099.98px) {
  .margin-note {
    margin-top: 1rem;
    padding-left: 1.25rem;
  }
}

.prose {
  max-width: var(--measure);
}

/* ---------- Evidence blocks ---------- */

.evidence {
  background: var(--paper-tint);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  max-width: var(--measure);
}

.evidence-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--ink);
}

.evidence > figcaption:last-child,
.fig-caption {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* Video frame */

.video-frame {
  margin-top: 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--paper);
}

.video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1.5rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* Audio clips */

.clip-list {
  list-style: none;
  padding: 0;
  margin-top: 1.5rem;
}

.clip-list li + li {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.clip-list audio {
  display: block;
  width: 100%;
  height: 2.25rem;
}

.clip-caption {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.clip-no {
  color: var(--ink);
  font-weight: 500;
}

/* Future callable-demo line (used when the live number ships) */

.demo-callout {
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--redline);
}

/* Transcript */

.transcript {
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.7;
}

.transcript p + p {
  margin-top: 0.6rem;
}

.speaker {
  display: inline-block;
  min-width: 7ch;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.stage {
  color: var(--ink-soft);
  font-style: italic;
}

/* Spec table */

.spec-table {
  margin-top: 1.25rem;
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.spec-table th,
.spec-table td {
  text-align: left;
  padding: 0.6rem 1rem 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  font-weight: 400;
  vertical-align: baseline;
}

.spec-table tr:last-child th,
.spec-table tr:last-child td {
  border-bottom: 0;
}

.spec-table td:last-child {
  padding-right: 0;
  white-space: nowrap;
}

.spec-mark {
  color: var(--redline);
  font-weight: 500;
}

/* Payload */

.payload {
  margin-top: 1.25rem;
  overflow-x: auto;
}

.payload pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink);
}

.payload .redval {
  color: var(--redline);
  font-weight: 500;
}

/* ---------- Figures / schematics ---------- */

.figure {
  max-width: var(--measure);
}

.schematic {
  border: 0;
}

.schematic svg {
  display: block;
  width: 100%;
}

.schematic .fig-wide {
  display: block;
}

.schematic .fig-tall {
  display: none;
}

@media (max-width: 719.98px) {
  .schematic .fig-wide {
    display: none;
  }

  .schematic .fig-tall {
    display: block;
    max-width: 22rem;
  }
}

/* SVG text/stroke conventions */

.schematic text {
  font-family: var(--font-mono);
  fill: var(--ink);
}

.schematic .lbl-soft {
  fill: var(--ink-soft);
}

.schematic .lbl-red {
  fill: var(--redline);
  font-weight: 500;
}

.schematic .node {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.25;
}

.schematic .wire {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.25;
}

.schematic .wire-dashed {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.25;
  stroke-dasharray: 4 4;
}

.schematic .live {
  fill: none;
  stroke: var(--redline);
  stroke-width: 1.5;
}

.schematic .live-fill {
  fill: var(--redline);
  stroke: none;
}

.schematic .mark {
  fill: none;
  stroke: var(--redline);
  stroke-width: 1.25;
}

/* ---------- 02 · Capabilities ---------- */

.cap-grid {
  margin-top: 2.5rem;
  max-width: 56rem;
}

.cap {
  padding-block: 1.75rem;
  border-top: 1px solid var(--rule);
}

.cap h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.25;
}

.cap p {
  margin-top: 0.6rem;
}

@media (min-width: 768px) {
  .cap-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: clamp(2.5rem, 5vw, 5rem);
  }
}

/* ---------- 03 · Case study ---------- */

.case-sub {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.25;
  margin-top: 2.5rem;
}

.pullquote {
  margin-block: 2.5rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--ink);
  max-width: var(--measure);
}

.design-notes p + p {
  margin-top: 1.1rem;
}

.design-notes b {
  font-weight: 600;
}

/* ---------- 04 · Method ---------- */

.method-list {
  list-style: none;
  padding: 0;
  margin-top: 2.5rem;
  max-width: var(--measure);
}

.method-list li {
  padding-block: 1.5rem;
  border-top: 1px solid var(--rule);
}

.method-no {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--redline);
  margin-right: 1rem;
}

.method-list b {
  font-weight: 600;
}

/* ---------- 05 · Studio ---------- */

.studio-grid {
  margin-top: 2.5rem;
  display: grid;
  gap: 2.5rem clamp(2.5rem, 5vw, 5rem);
}

@media (min-width: 768px) {
  .studio-grid {
    grid-template-columns: 1fr 1fr;
    max-width: 56rem;
  }
}

.person h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.6rem;
}

.person-role {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 0.25rem;
}

.person p {
  margin-top: 0.85rem;
}

.person-links {
  margin-top: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* ---------- 06 · Contact ---------- */

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.25rem;
}

.contact-detail {
  margin-top: 2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* ---------- Colophon ---------- */

.colophon {
  border-top: 1px solid var(--ink);
  padding-block: 2.5rem 3.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 2;
  color: var(--ink-soft);
}

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

.colophon-nav {
  display: inline;
}

/* ---------- Motion ---------- */
/* All motion is progressive enhancement: html.js is set by main.js.
   Without JS everything is static and visible. */

html.js .reveal {
  opacity: 0;
  transform: translateY(12px);
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 350ms ease-out, transform 350ms ease-out;
}

html.js .schematic .live,
html.js .schematic .mark {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

html.js .schematic .live-fill {
  opacity: 0;
}

html.js .schematic.is-drawn .live,
html.js .schematic.is-drawn .mark {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 600ms ease-out 100ms;
}

html.js .schematic.is-drawn .live-fill {
  opacity: 1;
  transition: opacity 200ms ease-out 650ms;
}

.stickybar {
  transition: transform 250ms ease-out, visibility 250ms;
}

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

  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html.js .schematic .live,
  html.js .schematic .mark {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    transition: none;
  }

  html.js .schematic .live-fill {
    opacity: 1;
    transition: none;
  }

  .stickybar {
    transition: none;
  }
}

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

@media (max-width: 479.98px) {
  .spec-table td:last-child {
    white-space: normal;
  }
}

@media (max-width: 767.98px) {
  :root {
    --section-pad: 3.5rem;
  }

  body {
    font-size: 1rem;
  }

  .hero h1 {
    font-size: clamp(2.3rem, 9vw, 2.8rem);
  }

  .section-title {
    font-size: clamp(1.55rem, 6vw, 1.8rem);
  }

  .pullquote {
    font-size: 1.3rem;
  }
}
