/* Couture Robotics — brand tokens
   Paper, ink, thread. One family: Archivo, expanded for headlines, normal width for text. */
:root {
  color-scheme: light;
  --paper: #F5F5F2;
  --paper-deep: #ECECE7;
  --grid: #C9CDD6;
  --ink: #151B2E;
  --ink-soft: #4B5164;
  --denim: #2F4A8A;
  --thread: #C6362B;
  --thread-deep: #9F2A22;
  --topstitch: #E0533F; /* thread on dark backgrounds */
  --chalk: #FFFFFF;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;

  --measure: 62ch;
  --gutter: clamp(20px, 4vw, 56px);
  --section: clamp(80px, 10vw, 140px);
  --radius: 4px;
  --hair: color-mix(in srgb, var(--ink) 14%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1.1em; max-width: var(--measure); }
h1, h2, h3 { margin: 0; }

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

.wrap { width: min(1200px, 100% - 2 * var(--gutter)); margin-inline: auto; }

/* Headlines: Archivo, expanded and tight */
.display {
  font-family: var(--font);
  font-stretch: 115%;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.02;
  text-wrap: balance;
}
h1.display { font-size: clamp(42px, 6.2vw, 88px); line-height: 0.98; }
h2.display { font-size: clamp(30px, 3.8vw, 50px); }
h3 { font-size: 18px; font-weight: 600; line-height: 1.3; }

.lede { font-size: clamp(18px, 1.45vw, 20px); line-height: 1.55; }
.muted { color: var(--ink-soft); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: var(--radius);
  font: 500 15.5px/1 var(--font); letter-spacing: 0.005em; white-space: nowrap;
  text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: var(--thread); border-color: var(--thread); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--paper); }
.btn-thread { background: var(--thread); color: var(--chalk); border-color: var(--thread); }
.btn-thread:hover { background: var(--thread-deep); border-color: var(--thread-deep); }
.btn[disabled] { opacity: .6; cursor: default; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand svg { width: 32px; height: 32px; flex: none; }
.brand-name { font-stretch: 112%; font-weight: 600; font-size: 19px; letter-spacing: -0.02em; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; font-size: 15px; color: var(--ink-soft); }
.nav-links a:hover { color: var(--ink); }
.nav .btn { padding: 11px 16px; font-size: 14.5px; }
@media (max-width: 760px) { .nav-links { display: none; } }
@media (max-width: 440px) {
  .nav-inner { gap: 12px; }
  .brand { gap: 8px; }
  .brand svg { width: 26px; height: 26px; }
  .brand-name { font-size: 15.5px; }
  .nav .btn { padding: 9px 11px; font-size: 13.5px; }
}

/* Hero: full-bleed simulation footage */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: min(86vh, 860px); display: flex; align-items: flex-end;
  padding-block: 140px clamp(56px, 7vw, 96px);
  background: var(--ink); color: var(--paper);
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(21,27,46,.88) 0%, rgba(21,27,46,.62) 38%, rgba(21,27,46,.08) 72%),
    linear-gradient(0deg, rgba(21,27,46,.75) 0%, rgba(21,27,46,0) 45%);
}
.hero-inner { position: relative; }
.hero h1 { max-width: 12ch; color: var(--paper); }
.hero .lede { margin-top: 26px; max-width: 46ch; color: color-mix(in srgb, var(--paper) 88%, transparent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-note { margin-top: 20px; font-size: 14.5px; color: color-mix(in srgb, var(--paper) 66%, transparent); max-width: 46ch; }
.hero-meta { position: absolute; right: var(--gutter); bottom: 18px; display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: color-mix(in srgb, var(--paper) 62%, transparent); }
.hero-toggle { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--paper) 40%, transparent); background: rgba(21,27,46,.4); color: var(--paper); cursor: pointer; padding: 0; }
.hero-toggle:hover { background: var(--paper); color: var(--ink); }
.hero-toggle .i-play { display: none; }
.hero-toggle[aria-pressed="true"] .i-play { display: block; }
.hero-toggle[aria-pressed="true"] .i-pause { display: none; }
@media (max-width: 760px) {
  .hero { min-height: 92vh; padding-top: 120px; }
  .hero-shade { background: linear-gradient(0deg, rgba(21,27,46,.92) 0%, rgba(21,27,46,.7) 55%, rgba(21,27,46,.25) 100%); }
  .hero-meta { left: var(--gutter); right: var(--gutter); justify-content: space-between; bottom: 12px; }
}
.btn-ghost { background: rgba(245,245,242,.08); color: var(--paper); border-color: color-mix(in srgb, var(--paper) 55%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.btn-ghost:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
button.btn { font-family: var(--font); }

/* Pattern drawing in the mission section: the seam stitches itself when it scrolls into view */
.pattern-art { width: 100%; max-width: 330px; height: auto; margin-top: 40px; color: var(--paper); }
.seam { stroke: var(--topstitch); stroke-width: 2.6; stroke-dasharray: 7 6; fill: none; stroke-linecap: round; }
.reveal { stroke-dasharray: 1; stroke-dashoffset: 1; }
.pattern-art.in .reveal { animation: draw 2.4s cubic-bezier(.6,.05,.3,1) .2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .reveal, .pattern-art.in .reveal { animation: none; stroke-dashoffset: 0; } }
@media (max-width: 860px) { .pattern-art { max-width: 240px; } }

/* Sections */
section { padding-block: var(--section); }
.head { max-width: 34ch; margin-bottom: 20px; }
.head + .lede { max-width: 58ch; }

/* Why now: chart + stats */
.why-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(32px, 5vw, 72px); margin-top: 48px; align-items: start; }
@media (max-width: 900px) { .why-grid { grid-template-columns: 1fr; } }
.chart { position: relative; }
.chart h3 { margin-bottom: 4px; }
.chart .sub { font-size: 14.5px; color: var(--ink-soft); margin: 0 0 16px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--hair); stroke-width: 1; }
.chart .axis-label { font: 400 12px var(--font); fill: var(--ink-soft); }
.chart .baseline { stroke: var(--ink-soft); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .line { stroke: var(--thread); stroke-width: 2.5; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--thread); stroke: var(--paper); stroke-width: 2; }
.chart .value { font: 600 14px var(--font); fill: var(--ink); }
.chart .hit { fill: transparent; cursor: default; }
.chart .pt:focus { outline: none; }
.chart .pt:focus .dot, .chart .pt:hover .dot { r: 7; }
.tip {
  position: absolute; pointer-events: none; z-index: 2;
  background: var(--ink); color: var(--paper); border-radius: var(--radius);
  padding: 8px 10px; font-size: 13.5px; line-height: 1.35; white-space: nowrap;
  transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity .12s;
}
.tip.on { opacity: 1; }
.tip strong { font-weight: 600; }
@media (max-width: 560px) {
  .chart .axis-label { font-size: 19px; }
  .chart .value { font-size: 22px; }
  .chart .xmid { display: none; }
}
.demo-frame .lbl { font-size: 13px; }
@media (max-width: 560px) { .demo-frame .lbl { font-size: 21px; } }
.chart details { margin-top: 10px; font-size: 14px; color: var(--ink-soft); }
.chart summary { cursor: pointer; }
.chart table { border-collapse: collapse; margin-top: 10px; font-variant-numeric: tabular-nums; }
.chart td, .chart th { padding: 4px 18px 4px 0; text-align: left; border-bottom: 1px solid var(--hair); font-weight: 400; }

.stats { display: grid; gap: 0; border-top: 1px solid var(--ink); }
.stat { padding: 22px 0; border-bottom: 1px solid var(--hair); }
.stat .fig { font-stretch: 115%; font-weight: 600; font-size: clamp(40px, 4vw, 54px); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat .fig small { font-size: .42em; letter-spacing: 0; font-weight: 500; margin-right: 6px; }
.stat p { margin: 10px 0 0; font-size: 15px; line-height: 1.45; color: var(--ink-soft); max-width: 30ch; }
sup { font-size: 11px; color: var(--ink-soft); font-weight: 400; letter-spacing: 0; margin-left: 2px; }
.footnotes { margin-top: 40px; font-size: 13px; color: var(--ink-soft); line-height: 1.55; max-width: 90ch; }
.footnotes ol { margin: 0; padding-left: 18px; }

/* Mission */
.mission { background: var(--ink); color: var(--paper); }
.mission .muted { color: color-mix(in srgb, var(--paper) 66%, transparent); }
.mission-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); }
@media (max-width: 860px) { .mission-grid { grid-template-columns: 1fr; } }
.definition { font-size: clamp(22px, 2.2vw, 28px); line-height: 1.3; font-weight: 400; margin-top: 22px; max-width: 24ch; }
.definition i { font-weight: 600; font-stretch: 112%; }
.definition .pos { font-size: 14px; color: color-mix(in srgb, var(--paper) 60%, transparent); margin-left: 8px; font-style: normal; }
.mission p { color: color-mix(in srgb, var(--paper) 82%, transparent); }
.mission .lede { color: var(--paper); }

.timeline { list-style: none; margin: clamp(56px, 7vw, 88px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: relative; }
.timeline::before { /* the seam running through history */
  content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 2px;
  background: repeating-linear-gradient(to right, color-mix(in srgb, var(--paper) 45%, transparent) 0 10px, transparent 10px 18px);
}
.timeline li { position: relative; padding: 34px 24px 0 0; }
.timeline li::before { content: ""; position: absolute; top: 0; left: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 2px solid var(--paper); }
.timeline li.next::before { background: var(--topstitch); border-color: var(--topstitch); }
.timeline .year { font-stretch: 115%; font-weight: 600; font-size: 30px; line-height: 1; letter-spacing: -0.02em; }
.timeline li.next .year { color: var(--topstitch); }
.timeline p { margin: 10px 0 0; font-size: 15px; line-height: 1.5; color: color-mix(in srgb, var(--paper) 74%, transparent); }
@media (max-width: 760px) {
  .timeline { grid-template-columns: 1fr; gap: 28px; padding-left: 34px; }
  .timeline::before { left: 7px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; background: repeating-linear-gradient(to bottom, color-mix(in srgb, var(--paper) 45%, transparent) 0 10px, transparent 10px 18px); }
  .timeline li { padding: 0; }
  .timeline li::before { left: -34px; top: 6px; }
}

.commitments { list-style: none; margin: clamp(56px, 7vw, 80px) 0 0; padding: 28px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; border-top: 1px solid color-mix(in srgb, var(--paper) 22%, transparent); }
.commitments h3 { margin-bottom: 8px; }
.commitments p { margin: 0; font-size: 15.5px; color: color-mix(in srgb, var(--paper) 74%, transparent); }
@media (max-width: 760px) { .commitments { grid-template-columns: 1fr; } }

/* How it works: a loop */
.loop { margin-top: 56px; }
.loop ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; position: relative; }
.loop li { position: relative; padding-right: 28px; }
.loop ol { gap: 24px; }
.loop li { padding-right: 0; }
.loop .shot { margin: 0; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius); background: var(--ink); }
.loop .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.loop h3 { margin-top: 20px; }
.loop .where { font-size: 13.5px; color: var(--thread); font-weight: 500; margin: 2px 0 8px; }
.loop p { margin: 0; font-size: 15.5px; color: var(--ink-soft); }
.return {
  position: relative; margin: 26px calc(12.5% - 3px) 0 calc(37.5% - 9px); height: 34px;
  border: 2px dashed var(--thread); border-top: 0; border-radius: 0 0 16px 16px;
}
.return span { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); background: var(--paper); padding: 0 12px; font-size: 14px; color: var(--ink); white-space: nowrap; }
.return::before { /* arrowhead pointing up into Learn */
  content: ""; position: absolute; left: -7px; top: -9px; border: 6px solid transparent; border-bottom: 9px solid var(--thread); border-top: 0;
}
.return-note { display: none; }
@media (max-width: 860px) {
  .loop ol { grid-template-columns: 1fr 1fr; gap: 28px 18px; }
  .return { display: none; }
  .return-note { display: block; margin-top: 24px; font-size: 15px; }
}
@media (max-width: 520px) { .loop ol { grid-template-columns: 1fr; } }

/* Pilot */
.pilot { background: var(--ink); color: var(--paper); }
.pilot-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
@media (max-width: 860px) { .pilot-grid { grid-template-columns: 1fr; } }
.pilot p { color: color-mix(in srgb, var(--paper) 74%, transparent); }
.who { list-style: none; margin: 28px 0; padding: 0; }
.who li { padding: 14px 0; border-top: 1px solid color-mix(in srgb, var(--paper) 20%, transparent); }
.who li:last-child { border-bottom: 1px solid color-mix(in srgb, var(--paper) 20%, transparent); }
.who strong { display: block; font-weight: 600; }
.who span { font-size: 15px; color: color-mix(in srgb, var(--paper) 70%, transparent); }
.pilot .small { font-size: 14.5px; }
.pilot a { color: var(--paper); }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 14px; color: color-mix(in srgb, var(--paper) 74%, transparent); }
.field input, .field select, .field textarea {
  width: 100%; font: 400 16px/1.4 var(--font); color: var(--paper);
  background: color-mix(in srgb, var(--paper) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--paper) 28%, transparent);
  border-radius: var(--radius); padding: 12px 14px;
}
.field select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--paper) 50%), linear-gradient(135deg, var(--paper) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.field select option { color: var(--ink); background: var(--paper); }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-color: var(--topstitch); border-color: var(--topstitch); }
.form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 6px; }
.form-actions p { margin: 0; font-size: 14px; color: color-mix(in srgb, var(--paper) 62%, transparent); }
.form-status { grid-column: 1 / -1; font-size: 15px; min-height: 1.4em; margin: 0; }
.pilot .form-status { color: var(--paper); }
@media (max-width: 620px) { .form { grid-template-columns: 1fr; } }

/* Demo */
.demo-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
@media (max-width: 860px) { .demo-grid { grid-template-columns: 1fr; } }
.demo-frame { position: relative; margin: 0; border-radius: var(--radius); background: var(--ink); overflow: hidden; }
.demo-frame video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--ink); }
.demo-frame .badge { position: absolute; z-index: 1; bottom: 14px; right: 14px; margin: 0; font-size: 13px; padding: 6px 10px; background: var(--paper); border: 1px solid var(--ink); }
.demo-form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; max-width: 500px; }
.demo-form input { flex: 1 1 220px; font: 400 16px/1.4 var(--font); padding: 12px 14px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--chalk); color: var(--ink); }
.demo-form .form-status { flex-basis: 100%; }

/* Footer */
footer { border-top: 1px solid var(--ink); padding: 40px 0 56px; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: center; }
.foot-right { font-size: 14.5px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 8px 28px; }
.foot-right a { text-decoration: none; }
.foot-right a:hover { color: var(--thread); }

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

/* Film dialog */
.film { width: min(1200px, 100vw - 32px); max-height: 100vh; padding: 0; border: 0; background: transparent; color: var(--paper); overflow: visible; }
.film::backdrop { background: rgba(10, 13, 24, .9); backdrop-filter: blur(4px); }
.film video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); }
.film-close { position: absolute; top: -46px; right: 0; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--paper); cursor: pointer; }
.film-close:hover { background: rgba(255,255,255,.12); }
.film-credit { margin: 12px 0 0; font-size: 12.5px; color: rgba(245,245,242,.6); max-width: none; }
