/* Abode — network concept. Drenched dark: the page is the lobby, the data is the light. */

@font-face { font-family: 'InterFallback'; src: local('Inter'); }

:root {
  /* Brand tokens inherited from the shipping Abode system (v4 mockup). */
  --navy: #1a1f36;
  --dark: #0d0f1a;
  --deep: #070912;
  --gold: #c9a96e;
  --gold-light: #e8d5a8;

  --ink: #f2f0ec;
  --ink-dim: #a8adbd;
  --ink-faint: #808799;   /* 5.31:1 on --dark. #6f7688 measured 4.20:1 and failed small text. */
  --rule: rgba(201, 169, 110, 0.18);
  --rule-soft: rgba(242, 240, 236, 0.09);

  /* Mosaic groups — distinguishable at 3px on near-black. */
  --m-a: #d9b878;
  --m-h: #7fa8c4;
  --m-o: #8b86ad;
  --m-x: #55596b;

  --measure: 62ch;
  --gut: clamp(1.5rem, 5vw, 6rem);

  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

  --z-canvas: 1;
  --z-content: 2;
  --z-nav: 20;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--dark);
  color: var(--ink);
  font-family: 'Inter', 'InterFallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: clamp(1rem, 0.94rem + 0.28vw, 1.125rem);
  line-height: 1.72;                       /* light type on dark needs the extra */
  font-feature-settings: 'cv05' 1, 'ss03' 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

::selection { background: var(--gold); color: var(--deep); }

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

/* ---------------------------------------------------------------- type */

h1, h2, h3 { text-wrap: balance; margin: 0; }
p { text-wrap: pretty; }

.display {
  font-weight: 200;
  font-size: clamp(2.05rem, 0.9rem + 5.4vw, 5.25rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}
.display em {
  font-style: normal;
  font-weight: 500;
  color: var(--gold);
}

.h2 {
  font-weight: 200;
  font-size: clamp(2rem, 1rem + 3.6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.lede {
  font-size: clamp(1.075rem, 1rem + 0.45vw, 1.35rem);
  line-height: 1.62;
  color: var(--ink-dim);
  max-width: 46ch;
}

.body { max-width: var(--measure); color: var(--ink-dim); }
.body strong { color: var(--ink); font-weight: 500; }

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1, 'zero' 1;
}

.footnote {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--ink-faint);
  max-width: 58ch;
}

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

.wrap {
  width: min(100% - (var(--gut) * 2), 1360px);
  margin-inline: auto;
}

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem var(--gut);
  background: linear-gradient(to bottom, rgba(7, 9, 18, 0.86), rgba(7, 9, 18, 0));
  pointer-events: none;
}
.nav > * { pointer-events: auto; }

.mark {
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.mark span { color: var(--gold); }

.nav-cta {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: 100px;
  padding: 0.55rem 1.1rem;
  transition: border-color 0.4s var(--ease-out-quint), color 0.4s var(--ease-out-quint);
}
.nav-cta:hover { border-color: var(--gold); color: var(--gold); }

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

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  overflow: clip;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: -5% -2%;
  z-index: -2;
  will-change: transform;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* The subject (the lit screen) sits right of centre. A tall viewport
     centre-crops a landscape frame and loses it entirely, so bias right. */
  object-position: 62% center;
  /* Exposure ramp only — a global luminance move on an untouched photograph.
     Nothing in the frame is added, removed or re-rendered. */
  filter: brightness(var(--expo, 0.34)) saturate(var(--sat, 0.7));
  transition: filter 0.1s linear;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to right, rgba(7, 9, 18, 0.94) 0%, rgba(7, 9, 18, 0.72) 38%, rgba(7, 9, 18, 0.1) 72%),
    linear-gradient(to top, rgba(7, 9, 18, 0.95) 0%, rgba(7, 9, 18, 0) 45%);
}

.hero-inner {
  position: relative;
  z-index: var(--z-content);
  padding: 0 var(--gut) clamp(3.5rem, 9vh, 7rem);
  width: min(100%, 1360px);
  margin-inline: auto;
}

.hero h1 { max-width: 15ch; }
@media (min-width: 62rem) { .hero h1 { max-width: 19ch; } }

.hero .lede { margin: 1.75rem 0 0; }

.hero-foot {
  margin-top: clamp(2.5rem, 6vh, 4.5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 2.5rem;
  border-top: 1px solid var(--rule-soft);
  padding-top: 1.25rem;
}
.hero-foot p { margin: 0; font-size: 0.875rem; color: var(--ink-faint); }

.scroll-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
}
.scroll-hint::before {
  content: '';
  width: 34px;
  height: 1px;
  background: var(--gold);
  transform-origin: left;
  animation: sweep 2.6s var(--ease-out-quint) infinite;
}
@keyframes sweep {
  0%, 100% { transform: scaleX(0.25); opacity: 0.45; }
  50%      { transform: scaleX(1);    opacity: 1; }
}

/* ------------------------------------------------- the network instrument */

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

.instrument { position: relative; }

/* The scroll runway. Height drives the timeline; the stage pins inside it. */
.instrument-runway { height: 560vh; }

.instrument-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: clip;
}

#net-canvas {
  position: absolute;
  inset: 0;
  z-index: var(--z-canvas);
  width: 100%;
  height: 100%;
  display: block;
}

.readout {
  position: absolute;
  z-index: var(--z-content);
  left: var(--gut);
  bottom: clamp(2rem, 6vh, 4rem);
  width: min(100%, 33rem);
  padding-right: var(--gut);
}

.readout-title {
  font-weight: 200;
  font-size: clamp(1.6rem, 1rem + 2vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 0.6rem;
  min-height: 2.4em;
}
.readout-note {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-dim);
  max-width: 40ch;
  min-height: 4.8em;
}

.readout-swap { transition: opacity 0.45s var(--ease-out-quint); }
.readout-swap[data-fading='1'] { opacity: 0; }

/* Three readings across, aligned like an instrument panel. Wrapping two-up
   then one-up reads as a layout accident, not a design. */
.gauges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  gap: 1.25rem 1.5rem;
  margin: 1.9rem 0 0;
  padding: 1.35rem 0 0;
  border-top: 1px solid var(--rule);
}
.gauge dt {
  font-size: 0.75rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.3rem;
}
.gauge dd {
  margin: 0;
  font-size: clamp(1.3rem, 0.95rem + 1.05vw, 2rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.gauge dd.is-gold { color: var(--gold); }

.legend {
  position: absolute;
  z-index: var(--z-content);
  right: var(--gut);
  bottom: clamp(2rem, 6vh, 4rem);
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  opacity: 0;
  transition: opacity 0.6s var(--ease-out-quint);
  text-align: right;
}
.legend[data-on='1'] { opacity: 1; }
.legend li {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
  font-size: 0.8125rem;
  color: var(--ink-dim);
}
.legend b { color: var(--ink); font-weight: 500; }
.swatch {
  width: 9px; height: 9px; border-radius: 50%;
  flex: 0 0 auto;
  order: 2;
}

/* Left column, above the readout: the right side belongs to the plot, which
   grows into it during the London zoom. */
.instrument-caption {
  position: absolute;
  z-index: var(--z-content);
  top: clamp(5.5rem, 12vh, 8rem);
  left: var(--gut);
  max-width: 30ch;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--ink-faint);
  transition: opacity 0.35s var(--ease-out-quint);
}

/* ------------------------------------------------------------ sections */

.band {
  position: relative;
  padding-block: clamp(6rem, 16vh, 12rem);
}
.band--tight { padding-block: clamp(4rem, 10vh, 7rem); }

.split {
  display: grid;
  gap: clamp(2.5rem, 6vw, 6rem);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 62rem) {
  .split { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
  .split--reverse > :first-child { order: 2; }
}

.figure {
  position: relative;
  overflow: clip;
  border-radius: 2px;
}
.figure img {
  width: 100%;
  /* height:auto is load-bearing. The HTML height attribute becomes a
     presentational CSS height that beats aspect-ratio, which forced a portrait
     box and made object-fit:cover throw away ~60% of the frame. */
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  will-change: transform;
}
.figure figcaption {
  margin-top: 0.85rem;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

.stat-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}
.stat-line li {
  font-size: 0.875rem;
  color: var(--ink-dim);
  padding-right: 1rem;
  border-right: 1px solid var(--rule-soft);
}
.stat-line li:last-child { border-right: 0; }
.stat-line b { color: var(--gold); font-weight: 500; }

/* estate ticker */

.ticker {
  position: relative;
  border-block: 1px solid var(--rule-soft);
  padding-block: 1.15rem;
  overflow: clip;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.ticker-rail {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: rail 90s linear infinite;
}
.ticker:hover .ticker-rail { animation-play-state: paused; }
@keyframes rail { to { transform: translateX(-50%); } }

.ticker-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.875rem;
  white-space: nowrap;
  color: var(--ink-dim);
}
.ticker-item b { color: var(--ink); font-weight: 500; }
.ticker-item i {
  font-style: normal;
  color: var(--ink-faint);
  font-size: 0.8125rem;
}
.ticker-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  flex: 0 0 auto;
  align-self: center;
}

/* proof */

.proof {
  display: grid;
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
  margin-top: clamp(2.5rem, 6vh, 4rem);
}
@media (min-width: 52rem) { .proof { grid-template-columns: repeat(3, 1fr); } }

.proof-cell {
  background: var(--dark);
  padding: clamp(1.75rem, 4vw, 2.75rem);
}
.proof-metric {
  font-weight: 200;
  font-size: clamp(2.4rem, 1.4rem + 3vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--gold);
  margin: 0 0 0.35rem;
}
.proof-what {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--ink);
}
.proof-who {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

/* close */

.close { text-align: center; }
.close .h2 { margin-inline: auto; max-width: 20ch; }
.close .lede { margin: 1.5rem auto 0; }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 2.5rem;
  padding: 1rem 2rem;
  background: var(--gold);
  color: var(--deep);
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 100px;
  transition: transform 0.5s var(--ease-out-expo), background-color 0.4s var(--ease-out-quint);
}
.cta:hover { background: var(--gold-light); transform: translateY(-2px); }

.foot {
  border-top: 1px solid var(--rule-soft);
  padding-block: 2.5rem 3.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}
.foot a { color: var(--ink-dim); }

/* ------------------------------------------------------------- reveals */
/* Content is visible by default and never gated on JS. The reveal is a pure
   scroll-driven CSS animation: it runs on the compositor, needs no observer,
   and where `animation-timeline` is unsupported the section simply renders. */

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    [data-reveal] {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }
}

/* ------------------------------------------------------ reduced motion */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { animation: none !important; opacity: 1; transform: none; }
  .hero-media { position: absolute; inset: 0; transform: none !important; }
  .hero-media img { filter: brightness(0.72) saturate(0.9) !important; }
  .ticker-rail { animation: none; flex-wrap: wrap; width: 100%; }
  /* The instrument collapses to a single readable end-state, no scrub. */
  .instrument-runway { height: auto; }
  .instrument-stage { position: static; height: 78svh; }
  .readout, .legend, .instrument-caption { position: static; margin: 1.5rem var(--gut) 0; width: auto; text-align: left; }
  .legend { opacity: 1; }
  .legend li { justify-content: flex-start; }
  .swatch { order: 0; }
}

@media (max-width: 61.999rem) {
  /* The narrower the viewport, the harder a landscape frame is cropped, so
     track further toward the subject rather than losing it off-frame. */
  .hero-media img { object-position: 78% center; }

  /* On wide viewports the headline sits in the left third, so a left-to-right
     scrim is enough. On narrow it spans the full width and can land on the lit
     panel, so weight the scrim bottom-up instead. */
  .hero::after {
    background: linear-gradient(to top,
      rgba(7, 9, 18, 0.97) 0%,
      rgba(7, 9, 18, 0.88) 42%,
      rgba(7, 9, 18, 0.34) 70%,
      rgba(7, 9, 18, 0.12) 100%);
  }

  .instrument-caption { display: none; }

  /* Each element gets its own row, so the legend can never land on the plot. */
  .instrument-stage {
    height: 100svh;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto;
    align-content: end;
  }
  #net-canvas { position: relative; grid-row: 1; min-height: 0; }

  .legend {
    position: static;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
    padding: 0.75rem var(--gut) 0;
    text-align: left;
    /* Only meaningful in the final act; it fades in with data-on. */
  }
  .legend li { justify-content: flex-start; font-size: 0.75rem; }
  .swatch { order: 0; }

  .readout {
    position: static;
    grid-row: 3;
    margin: 0;
    padding: 1rem var(--gut) 1.5rem;
    width: auto;
  }
  .readout-title { min-height: 0; }
  .readout-note { min-height: 3.2em; font-size: 0.875rem; }
  .gauges { gap: 1rem 1.75rem; margin-top: 1.25rem; padding-top: 1rem; }
}
