/* ==========================================================================
   investor-sections — iteration block
   --------------------------------------------------------------------------
   Black scroll-pinned section with 4 investor angles. 3-column grid:
     LEFT gutter   → nav top, paragraph + CTA bottom
     CENTER        → media (image / autoplay video)
     RIGHT gutter  → KPI rows bottom

   Outer .is__track is 400 vh (100 vh per slide). The sticky stage pins
   for the whole journey. Four .is__slide siblings sit on top of each
   other at inset 0 and crossfade — JS writes opacity + a 16-px Y
   translate per slide based on scroll progress.

   PLAYGROUND MODE: raw values throughout (no token snap).
   ========================================================================== */

/* 29 Aug 2026: nav/index/copy/kpi insets use --teako-page-inset (css/layout.css) so the text axis matches containered sections. */

.is {
  /* Light editorial palette — paper-grey background, dark ink. Cards
     and chrome adjust accordingly via the var refs below.

     The palette is alternated per slide as the section scrolls: odd
     slides flip to the dark palette below (.is.is-theme-dark), so the
     whole section inverts light → dark → light → dark. The JS just
     toggles the class; every colour resolves through these vars, and
     the long background-color / color transitions do the crossfade. */
  --is-bg:         #ECEEF2;
  --is-ink:        #141A26;
  --is-dim:        rgba(20, 26, 38, 0.62);
  --is-faint:      rgba(20, 26, 38, 0.42);
  --is-rule:       rgba(20, 26, 38, 0.14);
  --is-accent:     #C42800;
  --is-topo:       rgba(20, 26, 38, 0.9);
  --is-media-fill: #d6dae0;

  /* Eased, unhurried invert — matches the deliberate scroll cadence. */
  --is-theme-ease: 720ms cubic-bezier(0.4, 0, 0.2, 1);

  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: var(--is-bg);
  color: var(--is-ink);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--is-theme-ease), color var(--is-theme-ease);
}

/* Dark palette — exact inversion of the light one. Background drops to
   near-black ink, text rises to paper-grey; the Milano-red accent is
   shared by both themes. */
.is.is-theme-dark {
  --is-bg:         #10141C;
  --is-ink:        #ECEEF2;
  --is-dim:        rgba(236, 238, 242, 0.62);
  --is-faint:      rgba(236, 238, 242, 0.42);
  --is-rule:       rgba(236, 238, 242, 0.16);
  --is-accent:     #C42800;
  --is-topo:       rgba(236, 238, 242, 0.9);
  --is-media-fill: #1A2028;
}

/* Diagonal topo — same pattern as the hero / projects-portfolio,
   inverted dark-on-light for the new paper-grey palette. Sits at
   the very back of the stage, well below the slide content. */
.is__topo {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  z-index: 0;
  background-image: repeating-linear-gradient(
    45deg,
    var(--is-topo) 0,
    var(--is-topo) 1px,
    transparent 1px,
    transparent 16px
  );
  -webkit-mask-image: linear-gradient(135deg, #000 0%, transparent 65%);
  mask-image: linear-gradient(135deg, #000 0%, transparent 65%);
}

/* Outer scroll track — 400 vh = 100 vh per slide. Enough for an unhurried
   read of each one. */
.is__track {
  position: relative;
  height: 400vh;
}

.is__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: var(--is-bg);
  transition: background-color var(--is-theme-ease);
}

/* ---------- Nav (persistent, top-left) ---------- */

.is__nav {
  position: absolute;
  top: 148px; /* below the fixed site-nav wordmark, which overlays this corner */
  left: var(--teako-page-inset, 56px);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.is__nav-item {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--is-dim);
  text-transform: none;
  cursor: pointer;
  /* Smooth state swap when activeIdx changes — handles the nav's part of
     the "seamless transition" without any JS animation. */
  transition: color 360ms cubic-bezier(0.33, 1, 0.68, 1);
}
.is__nav-item:hover { color: var(--is-ink); }

.is__nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--is-faint);
  flex-shrink: 0;
  transition:
    background 360ms cubic-bezier(0.33, 1, 0.68, 1),
    transform 360ms cubic-bezier(0.33, 1, 0.68, 1),
    box-shadow 360ms cubic-bezier(0.33, 1, 0.68, 1);
}

.is__nav-item.is-active {
  color: var(--is-ink);
}
.is__nav-item.is-active .is__nav-dot {
  background: var(--is-accent);
  transform: scale(1.4);
  box-shadow: 0 0 10px rgba(196, 40, 0, 0.55);
}

/* ---------- Index marker (top-right, decorative) ---------- */

.is__index {
  position: absolute;
  top: 56px;
  right: var(--teako-page-inset, 56px);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--is-dim);
  transition: color var(--is-theme-ease);
}
.is__index [data-is-index] {
  color: var(--is-ink);
  font-variant-numeric: tabular-nums;
  transition: color var(--is-theme-ease);
}
.is__index-sep {
  color: var(--is-faint);
  transition: color var(--is-theme-ease);
}

/* ---------- Slide stack ---------- */

.is__slides {
  position: relative;
  height: 100%;
  width: 100%;
}

.is__slide {
  position: absolute;
  inset: 0;
  /* JS writes --is-op (0..1) and --is-y (px) each frame. Smoothstepped
     opacity + a small 16-px enter offset is the entire transition. */
  opacity: var(--is-op, 0);
  transform: translateY(var(--is-y, 16px));
  pointer-events: none;
  transition: opacity 80ms linear, transform 80ms linear;
  will-change: opacity, transform;
}
.is__slide.is-active {
  pointer-events: auto;
}

/* Media frame — centred and full-height (top: 0 → bottom: 0) so the
   photo / video occupies the full vertical extent of the stage. The
   side gutters either side host the nav, copy, and KPI. */
.is__media {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(420px, 36vw, 540px);
  /* Slightly darker fill than the section bg so the empty frame still
     reads as a distinct rectangle before the videos load. */
  background: var(--is-media-fill);
  overflow: hidden;
  border: 1px solid var(--is-rule);
  z-index: 1;
  transition: background-color var(--is-theme-ease), border-color var(--is-theme-ease);
}
.is__media img,
.is__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Bottom-left copy — sits in the LEFT gutter beside the media. */
.is__copy {
  position: absolute;
  left: var(--teako-page-inset, 56px);
  bottom: 56px;
  width: 280px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.is__copy-body {
  margin: 0;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  font-weight: 400;
  color: var(--is-ink);
  transition: color var(--is-theme-ease);
}
.is__cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--is-ink);
  font-family: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--is-ink);
  text-decoration: none;
  transition: color var(--is-theme-ease), border-color var(--is-theme-ease), gap 240ms cubic-bezier(0.33, 1, 0.68, 1);
}
.is__cta::after {
  content: '\2197'; /* ↗ */
  font-family: inherit;
  color: var(--is-accent);
  transition: transform 240ms cubic-bezier(0.33, 1, 0.68, 1);
}
.is__cta:hover {
  gap: 14px;
  border-color: var(--is-accent);
}
.is__cta:hover::after { transform: translate(2px, -2px); }

/* Bottom-right KPI rows — sits in the RIGHT gutter beside the media. */
.is__kpi {
  position: absolute;
  right: var(--teako-page-inset, 56px);
  bottom: 56px;
  width: 280px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.is__kpi-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--is-rule);
  transition: border-color var(--is-theme-ease);
}
.is__kpi-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.is__kpi-label {
  font-family: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--is-dim);
  transition: color var(--is-theme-ease);
}
.is__kpi-value {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--is-ink);
  font-variant-numeric: tabular-nums;
  transition: color var(--is-theme-ease);
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  /* Below the fixed wordmark (which overlays this corner on small screens). */
  .is__nav { top: 96px; left: 28px; gap: 10px; }
  .is__index { top: 96px; right: 28px; }
  /* Stacked layout — media on top, copy + KPI below side-by-side. */
  .is__media {
    left: 28px;
    right: 28px;
    top: 232px; /* below the section nav list, which now starts at 96px */
    bottom: 240px;
    width: auto;
    transform: none;
  }
  .is__copy {
    left: 28px;
    bottom: 28px;
    width: calc(50% - 42px);
  }
  .is__kpi {
    right: 28px;
    bottom: 28px;
    width: calc(50% - 42px);
  }
}

@media (max-width: 640px) {
  /* Portrait media (client call) — a phone frame wants a standing crop,
     not a letterboxed strip. Height clamps so the copy + KPI stack below
     always keeps its room on shorter screens. */
  .is__media {
    top: 244px; /* fully below the 4-row section nav (starts 96px) */
    bottom: auto;
    left: 50%;
    right: auto;
    width: auto;
    transform: translateX(-50%);
    aspect-ratio: 3 / 4;
    height: clamp(220px, 100vh - 570px, 420px);
  }
  .is__copy {
    bottom: 170px;
    left: 28px;
    right: 28px;
    width: auto;
  }
  .is__kpi {
    bottom: 20px;
    left: 28px;
    right: 28px;
    width: auto;
    gap: 9px;
  }
  .is__kpi-row { padding-bottom: 9px; }
}

/* Media never captures clicks (2026-08-02) — the frame overlapped the CTA
   at some widths and swallowed the click. It's ambient-only; the copy
   column owns all interaction.

   FIX (2026-08-02, later same day): the first version of this patch set
   `.is__copy { position: relative; }`, which silently overrode the
   column's `position: absolute; bottom: …` collage placement. In flow,
   the `bottom` offset became a relative shift UP from the slide's top,
   so the copy rendered at top:-28/-56 — under the section nav and the
   fixed wordmark, with the CTA unclickable. The copy must STAY
   absolutely positioned; z-index alone is enough to lift it above the
   (already pointer-inert) media frame. */
.is__media, .is__media * { pointer-events: none; }
.is__copy { z-index: 5; }


/* Display headings in Geologica (2026-08-02). */
.is__title, .is__slide h2 { font-family: 'Geologica', 'IBM Plex Sans', system-ui, sans-serif; }

/* Clearance tweak (2026-08-02) — in the stacked 641–1080 band the media's
   240-px bottom inset let the tallest body copy (slide 2 at ~50% column
   width) graze the frame's bottom edge. Because both the copy and the
   frame are bottom-anchored, the gap is viewport-height-independent:
   gap = inset − (copy height + 28). The worst-case copy + CTA stack at
   the band's narrowest column (~641 px viewport) measures ~285 px, so a
   320-px inset keeps clear air under the frame at every size in the
   band; the frame gives up a sliver of height, nothing else moves. */
@media (max-width: 1080px) and (min-width: 641px) {
  .is__media { bottom: 320px; }
}

/* ==========================================================================
   Investor slides v2 (2026-08-18) — the portfolio system's instrument
   grammar applied: plated KPI card with red keyline + Geologica numerals,
   solid red CTA (the slide's one accent moment), ghost slide index.
   ========================================================================== */
.is { --is-card: #FFFFFF; --is-card-rule: rgba(20, 26, 38, 0.12); --is-card-soft: rgba(20, 26, 38, 0.08); }
.is.is-theme-dark { --is-card: #161B26; --is-card-rule: rgba(236, 238, 242, 0.14); --is-card-soft: rgba(236, 238, 242, 0.10); }

.is__kpi {
  width: 310px;
  gap: 0;
  background: var(--is-card);
  border: 1px solid var(--is-card-rule);
  /* Red top rule removed 2026-08-20 — standing rule: no red top lines on
     containers. The hairline plate carries the KPI card on its own. */
  padding: 6px 20px 12px;
  box-shadow: 0 18px 50px rgba(10, 14, 22, 0.12);
  transition: background-color var(--is-theme-ease), border-color var(--is-theme-ease);
}
.is__kpi-row { padding: 13px 0 12px; border-bottom: 1px solid var(--is-card-soft); flex-wrap: wrap; }
.is__kpi-row:last-child { border-bottom: 0; }
/* Values never break mid-phrase ("10% by 2030" split ugly); if a row runs
   tight the whole value drops as one unit instead. */
.is__kpi-value { white-space: nowrap; }
.is__kpi-value {
  font-family: 'Geologica', 'IBM Plex Sans', system-ui, sans-serif;
  font-weight: 300;
  font-size: 21px;
  letter-spacing: -0.015em;
}

.is__cta {
  display: inline-block;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  text-decoration: none;
  background: var(--is-accent);
  border: 1px solid var(--is-accent);
  color: #fff !important;
  padding: 13px 20px;
  transition: background 160ms ease;
}
.is__cta:hover { background: #A62200; }

/* Slide index becomes a quiet ghost numeral — the system's signature. */
.is__index {
  font-family: 'Geologica', sans-serif;
  font-weight: 200;
  font-size: clamp(56px, 6vw, 96px);
  letter-spacing: -0.03em;
  opacity: 0.07;
}
/* Ghost numeral shows the CURRENT slide only — sep + total hidden together
   (hiding just the sep read as doubled digits, e.g. "0104"). */
.is__index-sep,
.is__index span:last-child { display: none; }

@media (max-width: 900px) {
  .is__kpi { width: auto; left: 20px; right: 20px; bottom: 20px; }
}

/* ==========================================================================
   KPI rail de-carded (2026-08-20 · client dump, 20 Aug)
   --------------------------------------------------------------------------
   D5. "This section on the bottom right … doesn't need to be in a container
   as such and with a top red line. It just needs to have those line
   dividers for each of those sections."

   So the white plate, its border, the 2 px Milano-red keyline and the drop
   shadow all go. What is left is a quiet index: each entry introduced by a
   single hairline in the section's own rule colour (--is-rule), which
   already inverts with the light/dark theme swap. Same divider rhythm as
   the home map's model strip.
   ========================================================================== */
.is__kpi {
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
}
.is__kpi-row {
  padding: 13px 0 12px;
  border-top: 1px solid var(--is-rule);
  border-bottom: 0;
  transition: border-color var(--is-theme-ease);
}
/* Nothing closes the list at the foot — an index, not a box. */
.is__kpi-row:last-child { border-bottom: 0; }

@media (max-width: 640px) {
  .is__kpi-row { padding: 9px 0 8px; }
}

/* ==========================================================================
   PHONES — investor sections mobile layout (client pick, 29 Aug 2026: B)
   Top: the four section tags as a chip strip with the progress line and the
   01 — 04 index. Each slide flows: landscape video · copy · full-width CTA ·
   the KPI table anchored to the bottom of the slide. Desktop untouched.
   ========================================================================== */
@media (max-width: 760px) {
  .is__nav { position: absolute; left: 20px; right: 20px; top: 22px; height: auto; display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; z-index: 6; }
  .is__nav::-webkit-scrollbar { display: none; }
  .is__nav-item { flex: none; gap: 7px; padding: 6px 11px 5px; border: 1px solid var(--is-rule); border-radius: 999px; font-size: 10.5px; letter-spacing: 0.06em; white-space: nowrap; transition: border-color 0.3s, color 0.3s; }
  .is__nav-item.is-active { border-color: var(--is-accent); color: var(--is-ink); }
  .is__line { position: absolute; left: 20px; right: 78px; top: 70px; height: 2px; background: var(--is-rule); z-index: 6; }
  .is__line i { display: block; height: 100%; width: 0; background: var(--is-accent); transition: width 0.2s linear; }
  .is__index { top: 62px; right: 20px; left: auto; bottom: auto; width: auto; height: auto; font-size: 10px; letter-spacing: 0.12em; line-height: 1.6; }
  .is__index span:last-child { display: inline; }
  /* Column tightened so the table sits clear of the bottom edge on a 664px
     screen (client, 29 Aug): head 82, gaps 10, body 1.45, rows 6/5. */
  .is__slide { display: flex; flex-direction: column; gap: 10px; padding: 82px 20px 36px; box-sizing: border-box; }
  .is__media { position: static; transform: none; width: 100%; height: auto; aspect-ratio: 16 / 9; left: auto; right: auto; top: auto; bottom: auto; flex: none; order: 1; }
  .is__copy { position: static; width: auto; left: auto; right: auto; bottom: auto; display: flex; flex-direction: column; order: 2; }
  .is__copy-body { font-size: 14px; line-height: 1.45; margin: 0 0 8px; }
  .is__cta { align-self: stretch; display: flex; justify-content: center; width: 100%; box-sizing: border-box; }
  .is__kpi { position: static; width: auto; left: auto; right: auto; bottom: auto; order: 3; margin-top: auto; }
  .is__kpi-row { padding: 6px 0 5px; }
  .is__kpi-value { font-size: 15px; }
}

