/* ==========================================================================
   Mathic v8 — Apple Pro Keynote Design System
   Pure Black (#000000) / Pure White (#FFFFFF) / Studio Gray (#F5F5F7)
   Single Accent: Cobalt Blue (#2E6BFF / #1F5BF0 / #699BFF)
   Typography: Inter (tabular-nums) + PingFang SC + self-hosted Noto Sans SC
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  src: url('./assets/fonts/inter-var.woff2?v=8') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Sans SC';
  src: url('./assets/fonts/noto-sans-sc-600.woff2?v=11') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Sans SC';
  src: url('./assets/fonts/noto-sans-sc-700.woff2?v=11') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@property --fade-start {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@property --fade-end {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

:root {
  /* Surfaces */
  --bg-black: #000000;
  --bg-black-elev: #111216;
  --bg-black-card: #15171D;
  --bg-white: #FFFFFF;
  --bg-gray: #F5F5F7;
  --bg-control-light: #EAEAEE;

  /* Ink & Contrast (WCAG AA+ on every pair) */
  --ink-dark: #F5F5F7;
  --ink-dark-muted: #A1A1A6;
  --ink-light: #1D1D1F;
  --ink-light-muted: #58585E;

  /* Hairlines */
  --line-dark: rgba(255, 255, 255, 0.14);
  --line-dark-strong: rgba(255, 255, 255, 0.24);
  --line-light: rgba(0, 0, 0, 0.08);
  --line-light-strong: rgba(0, 0, 0, 0.16);

  /* Single Accent: Cobalt Blue */
  --cobalt: #2E6BFF;
  --cobalt-cta: #1F5BF0;
  --cobalt-cta-hover: #2E6BFF;
  --cobalt-ink-light: #1B52DF;
  --cobalt-ink-dark: #699BFF;
  --cobalt-soft: rgba(46, 107, 255, 0.12);

  /* Slider Track (>= 3.6:1 contrast on white and #F5F5F7) */
  --range-track: #7A828F;

  /* Financial Semantic Colors — CN Default (Red Up / Green Down) */
  --fin-up-light: #C82838;
  --fin-down-light: #0A7A58;
  --fin-up-dark: #FF5E6D;
  --fin-down-dark: #30D187;

  /* Typography — Strict 2 Webfont Families, Zero Serif */
  --font-sans: 'Inter', 'PingFang SC', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;

  /* Scale Tokens */
  --text-hero: clamp(3.5rem, 8.2vw, 8.2rem);
  --text-keynote: clamp(4rem, 12.2vw, 9.75rem);
  --text-h2: clamp(2.5rem, 5.2vw, 4.75rem);
  --text-metric: clamp(1.75rem, 2.8vw, 2.5rem);
  --text-metric-sm: clamp(1.375rem, 2vw, 1.875rem);
  --text-body: 1.125rem;
  --text-sm: 0.875rem;

  /* Layout & Motion */
  --container-max: 1180px;
  --header-h: 56px;
  --radius-card: 28px;
  --radius-control: 14px;
  --radius-pill: 9999px;
  --ease-apple: cubic-bezier(0.22, 1, 0.36, 1);
  --t-ui: 180ms;
}

html[data-fin-convention="us"] {
  --fin-up-light: #0A7A58;
  --fin-down-light: #C82838;
  --fin-up-dark: #30D187;
  --fin-down-dark: #FF5E6D;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  background: var(--bg-black);
  color: var(--ink-dark);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.58;
  background: var(--bg-black);
  color: var(--ink-dark);
  overflow-x: clip;
}

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

button,
input {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}

h1,
h2,
h3,
p,
figure,
dl,
dd,
ul {
  margin: 0;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.nowrap {
  white-space: nowrap;
}

html[data-fin-convention] .fin-up-text {
  color: var(--fin-up-light);
}

html[data-fin-convention] .fin-down-text {
  color: var(--fin-down-light);
}

html[data-fin-convention] .fin-up-text-dark {
  color: var(--fin-up-dark);
}

html[data-fin-convention] .fin-down-text-dark {
  color: var(--fin-down-dark);
}

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

.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  padding: 10px 18px;
  clip: auto;
  z-index: 999;
  background: var(--cobalt-cta);
  color: #FFFFFF;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 600;
}

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

.container {
  width: min(var(--container-max), calc(100% - 48px));
  margin-inline: auto;
}

/* ==========================================================================
   Navigation Header — Single-Line Apple Frosted Glass
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  min-height: var(--header-h);
  color: var(--ink-dark);
}

.header-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 14, 0.86);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--t-ui) var(--ease-apple),
    background-color var(--t-ui) var(--ease-apple),
    border-color var(--t-ui) var(--ease-apple);
}

.site-header.is-light-surface .header-backdrop {
  background: rgba(245, 245, 247, 0.86);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.site-header.is-scrolled .header-backdrop,
.site-header.is-menu-open .header-backdrop,
.site-header.is-light-surface .header-backdrop {
  opacity: 1;
}

.header-inner {
  position: relative;
  z-index: 2;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  transition: opacity var(--t-ui) var(--ease-apple);
}

.brand:hover {
  opacity: 0.85;
}

.brand-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.brand-wordmark {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #FFFFFF;
  transition: color var(--t-ui) var(--ease-apple);
}

.site-header.is-light-surface .brand-wordmark {
  color: var(--ink-light);
}

.nav-list {
  list-style: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-list a {
  display: inline-block;
  padding-block: 6px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: rgba(245, 245, 247, 0.84);
  transition: color var(--t-ui) var(--ease-apple);
}

.nav-list a:hover,
.nav-list a:focus-visible {
  color: #FFFFFF;
}

.site-header.is-light-surface .nav-list a {
  color: #424245;
}

.site-header.is-light-surface .nav-list a:hover,
.site-header.is-light-surface .nav-list a:focus-visible {
  color: var(--ink-light);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: #FFFFFF;
  cursor: pointer;
  transition:
    background-color var(--t-ui) var(--ease-apple),
    color var(--t-ui) var(--ease-apple);
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.site-header.is-light-surface .nav-toggle {
  color: var(--ink-light);
}

.site-header.is-light-surface .nav-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
}

.nav-bar-top,
.nav-bar-bottom {
  transform-box: view-box;
  transform-origin: 12px 12px;
  transition: transform 200ms var(--ease-apple);
}

.site-header.is-menu-open .nav-bar-top {
  transform: translateY(3.5px) rotate(45deg);
}

.site-header.is-menu-open .nav-bar-bottom {
  transform: translateY(-3.5px) rotate(-45deg);
}

.mobile-nav {
  position: relative;
  z-index: 2;
  background: rgba(10, 10, 14, 0.96);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 24px 24px;
  transition:
    background-color var(--t-ui) var(--ease-apple),
    border-color var(--t-ui) var(--ease-apple);
}

.site-header.is-light-surface .mobile-nav {
  background: rgba(245, 245, 247, 0.96);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.mobile-nav-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.mobile-nav-list li + li {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header.is-light-surface .mobile-nav-list li + li {
  border-top-color: rgba(0, 0, 0, 0.08);
}

.mobile-nav-list a {
  display: block;
  padding: 15px 0;
  font-size: var(--text-body);
  font-weight: 600;
  color: #F5F5F7;
  transition: color var(--t-ui) var(--ease-apple);
}

.mobile-nav-list a:hover {
  color: var(--cobalt-ink-dark);
}

.site-header.is-light-surface .mobile-nav-list a {
  color: var(--ink-light);
}

.site-header.is-light-surface .mobile-nav-list a:hover {
  color: var(--cobalt-ink-light);
}

/* ==========================================================================
   Hero Keynote Stage — Pure Black + Titanium Silver + Rising Sculpture
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  background: var(--bg-black);
  color: var(--ink-dark);
  padding-top: calc(var(--header-h) + clamp(1.25rem, 2.8vh, 2.25rem));
  padding-bottom: clamp(1rem, 2.2vh, 1.75rem);
  overflow: clip;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.hero-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-copy-block {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 1080px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 2.2vh, 1.5rem);
  will-change: transform, opacity;
}

.hero-title {
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
  color: #F5F5F7;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 46%, #9E9EA6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink-dark-muted);
  max-width: 44ch;
  text-wrap: balance;
}

.hero-cta-wrap {
  margin-top: 0.25rem;
}

.btn-cobalt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
  border-radius: var(--radius-pill);
  background: var(--cobalt-cta);
  color: #FFFFFF;
  font-size: var(--text-body);
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14) inset, 0 10px 30px rgba(46, 107, 255, 0.32);
  transition:
    background-color var(--t-ui) var(--ease-apple),
    transform var(--t-ui) var(--ease-apple),
    box-shadow var(--t-ui) var(--ease-apple);
}

.btn-cobalt:hover {
  background: var(--cobalt-cta-hover);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22) inset, 0 14px 36px rgba(46, 107, 255, 0.44);
}

.btn-cobalt:active {
  transform: translateY(0) scale(0.985);
}

.hero-sculpture-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: clamp(-3.25rem, -4.4vw, -1.25rem);
  padding-inline: 16px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.hero-sculpture-frame {
  height: min(54svh, 480px);
  width: auto;
  max-width: min(100%, 1340px);
  aspect-ratio: 1376 / 768;
  will-change: transform;
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0%, #000000 18%, #000000 84%, transparent 100%),
    linear-gradient(to right, transparent 0%, #000000 7%, #000000 93%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent 0%, #000000 18%, #000000 84%, transparent 100%),
    linear-gradient(to right, transparent 0%, #000000 7%, #000000 93%, transparent 100%);
  mask-composite: intersect;
}

.hero-sculpture-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}

/* ==========================================================================
   What Is Mathic — Pure Black 3-Pillar Intro Strip
   ========================================================================== */
.section-intro-pillars {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-block: clamp(4.5rem, 8vw, 7rem);
}

.what-is-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
}

.what-is-item {
  padding-top: 22px;
  border-top: 1px solid var(--line-dark-strong);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.what-is-item h3 {
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #FFFFFF;
}

.what-is-item p {
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--ink-dark-muted);
  text-wrap: pretty;
}

/* ==========================================================================
   Keynote "By The Numbers" — Pure Black Sticky Giant Metrics Stage
   ========================================================================== */
.keynote-numbers {
  position: relative;
  background: var(--bg-black);
  color: var(--ink-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.keynote-sticky-shell {
  position: relative;
  height: 340vh;
}

.keynote-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: clip;
  padding-inline: 24px;
}

.keynote-slides {
  position: relative;
  width: min(1040px, 100%);
  min-height: 360px;
  display: grid;
  place-items: center;
}

.keynote-slide {
  grid-area: 1 / 1;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  opacity: 0;
  transform: translate3d(0, 34px, 0) scale(0.95);
  pointer-events: none;
  transition:
    opacity 360ms var(--ease-apple),
    transform 460ms var(--ease-apple);
}

.keynote-slide.is-past {
  opacity: 0;
  transform: translate3d(0, -34px, 0) scale(0.97);
}

.keynote-slide.is-active {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
}

.keynote-figure {
  font-size: var(--text-keynote);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.keynote-figure-up {
  color: var(--fin-up-dark);
  background: linear-gradient(180deg, color-mix(in srgb, var(--fin-up-dark) 42%, #FFFFFF) 0%, var(--fin-up-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.keynote-figure-down {
  color: var(--fin-down-dark);
  background: linear-gradient(180deg, color-mix(in srgb, var(--fin-down-dark) 42%, #FFFFFF) 0%, var(--fin-down-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.keynote-figure-titanium {
  color: #F5F5F7;
  background: linear-gradient(180deg, #FFFFFF 0%, #E8E8ED 52%, #8E8E96 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.keynote-title {
  font-size: var(--text-h2);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: #F5F5F7;
  text-wrap: balance;
}

.keynote-desc {
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--ink-dark-muted);
  max-width: 48ch;
  text-wrap: pretty;
}

.keynote-rail {
  position: absolute;
  right: clamp(12px, 2.5vw, 32px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 4;
}

.keynote-dot {
  width: 28px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.keynote-dot::after {
  content: "";
  width: 6px;
  height: 22px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.46);
  transition:
    background-color 200ms var(--ease-apple),
    transform 200ms var(--ease-apple);
}

.keynote-dot:hover::after {
  background: rgba(255, 255, 255, 0.76);
}

.keynote-dot.is-active::after {
  background: var(--cobalt-ink-dark);
  transform: scaleY(1.25);
}

.keynote-sentinels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

.keynote-sentinel {
  flex: 1 0 25%;
}

/* ==========================================================================
   Shared Section Rhythm (White / Gray / Black Alternation)
   ========================================================================== */
.section {
  padding-block: clamp(5rem, 10vw, 8.75rem);
}

.section-white {
  background: var(--bg-white);
  color: var(--ink-light);
}

.section-gray {
  background: var(--bg-gray);
  color: var(--ink-light);
}

.section-black {
  background: var(--bg-black);
  color: var(--ink-dark);
}

.section-head {
  max-width: 880px;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-head-center {
  margin-inline: auto;
  text-align: center;
  align-items: center;
}

.section-head h2 {
  font-size: var(--text-h2);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.section-black .section-head h2 {
  color: #F5F5F7;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 52%, #A1A1A6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-intro {
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--ink-light-muted);
  max-width: 54ch;
  text-wrap: pretty;
}

.section-black .section-intro {
  color: var(--ink-dark-muted);
}

/* ==========================================================================
   Chapter 1: Strategy Backtest Workbench (White Surface, 28px Rounded Card)
   ========================================================================== */
.workbench-card {
  background: var(--bg-white);
  border-radius: var(--radius-card);
  border: 1px solid var(--line-light);
  box-shadow:
    0 24px 64px rgba(15, 23, 42, 0.08),
    0 2px 6px rgba(15, 23, 42, 0.04);
  padding: clamp(1.5rem, 3.2vw, 2.75rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 2.8vw, 2.25rem);
}

.workbench-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-light);
}

/* Single-Row Scrollable Apple Pill Tablist */
.strategy-tablist {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--bg-gray);
  border-radius: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: inline proximity;
  max-width: 100%;
  --fade-size: 2.25rem;
  scroll-padding-inline: var(--fade-size);
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, black var(--fade-start), black calc(100% - var(--fade-end)), transparent 100%);
  mask-image:
    linear-gradient(to right, transparent 0, black var(--fade-start), black calc(100% - var(--fade-end)), transparent 100%);
}

.strategy-tablist::-webkit-scrollbar {
  display: none;
}

.strategy-tablist.more-start {
  --fade-start: var(--fade-size);
}

.strategy-tablist.more-end {
  --fade-end: var(--fade-size);
}

.strategy-tablist [role="tab"] {
  position: relative;
  flex: none;
  scroll-snap-align: start;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 9px 16px 11px;
  border-radius: 12px;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink-light-muted);
  cursor: pointer;
  white-space: nowrap;
  transition:
    color var(--t-ui) var(--ease-apple),
    background-color var(--t-ui) var(--ease-apple),
    box-shadow var(--t-ui) var(--ease-apple);
}

.tab-code {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: inherit;
}

.tab-sub {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink-light-muted);
}

.strategy-tablist:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: -2px;
}

.strategy-tablist [role="tab"]:hover {
  color: var(--ink-light);
}

.strategy-tablist [role="tab"]:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: -2px;
}

.strategy-tablist [role="tab"][aria-selected="true"] {
  background: #FFFFFF;
  color: var(--ink-light);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* WCAG 1.4.1 non-color shape indicator via border pseudo-element */
.strategy-tablist [role="tab"][aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 3px;
  border-bottom: 2px solid var(--cobalt-cta);
  border-radius: 2px;
}

.workbench-switches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* Apple Segmented Radio Control */
.apple-segmented {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  background: var(--bg-gray);
  border-radius: 14px;
  gap: 2px;
}

.apple-segmented input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.apple-segmented label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink-light-muted);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition:
    color var(--t-ui) var(--ease-apple),
    background-color var(--t-ui) var(--ease-apple),
    box-shadow var(--t-ui) var(--ease-apple);
}

.apple-segmented label:hover {
  color: var(--ink-light);
}

.apple-segmented input[type="radio"]:checked + label {
  background: #FFFFFF;
  color: var(--ink-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.apple-segmented input[type="radio"]:focus-visible + label {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}

/* Giant Telemetry Readout Row */
.telemetry-hero-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.telemetry-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.telemetry-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-light-muted);
}

.telemetry-val {
  font-size: clamp(1.25rem, 2.05vw, 1.95rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--ink-light);
  white-space: nowrap;
}

/* Interactive Chart Canvas */
.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 360px;
}

.strategy-chart-canvas {
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: pan-y;
}

/* Precision Cobalt Apple Range Slider */
.scrubber-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.scrubber-label,
.scrubber-range {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-light-muted);
  white-space: nowrap;
}

.apple-range {
  --attr-min: 0;
  --attr-max: 100;
  --control-value: 100;
  --range-pct: calc((var(--control-value) - var(--attr-min)) / max(1, (var(--attr-max) - var(--attr-min))) * 100%);
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 auto;
  height: 30px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.apple-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(
    to right,
    var(--cobalt-cta) 0%,
    var(--cobalt-cta) var(--range-pct),
    var(--range-track) var(--range-pct),
    var(--range-track) 100%
  );
}

.apple-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid var(--cobalt-cta);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  transition: transform 140ms var(--ease-apple);
}

.apple-range::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.apple-range::-moz-range-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--range-track);
}

.apple-range::-moz-range-progress {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--cobalt-cta);
}

.apple-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid var(--cobalt-cta);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  transition: transform 140ms var(--ease-apple);
}

/* Strategy Panels — Zero styling on [role="tabpanel"] itself (hidden="until-found" rule) */
.strategy-panels {
  display: grid;
  border-top: 1px solid var(--line-light);
}

.strategy-panels > [role="tabpanel"] {
  grid-area: 1 / 1;
}

.strategy-panel-body {
  padding-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr);
  gap: 36px;
  align-items: start;
}

.strategy-thesis-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.strategy-thesis {
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--ink-light);
  max-width: 58ch;
  text-wrap: pretty;
}

.strategy-subnote {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--ink-light-muted);
}

.dossier-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, max-content));
  justify-content: space-between;
  gap: 20px 28px;
}

.dossier-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dossier-metric dt {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-light-muted);
}

.metric-figure {
  font-size: var(--text-metric-sm);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--ink-light);
  white-space: nowrap;
}

.dossier-sublist {
  display: flex;
  flex-direction: column;
}

.dossier-subhead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-light-strong);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-light-muted);
}

.dossier-subrow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  padding-block: 12px;
}

.dossier-subrow:last-child {
  padding-bottom: 0;
}

.dossier-subrow + .dossier-subrow {
  border-top: 1px solid var(--line-light);
}

.subrow-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.subrow-code {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--ink-light);
}

.subrow-desc {
  font-size: var(--text-sm);
  color: var(--ink-light-muted);
}

.subrow-nums {
  display: grid;
  grid-template-columns: repeat(3, 76px);
  gap: 16px;
  text-align: right;
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--ink-light);
}

.subrow-nums.subhead-nums {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-light-muted);
}

/* Workbench Footer + Disclosure Table */
.workbench-footer {
  padding-top: 20px;
  border-top: 1px solid var(--line-light);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.workbench-footnote {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--ink-light-muted);
}

.ledger-disclosure summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--cobalt-ink-light);
  cursor: pointer;
  list-style: none;
  padding-block: 4px;
  transition: opacity var(--t-ui) var(--ease-apple);
}

.ledger-disclosure summary::-webkit-details-marker {
  display: none;
}

.ledger-disclosure summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 200ms var(--ease-apple);
}

.ledger-disclosure[open] summary::after {
  transform: translateY(2px) rotate(-135deg);
}

.ledger-disclosure summary:hover {
  opacity: 0.78;
}

.table-scroll {
  margin-top: 16px;
  overflow-x: auto;
  border-radius: 8px;
}

.table-scroll:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: -2px;
}

.apple-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  text-align: left;
  min-width: 680px;
}

.apple-table caption {
  text-align: left;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-light-muted);
  padding-bottom: 12px;
}

.apple-table th,
.apple-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-light);
  vertical-align: top;
}

.apple-table thead th {
  font-weight: 600;
  color: var(--ink-light-muted);
  border-bottom-color: var(--line-light-strong);
}

.apple-table tbody th {
  font-weight: 600;
  color: var(--ink-light);
  white-space: nowrap;
}

.apple-table tbody td {
  color: var(--ink-light-muted);
}

.apple-table tbody td.fin-up-text {
  color: var(--fin-up-light);
  font-weight: 600;
}

.apple-table tbody td.fin-down-text {
  color: var(--fin-down-light);
  font-weight: 600;
}

.table-code {
  display: block;
  font-weight: 700;
  color: var(--ink-light);
}

.table-sub,
.table-cell-note {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-light-muted);
  margin-top: 2px;
}

.table-tbody-separate tr:first-child th,
.table-tbody-separate tr:first-child td {
  border-top: 2px solid var(--line-light-strong);
  background: rgba(245, 245, 247, 0.55);
}

/* Collapsible Plain-Language Glossary at End of Historical Performance */
.glossary-disclosure {
  margin-top: 24px;
  background: var(--bg-gray);
  border-radius: var(--radius-card);
  border: 1px solid var(--line-light);
  padding: clamp(1.25rem, 2.4vw, 1.65rem) clamp(1.5rem, 3.2vw, 2.75rem);
}

.glossary-disclosure summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--cobalt-ink-light);
  cursor: pointer;
  padding-block: 4px;
  transition: opacity var(--t-ui) var(--ease-apple);
}

.glossary-disclosure summary::-webkit-details-marker {
  display: none;
}

.glossary-disclosure summary::before {
  content: "";
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateX(-2px) rotate(-45deg);
  transition: transform 200ms var(--ease-apple);
}

.glossary-disclosure[open] summary::before {
  transform: translateY(-2px) rotate(45deg);
}

.glossary-disclosure summary:hover {
  opacity: 0.78;
}

.glossary-disclosure::details-content {
  interpolate-size: allow-keywords;
  overflow: clip;
  contain: layout;
}

.glossary-disclosure:not([open])::details-content {
  block-size: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .glossary-disclosure::details-content {
    transition: block-size, content-visibility, display;
    transition-duration: 240ms;
    transition-timing-function: var(--ease-apple);
    transition-behavior: allow-discrete;
  }
}

.glossary-grid {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line-light);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 36px;
}

.glossary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.glossary-item dt {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--ink-light);
}

.glossary-item dd {
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--ink-light-muted);
}

/* ==========================================================================
   Chapter 2: Risk & Stress Tests — Apple Bento Grid (#F5F5F7)
   ========================================================================== */
.bento-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bento-card {
  background: var(--bg-white);
  border-radius: var(--radius-card);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

/* White Full-Width 20-Start-Day Phase Dispersion Card */
.bento-phase-card {
  padding: clamp(1.5rem, 2.8vw, 2.25rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.phase-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.phase-card-head h3 {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--ink-light);
  margin-bottom: 4px;
}

.phase-card-sub {
  font-size: var(--text-sm);
  color: var(--ink-light-muted);
  line-height: 1.5;
}

.phase-readout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 20px 28px;
}

.phase-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.phase-metric-val {
  font-size: var(--text-metric);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink-light);
}

.phase-metric-val-day {
  font-size: clamp(1.125rem, 1.7vw, 1.5rem);
  line-height: 1.25;
}

.phase-canvas-wrap {
  position: relative;
  width: 100%;
  height: 210px;
}

.phase-canvas {
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: pan-y;
}

/* 5 Asymmetric Bento Interactive Cards */
.bento-tests-fieldset {
  width: 100%;
}

.bento-tests-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}

.bento-test-item {
  position: relative;
  display: flex;
}

.bento-span-7 {
  grid-column: span 7;
}

.bento-span-5 {
  grid-column: span 5;
}

.bento-span-4 {
  grid-column: span 4;
}

.bento-test-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.bento-test-card {
  width: 100%;
  padding: clamp(1.5rem, 2.5vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition:
    transform var(--t-ui) var(--ease-apple),
    border-color var(--t-ui) var(--ease-apple),
    box-shadow var(--t-ui) var(--ease-apple);
}

.bento-test-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

.bento-test-item input[type="radio"]:checked + .bento-test-card {
  border-color: var(--cobalt-cta);
  box-shadow: 0 16px 40px rgba(31, 91, 240, 0.14);
}

.bento-test-item input[type="radio"]:focus-visible + .bento-test-card {
  outline: 2px solid var(--cobalt);
  outline-offset: 3px;
}

.bento-test-stat {
  font-size: var(--text-metric-sm);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--ink-light);
}

.bento-test-title {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--ink-light);
}

.bento-test-desc {
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--ink-light-muted);
}

/* Row 4: Full-width Future Expectation Strip Card */
.expectation-strip {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 36px;
}

.expectation-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.expectation-copy h3 {
  font-size: clamp(1.25rem, 2vw, 1.625rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink-light);
}

.expectation-desc {
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--ink-light-muted);
}

.expectation-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px 32px;
}

.expectation-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
}

.expectation-metric + .expectation-metric {
  padding-left: 32px;
  border-left: 1px solid var(--line-light);
}

.expectation-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-light-muted);
}

.expectation-figure {
  font-size: var(--text-metric-sm);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink-light);
  white-space: nowrap;
}

/* ==========================================================================
   Chapter 3: Five-Layer Security Isolation (Pure Black Sticky Scrollytelling)
   ========================================================================== */
.security-scrolly {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: start;
}

.security-sticky-col {
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.glass-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.glass-photo-frame {
  --layer-shift-x: -10px;
  --layer-scale: 1;
  --beam-x: -32%;
  position: relative;
  height: min(460px, calc(100svh - 290px));
  width: auto;
  max-width: 100%;
  margin-inline: auto;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg-black);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000000 10%, #000000 90%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000000 10%, #000000 90%, transparent 100%);
}

.glass-photo-frame[data-active-layer="0"] {
  --beam-x: -17.4%;
}

.glass-photo-frame[data-active-layer="1"] {
  --beam-x: -9%;
}

.glass-photo-frame[data-active-layer="2"] {
  --beam-x: 0%;
}

.glass-photo-frame[data-active-layer="3"] {
  --beam-x: 9%;
}

.glass-photo-frame[data-active-layer="4"] {
  --beam-x: 17.4%;
}

.glass-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.76) brightness(0.92);
  transform: translate3d(var(--layer-shift-x), 0, 0) scale(var(--layer-scale));
  transition:
    transform 340ms var(--ease-apple),
    filter 340ms var(--ease-apple);
}

.glass-photo-frame[data-active-layer="2"] .glass-photo {
  filter: saturate(1.06) brightness(1);
}

.glass-layer-mask,
.glass-layer-beam {
  position: absolute;
  inset: 0 -45%;
  pointer-events: none;
  transform: translate3d(var(--beam-x), 0, 0);
  transition: transform 340ms var(--ease-apple);
}

.glass-layer-mask {
  background: radial-gradient(
    ellipse 17% 72% at 50% 50%,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.12) 48%,
    rgba(0, 0, 0, 0.56) 100%
  );
}

.glass-layer-beam {
  background: radial-gradient(
    ellipse 11% 62% at 50% 50%,
    rgba(72, 134, 255, 0.44) 0%,
    rgba(46, 107, 255, 0.16) 52%,
    rgba(46, 107, 255, 0) 100%
  );
  mix-blend-mode: screen;
}

.plate-meter {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  width: min(520px, 100%);
  margin-inline: auto;
}

.plate-seg {
  height: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.16);
  position: relative;
  overflow: hidden;
}

.plate-seg::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--cobalt);
  opacity: 0;
  transition: opacity 220ms var(--ease-apple);
}

.plate-seg.is-active::after {
  opacity: 1;
}

.glass-telemetry {
  width: min(520px, 100%);
  margin-inline: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line-dark);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
}

.hw-spec-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hw-spec-row-wide {
  grid-column: 1 / -1;
}

.hw-spec-key {
  font-size: var(--text-sm);
  color: var(--ink-dark-muted);
}

.hw-spec-val {
  font-size: var(--text-body);
  font-weight: 600;
  color: #F5F5F7;
  line-height: 1.5;
}

.hw-spec-cobalt {
  color: var(--cobalt-ink-dark);
}

/* Right Scroll-Stepped 5 Layer Options */
.security-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-block: 12px 48px;
}

.security-step {
  position: relative;
}

.security-step input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.security-step label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: 168px;
  padding: 28px 28px 28px 32px;
  border-radius: 22px;
  background: #0B0C10;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  position: relative;
  transition:
    background-color 220ms var(--ease-apple),
    border-color 220ms var(--ease-apple),
    transform 220ms var(--ease-apple);
}

.security-step label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 24px;
  bottom: 24px;
  width: 3px;
  border-radius: var(--radius-pill);
  background: var(--cobalt);
  opacity: 0;
  transition: opacity 200ms var(--ease-apple);
}

.security-step label:hover {
  background: #12141C;
  border-color: rgba(255, 255, 255, 0.22);
}

.security-step.is-active label,
.security-step input[type="radio"]:checked + label {
  background: var(--bg-black-card);
  border-color: rgba(46, 107, 255, 0.65);
}

.security-step.is-active label::before,
.security-step input[type="radio"]:checked + label::before {
  opacity: 1;
}

.security-step input[type="radio"]:focus-visible + label {
  outline: 2px solid var(--cobalt);
  outline-offset: 3px;
}

.security-step-state {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-dark-muted);
  transition: color 200ms var(--ease-apple);
}

.security-step.is-active .security-step-state,
.security-step input[type="radio"]:checked + label .security-step-state {
  color: var(--cobalt-ink-dark);
}

.security-step-name {
  font-size: var(--text-metric);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: #C7C7CC;
  transition: color 200ms var(--ease-apple);
}

.security-step.is-active .security-step-name,
.security-step input[type="radio"]:checked + label .security-step-name {
  color: #FFFFFF;
}

.security-step-desc {
  font-size: var(--text-body);
  line-height: 1.6;
  color: #9A9AA2;
  transition: color 200ms var(--ease-apple);
}

.security-step.is-active .security-step-desc,
.security-step input[type="radio"]:checked + label .security-step-desc {
  color: #D1D1D6;
}

/* ==========================================================================
   Chapter 4: Centered Giant Titanium iPhone Hardware Showcase
   ========================================================================== */
.ios-controls-center {
  display: flex;
  justify-content: center;
  margin-bottom: clamp(2rem, 4.5vw, 3.5rem);
}

.ios-stage-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-block: 12px clamp(3rem, 6vw, 4.75rem);
  overflow: visible;
}

.ios-mockup-caption {
  font-size: var(--text-sm);
  color: var(--ink-light-muted);
  text-align: center;
}

.iphone-motion-rig {
  will-change: transform, opacity;
  transform-origin: center center;
}

/* Brushed Natural Titanium iPhone Chassis */
.iphone-chassis {
  position: relative;
  width: min(372px, calc(100vw - 48px));
  padding: 12px;
  border-radius: 56px;
  background: linear-gradient(145deg, #E3E3E8 0%, #B7B7BF 38%, #8C8C94 72%, #C9C9D0 100%);
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.24),
    0 12px 28px rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.55) inset;
}

.chassis-btn {
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #D5D5DC, #8C8C94);
}

.chassis-btn-action {
  left: -3px;
  top: 112px;
  height: 26px;
}

.chassis-btn-vol-up {
  left: -3px;
  top: 158px;
  height: 48px;
}

.chassis-btn-vol-down {
  left: -3px;
  top: 218px;
  height: 48px;
}

.chassis-btn-power {
  right: -3px;
  top: 176px;
  height: 68px;
}

.iphone-bezel {
  background: #000000;
  border-radius: 46px;
  padding: 10px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8);
}

.iphone-screen {
  background: #0B0C10;
  color: #F5F5F7;
  border-radius: 38px;
  padding: 14px 18px 10px;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.ios-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #FFFFFF;
}

.ios-time {
  font-size: var(--text-sm);
  font-weight: 600;
}

.dynamic-island {
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.island-compact {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.island-icon {
  width: 16px;
  height: 16px;
}

.island-delta {
  font-size: var(--text-sm);
  font-weight: 600;
}

.ios-indicators {
  color: #FFFFFF;
}

.ios-view-portfolio,
.ios-view-widgets {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
}

.ios-view-portfolio[hidden],
.ios-view-widgets[hidden] {
  display: none;
}

.ios-app-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ios-app-title {
  font-size: var(--text-body);
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}

.ios-app-sub {
  font-size: var(--text-sm);
  color: var(--ink-dark-muted);
}

.ios-nav-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ios-muted-line {
  font-size: var(--text-sm);
  color: var(--ink-dark-muted);
}

.ios-nav-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.ios-nav-figure {
  font-size: var(--text-metric);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #FFFFFF;
}

.ios-nav-delta {
  font-size: var(--text-body);
  font-weight: 600;
}

.ios-equity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ios-equity-val {
  font-size: var(--text-sm);
  font-weight: 600;
  color: #F5F5F7;
}

.ios-spark-wrap {
  padding-block: 4px;
}

.ios-spark-svg {
  width: 100%;
  height: auto;
}

.spark-grid {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.spark-stop-top {
  stop-color: var(--fin-up-dark);
  stop-opacity: 0.32;
}

.spark-stop-bottom {
  stop-color: var(--fin-up-dark);
  stop-opacity: 0;
}

.spark-stroke {
  stroke: var(--fin-up-dark);
}

.spark-dot {
  fill: #FFFFFF;
  stroke: var(--fin-up-dark);
  stroke-width: 2;
}

.ios-holdings {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ios-holdings-head {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--ink-dark-muted);
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ios-holding-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ios-holding-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.holding-symbol,
.holding-values {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.holding-values {
  text-align: right;
}

.holding-ticker {
  font-size: var(--text-sm);
  font-weight: 700;
  color: #FFFFFF;
}

.holding-sector,
.holding-amount {
  font-size: var(--text-sm);
  color: var(--ink-dark-muted);
}

.holding-chg {
  font-size: var(--text-sm);
  font-weight: 600;
}

.ios-benchmark-foot {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--ink-dark-muted);
}

/* Widgets & Dynamic Island View inside iPhone */
.ios-live-activity,
.ios-widget-panel,
.ios-widget-cell {
  background: #161820;
  border-radius: 20px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ios-live-activity {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.live-act-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.live-act-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-act-text {
  display: flex;
  flex-direction: column;
}

.live-act-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: #FFFFFF;
}

.live-act-sub,
.widget-sub,
.widget-foot {
  font-size: var(--text-sm);
  color: var(--ink-dark-muted);
}

.live-act-delta {
  font-size: var(--text-body);
  font-weight: 700;
}

.live-act-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-act-meta {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: #E5E5EA;
}

.live-act-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.live-act-fill {
  width: 72%;
  height: 100%;
  border-radius: inherit;
  background: var(--fin-up-dark);
}

.ios-widget-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.widget-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.widget-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: #FFFFFF;
}

.widget-matrix-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.widget-matrix-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--text-sm);
  color: #F5F5F7;
}

.widget-strat-name {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.widget-strat-name strong {
  font-weight: 700;
  color: #FFFFFF;
}

.widget-strat-sub {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-dark-muted);
}

.ios-widget-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ios-widget-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.widget-val {
  font-size: var(--text-sm);
  font-weight: 700;
  color: #FFFFFF;
}

.iphone-home-indicator {
  width: 124px;
  height: 5px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.36);
  margin: 6px auto 2px;
}

/* 4-Column Feature Grid Below iPhone (Zero Nested Cards) */
.ios-features-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
}

.ios-feature-item {
  padding-top: 20px;
  border-top: 1px solid var(--line-light-strong);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ios-feature-item h3 {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--ink-light);
}

.ios-feature-item p {
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--ink-light-muted);
}

/* ==========================================================================
   Apple-Style Light Gray Footer (#F5F5F7)
   ========================================================================== */
.site-footer {
  background: var(--bg-gray);
  color: var(--ink-light-muted);
  border-top: 1px solid var(--line-light);
  padding-block: 44px 52px;
}

.footer-disclaimer {
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--ink-light-muted);
  max-width: 56ch;
  text-wrap: pretty;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-light);
}

.footer-bar {
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}

.footer-brand-group {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-light);
}

.footer-brand-icon {
  width: 20px;
  height: 20px;
}

.footer-wordmark {
  font-size: var(--text-body);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink-light);
}

.footer-copy {
  font-size: var(--text-sm);
  color: var(--ink-light-muted);
}

.footer-nav-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.footer-nav-list a {
  font-size: var(--text-sm);
  color: var(--ink-light-muted);
  transition: color var(--t-ui) var(--ease-apple);
}

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

/* ==========================================================================
   Scroll-Driven Animations (Native CSS @supports + Reduced-Motion Guard)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
    @keyframes header-glass-in {
      from {
        opacity: 0;
      }
      to {
        opacity: 1;
      }
    }

    .header-backdrop {
      animation: header-glass-in auto linear both;
      animation-timeline: scroll(block root);
      animation-range: 0px 96px;
    }

    .site-header.is-menu-open .header-backdrop {
      animation: none;
      opacity: 1;
    }

    /* Strategy Tablist Horizontal Scroll Edge Fade Mask */
    @keyframes reveal-fade-start {
      to {
        --fade-start: var(--fade-size);
      }
    }

    @keyframes hide-fade-end {
      from {
        --fade-end: var(--fade-size);
      }
    }

    .strategy-tablist {
      animation: reveal-fade-start linear both, hide-fade-end linear both;
      animation-timeline: scroll(self inline);
      animation-range: 0 var(--fade-size), calc(100% - var(--fade-size)) 100%;
    }

    /* Hero Scroll-Linked Choreography (scroll(root) avoids scroll-padding-top inset drift at y=0) */
    @keyframes hero-copy-exit {
      from {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
      }
      to {
        opacity: 0;
        transform: translate3d(0, -64px, 0) scale(0.95);
      }
    }

    @keyframes hero-sculpture-rise {
      from {
        transform: translate3d(0, 0, 0) scale(0.96);
      }
      to {
        transform: translate3d(0, -56px, 0) scale(1.1);
      }
    }

    .hero-copy-block {
      animation: hero-copy-exit auto linear both;
      animation-timeline: scroll(block root);
      animation-range: 0px 380px;
    }

    .hero-sculpture-frame {
      animation: hero-sculpture-rise auto linear both;
      animation-timeline: scroll(block root);
      animation-range: 0px 760px;
    }
  }

  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    /* Section Reveal-Up (Never starts at 0 so content is never stuck invisible) */
    @keyframes section-reveal {
      from {
        opacity: 0.18;
        transform: translate3d(0, 42px, 0) scale(0.985);
      }
      to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
      }
    }

    .reveal-up {
      animation: section-reveal auto linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 36%;
    }

    /* Giant iPhone Hardware Tilt-to-Front Scroll Zoom */
    .ios-stage-wrap {
      view-timeline: --ios-stage block;
    }

    @keyframes ios-present {
      from {
        opacity: 0.72;
        transform: perspective(1400px) rotateX(18deg) rotateY(-9deg) scale(0.82) translate3d(0, 64px, 0);
      }
      to {
        opacity: 1;
        transform: perspective(1400px) rotateX(0deg) rotateY(0deg) scale(1) translate3d(0, 0, 0);
      }
    }

    .iphone-motion-rig {
      animation: ios-present auto linear both;
      animation-timeline: --ios-stage;
      animation-range: entry 0% cover 46%;
    }
  }
}

/* JS Fallback classes when CSS view-timeline is unsupported */
.reveal-up.js-reveal-pending {
  opacity: 0.18;
  transform: translate3d(0, 36px, 0);
  transition: opacity 420ms var(--ease-apple), transform 480ms var(--ease-apple);
}

.reveal-up.js-reveal-pending.is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* ==========================================================================
   Responsive Breakpoints (1024 / 899 / 767 / 480)
   ========================================================================== */
@media (max-width: 1024px) {
  .bento-span-7,
  .bento-span-5 {
    grid-column: span 6;
  }

  .bento-span-4 {
    grid-column: span 4;
  }

  .strategy-panel-body {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .ios-features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  /* Keynote Numbers switches from tall sticky stage to spacious vertical beats */
  .keynote-sticky-shell {
    height: auto;
    padding-block: 56px;
  }

  .keynote-stage {
    position: static;
    height: auto;
    padding-inline: 24px;
  }

  .keynote-slides {
    display: flex;
    flex-direction: column;
    gap: 64px;
    min-height: 0;
  }

  .keynote-slide,
  .keynote-slide.is-past,
  .keynote-slide.is-active {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    padding-block: 16px;
  }

  .keynote-slide + .keynote-slide {
    padding-top: 48px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .keynote-figure {
    white-space: normal;
  }

  .keynote-rail,
  .keynote-sentinels {
    display: none;
  }

  .security-scrolly {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .security-sticky-col {
    position: static;
  }

  .glass-photo-frame {
    height: auto;
    width: min(100%, 420px);
  }

  .security-step label {
    min-height: 0;
    padding: 22px 22px 22px 24px;
  }

  .bento-tests-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bento-span-7,
  .bento-span-5,
  .bento-span-4 {
    grid-column: span 1;
  }

  .bento-test-item:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .container {
    width: calc(100% - 36px);
  }

  .site-nav {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .hero {
    min-height: 0;
    padding-top: calc(var(--header-h) + 2.5rem);
    padding-bottom: 2.5rem;
  }

  .hero-sculpture-stage {
    margin-top: 0.75rem;
    padding-inline: 0;
  }

  .hero-sculpture-frame {
    height: auto;
    width: 100%;
    max-width: 100%;
  }

  .what-is-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .telemetry-hero-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .chart-canvas-wrap {
    height: 270px;
  }

  .scrubber-bar {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .apple-range {
    order: 3;
    flex-basis: 100%;
  }

  .dossier-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .glossary-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .bento-tests-grid {
    grid-template-columns: 1fr;
  }

  .bento-test-item:last-child {
    grid-column: auto;
  }

  .expectation-metrics {
    width: 100%;
    flex-direction: column;
    gap: 16px;
  }

  .expectation-metric {
    text-align: left;
  }

  .expectation-metric + .expectation-metric {
    padding-left: 0;
    padding-top: 16px;
    border-left: 0;
    border-top: 1px solid var(--line-light);
    width: 100%;
  }

  .phase-canvas-wrap {
    height: 190px;
  }

  .ios-features-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .iphone-chassis {
    border-radius: 48px;
    padding: 10px;
  }

  .iphone-bezel {
    border-radius: 40px;
    padding: 8px;
  }

  .iphone-screen {
    border-radius: 34px;
    min-height: 580px;
    padding: 12px 14px 10px;
  }

  .footer-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .strategy-tablist [role="tab"] {
    padding: 8px 10px 10px;
  }

  .strategy-tablist [role="tab"][aria-selected="true"]::after {
    left: 10px;
    right: 10px;
  }

  .telemetry-val {
    font-size: 1.0625rem;
  }

  .subrow-nums {
    grid-template-columns: repeat(3, 68px);
    font-size: 0.9375rem;
    gap: 12px;
  }

  .subrow-nums.subhead-nums {
    font-size: 0.75rem;
  }
}

/* ==========================================================================
   Reduced Motion & Forced Colors Safety (Zero Content Stuck at opacity: 0)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .header-backdrop,
  .brand,
  .brand-wordmark,
  .nav-list a,
  .nav-toggle,
  .nav-bar-top,
  .nav-bar-bottom,
  .mobile-nav,
  .mobile-nav-list a,
  .btn-cobalt,
  .keynote-slide,
  .keynote-dot::after,
  .strategy-tablist [role="tab"],
  .apple-segmented label,
  .ledger-disclosure summary,
  .ledger-disclosure summary::after,
  .glossary-disclosure summary,
  .glossary-disclosure summary::before,
  .bento-test-card,
  .glass-photo,
  .glass-layer-mask,
  .glass-layer-beam,
  .plate-seg::after,
  .security-step label,
  .security-step label::before,
  .security-step-state,
  .security-step-name,
  .security-step-desc,
  .footer-nav-list a,
  .reveal-up.js-reveal-pending {
    transition-duration: 0s !important;
  }

  .apple-range::-webkit-slider-thumb {
    transition-duration: 0s !important;
  }

  .apple-range::-moz-range-thumb {
    transition-duration: 0s !important;
  }

  .header-backdrop,
  .hero-copy-block,
  .hero-sculpture-frame,
  .reveal-up,
  .iphone-motion-rig,
  .strategy-tablist {
    animation: none !important;
    transform: none !important;
  }

  .hero-copy-block,
  .reveal-up,
  .iphone-motion-rig {
    opacity: 1 !important;
  }

  /* Keynote numbers unpack into full visible vertical cadence */
  .keynote-sticky-shell {
    height: auto !important;
    padding-block: 64px;
  }

  .keynote-stage {
    position: static !important;
    height: auto !important;
  }

  .keynote-slides {
    display: flex;
    flex-direction: column;
    gap: 56px;
    min-height: 0;
  }

  .keynote-slide,
  .keynote-slide.is-past,
  .keynote-slide.is-active {
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto;
  }

  .keynote-slide + .keynote-slide {
    padding-top: 44px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .keynote-rail,
  .keynote-sentinels {
    display: none !important;
  }

  .glass-photo {
    transform: none !important;
  }
}

@media (forced-colors: active) {
  .hero-title,
  .keynote-figure,
  .section-black .section-head h2 {
    background: none;
    -webkit-text-fill-color: CanvasText;
    color: CanvasText;
  }
}
