:root {
  --ink: #0c1219;
  --ink-soft: #2a3642;
  --muted: #5c6d7c;
  --line: #b7c5d0;
  --paper: #eef3f6;
  --paper-deep: #d5e0e8;
  --surface: #f7fafc;
  --accent: #102b56;
  --accent-ink: #0a1c38;
  --accent-warm: #c09450;
  --header-h: 4.25rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Syne", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
}

.skip:focus {
  top: 1rem;
}

/* ——— Header ——— */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  transition: background 0.3s ease;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.08rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.logo-mark {
  width: auto;
  height: 1.05em;
  flex-shrink: 0;
  display: block;
  /* Optical align: wave M sits a touch high vs Syne baseline */
  transform: translateY(0.02em);
}

.logo-word {
  line-height: 1;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
}

.nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
}

.nav a:hover {
  color: var(--ink);
}

.nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent-warm);
  text-underline-offset: 0.45em;
}

.nav-toggle {
  display: none;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: 500 0.9rem var(--font-body);
  cursor: pointer;
}

/* Six links don't fit on a phone: fold them into a panel under the header */
@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem clamp(1.25rem, 4vw, 3rem) 1rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }

  .site-header.is-open .nav {
    display: flex;
  }

  .nav a {
    padding: 0.8rem 0;
    font-size: 1rem;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  }

  .nav .nav-cta {
    margin-top: 0.75rem;
    text-align: center;
  }
}

.nav-cta {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--ink);
  color: var(--ink) !important;
}

.nav-cta:hover {
  background: var(--ink);
  color: var(--paper) !important;
}

/* Plain layout: the routes show at full strength behind the hero and soften once the
   visitor scrolls on, so they never run through section copy */
.hero-mesh .routes,
.hero-mesh .nodes,
.hero-mesh .grid {
  transition: opacity 0.8s ease;
}

html.past-hero:not(.scene-on) .hero-mesh .routes,
html.past-hero:not(.scene-on) .hero-mesh .nodes {
  opacity: 0.16;
}

html.past-hero:not(.scene-on) .hero-mesh .grid {
  opacity: 0.18;
}

/* Hero in the plain layout: as large as the scroll scene's opening frame, with a short
   load-in (wordmark, then headline, then the rest) */
html:not(.scene-on) .hero-copy {
  max-width: 54rem;
}

html:not(.scene-on) .brand-lockup {
  font-size: clamp(3.4rem, 10.5vw, 7.75rem);
  margin-bottom: 1.1rem;
  animation: hero-in 1s var(--ease) both;
}

html:not(.scene-on) .headline {
  font-size: clamp(1.8rem, 3.8vw, 2.9rem);
}

html:not(.scene-on) .lede {
  max-width: 38rem;
  font-size: clamp(1.08rem, 1.4vw, 1.3rem);
}

html:not(.scene-on) .layer-hero .btn-briefing {
  width: min(100%, 24rem);
  min-height: 3.9rem;
  font-size: 1.15rem;
}

html:not(.scene-on) .hero-reveal[data-reveal="1"] {
  animation: hero-in 1s 0.35s var(--ease) both;
}

html:not(.scene-on) .hero-reveal[data-reveal="2"] {
  animation: hero-in 1s 0.7s var(--ease) both;
}

html:not(.scene-on) .scroll-cue {
  animation: hero-in 1s 1.2s var(--ease) both;
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* Desktop plain layout: What we do fills a screen like the other sections */
@media (min-width: 981px) {

  html:not(.scene-on) .what-points li {
    padding: clamp(2rem, 6vh, 3.5rem) 0;
  }

  html:not(.scene-on) .what-points h3 {
    font-size: clamp(1.9rem, 3.4vw, 3.4rem);
  }

  html:not(.scene-on) .what-points p {
    font-size: clamp(1.05rem, 1.35vw, 1.3rem);
  }
}

/* Desktop: each section fills one screen and the browser's own scroll snapping (CSS only, no
   script) lands every scroll on a whole section. Phones and short windows scroll freely. */
@media (min-width: 981px) and (min-height: 640px) {
  /* Home page only: other pages have no sections, so their only snap point would be the
     footer and every page would jump to the bottom */
  html.home:not(.scene-on) {
    scroll-snap-type: y mandatory;
  }

  html.home:not(.scene-on) .layer {
    scroll-snap-align: start;
  }

  html.home:not(.scene-on) .site-footer {
    scroll-snap-align: end;
  }

  html:not(.scene-on) .what {
    display: flex;
    align-items: center;
    min-height: 100svh;
    padding-top: calc(var(--header-h) + clamp(1.5rem, 4vh, 3rem));
    padding-bottom: clamp(1.5rem, 4vh, 3rem);
  }
}

/* Section fade-ups (main.js adds .reveal, then .is-in when in view) */
.reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* Small corner switch for visitors who prefer a plain scroll */
.motion-toggle {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  z-index: 40;
  padding: 0.4rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: color-mix(in srgb, var(--paper) 75%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  backdrop-filter: blur(6px);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.motion-toggle.is-tucked {
  opacity: 0;
  pointer-events: none;
}

.motion-toggle:hover,
.motion-toggle:focus-visible {
  opacity: 1;
  color: var(--ink);
  border-color: var(--ink);
}

.motion-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ——— Scene: hero, What we do and Recent work over one pinned mesh ———
   Default (phones, reduced motion, no JS): the three layers stack as normal
   sections. With html.scene-on, the pin holds one screen and main.js fades the
   layers through it from scroll position. */

.scene {
  position: relative;
  isolation: isolate;
  overflow: clip;
}

.scene-pin {
  position: relative;
}

/* Stacked layout: one screen of mesh pinned behind the sections as they scroll */
.field-plane {
  position: sticky;
  top: 0;
  z-index: -1;
  height: 100svh;
  margin-bottom: -100svh;
  overflow: hidden;
}

.scene-on .field-plane {
  position: absolute;
  inset: 0;
  height: auto;
  margin-bottom: 0;
}

.hero-mesh {
  width: 100%;
  height: 100%;
}

.layer {
  position: relative;
  padding-left: clamp(1.5rem, 4vw, 3.75rem);
  padding-right: clamp(1.5rem, 4vw, 3.75rem);
}

.scene-on .scene {
  /* 1 screen pinned + SCENE_SCREENS of scroll (main.js); keep the two in step */
  height: 1415vh;
}

.scene-on .scene-pin {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}

.scene-on .layer {
  position: absolute;
  inset: 0;
  min-height: 0;
  will-change: opacity, transform;
}

/* Hidden until main.js scrubs them in */
.scene-on .what,
.scene-on .work,
.scene-on .tools,
.scene-on .founder,
.scene-on .closing,
.scene-on .hero-reveal {
  opacity: 0;
}

.scene-on .what,
.scene-on .work,
.scene-on .tools,
.scene-on .founder,
.scene-on .closing {
  visibility: hidden;
}

/* ——— Hero: brand, then headline, then lede + briefing ——— */

.layer-hero {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding-top: calc(var(--header-h) + 1rem);
  padding-bottom: 3rem;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 44rem;
  text-align: center;
  will-change: transform;
}

.hero-reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: opacity, transform;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 0.9rem;
  max-width: 100%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 9vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
  color: var(--ink);
  transform-origin: 50% 60%;
  will-change: transform;
}

.hero-logo {
  display: block;
  width: auto;
  height: 0.78em;
  flex-shrink: 0;
  transform: translateY(0.04em);
}

.brand-rest {
  line-height: 1;
}

.headline {
  margin: 0;
  max-width: 16ch;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink-soft);
  text-wrap: balance;
}

.lede {
  margin: 1.4rem 0 1.6rem;
  max-width: 32rem;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.btn-briefing {
  min-height: 3.7rem;
  padding: 1rem 1.8rem;
  width: min(100%, 22rem);
  font-size: 1.12rem;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.75rem;
  display: inline-flex;
  gap: 0.5rem;
  margin: 0;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.scroll-cue span {
  animation: nudge 2.2s var(--ease) infinite;
}

@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(0.3rem); }
}

@media (max-width: 980px) {
  html:not(.scene-on) .scroll-cue {
    display: none;
  }
}

/* ——— What we do ——— */

.what {
  padding-top: clamp(4rem, 12vh, 7rem);
  padding-bottom: clamp(4rem, 12vh, 7rem);
}

.what-inner {
  width: 100%;
}

.what .eyebrow {
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}

.what-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 5vw, 4.5rem);
  border-top: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
}

.what-points li {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr);
  align-content: center;
  gap: 0 1rem;
  padding: clamp(1.5rem, 3.5vh, 2.25rem) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  will-change: opacity, transform;
}

.what-code {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent-warm);
  padding-top: 0.6rem;
}

/* Line icon under each number: navy strokes with a gold accent, like the background routes */
.what-icon {
  display: block;
  width: 3.75rem;
  height: 3.75rem;
  margin-top: 0.7rem;
  color: var(--accent);
  opacity: 0.85;
}

.what-icon .g,
.line-icon .g {
  stroke: var(--accent-warm);
}

.what-icon circle.g,
.line-icon circle.g {
  fill: var(--accent-warm);
}

/* Line icons beside the Models & data titles and the Work with us options */
.line-icon {
  display: block;
  flex-shrink: 0;
  color: var(--accent);
  opacity: 0.85;
}

.tools-title {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.tools-icon {
  width: 3.3rem;
  height: 3.3rem;
}

.closing-options li {
  grid-template-columns: 3.25rem minmax(0, 1fr);
  column-gap: 1.1rem;
  align-items: center;
}

.closing-icon {
  grid-row: 1 / span 2;
  width: 3rem;
  height: 3rem;
}

.closing-options h3,
.closing-options p {
  grid-column: 2;
}

.what-points h3 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.8vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.what-points p {
  margin: 0;
  max-width: 32rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* In the scene the grid stretches to the screen, so the four points fill it */
.scene-on .what {
  display: flex;
  padding-top: calc(var(--header-h) + clamp(1.5rem, 5vh, 3rem));
  padding-bottom: clamp(2rem, 7vh, 4rem);
}

.scene-on .what-inner {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.scene-on .what-points {
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.scene-on .what-points h3 {
  font-size: clamp(1.9rem, 3.4vw, 3.4rem);
}

.scene-on .what-points p {
  font-size: clamp(1.05rem, 1.35vw, 1.3rem);
}

.scene-on .what-code {
  font-size: 1.1rem;
  padding-top: 0.9rem;
}

@media (max-width: 980px) {
  .what-points {
    grid-template-columns: 1fr;
  }

  .what-points li {
    grid-template-columns: 3.75rem minmax(0, 1fr);
  }

  .what-icon {
    width: 2.75rem;
    height: 2.75rem;
  }
}

/* ——— Recent work: full screen, same background as the hero ——— */

.work {
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding-top: calc(var(--header-h) + clamp(2rem, 5vh, 3.5rem));
  padding-bottom: clamp(3rem, 7vh, 5rem);
}

.work-inner {
  width: 100%;
}

.work-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.6rem 2rem;
  margin-bottom: clamp(1.75rem, 4vh, 3rem);
}

.work-head .eyebrow {
  margin: 0;
  font-size: 0.88rem;
}

.work-head h2 {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 4.6vw, 4.75rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: var(--ink);
}

.work-all {
  padding-bottom: 0.3rem;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-warm);
  white-space: nowrap;
}

.work-all:hover {
  color: var(--accent);
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 1.6vw, 1.5rem);
  /* Size to what the viewport has left after the heading, so the section reads as one screen */
  height: clamp(26rem, calc(100svh - 22.5rem), 48rem);
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.work-grid.is-in {
  opacity: 1;
  transform: none;
}

.work-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: color-mix(in srgb, #fff 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent);
  /* --in is scrubbed by the scroll scene (0..1); --dim and --lift come from hover */
  opacity: calc(var(--in, 1) * var(--dim, 1));
  transform: translateY(calc((1 - var(--in, 1)) * 2rem + var(--lift, 0px)));
  transition:
    opacity 0.25s var(--ease),
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.3s var(--ease);
}

.work-card.is-lead {
  grid-row: 1 / span 2;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
}

.work-media {
  min-height: 0;
  overflow: hidden;
  background: var(--paper-deep);
  border-right: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.work-card.is-lead .work-media {
  border-right: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.work-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.work-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  padding: clamp(1.1rem, 1.8vw, 1.6rem);
}

.work-card.is-lead .work-body {
  padding: clamp(1.4rem, 2.2vw, 2rem);
}

.work-meta {
  display: flex;
  gap: 0.9rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.work-type {
  color: var(--accent-warm);
}

.work-date {
  color: var(--muted);
}

.work-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 1.9vw, 1.75rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.work-card.is-lead .work-title {
  font-size: clamp(1.8rem, 3vw, 2.75rem);
}

.work-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

.work-open {
  margin-top: auto;
  padding-top: 0.4rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent);
}

/* Fewer than three items (desktop): one fills the grid with picture and text side by side;
   with two, the second takes the whole right column */
@media (min-width: 981px) {
  .work-grid[data-count="1"] .work-card.is-lead {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    grid-template-rows: none;
  }

  .work-grid[data-count="1"] .work-card.is-lead .work-media {
    border-bottom: 0;
    border-right: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  }

  .work-grid[data-count="1"] .work-card.is-lead .work-body {
    justify-content: center;
  }

  .work-grid[data-count="2"] .work-card:not(.is-lead) {
    grid-row: 1 / span 2;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .work-grid[data-count="2"] .work-card:not(.is-lead) .work-media {
    border-right: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  }
  /* Two cards share the height, so keep the text compact and leave room for the pictures */
  .work-grid[data-count="2"] {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  }

  .work-grid[data-count="2"] .work-card.is-lead .work-title {
    font-size: clamp(1.45rem, 2.05vw, 2.25rem);
  }

  .work-grid[data-count="2"] .work-card .work-body {
    gap: 0.45rem;
    padding: clamp(1.1rem, 1.7vw, 1.75rem);
  }

  .work-grid[data-count="2"] .work-card .work-summary {
    font-size: 0.95rem;
  }
}

/* Before any report is published: one panel across the whole grid */
.work-card.work-soon {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1.1rem;
  padding: clamp(1.75rem, 5vw, 4rem);
  background:
    linear-gradient(120deg, color-mix(in srgb, #fff 92%, transparent), color-mix(in srgb, #fff 70%, transparent));
}

.work-soon .soon > .btn {
  justify-self: start;
}

.soon-badge {
  margin: 0;
}

.work-soon .work-title {
  font-size: clamp(2rem, 3.6vw, 3.25rem);
}

.work-soon .work-summary {
  max-width: 40rem;
  font-size: clamp(1.02rem, 1.3vw, 1.2rem);
}

.work-soon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

/* No hover dimming on the single panel */
.work-grid:hover .work-card.work-soon {
  --dim: 1;
}

/* Hover: light the card under the cursor, dim the rest */
.work-grid:hover .work-card {
  --dim: 0.45;
}

.work-grid:hover .work-card:hover,
.work-grid .work-card:focus-visible {
  --dim: 1;
  --lift: -2px;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--ink) 12%, transparent);
}

.work-card:hover .work-media img {
  transform: scale(1.03);
}

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

@media (max-width: 980px) {
  .work {
    min-height: 0;
  }

  .work-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    height: auto;
  }

  .work-card,
  .work-card.is-lead {
    grid-row: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .work-media,
  .work-card.is-lead .work-media {
    aspect-ratio: 16 / 9;
    border-right: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  }
}

/* ——— Models & data: two panels linking to the full pages ——— */

.tools {
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding-top: calc(var(--header-h) + clamp(2rem, 5vh, 3.5rem));
  padding-bottom: clamp(3rem, 7vh, 5rem);
}

.tools-inner {
  width: 100%;
}

.tools-head {
  margin-bottom: clamp(1.75rem, 4vh, 3rem);
  will-change: opacity, transform;
}

.tools-head .eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.88rem;
}

.tools-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 4.6vw, 4.75rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: var(--ink);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 1.6vw, 1.5rem);
  /* Same sizing as the publications grid, so the screen reads as full */
  min-height: clamp(24rem, calc(100svh - 22.5rem), 46rem);
}

.tools-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: clamp(1.4rem, 2.4vw, 2.25rem);
  text-decoration: none;
  color: inherit;
  background: color-mix(in srgb, #fff 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent);
  /* Same mechanics as .work-card: --in from the scroll scene, --dim and --lift from hover */
  opacity: calc(var(--in, 1) * var(--dim, 1));
  transform: translateY(calc((1 - var(--in, 1)) * 2rem + var(--lift, 0px)));
  will-change: opacity, transform;
  transition:
    opacity 0.25s var(--ease),
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.3s var(--ease);
}

/* Hover: light the panel under the cursor, dim the other */
.tools-grid:hover .tools-card {
  --dim: 0.45;
}

.tools-grid:hover .tools-card:hover,
.tools-grid .tools-card:focus-visible {
  --dim: 1;
  --lift: -2px;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--ink) 12%, transparent);
}

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

.live-badge {
  color: #6b4a14;
  border-color: color-mix(in srgb, var(--accent-warm) 70%, transparent);
  background: color-mix(in srgb, var(--accent-warm) 12%, transparent);
}

.tools-card .soon-badge {
  align-self: flex-start;
  margin: 0;
}

.tools-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.tools-text {
  margin: 0;
  max-width: 34rem;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.55;
}

.tools-list {
  display: grid;
  gap: 0;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

.tools-list li {
  padding: 0.7rem 0;
  color: var(--muted);
  font-size: 0.98rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

.tools-open {
  margin-top: auto;
  padding-top: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent);
}

@media (max-width: 980px) {
  .tools {
    min-height: 0;
  }

  .tools-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}

/* ——— Founder: last screen of the scene ——— */

.founder {
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding-top: calc(var(--header-h) + clamp(2rem, 5vh, 3.5rem));
  padding-bottom: clamp(3rem, 7vh, 5rem);
}

.founder-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  width: 100%;
}

.founder-photo {
  justify-self: end;
  width: 100%;
  /* 5:6 frame, sized so the photo always fits the window height */
  max-width: min(30rem, calc((100svh - var(--header-h) - 9rem) * 5 / 6));
  margin: 0;
  will-change: opacity, transform;
}

.founder-photo img {
  display: block;
  width: 100%;
  height: auto; /* the width/height attributes are only there to reserve space while loading */
  aspect-ratio: 5 / 6;
  object-fit: cover;
  object-position: 50% 35%;
  /* Soft edges: the photo fades gently into the background on every side */
  -webkit-mask-image:
    linear-gradient(to right, rgba(0,0,0,0.55) 0, #000 2.5%, #000 97.5%, rgba(0,0,0,0.55) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.55) 0, #000 2.5%, #000 97.5%, rgba(0,0,0,0.55) 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, rgba(0,0,0,0.55) 0, #000 2.5%, #000 97.5%, rgba(0,0,0,0.55) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.55) 0, #000 2.5%, #000 97.5%, rgba(0,0,0,0.55) 100%);
  mask-composite: intersect;
}

.founder-copy {
  max-width: 46rem;
  will-change: opacity, transform;
}

.founder-copy .eyebrow {
  font-size: 0.88rem;
}

.founder-copy h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.25rem, 2rem + 2.2vh, 4rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: var(--ink);
}

.founder-role {
  margin: 0 0 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--accent-warm);
}

.founder-bio {
  display: grid;
  gap: 0.85em;
  margin: 0 0 1.75rem;
  color: var(--ink-soft);
  /* Three paragraphs have to fit beside the portrait on one screen */
  font-size: clamp(1rem, 0.3rem + 1.5vh, 1.3rem);
  line-height: 1.55;
}

.founder-bio p {
  margin: 0;
  will-change: opacity, transform;
}

.founder .btn-briefing {
  width: auto;
}

@media (max-width: 980px) {
  .founder {
    min-height: 0;
  }

  .founder-inner {
    grid-template-columns: 1fr;
  }

  .founder-photo {
    justify-self: start;
    max-width: 18rem;
  }
}

/* ——— Work with us: closing screen of the scene ——— */

.closing {
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding-top: calc(var(--header-h) + clamp(2rem, 5vh, 3.5rem));
  padding-bottom: clamp(3rem, 7vh, 5rem);
}

.closing-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  width: 100%;
}

.closing-copy {
  will-change: opacity, transform;
}

.closing-copy .eyebrow {
  font-size: 0.88rem;
}

.closing-copy h2 {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 4.6vw, 4.75rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: var(--ink);
  text-wrap: balance;
}

.closing-summary {
  margin: 0 0 2rem;
  max-width: 32rem;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.3vw, 1.25rem);
  line-height: 1.6;
}

.closing-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}

.closing .btn-briefing {
  width: auto;
}

.closing-email {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent);
  user-select: all;
}

.closing-options {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
}

.closing-options li {
  display: grid;
  gap: 0.35rem;
  padding: clamp(1.1rem, 3vh, 1.75rem) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  will-change: opacity, transform;
}

.closing-options h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.closing-options p {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.15vw, 1.1rem);
}

@media (max-width: 980px) {
  .closing {
    min-height: 0;
  }

  .closing-inner {
    grid-template-columns: 1fr;
  }
}

/* ——— Databases page: dataset entries ——— */

.dataset {
  display: grid;
  gap: 1.5rem;
  margin-top: clamp(2rem, 5vw, 3rem);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  max-width: 56rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, #fff 80%, transparent);
}

.dataset .dataset-head h2 {
  margin: 0.4rem 0 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.dataset-status {
  display: inline-block;
  margin: 0;
  padding: 0.3rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}

.dataset-sub {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent-warm);
}

.dataset-text {
  margin: 0;
  max-width: 44rem;
  color: var(--ink-soft);
  font-size: 1.08rem;
  line-height: 1.6;
}

.dataset-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dataset-facts div {
  display: grid;
  align-content: start;
  gap: 0.3rem;
  padding: 1rem 1rem 1rem 0;
}

.dataset-facts div + div {
  padding-left: 1rem;
  border-left: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

.dataset-facts dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.dataset-facts dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.dataset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dataset-note {
  margin: 0;
  padding-left: 1rem;
  max-width: 46rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  border-left: 2px solid var(--accent-warm);
}

.dataset-note strong {
  color: var(--ink-soft);
}

.dataset-note a {
  color: var(--accent);
}

.dataset-more {
  margin: 1.75rem 0 0;
  max-width: 46rem;
  color: var(--muted);
}

@media (max-width: 760px) {
  .dataset-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dataset-facts div,
  .dataset-facts div + div {
    padding: 0.85rem 0.75rem 0.85rem 0;
    border-left: 0;
  }

  .dataset-facts div:nth-child(even) {
    padding-left: 0.75rem;
    border-left: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  }
}

/* Databases section: the list of databases on /databases/ */
.dataset-list {
  display: grid;
  gap: 1.25rem;
  margin: clamp(2rem, 5vw, 3rem) 0 0;
  padding: 0;
  max-width: 62rem;
  list-style: none;
}

.dataset-list .dataset {
  margin-top: 0;
}

/* Databases section: full-screen background graphic, footer pinned to the bottom of short pages,
   and a larger entry while the list holds a single database */
.data-plane {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.data-plane img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: right center;
}

/* Narrow screens: the stack sits behind the heading, so keep it faint */
@media (max-width: 980px) {
  .data-plane img {
    opacity: 0.3;
  }
}

body:has(.section-databases) {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  background: transparent;
}

body:has(.section-databases) main {
  flex: 1;
}

.section-databases .reports-hero {
  padding-bottom: clamp(3rem, 8vh, 6rem);
}

.section-databases .dataset {
  background: color-mix(in srgb, #fff 82%, transparent);
  backdrop-filter: blur(4px);
  box-shadow: 0 18px 50px color-mix(in srgb, var(--ink) 8%, transparent);
}

/* One database: scale the entry up to hold the screen */
.dataset-list > li:only-child .dataset {
  max-width: 62rem;
  gap: 1.75rem;
  padding: clamp(1.75rem, 4.5vw, 3.5rem);
}

.dataset-list > li:only-child .dataset .dataset-head h2 {
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
}

.dataset-list > li:only-child .dataset-text {
  font-size: clamp(1.08rem, 1.3vw, 1.25rem);
}

.dataset-list > li:only-child .dataset-facts dd {
  font-size: clamp(1.2rem, 1.9vw, 1.65rem);
}

.dataset-facts dd {
  white-space: nowrap;
}

.dataset-list > li:only-child .dataset-facts div {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

/* "View more": the panel grows from zero height to its content, smoothly */
.dataset-more-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.5s var(--ease),
    opacity 0.35s ease;
}

.dataset-more-panel.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.dataset-more-inner {
  display: grid;
  gap: 1.5rem;
  min-height: 0;
  overflow: hidden;
}

/* keep the panel's first item clear of the buttons once open */
.dataset-more-panel.is-open .dataset-more-inner {
  padding-top: 0.5rem;
}

.dataset-includes h3 {
  margin: 0 0 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.dataset-includes ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

.dataset-includes li {
  padding: 0.65rem 0;
  color: var(--ink-soft);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

.dataset-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 0;
}

.dataset-links a {
  font-weight: 600;
  color: var(--accent);
}

.dataset-toggle {
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .dataset-more-panel {
    transition: none;
  }
}

/* ——— Explore the OCGE Database (/databases/explore/) ——— */

.explore-page {
  padding-left: clamp(1.25rem, 4vw, 3rem);
  padding-right: clamp(1.25rem, 4vw, 3rem);
  padding-bottom: clamp(3rem, 8vh, 5rem);
  background:
    radial-gradient(120% 70% at 75% 0%, color-mix(in srgb, var(--paper-deep) 70%, transparent) 0%, transparent 70%),
    var(--paper);
}

.explore-intro.section {
  padding: clamp(2.5rem, 6vh, 4rem) 0 clamp(1.5rem, 3vh, 2rem);
}

.explore-intro h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.explore-caveat {
  margin: 1.25rem 0 0;
  padding: 0.75rem 1rem;
  max-width: 52rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-soft);
  border-left: 2px solid var(--accent-warm);
  background: color-mix(in srgb, #fff 65%, transparent);
}

.explore-caveat a {
  color: var(--accent);
}

.explore-report {
  display: block;
  margin-top: 0.5rem;
}

.explore-caveat strong {
  color: var(--ink);
}

.explore-intro .section-lede a {
  color: var(--accent);
}

/* Globe + control panel */
.explore-globe {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem);
  gap: clamp(1rem, 2vw, 1.5rem);
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}

.globe-stage {
  position: relative;
  height: clamp(420px, 72vh, 780px);
  border: 1px solid var(--line);
  background:
    radial-gradient(closest-side, color-mix(in srgb, #fff 55%, transparent), transparent),
    color-mix(in srgb, var(--paper-deep) 55%, var(--paper));
  overflow: hidden;
}

.globe-stage canvas {
  display: block;
  touch-action: none;
  cursor: grab;
}

.globe-stage canvas:active {
  cursor: grabbing;
}

.globe-hint {
  position: absolute;
  left: 1rem;
  bottom: 0.8rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.globe-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
}

.globe-tip {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 0.15rem;
  padding: 0.5rem 0.7rem;
  max-width: 16rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: color-mix(in srgb, #fff 94%, transparent);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--ink) 12%, transparent);
  pointer-events: none;
}

.globe-tip[hidden],
.globe-status[hidden],
.fs-detail[hidden] {
  display: none;
}

.globe-tip strong {
  color: var(--ink);
}

.globe-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, #fff 80%, transparent);
}

.globe-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--ink);
}

.globe-mode {
  padding: 0.6rem 0.5rem;
  font: 600 0.92rem var(--font-body);
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.globe-mode.is-active {
  color: #fff;
  background: var(--accent);
}

.globe-controls {
  display: grid;
  gap: 0.85rem;
}

.globe-controls[hidden] {
  display: none;
}

.field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.field > span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.field select {
  width: 100%;
  min-width: 0;
  padding: 0.55rem 0.6rem;
  font: 0.95rem var(--font-body);
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
}

.field select:focus-visible,
.segmented button:focus-visible,
.globe-mode:focus-visible,
.globe-list button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.field-inline {
  grid-auto-flow: column;
  align-items: center;
  gap: 0.5rem;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border: 1px solid var(--line);
  background: #fff;
}

.segmented button {
  padding: 0.5rem 0.7rem;
  font: 500 0.88rem var(--font-body);
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}

.segmented button + button {
  border-left: 1px solid var(--line);
}

.segmented button.is-active {
  color: #fff;
  background: var(--accent);
}

.globe-legend .legend-title {
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.legend-ramp {
  height: 10px;
  background: linear-gradient(90deg, #edf2f6, var(--accent));
  border: 1px solid var(--line);
}

.legend-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.legend-keys {
  display: flex;
  gap: 1rem;
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.key::before {
  content: "";
  display: inline-block;
  width: 1.4rem;
  height: 3px;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.key-x::before {
  background: var(--accent-warm);
}

.key-m::before {
  background: var(--accent);
}

.globe-list-title {
  margin: 0.25rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.globe-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.globe-list li {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.globe-list button {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.45rem 0;
  font: 0.88rem var(--font-body);
  color: var(--ink-soft);
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

.globe-list button:hover span {
  color: var(--accent);
  text-decoration: underline;
}

.globe-list b {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink);
}

.globe-list .empty {
  padding: 0.6rem 0;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Fact sheet */
.factsheet {
  padding-top: clamp(1.5rem, 4vh, 2.5rem);
  border-top: 1px solid var(--line);
}

.factsheet-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem 2rem;
  margin-bottom: 1.5rem;
}

.factsheet-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.fs-notes {
  margin: 0.6rem 0 0;
  max-width: 48rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.factsheet-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.factsheet-actions .field {
  min-width: 15rem;
}

.fs-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 1.5rem;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: color-mix(in srgb, #fff 70%, transparent);
}

.fs-tiles div {
  display: grid;
  gap: 0.3rem;
  padding: 1rem 1.1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.fs-tiles dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.fs-tiles dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fs-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1.25rem;
}

.fs-card {
  min-width: 0;
  padding: clamp(1.1rem, 2.5vw, 1.6rem);
  border: 1px solid var(--line);
  background: color-mix(in srgb, #fff 82%, transparent);
}

.fs-spider {
  position: relative;
  grid-row: span 2;
}

.sp-tip {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: 0.15rem;
  padding: 0.5rem 0.7rem;
  max-width: 17rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--ink) 12%, transparent);
  pointer-events: none;
}

.sp-tip[hidden] {
  display: none;
}

.sp-tip strong {
  color: var(--ink);
}

.sp-tip-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.fs-card h3 {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.fs-card h3:not(:first-child) {
  margin-top: 1.5rem;
}

.fs-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.fs-card-head h3 {
  margin: 0;
}

.fs-card-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
  cursor: pointer;
}

.check input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--accent);
}

.fs-card-controls select {
  padding: 0.4rem 0.5rem;
  font-size: 0.88rem;
  max-width: 13rem;
}

#spider {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  margin: 0.75rem auto 0;
  overflow: visible;
}

.sp-ring {
  fill: none;
  stroke: color-mix(in srgb, var(--line) 90%, transparent);
  stroke-width: 1;
}

.sp-ring-label {
  font: 10px var(--font-mono);
  fill: var(--muted);
}

.sp-spoke {
  stroke: color-mix(in srgb, var(--line) 75%, transparent);
  stroke-width: 1;
}

.sp-label {
  font: 500 12.5px var(--font-body);
  fill: var(--ink-soft);
  cursor: pointer;
}

.sp-label:hover,
.sp-label:focus {
  fill: var(--accent);
  text-decoration: underline;
  outline: none;
}

.sp-label-small {
  font: 9.5px var(--font-mono);
  cursor: help;
}

.sp-dot {
  cursor: help;
}

.sp-main {
  fill: color-mix(in srgb, var(--accent-warm) 30%, transparent);
  stroke: var(--accent-warm);
  stroke-width: 2;
  stroke-linejoin: round;
}

.sp-cmp {
  fill: color-mix(in srgb, var(--accent) 7%, transparent);
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  stroke-linejoin: round;
}

.sp-dot {
  fill: #8a6326;
}

.sp-dot.sp-over {
  fill: #fff;
  stroke: #8a6326;
  stroke-width: 2;
}

.sp-legend text {
  font: 12px var(--font-body);
  fill: var(--ink-soft);
}

.fs-caption {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.fs-detail {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.fs-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.fs-detail h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.link-button {
  font: 600 0.88rem var(--font-body);
  color: var(--accent);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
}

.fs-bars {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fs-bars li {
  display: grid;
  grid-template-columns: minmax(0, 9.5rem) minmax(3rem, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
}

.bar-label {
  overflow: hidden;
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 8px;
  background: color-mix(in srgb, var(--line) 45%, transparent);
}

.bar {
  display: block;
  height: 100%;
  background: var(--accent);
}

.fs-bars b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink);
}

.factor-bar {
  display: flex;
  height: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.factor-bar span {
  height: 100%;
}

.factor-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.factor-keys i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 0.35rem;
}

.factor-keys b {
  font-weight: 500;
  color: var(--ink);
}

.fs-source {
  margin: 1.5rem 0 0;
  max-width: 60rem;
  font-size: 0.82rem;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .explore-globe {
    grid-template-columns: 1fr;
  }

  .globe-stage {
    height: clamp(360px, 62vh, 640px);
  }

  .fs-grid {
    grid-template-columns: 1fr;
  }

  .fs-spider {
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .fs-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fs-bars li {
    grid-template-columns: minmax(0, 7rem) minmax(2rem, 1fr) auto;
  }

  .factsheet-actions,
  .factsheet-actions .field {
    width: 100%;
    min-width: 0;
  }

  .globe-stage {
    height: 92vw;
  }
}

/* Dashboards page: an entry with a preview image above it */
.dashboard-entry {
  padding-top: 0;
  overflow: hidden;
}

.dashboard-preview {
  display: block;
  margin: 0 calc(-1 * clamp(1.5rem, 4vw, 2.75rem));
  border-bottom: 1px solid var(--line);
  background: var(--paper-deep);
}

.dashboard-preview img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.dashboard-preview:hover img {
  transform: scale(1.02);
}

.dataset-list > li:only-child .dashboard-entry {
  padding-top: 0;
}

.dataset-list > li:only-child .dashboard-entry .dashboard-preview {
  margin: 0 calc(-1 * clamp(1.75rem, 4.5vw, 3.5rem));
}

/* Dashboards page: entries side by side on wide screens, each card as tall as its row */
.dashboard-list > li {
  display: grid;
}

.dashboard-list .dataset {
  max-width: none;
  align-content: start;
}

.dashboard-list .dataset-actions {
  align-self: end;
}

@media (min-width: 1100px) {
  .dashboard-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }

  .dashboard-list .dataset {
    grid-template-rows: auto auto auto auto 1fr;
  }

  .dashboard-list .dataset-head h2 {
    font-size: clamp(1.5rem, 1.9vw, 2rem);
  }
}

/* An entry with four facts spreads them across the full width */
@media (min-width: 761px) {
  .dashboard-list .dataset-facts:has(> div:nth-child(4):last-child) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ——— Coming-soon pages: Dashboards, Models, Databases ——— */

.soon {
  display: grid;
  gap: 1.25rem;
  margin-top: clamp(2rem, 5vw, 3rem);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  max-width: 46rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, #fff 70%, transparent);
}

.soon-badge {
  justify-self: start;
  padding: 0.3rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}

.soon h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
}

.soon-list {
  display: grid;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.soon-list li {
  display: grid;
  gap: 0.15rem;
  padding-top: 0.9rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

.soon-list strong {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.soon-list span {
  color: var(--muted);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.7rem 1.15rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn-primary {
  background: var(--accent);
  color: #f4fbfa;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ——— Sections ——— */

.section {
  padding: clamp(4rem, 10vw, 7rem) clamp(1.25rem, 4vw, 3rem);
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.section h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.section-lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 36rem;
}

/* Footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.5rem clamp(1.25rem, 4vw, 3rem);
  background: #080c10;
  color: #7f919e;
  border-top: 1px solid #1a242e;
}

.footer-brand {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.06rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: #d5e0e8;
  letter-spacing: -0.04em;
}

.footer-mark {
  width: auto;
  height: 1em;
  flex-shrink: 0;
  display: block;
  transform: translateY(0.02em);
}

.li-icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: -0.15em;
}

.closing-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--accent);
  text-decoration: none;
}

.closing-linkedin:hover {
  text-decoration: underline;
}

.footer-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 1.25rem;
  color: #c4d1da;
  text-decoration: none;
}

.footer-linkedin:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-meta {
  margin: 0;
  font-size: 0.9rem;
}

/* ——— Motion: mesh ——— */

.route {
  stroke-dasharray: 12 10;
  animation: dash 28s linear infinite;
}

.r2 {
  animation-duration: 36s;
  animation-direction: reverse;
}

.r3 {
  animation-duration: 22s;
}

.node {
  transform-origin: center;
  animation: pulse 4.5s var(--ease) infinite;
}

.n2 { animation-delay: 0.6s; }
.n3 { animation-delay: 1.2s; }
.n4 { animation-delay: 1.8s; }
.n5 { animation-delay: 2.4s; }
.n6 { animation-delay: 3s; }

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes dash {
  to {
    stroke-dashoffset: -400;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

/* ——— Reports gallery ——— */

.reports-page {
  padding-top: var(--header-h);
}

.reports-hero {
  padding-bottom: 1.5rem;
}

.reports-hero h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 8.6vw, 4.5rem); /* "Dashboards" must fit a 360px phone */
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.reports-hero code {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.report-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.filter-btn {
  min-height: 2.4rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.filter-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-btn.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.reports-list-section {
  padding-top: 0;
}

.reports-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.report-row {
  border-bottom: 1px solid var(--line);
}

.report-link {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 1.5rem;
  padding: 1.4rem 0;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease;
}

@media (min-width: 800px) {
  .report-link {
    grid-template-columns: 8.5rem minmax(0, 1fr) auto;
    align-items: start;
  }
}

.report-link:hover .report-title {
  color: var(--accent);
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: baseline;
}

.report-type {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-warm);
}

.report-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.report-title {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.report-summary {
  margin: 0;
  color: var(--muted);
  max-width: 40rem;
}

.report-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.report-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 0.15rem 0.45rem;
}

.report-open {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  align-self: center;
}

.reports-loading,
.reports-empty {
  margin: 0;
  padding: 1.5rem 0;
  color: var(--muted);
}

.soon.reports-empty {
  margin: 0;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  color: inherit;
}

.reports-empty[hidden],
.reports-list[hidden] {
  display: none;
}

.reports-empty .section-lede a {
  color: var(--accent);
}

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

  .what-points li,
  .hero-reveal,
  .brand-lockup,
  .scroll-cue,
  .reveal,
  .work-grid,
  .work-card,
  .work-media img,
  .closing-options li {
    transition: none !important;
    animation: none !important;
  }

  .route,
  .node,
  .scroll-cue span {
    animation: none;
  }
}

@media (max-width: 640px) {}

