/* memirror.app — Editorial Modernism & Contemplative Clarity
   Inspired by BridgeBio's Swiss architectural grid, hairline dividers,
   warm organic Sandstone surfaces, and high-contrast editorial typography.
   Zero CSS gradients. */

:root {
  /* Sandstone — Warm Organic Paper & Neutrals */
  --sandstone-100: #FBFBF9;
  --sandstone-200: #F6F4EE;
  --sandstone-300: #EFECE1;
  --sandstone-400: #E7E3D3;
  --sandstone-500: #DDD8C3;
  --sandstone-600: #787569;
  --sandstone-700: #5E5B52;
  --sandstone-800: #3D3B35;
  --sandstone-900: #1B1B18;

  /* Serene Indigo — Solid Scientific & Contemplative Accent (BridgeBio Pipeline Tint) */
  --serene-100: #ECEEFE;
  --serene-200: #D9DDFD;
  --serene-300: #B2BCFB;
  --serene-500: #3B52E6;
  --serene-600: #253CD4;
  --serene-700: #1428B8;

  /* Warm Sage — Quiet Grounding Surface */
  --sage-100: #EFF2ED;
  --sage-200: #DFE5DC;

  /* Structural Ink & Hairline Dividers */
  --ink: #0F0F0E;
  --ink-2: #3D3B35;
  --ink-3: #6F6C62;
  --ink-4: #8E8B80;
  --paper: var(--sandstone-100);
  --surface: var(--sandstone-200);
  --tile: var(--sandstone-300);
  --divider: #DCDCDC;
  --divider-warm: #DFDBD0;
  --white: #FFFFFF;

  /* Layout & Grid */
  --max: 1440px;
  --gutter: clamp(20px, 4vw, 56px);

  /* Typography */
  --serif: 'Newsreader', 'Libre Caslon Text', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

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

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Typography Helpers ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sandstone-600);
  margin: 0 0 18px;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--serene-500);
  display: inline-block;
}

/* ---------- Top Navigation Bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--divider);
  transition: background-color 0.2s ease;
}

.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 24px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
}

.topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.topbar .brand img {
  height: 26px;
  width: auto;
  filter: brightness(0);
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.2vw, 32px);
}

.topbar-links a,
.topbar-right a:not(.nav-cta) {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
  padding: 4px 0;
  position: relative;
  transition: color 0.15s ease;
}

.topbar-links a::after,
.topbar-right a:not(.nav-cta)::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.topbar-links a:hover::after,
.topbar-links a[aria-current="page"]::after,
.topbar-right a:not(.nav-cta):hover::after {
  transform: scaleX(1);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 24px);
}

.topbar .nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 9999px;
  background: var(--ink);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.topbar .nav-cta:hover {
  background: var(--sandstone-800);
}

.topbar .nav-cta .arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.topbar .nav-cta:hover .arrow {
  transform: translateX(3px);
}

@media (max-width: 860px) {
  .topbar .nav-hide-md {
    display: none;
  }
}

@media (max-width: 560px) {
  .topbar .nav-hide-sm {
    display: none;
  }
  .topbar .container {
    min-height: 64px;
  }
}

/* ---------- Buttons & Interactive Controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 26px;
  border-radius: 9999px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: none;
}

.btn .arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.btn:hover .arrow {
  transform: translateX(4px);
}

.btn-dark {
  background: var(--ink);
  color: var(--white);
}

.btn-dark:hover {
  background: var(--sandstone-800);
}

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

.btn-outline:hover {
  background: var(--sandstone-300);
}

.btn-sandstone {
  background: var(--sandstone-300);
  color: var(--ink);
  border-color: var(--sandstone-400);
}

.btn-sandstone:hover {
  background: var(--sandstone-400);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--ink);
  white-space: nowrap;
}

.link-arrow .arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.link-arrow:hover .arrow {
  transform: translateX(4px);
}

/* ---------- Architectural Section & Grid System ---------- */

.arch-band {
  border-bottom: 1px solid var(--divider);
  background: var(--paper);
}

.arch-band.band-serene {
  background: var(--serene-100);
}

.arch-band.band-surface {
  background: var(--surface);
}

.arch-band.band-sage {
  background: var(--sage-100);
}

/* ---------- Hero Section (BridgeBio 8:4 Architectural Split) ---------- */

.hero-split {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  max-width: var(--max);
  margin: 0 auto;
  border-left: 1px solid var(--divider);
  border-right: 1px solid var(--divider);
}

.hero-main {
  grid-column: span 8;
  padding: clamp(44px, 6vw, 84px) clamp(24px, 4.5vw, 64px);
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(32px, 4.5vw, 52px);
  background: var(--paper);
}

.hero-main h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.65rem, 5.2vw, 4.85rem);
  line-height: 1.05;
  letter-spacing: -0.022em;
  color: var(--ink);
  margin: 0 0 24px;
  max-width: 16.5ch;
}

.hero-main h1 em {
  font-style: italic;
  font-weight: 300;
}

.hero-lead {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 58ch;
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.hero-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--divider);
  padding-top: 28px;
  gap: 24px;
}

.hero-pillar-num {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--sandstone-600);
  margin-bottom: 6px;
}

.hero-pillar-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 4px;
}

.hero-pillar-desc {
  display: block;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink-3);
}

/* Right 4-column hero block: matted gallery portrait plate + bottom Sandstone-300 corner CTA tile */
.hero-aside {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
}

.hero-media-mat {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 3.5vw, 44px);
  gap: 14px;
}

.hero-media-frame {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  aspect-ratio: 5 / 6;
  overflow: hidden;
  border: 1px solid var(--divider);
  background: var(--sandstone-300);
}

.hero-media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-media-caption {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--sandstone-600);
}

.hero-corner-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(26px, 3vw, 36px) clamp(24px, 3vw, 40px);
  background: var(--tile);
  border-top: 1px solid var(--divider);
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  transition: background-color 0.2s ease;
}

.hero-corner-tile:hover {
  background: var(--sandstone-400);
}

.hero-corner-tile .tile-sub {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--sandstone-700);
  margin-bottom: 4px;
}

.hero-corner-tile .arrow {
  font-size: 1.35rem;
  transition: transform 0.2s ease;
}

.hero-corner-tile:hover .arrow {
  transform: translateX(5px);
}

@media (max-width: 1024px) {
  .hero-main {
    grid-column: span 12;
    border-right: none;
    border-bottom: 1px solid var(--divider);
  }
  .hero-aside {
    grid-column: span 12;
  }
  .hero-media-bleed {
    min-height: 360px;
  }
}

@media (max-width: 640px) {
  .hero-pillars {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* ---------- Pipeline / Domains of Self-Inquiry Section ---------- */

.pipeline-wrap {
  max-width: var(--max);
  margin: 0 auto;
  border-left: 1px solid var(--divider);
  border-right: 1px solid var(--divider);
}

.pipeline-header {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  padding: clamp(44px, 6vw, 80px) clamp(24px, 4.5vw, 64px) clamp(32px, 4vw, 48px);
  border-bottom: 1px solid var(--divider);
  align-items: end;
  gap: 24px;
}

.pipeline-header-left {
  grid-column: span 8;
}

.pipeline-header-left h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  color: var(--ink);
}

.pipeline-header-left p {
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 60ch;
  margin: 0;
}

.pipeline-header-right {
  grid-column: span 4;
  display: flex;
  justify-content: flex-end;
}

.pipeline-rows {
  display: flex;
  flex-direction: column;
}

.pipeline-row {
  display: grid;
  grid-template-columns: 3.5fr 5.5fr 3fr;
  align-items: center;
  border-bottom: 1px solid var(--divider);
  background: var(--serene-100);
  transition: background-color 0.15s ease;
}

.pipeline-row:last-child {
  border-bottom: none;
}

.pipeline-row:hover {
  background: #E3E7FC;
}

.pipeline-cell-title {
  padding: clamp(20px, 2.5vw, 30px) clamp(24px, 3.5vw, 48px);
  border-right: 1px solid var(--divider);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pipeline-idx {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--serene-600);
  margin-bottom: 4px;
}

.pipeline-cell-title h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.25rem, 1.8vw, 1.6rem);
  line-height: 1.2;
  margin: 0 0 6px;
}

.pipeline-cell-title p {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-2);
  margin: 0;
}

.pipeline-cell-stages {
  padding: clamp(20px, 2.5vw, 30px) clamp(20px, 3vw, 40px);
  border-right: 1px solid var(--divider);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.stage-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-2);
}

.stage-meta strong {
  font-weight: 600;
  color: var(--ink);
}

.stage-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.stage-pill {
  height: 26px;
  border-radius: 9999px;
  background: var(--serene-200);
  color: var(--ink-2);
  font-size: 0.73rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  white-space: nowrap;
}

.stage-pill.is-active {
  background: var(--serene-600);
  color: var(--white);
}

.pipeline-cell-action {
  padding: clamp(20px, 2.5vw, 30px) clamp(20px, 3vw, 40px);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.875rem;
  font-weight: 500;
}

.pipeline-samples {
  font-size: 0.82rem;
  color: var(--ink-2);
  line-height: 1.4;
}

.pipeline-arrow {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  border: 1px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.pipeline-row:hover .pipeline-arrow {
  background: var(--ink);
  color: var(--white);
  transform: translateX(3px);
}

@media (max-width: 980px) {
  .pipeline-header-left,
  .pipeline-header-right {
    grid-column: span 12;
    justify-content: flex-start;
  }
  .pipeline-row {
    grid-template-columns: 1fr;
  }
  .pipeline-cell-title,
  .pipeline-cell-stages {
    border-right: none;
    border-bottom: 1px solid var(--divider);
  }
}

/* ---------- Philosophy & Key Metrics Split (BridgeBio 5:7 Stat Grid) ---------- */

.stats-split {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  max-width: var(--max);
  margin: 0 auto;
  border-left: 1px solid var(--divider);
  border-right: 1px solid var(--divider);
}

.stats-narrative {
  grid-column: span 5;
  padding: clamp(44px, 6vw, 80px) clamp(24px, 4vw, 56px);
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.stats-narrative h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
}

.stats-narrative p {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 16px;
}

.stats-cells {
  grid-column: span 7;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.stat-cell {
  padding: clamp(32px, 4.5vw, 56px) clamp(24px, 3.5vw, 44px);
  border-bottom: 1px solid var(--divider);
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  background: var(--paper);
}

.stat-cell:nth-child(2n) {
  border-right: none;
}

.stat-cell:nth-last-child(-n+2) {
  border-bottom: none;
}

.stat-number {
  font-family: var(--sans);
  font-size: clamp(2.75rem, 5vw, 4.25rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.stat-number sup {
  font-size: 0.4em;
  font-weight: 600;
  color: var(--serene-500);
  margin-left: 4px;
}

.stat-label {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 6px;
}

.stat-desc {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-3);
  margin: 0;
}

@media (max-width: 960px) {
  .stats-narrative {
    grid-column: span 12;
    border-right: none;
    border-bottom: 1px solid var(--divider);
  }
  .stats-cells {
    grid-column: span 12;
  }
}

@media (max-width: 580px) {
  .stats-cells {
    grid-template-columns: 1fr;
  }
  .stat-cell {
    border-right: none;
    border-bottom: 1px solid var(--divider);
  }
  .stat-cell:last-child {
    border-bottom: none;
  }
}

/* ---------- Section Headers & Filter Chips ---------- */

.section-shell {
  max-width: var(--max);
  margin: 0 auto;
  border-left: 1px solid var(--divider);
  border-right: 1px solid var(--divider);
}

.section-header-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: clamp(44px, 6vw, 76px) clamp(24px, 4.5vw, 64px) clamp(28px, 3.5vw, 40px);
  border-bottom: 1px solid var(--divider);
}

.section-header-bar h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2rem, 3.8vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
}

.section-header-bar p {
  margin: 0;
  color: var(--ink-2);
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  max-width: 60ch;
  line-height: 1.55;
}

.chips-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px clamp(24px, 4.5vw, 64px);
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 9999px;
  background: var(--paper);
  border: 1px solid var(--divider-warm);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.84rem;
  color: var(--ink);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.chip:hover {
  background: var(--tile);
  border-color: var(--sandstone-500);
}

/* ---------- Architectural Test Cards (Zero Gradients, Focal-Centered Artwork) ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--paper);
  border-right: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.2s ease;
  position: relative;
}

.card:nth-child(4n) {
  border-right: none;
}

.card:hover {
  background: var(--surface);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--divider);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--sandstone-600);
  letter-spacing: 0.02em;
}

.card-cat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c, var(--serene-500));
  flex: none;
}

.card-top-time {
  font-size: 0.74rem;
  color: var(--sandstone-600);
  flex: none;
}

.card-art-mat {
  padding: 20px 20px 0;
}

.card-art {
  position: relative;
  aspect-ratio: 5 / 6;
  overflow: hidden;
  background: var(--sandstone-200);
  border: 1px solid var(--divider);
}

.card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  gap: 14px;
}

.card-title {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.35rem;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 6px;
}

.card-desc {
  display: block;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--divider-warm);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink);
}

.card-meta {
  color: var(--sandstone-600);
  font-weight: 500;
}

.card-cta-arrow {
  transition: transform 0.2s ease;
}

.card:hover .card-cta-arrow {
  transform: translateX(4px);
}

@media (max-width: 1120px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
  .card:nth-child(4n) {
    border-right: 1px solid var(--divider);
  }
  .card:nth-child(3n) {
    border-right: none;
  }
}

@media (max-width: 820px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .card:nth-child(3n) {
    border-right: 1px solid var(--divider);
  }
  .card:nth-child(2n) {
    border-right: none;
  }
}

@media (max-width: 520px) {
  .cards {
    grid-template-columns: 1fr;
  }
  .card {
    border-right: none !important;
  }
}

/* ---------- Method & Living Mirror Section (6:6 Architectural Specimen Split) ---------- */

.practice-split {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  max-width: var(--max);
  margin: 0 auto;
  border-left: 1px solid var(--divider);
  border-right: 1px solid var(--divider);
}

.practice-left {
  grid-column: span 6;
  padding: clamp(44px, 6vw, 80px) clamp(24px, 4.5vw, 64px);
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}

.practice-left h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2rem, 3.5vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 16px;
}

.practice-left > div > p {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
}

.practice-steps {
  border-top: 1px solid var(--divider);
}

.practice-step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--divider);
}

.practice-step-num {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--serene-600);
  padding-top: 3px;
}

.practice-step h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.25rem;
  margin: 0 0 6px;
}

.practice-step p {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
}

.practice-right {
  grid-column: span 6;
  background: var(--surface);
  padding: clamp(32px, 4.5vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

/* Native Editorial Specimen Cards (replaces distorted 3D mockup image) */
.specimen-stack {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--divider);
  background: var(--paper);
}

.specimen-prompt-card {
  padding: clamp(24px, 3vw, 34px);
  border-bottom: 1px solid var(--divider);
  background: var(--paper);
}

.specimen-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.specimen-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sandstone-600);
}

.specimen-progress {
  display: flex;
  gap: 4px;
  width: 96px;
}

.specimen-progress i {
  height: 4px;
  flex: 1;
  background: var(--sandstone-300);
  display: block;
}

.specimen-progress i.is-done {
  background: var(--ink);
}

.specimen-question {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.25rem, 1.8vw, 1.55rem);
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 20px;
}

.specimen-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.specimen-opt {
  padding: 10px 12px;
  border: 1px solid var(--divider);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-2);
  text-align: center;
}

.specimen-opt.is-selected {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.specimen-report-card {
  padding: clamp(24px, 3vw, 34px);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.specimen-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.22;
  margin: 0;
  color: var(--ink);
}

.specimen-dims {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid var(--divider);
  padding-top: 16px;
}

.specimen-dim-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.specimen-dim-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
}

.specimen-dim-head span:last-child {
  color: var(--sandstone-700);
}

.specimen-bar {
  height: 6px;
  background: var(--sandstone-300);
  border-radius: 999px;
  overflow: hidden;
}

.specimen-bar-fill {
  height: 100%;
  background: var(--serene-600);
  border-radius: 999px;
}

@media (max-width: 980px) {
  .practice-left {
    grid-column: span 12;
    border-right: none;
    border-bottom: 1px solid var(--divider);
  }
  .practice-right {
    grid-column: span 12;
  }
}

@media (max-width: 560px) {
  .specimen-options {
    grid-template-columns: 1fr;
  }
}

/* ---------- Tests Directory & Category Pages ---------- */

.page-intro-band {
  max-width: var(--max);
  margin: 0 auto;
  border-left: 1px solid var(--divider);
  border-right: 1px solid var(--divider);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  background: var(--paper);
}

.page-intro-main {
  grid-column: span 8;
  padding: clamp(40px, 6vw, 76px) clamp(24px, 4.5vw, 64px);
  border-right: 1px solid var(--divider);
}

.page-intro-main h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.4rem, 5vw, 4.25rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}

.page-intro-main p {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 60ch;
  margin: 0;
}

.page-intro-aside {
  grid-column: span 4;
  background: var(--surface);
  padding: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sandstone-600);
  margin-bottom: 18px;
}

.crumbs a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.category-block {
  scroll-margin-top: 84px;
}

@media (max-width: 920px) {
  .page-intro-main {
    grid-column: span 12;
    border-right: none;
    border-bottom: 1px solid var(--divider);
  }
  .page-intro-aside {
    grid-column: span 12;
  }
}

/* ---------- Individual Assessment Page (/tests/<id>) ---------- */

.test-hero-grid {
  max-width: var(--max);
  margin: 0 auto;
  border-left: 1px solid var(--divider);
  border-right: 1px solid var(--divider);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  background: var(--paper);
}

.test-hero-content {
  grid-column: span 7;
  padding: clamp(36px, 5vw, 64px) clamp(24px, 4.5vw, 64px);
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.test-hero-content h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.5rem, 5vw, 4.25rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  color: var(--ink);
}

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

.facts li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--surface);
  border: 1px solid var(--divider-warm);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-2);
}

.lede {
  font-size: clamp(1.1rem, 1.5vw, 1.28rem);
  line-height: 1.6;
  margin: 0;
  color: var(--ink-2);
  max-width: 56ch;
}

.cta-block {
  background: var(--surface);
  border: 1px solid var(--divider);
  padding: clamp(20px, 2.8vw, 28px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.open-app {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.qr {
  display: none;
  align-items: center;
  gap: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
  width: 100%;
}

.qr svg {
  width: 96px;
  height: 96px;
  border: 1px solid var(--divider);
  background: var(--white);
  flex: none;
  display: block;
}

.qr p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 36ch;
}

@media (hover: hover) and (pointer: fine) {
  html:not(.is-ios) .qr {
    display: flex;
  }
}

.only-ios {
  display: none;
}

html.is-ios .only-ios {
  display: inline-block;
}

.test-hero-art {
  grid-column: span 5;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.test-art-mat {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 4vw, 48px);
}

.test-art-frame {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 5 / 6;
  overflow: hidden;
  border: 1px solid var(--divider);
  background: var(--sandstone-300);
}

.test-art-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.test-art-caption {
  padding: 16px clamp(24px, 3vw, 36px);
  border-top: 1px solid var(--divider);
  background: var(--tile);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--sandstone-700);
}

/* Test Page Detail Sections (4:8 Architectural Split) */

.test-detail-split {
  max-width: var(--max);
  margin: 0 auto;
  border-left: 1px solid var(--divider);
  border-right: 1px solid var(--divider);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
}

.test-detail-head {
  grid-column: span 4;
  padding: clamp(32px, 4.5vw, 56px) clamp(24px, 3.5vw, 48px);
  border-right: 1px solid var(--divider);
  background: var(--surface);
}

.test-detail-head h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.75rem, 2.8vw, 2.4rem);
  line-height: 1.15;
  margin: 0 0 12px;
}

.test-detail-head p {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
}

.test-detail-body {
  grid-column: span 8;
  background: var(--paper);
}

.discover-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.discover-list li {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: baseline;
  padding: clamp(20px, 2.5vw, 28px) clamp(24px, 4vw, 48px);
  border-bottom: 1px solid var(--divider);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
}

.discover-list li:last-child {
  border-bottom: none;
}

.discover-num {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--serene-600);
}

.dims-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 0;
}

.dim-cell {
  padding: clamp(24px, 3vw, 36px);
  border-right: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}

.dim-cell:nth-child(2n) {
  border-right: none;
}

.dim-cell dt {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: 8px;
}

.dim-cell dd {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.steps-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.steps-grid li {
  padding: clamp(24px, 3vw, 36px);
  border-right: 1px solid var(--divider);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.steps-grid li:last-child {
  border-right: none;
}

.step-idx {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--serene-600);
  margin-bottom: 10px;
}

.steps-grid strong {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--ink);
  margin-bottom: 6px;
}

@media (max-width: 920px) {
  .test-hero-content {
    grid-column: span 12;
    border-right: none;
    border-bottom: 1px solid var(--divider);
  }
  .test-hero-art {
    grid-column: span 12;
  }
  .test-art-frame {
    min-height: 360px;
  }
  .test-detail-head {
    grid-column: span 12;
    border-right: none;
    border-bottom: 1px solid var(--divider);
  }
  .test-detail-body {
    grid-column: span 12;
  }
}

@media (max-width: 680px) {
  .dims-grid,
  .steps-grid {
    grid-template-columns: 1fr;
  }
  .dim-cell,
  .steps-grid li {
    border-right: none;
    border-bottom: 1px solid var(--divider);
  }
  .steps-grid li:last-child {
    border-bottom: none;
  }
}

/* Sticky Mobile CTA */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--divider);
  display: none;
  transform: translateY(110%);
  transition: transform 0.25s ease;
}

.sticky-cta .btn {
  width: 100%;
}

.sticky-cta.is-shown {
  transform: translateY(0);
}

@media (max-width: 820px) {
  .sticky-cta {
    display: block;
  }
}

/* ---------- Footer & References Drawer (BridgeBio Tiered Footer) ---------- */

.sitefoot {
  background: var(--paper);
  color: var(--ink-2);
  font-size: 0.9rem;
}

.foot-shell {
  max-width: var(--max);
  margin: 0 auto;
  border-left: 1px solid var(--divider);
  border-right: 1px solid var(--divider);
}

.foot-banner {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
}

.foot-banner-left {
  grid-column: span 8;
  padding: clamp(36px, 5vw, 64px) clamp(24px, 4.5vw, 64px);
  border-right: 1px solid var(--divider);
}

.foot-banner-left h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.85rem, 3.2vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 10px;
  color: var(--ink);
}

.foot-banner-left p {
  margin: 0;
  font-size: 1rem;
  color: var(--ink-2);
  max-width: 54ch;
}

.foot-banner-right {
  grid-column: span 4;
  padding: clamp(28px, 4vw, 48px);
  background: var(--tile);
  display: flex;
  align-items: center;
  justify-content: center;
}

.foot-grid {
  display: grid;
  grid-template-columns: 4fr 4fr 2fr 2fr;
  border-bottom: 1px solid var(--divider);
}

.foot-col {
  padding: clamp(32px, 4vw, 52px) clamp(24px, 3vw, 40px);
  border-right: 1px solid var(--divider);
}

.foot-col:last-child {
  border-right: none;
}

.foot-brand img {
  height: 24px;
  width: auto;
  filter: brightness(0);
  margin-bottom: 16px;
}

.foot-brand p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 20px;
  max-width: 34ch;
}

.foot-col h3 {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sandstone-600);
  margin: 0 0 16px;
}

.foot-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.foot-col a {
  font-size: 0.875rem;
  color: var(--ink-2);
  transition: color 0.15s ease;
}

.foot-col a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.foot-notes {
  padding: 24px clamp(24px, 4.5vw, 64px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--ink-3);
  background: var(--paper);
}

.foot-notes p {
  margin: 0;
  max-width: 82ch;
  line-height: 1.5;
}

@media (max-width: 960px) {
  .foot-banner-left {
    grid-column: span 12;
    border-right: none;
    border-bottom: 1px solid var(--divider);
  }
  .foot-banner-right {
    grid-column: span 12;
    justify-content: flex-start;
  }
  .foot-grid {
    grid-template-columns: 1fr 1fr;
  }
  .foot-col:nth-child(2n) {
    border-right: none;
  }
  .foot-col:nth-child(-n+2) {
    border-bottom: 1px solid var(--divider);
  }
}

@media (max-width: 560px) {
  .foot-grid {
    grid-template-columns: 1fr;
  }
  .foot-col {
    border-right: none !important;
    border-bottom: 1px solid var(--divider);
  }
  .foot-col:last-child {
    border-bottom: none;
  }
}

/* ---------- 404 Not Found ---------- */

.notfound-box {
  max-width: var(--max);
  margin: 0 auto;
  border-left: 1px solid var(--divider);
  border-right: 1px solid var(--divider);
  min-height: 58vh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 18px;
  padding: 80px 24px;
}

.notfound-box h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  margin: 0;
}

.notfound-box p {
  color: var(--ink-2);
  font-size: 1.08rem;
  margin: 0 auto 12px;
  max-width: 44ch;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
