/* ============================================================
   Thirsty Machines — site polish layer
   Loaded after pipeline.css; overrides where surfaces overlap.
   Visual-only changes; no content or DOM restructuring.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&family=Instrument+Serif:ital@0;1&display=swap");

:root {
  /* Soft-blue page is intentionally preserved. Subtle warm/cool shifts
     across surface layers create a more refined 3-tier hierarchy:
     page (cool blue) → panel (true white) → elevated card. */
  --color-page: #dfe8f4;
  --color-page-grad-top: #e6edf6;
  --color-page-grad-bot: #d8e3f2;
  --color-card: #ffffff;
  --color-card-border: rgba(15, 32, 60, 0.08);
  --color-card-border-strong: rgba(15, 32, 60, 0.14);
  --color-card-shadow:
    0 1px 2px rgba(15, 32, 60, 0.04),
    0 8px 24px -8px rgba(15, 32, 60, 0.12),
    0 24px 48px -24px rgba(15, 32, 60, 0.08);
  --color-card-shadow-lifted:
    0 1px 2px rgba(15, 32, 60, 0.04),
    0 12px 32px -8px rgba(15, 32, 60, 0.16),
    0 32px 64px -24px rgba(15, 32, 60, 0.1);
  --radius-card: 18px;
  --radius-pill: 999px;

  --color-text: #0f1d36;
  --color-text-soft: #1f2d47;
  --color-eyebrow: #4a5878;
  --site-text-muted: #4a5878;
  --color-rule: rgba(15, 32, 60, 0.08);
  --color-link: #0a4ec8;

  --color-accent: var(--color-energy, #0072b2);

  /* Font system */
  --font-sans:
    "Geist", -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", "Source Serif Pro", Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --site-content-max: 960px;
  --site-content-wide: 1280px;
  --site-section-pad-y: 96px;
  --site-section-gap: 24px;

  --eyebrow-size: 11px;
  --eyebrow-tracking: 0.16em;
}

/* Pipeline.css sets body font; we override globally so Geist propagates
   into the C1 component for one consistent voice. */
html,
body {
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  background:
    radial-gradient(1100px 720px at 12% -10%, rgba(255, 255, 255, 0.7), transparent 60%),
    radial-gradient(900px 600px at 92% 8%, rgba(0, 114, 178, 0.06), transparent 55%),
    linear-gradient(180deg, var(--color-page-grad-top) 0%, var(--color-page) 22%, var(--color-page-grad-bot) 100%);
  background-attachment: fixed;
  color: var(--color-text);
  letter-spacing: -0.005em;
}

/* ---------- skip link ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--color-card-border);
  border-radius: 10px;
  box-shadow: var(--color-card-shadow);
  z-index: 1000;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
}

/* ---------- shell ---------- */

.site {
  max-width: var(--site-content-max);
  margin: 0 auto;
  padding: 56px 24px 96px;
  counter-reset: section-counter figure-counter finding-counter;
}

/* ============================================================
   Masthead
   ============================================================ */

.site-header {
  text-align: left;
  padding: 16px 0 32px;
  position: relative;
}

.site-header__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--eyebrow-size);
  letter-spacing: var(--eyebrow-tracking);
  text-transform: uppercase;
  color: var(--color-eyebrow);
  font-weight: 500;
  margin: 0 0 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.site-header__eyebrow::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(0, 114, 178, 0.12);
}

.site-header__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(36px, 5.2vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.018em;
  margin: 0 0 20px;
  color: var(--color-text);
  max-width: 22ch;
  text-wrap: balance;
}

.site-header__title em,
.site-header__title i {
  font-style: italic;
  color: var(--color-accent);
}

.site-header__subtitle {
  font-size: 18px;
  line-height: 1.55;
  margin: 0 0 28px;
  color: var(--site-text-muted);
  max-width: 56ch;
  font-weight: 400;
}

.site-header__accent {
  display: none; /* superseded by the rule below */
}

/* Replace the single accent bar with a three-metric ribbon that
   foreshadows the energy/water/carbon palette used throughout. */
.site-header::after {
  content: "";
  display: block;
  margin-top: 8px;
  width: 144px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    var(--color-energy, #0072b2) 0 33.3%,
    var(--color-water, #56b4e9) 33.3% 66.6%,
    var(--color-carbon, #d55e00) 66.6% 100%
  );
}

/* ============================================================
   Floating pill nav
   ============================================================ */

.site-nav {
  position: sticky;
  top: 16px;
  z-index: 50;
  margin: 32px auto 16px;
  padding: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  align-items: center;
  width: max-content;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 32, 60, 0.08);
  border-radius: 999px;
  box-shadow:
    0 1px 2px rgba(15, 32, 60, 0.04),
    0 10px 30px -10px rgba(15, 32, 60, 0.18);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
}

.site-nav a {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--site-text-muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0;
  transition: color 160ms ease, background-color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--color-text);
  background: rgba(15, 32, 60, 0.05);
  text-decoration: none;
}

.site-nav a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.site-nav a.is-active {
  color: #ffffff;
  background: var(--color-text);
}

/* ============================================================
   Sections
   ============================================================ */

.site-section {
  padding: var(--site-section-pad-y) 0;
  scroll-margin-top: 96px;
  position: relative;
}

.site-section + .site-section {
  border-top: 1px solid var(--color-rule);
}

/* Number every titled section. The hero/intro is unnumbered because it
   has no .site-section__heading. Counter increments live on the heading
   itself so unnumbered sections are skipped. */
.site-section__heading {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.012em;
  margin: 0 0 24px;
  color: var(--color-text);
  counter-increment: section-counter;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 18px;
  align-items: baseline;
  text-wrap: balance;
}

.site-section__heading::before {
  content: counter(section-counter, decimal-leading-zero);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  align-self: center;
  padding-top: 4px;
}

.site-section__lede {
  font-size: 18px;
  line-height: 1.65;
  margin: 0 0 28px;
  color: var(--color-text-soft);
  max-width: 62ch;
  font-weight: 400;
  text-wrap: pretty;
}

.site-section__commentary {
  font-size: 16px;
  line-height: 1.7;
  margin: 28px 0;
  color: var(--site-text-muted);
  max-width: 62ch;
  text-wrap: pretty;
}

.site-section__subheading {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1.25;
  font-weight: 400;
  margin: 40px 0 16px;
  color: var(--color-text);
  letter-spacing: -0.005em;
}

/* Hero/intro lede — slightly larger and warmer than section ledes. */
#hero .site-section__lede {
  font-size: 19px;
  line-height: 1.65;
  color: var(--color-text-soft);
  max-width: 64ch;
}

#hero {
  padding-top: 56px;
  padding-bottom: 56px;
}

/* ============================================================
   Techniques list (C7)
   ============================================================ */

.techniques-list {
  margin: 0 0 24px;
  padding: 0;
  max-width: 64ch;
  list-style: none;
  counter-reset: tech-counter;
  display: grid;
  gap: 14px;
}

.techniques-list > li {
  font-size: 15px;
  line-height: 1.65;
  color: var(--site-text-muted);
  position: relative;
  padding: 16px 18px 16px 56px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--color-rule);
  border-radius: 12px;
  counter-increment: tech-counter;
}

.techniques-list > li::before {
  content: counter(tech-counter, decimal-leading-zero);
  position: absolute;
  left: 18px;
  top: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--color-accent);
}

.techniques-list strong {
  color: var(--color-text);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

/* ============================================================
   Links
   ============================================================ */

.prose-link {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(10, 78, 200, 0.35);
  transition: text-decoration-color 160ms ease;
}

.prose-link:hover,
.prose-link:focus-visible {
  text-decoration-thickness: 1px;
  text-decoration-color: var(--color-link);
}

/* ============================================================
   Cards / panels
   ============================================================ */

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

.c1-stack {
  display: grid;
  gap: 20px;
  margin-top: 8px;
}

/* ============================================================
   Tableau embeds — auto figure counters + refined chrome
   ============================================================ */

.tableau-embed {
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--color-card-shadow);
  padding: 14px 14px 18px;
  min-width: 320px;
  overflow-x: auto;
  counter-increment: figure-counter;
  position: relative;
}

.tableau-embed::before {
  content: "Fig. " counter(figure-counter, decimal-leading-zero) " — Tableau";
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-eyebrow);
  padding: 6px 8px 12px;
}

.tableau-embed iframe {
  display: block;
  width: 100%;
  border: 0;
  border-radius: calc(var(--radius-card) - 6px);
  background: #fafbfc;
}

.tableau-embed + .tableau-embed {
  margin-top: 28px;
}

@media (min-width: 1024px) {
  .tableau-embed,
  .c1-stack {
    --bleed-max: min(1400px, calc(100vw - 48px));
    width: var(--bleed-max);
    margin-left: calc((100% - var(--bleed-max)) / 2);
    margin-right: 0;
  }
  .tableau-embed--c5 {
    min-height: 1100px;
  }
  .tableau-embed--c5 iframe {
    width: 1650px;
    height: 1080px;
  }
}

/* ============================================================
   Static figures (C7 PNGs)
   ============================================================ */

.figure-static {
  margin: 0 0 28px;
  counter-increment: figure-counter;
  position: relative;
}

.figure-static::before {
  content: "Fig. " counter(figure-counter, decimal-leading-zero);
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-eyebrow);
  margin-bottom: 10px;
}

.figure-static img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--color-card-border);
  box-shadow: var(--color-card-shadow);
}

.figure-static figcaption {
  font-size: 14px;
  line-height: 1.55;
  margin-top: 12px;
  color: var(--site-text-muted);
  max-width: 62ch;
  font-style: italic;
}

/* ============================================================
   Findings — bold serif numerals, generous cards
   ============================================================ */

.findings-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 20px;
  counter-reset: finding-counter;
}

.findings-list > li {
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--color-card-shadow);
  padding: 32px 36px 32px 36px;
  display: grid;
  grid-template-columns: minmax(78px, 92px) 1fr;
  gap: 8px 28px;
  counter-increment: finding-counter;
  align-items: start;
  position: relative;
  overflow: hidden;
  transition: transform 240ms ease, box-shadow 240ms ease;
}

.findings-list > li:hover {
  transform: translateY(-1px);
  box-shadow: var(--color-card-shadow-lifted);
}

.findings-list > li::before {
  content: counter(finding-counter, decimal-leading-zero);
  grid-row: 1 / span 2;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 64px;
  line-height: 0.9;
  color: var(--color-accent);
  letter-spacing: -0.02em;
  align-self: start;
}

.findings-list h3 {
  font-family: var(--font-sans);
  font-size: 19px;
  margin: 0 0 8px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text);
  letter-spacing: -0.005em;
}

.findings-list p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--site-text-muted);
  grid-column: 2;
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--color-rule);
  padding: 40px 0 24px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--site-text-muted);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 24px;
  align-items: start;
}

.site-footer p {
  margin: 0;
}

.site-footer p:nth-child(1) {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 17px;
  color: var(--color-text);
  grid-column: 1;
  grid-row: 1;
}

.site-footer p:nth-child(2) {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-eyebrow);
  grid-column: 1;
  grid-row: 2;
}

.site-footer p:nth-child(3) {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-eyebrow);
  grid-column: 1;
  grid-row: 3;
}

.site-footer p:nth-child(4) {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: end;
  text-align: right;
}

.site-footer a {
  color: var(--color-link);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================================
   Utility
   ============================================================ */

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

.placeholder {
  display: block;
  border: 1px dashed rgba(15, 32, 60, 0.2);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  padding: 18px 20px;
  font-size: 14px;
  color: var(--site-text-muted);
}

.placeholder__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: #b91c1c;
  background: #fee2e2;
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 8px;
  vertical-align: 1px;
}

/* ============================================================
   C1 component refinements (overrides on pipeline.css)
   These are typography-only and keep the component's structure
   intact. Buttons / counters / pipeline SVG behaviour unchanged.
   ============================================================ */

.pipeline__title {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.012em;
  font-size: 34px;
  line-height: 1.1;
}

.pipeline__subtitle {
  font-size: 16.5px;
  color: var(--site-text-muted);
}

.header-eyebrow {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--color-eyebrow);
}

.counter__number {
  font-family: var(--font-sans);
  font-feature-settings: "tnum", "ss01";
  font-weight: 600;
  letter-spacing: -0.025em;
}

.counter__label {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.12em;
}

.btn {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0;
  border-color: rgba(15, 32, 60, 0.12);
  transition:
    background-color 140ms ease,
    color 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.btn:hover {
  background: rgba(15, 32, 60, 0.04);
}

.btn.is-selected {
  background: var(--color-text);
  border-color: var(--color-text);
}

.btn--send {
  font-weight: 600;
  letter-spacing: 0;
  box-shadow: 0 6px 16px -6px rgba(0, 114, 178, 0.5);
}

.btn--send:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -6px rgba(0, 114, 178, 0.55);
}

.controls__legend {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--color-eyebrow);
}

.viz-column__caption {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.12em;
  font-size: 10.5px;
  color: var(--color-eyebrow);
}

.insight {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 17px;
  color: var(--color-text-soft);
  line-height: 1.55;
}

.insight::before {
  font-family: var(--font-sans);
  color: var(--color-accent);
  font-weight: 600;
}

/* Pipeline.css panel — refine border + shadow to match site rhythm */
.panel {
  border-color: var(--color-card-border);
  box-shadow: var(--color-card-shadow);
  border-radius: var(--radius-card);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1023px) {
  .site-nav {
    position: sticky;
    top: 12px;
  }
}

@media (max-width: 768px) {
  .site {
    padding: 32px 18px 64px;
  }
  :root {
    --site-section-pad-y: 56px;
  }
  .site-header {
    padding: 8px 0 24px;
  }
  .site-header__title {
    font-size: 34px;
  }
  .site-header__subtitle {
    font-size: 16.5px;
  }
  .site-section__heading {
    font-size: 26px;
    grid-template-columns: auto 1fr;
    gap: 0 14px;
  }
  .site-section__subheading {
    font-size: 20px;
  }
  .site-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: 100%;
    margin: 24px 0 8px;
    padding: 6px 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar {
    display: none;
  }
  .site-nav a {
    font-size: 12.5px;
    padding: 7px 12px;
  }
  .tableau-embed,
  .c1-stack {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  .tableau-embed iframe {
    height: 720px;
  }
  .tableau-embed--c5 {
    min-height: 0;
  }
  .tableau-embed--c5 iframe {
    width: 100%;
    height: 720px;
  }
  .findings-list > li {
    padding: 24px 22px;
    grid-template-columns: 56px 1fr;
    gap: 4px 18px;
  }
  .findings-list > li::before {
    font-size: 44px;
  }
  .site-footer {
    grid-template-columns: 1fr;
  }
  .site-footer p:nth-child(4) {
    grid-column: 1;
    grid-row: auto;
    text-align: left;
    align-self: start;
    margin-top: 8px;
  }
  .techniques-list {
    padding-left: 0;
  }
  .techniques-list > li {
    padding: 14px 16px 14px 48px;
  }
  .techniques-list > li::before {
    left: 16px;
    top: 16px;
  }
}

@media (max-width: 480px) {
  .site-header__title {
    font-size: 28px;
  }
  .site-section__heading {
    font-size: 22px;
  }
  .site-section__subheading {
    font-size: 18px;
  }
  .findings-list h3 {
    font-size: 17px;
  }
  .findings-list > li::before {
    font-size: 38px;
  }
  .site-footer {
    font-size: 12.5px;
  }
}