/* Agely landing page. Spacing and type follow src/ui/tokens.css (16px floor); the accent is the
   violet used in the demo video. */

@font-face {
  font-family: "Fraunces";
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/Fraunces-500.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces";
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/Fraunces-600.woff2") format("woff2");
}

:root {
  --color-accent: #6d63c9;
  --color-accent-strong: #4f469f;
  --color-accent-soft: #ebe9f8;
  --bg: #f8f7fb;
  --surface: #ffffff;
  --surface-muted: #f1f0f7;
  --border: #e2e0ee;
  --text: #1b2430;
  --text-muted: #56606c;
  --color-dev: #0f6f68;
  --color-dev-soft: #dff1ee;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --radius-md: 16px;
  --card-radius: 20px;
  --card-shadow: 0 1px 2px rgba(27, 36, 48, 0.06), 0 8px 24px rgba(27, 36, 48, 0.06);
  --video-shadow: 0 2px 4px rgba(27, 36, 48, 0.08), 0 24px 48px rgba(27, 36, 48, 0.16);
  --control-h: 56px;
  --content-max: 1120px;
  --gutter: clamp(16px, 4vw, 48px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-accent: #a59cf0;
    --color-accent-strong: #c4bdf7;
    --color-accent-soft: #2b2752;
    --bg: #15141f;
    --surface: #1f1d2d;
    --surface-muted: #1a1927;
    --border: #312e47;
    --text: #eef1f4;
    --text-muted: #a8b2bd;
    --color-dev: #6fd3c8;
    --color-dev-soft: #16373a;
    --card-shadow: none;
    --video-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--color-accent-strong);
}

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

.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 20px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}

.brand img {
  border-radius: 10px;
}

.topbar-link {
  font-weight: 600;
}

/* Hero */
.hero {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(24px, 6vh, 72px) var(--gutter) clamp(48px, 8vh, 96px);
}

.hero-copy {
  max-width: 760px;
  margin: 0 auto clamp(32px, 5vh, 56px);
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 20px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  letter-spacing: -0.01em;
}

.lede {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  color: var(--text-muted);
}

.hero-video {
  margin: 0;
}

.hero-video video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--card-radius);
  background: #22203a;
  box-shadow: var(--video-shadow);
}

.hero-video figcaption {
  margin-top: 16px;
  text-align: center;
  color: var(--text-muted);
}

/* Bands and cards */
.band {
  background: var(--surface-muted);
  border-block: 1px solid var(--border);
  padding: clamp(48px, 8vh, 88px) 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 28px;
  box-shadow: var(--card-shadow);
}

.card p {
  color: var(--text-muted);
  margin: 0;
}

/* Story steps */
.story {
  padding-block: clamp(48px, 8vh, 88px);
}

.story-intro {
  max-width: 68ch;
  color: var(--text-muted);
  font-size: 1.125rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.swatch {
  width: 28px;
  height: 20px;
  border-radius: 6px;
  background: var(--surface);
}

.swatch--says {
  border: 1px solid var(--border);
  border-bottom-left-radius: 0;
}

.swatch--draft {
  border: 2px dashed var(--text-muted);
}

.swatch--decision {
  border: 2px solid var(--color-accent-strong);
  background: var(--color-accent-soft);
}

/* Flow: three lanes. Each event sits under whoever takes it; reading down is reading in time. */
.flow {
  --gap: 20px;
  margin-top: 32px;
}

.lanes {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  padding: 14px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.lane {
  display: flex;
  flex-direction: column;
  padding-left: 14px;
  border-left: 4px solid var(--lane);
  line-height: 1.35;
}

.lane span {
  color: var(--text-muted);
  font-size: 0.89rem;
}

.lane--m,
.ev--m {
  --lane: var(--color-accent-strong);
  --lane-soft: var(--color-accent-soft);
}

.lane--a,
.ev--a,
.ev--ad {
  --lane: var(--text-muted);
  --lane-soft: var(--surface-muted);
}

.lane--d,
.ev--d {
  --lane: var(--color-dev);
  --lane-soft: var(--color-dev-soft);
}

.chapter {
  padding-top: 40px;
}

.chapter-head {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  max-width: 76ch;
}

.chapter-num {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
}

.chapter-head h3 {
  font-size: 1.5rem;
  margin-bottom: 0.3em;
}

.chapter-head p {
  margin: 0;
  color: var(--text-muted);
}

/* Lifelines down the centre of each lane; cards sit on top of them. */
.events {
  list-style: none;
  margin: 20px 0 0;
  padding: 4px 0 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px var(--gap);
  align-items: start;
  --line: linear-gradient(var(--border), var(--border));
  background:
    var(--line) 16.667% 0 / 2px 100% no-repeat,
    var(--line) 50% 0 / 2px 100% no-repeat,
    var(--line) 83.333% 0 / 2px 100% no-repeat;
}

.ev {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.ev--m {
  grid-column: 1;
}

.ev--a {
  grid-column: 2;
}

.ev--d {
  grid-column: 3;
}

/* The match explanation spans the agent and Dev lanes: it is drawn for Dev to read. */
.ev--ad {
  grid-column: 2 / 4;
}

/* Placement in time: a later event starts lower than the one it answers. */
.at-1 {
  grid-row: 1;
}

.at-2 {
  grid-row: 2;
}

.at-3 {
  grid-row: 3;
}

.tall {
  grid-row-end: span 2;
  margin-top: 56px;
}

.last {
  align-self: end;
}

.ev p,
.ev blockquote {
  margin: 0;
}

.ev > * + * {
  margin-top: 10px;
}

.ev-who {
  font-weight: 600;
  color: var(--lane);
}

.ev--says {
  border-bottom-left-radius: 4px;
}

.ev--says blockquote {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.125rem;
  line-height: 1.4;
}

.ev--draft {
  border: 2px dashed var(--lane);
}

.ev--decision {
  border: 2px solid var(--lane);
  background: var(--lane-soft);
}

.ev--decision .ev-who::before {
  content: "✓ ";
}

.ev-note {
  color: var(--text-muted);
  font-size: 0.89rem;
}

.sourced,
.facts,
.verdicts {
  margin: 10px 0 0;
}

.sourced div,
.facts div {
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.sourced dt,
.facts dt,
.verdicts dt {
  font-weight: 600;
}

.sourced dd,
.facts dd,
.verdicts dd {
  margin: 0;
  color: var(--text-muted);
}

.figure-line {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1.1;
}

.figure-line small {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.89rem;
  color: var(--text-muted);
}

.reasons {
  margin: 10px 0 0;
  padding-left: 1.1em;
  color: var(--text-muted);
}

.reasons li + li {
  margin-top: 4px;
}

/* Price ranges on one scale, $40 to $160. The shaded band is Dev's budget. */
.ranges-plot {
  position: relative;
  margin-left: 92px;
  padding: 0 0 8px;
}

.ranges-budget {
  position: absolute;
  inset: 0 auto 0 8.33%;
  width: 41.67%;
  border-inline: 2px solid var(--color-dev);
  background: var(--color-dev-soft);
  border-radius: 4px;
}

.ranges-budget-label {
  /* A translated caption can span several lines; the price rows must follow its real height. */
  position: relative;
  margin: 0 0 8px;
  padding: 8px 0 0 calc(8.33% + 8px);
  color: var(--color-dev);
  font-weight: 600;
  font-size: 0.89rem;
}

.range-row {
  position: relative;
  height: 36px;
  margin-top: 8px;
}

.range-name {
  position: absolute;
  right: 100%;
  width: 92px;
  line-height: 36px;
  font-weight: 600;
}

.range-name small {
  display: none;
  font-size: 0.89rem;
  font-weight: 400;
  color: var(--text-muted);
}

.range-bar {
  position: absolute;
  left: var(--from);
  width: var(--width);
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface);
  border: 2px solid var(--text-muted);
  color: var(--text);
  font-size: 0.89rem;
  font-weight: 600;
  white-space: nowrap;
}

.range-row--match .range-bar {
  background: var(--color-accent-strong);
  border-color: var(--color-accent-strong);
  color: var(--bg);
}

.verdicts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px 24px;
  margin-top: 16px;
}

.sum {
  display: flex;
  flex-direction: column;
}

.sum strong {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.1;
}

.tally {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.tally strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.story-end {
  margin: 48px 0 0;
  justify-content: center;
}

/* One column: the lanes become a stagger, Margaret to the left and Dev to the right. */
@media (max-width: 820px) {
  .lanes {
    display: none;
  }

  .events {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: none;
  }

  .tall {
    margin-top: 0;
  }

  .last {
    align-self: auto;
  }

  .ev,
  .ev--ad {
    border-left-width: 4px;
    border-left-style: solid;
    border-left-color: var(--lane);
  }

  .ev--m {
    margin-right: 10%;
  }

  .ev--d {
    margin-left: 10%;
  }

  .ev--a {
    margin-inline: 5%;
  }

  .chapter-head {
    gap: 14px;
  }

  /* Narrow bars can't hold their own label, so the price moves up beside the name. */
  .ranges-plot {
    margin-left: 0;
  }

  .range-row {
    height: 52px;
  }

  .range-name {
    position: relative;
    right: auto;
    z-index: 1;
    display: block;
    width: auto;
    line-height: 24px;
  }

  .range-name small {
    display: inline;
  }

  .range-bar {
    top: 26px;
    height: 22px;
    font-size: 0;
  }
}

/* Split section */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 48px;
}

.split p {
  color: var(--text-muted);
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-h);
  padding: 0 28px;
  border-radius: 999px;
  background: var(--color-accent-strong);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  background: var(--color-accent);
}

@media (prefers-color-scheme: dark) {
  .button {
    background: var(--color-accent);
    color: #15141f;
  }
  .button:hover {
    background: var(--color-accent-strong);
  }
}

.hero-copy .button {
  margin-top: 8px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

.actions a:not(.button) {
  font-weight: 600;
}

.footer {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 40px var(--gutter) 56px;
  color: var(--text-muted);
  text-align: center;
}
