/* Client Pulse case study. One family (Archivo, variable width + weight). */
@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #F3F5F8;
  --surface: #FFFFFF;
  --ink: #142034;
  --muted: #4A586B;
  --line: #D6DDE6;
  --pulse: #11704E;
  --trace: #1F8A63;
  --signal: #9A5600;
  --shadow: rgba(20, 32, 52, .30);

  --band: #12203A;
  --band-ink: #E8EEF6;
  --band-muted: #A9B6C8;
  --band-line: #2A3A57;
  --band-pulse: #5FD7A5;
  --band-signal: #F2B14C;

  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0C1422;
    --surface: #121D30;
    --ink: #E6ECF4;
    --muted: #A0AEC1;
    --line: #24324A;
    --pulse: #5FD7A5;
    --trace: #5FD7A5;
    --signal: #F2B14C;
    --shadow: rgba(0, 0, 0, .55);

    --band: #070E1A;
    --band-line: #1D2B43;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--pulse); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--pulse); outline-offset: 3px; border-radius: 4px; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; text-wrap: balance; }

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- header ---------- */
.top { padding-block: 20px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-weight: 700; font-stretch: 112%; font-size: 1.05rem; letter-spacing: -.01em;
}
.brand-mark { width: 30px; height: 30px; }
.brand-mark rect { fill: var(--trace); }
.brand-mark path { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-color-scheme: dark) { .brand-mark path { stroke: #0C1422; } }
.byline { margin: 0; color: var(--muted); font-size: .95rem; }
.byline a { color: var(--ink); }

/* ---------- hero ---------- */
.hero { padding-top: clamp(28px, 6vw, 80px); }
.hero h1 {
  font-size: clamp(2.45rem, 1.1rem + 5.6vw, 5.75rem);
  font-weight: 780;
  font-stretch: 125%;
  line-height: .97;
  letter-spacing: -.028em;
  max-width: 14.5ch;
  margin-bottom: clamp(20px, 3vw, 32px);
}
@media (max-width: 520px) { .hero h1 { font-stretch: 110%; } }
.lede { font-size: clamp(1.1rem, 1rem + .45vw, 1.3rem); line-height: 1.55; max-width: 58ch; color: var(--ink); }

.facts {
  margin: clamp(24px, 4vw, 40px) 0 0; display: grid; gap: 16px 32px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line); padding-top: 18px;
}
.facts dt { font-size: .86rem; font-weight: 600; font-stretch: 88%; color: var(--muted); letter-spacing: .01em; }
.facts dd { margin: 2px 0 0; font-weight: 520; line-height: 1.4; }
@media (max-width: 900px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; } }

/* the pulse line: a real day of scheduled jobs */
.trace { margin: clamp(36px, 6vw, 72px) 0 clamp(28px, 4vw, 44px); }
.trace-band {
  --base: 80%;
  background: linear-gradient(to bottom, transparent calc(var(--base) - 1px), var(--line) calc(var(--base) - 1px), var(--line) var(--base), transparent var(--base));
}
.trace-plot { height: clamp(84px, 11vw, 160px); }
.trace-svg { width: 100%; height: 100%; overflow: visible; }
.trace-base { stroke: transparent; stroke-width: 1; vector-effect: non-scaling-stroke; fill: none; }
.trace-line {
  fill: none; stroke: var(--trace); stroke-width: 2; vector-effect: non-scaling-stroke;
  stroke-linejoin: round; stroke-linecap: round;
}
/* one orchestrated moment: the day draws itself left to right */
@media (prefers-reduced-motion: no-preference) {
  .trace-svg { animation: draw 2.8s cubic-bezier(.35, .1, .25, 1) .15s both; }
  @keyframes draw { from { clip-path: inset(-20% 100% -20% 0); } to { clip-path: inset(-20% 0 -20% 0); } }
}
.trace-axis {
  display: flex; justify-content: space-between; margin-top: 8px;
  font-size: .8rem; font-stretch: 88%; color: var(--muted); font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) { .trace-axis .opt { display: none; } }
.trace figcaption { margin-top: 12px; max-width: 70ch; color: var(--muted); font-size: .95rem; }

/* ---------- screenshot frame ---------- */
.screen {
  margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 60px -36px var(--shadow);
}
.screen-bar {
  display: flex; align-items: center; height: 34px; padding-inline: 14px;
  border-bottom: 1px solid var(--line);
  font-size: .8rem; font-stretch: 88%; font-weight: 600; color: var(--muted);
}
.screen-bar span::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--trace); margin-right: 8px; vertical-align: 1px;
}
.screen img { width: 100%; }
.screen-hero { max-width: 1105px; }
@media (prefers-color-scheme: dark) { .screen img { filter: brightness(.92); } }
.hero-caption { margin: 18px 0 0; max-width: 70ch; }
.hero-caption strong { font-weight: 660; }
.privacy-note {
  margin: 16px 0 0; padding-left: 14px; border-left: 3px solid var(--trace);
  color: var(--muted); font-size: .95rem; max-width: 70ch;
}

/* ---------- sections ---------- */
.block { padding-block: clamp(56px, 9vw, 120px); }
.hero + .block { margin-top: clamp(56px, 9vw, 120px); border-top: 1px solid var(--line); }
.block + .block { border-top: 1px solid var(--line); }
.block h2, .rhythm h2 {
  font-size: clamp(1.8rem, 1.15rem + 2.4vw, 2.9rem);
  font-weight: 720; font-stretch: 114%; line-height: 1.04; letter-spacing: -.02em;
  margin-bottom: 18px;
}
.block h3 { font-size: 1.2rem; font-weight: 660; line-height: 1.25; margin-bottom: 8px; }
.section-intro { max-width: 62ch; color: var(--muted); font-size: 1.08rem; margin-bottom: clamp(28px, 4vw, 44px); }
.prose { max-width: 64ch; }
.prose h3 { margin-top: 28px; }

.split { display: grid; gap: 8px 48px; }
@media (min-width: 880px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); }
  .split h2 { position: sticky; top: 24px; align-self: start; }
}

/* ---------- tour (tabs on wide screens, stacked otherwise) ---------- */
.tour-tabs { display: none; }
.panel + .panel { margin-top: clamp(48px, 8vw, 72px); }
.panel-text { max-width: 62ch; margin-bottom: 22px; }
.panel-text p:last-child { margin-bottom: 0; }
.source { color: var(--muted); font-size: .95rem; }

@media (min-width: 900px) {
  .js .tour-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 44px; align-items: start; }
  .js .tour-tabs {
    display: flex; flex-direction: column; gap: 2px; position: sticky; top: 24px;
    padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  }
  .js .tour-tabs button {
    font: inherit; font-size: .98rem; font-weight: 520; text-align: left; cursor: pointer;
    padding: 9px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  }
  .js .tour-tabs button:hover { color: var(--ink); background: var(--paper); }
  .js .tour-tabs button[aria-selected="true"] {
    color: var(--ink); background: var(--paper); font-weight: 650;
    box-shadow: inset 3px 0 0 var(--trace);
  }
  .js .panel { display: none; }
  .js .panel.is-active { display: block; }
  .js .panel + .panel { margin-top: 0; }
  .js .panel-text { min-height: 9.5em; }
}
.also { margin-top: clamp(32px, 5vw, 48px); max-width: 70ch; color: var(--muted); }

/* ---------- how it fits together ---------- */
.flow { display: grid; gap: 14px; align-items: center; }
.flow h3 { font-size: 1rem; font-stretch: 100%; font-weight: 650; color: var(--muted); margin-bottom: 12px; }
.flow ul { list-style: none; margin: 0; padding: 0; }
.flow-col { align-self: start; }
.flow-col li { padding: 12px 0; border-top: 1px solid var(--line); }
.flow-col li strong { display: block; font-weight: 640; }
.flow-col li span { display: block; color: var(--muted); font-size: .95rem; line-height: 1.45; }
.flow-core {
  background: var(--band); color: var(--band-ink); border-radius: 18px; padding: 22px 22px 18px;
}
.flow-core h3 { color: var(--band-ink); font-size: 1.35rem; font-stretch: 118%; font-weight: 740; }
.flow-core li { padding: 8px 0 8px 18px; position: relative; color: var(--band-muted); line-height: 1.45; }
.flow-core li::before {
  content: ""; position: absolute; left: 0; top: .62em; width: 2px; height: 14px; background: var(--band-pulse);
}
.flow-arrow { justify-self: center; color: var(--trace); }
.flow-arrow svg { width: 48px; height: 16px; transform: rotate(90deg); }
.flow-arrow path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 980px) {
  .flow { grid-template-columns: minmax(0, 1fr) 56px minmax(0, .85fr) 56px minmax(0, 1fr); gap: 0; }
  .flow-arrow svg { transform: none; }
}

.stack {
  margin: clamp(40px, 6vw, 64px) 0 0; display: grid; gap: 16px 32px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.stack div { border-top: 1px solid var(--line); padding-top: 12px; }
.stack dt { font-size: .86rem; font-weight: 600; font-stretch: 88%; color: var(--muted); }
.stack dd { margin: 4px 0 0; line-height: 1.45; }
.num { font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 680px) { .stack { grid-template-columns: 1fr; } }

/* ---------- the jobs behind the line ---------- */
.rhythm {
  background: var(--band); color: var(--band-ink);
  padding-block: clamp(64px, 10vw, 128px);
}
.rhythm .section-intro { color: var(--band-muted); }
.lanes { --label: 320px; --gap: 32px; }
.lanes-axis {
  position: relative; height: 22px; margin-left: calc(var(--label) + var(--gap));
  font-size: .8rem; font-stretch: 88%; color: var(--band-muted); font-variant-numeric: tabular-nums;
}
.lanes-axis span { position: absolute; top: 0; transform: translateX(-50%); }
.lanes-axis span:nth-child(1) { left: 0; transform: none; }
.lanes-axis span:nth-child(2) { left: 12.5%; }
.lanes-axis span:nth-child(3) { left: 25%; }
.lanes-axis span:nth-child(4) { left: 37.5%; }
.lanes-axis span:nth-child(5) { left: 50%; }
.lanes-axis span:nth-child(6) { left: 62.5%; }
.lanes-axis span:nth-child(7) { left: 75%; }
.lanes-axis span:nth-child(8) { left: 87.5%; }
.lanes-axis span:nth-child(9) { left: 100%; transform: translateX(-100%); }

.lane {
  display: grid; grid-template-columns: var(--label) minmax(0, 1fr); gap: var(--gap);
  align-items: end; padding-block: 14px; border-bottom: 1px solid var(--band-line);
}
.lane-label strong { display: block; font-weight: 650; }
.lane-label span { display: block; color: var(--band-muted); font-size: .92rem; line-height: 1.45; }
.lane-track {
  position: relative; height: 46px;
  background-image: linear-gradient(to right, var(--band-line) 1px, transparent 1px);
  background-size: 12.5% 100%;
  border-right: 1px solid var(--band-line);
}
.lane-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.lane-svg line { stroke: var(--band-pulse); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.lane-svg.tall line { stroke-width: 3; }
.lane-svg.signal line { stroke: var(--band-signal); }
.tick-label {
  position: absolute; top: -4px; transform: translateX(7px);
  font-size: .78rem; font-stretch: 88%; color: var(--band-muted); font-variant-numeric: tabular-nums;
}
.lane-signal .tick-label { color: var(--band-signal); }
.at-0830 { left: 35.4167%; }
.at-1200 { left: 50%; }
.at-1300 { left: 54.1667%; }

@media (max-width: 860px) {
  .lanes { --label: 240px; --gap: 20px; }
}
@media (max-width: 700px) {
  .lanes-axis { margin-left: 0; }
  .lanes-axis .opt { display: none; }
  .lane { grid-template-columns: 1fr; gap: 10px; }
  .lane-label span { max-width: 52ch; }
}

/* ---------- my part ---------- */
.threads { list-style: none; margin: 0; padding: 0; }
.threads li { position: relative; padding: 6px 0 6px 20px; }
.threads li::before {
  content: ""; position: absolute; left: 2px; top: .7em; width: 2px; height: 14px; background: var(--trace);
}

/* ---------- rules ---------- */
.rule-grid { display: grid; gap: 28px 48px; }
@media (min-width: 760px) { .rule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rule { border-top: 2px solid var(--ink); padding-top: 16px; }
.rule p { color: var(--muted); margin: 0; max-width: 52ch; }

/* ---------- outro + footer ---------- */
.outro p { max-width: 60ch; }
.button {
  display: inline-block; margin-top: 6px; padding: 12px 20px; border-radius: 10px;
  background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 620;
}
.button:hover { background: var(--pulse); color: var(--paper); }
@media (prefers-color-scheme: dark) { .button:hover { color: #0C1422; } }

.foot { border-top: 1px solid var(--line); padding-block: 28px 40px; color: var(--muted); font-size: .95rem; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; }
.foot p { margin: 0; }
.foot a { color: var(--ink); }

/* ---------- 404 ---------- */
.notfound { min-height: 62vh; display: grid; align-content: center; padding-block: 48px 80px; }
.notfound h1 {
  font-size: clamp(2.2rem, 1.2rem + 4vw, 4rem); font-weight: 760; font-stretch: 120%;
  line-height: 1; letter-spacing: -.025em; margin-bottom: 16px;
}
.notfound .flat { height: 60px; margin: 0 0 28px; }
.notfound .flat svg { width: 100%; height: 100%; }
.notfound .flat path { fill: none; stroke: var(--trace); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.notfound p { color: var(--muted); max-width: 52ch; }
