@import url('./tokens/doril.css');

/* ==========================================================================
   TOKENS
   Colours come only from tokens/doril.css. Text hierarchy uses opacity of
   near-black or white, never new hues. No gradients, glows or coloured shadows.
   ========================================================================== */
:root {
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* 8-point spacing */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;
  --space-12: 96px;
  --space-16: 128px;

  --header-h: 76px;
  --gutter: clamp(20px, 5vw, 64px);
  --section-pad: clamp(96px, 11vw, 160px);
  --content-max: 1200px;

  /* Text on light (paper / white) */
  --ink: var(--doril-near-black);
  --ink-2: rgba(11, 11, 13, 0.72);
  --rule-light: rgba(11, 11, 13, 0.14);

  /* Text on dark (near-black / graphite) */
  --on-dark: var(--doril-white);
  --on-dark-2: rgba(255, 255, 255, 0.72);
  --rule-dark: rgba(255, 255, 255, 0.14);

  /* Type scale (~1.25) */
  --fs-body: 1.0625rem;
  --fs-small: 0.9375rem;
  --fs-h3: 1.375rem;
  --fs-h2: clamp(2rem, 3.4vw, 2.875rem);
  --fs-statement: clamp(1.75rem, 3.2vw, 2.75rem);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--doril-near-black);
  color: var(--on-dark);
  font-family: var(--font-sans);
}

body {
  min-height: 100vh;
  font-size: var(--fs-body);
  line-height: 1.6;
  background-color: var(--doril-near-black);
}

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

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

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

h1, h2, h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

:focus-visible {
  outline: 2px solid var(--doril-purple);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--doril-purple);
  color: var(--doril-white);
  font-weight: 600;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease;
  background-color: var(--doril-white);
  border-bottom: 1px solid var(--rule-light);
  color: var(--ink);
}

.site-header.is-dark {
  background-color: var(--doril-near-black);
  border-bottom-color: var(--rule-dark);
  color: var(--on-dark);
}

.header-inner {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
  position: relative;
  height: 44px;
  flex-shrink: 0;
}

.brand-wordmark {
  width: 104px;
  height: auto;
  object-fit: contain;
  transition: opacity 0.35s ease;
}

.brand-wordmark.wordmark-dark {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
}

.site-header.is-dark .brand-wordmark.wordmark-light {
  opacity: 0;
}

.site-header.is-dark .brand-wordmark.wordmark-dark {
  opacity: 1;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.6vw, 40px);
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 12px 2px;
  opacity: 0.72;
  transition: opacity 0.2s ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  opacity: 1;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 4px;
  height: 2px;
  background: var(--doril-purple);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ==========================================================================
   BUTTONS & LINKS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  border: 1.5px solid transparent;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Main action: the one purple button on a screen */
.btn-primary {
  background-color: var(--doril-purple);
  color: var(--doril-white);
}

.btn-primary:hover {
  background-color: var(--doril-near-black);
}

.theme-dark .btn-primary:hover,
.bg-dark .btn-primary:hover,
.bg-graphite .btn-primary:hover,
.on-dark .btn-primary:hover,
.site-header.is-dark .btn-primary:hover {
  background-color: var(--doril-white);
  color: var(--doril-near-black);
}

/* Equal-weight choice buttons: near-black on light, white on dark */
.btn-choice {
  background-color: var(--choice-bg, var(--doril-near-black));
  color: var(--choice-fg, var(--doril-white));
}

.btn-choice:hover {
  background-color: var(--doril-purple);
  color: var(--doril-white);
}

.btn-rect {
  border-radius: 12px;
  min-height: 54px;
  padding: 0 28px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
}

.text-link:hover {
  text-decoration-color: var(--doril-purple);
}

.mobile-menu-btn {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid currentColor;
  background: transparent;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ==========================================================================
   HOMEPAGE SCROLL STORY
   Hero -> sketch merge -> CAD assembly in a viewport -> finished car
   ========================================================================== */
.scrolly-track {
  position: relative;
  width: 100%;
  height: 380vh;
}

.scrolly-sticky-viewport {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background-color: var(--doril-white);
}

/* Dark circle that grows from the center to take the page from white to black */
.dark-wipe {
  position: absolute;
  inset: 0;
  z-index: 3;
  background-color: var(--doril-near-black);
  clip-path: circle(0% at 50% 50%);
  pointer-events: none;
  will-change: clip-path;
}

/* Hero sketches */
.sketch-stage {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  max-width: 1680px;
  margin: 0 auto;
}

.sketch-layer {
  position: absolute;
  height: auto;
  will-change: transform, opacity, filter;
  transform-origin: center center;
  user-select: none;
  pointer-events: none;
}

/* Two sketches on the left, three of different sizes on the right */
.sketch-iso-car {
  top: 15%;
  left: 2%;
  width: clamp(240px, 25vw, 430px);
}

.sketch-side-view {
  top: 70%;
  left: 4%;
  width: clamp(220px, 22vw, 380px);
}

.sketch-suspension {
  top: 12%;
  right: 6%;
  width: clamp(130px, 12vw, 210px);
}

.sketch-upright {
  top: 40%;
  right: 15%;
  width: clamp(70px, 6.5vw, 112px);
}

.sketch-steering {
  top: 67%;
  right: 3%;
  width: clamp(160px, 14vw, 235px);
}

/* Slight hand-placed tilts on the right (desktop only) */
@media (min-width: 821px) {
  .sketch-suspension { rotate: -9deg; }
  .sketch-upright { rotate: 7deg; }
  .sketch-steering { rotate: 11deg; }
}

/* Hero copy */
.hero-editorial-center {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--header-h) + 24px) 24px 32px;
  will-change: transform, opacity;
}

.hero-copy-box {
  max-width: 640px;
  padding: 32px;
}

.eyebrow-mono {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--ink-2);
  margin-bottom: var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 4.5rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin-bottom: var(--space-4);
}

.accent-purple {
  color: var(--doril-purple);
}

.hero-subheadline {
  font-size: clamp(1.08rem, 1.3vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 44ch;
  margin: 0 auto var(--space-6);
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
}

.hero-cta-group .btn {
  min-width: 232px;
}

.scroll-explore-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ink);
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px 16px;
}

.scroll-explore-arrow {
  font-size: 1.4rem;
  line-height: 1;
  animation: floatArrow 2.2s ease-in-out infinite;
}

.scroll-explore-label {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
}

@keyframes floatArrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* Story stage: viewport panel on the left, words on the right */
.story-stage {
  position: absolute;
  inset: 0;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(40px, 5vw, 80px);
  max-width: 1440px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 24px) var(--gutter) 32px;
  will-change: opacity;
}

.story-stage.is-interactive {
  pointer-events: auto;
}

.story-media {
  min-width: 0;
}

.viewport-panel {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--rule-dark);
  border-radius: 16px;
  overflow: hidden;
  background-color: var(--doril-graphite);
}

#cad-scrub-canvas,
.final-car-img,
.final-car-cutout {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.final-car-img {
  opacity: 0;
}

.final-car-img.is-static {
  opacity: 1;
}

.media-note {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--doril-support-gray);
}

.story-copy {
  position: relative;
  min-height: 300px;
  color: var(--on-dark);
}

.story-step {
  position: absolute;
  inset: 0 0 auto 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
}

.story-step.is-active {
  opacity: 1;
  visibility: visible;
}

.story-count {
  display: block;
  font-size: var(--fs-small);
  color: var(--doril-support-gray);
  margin-bottom: 16px;
}

.story-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2.6vw, 2.5rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
}

.story-text {
  font-size: 1.0625rem;
  color: var(--on-dark-2);
  max-width: 40ch;
}

.story-dots {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  gap: 8px;
  width: 160px;
}

.step-bar-btn {
  flex: 1;
  height: 44px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  position: relative;
}

.step-bar-btn::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  transform: translateY(-50%);
  background-color: var(--rule-dark);
}

.step-bar-btn.is-active::before,
.step-bar-btn.is-complete::before {
  background-color: var(--doril-white);
}

.story-media {
  transform-origin: center center;
  will-change: transform;
}

/* The T: white half for businesses, black half for teams */
.t-choices {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 60%;
  z-index: 7;
  display: grid;
  grid-template-columns: 1fr 1fr;
  transform: translateY(100%);
  pointer-events: none;
  will-change: transform;
}

.t-choices.is-interactive {
  pointer-events: auto;
}

.t-half {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
  padding: 32px clamp(24px, 5vw, 80px);
  min-width: 0;
}

.t-business {
  background-color: var(--doril-white);
  color: var(--ink);
}

.t-backdrop {
  position: absolute;
  inset: 0;
  z-index: 5;
  background-color: var(--doril-graphite);
  opacity: 0;
  pointer-events: none;
}

.t-team {
  background-color: var(--doril-near-black);
  color: var(--on-dark);
  --btn-bg: var(--doril-white);
}

.t-label {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--ink-2);
}

.t-team .t-label {
  color: var(--doril-support-gray);
}

.t-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.t-text {
  max-width: 40ch;
  color: var(--ink-2);
  margin-bottom: 8px;
}

.t-team .t-text {
  color: var(--on-dark-2);
}

.t-team .btn-choice {
  background-color: var(--doril-white);
  color: var(--doril-near-black);
}

.t-half:hover .btn-choice,
.t-half:focus-visible .btn-choice {
  background-color: var(--doril-purple);
  color: var(--doril-white);
}

/* ==========================================================================
   THEMES
   Light = businesses (and neutral content). Dark = engineering teams.
   Every section declares one; components read these variables, so a light
   section can never pick up dark styling or the reverse.
   ========================================================================== */
.theme-light,
.bg-white,
.bg-paper {
  --fg: var(--doril-near-black);
  --fg-2: rgba(11, 11, 13, 0.72);
  --rule: rgba(11, 11, 13, 0.14);
  --num: rgba(11, 11, 13, 0.72);
  --field-bg: var(--doril-white);
  --field-border: rgba(11, 11, 13, 0.32);
  --placeholder: rgba(11, 11, 13, 0.6);
  --choice-bg: var(--doril-near-black);
  --choice-fg: var(--doril-white);
  color: var(--fg);
}

.theme-dark,
.bg-dark,
.bg-graphite,
.on-dark {
  --fg: var(--doril-white);
  --fg-2: rgba(255, 255, 255, 0.72);
  --rule: rgba(255, 255, 255, 0.14);
  --num: var(--doril-support-gray);
  --field-bg: var(--doril-graphite);
  --field-border: rgba(255, 255, 255, 0.28);
  --placeholder: rgba(255, 255, 255, 0.55);
  --choice-bg: var(--doril-white);
  --choice-fg: var(--doril-near-black);
  color: var(--fg);
}

.bg-white { background-color: var(--doril-white); }
.bg-paper { background-color: var(--doril-paper); }
.bg-dark { background-color: var(--doril-near-black); }
.bg-graphite { background-color: var(--doril-graphite); }

/* ==========================================================================
   CONTENT SECTIONS
   ========================================================================== */
.section {
  padding: var(--section-pad) var(--gutter);
}

/* A section that owns the whole screen, so nothing else competes with it */
.section-full {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section-full > .container {
  width: 100%;
}

.container {
  max-width: var(--content-max);
  margin: 0 auto;
}

/* 12-column grid */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--space-3);
}

.label {
  display: block;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--num);
  margin-bottom: 20px;
}

.h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.h3 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.lead {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--fg-2);
}

.body-2 {
  color: var(--fg-2);
}

/* Big statement paragraph */
.statement {
  grid-column: 1 / span 10;
  text-wrap: balance;
  font-family: var(--font-display);
  font-size: var(--fs-statement);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.statement-aside {
  grid-column: 7 / span 6;
  margin-top: var(--space-8);
}

/* Heading on the left, content on the right */
.split-head {
  grid-column: 1 / span 4;
}

.split-body {
  grid-column: 6 / span 7;
}

/* Numbered rows separated by hairlines */
.rows {
  list-style: none;
  border-top: 1px solid var(--rule);
}

.row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: var(--space-3);
  padding: 32px 0 36px;
  border-bottom: 1px solid var(--rule);
}

.row-num {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 500;
  line-height: 1.25;
  color: var(--num);
  font-variant-numeric: tabular-nums;
}

.row .h3 {
  margin-bottom: 8px;
}

/* Plain list with hairlines */
.plain-list {
  list-style: none;
  border-top: 1px solid var(--rule);
}

.plain-list li {
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

/* Horizontal process (5 steps) */
.process {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-8);
}

.process li {
  padding-top: 24px;
  border-top: 2px solid var(--rule);
}

.process li:first-child {
  border-top-color: var(--doril-purple);
}

.process .row-num {
  display: block;
  margin-bottom: 20px;
}

.process .h3 {
  margin-bottom: 10px;
}

.process p {
  font-size: var(--fs-small);
  color: var(--fg-2);
}

/* 2 x 2 commitments */
.pairs {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-8);
  margin-top: var(--space-8);
  border-top: 1px solid var(--rule);
}

.pairs li {
  padding: 32px 0 36px;
  border-bottom: 1px solid var(--rule);
}

.pairs .h3 {
  margin-bottom: 10px;
}

/* Page heroes (businesses / teams) fill the first screen */
.page-hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 48px) var(--gutter) 64px;
}

.page-hero-grid {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(48px, 6vw, 96px);
  align-items: center;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.2vw, 3.5rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.035em;
  margin-bottom: var(--space-4);
}

.page-hero .lead {
  max-width: 46ch;
  margin-bottom: var(--space-6);
}

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

.page-hero .btn-row {
  gap: var(--space-4);
}

.theme-light .viewport-panel,
.bg-white .viewport-panel {
  border-color: rgba(11, 11, 13, 0.14);
}

.theme-light .media-note,
.bg-white .media-note,
.bg-paper .media-note {
  color: rgba(11, 11, 13, 0.72);
}

.hero-sketch img {
  width: 100%;
  height: auto;
}

/* FAQ (native details) */
.faq {
  border-top: 1px solid var(--rule);
}

.faq-item {
  border-bottom: 1px solid var(--rule);
}

.faq-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 44px;
  padding: 24px 0;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
}

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

.faq-item summary::after {
  content: '+';
  flex-shrink: 0;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding-bottom: 28px;
  max-width: 60ch;
  color: var(--fg-2);
}

/* Small utilities */
.mt-3 {
  margin-top: var(--space-3);
}

.mb-5 {
  margin-bottom: 40px;
}

.measure-short {
  max-width: 18ch;
}

/* ==========================================================================
   FORMS
   ========================================================================== */
.form-wrap {
  grid-column: 6 / span 7;
}

.role-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--fg);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: var(--space-6);
}

.role-tab-btn {
  min-height: 52px;
  border: none;
  background: transparent;
  color: var(--fg);
  font-weight: 600;
  font-size: 0.9875rem;
  cursor: pointer;
  padding: 0 12px;
}

.role-tab-btn + .role-tab-btn {
  border-left: 1px solid var(--fg);
}

.role-tab-btn[aria-pressed="true"] {
  background-color: var(--fg);
  color: var(--choice-fg);
}

.theme-dark .role-tab-btn[aria-pressed="true"] {
  color: var(--doril-near-black);
}

.form-fields {
  border: none;
  min-width: 0;
}

.form-fields[disabled] {
  display: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: var(--fs-small);
  font-weight: 600;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.form-label .optional {
  font-weight: 400;
  color: var(--fg-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 10px;
  background-color: var(--field-bg);
  border: 1px solid var(--field-border);
  color: var(--fg);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-select option {
  background-color: var(--field-bg);
  color: var(--fg);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--placeholder);
}

.form-textarea {
  min-height: 128px;
  resize: vertical;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--doril-purple);
  outline: 2px solid var(--doril-purple);
  outline-offset: 0;
}

.checkbox-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  background-color: var(--field-bg);
  cursor: pointer;
  font-size: var(--fs-small);
  user-select: none;
}

.checkbox-pill:has(input:checked) {
  border-color: var(--doril-purple);
}

.checkbox-pill input {
  accent-color: var(--doril-purple);
  width: 18px;
  height: 18px;
}

.form-actions {
  margin-top: var(--space-6);
}

.form-footnote {
  margin-top: 16px;
  font-size: var(--fs-small);
  color: var(--fg-2);
}

.form-footnote a,
.form-status-box a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-status-box {
  display: none;
  padding: 24px 0 24px 20px;
  border-left: 3px solid var(--doril-purple);
}

.form-status-box.is-visible {
  display: block;
}

.form-status-box.is-error {
  border-left-color: var(--fg);
}

.form-status-box strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  margin-bottom: 6px;
}

.form-status-box p {
  color: var(--fg-2);
}

.form-card.is-done form,
.form-card.is-done .role-switcher {
  display: none;
}

/* Footer logo follows the footer's mode */
.bg-paper .footer-logo-dark,
.bg-white .footer-logo-dark,
.bg-dark .footer-logo-light,
.bg-graphite .footer-logo-light {
  display: none;
}

/* The homepage sign-up switches mode with the role you pick */
#join {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==========================================================================
   LEGAL / SIMPLE TEXT PAGES
   ========================================================================== */
.prose-page {
  padding: calc(var(--header-h) + clamp(56px, 7vw, 104px)) var(--gutter) var(--section-pad);
}

.prose {
  max-width: 720px;
  margin: 0 auto;
}

.prose h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 12px;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 600;
  margin: 48px 0 12px;
}

.prose p,
.prose li {
  color: var(--on-dark-2);
  line-height: 1.7;
}

.prose p + p {
  margin-top: 14px;
}

.prose ul {
  margin: 12px 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prose a {
  color: var(--on-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose .meta,
.prose .label {
  color: var(--doril-support-gray);
}

/* ==========================================================================
   FOOTER (follows the page's mode)
   ========================================================================== */
.site-footer {
  padding: var(--space-8) var(--gutter) var(--space-6);
  border-top: 1px solid var(--rule);
  color: var(--fg-2);
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-6);
}

.footer-brand img {
  width: 104px;
  height: auto;
  object-fit: contain;
  margin-bottom: 16px;
}

.footer-cols {
  display: flex;
  gap: clamp(40px, 6vw, 96px);
  flex-wrap: wrap;
}

.footer-col h2 {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 12px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.footer-col a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

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

.footer-bottom {
  max-width: var(--content-max);
  margin: var(--space-6) auto 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--rule);
  font-size: var(--fs-small);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1200px) {
  .sketch-suspension {
    right: 4%;
  }

  .sketch-upright {
    right: 8%;
  }

  .sketch-iso-car,
  .sketch-side-view,
  .sketch-suspension,
  .sketch-upright,
  .sketch-steering {
    opacity: 0.4;
  }
}

@media (max-width: 1024px) {
  .split-head,
  .split-body,
  .statement,
  .statement-aside,
  .form-wrap {
    grid-column: 1 / -1;
  }

  .split-head {
    margin-bottom: var(--space-6);
  }

  .statement-aside {
    margin-top: var(--space-6);
  }

  .process {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: var(--space-6);
  }

  .page-hero-grid {
    grid-template-columns: 1fr;
  }

  .story-stage {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 40px;
  }
}

/* Short laptop screens */
@media (min-width: 821px) and (max-height: 820px) {
  .hero-cta-group {
    margin-bottom: var(--space-4);
  }

  .story-title {
    font-size: clamp(1.6rem, 2.3vw, 2.1rem);
  }
}

@media (max-width: 820px) {
  :root {
    --header-h: 68px;
  }

  body {
    font-size: 1rem;
  }

  .main-nav {
    display: none;
  }

  .main-nav.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background-color: var(--doril-near-black);
    color: var(--on-dark);
    padding: var(--space-2) var(--gutter) var(--space-4);
    border-bottom: 1px solid var(--rule-dark);
    align-items: flex-start;
  }

  .main-nav.is-open .nav-link {
    font-size: 1.0625rem;
    opacity: 1;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .header-actions .btn {
    min-height: 44px;
    padding: 0 16px;
    font-size: 0.875rem;
  }

  .brand-wordmark {
    width: 88px;
  }

  /* Hero: two faint sketches only */
  .sketch-side-view,
  .sketch-suspension,
  .sketch-upright {
    display: none;
  }

  .sketch-iso-car {
    top: 9%;
    left: 50%;
    width: min(80vw, 320px);
    margin-left: min(-40vw, -160px);
    opacity: 0.18;
  }

  .sketch-steering {
    top: auto;
    bottom: 1%;
    right: auto;
    left: 50%;
    width: 150px;
    margin-left: -75px;
    opacity: 0.18;
  }

  .hero-copy-box {
    padding: 16px 4px;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    margin-bottom: var(--space-4);
  }

  .hero-cta-group .btn {
    width: 100%;
    min-width: 0;
  }

  /* Story: car on top, words underneath */
  .story-stage {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 24px;
    padding: var(--header-h) 0 24px;
  }

  .story-stage .viewport-panel {
    aspect-ratio: auto;
    height: 44svh;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--rule-dark);
  }

  .media-note {
    margin: 8px 20px 0;
    font-size: 0.875rem;
  }

  .story-copy {
    margin: 0 20px;
    min-height: 260px;
  }

  .story-title {
    font-size: 1.6rem;
  }

  .story-text {
    font-size: 1rem;
  }


  .t-half {
    justify-content: flex-start;
    padding: 40px 16px 24px;
    gap: 8px;
  }

  .t-title {
    font-size: 1.25rem;
  }

  .t-text {
    display: none;
  }

  .t-half .btn-rect {
    min-height: 48px;
    padding: 0 14px;
    font-size: 0.875rem;
    white-space: normal;
    text-align: left;
  }

  .row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: var(--space-2);
  }

  .pairs,
  .process,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .role-tab-btn {
    font-size: 0.875rem;
  }

  .page-hero .btn-row {
    gap: var(--space-2);
  }

  .page-hero {
    align-items: flex-start;
    padding-top: calc(var(--header-h) + 40px);
  }
}

/* ==========================================================================
   REDUCED MOTION: the story becomes a simple static page
   ========================================================================== */
.reduced-motion .scrolly-track {
  height: auto;
}

.reduced-motion .scrolly-sticky-viewport {
  position: relative;
  height: auto;
  overflow: visible;
  background-color: var(--doril-near-black);
}

.reduced-motion .hero-editorial-center {
  height: auto;
  min-height: 100svh;
  background-color: var(--doril-white);
}

.reduced-motion .sketch-stage {
  bottom: auto;
  height: 100svh;
}

.reduced-motion .scroll-explore-cue,
.reduced-motion .story-dots,
.reduced-motion #cad-scrub-canvas {
  display: none;
}

.reduced-motion .story-stage {
  position: relative;
  inset: auto;
  opacity: 1;
  pointer-events: auto;
  padding-top: var(--section-pad);
  padding-bottom: var(--section-pad);
}

.reduced-motion .final-car-img {
  opacity: 1;
}

.reduced-motion .story-step,
.reduced-motion .story-copy {
  display: none;
}

.reduced-motion .story-stage {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1000px;
}

.reduced-motion .t-choices {
  position: relative;
  inset: auto;
  transform: none;
  pointer-events: auto;
  min-height: 420px;
}

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

  .scroll-explore-arrow {
    animation: none;
  }
}

/* ==========================================================================
   DRAWING SYSTEM
   Purple is the engineer's markup colour: dimension lines, review gates and
   checks. Text is never purple (it fails contrast); lines and marks only.
   ========================================================================== */
.bg-white { --surface: var(--doril-white); }
.bg-paper { --surface: var(--doril-paper); }
.bg-dark { --surface: var(--doril-near-black); }
.bg-graphite { --surface: var(--doril-graphite); }

.mono {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--fg-2);
}

.view-ref {
  font-family: var(--font-mono);
  font-weight: 500;
  margin-right: 10px;
  padding-right: 10px;
  border-right: 1px solid var(--rule);
}

.view-head {
  max-width: 760px;
  margin-bottom: clamp(48px, 6vw, 80px);
}

.view-head.split-head {
  margin-bottom: 0;
}

.view-head .lead {
  margin-top: 24px;
}

/* Dimension line: |<-------->| in purple */
.dim {
  position: relative;
  display: block;
  color: var(--doril-purple);
  pointer-events: none;
}

.dim-rule {
  position: absolute;
  inset: 0;
  border-left: 1px solid currentColor;
  border-right: 1px solid currentColor;
}

.dim-rule::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid currentColor;
  transform-origin: left center;
  transition: transform 0.9s cubic-bezier(0.65, 0, 0.35, 1) var(--d, 0s);
}

.dim-under {
  height: 14px;
  width: min(100%, 320px);
  margin-top: 20px;
}

.dim-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0 8px;
  background-color: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--fg);
}

/* Hero sketch with d1 / d2 dimensions */
.hero-sketch-frame {
  position: relative;
  padding: 0 40px 40px 0;
}

.hero-sketch img {
  width: 100%;
  height: auto;
}

.dim-h {
  position: absolute;
  left: 4%;
  right: 46px;
  bottom: 8px;
  height: 14px;
}

.dim-v {
  position: absolute;
  top: 8%;
  bottom: 46px;
  right: 8px;
  width: 14px;
}

.dim-v .dim-rule {
  border-left: none;
  border-right: none;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}

.dim-v .dim-rule::before {
  left: 50%;
  right: auto;
  top: 0;
  bottom: 0;
  border-top: none;
  border-left: 1px solid currentColor;
  transform-origin: center top;
}

.dim-v .dim-text {
  padding: 6px 0;
}

/* SVG diagrams */
.dg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.dg * {
  vector-effect: non-scaling-stroke;
}

.dg .ink,
.dg .ink polyline,
.dg .ink line {
  fill: none;
  stroke: var(--fg);
  stroke-width: 1.5;
}

.dg .ink-faint line {
  fill: none;
  stroke: var(--fg-2);
  stroke-width: 1;
}

.dg .mark,
.dg .mark line,
.dg .mark polyline {
  fill: none;
  stroke: var(--doril-purple);
  stroke-width: 1.5;
}

.dg .mark .check {
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dg .node {
  fill: var(--surface);
  stroke: var(--fg);
  stroke-width: 1.5;
}

.dg .node-gate {
  stroke: var(--doril-purple);
  stroke-width: 2;
}

.dg .tag-bg {
  fill: var(--surface);
  stroke: none;
}

.dg text {
  fill: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 600;
  stroke: none;
}

.dg .t-mono,
.dg .t-dim {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  fill: var(--fg-2);
}

.dg .t-dim {
  fill: var(--fg);
  font-size: 15px;
}

.dg .t-note {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  fill: var(--fg-2);
}

/* View A: comparison */
.compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.compare-panel {
  padding: 40px clamp(16px, 4vw, 56px) 48px;
  min-width: 0;
}

.compare-panel + .compare-panel {
  border-left: 1px solid var(--rule);
}

.compare-panel .dg {
  max-width: 460px;
  margin: 24px auto 32px;
}

.compare-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 600;
}

.tree {
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  border-left: 1px solid var(--rule);
  margin-left: 6px;
}

.tree li {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0 7px 26px;
}

.tree li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 14px;
  border-top: 1px solid var(--rule);
}

.tree li span {
  color: var(--fg-2);
}

.tree-bad li {
  color: var(--fg-2);
}

.tree-good li::after {
  content: '';
  position: absolute;
  left: -5px;
  top: 50%;
  width: 9px;
  height: 9px;
  transform: translateY(-50%);
  background-color: var(--doril-purple);
  border-radius: 50%;
}

.compare + .media-note {
  margin-top: 16px;
}

/* View B: the season loop */
.loop {
  position: relative;
  max-width: 560px;
}

.loop-svg {
  aspect-ratio: 4 / 3;
}

.loop-input {
  position: absolute;
  left: 30.5%;
  top: 0.5%;
  font-size: var(--fs-small);
  font-weight: 600;
}

.loop-nodes {
  list-style: none;
  position: absolute;
  left: 12.5%;
  right: 12.5%;
  top: 20%;
  bottom: 13.3%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  padding: 6% 7%;
  gap: 4%;
}

.loop-nodes li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
}

.loop-nodes li:nth-child(2),
.loop-nodes li:nth-child(3) {
  text-align: right;
  align-items: flex-end;
}

.loop-nodes li:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
  justify-content: flex-end;
}

.loop-nodes li:nth-child(4) {
  grid-column: 1;
  grid-row: 2;
  justify-content: flex-end;
}

.loop-nodes strong {
  font-family: var(--font-display);
  font-size: 1.125rem;
}

.loop-nodes li > span:last-child {
  font-size: var(--fs-small);
  color: var(--fg-2);
}

.loop-note {
  margin-top: 32px;
  max-width: 52ch;
  color: var(--fg-2);
}

/* View C: flowchart */
.flow-tall {
  display: none;
}

.flow-notes {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 32px;
  font-size: var(--fs-small);
  color: var(--fg-2);
}

.flow-notes li {
  padding: 0 calc(30 / 240 * 100%);
}

.flow-notes .mono {
  display: block;
  margin-bottom: 6px;
}

/* View D: gate */
.gate {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr) 40px minmax(0, 1fr);
  align-items: stretch;
}

.gate-step {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: 10px;
}

.gate-first {
  border: 2px solid var(--doril-purple);
}

.gate-step strong {
  font-family: var(--font-display);
  font-size: 1.125rem;
  line-height: 1.25;
}

.gate-step > span:last-child {
  font-size: var(--fs-small);
  color: var(--fg-2);
}

.gate-link {
  position: relative;
}

.gate-link::before {
  content: '';
  position: absolute;
  left: 4px;
  right: 6px;
  top: 50%;
  border-top: 1.5px solid var(--fg);
}

.gate-link::after {
  content: '';
  position: absolute;
  right: 5px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-top: 1.5px solid var(--fg);
  border-right: 1.5px solid var(--fg);
  transform: translateY(-50%) rotate(45deg);
}

/* Title-block footer */
.title-block {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--rule);
  padding-top: 0;
}

.title-block div {
  padding: 12px 16px;
  border-left: 1px solid var(--rule);
}

.title-block div:first-child {
  border-left: none;
}

.title-block dt {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-2);
}

.title-block dd {
  font-weight: 600;
  color: var(--fg);
}

/* Draw-in on scroll (only when JS runs and motion is allowed) */
.js [data-draw] .ln {
  stroke-dasharray: 2;
  stroke-dashoffset: 2;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.65, 0, 0.35, 1) var(--d, 0s);
}

.js [data-draw] .fade {
  opacity: 0;
  transition: opacity 0.45s ease var(--d, 0s);
}

.js [data-draw] .dim-rule::before {
  transform: scale(0);
}

.js [data-draw].is-drawn .ln {
  stroke-dashoffset: 0;
}

.js [data-draw].is-drawn .fade {
  opacity: 1;
}

.js [data-draw].is-drawn .dim-rule::before {
  transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .js [data-draw] .ln,
  .js [data-draw] .fade,
  .js [data-draw] .dim-rule::before {
    transition: none;
  }
}

@media (max-width: 820px) {
  .compare {
    grid-template-columns: 1fr;
  }

  .compare-panel {
    padding: 32px 0 40px;
  }

  .compare-panel + .compare-panel {
    border-left: none;
    border-top: 1px solid var(--rule);
  }

  .loop {
    margin-top: 48px;
  }

  .loop-nodes strong {
    font-size: 1rem;
  }

  .loop-nodes li > span:last-child {
    font-size: 0.8125rem;
  }

  .loop-input {
    font-size: 0.8125rem;
  }

  .flow-wide {
    display: none;
  }

  .flow-tall {
    display: block;
    max-width: 380px;
    margin: 0 auto;
  }

  .flow-notes {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 40px;
  }

  .flow-notes li {
    padding: 0;
    display: grid;
    grid-template-columns: 44px 1fr;
  }

  .gate {
    grid-template-columns: 1fr;
    grid-template-rows: auto 32px auto 32px auto;
  }

  .gate-link::before {
    left: 50%;
    right: auto;
    top: 4px;
    bottom: 6px;
    border-top: none;
    border-left: 1.5px solid var(--fg);
  }

  .gate-link::after {
    left: 50%;
    right: auto;
    top: auto;
    bottom: 6px;
    transform: translateX(-50%) rotate(135deg);
  }

  .title-block {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .title-block div {
    border-left: none;
    border-top: 1px solid var(--rule);
  }

  .title-block div:nth-child(even) {
    border-left: 1px solid var(--rule);
  }

  .title-block div:nth-child(-n+2) {
    border-top: none;
  }

  .hero-sketch-frame {
    padding: 0 32px 32px 0;
  }
}

/* Season loop on phones: a vertical cycle instead of the cramped ring */
@media (max-width: 820px) {
  .loop-svg {
    display: none;
  }

  .loop-input {
    position: static;
    display: block;
    padding-left: 22px;
    margin-bottom: 8px;
    border-left: 2px solid var(--doril-purple);
  }

  .loop-nodes {
    position: static;
    display: block;
    padding: 0;
    border-left: 1.5px solid var(--fg);
    margin-left: 0;
  }

  .loop-nodes li,
  .loop-nodes li:nth-child(2),
  .loop-nodes li:nth-child(3) {
    position: relative;
    text-align: left;
    align-items: flex-start;
    padding: 14px 0 14px 22px;
  }

  .loop-nodes li::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 22px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--fg);
  }

  .loop-nodes strong {
    font-size: 1.125rem;
  }

  .loop-nodes li > span:last-child {
    font-size: var(--fs-small);
  }

  .loop::after {
    content: '\21BB  Repeats every season';
    display: block;
    padding: 10px 0 0 22px;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--fg-2);
  }
}

/* Teams page drawing pieces */
.sketch-on-dark {
  width: 100%;
  height: auto;
  filter: invert(1) hue-rotate(180deg);
  opacity: 0.85;
}

.private-box {
  position: relative;
  max-width: 460px;
  margin: 24px auto 32px;
  padding: 16px;
}

.private-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.dg .mark-dash {
  fill: none;
  stroke: var(--doril-purple);
  stroke-width: 1.5;
}

.dg .mark-dash {
  stroke-dasharray: 8 6;
}

.spec-list {
  list-style: none;
  border-top: 1px solid var(--rule);
}

.spec-list li {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: var(--space-3);
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
}

.spec-list .mono {
  padding-top: 3px;
}

.spec-list p {
  color: var(--fg-2);
}

.hero-sketch-frame .viewport-panel + .dim-h {
  left: 0;
}

.theme-dark .dim-text,
.bg-dark .dim-text,
.bg-graphite .dim-text {
  color: var(--fg);
}

@media (max-width: 820px) {
  .spec-list li {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

.flow-notes.notes-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

.flow-notes.notes-3 li {
  padding: 0;
  border-top: 1px solid var(--rule);
  padding-top: 20px;
}

.flow-notes.notes-3 .mono {
  margin-bottom: 10px;
}

@media (max-width: 820px) {
  .flow-notes.notes-3 {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .flow-notes.notes-3 li {
    display: block;
  }
}

/* Homepage T: the panel's studio backdrop falls away, leaving the car */
.final-car-cutout {
  opacity: 0;
  pointer-events: none;
}

.story-stage .viewport-panel {
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.story-stage .viewport-panel.is-lifted {
  background-color: transparent;
  border-color: transparent;
}

.reduced-motion .final-car-img {
  opacity: 0;
}

.reduced-motion .final-car-cutout {
  opacity: 1;
}

.reduced-motion .viewport-panel {
  background-color: transparent;
  border-color: transparent;
}

@media (max-width: 820px) {
  .final-car-cutout {
    object-fit: contain;
  }
}

/* Kinds of work */
.work-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.work-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 32px 28px 36px;
  min-width: 0;
}

.work-item + .work-item {
  border-left: 1px solid var(--rule);
}

.work-item:first-child {
  padding-left: 0;
}

.work-item .work-icon {
  width: 64px;
  margin-bottom: 14px;
}

.work-note {
  margin-top: 20px;
  color: var(--fg-2);
  font-size: var(--fs-small);
}

/* Heading with a short purple underline that draws in */
.mark-under {
  position: relative;
  padding-bottom: 14px;
  margin-bottom: 12px;
}

.mark-under::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44px;
  height: 2px;
  background-color: var(--doril-purple);
  transform-origin: left center;
  transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1) var(--d, 0s);
}

.js [data-draw] .mark-under::after {
  transform: scaleX(0);
}

.js [data-draw].is-drawn .mark-under::after {
  transform: scaleX(1);
}

.flow-notes.notes-3 li {
  color: var(--fg-2);
}

.flow-notes.notes-3 .h3 {
  color: var(--fg);
}

@media (max-width: 1024px) {
}

@media (max-width: 820px) {
  .work-grid {
    grid-template-columns: 1fr;
  }

  .work-item,
  .work-item + .work-item {
    padding: 28px 0;
    border-left: none;
  }

  .work-item + .work-item {
    border-top: 1px solid var(--rule);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mark-under::after {
    transition: none;
  }
}

/* Season of proof: a straight chain, no loop */
.chain {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 36px;
}

.chain-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: 10px;
}

.chain-step + .chain-step::before {
  content: '';
  position: absolute;
  left: -32px;
  top: 50%;
  width: 26px;
  border-top: 1.5px solid var(--fg);
}

.chain-step + .chain-step::after {
  content: '';
  position: absolute;
  left: -14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-top: 1.5px solid var(--fg);
  border-right: 1.5px solid var(--fg);
  transform: translateY(-50%) rotate(45deg);
}

.chain-step strong {
  font-family: var(--font-display);
  font-size: 1.125rem;
}

.chain-step > span:last-child {
  font-size: var(--fs-small);
  color: var(--fg-2);
}

.chain-end {
  border: 2px solid var(--doril-purple);
}

@media (max-width: 1024px) {
  .chain {
    grid-template-columns: 1fr;
    gap: 28px;
    max-width: 420px;
  }

  .chain-step + .chain-step::before {
    left: 50%;
    top: -26px;
    width: 0;
    height: 20px;
    border-top: none;
    border-left: 1.5px solid var(--fg);
  }

  .chain-step + .chain-step::after {
    left: 50%;
    top: -8px;
    transform: translateX(-50%) rotate(135deg);
  }
}

.tree li span {
  text-align: right;
}

@media (max-width: 820px) {
  .tree li {
    flex-direction: column;
    gap: 2px;
  }

  .tree li span {
    text-align: left;
  }
}

/* DATA: the one word that always stands out. Large type only (contrast). */
.data-mark {
  color: var(--doril-purple);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 700;
}

/* Animation end: parts of the car become data */
.callouts {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.callout-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.callout-lines .ln {
  stroke-dasharray: 2;
  stroke-dashoffset: 2;
  transition: stroke-dashoffset 0.7s cubic-bezier(0.65, 0, 0.35, 1) var(--d, 0s);
}

.callouts.is-on .callout-lines .ln {
  stroke-dashoffset: 0;
}

.callout-dot {
  fill: var(--doril-purple);
  stroke: none;
}

.callout {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 10px;
  border-left: 2px solid var(--doril-purple);
  white-space: nowrap;
  color: var(--doril-white);
  font-size: 0.9375rem;
  line-height: 1.3;
}

.callout strong {
  font-family: var(--font-display);
}

.callout span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.72);
}

.t-caption {
  position: absolute;
  left: 4%;
  top: 6%;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.8vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--doril-white);
  opacity: 0;
  pointer-events: none;
}

/* What you receive: exploded record */
.record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px 40px;
  align-items: center;
}

.record-svg {
  max-width: 420px;
}

.dg .ink-node {
  fill: var(--surface);
  stroke: var(--fg);
  stroke-width: 1.5;
}

.dg .ink-faint line {
  stroke-dasharray: 4 4;
}

.js [data-draw] .ink-faint .ln {
  stroke-dasharray: 2;
}

.record-list {
  list-style: none;
  border-top: 1px solid var(--rule);
}

.record-list li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}

.record-list .mono {
  grid-row: span 2;
  padding-top: 4px;
}

.record-list .h3 {
  font-size: 1.125rem;
  margin-bottom: 4px;
}

.record-list p {
  color: var(--fg-2);
  font-size: var(--fs-small);
}

.record-list li:nth-child(3) .mono {
  color: var(--fg);
}

.record-note {
  grid-column: 1 / -1;
  margin-top: 0;
}

@media (max-width: 820px) {
  .callout-lines,
  .callout {
    display: none;
  }

  .t-caption {
    top: 4%;
    font-size: 1.25rem;
  }

  .record {
    grid-template-columns: 1fr;
  }

  .record-svg {
    max-width: 300px;
    margin: 0 auto;
  }
}

.reduced-motion .callouts,
.reduced-motion .t-caption {
  opacity: 1;
}

.reduced-motion .callouts .ln {
  stroke-dashoffset: 0;
  transition: none;
}

.callout-left {
  align-items: flex-end;
  text-align: right;
  padding-left: 0;
  padding-right: 10px;
  border-left: none;
  border-right: 2px solid var(--doril-purple);
}

/* Legal: consent boxes, helper text, footer note */
.consents {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: var(--space-4);
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  font-size: var(--fs-small);
  line-height: 1.5;
  cursor: pointer;
}

.consent input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--doril-purple);
}

.consent a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.consent .optional {
  color: var(--fg-2);
}

.form-actions {
  margin-top: var(--space-4);
}

.field-help {
  font-size: var(--fs-small);
  color: var(--fg-2);
}

.soon {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-2);
  letter-spacing: 0;
}

.footer-legal {
  max-width: var(--content-max);
  margin: var(--space-3) auto 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--fg-2);
}

.prose ul + p {
  margin-top: 14px;
}

/* What you receive, per kind of work (businesses page) */
.work-get {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--fg);
}

.work-get .mono {
  display: block;
  margin-bottom: 4px;
}

/* Review checklist */
.checklist {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--rule);
  max-width: 760px;
}

.checklist .tree {
  margin-top: 20px;
}

.work-note .text-link {
  margin-left: 4px;
}

/* The opening statement no longer fills a whole screen */
#what .statement-aside {
  margin-top: var(--space-6);
}
