/* New Gold Official Website Stylesheet */

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

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

:root {
  --bg-pearl: #EEF1F4;
  --bg-surface: #F9FAFC;
  --bg-obsidian: #161B20;
  --bg-obsidian-elevated: #222A31;

  --ink-primary: #23313D;
  --ink-muted: #526576;
  --ink-dark-primary: #ECF1F5;
  --ink-dark-muted: #A2B2BF;

  --accent-gold: #80662F;
  --accent-gold-hover: #6B5526;
  --accent-champagne: #DDCFB1;
  --accent-soft: #F4EDDF;

  --line-light: #D8DEE4;
  --line-dark: #3A4650;

  --fin-red: #D74753;
  --fin-green: #13876D;
  --fin-red-dark: #FF8892;
  --fin-green-dark: #63D4B9;

  --fin-up: var(--fin-red);
  --fin-down: var(--fin-green);
  --fin-up-dark: var(--fin-red-dark);
  --fin-down-dark: var(--fin-green-dark);

  --font-sans: 'Inter', 'PingFang SC', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Noto Sans SC', sans-serif;

  /* Strictly 3 body font-size steps below the hero */
  --text-heading: clamp(1.85rem, 3.2vw, 2.65rem);
  --text-body: 1.0625rem;
  --text-sm: 0.875rem;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --container-max: 1120px;
  --header-h: 72px;
}

html[data-fin-convention="us"] {
  --fin-up: var(--fin-green);
  --fin-down: var(--fin-red);
  --fin-up-dark: var(--fin-green-dark);
  --fin-down-dark: var(--fin-red-dark);
}

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

html {
  scroll-padding-top: 58px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--ink-primary);
  background-color: var(--bg-pearl);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

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

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

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

ul {
  list-style: none;
  padding: 0;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.fin-up-text {
  color: var(--fin-up);
}

.fin-down-text {
  color: var(--fin-down);
}

.fin-up-text-dark {
  color: var(--fin-up-dark);
}

.section-obsidian .fin-up-text {
  color: var(--fin-up-dark);
}

.section-obsidian .fin-down-text {
  color: var(--fin-down-dark);
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 200;
  padding: 10px 18px;
  font-size: var(--text-sm);
  font-weight: 600;
  background-color: var(--ink-primary);
  color: #FFFFFF;
  border-radius: 8px;
}

:where(a:any-link, button, input, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 3px;
}

.section-obsidian :where(a:any-link, button, input, summary, [tabindex]):focus-visible {
  outline-color: var(--accent-champagne);
}

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

/* ==========================================================================
   Header & Scroll-Driven Glass Separation
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 100;
  color: var(--ink-primary);
}

.header-glass {
  position: absolute;
  inset: 0;
  background-color: rgba(238, 241, 244, 0.84);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--line-light);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease-out);
}

.site-header.is-scrolled .header-glass {
  opacity: 1;
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 24px;
  transition: min-height 220ms var(--ease-out);
}

.site-header.is-scrolled .header-inner {
  min-height: 58px;
}

@keyframes header-glass-reveal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
    .header-glass {
      animation: header-glass-reveal auto linear both;
      animation-timeline: scroll(block root);
      animation-range: 0px 110px;
    }
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  flex-shrink: 0;
}

.brand-icon {
  border-radius: 7px;
  flex-shrink: 0;
}

/* Exempt above-the-fold brand wordmark */
.brand-wordmark {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink-primary);
}

.site-nav {
  display: flex;
  align-items: center;
}

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

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-muted);
  white-space: nowrap;
  transition: color 180ms var(--ease-out);
}

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

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--ink-primary);
  cursor: pointer;
  transition: background-color 180ms var(--ease-out);
}

.nav-toggle:hover {
  background-color: rgba(35, 49, 61, 0.06);
}

.mobile-nav {
  position: relative;
  background-color: rgba(249, 250, 252, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line-light);
}

.mobile-nav[hidden] {
  display: none;
}

.mobile-nav-list {
  width: min(100% - 48px, var(--container-max));
  margin-inline: auto;
  padding: 8px 0 16px;
}

.mobile-nav-list li + li {
  border-top: 1px solid var(--line-light);
}

.mobile-nav-list a {
  display: flex;
  align-items: center;
  min-height: 48px;
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--ink-primary);
}

/* ==========================================================================
   Monumental Hero Stage
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding-top: calc(var(--header-h) + 28px);
  padding-bottom: 72px;
  background-color: var(--bg-pearl);
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-orbit-stage {
  position: relative;
  width: clamp(200px, 24vw, 290px);
  aspect-ratio: 1 / 1;
  margin-bottom: 24px;
  display: grid;
  place-items: center;
}

.hero-orbit-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Feather perimeter seamlessly into #EEF1F4 pearl stage without altering the sculpture */
  -webkit-mask-image: radial-gradient(closest-side, #000 56%, rgba(0, 0, 0, 0.72) 74%, transparent 94%);
  mask-image: radial-gradient(closest-side, #000 56%, rgba(0, 0, 0, 0.72) 74%, transparent 94%);
}

@keyframes hero-orbit-lift {
  from {
    transform: translateY(0) scale(1);
  }
  to {
    transform: translateY(-28px) scale(0.95);
  }
}

@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
    .hero-orbit-stage {
      animation: hero-orbit-lift auto linear both;
      animation-timeline: scroll(block root);
      animation-range: 0px 520px;
    }
  }
}

/* Exempt above-the-fold Hero H1 */
.hero-title {
  font-size: clamp(2.85rem, 6.2vw, 5.75rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.06;
  color: var(--ink-primary);
  max-width: 16ch;
  text-wrap: balance;
}

.hero-copy {
  margin-top: 22px;
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--ink-muted);
  max-width: 44ch;
  text-wrap: pretty;
}

.hero-action {
  margin-top: 34px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
  border-radius: 999px;
  background-color: var(--accent-gold);
  color: #FFFFFF;
  font-size: var(--text-body);
  font-weight: 500;
  letter-spacing: -0.01em;
  transition:
    background-color 180ms var(--ease-out),
    transform 180ms var(--ease-out);
}

.btn-primary:hover {
  background-color: var(--accent-gold-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.motion-toggle {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 2;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-light);
  border-radius: 999px;
  background-color: rgba(249, 250, 252, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition:
    color 180ms var(--ease-out),
    border-color 180ms var(--ease-out),
    background-color 180ms var(--ease-out);
}

.motion-toggle:hover {
  color: var(--ink-primary);
  border-color: var(--ink-muted);
  background-color: var(--bg-surface);
}

/* ==========================================================================
   Section Rhythm & Scroll-Driven Entry Reveals
   ========================================================================== */

.section {
  padding-block: clamp(64px, 7.2vw, 96px);
}

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

.section-pearl {
  background-color: var(--bg-pearl);
  color: var(--ink-primary);
}

.section-gallery {
  background-color: var(--bg-surface);
  color: var(--ink-primary);
}

.section-head {
  max-width: 68ch;
}

h2 {
  font-size: var(--text-heading);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.14;
  text-wrap: balance;
}

h3 {
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.45;
}

.section-intro {
  margin-top: 16px;
  font-size: var(--text-body);
  line-height: 1.65;
  max-width: 60ch;
  color: var(--ink-muted);
}

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

/* Scroll-driven reveal: always visible at rest, progressive entry when motion allowed */
@keyframes reveal-up {
  from {
    opacity: 0.15;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .reveal-item {
      animation: reveal-up auto linear backwards;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }
}

.reveal-item.js-reveal-pending {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 420ms var(--ease-out),
    transform 420ms var(--ease-out);
}

.reveal-item.js-reveal-pending.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Chapter 1: Strategy Evolution Lab (Tabs + Interactive Chart)
   ========================================================================== */

.strategy-tabs {
  margin-top: 44px;
}

.strategy-tablist-frame {
  border-bottom: 1px solid var(--line-dark);
}

.strategy-tablist {
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: inline proximity;
  --fade-size: 2.5rem;
  --fade-dir: right;
  --fade-start-pos: 0;
  --fade-end-pos: 100%;
  scroll-padding-inline: var(--fade-size);
  -webkit-mask:
    linear-gradient(black, black) no-clip subtract,
    linear-gradient(to var(--fade-dir), black, transparent) var(--fade-start-pos) 0 / var(--fade-start) 100% no-repeat no-clip,
    linear-gradient(to var(--fade-dir), transparent, black) var(--fade-end-pos) 0 / var(--fade-end) 100% no-repeat no-clip;
  mask:
    linear-gradient(black, black) no-clip subtract,
    linear-gradient(to var(--fade-dir), black, transparent) var(--fade-start-pos) 0 / var(--fade-start) 100% no-repeat no-clip,
    linear-gradient(to var(--fade-dir), transparent, black) var(--fade-end-pos) 0 / var(--fade-end) 100% no-repeat no-clip;
}

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

@keyframes tab-reveal-fade-start {
  to {
    --fade-start: var(--fade-size);
  }
}

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

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

.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;
  min-height: 48px;
  padding: 12px 18px 14px;
  border: 0;
  background: transparent;
  color: var(--ink-dark-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color 180ms var(--ease-out);
}

.strategy-tablist [role="tab"]:first-child {
  padding-inline-start: 0;
}

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

.strategy-tablist [role="tab"][aria-selected="true"] {
  color: var(--accent-champagne);
}

/* Forced-colors safe underline on pseudo-element; never changes tab dimensions */
.strategy-tablist [role="tab"][aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  border-block-end: 2px solid var(--accent-champagne);
}

.strategy-tablist [role="tab"]:first-child[aria-selected="true"]::after {
  inset-inline-start: 0;
}

/* Panels share one grid cell with zero gap; zero padding/border/bg on [role="tabpanel"] itself */
.strategy-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

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

.strategy-panel-inner {
  padding-block: 24px 28px;
}

.strategy-desc {
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--ink-dark-primary);
  max-width: 60ch;
}

.metric-strip {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line-dark);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.metric-cell dt {
  font-size: var(--text-sm);
  color: var(--ink-dark-muted);
}

.metric-value {
  margin-top: 6px;
  font-size: var(--text-heading);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

/* Elevated Obsidian Chart Stage */
.lab-chart-stage {
  background-color: var(--bg-obsidian-elevated);
  border: 1px solid var(--line-dark);
  border-radius: 16px;
  padding: 28px;
}

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

.chart-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 32px;
}

.readout-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.readout-val {
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--ink-dark-primary);
}

.chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Apple-style Connected Segmented Radio Controls */
.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  margin: 0;
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
}

.segmented-dark {
  background-color: var(--bg-obsidian);
  border: 1px solid var(--line-dark);
}

.segmented-light {
  background-color: #E2E7EC;
  border: 1px solid var(--line-light);
}

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

.segmented label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 7px;
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition:
    background-color 180ms var(--ease-out),
    color 180ms var(--ease-out);
}

.segmented-dark label {
  color: var(--ink-dark-muted);
}

.segmented-dark label:hover {
  color: var(--ink-dark-primary);
}

.segmented-dark input[type="radio"]:checked + label {
  background-color: var(--bg-obsidian-elevated);
  color: var(--accent-champagne);
}

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

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

.segmented-light input[type="radio"]:checked + label {
  background-color: var(--bg-surface);
  color: var(--ink-primary);
  box-shadow: 0 1px 2px rgba(35, 49, 61, 0.08);
}

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

.segmented-dark input[type="radio"]:focus-visible + label {
  outline-color: var(--accent-champagne);
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 340px;
  margin-top: 20px;
}

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

.chart-scrubber-bar,
.dispersion-slider-bar {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-dark);
  display: flex;
  align-items: center;
  gap: 16px;
}

.dispersion-slider-bar {
  border-top-color: var(--line-light);
}

.scrubber-label,
.scrubber-hint {
  font-size: var(--text-sm);
  white-space: nowrap;
}

.section-obsidian .scrubber-label,
.section-obsidian .scrubber-hint {
  color: var(--ink-dark-muted);
}

.section-pearl .scrubber-label,
.section-pearl .scrubber-hint {
  color: var(--ink-muted);
}

.precision-range {
  flex: 1;
  min-width: 120px;
  height: 28px;
  margin: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.precision-range::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 2px;
}

.range-dark::-webkit-slider-runnable-track {
  background-color: var(--line-dark);
}

.range-light::-webkit-slider-runnable-track {
  background-color: var(--line-light);
}

.precision-range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -7px;
  border-radius: 50%;
  border: 2px solid var(--bg-obsidian-elevated);
  background-color: var(--accent-champagne);
  transition: transform 160ms var(--ease-out);
}

.range-light::-webkit-slider-thumb {
  border-color: var(--bg-surface);
  background-color: var(--accent-gold);
}

.precision-range::-webkit-slider-thumb:hover {
  transform: scale(1.16);
}

.precision-range::-moz-range-track {
  height: 2px;
  border-radius: 2px;
  background-color: var(--line-dark);
}

.range-light::-moz-range-track {
  background-color: var(--line-light);
}

.precision-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg-obsidian-elevated);
  background-color: var(--accent-champagne);
}

.range-light::-moz-range-thumb {
  border-color: var(--bg-surface);
  background-color: var(--accent-gold);
}

.chart-footer-bar {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.chart-data-details summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--accent-champagne);
  cursor: pointer;
}

.details-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

/* ==========================================================================
   Chapter 2: New Gold iOS 27 Native Terminal
   ========================================================================== */

.ios-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 416px);
  gap: clamp(40px, 6vw, 84px);
  align-items: start;
}

.feature-list {
  margin-top: 36px;
  border-top: 1px solid var(--line-light);
}

.feature-row {
  padding-block: 22px;
  border-bottom: 1px solid var(--line-light);
}

.feature-row h3 {
  color: var(--ink-primary);
}

.feature-row p {
  margin-top: 6px;
  font-size: var(--text-body);
  color: var(--ink-muted);
  max-width: 54ch;
}

.ios-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.ios-mode-switch {
  max-width: 100%;
}

/* Precision iPhone 17 Pro Titanium Hardware Mockup */
.iphone-device {
  position: relative;
  width: 100%;
  max-width: 366px;
  padding: 5px;
  border-radius: 54px;
  background: linear-gradient(145deg, #D5DBE1 0%, #9CA6B0 28%, #C8CFD6 60%, #86919C 100%);
  box-shadow:
    0 32px 64px -22px rgba(35, 49, 61, 0.24),
    0 8px 20px -8px rgba(35, 49, 61, 0.14),
    inset 0 1px 1px rgba(255, 255, 255, 0.7);
}

.iphone-btn {
  position: absolute;
  width: 3px;
  background-color: #939DA8;
  border-radius: 2px;
}

.iphone-btn-action {
  left: -3px;
  top: 112px;
  height: 28px;
}

.iphone-btn-vol-up {
  left: -3px;
  top: 162px;
  height: 52px;
}

.iphone-btn-vol-down {
  left: -3px;
  top: 226px;
  height: 52px;
}

.iphone-btn-power {
  right: -3px;
  top: 184px;
  height: 76px;
}

.iphone-bezel {
  padding: 10px;
  border-radius: 49px;
  background-color: #111418;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.iphone-screen {
  position: relative;
  min-height: 616px;
  padding: 16px 20px 20px;
  border-radius: 40px;
  background-color: var(--bg-surface);
  color: var(--ink-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background-color 220ms var(--ease-out);
}

.iphone-device[data-ios-view="widgets"] .iphone-screen {
  background: linear-gradient(180deg, #E3E8EE 0%, #EEF1F4 52%, #E8E4DA 100%);
}

.ios-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
}

.ios-time {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-primary);
  min-width: 44px;
}

.dynamic-island {
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background-color: #111418;
  color: var(--ink-dark-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    width 220ms var(--ease-out),
    padding 220ms var(--ease-out);
}

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

.island-icon {
  border-radius: 4px;
}

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

.ios-indicators {
  color: var(--ink-primary);
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 44px;
}

.ios-app-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-light);
}

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

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

.ios-nav-hero {
  padding-block: 18px 14px;
}

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

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

.ios-nav-figure {
  font-size: var(--text-heading);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--ink-primary);
}

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

.ios-equity-line {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.ios-equity-val {
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--ink-primary);
  transition: opacity 180ms var(--ease-out);
}

.ios-sensitive {
  transition:
    filter 200ms var(--ease-out),
    opacity 200ms var(--ease-out);
}

.iphone-device[data-ios-view="privacy"] .ios-sensitive {
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.ios-sparkline-box {
  padding-block: 8px 14px;
  border-bottom: 1px solid var(--line-light);
}

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

.spark-grid {
  stroke: var(--line-light);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.spark-stroke {
  stroke: var(--fin-up);
  transition: stroke 200ms var(--ease-out);
}

.spark-dot {
  fill: var(--fin-up);
  transition: fill 200ms var(--ease-out);
}

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

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

.ios-holdings {
  margin-top: 14px;
  flex: 1;
}

.ios-holdings-head {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--ink-muted);
  padding-bottom: 8px;
}

.ios-holding-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 10px;
  border-top: 1px solid var(--line-light);
}

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

.holding-values {
  align-items: flex-end;
}

.holding-ticker,
.holding-amount {
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.25;
}

.holding-weight,
.holding-chg {
  font-size: var(--text-sm);
  line-height: 1.25;
}

.holding-weight {
  color: var(--ink-muted);
}

.holding-chg {
  font-weight: 500;
}

/* iOS View 2: Expanded Dynamic Island + Widgets */
.ios-view-widgets {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

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

.ios-live-activity {
  padding: 16px;
  border-radius: 24px;
  background-color: #161B20;
  color: var(--ink-dark-primary);
}

.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-icon {
  border-radius: 7px;
  flex-shrink: 0;
}

.live-act-name {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-dark-primary);
}

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

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

.live-act-bar-wrap {
  margin-top: 14px;
}

.live-act-meta {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--ink-dark-muted);
  margin-bottom: 8px;
}

.live-act-track {
  height: 4px;
  border-radius: 999px;
  background-color: var(--line-dark);
  overflow: hidden;
}

.live-act-fill {
  width: 78%;
  height: 100%;
  border-radius: 999px;
  background-color: var(--accent-champagne);
}

.ios-widget-medium {
  padding: 16px 18px;
  border-radius: 22px;
  background-color: rgba(249, 250, 252, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.widget-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.widget-title {
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--ink-primary);
}

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

.widget-matrix-list li {
  display: flex;
  justify-content: space-between;
  padding-block: 8px;
  border-top: 1px solid var(--line-light);
  font-size: var(--text-sm);
  font-weight: 500;
}

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

.ios-widget-small {
  padding: 16px;
  border-radius: 22px;
  background-color: rgba(249, 250, 252, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.75);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.widget-big {
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--ink-primary);
}

.widget-foot {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.iphone-home-indicator {
  width: 118px;
  height: 4px;
  border-radius: 999px;
  background-color: rgba(35, 49, 61, 0.24);
  margin: 14px auto 0;
}

/* ==========================================================================
   Chapter 3: Five-Layer Fail-Closed Engineering Security
   ========================================================================== */

.security-layout {
  margin-top: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.layer-selector {
  margin: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line-light);
}

.layer-option {
  position: relative;
  border-bottom: 1px solid var(--line-light);
}

.layer-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.layer-option label {
  position: relative;
  display: block;
  padding: 20px 16px 20px 20px;
  cursor: pointer;
  transition: background-color 180ms var(--ease-out);
}

.layer-option label::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background-color: transparent;
  transition: background-color 180ms var(--ease-out);
}

.layer-option label:hover {
  background-color: var(--bg-pearl);
}

.layer-option input[type="radio"]:checked + label {
  background-color: var(--bg-pearl);
}

.layer-option input[type="radio"]:checked + label::before {
  background-color: var(--accent-gold);
}

.layer-option input[type="radio"]:focus-visible + label {
  outline: 3px solid var(--accent-gold);
  outline-offset: -3px;
}

.layer-name {
  display: block;
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--ink-primary);
}

.layer-summary {
  display: block;
  margin-top: 4px;
  font-size: var(--text-body);
  color: var(--ink-muted);
}

.security-diagram-wrap {
  background-color: var(--bg-pearl);
  border: 1px solid var(--line-light);
  border-radius: 16px;
  overflow: hidden;
}

.security-svg {
  width: 100%;
  height: auto;
  padding: 18px 18px 8px;
}

.bp-grid line {
  stroke: #DDE3E9;
  stroke-width: 1;
}

.bp-layer {
  cursor: pointer;
}

.bp-frame {
  fill: rgba(249, 250, 252, 0.72);
  stroke: #B8C3CE;
  stroke-width: 1.25;
  transition:
    fill 200ms var(--ease-out),
    stroke 200ms var(--ease-out),
    stroke-width 200ms var(--ease-out);
}

.bp-label {
  font-size: var(--text-sm);
  font-weight: 500;
  fill: #526576;
  transition: fill 200ms var(--ease-out);
}

.bp-layer:hover .bp-frame {
  stroke: #80662F;
}

.bp-layer.is-active .bp-frame {
  fill: rgba(244, 237, 223, 0.65);
  stroke: #80662F;
  stroke-width: 2;
}

.bp-layer.is-active .bp-label {
  fill: #23313D;
  font-weight: 600;
}

.bp-node {
  fill: #23313D;
}

.bp-node-text {
  font-size: var(--text-sm);
  font-weight: 500;
  fill: #ECF1F5;
}

.bp-node-masked {
  fill: #EEF1F4;
  stroke: #8E9DAA;
  stroke-width: 1.25;
  stroke-dasharray: 4 3;
}

.bp-node-text-muted {
  font-size: var(--text-sm);
  font-weight: 500;
  fill: #526576;
}

.bp-gap-line {
  stroke: #8E9DAA;
  stroke-width: 1.5;
}

.bp-cut {
  stroke: #80662F;
  stroke-width: 2;
  stroke-linecap: round;
}

.security-spec-bar {
  display: grid;
  grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr);
  gap: 16px 24px;
  padding: 20px 24px;
  border-top: 1px solid var(--line-light);
  background-color: var(--bg-surface);
}

.spec-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.spec-val {
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--ink-primary);
}

/* ==========================================================================
   Chapter 4: Institutional Falsification & Stress-Testing
   ========================================================================== */

.audit-dispersion-stage {
  margin-top: 44px;
  padding: 32px;
  background-color: var(--bg-surface);
  border: 1px solid var(--line-light);
  border-radius: 16px;
}

.dispersion-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px 32px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-light);
}

.dispersion-sub {
  margin-top: 6px;
  font-size: var(--text-body);
  color: var(--ink-muted);
  max-width: 52ch;
}

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

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

.phase-metric-label {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.phase-metric-val {
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--ink-primary);
}

.phase-metric-val.fin-up-text {
  color: var(--fin-up);
}

.phase-metric-val.fin-down-text {
  color: var(--fin-down);
}

.dispersion-visual {
  margin-top: 24px;
}

.phase-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.expectation-strip {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line-light);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.expectation-cell dt {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.expectation-cell dd {
  color: var(--ink-primary);
}

.expectation-cell .fin-down-text {
  color: var(--fin-down);
}

/* Semantic Data Tables */
.audit-table-wrap {
  margin-top: 44px;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table caption {
  text-align: left;
  font-size: var(--text-sm);
  font-weight: 500;
  padding-bottom: 14px;
}

.data-table-light caption {
  color: var(--ink-muted);
}

.data-table-dark caption {
  color: var(--ink-dark-muted);
}

.data-table th,
.data-table td {
  padding: 16px 18px 16px 0;
  vertical-align: top;
}

.data-table thead th {
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
}

.data-table tbody th {
  font-size: var(--text-body);
  font-weight: 600;
  min-width: 180px;
}

.data-table tbody td {
  font-size: var(--text-body);
}

.data-table-light thead th {
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line-light);
}

.data-table-light tbody th {
  color: var(--ink-primary);
  border-bottom: 1px solid var(--line-light);
}

.data-table-light tbody td {
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line-light);
}

.data-table-dark thead th {
  color: var(--ink-dark-muted);
  border-bottom: 1px solid var(--line-dark);
}

.data-table-dark tbody th {
  color: var(--ink-dark-primary);
  border-bottom: 1px solid var(--line-dark);
}

.data-table-dark tbody td {
  color: var(--ink-dark-muted);
  border-bottom: 1px solid var(--line-dark);
}

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

.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--line-light);
  padding-block: 48px 40px;
}

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

.footer-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}

.footer-nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: var(--text-sm);
  color: var(--ink-muted);
  transition: color 180ms var(--ease-out);
}

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

.footer-bottom {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 32px;
}

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

.footer-disclaimer {
  max-width: 65ch;
}

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

@media (max-width: 960px) {
  .ios-layout,
  .security-layout {
    grid-template-columns: 1fr;
  }

  .ios-showcase {
    margin-top: 12px;
  }

  .metric-strip,
  .expectation-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .site-nav {
    display: none;
  }

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

  .hero {
    padding-top: calc(var(--header-h) + 20px);
    padding-bottom: 84px;
  }

  .motion-toggle {
    right: 16px;
    bottom: 16px;
  }

  .lab-chart-stage,
  .audit-dispersion-stage {
    padding: 20px 16px;
  }

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

  .metric-strip,
  .expectation-strip,
  .security-spec-bar {
    grid-template-columns: 1fr;
  }

  .chart-scrubber-bar,
  .dispersion-slider-bar {
    flex-wrap: wrap;
  }

  .segmented label {
    padding: 0 10px;
  }

  .data-table-light thead {
    display: none;
  }

  .data-table-light,
  .data-table-light tbody,
  .data-table-light tr,
  .data-table-light th,
  .data-table-light td {
    display: block;
    width: 100%;
  }

  .data-table-light tr {
    padding-block: 16px;
    border-bottom: 1px solid var(--line-light);
  }

  .data-table-light tbody th,
  .data-table-light tbody td {
    padding: 4px 0;
    border-bottom: 0;
    min-width: 0;
  }
}

@media (pointer: coarse) {
  .segmented label,
  .strategy-tablist [role="tab"] {
    min-height: 44px;
  }
}
