/* ------------------------------------------------------------------
   Colour tokens.
   Blue = our plans, grey = the conventional benchmark (same as the charts).
   ------------------------------------------------------------------ */
:root {
  --paper: #f4f6f8;
  --surface: #ffffff;
  --ink: #14283c;
  --muted: #4c5f72;
  --rule: #d3dbe3;
  --ours: #1f6fb2;
  --ours-ink: #ffffff;
  --bench: #9aa5b1;
  --contour: #b9c6d3;
  --focus: #1f6fb2;

  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 66ch;
  --wide: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1a25;
    --surface: #162433;
    --ink: #e4ebf2;
    --muted: #a0b1c2;
    --rule: #2a3c4f;
    --ours: #5ea6e3;
    --ours-ink: #0f1a25;
    --bench: #7f8b98;
    --contour: #2d4359;
    --focus: #8cc2f0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1a25;
  --surface: #162433;
  --ink: #e4ebf2;
  --muted: #a0b1c2;
  --rule: #2a3c4f;
  --ours: #5ea6e3;
  --ours-ink: #0f1a25;
  --bench: #7f8b98;
  --contour: #2d4359;
  --focus: #8cc2f0;
  color-scheme: dark;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ours); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.005em; }
p { margin: 0 0 1em; }
strong { font-weight: 650; }

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

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--surface); color: var(--ink); padding: 8px 12px; z-index: 100;
}
.skip:focus { left: 8px; }

/* ------------------------------------------------------------------
   Header
   ------------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px;
}
.brand {
  font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px;
}
.brand svg { width: 22px; height: 22px; flex: none; }
.nav { display: flex; gap: clamp(14px, 2.5vw, 32px); }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.97rem; }
.nav a:hover { color: var(--ink); }
.nav a.nav-cta { color: var(--ours); font-weight: 600; }
@media (max-width: 640px) {
  .nav a:not(.nav-cta) { display: none; }
}

/* ------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------ */
.button {
  display: inline-block;
  background: var(--ours); color: var(--ours-ink);
  font-weight: 600; font-size: 1.02rem;
  padding: 14px 24px; border-radius: 6px; text-decoration: none;
}
.button:hover { filter: brightness(1.08); }
.button-quiet {
  background: transparent; color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--rule);
}
.button-quiet:hover { box-shadow: inset 0 0 0 1.5px var(--ink); filter: none; }

/* ------------------------------------------------------------------
   Hero: the reservoir map is the signature element
   ------------------------------------------------------------------ */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--rule); }
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  gap: 24px;
  min-height: min(78vh, 720px);
  padding-top: clamp(48px, 8vw, 96px);
  padding-bottom: clamp(48px, 8vw, 96px);
}
.hero h1 {
  font-size: clamp(2.3rem, 5.2vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  max-width: 15ch;
  margin-bottom: 28px;
}
.hero .lede { font-size: clamp(1.1rem, 1.6vw, 1.28rem); color: var(--muted); max-width: 46ch; margin-bottom: 36px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-map { position: relative; align-self: stretch; min-height: 320px; }
.reservoir {
  position: absolute; inset: 50% auto auto 50%;
  width: 150%; max-width: none; transform: translate(-42%, -50%);
}
.reservoir .contours path { stroke: var(--contour); stroke-width: 1.4; }
.reservoir .prod { fill: var(--ours); }
.reservoir .inj circle { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.reservoir .inj path { stroke: var(--ink); stroke-width: 2; }
.reservoir .inj.water circle { stroke: var(--bench); }
.reservoir .inj.water path { stroke: var(--bench); }

.map-key {
  position: absolute; right: 0; bottom: 0;
  font-size: 0.82rem; color: var(--muted);
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: flex-end;
}
.map-key span { display: inline-flex; align-items: center; gap: 6px; }
.map-key svg { width: 14px; height: 14px; }

/* One orchestrated moment: the wells light up in sequence on load. */
@media (prefers-reduced-motion: no-preference) {
  .reservoir .contours path { stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: draw 2.2s ease-out forwards; }
  .reservoir .wells > * { opacity: 0; animation: appear 0.4s ease-out forwards; }
  .reservoir .wells > *:nth-child(n) { animation-delay: calc(1.1s + var(--i, 0) * 70ms); }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; min-height: 0; }
  .hero-map { min-height: 260px; order: -1; margin: -24px calc(-1 * var(--gutter)) 0; overflow: hidden; }
  .reservoir { width: 115%; transform: translate(-50%, -50%); }
  .map-key { display: none; }
}

/* ------------------------------------------------------------------
   Sections
   ------------------------------------------------------------------ */
.section { padding: clamp(64px, 9vw, 112px) 0; border-bottom: 1px solid var(--rule); }
.section-head { max-width: var(--measure); margin-bottom: clamp(32px, 5vw, 56px); }
.section-head p { color: var(--muted); margin-top: 16px; font-size: 1.12rem; }

/* Why it is different: claim on the left, explanation on the right */
.contrasts { list-style: none; margin: 0; padding: 0; }
.contrasts li {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(16px, 4vw, 56px);
  padding: 32px 0; border-top: 1px solid var(--rule);
}
.contrasts li:last-child { border-bottom: 1px solid var(--rule); }
.contrasts h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }
.contrasts .not { display: block; color: var(--bench); font-weight: 500; margin-top: 4px; }
.contrasts p { margin: 0; color: var(--muted); max-width: 60ch; }
@media (max-width: 720px) { .contrasts li { grid-template-columns: 1fr; gap: 10px; } }

/* What you get */
.deliverables {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0 clamp(24px, 4vw, 56px);
}
.deliverables li { padding: 22px 0 22px 22px; border-top: 1px solid var(--rule); position: relative; }
.deliverables li::before {
  content: ""; position: absolute; left: 0; top: 33px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--ours);
}
.deliverables strong { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.deliverables span { color: var(--muted); }

/* Results */
.results { background: var(--surface); }
.results-grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 5vw, 72px); align-items: start;
}
.figures { margin: 0; }
.figures div { padding: 20px 0; border-top: 1px solid var(--rule); }
.figures div:first-child { border-top: 0; padding-top: 0; }
.figures dt {
  font-size: clamp(1.5rem, 2.6vw, 2.05rem); font-weight: 700; line-height: 1.15;
  letter-spacing: -0.02em; color: var(--ours);
}
.figures dt small { display: block; font-size: 0.62em; letter-spacing: -0.01em; margin-top: 4px; }
.figures dd { margin: 6px 0 0; color: var(--muted); }
.figure-frame {
  margin: 0; background: #fff; border: 1px solid var(--rule); border-radius: 8px;
  padding: clamp(10px, 2vw, 20px);
}
.figure-frame figcaption { color: #4c5f72; font-size: 0.92rem; margin-top: 10px; }
.results-note { color: var(--muted); font-size: 0.97rem; margin-top: 28px; max-width: var(--measure); }
.results-more { margin-top: 28px; }
@media (max-width: 900px) { .results-grid { grid-template-columns: 1fr; } }

/* How we work: a real sequence, so it is numbered */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.steps li { counter-increment: step; border-top: 3px solid var(--ink); padding-top: 18px; }
.steps li:first-child { border-top-color: var(--ours); }
.steps li::before { content: counter(step); display: block; font-weight: 700; font-size: 2.6rem; line-height: 1; color: var(--ours); margin-bottom: 14px; }
.steps h3 { margin-bottom: 8px; }
.steps p { color: var(--muted); margin: 0; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* For / About */
.two-up { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 6vw, 96px); }
.two-up h2 { font-size: clamp(1.4rem, 2.2vw, 1.75rem); margin-bottom: 14px; }
.two-up p { color: var(--muted); font-size: 1.12rem; max-width: 52ch; margin: 0; }
@media (max-width: 720px) { .two-up { grid-template-columns: 1fr; } }

/* Contact */
.contact { background: var(--ink); color: var(--paper); border-bottom: 0; }
.contact h2 { max-width: 20ch; }
.contact p { color: color-mix(in srgb, var(--paper) 78%, transparent); font-size: 1.12rem; margin: 20px 0 32px; }
.contact a:not(.button) { color: var(--paper); }
.contact .button { background: var(--paper); color: var(--ink); }
.contact-lines { list-style: none; margin: 20px 0 36px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 32px; font-size: 1.1rem; }

/* Footer */
.site-footer { padding: 36px 0 48px; color: var(--muted); font-size: 0.92rem; }
.site-footer .wrap { display: grid; gap: 10px; }
.site-footer p { margin: 0; max-width: 90ch; }
.site-footer .row { display: flex; flex-wrap: wrap; gap: 6px 24px; color: var(--ink); }

/* ------------------------------------------------------------------
   Case study page (long-form)
   ------------------------------------------------------------------ */
.article { padding: clamp(48px, 7vw, 88px) 0 clamp(64px, 9vw, 112px); }
.article .wrap { max-width: calc(var(--measure) + 2 * var(--gutter)); }
.article .crumb { font-size: 0.95rem; margin-bottom: 28px; display: inline-block; }
.article h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); letter-spacing: -0.025em; line-height: 1.08; margin-bottom: 28px; }
.article .summary { font-size: 1.2rem; line-height: 1.55; color: var(--ink); margin-bottom: 16px; }
.article .audience { color: var(--muted); }
.article h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); margin: 64px 0 18px; padding-top: 28px; border-top: 1px solid var(--rule); }
.article h3 { font-size: 1.25rem; margin: 44px 0 12px; }
.article h3 .n { color: var(--ours); margin-right: 6px; }
.article ul { padding-left: 1.2em; margin: 0 0 1em; }
.article li { margin-bottom: 0.4em; }
.article .figure-frame { margin: 28px 0 32px; }
.callout { background: var(--surface); border-left: 3px solid var(--ours); padding: 18px 22px; margin: 28px 0; }
.callout p:last-child { margin: 0; }
.assumptions { margin-top: 64px; padding: 4px 24px 12px; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; }
.assumptions summary { cursor: pointer; font-weight: 650; padding: 16px 0; font-size: 1.1rem; }
.assumptions ul { font-size: 0.97rem; color: var(--muted); }
.assumptions strong { color: var(--ink); }

.case-cta { margin-top: 64px; padding: 32px; background: var(--ink); color: var(--paper); border-radius: 8px; }
.case-cta h2 { margin: 0 0 10px; padding: 0; border: 0; font-size: 1.6rem; }
.case-cta p { color: color-mix(in srgb, var(--paper) 78%, transparent); }
.case-cta a:not(.button) { color: var(--paper); }
.case-cta .button { background: var(--paper); color: var(--ink); margin-top: 8px; }
.figure-frame.narrow { max-width: 560px; }

/* "Email copied" note, shown by assets/js/copy-email.js */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font: 500 15px/1.4 var(--font);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 100;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
