/* =====================================================================
   MAXIMAL MODE — Newspaper / Nothing-Phone editorial layout
   Active when html[data-site-mode="maximal"]
   ===================================================================== */

/* --- Mode Transition Overlay --- */
.mode-transition {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.mode-transition.active {
  opacity: 1;
  pointer-events: all;
}

/* All max-only blocks hidden in min mode */
.max-hero,
.max-marquee,
.max-feature,
.max-dossier,
.max-footer,
.max-blog-masthead {
  display: none;
}

/* =====================================================================
   PALETTE  (max-mode only — light theme stays untouched in min mode)
   ===================================================================== */
html[data-site-mode='maximal'],
html[data-site-mode='maximal'][data-theme='dark'],
html[data-site-mode='maximal'][data-theme='light'] {
  --bg: #050505;
  --fg: #f4f4f0;
  --muted: rgba(244, 244, 240, 0.5);
  --hair: rgba(244, 244, 240, 0.14);
  --hair-soft: rgba(244, 244, 240, 0.06);
  --accent: #d3ff3a;
  --accent-red: #ff3340;
  --panel: #0a0a0a;
  --max-display: 'Space Grotesk', 'Inter', sans-serif;
  --max-mono: 'JetBrains Mono', monospace;
  --max-body: 'Inter', sans-serif;
}

html[data-site-mode='maximal'] body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--max-body);
}

/* Hide the entire minimal site stack on pages that have a maximal masthead.
   Pages without max-* masthead keep their normal .main layout — just
   inherit the maximal palette + toggle pill. */
html[data-site-mode='maximal'] body:has(.max-hero) .main,
html[data-site-mode='maximal'] body:has(.max-hero) > .footer,
html[data-site-mode='maximal'] .back-to-top,
html[data-site-mode='maximal'] .side-index,
html[data-site-mode='maximal'] .mobile-menu,
html[data-site-mode='maximal'] .shortcut-hint {
  display: none !important;
}

/* Blog masthead (max-only) */
html[data-site-mode='maximal'] .max-blog-masthead {
  display: block;
  position: relative;
  padding: 52px clamp(20px, 5vw, 56px) 56px;
  border-bottom: 1px solid var(--hair);
}

.max-blog-back {
  position: absolute;
  bottom: 16px;
  right: clamp(20px, 5vw, 56px);
  font-family: var(--max-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}
.max-blog-back:hover {
  color: var(--accent);
}

/* Blog list inside max mode — match newspaper palette */
html[data-site-mode='maximal'] body:has(.max-blog-masthead) .main {
  padding-top: 32px;
}

html[data-site-mode='maximal'] body:has(.max-blog-masthead) .section {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 24px clamp(20px, 5vw, 56px);
  margin: 0 auto;
  max-width: 1480px;
}

html[data-site-mode='maximal'] body:has(.max-blog-masthead) .section-title {
  display: none;
}

html[data-site-mode='maximal'] body:has(.max-blog-masthead) .section-subtitle {
  display: none;
}

html[data-site-mode='maximal'] body:has(.max-blog-masthead) .rss-link {
  display: none;
}

html[data-site-mode='maximal'] body:has(.max-blog-masthead) .blog-post {
  border-bottom: 1px solid var(--hair);
  padding: 28px 0;
}

html[data-site-mode='maximal'] body:has(.max-blog-masthead) .blog-post-link {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 24px;
  align-items: baseline;
  text-decoration: none;
}

html[data-site-mode='maximal'] body:has(.max-blog-masthead) .blog-post-meta {
  display: contents;
}

html[data-site-mode='maximal'] body:has(.max-blog-masthead) .blog-post-title {
  grid-column: 1;
  font-family: var(--max-display);
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--fg);
  margin: 0;
}

html[data-site-mode='maximal'] body:has(.max-blog-masthead) .blog-post-link:hover .blog-post-title {
  color: var(--accent);
}

html[data-site-mode='maximal'] body:has(.max-blog-masthead) .blog-post-date {
  grid-column: 2;
  text-align: right;
  font-family: var(--max-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

html[data-site-mode='maximal'] body:has(.max-blog-masthead) .blog-post-excerpt {
  grid-column: 1 / -1;
  font-family: var(--max-body);
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(244, 244, 240, 0.65);
  margin-top: 10px;
  max-width: 760px;
}

/* Keep header in DOM (toggle lives inside it) but make it invisible —
   hide every child except the toggle, then float the toggle via fixed pos */
html[data-site-mode='maximal'] .header {
  position: static;
  background: transparent;
  border: 0;
  backdrop-filter: none;
  height: 0;
  overflow: visible;
}

html[data-site-mode='maximal'] .header .container,
html[data-site-mode='maximal'] .header .header-content,
html[data-site-mode='maximal'] .header .nav-right {
  display: contents;
}

html[data-site-mode='maximal'] .header .logo,
html[data-site-mode='maximal'] .header .nav-switch,
html[data-site-mode='maximal'] .header .nav-socials,
html[data-site-mode='maximal'] .header .theme-toggle,
html[data-site-mode='maximal'] .header .mobile-toggle {
  display: none !important;
}

/* =====================================================================
   MODE TOGGLE  ─  attractive pill in both modes
   ===================================================================== */

/* Base styling — applies to MIN mode (pill sits inside nav-right) */
.mode-toggle-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 12px;
  min-height: 32px;
  background: linear-gradient(
    135deg,
    rgba(118, 185, 0, 0.08) 0%,
    rgba(0, 0, 0, 0) 60%
  );
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease,
    background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.mode-toggle-btn::before {
  /* shimmer that sweeps across the pill on hover */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 35%,
    rgba(118, 185, 0, 0.18) 50%,
    transparent 65%
  );
  transform: translateX(-110%);
  transition: transform 0.6s ease;
  pointer-events: none;
}

.mode-toggle-btn:hover {
  border-color: #76b900;
  color: #76b900;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(118, 185, 0, 0.18),
    0 0 0 1px rgba(118, 185, 0, 0.18) inset;
}

.mode-toggle-btn:hover::before {
  transform: translateX(110%);
}

.mode-toggle-btn:focus-visible {
  outline: 2px solid #76b900;
  outline-offset: 3px;
}

.mode-toggle-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #76b900;
  box-shadow: 0 0 8px rgba(118, 185, 0, 0.7);
  animation: minDotPulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

.mode-toggle-label {
  position: relative;
  z-index: 1;
}

.mode-toggle-label::after {
  content: ' ↗';
  opacity: 0.6;
  transition: opacity 0.25s, transform 0.25s;
  display: inline-block;
}

.mode-toggle-btn:hover .mode-toggle-label::after {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* On phones, in min mode, collapse the toggle to a dot-only chip so
   it doesn't crowd the absolutely-centered work/blog switch. */
@media (max-width: 768px) {
  html:not([data-site-mode='maximal']) .mode-toggle-btn {
    padding: 0;
    width: 32px;
    height: 32px;
    min-height: 32px;
    border-radius: 50%;
    justify-content: center;
    gap: 0;
  }
  html:not([data-site-mode='maximal']) .mode-toggle-label {
    display: none;
  }
  html:not([data-site-mode='maximal']) .mode-toggle-dot {
    width: 9px;
    height: 9px;
  }
}

@keyframes minDotPulse {
  0%, 100% {
    box-shadow: 0 0 6px rgba(118, 185, 0, 0.6);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 14px rgba(118, 185, 0, 0.95);
    transform: scale(1.15);
  }
}

/* Hide arrow when the button is showing "min" (we're in max mode) */
.mode-toggle-btn[data-mode='maximal'] .mode-toggle-label::after {
  content: '';
}

/* Floating min/max toggle — fixed top-right */
html[data-site-mode='maximal'] .mode-toggle-btn {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 10000;
  padding: 10px 18px;
  min-height: 38px;
  background: var(--panel);
  border: 1px solid var(--hair);
  color: var(--fg);
  border-radius: 999px;
  font-family: var(--max-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
}

html[data-site-mode='maximal'] .mode-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

html[data-site-mode='maximal'] .mode-toggle-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: maxDotPulse 1.8s ease-in-out infinite;
}

@keyframes maxDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.65); }
}

/* Top-of-page hairline scroll progress */
html[data-site-mode='maximal'] body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: var(--scroll-progress, 0%);
  background: var(--accent);
  z-index: 99998;
  pointer-events: none;
  box-shadow: 0 0 10px var(--accent);
  transition: width 60ms linear;
}

/* =====================================================================
   DOT MATRIX BACKGROUND (Nothing-style accent)
   ===================================================================== */
.dotmatrix-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(244, 244, 240, 0.35) 1px, transparent 1.4px);
  background-size: 5px 5px;
  background-position: center;
  opacity: 0.35;
  pointer-events: none;
  mix-blend-mode: lighten;
}

/* =====================================================================
   MASTHEAD / HERO
   ===================================================================== */
html[data-site-mode='maximal'] .max-hero {
  display: block;
  position: relative;
  padding: 52px clamp(20px, 5vw, 56px) 60px;
  border-bottom: 1px solid var(--hair);
}

.max-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-template-rows: auto auto auto auto auto;
  gap: 24px 24px;
  align-items: start;
  position: relative;
  max-width: 1480px;
  margin: 0 auto;
}

/* Top corner pills */
.max-hero-pill {
  grid-row: 1;
  grid-column: 1 / span 2;
  position: relative;
  padding: 12px 16px;
  border: 1px solid var(--hair);
  font-family: var(--max-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  overflow: hidden;
}

.max-hero-pill.right {
  grid-column: 3 / span 2;
  justify-content: flex-end;
}

.pill-k {
  color: var(--muted);
}
.pill-v {
  color: var(--fg);
  font-weight: 600;
  z-index: 1;
}

/* Tagline row (dateline) */
.max-hero-tagline {
  grid-row: 2;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--max-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hair);
}

.tag-bullet {
  width: 9px;
  height: 9px;
  background: var(--accent-red);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 51, 64, 0.6);
}

/* Massive title — sized to fit comfortably on one screen */
.max-hero-title {
  grid-row: 3;
  grid-column: 1 / -1;
  font-family: var(--max-display);
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 11rem);
  line-height: 0.86;
  letter-spacing: -0.05em;
  color: var(--fg);
  margin: 0;
}

.max-hero-title .line {
  display: block;
  padding-bottom: 0.04em;
}

.max-hero-title em {
  font-style: italic;
  font-family: 'Space Grotesk', serif;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: -0.04em;
}

/* Byline grid (newspaper-style) */
.max-hero-byline {
  grid-row: 4;
  grid-column: 1 / span 4;
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--hair);
  font-family: var(--max-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.byline-name,
.byline-loc,
.byline-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.byline-k {
  color: var(--muted);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
}

.byline-v {
  color: var(--fg);
  font-weight: 600;
}

.byline-v a {
  color: var(--fg);
  border-bottom: 1px solid var(--accent);
  transition: color 0.25s;
}
.byline-v a:hover {
  color: var(--accent);
}

/* Lede paragraph */
.max-hero-lede {
  grid-row: 5;
  grid-column: 1 / span 2;
  font-family: var(--max-body);
  font-size: clamp(0.92rem, 1.05vw, 1.05rem);
  line-height: 1.5;
  color: rgba(244, 244, 240, 0.78);
  font-weight: 400;
  letter-spacing: -0.005em;
  max-width: 540px;
  margin-top: 8px;
}

/* Stat strip */
.max-hero-stat-strip {
  grid-row: 5;
  grid-column: 3 / span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 30px;
  margin-top: 16px;
}

.max-hero-stat-strip > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--hair);
  background: var(--panel);
  position: relative;
  overflow: hidden;
}

.max-hero-stat-strip .ss-v {
  font-family: var(--max-display);
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
}

.max-hero-stat-strip .ss-k {
  font-family: var(--max-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Scroll cue */
.max-hero-scroll {
  position: absolute;
  bottom: -56px;
  right: clamp(20px, 5vw, 56px);
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--max-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.scroll-arrow {
  display: inline-block;
  animation: scrollArrow 1.6s ease-in-out infinite;
}

@keyframes scrollArrow {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(4px); opacity: 1; }
}

/* =====================================================================
   MARQUEE
   ===================================================================== */
html[data-site-mode='maximal'] .max-marquee {
  display: flex;
  overflow: hidden;
  border-bottom: 1px solid var(--hair);
  padding: 22px 0;
  background: var(--panel);
  white-space: nowrap;
}

.max-marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 32px;
  padding-right: 32px;
  font-family: var(--max-display);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--fg);
  animation: marqueeRoll 42s linear infinite;
  flex-shrink: 0;
}

.max-marquee-track .dot {
  color: var(--accent);
  font-size: 0.5em;
  vertical-align: middle;
}

@keyframes marqueeRoll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* =====================================================================
   FEATURE ARTICLES (asymmetric newspaper grid)
   ===================================================================== */
html[data-site-mode='maximal'] .max-feature {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 240px;
  grid-template-areas:
    'meta head head'
    'meta body stat';
  column-gap: 40px;
  row-gap: 26px;
  padding: 64px clamp(20px, 5vw, 56px);
  border-bottom: 1px solid var(--hair);
  position: relative;
  max-width: 1480px;
  margin: 0 auto;
}

html[data-site-mode='maximal'] .max-feature.reverse {
  grid-template-columns: 240px minmax(0, 1fr) 200px;
  grid-template-areas:
    'head head meta'
    'stat body meta';
}

.feat-meta {
  grid-area: meta;
  position: relative;
  padding: 24px 22px;
  border: 1px solid var(--hair);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--max-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  align-self: start;
  overflow: hidden;
}

.meta-tag {
  font-family: var(--max-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hair);
}

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

.meta-row .k {
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.meta-row .v {
  color: var(--fg);
  font-weight: 500;
}

.meta-dotmatrix {
  position: absolute;
  inset: auto -10px -30px auto;
  width: 120px;
  height: 80px;
  background-image: radial-gradient(rgba(244, 244, 240, 0.35) 1px, transparent 1.4px);
  background-size: 6px 6px;
  pointer-events: none;
  opacity: 0.6;
}

.feat-headline {
  grid-area: head;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.feat-title {
  font-family: var(--max-display);
  font-size: clamp(1.9rem, 4.2vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.02;
  color: var(--fg);
  margin: 0;
}

.feat-title em {
  font-style: italic;
  color: var(--accent);
}

.feat-deck {
  font-family: var(--max-body);
  font-size: clamp(0.92rem, 1.05vw, 1.05rem);
  font-weight: 400;
  line-height: 1.5;
  color: rgba(244, 244, 240, 0.7);
  max-width: 720px;
}

.feat-deck em {
  font-style: italic;
  color: var(--accent);
}

.feat-stat {
  grid-area: stat;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 22px;
  border: 1px solid var(--hair);
  background: var(--panel);
  align-self: start;
  position: relative;
}

.feat-stat.double {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  padding: 20px 22px;
}

.feat-stat.double > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feat-stat .stat-k {
  font-family: var(--max-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.feat-stat .stat-v {
  font-family: var(--max-display);
  font-size: clamp(2rem, 3.2vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
}

.feat-stat .stat-foot {
  font-family: var(--max-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--muted);
}

.feat-body {
  grid-area: body;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--max-body);
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(244, 244, 240, 0.72);
  min-width: 0;
  max-width: 640px;
}

.feat-body p {
  margin: 0;
}

.feat-body strong {
  color: var(--accent);
  font-weight: 600;
}

.feat-body a {
  color: var(--fg);
  border-bottom: 1px solid var(--accent);
}

.feat-body a:hover {
  color: var(--accent);
}

/* =====================================================================
   DOSSIER (education / skills / writing / reach)
   ===================================================================== */
html[data-site-mode='maximal'] .max-dossier {
  display: block;
  padding: 64px clamp(20px, 5vw, 56px);
  border-bottom: 1px solid var(--hair);
  position: relative;
  max-width: 1480px;
  margin: 0 auto;
}

.dossier-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 32px 24px;
}

.dossier-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 26px;
  border: 1px solid var(--hair);
  background: var(--panel);
  position: relative;
}

.dossier-block:nth-child(1) { grid-column: span 7; }
.dossier-block:nth-child(2) { grid-column: span 5; }
.dossier-block:nth-child(3) { grid-column: span 5; }
.dossier-block:nth-child(4) { grid-column: span 7; }

.block-tag {
  font-family: var(--max-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hair);
}

.block-h {
  font-family: var(--max-display);
  font-size: clamp(1.2rem, 1.6vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--fg);
  margin: 0;
}

.block-h a {
  color: var(--fg);
  border-bottom: 1px solid var(--hair);
  transition: color 0.25s, border-color 0.25s;
}
.block-h a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.block-sub {
  font-family: var(--max-body);
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(244, 244, 240, 0.65);
}

.block-sub a {
  color: var(--fg);
  border-bottom: 1px solid var(--hair);
}
.block-sub a:hover {
  color: var(--accent);
}

.dossier-stack {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dossier-stack li {
  font-family: var(--max-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  padding: 6px 11px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  color: var(--fg);
  transition: all 0.25s;
}

.dossier-stack li:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.dossier-cta .block-h {
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
}

/* =====================================================================
   FOOTER
   ===================================================================== */
html[data-site-mode='maximal'] .max-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px clamp(20px, 5vw, 56px);
  font-family: var(--max-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 1480px;
  margin: 0 auto;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1024px) {
  html[data-site-mode='maximal'] .max-feature,
  html[data-site-mode='maximal'] .max-feature.reverse {
    grid-template-columns: 1fr;
    grid-template-areas:
      'meta'
      'head'
      'stat'
      'body';
    padding: 56px clamp(18px, 5vw, 40px);
    column-gap: 0;
    row-gap: 22px;
  }

  .max-hero-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto auto auto auto;
    gap: 20px 16px;
  }
  .max-hero-pill { grid-column: 1; }
  .max-hero-pill.right { grid-column: 2; }
  .max-hero-tagline { grid-row: 2; }
  .max-hero-title { grid-row: 3; }
  .max-hero-byline { grid-row: 4; grid-column: 1 / -1; }
  .max-hero-lede { grid-row: 5; grid-column: 1 / -1; }
  .max-hero-stat-strip { grid-row: 6; grid-column: 1 / -1; }

  .dossier-block:nth-child(1),
  .dossier-block:nth-child(2),
  .dossier-block:nth-child(3),
  .dossier-block:nth-child(4) { grid-column: span 12; }
}

@media (max-width: 720px) {
  /* Pull hero down so the floating toggle doesn't overlap the FILE pill */
  html[data-site-mode='maximal'] .max-hero {
    padding-top: 88px;
    padding-bottom: 40px;
  }

  /* Toggle pill stays top-right but compact + above content */
  html[data-site-mode='maximal'] .mode-toggle-btn {
    top: 16px;
    right: 16px;
    padding: 7px 12px 7px 11px;
    min-height: 32px;
    font-size: 0.6rem;
    letter-spacing: 0.14em;
  }
  html[data-site-mode='maximal'] .mode-toggle-dot {
    width: 6px;
    height: 6px;
  }

  /* Pills stack in their own rows */
  .max-hero-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto auto auto auto;
    gap: 14px;
  }
  .max-hero-pill {
    grid-row: 1;
    grid-column: 1;
    justify-content: flex-start;
    padding-right: 86px; /* leave room for the floating MIN/MAX pill */
  }
  .max-hero-pill.right {
    grid-row: 2;
    grid-column: 1;
    justify-content: flex-start;
    padding-right: 16px;
  }
  .max-hero-tagline { grid-row: 3; }
  .max-hero-title { grid-row: 4; }
  .max-hero-byline { grid-row: 5; }
  .max-hero-lede { grid-row: 6; }
  .max-hero-stat-strip { grid-row: 7; }

  .max-hero-byline {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 22px;
  }

  .max-hero-stat-strip {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .max-hero-stat-strip > div {
    padding: 12px 14px;
  }

  /* feature stat box wraps tightly */
  .feat-stat.double {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  /* dossier blog reach grid */
  .dossier-grid {
    gap: 18px;
  }
  .dossier-block {
    padding: 22px 20px;
  }

  /* tighten marquee on phone */
  .max-marquee-track {
    font-size: 1.1rem;
    gap: 22px;
  }

  /* footer stacks */
  html[data-site-mode='maximal'] .max-footer {
    flex-direction: column;
    gap: 6px;
    text-align: center;
    padding: 24px 16px;
  }

  /* hide scroll cue on phones — saves vertical room */
  .max-hero-scroll {
    display: none;
  }
}

@media (max-width: 420px) {
  .max-hero-stat-strip {
    grid-template-columns: 1fr;
  }
  .feat-stat.double {
    grid-template-columns: 1fr;
  }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .mode-transition,
  .max-marquee-track,
  .scroll-arrow,
  .mode-toggle-dot,
  .tag-bullet {
    animation: none !important;
    transition: none !important;
  }
}
