/* Flying Elephant — see DESIGN.md for the token rationale */

:root {
  --sky: #1F9BEF;
  --sky-deep: #157CC4;
  --navy: #0F2D64;
  --ink: #17233A;
  --ink-soft: #4A5670;
  --mist: #EEF5FC;
  --paper: #FFFFFF;
  --cloud: #C9DCF0;

  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --body: "Figtree", "Avenir Next", "Segoe UI", sans-serif;

  --measure: 1120px;
  --gutter: 24px;

  --t-sm: 15px;
  --t-base: 17px;
  --t-md: 20px;
  --t-lg: 26px;
  --t-xl: 36px;
  --t-2xl: clamp(36px, 5vw, 52px);
  --t-3xl: clamp(40px, 6.2vw, 76px);
}

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

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

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

img { display: block; max-width: 100%; height: auto; }

a { color: var(--sky-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--navy); }

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

.skip {
  position: absolute; left: var(--gutter); top: -60px;
  background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 6px;
  z-index: 10;
}
.skip:focus { top: 12px; }

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.wrap.narrow { max-width: 760px; margin-left: auto; margin-right: auto; }

h1, h2, h3 {
  font-family: var(--display);
  font-variation-settings: "opsz" 96;
  color: var(--navy);
  margin: 0;
  letter-spacing: -0.015em;
}
h1 { font-size: var(--t-3xl); font-weight: 800; line-height: 1.02; }
h2 { font-size: var(--t-2xl); font-weight: 800; line-height: 1.06; margin-bottom: 28px; }
h3 { font-size: var(--t-lg); font-weight: 700; line-height: 1.2; margin-bottom: 18px; }

p { margin: 0 0 1em; max-width: 68ch; }

/* ---------- header ---------- */

.top {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 22px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--navy);
}
.brand-mark { width: 58px; height: auto; }
.brand-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  line-height: 0.95;
  letter-spacing: 0.01em;
}
.nav { display: flex; gap: 28px; }
.nav a {
  font-weight: 600; font-size: var(--t-sm);
  color: var(--navy); text-decoration: none;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--sky); }

/* ---------- hero ---------- */

.hero {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 48px var(--gutter) 72px;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 40px;
  align-items: center;
}
.hero h1 { max-width: 14ch; margin-bottom: 26px; }
.lede { font-size: var(--t-md); color: var(--ink-soft); max-width: 52ch; }
.hero-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 30px; }

.button {
  display: inline-block;
  background: var(--sky);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 14px 24px;
  border-radius: 999px;
  transition: background-color .15s ease;
}
.button:hover { background: var(--sky-deep); color: #fff; }
.quiet-link { font-weight: 600; }

.hero-art { position: relative; min-height: 240px; }
.elephant {
  width: min(100%, 560px);
  margin-left: auto;
  /* visible by default; the keyframe's from-state supplies the drift, so a paused animation never hides the logo */
  animation: drift-in 1.1s cubic-bezier(.2,.7,.2,1) .15s backwards;
}
@keyframes drift-in {
  from { opacity: 0; transform: translate(28px, 16px) rotate(2deg); }
  to   { opacity: 1; transform: translate(0, 0) rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
  .elephant { animation: none; }
}

/* ---------- bands ---------- */

.band { padding: 80px 0; }
.band.mist { background: var(--mist); }
.section-lede { font-size: var(--t-md); color: var(--ink-soft); margin-bottom: 40px; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}

/* ruled rows: the rule marks the row, the strong is the subject */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--navy); }
.rows li {
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--cloud);
  display: grid;
  gap: 6px;
}
.rows strong { font-family: var(--display); font-weight: 700; font-size: var(--t-md); color: var(--navy); }
.rows span { color: var(--ink-soft); max-width: 60ch; }

.rows.work li {
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 32px;
  padding: 28px 0;
}
.rows.work strong { font-size: var(--t-lg); line-height: 1.2; }
.rows.work span { max-width: none; }

/* ---------- pipeline figure ---------- */

.pipeline { margin: 0; }
.pipeline svg { width: 100%; height: auto; overflow: visible; }
.pipeline figcaption { margin-top: 18px; color: var(--ink-soft); font-size: var(--t-sm); max-width: 60ch; }

.pipe { fill: none; stroke: var(--cloud); stroke-width: 3; }
.pipe-live {
  fill: none; stroke: var(--sky); stroke-width: 3;
  stroke-dasharray: 980;
  stroke-dashoffset: 980;
}
.node { fill: var(--paper); stroke: var(--navy); stroke-width: 3; }
.icon { fill: none; stroke: var(--navy); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.stages {
  list-style: none; margin: 6px 0 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  text-align: center;
}
.stages li { display: grid; gap: 4px; padding: 0 4px; }
.stages strong { font-family: var(--display); font-weight: 700; font-size: 17px; line-height: 1.2; color: var(--navy); }
.stages span { font-size: var(--t-sm); color: var(--ink-soft); line-height: 1.4; }
.packet { fill: var(--sky); opacity: 0; }

/* the one reveal: when the figure scrolls into view, the live line draws and the packet rides it */
.pipeline.is-live .pipe-live { animation: draw 2.4s ease-out forwards; }
.pipeline.is-live .packet { animation: ride 2.4s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes ride {
  0%   { opacity: 0; cx: 70; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { opacity: 0; cx: 1050; }
}
/* the five node centres sit at 70/315/560/805/1050 of 1120: the grid below uses the same 1/5 rhythm */
.pipeline svg { padding: 0 0 0 0; }
@media (prefers-reduced-motion: reduce) {
  .pipe-live { stroke-dashoffset: 0; animation: none !important; }
  .packet { display: none; }
}

/* ---------- steps (a true sequence) ---------- */

.steps {
  list-style: none; margin: 0; padding: 0;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px;
}
.steps li { counter-increment: step; display: grid; gap: 10px; }
.steps li::before {
  content: counter(step);
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--t-xl);
  line-height: 1;
  color: var(--sky);
}
.steps strong { font-family: var(--display); font-weight: 700; font-size: var(--t-md); color: var(--navy); }
.steps span { color: var(--ink-soft); }

/* ---------- footer / contact ---------- */

.contact { background: var(--navy); color: #DCE8F7; padding: 80px 0 40px; }
.contact h2 { color: #fff; }
.contact-lede { font-size: var(--t-md); color: #B9CDE8; max-width: 44ch; }
.contact-email a {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--t-2xl);
  color: #fff;
  text-decoration-color: var(--sky);
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
  line-height: 1.1;
  word-break: break-all;
}
.contact-email a:hover { color: var(--sky); }
.foot-meta {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.18);
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  font-size: var(--t-sm); color: #9FB6D6;
}
.foot-meta p { margin: 0; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; gap: 40px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .rows.work li { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 700px) {
  .top { padding-top: 16px; padding-bottom: 8px; }
  .nav { gap: 16px; }
  .nav a { font-size: 14px; }
  .hero { grid-template-columns: 1fr; padding-top: 24px; padding-bottom: 56px; gap: 16px; }
  .hero-art { order: -1; min-height: 0; }
  .elephant { width: min(72%, 320px); margin-left: 0; }
  .band { padding: 56px 0; }
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .pipeline svg { display: none; }
  .stages {
    grid-template-columns: 1fr;
    gap: 0;
    text-align: left;
    border-left: 3px solid var(--sky);
    margin-left: 6px;
  }
  .stages li { padding: 12px 0 12px 20px; position: relative; }
  .stages li::before {
    content: ""; position: absolute; left: -10px; top: 18px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--paper); border: 3px solid var(--navy);
  }
}

@media (max-width: 480px) {
  .nav { display: none; }
}
