/* ==========================================================================
   KUNLE'S EDITORIAL PORTFOLIO — STYLESHEET
   Design System: Editorial Print-Digital Hybrid
   Rule: SOLID COLORS ONLY. ZERO GRADIENTS.
   Target Palette:
     - Paper Background:    #F0EEE8
     - Main Ink:            #203238
     - Secondary Slate:     #5D6967
     - Deep Teal Accent:    #2D625F
     - Structural Divider:  #C9CFCA
     - Soft Surface Tint:   #DDE5DC
     - SafeAlert Red Accent: #B6544A (SafeAlert scope only)
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
  /* Surface & Base Colors (SOLID FLAT COLORS ONLY - NO GRADIENTS) */
  --color-paper: #F0EEE8;
  --color-paper-light: #F8F7F3;
  --color-paper-warm: #EBE8E1;
  --color-paper-dim: #E2DFD6;
  
  /* Text & Ink Colors */
  --color-ink: #203238;
  --color-ink-dark: #142226;
  --color-ink-soft: #30464E;
  
  /* Secondary & Muted */
  --color-secondary: #5D6967;
  --color-secondary-light: #7E8C8A;
  
  /* Accents & States */
  --color-accent: #2D625F;
  --color-accent-hover: #1F4745;
  --color-accent-light: #E0EBE8;
  
  /* Structural Lines & Borders */
  --color-line: #C9CFCA;
  --color-line-dark: #A5B0A8;
  --color-line-light: #DCE1DC;
  
  /* Feature Surfaces */
  --color-panel: #DDE5DC;
  --color-panel-hover: #D0DBD0;
  
  /* Project-Specific (SafeAlert Only) */
  --color-alert-red: #B6544A;
  --color-alert-dark: #8F3A32;
  --color-alert-surface: #F5EAE8;

  /* Project Accent Dots (Systems / Business builds) */
  --color-dot-systems: #8C6A48;
  --color-dot-business: #4A6572;

  /* Typography */
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, Monaco, monospace;
  
  /* Spacing Scale */
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-2xl: 64px;
  --space-3xl: 96px;
  --space-4xl: 128px;
  
  /* Layout Dimensions */
  --container-max: 1240px;
  --container-pad: clamp(16px, 4vw, 40px);
  --header-height: 76px;
  
  /* Flat Solid Shadows (NO BLUR GLOWS / NO GRADIENTS) */
  --shadow-flat-sm: 4px 4px 0 var(--color-line-dark);
  --shadow-flat-md: 8px 8px 0 var(--color-line-dark);
  --shadow-flat-lg: 14px 14px 0 var(--color-ink);

  /* Motion Identity — Premium editorial personality (0% overshoot)
     Signature easing: --ease-out-editorial carries entrances & reveals;
     --ease-smooth carries on-screen moves (hover/press/state changes);
     --ease-accelerate carries exits (gentle start, fast departure);
     --ease-curtain is reserved for scene cuts (curtain, title sequence).
     Duration palette: quick = hover/press feedback, standard = cards,
     panels & icons, slow = reveals, modals & page moves. */
  --ease-out-editorial: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-accelerate: cubic-bezier(0.3, 0, 1, 1);
  --ease-curtain: cubic-bezier(0.76, 0, 0.24, 1);
  --dur-quick: 140ms;
  --dur-standard: 300ms;
  --dur-slow: 560ms;
}

/* --------------------------------------------------------------------------
   02. CSS Reset & Base Elements
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: light;
  background-color: var(--color-paper);
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-paper);
  color: var(--color-ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

/* Accessible Skip Link */
.skip-link {
  position: absolute;
  top: -60px;
  left: 20px;
  background: var(--color-ink);
  color: var(--color-paper);
  padding: 12px 20px;
  z-index: 9999;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s var(--ease-smooth);
  border: 2px solid var(--color-accent);
}

.skip-link:focus {
  top: 15px;
  outline: none;
}

/* Screen Reader Only Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus Visible Accessibility */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Container Structure */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

/* --------------------------------------------------------------------------
   03. Typography & Editorial Accents
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--color-ink);
  line-height: 1.15;
}

h1 em, h2 em, h3 em {
  font-style: italic;
  color: var(--color-accent);
}

p {
  color: var(--color-secondary);
  font-size: 1.0625rem;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s var(--ease-smooth), border-color 0.15s var(--ease-smooth);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Section Rule Dividers */
.section-rule {
  width: 100%;
  height: 1px;
  background-color: var(--color-line);
  border: none;
  margin: 0;
}

/* Micro Eyebrows / Meta Labels */
.meta-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-secondary);
}

.meta-eyebrow .dot-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-accent);
  display: inline-block;
}

.meta-eyebrow .dot-indicator.alert {
  background-color: var(--color-alert-red);
}

/* Editorial Index Pill / Badge */
.editorial-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background-color: var(--color-panel);
  border: 1px solid var(--color-line-dark);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-ink);
}

/* --------------------------------------------------------------------------
   04. Buttons & Interactive Links
   -------------------------------------------------------------------------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 24px;
  background-color: var(--color-ink);
  color: var(--color-paper);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--color-ink);
  box-shadow: 4px 4px 0 var(--color-accent);
  transition: transform 0.15s var(--ease-smooth), box-shadow 0.15s var(--ease-smooth), background-color 0.15s var(--ease-smooth);
}

.btn-primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--color-accent);
  background-color: var(--color-ink-dark);
  color: #FFFFFF;
}

.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--color-accent);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 22px;
  background-color: transparent;
  color: var(--color-ink);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--color-line-dark);
  box-shadow: 4px 4px 0 var(--color-line);
  transition: transform 0.15s var(--ease-smooth), box-shadow 0.15s var(--ease-smooth), border-color 0.15s var(--ease-smooth), background-color 0.15s var(--ease-smooth);
}

.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background-color: var(--color-paper-light);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--color-line-dark);
}

.btn-secondary:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--color-line-dark);
}

.btn-text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  border-bottom: 1px solid var(--color-accent);
  padding-bottom: 2px;
  transition: color 0.15s var(--ease-smooth), border-color 0.15s var(--ease-smooth);
}

.btn-text-link:hover {
  color: var(--color-ink);
  border-color: var(--color-ink);
}

/* --------------------------------------------------------------------------
   05. Site Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  height: var(--header-height);
  background-color: var(--color-paper);
  border-bottom: 1px solid var(--color-line);
  z-index: 1000;
  transition: background-color 0.2s var(--ease-smooth);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--color-ink);
}

.header-brand span {
  color: var(--color-accent);
  padding: 0 6px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-secondary);
  position: relative;
  padding: 6px 0;
  transition: color 0.15s var(--ease-smooth);
}

.nav-link:hover {
  color: var(--color-ink);
}

.nav-link.active {
  color: var(--color-accent);
}

/* Animated underline sweep (grows from left on hover, locked for active) */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.nav-link.active::after {
  transform: scaleX(1);
  background-color: var(--color-accent);
}

.nav-cta {
  padding: 8px 16px;
  background-color: var(--color-ink);
  color: var(--color-paper);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--color-ink);
  transition: background-color 0.15s var(--ease-smooth), transform 0.15s var(--ease-smooth);
}

.nav-cta:hover, .nav-cta.active {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: #FFFFFF;
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--color-line-dark);
  padding: 8px;
}

.mobile-nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--color-ink);
  transition: transform 0.2s var(--ease-smooth), opacity 0.2s var(--ease-smooth);
}

.mobile-nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Drawer — visibility/opacity/transform choreography replaces the old
   hard display cut, so the drawer can settle in AND accelerate back out.
   Transitions live in the no-preference block at the end of the stylesheet. */
.mobile-drawer {
  display: flex;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-10px);
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-paper);
  border-top: 1px solid var(--color-line);
  padding: var(--space-lg) var(--container-pad);
  z-index: 999;
  flex-direction: column;
  justify-content: space-between;
}

.mobile-drawer.is-open {
  visibility: visible;
  opacity: 1;
  transform: none;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-nav-links a {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--color-ink);
  border-bottom: 1px solid var(--color-line);
  padding-bottom: 12px;
}

.mobile-nav-links a.active {
  color: var(--color-accent);
}

.mobile-drawer-footer {
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   06. Dedicated Subpage Header Banner
   -------------------------------------------------------------------------- */
.page-header-banner {
  padding-top: clamp(48px, 6vw, 76px);
  padding-bottom: clamp(40px, 5vw, 64px);
  background-color: var(--color-paper);
  border-bottom: 1px solid var(--color-line);
}

.page-banner-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page-banner-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-line-light);
}

.page-banner-title {
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--color-ink);
}

.page-banner-lead {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.6;
  color: var(--color-secondary);
  max-width: 780px;
}

.page-jump-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.jump-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background-color: var(--color-paper-light);
  border: 1px solid var(--color-line-dark);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-ink);
  transition: background-color 0.15s var(--ease-smooth), border-color 0.15s var(--ease-smooth), color 0.15s var(--ease-smooth);
}

.jump-pill:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   07. Hero Section & 3D Interactive Phone (Home Page)
   -------------------------------------------------------------------------- */
.hero-section {
  padding-top: clamp(40px, 6vw, 72px);
  padding-bottom: clamp(48px, 8vw, 84px);
  border-bottom: 1px solid var(--color-line);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(24px, 3.5vw, 48px);
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 2;
  min-width: 0;                  /* grid item may shrink to its track; children wrap */
}

.hero-headline {
  font-size: clamp(2.35rem, 5.2vw, 4.4rem);
  line-height: 1.06;
  letter-spacing: -0.04em;
  color: var(--color-ink);
}

.hero-headline em {
  color: var(--color-accent);
  font-style: italic;
}

.hero-lead {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.6;
  color: var(--color-secondary);
  max-width: 500px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.hero-meta-strip {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--color-line);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--color-secondary);
  text-transform: uppercase;
}

.hero-meta-strip span b {
  color: var(--color-ink);
  font-weight: 700;
}

/* 3D Phone Stage */
.hero-stage-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 480px;
}

.hero-stage {
  position: relative;
  width: 100%;
  height: 460px;
  perspective: 1000px;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: transparent;
  padding: 0;
  border: none;
  transform-style: preserve-3d;
}

/* Orbital Rings (Solid flat rules - NO GRADIENTS) */
.orbit-ring {
  position: absolute;
  border: 1px solid var(--color-line);
  border-radius: 50%;
  pointer-events: none;
}

.orbit-one {
  width: 340px;
  height: 340px;
  transform: rotateX(68deg) rotateZ(-22deg);
}

.orbit-two {
  width: 320px;
  height: 320px;
  transform: rotateY(65deg) rotateZ(25deg);
  border-style: dashed;
}

/* 3D Phone Device Chassis */
.phone-chassis {
  width: 206px;
  height: 416px;
  background-color: var(--color-ink-dark);
  border: 8px solid #142226;
  border-radius: 36px;
  box-shadow: 16px 24px 0 var(--color-line-dark), 24px 36px 0 rgba(32, 50, 56, 0.12);
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(-18deg) rotateX(12deg) rotateZ(6deg);
  transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

/* Phone Speaker & Notch */
.phone-notch {
  width: 76px;
  height: 14px;
  background-color: #142226;
  border-radius: 0 0 12px 12px;
  position: absolute;
  top: -1px;
  left: calc(50% - 38px);
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-speaker {
  width: 32px;
  height: 3px;
  background-color: #2E454C;
  border-radius: 2px;
}

/* Phone Screen Surface */
.phone-screen {
  height: 100%;
  background-color: #F8F8F5;
  border-radius: 28px;
  padding: 24px 14px 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

/* Edge-to-edge screenshot mode for real app captures */
.phone-screen:has(.screen-screenshot-container),
.phone-screen.has-screenshot {
  padding: 0;
  background-color: #0E1618;
}

.phone-screen:has(.screen-screenshot-container) .screen-statusbar,
.phone-screen.has-screenshot .screen-statusbar {
  display: none;
}

/* Screen Top Bar */
.screen-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 700;
  color: var(--color-ink);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-line);
}

.screen-appname {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--color-ink);
  letter-spacing: 0.04em;
}

.screen-appname span {
  color: var(--color-alert-red);
}

/* Mini Simulated Map Surface (OSMDroid Simulation in Flat Colors) */
.screen-map-container {
  position: relative;
  height: 145px;
  background-color: #E2ECE7;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  margin: 8px 0;
  overflow: hidden;
}

/* Geometric Solid Map Roads */
.map-road-a {
  position: absolute;
  width: 180%;
  height: 14px;
  background-color: #FFFFFF;
  left: -40%;
  top: 42%;
  transform: rotate(26deg);
}

.map-road-b {
  position: absolute;
  width: 160%;
  height: 12px;
  background-color: #FFFFFF;
  left: -20%;
  top: 55%;
  transform: rotate(-38deg);
}

.map-road-c {
  position: absolute;
  width: 14px;
  height: 140%;
  background-color: #FFFFFF;
  left: 65%;
  top: -20%;
  transform: rotate(12deg);
}

.map-park {
  position: absolute;
  width: 50px;
  height: 45px;
  background-color: #D3E4DB;
  top: 10px;
  left: 12px;
  border-radius: 4px;
}

/* Emergency Alert Map Pin */
.map-alert-pin {
  position: absolute;
  top: 38%;
  left: 48%;
  width: 18px;
  height: 18px;
  background-color: var(--color-alert-red);
  border: 4px solid #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(182, 84, 74, 0.4);
  z-index: 5;
}

.map-user-loc {
  position: absolute;
  bottom: 22%;
  left: 28%;
  width: 10px;
  height: 10px;
  background-color: var(--color-accent);
  border: 2px solid #FFFFFF;
  border-radius: 50%;
  z-index: 4;
}

/* Alert Notification Strip inside Screen */
.screen-alert-strip {
  background-color: var(--color-alert-surface);
  border-left: 3px solid var(--color-alert-red);
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 0 6px 6px 0;
}

.screen-alert-strip strong {
  display: block;
  font-size: 0.625rem;
  font-weight: 800;
  color: var(--color-alert-dark);
  line-height: 1.2;
}

.screen-alert-strip small {
  display: block;
  font-size: 0.5rem;
  color: var(--color-secondary);
  margin-top: 2px;
}

/* Phone Screen Bottom SOS Controls */
.screen-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
}

.screen-sos-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background-color: var(--color-alert-red);
  color: #FFFFFF;
  font-weight: 900;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  box-shadow: 2px 2px 0 var(--color-alert-dark);
}

.screen-badge-status {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 700;
  color: var(--color-secondary);
  text-transform: uppercase;
}

/* Actual App Screenshot Container (replaces CSS vector simulations) */
.screen-screenshot-container {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 0 0 20px 20px;
  background-color: #F8F8F5;
  display: flex;
  flex-direction: column;
}

.screen-screenshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* Editorial Floating Feature Badge */
.stage-floating-badge {
  position: absolute;
  left: 0;
  bottom: 12px;
  background-color: var(--color-panel);
  border: 1px solid var(--color-line-dark);
  padding: 12px 18px;
  box-shadow: 4px 4px 0 var(--color-line-dark);
  text-align: left;
  z-index: 20;
  max-width: 260px;
  display: block;
  text-decoration: none;
  transition: background-color 0.15s var(--ease-smooth), border-color 0.15s var(--ease-smooth), transform 0.15s var(--ease-smooth);
}

.stage-floating-badge:hover {
  background-color: #E2ECE5;
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.stage-floating-badge .badge-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  text-transform: uppercase;
}

.stage-floating-badge strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--color-ink);
  margin-top: 4px;
  white-space: nowrap;
}

.stage-floating-badge .badge-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-ink);
  margin-top: 6px;
  border-bottom: 1px solid var(--color-ink);
  padding-bottom: 1px;
}

/* --------------------------------------------------------------------------
   08. Selected Work & Project Cards (Work Page & Home Teaser)
   -------------------------------------------------------------------------- */
.selected-work-section {
  padding: clamp(48px, 7vw, 84px) 0;
  background-color: var(--color-paper);
}

.work-header-strip {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-line);
}

.work-header-strip h2 {
  font-size: clamp(1.85rem, 3.4vw, 2.75rem);
  letter-spacing: -0.03em;
}

.work-header-strip .work-counter {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  color: var(--color-secondary);
}

/* Editorial Work Grid */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
}

.work-card {
  padding: clamp(24px, 3.5vw, 36px) clamp(16px, 2.5vw, 28px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 380px;
  background-color: var(--color-paper);
  border-right: 1px solid var(--color-line);
  position: relative;
  transition: background-color 0.2s var(--ease-smooth), transform 0.2s var(--ease-smooth);
}

.work-card:last-child {
  border-right: none;
}

.work-card:hover {
  background-color: var(--color-paper-light);
}

.work-card-top {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Representative screenshot thumbnail (top of each work card) */
.work-card-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--color-line-dark);
  background-color: var(--color-paper-light);
  overflow: hidden;
  margin-bottom: 4px;
}

.work-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.work-card-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--color-accent);
}

.work-card-category {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-secondary);
}

.work-card-title {
  font-size: clamp(1.5rem, 2vw, 2rem);
  line-height: 1.15;
  color: var(--color-ink);
  margin-top: 4px;
}

.work-card-desc {
  font-size: 0.9375rem;
  color: var(--color-secondary);
  line-height: 1.55;
  margin-top: 8px;
}

.work-card-bottom {
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-line-light);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.work-card-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-secondary);
}

.work-card-status .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-accent);
}

.work-card-status .status-dot.prototype {
  background-color: #8C6A48;
}

.work-card-status .status-dot.academic {
  background-color: #4A6572;
}

.work-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-ink);
  padding-top: 4px;
}

.work-card-action span {
  font-size: 1.125rem;
  transition: transform 0.15s var(--ease-smooth);
}

.work-card:hover .work-card-action span {
  transform: translate(3px, -3px);
  color: var(--color-accent);
}

/* Project Comparison Matrix Table */
.project-matrix-card {
  margin-top: clamp(48px, 6vw, 72px);
  background-color: var(--color-paper-light);
  border: 1px solid var(--color-line-dark);
  padding: clamp(24px, 3.5vw, 36px);
  box-shadow: 6px 6px 0 var(--color-line);
  overflow-x: auto;
}

.matrix-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-line);
  margin-bottom: 20px;
}

.matrix-header h3 {
  font-size: 1.5rem;
  color: var(--color-ink);
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.matrix-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-secondary);
  padding: 10px 14px;
  border-bottom: 2px solid var(--color-line);
}

.matrix-table td {
  padding: 14px;
  border-bottom: 1px solid var(--color-line-light);
  color: var(--color-ink);
}

.matrix-table tr:hover td {
  background-color: var(--color-paper);
}

/* --------------------------------------------------------------------------
   09. Dedicated Project Case Studies
   -------------------------------------------------------------------------- */
.case-studies-section {
  padding-top: clamp(56px, 8vw, 96px);
  padding-bottom: clamp(56px, 8vw, 96px);
  background-color: var(--color-paper-light);
}

.case-study-block {
  margin-bottom: clamp(64px, 10vw, 120px);
  padding-bottom: clamp(56px, 8vw, 96px);
  border-bottom: 2px solid var(--color-line);
}

.case-study-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* Case Study Header */
.case-header {
  margin-bottom: var(--space-xl);
}

.case-header-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-line);
  margin-bottom: var(--space-md);
}

.case-project-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
}

.case-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background-color: var(--color-paper);
  border: 1px solid var(--color-line-dark);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ink);
}

.case-title {
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--color-ink);
  margin-bottom: var(--space-sm);
}

.case-tagline {
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
  line-height: 1.5;
  color: var(--color-secondary);
  max-width: 820px;
}

/* Case Study Two-Column Grid */
.case-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 310px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  margin-top: var(--space-xl);
}

/* Sticky Case Study Sidebar (Metadata & Facts) */
.case-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-md);
  background-color: var(--color-paper);
  border: 1px solid var(--color-line);
  box-shadow: 4px 4px 0 var(--color-line-dark);
  height: fit-content;
}

.case-fact-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.case-fact-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-secondary-light);
}

.case-fact-val {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-ink);
}

.case-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 3px 8px;
  background-color: var(--color-panel);
  border: 1px solid var(--color-line-dark);
  color: var(--color-ink);
  font-weight: 600;
}

.case-sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: var(--space-xs);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-line);
}

/* Case Study Main Narrative */
.case-main-narrative {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.case-section-item {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.case-section-item h3 {
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  letter-spacing: -0.025em;
  color: var(--color-ink);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-line);
}

.case-section-item p {
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Annotated Diagram / Visual Block (Solid Flat Wireframe Style) */
.editorial-diagram-card {
  background-color: var(--color-paper);
  border: 1px solid var(--color-line-dark);
  padding: var(--space-md);
  box-shadow: 6px 6px 0 var(--color-line);
  margin: var(--space-sm) 0;
}

.diagram-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-secondary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-line);
  margin-bottom: var(--space-md);
}

.diagram-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.diagram-node {
  background-color: var(--color-paper-light);
  border: 1px solid var(--color-line-dark);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.diagram-node.active-node {
  border-color: var(--color-accent);
  background-color: var(--color-accent-light);
}

.diagram-node strong {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-ink);
}

.diagram-node span {
  font-size: 0.75rem;
  color: var(--color-secondary);
  line-height: 1.4;
}

.diagram-caption {
  font-size: 0.8125rem;
  color: var(--color-secondary);
  font-style: italic;
  margin-top: 10px;
}

/* Feature Bullet List */
.case-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.case-list li {
  position: relative;
  padding-left: 22px;
  font-size: 1rem;
  color: var(--color-ink-soft);
  line-height: 1.65;
}

.case-list li::before {
  content: '■';
  position: absolute;
  left: 0;
  top: 0.15em;
  color: var(--color-accent);
  font-size: 0.625rem;
  line-height: 1;
}

.case-list li strong {
  color: var(--color-ink);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   10. About Kunle Section (About Page & Home Teaser)
   -------------------------------------------------------------------------- */
.about-section {
  padding: clamp(56px, 8vw, 96px) 0;
  background-color: var(--color-paper);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 4.2fr) minmax(0, 5.8fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.about-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  position: sticky;
  top: calc(var(--header-height) + 32px);
}

.about-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
}

.about-heading {
  font-size: clamp(2.2rem, 3.8vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--color-ink);
}

.about-factsheet {
  background-color: var(--color-panel);
  border: 1px solid var(--color-line-dark);
  padding: var(--space-md);
  box-shadow: 4px 4px 0 var(--color-line-dark);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.factsheet-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(45, 98, 95, 0.2);
  font-size: 0.8125rem;
}

.factsheet-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.factsheet-row span {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--color-secondary);
  text-transform: uppercase;
}

.factsheet-row strong {
  color: var(--color-ink);
  font-weight: 600;
}

.about-narrative {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.about-narrative p {
  font-size: 1.125rem;
  line-height: 1.7;
}

.about-principles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-line);
}

.principle-card {
  background-color: var(--color-paper-light);
  border: 1px solid var(--color-line);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.principle-card h4 {
  font-size: 1.25rem;
  color: var(--color-ink);
}

.principle-card p {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--color-secondary);
}

/* --------------------------------------------------------------------------
   11. Skills & Technical Toolkit (Skills Page & Home Teaser)
   -------------------------------------------------------------------------- */
.skills-section {
  padding: clamp(56px, 8vw, 96px) 0;
  background-color: var(--color-paper-warm);
}

.skills-header {
  margin-bottom: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.skill-category-card {
  background-color: var(--color-paper);
  border: 1px solid var(--color-line-dark);
  padding: var(--space-md);
  box-shadow: 6px 6px 0 var(--color-line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
}

.skill-category-card:hover {
  transform: translateY(-2px);
  box-shadow: 8px 8px 0 var(--color-accent);
}

.skill-category-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-line);
}

.skill-cat-num {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-accent);
}

.skill-category-header h3 {
  font-size: 1.35rem;
  color: var(--color-ink);
}

.skill-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9375rem;
  color: var(--color-ink);
  font-weight: 600;
}

.skill-item span {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-secondary);
  font-weight: 400;
}

.skill-evidence-footer {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--color-line);
  font-size: 0.75rem;
  color: var(--color-secondary);
}

.skill-evidence-footer strong {
  color: var(--color-ink);
}

/* --------------------------------------------------------------------------
   12. Contact Section (Contact Page & Home Teaser)
   -------------------------------------------------------------------------- */
.contact-section {
  padding: clamp(56px, 8vw, 100px) 0;
  background-color: var(--color-paper);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: clamp(24px, 4vw, 56px);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-heading {
  font-size: clamp(2.3rem, 4.2vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--color-ink);
}

.contact-lead {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-secondary);
  max-width: 480px;
}

.contact-channels {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.channel-card {
  background-color: var(--color-paper-light);
  border: 1px solid var(--color-line-dark);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.15s var(--ease-smooth), background-color 0.15s var(--ease-smooth);
}

.channel-card:hover {
  border-color: var(--color-accent);
  background-color: #FFFFFF;
}

.channel-card-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.channel-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-secondary);
}

.channel-val {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-ink);
}

.channel-action-btn {
  padding: 8px 14px;
  background-color: var(--color-panel);
  border: 1px solid var(--color-line-dark);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-ink);
  transition: background-color 0.15s var(--ease-smooth), color 0.15s var(--ease-smooth);
}

.channel-action-btn:hover {
  background-color: var(--color-accent);
  color: #FFFFFF;
  border-color: var(--color-accent);
}

/* Direct Message Composer (Honest mailto generator) */
.contact-composer-card {
  background-color: var(--color-paper-light);
  border: 1px solid var(--color-line-dark);
  padding: clamp(24px, 4vw, 36px);
  box-shadow: 8px 8px 0 var(--color-line-dark);
}

.composer-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-line);
  margin-bottom: 20px;
}

.composer-header h3 {
  font-size: 1.5rem;
  color: var(--color-ink);
}

.composer-header p {
  font-size: 0.875rem;
  margin-top: 4px;
}

.composer-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-secondary);
}

.form-input, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  background-color: var(--color-paper);
  border: 1px solid var(--color-line-dark);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--color-ink);
  border-radius: 0;
  transition: border-color 0.15s var(--ease-smooth), background-color 0.15s var(--ease-smooth);
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  background-color: #FFFFFF;
}

.form-textarea {
  resize: vertical;
  min-height: 110px;
}

.composer-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
}

.composer-note {
  font-size: 0.75rem;
  color: var(--color-secondary);
  line-height: 1.4;
}

/* Home Page Section Teaser Banners */
.home-section-teaser {
  padding: clamp(48px, 6vw, 72px) 0;
  border-top: 1px solid var(--color-line);
}

.teaser-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

/* --------------------------------------------------------------------------
   13. Site Footer & Colophon
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: var(--color-ink);
  color: var(--color-paper);
  padding: clamp(48px, 6vw, 72px) 0 clamp(32px, 4vw, 48px);
  border-top: 1px solid var(--color-ink-dark);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-ink-soft);
}

.footer-brand h3 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--color-paper);
}

.footer-brand p {
  color: var(--color-line);
  font-size: 0.875rem;
  margin-top: 6px;
  max-width: 340px;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-nav h4 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--color-accent-light);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.footer-nav a {
  font-size: 0.875rem;
  color: var(--color-paper);
  transition: color 0.15s var(--ease-smooth);
}

.footer-nav a:hover {
  color: var(--color-panel);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: var(--space-lg);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--color-line);
}

.colophon-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background-color: var(--color-ink-dark);
  border: 1px solid var(--color-ink-soft);
  color: var(--color-line);
}

/* --------------------------------------------------------------------------
   14. Scroll Reveal & Restrained Motion
   -------------------------------------------------------------------------- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}

/* Directional reveal variants (source order after base so they win) */
.reveal-left  { transform: translateX(-26px); }
.reveal-right { transform: translateX(26px); }
.reveal-scale { transform: scale(0.955); }

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   15. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 880px) {
  .hero-grid {
    /* minmax(0, …) like the desktop template: the 3D stage's min-content
       (perspective children) must not widen the single-column track. */
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-xl);
  }
  
  .hero-stage-wrapper {
    min-height: 400px;
  }
  
  .case-content-grid {
    grid-template-columns: 1fr;
  }
  
  .case-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  .case-sidebar-actions {
    grid-column: 1 / -1;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  
  .about-sidebar {
    position: static;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .work-grid {
    grid-template-columns: 1fr;
  }
  
  .work-card {
    border-right: none;
    border-bottom: 1px solid var(--color-line);
    min-height: auto;
  }
  
  .work-card:last-child {
    border-bottom: none;
  }
}

@media (max-width: 768px) {
  .header-nav {
    display: none;
  }
  
  .mobile-nav-toggle {
    display: flex;
  }
  
  .matrix-table {
    display: block;
    overflow-x: auto;
  }
  
  .about-principles {
    grid-template-columns: 1fr;
  }
  
  .skills-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-stage {
    height: 380px;
  }
  
  .phone-chassis {
    transform: scale(0.85) rotateY(-14deg) rotateX(10deg) rotateZ(5deg);
  }
  
  .stage-floating-badge {
    bottom: 10px;
    left: 10px;
  }
  
  .hero-meta-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .footer-top {
    flex-direction: column;
  }
  
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .hero-headline {
    font-size: 2.35rem;
  }
  
  .hero-stage {
    height: 330px;
  }
  
  .phone-chassis {
    transform: scale(0.72) rotateY(-12deg) rotateX(8deg) rotateZ(4deg);
  }
  
  .orbit-one {
    width: 260px;
    height: 260px;
  }
  
  .orbit-two {
    width: 240px;
    height: 240px;
  }
  
  .stage-floating-badge {
    position: relative;
    left: auto;
    bottom: auto;
    width: 100%;
    max-width: 100%;
    margin-top: 16px;
  }
  
  .btn-primary, .btn-secondary {
    width: 100%;
  }
  
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   15b. Connected Scroll-Controlled 3D Showcase (save.design reference)
   Rule: SOLID COLORS ONLY. ZERO GRADIENTS.
   -------------------------------------------------------------------------- */
.scroll-showcase-section {
  position: relative;
  width: 100%;
  background-color: var(--color-paper);
  border-bottom: 1px solid var(--color-line);
}

/* 380vh Scroll Track on Desktop */
.showcase-track {
  position: relative;
  width: 100%;
  height: 380vh;
}

/* Pinned Sticky Viewport (sticks cleanly below fixed site header) */
.showcase-sticky-frame {
  position: sticky;
  top: var(--header-height);
  width: 100%;
  height: calc(100vh - var(--header-height));
  height: calc(100dvh - var(--header-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background-color: var(--color-paper);
  z-index: 5;
}

.showcase-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 940px;
  justify-content: space-between;
  padding-top: clamp(16px, 2.5vh, 32px);
  padding-bottom: clamp(16px, 2.5vh, 32px);
}

/* Header Milestone Bar & Progress */
.showcase-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-line);
  padding-bottom: 14px;
  margin-bottom: 10px;
  gap: 16px;
  flex-wrap: wrap;
}

.showcase-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  transition: color 0.15s var(--ease-smooth), transform 0.15s var(--ease-smooth);
}

.step-btn:hover {
  color: var(--color-ink);
}

.step-btn.active {
  color: var(--color-accent);
  font-weight: 800;
  border-bottom: 2px solid var(--color-accent);
}

.step-btn .step-num {
  font-size: 0.625rem;
  opacity: 0.85;
}

.step-sep {
  color: var(--color-line-dark);
  font-size: 0.6875rem;
}

.showcase-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--color-secondary);
}

.progress-bar-track {
  width: 140px;
  height: 6px;
  background-color: var(--color-paper-light);
  border: 1px solid var(--color-line-dark);
  position: relative;
  overflow: hidden;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background-color: var(--color-accent);
  transition: width 0.05s linear;
}

/* Two-Column Stage Layout */
.showcase-stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  flex: 1;
  min-height: 0;
}

/* Left Column: Story Narratives */
.showcase-narrative-col {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: center;
}

.showcase-story-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.showcase-story-card.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.story-title {
  font-size: clamp(1.85rem, 3.2vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--color-ink);
}

.story-desc {
  font-size: clamp(0.95rem, 1.15vw, 1.0625rem);
  line-height: 1.6;
  color: var(--color-secondary);
  max-width: 480px;
}

.story-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.story-tag {
  padding: 4px 10px;
  background-color: var(--color-paper-warm);
  border: 1px solid var(--color-line-dark);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-ink);
}

.story-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.story-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 8px;
}

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

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* Right Column: 3D Stage Viewport */
.showcase-stage-col {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 440px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.showcase-viewport-3d {
  position: relative;
  width: 100%;
  height: 480px;
  perspective: 1200px;
  transform-style: preserve-3d;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Base Project 3D Object */
.project-object {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: filter 0.2s var(--ease-smooth);
}

.project-object:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 8px;
}

.project-object:hover .object-badge {
  background-color: var(--color-panel);
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.object-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  background-color: var(--color-paper-light);
  border: 1px solid var(--color-line-dark);
  box-shadow: 4px 4px 0 var(--color-line-dark);
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  color: var(--color-ink);
  pointer-events: none;
  transition: background-color 0.15s var(--ease-smooth), border-color 0.15s var(--ease-smooth), transform 0.15s var(--ease-smooth);
}

.object-badge .badge-num {
  font-weight: 800;
  color: var(--color-accent);
}

.object-badge strong {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.object-badge small {
  color: var(--color-secondary);
  font-size: 0.625rem;
}

/* --------------------------------------------------------------------------
   Object 1: SafeAlert Phone Chassis
   -------------------------------------------------------------------------- */
.object-phone .phone-body {
  width: 204px;
  height: 412px;
  background-color: var(--color-ink-dark);
  border: 7px solid #142226;
  border-radius: 34px;
  box-shadow: 14px 20px 0 var(--color-line-dark);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}

/* --------------------------------------------------------------------------
   Object 2: Library Control Terminal Chassis
   -------------------------------------------------------------------------- */
.object-terminal .terminal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-style: preserve-3d;
}

.terminal-bezel {
  width: 320px;
  height: 240px;
  background-color: #162428;
  border: 7px solid #101B1E;
  border-radius: 8px;
  box-shadow: 14px 20px 0 var(--color-line-dark);
  padding: 8px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.terminal-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  color: #9BB1AD;
  border-bottom: 1px solid #23373D;
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.terminal-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.term-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #2D625F;
  display: inline-block;
}

.terminal-host {
  color: #6C8280;
  letter-spacing: 0.06em;
}

.terminal-screen {
  background-color: #101B1E;
  border: 1px solid #23373D;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  box-sizing: border-box;
}

.terminal-grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  font-weight: 700;
  color: #8CA09C;
  letter-spacing: 0.08em;
  padding-bottom: 4px;
  border-bottom: 1px solid #1E2F35;
}

.term-status-live {
  color: #64C4B4;
}

.terminal-nodes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 6px 0;
}

.term-node {
  border: 1px solid #23373D;
  background-color: #162428;
  padding: 5px 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
}

.term-node .node-id {
  font-weight: 700;
  color: #F0EEE8;
}

.term-node.node-active {
  border-color: #2D625F;
}

.term-node.node-active .node-state {
  color: #64C4B4;
}

.term-node.node-locked {
  border-color: #8F3A32;
}

.term-node.node-locked .node-state {
  color: #F38D82;
}

.term-node.node-idle {
  border-color: #8C6A48;
}

.term-node.node-idle .node-state {
  color: #D2A762;
}

.terminal-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #162428;
  border-top: 1px solid #23373D;
  padding: 5px 8px;
  margin-top: 4px;
}

.term-quick-action {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.action-label {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  color: #8CA09C;
  font-weight: 700;
}

.action-btn {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 2px;
  letter-spacing: 0.06em;
}

.lock-btn {
  background-color: #B6544A;
  color: #FFFFFF;
}

.unlock-btn {
  background-color: #2D625F;
  color: #FFFFFF;
}

.terminal-stand {
  width: 44px;
  height: 28px;
  background-color: #1A282D;
  border: 2px solid #101B1E;
  border-top: none;
}

.terminal-base {
  width: 130px;
  height: 8px;
  background-color: #101B1E;
  border-radius: 2px;
  box-shadow: 4px 4px 0 var(--color-line-dark);
}

/* --------------------------------------------------------------------------
   Object 3: Dansamdolly Engineering Dossier Chassis
   -------------------------------------------------------------------------- */
.object-dossier .dossier-body {
  width: 340px;
  height: 320px;
  background-color: #F8F7F3;
  border: 3px solid #203238;
  box-shadow: 14px 20px 0 var(--color-line-dark);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.dossier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-line);
  padding-bottom: 8px;
}

.dossier-tag {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  font-weight: 700;
  color: var(--color-accent);
  background-color: var(--color-panel);
  border: 1px solid var(--color-line-dark);
  padding: 2px 8px;
}

.dossier-ref {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  color: var(--color-secondary);
}

.dossier-project-name {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 10px 0 12px;
}

.dossier-project-name h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--color-ink);
  line-height: 1;
}

.dossier-label-badge {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  font-weight: 700;
  color: var(--color-ink);
  background-color: var(--color-paper-warm);
  border: 1px solid var(--color-line-dark);
  padding: 2px 6px;
}

.dossier-schematic {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.schematic-block {
  border: 1px solid var(--color-line-dark);
  background-color: var(--color-paper-light);
  padding: 6px 10px;
  font-family: var(--font-mono);
}

.schematic-block.highlight {
  background-color: var(--color-panel);
  border-color: var(--color-accent);
}

.block-title {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--color-ink);
  letter-spacing: 0.06em;
}

.block-sub {
  display: block;
  font-size: 0.5625rem;
  color: var(--color-secondary);
}

.schematic-arrow {
  text-align: center;
  font-size: 0.6875rem;
  color: var(--color-accent);
  line-height: 1;
  font-weight: 700;
}

.dossier-footer-note {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  color: var(--color-secondary);
  border-top: 1px solid var(--color-line);
  padding-top: 8px;
}

/* Actual Dansamdolly App Screenshot (replaces schematic blueprint) */
.dossier-screenshot-container {
  position: relative;
  flex: 1;
  min-height: 175px;
  overflow: hidden;
  border: 1px solid var(--color-line-dark);
  background-color: #FFFFFF;
  margin: 4px 0 8px;
}

.dossier-screenshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
  display: block;
}

/* --------------------------------------------------------------------------
   Mobile & Tablet Responsive Adjustments for Scroll Showcase
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
  .showcase-track {
    height: auto !important;
  }
  
  .showcase-sticky-frame {
    position: relative !important;
    top: auto !important;
    height: auto !important;
    overflow: visible !important;
    padding-top: var(--space-xl) !important;
    padding-bottom: var(--space-xl) !important;
  }
  
  .showcase-container {
    max-height: none !important;
  }
  
  .showcase-header-bar {
    display: none !important;
  }
  
  .showcase-stage-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: var(--space-2xl) !important;
  }
  
  .showcase-narrative-col {
    display: none !important;
  }
  
  .showcase-stage-col {
    min-height: auto !important;
  }
  
  .showcase-viewport-3d {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    perspective: none !important;
    gap: var(--space-3xl) !important;
  }
  
  .project-object {
    position: relative !important;
    transform: none !important;
    opacity: 1 !important;
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 auto !important;
  }

  .object-mobile-narrative {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    width: 100%;
    text-align: left;
    padding-top: 12px;
    border-top: 1px solid var(--color-line);
  }
  
  .object-mobile-narrative h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--color-ink);
    line-height: 1.1;
  }
  
  .object-mobile-narrative p {
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--color-secondary);
  }
  
  .object-mobile-narrative .btn-primary {
    width: 100%;
    margin-top: 6px;
    padding: 12px 18px;
    font-size: 0.75rem;
  }
}

.object-mobile-narrative {
  display: none;
}

/* --------------------------------------------------------------------------
   16. Accessibility: Prefers Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .phone-chassis,
  .project-object {
    transform: none !important;
    transition: none !important;
  }

  .showcase-track {
    height: auto !important;
  }

  .showcase-sticky-frame {
    position: relative !important;
    top: auto !important;
    height: auto !important;
    overflow: visible !important;
  }

  .showcase-viewport-3d {
    perspective: none !important;
  }
  
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  main#main-content {
    animation: none !important;
  }
}

/* --------------------------------------------------------------------------
   17. Page-to-Page Transitions (Editorial Fade + Rise)
   Progressive enhancement: pure-CSS enter fade so content is always visible
   even if JS fails; JS adds `.is-leaving` on <html> to fade out before nav.
   Scoped to no-preference so reduced-motion users get instant navigation.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes pageEnter {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes pageLeave {
    from {
      opacity: 1;
      transform: translateY(0);
    }
    to {
      opacity: 0;
      transform: translateY(-10px);
    }
  }

  main#main-content {
    animation: pageEnter 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  /* Swapping the animation-name cleanly replaces the filled enter animation */
  html.is-leaving main#main-content {
    animation: pageLeave 0.32s cubic-bezier(0.7, 0, 0.84, 0) forwards;
  }
}

/* --------------------------------------------------------------------------
   18. Hover & Micro-Interactions (Gradient-Free)
   -------------------------------------------------------------------------- */

/* Text link underline sweep (footer nav + inline email/repo links) */
.footer-nav a,
a.channel-val {
  position: relative;
  display: inline-block;
}

.footer-nav a::after,
a.channel-val::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-nav a:hover::after,
a.channel-val:hover::after {
  transform: scaleX(1);
}

a.channel-val:hover {
  color: var(--color-accent);
}

/* Header brand subtle shift */
.header-brand {
  transition: opacity 0.2s var(--ease-smooth);
}

.header-brand:hover {
  opacity: 0.7;
}

/* Screenshot zoom-on-hover (clipped by overflow-hidden containers) */
.screen-screenshot,
.dossier-screenshot {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-stage:hover .screen-screenshot,
.project-object:hover .screen-screenshot,
.project-object:hover .dossier-screenshot {
  transform: scale(1.05);
}

/* Tech / story tag hover lift */
.tech-tag,
.story-tag {
  transition: transform 0.18s var(--ease-smooth), border-color 0.18s var(--ease-smooth), background-color 0.18s var(--ease-smooth), color 0.18s var(--ease-smooth);
}

.tech-tag:hover,
.story-tag:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Editorial index badges */
.editorial-badge {
  transition: background-color 0.18s var(--ease-smooth), border-color 0.18s var(--ease-smooth), transform 0.18s var(--ease-smooth);
}

.editorial-badge:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent);
}

/* Jump pills nudge */
.jump-pill {
  transition: background-color 0.15s var(--ease-smooth), border-color 0.15s var(--ease-smooth), color 0.15s var(--ease-smooth), transform 0.15s var(--ease-smooth);
}

.jump-pill:hover {
  transform: translateY(-2px);
}

/* Channel card slide-in accent */
.channel-card {
  transition: border-color 0.18s var(--ease-smooth), background-color 0.18s var(--ease-smooth), transform 0.18s var(--ease-smooth), box-shadow 0.18s var(--ease-smooth);
}

.channel-card:hover {
  transform: translateX(4px);
  box-shadow: -4px 4px 0 var(--color-line);
}

/* Principle cards lift */
.principle-card {
  transition: transform 0.2s var(--ease-smooth), border-color 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
}

.principle-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-line-dark);
  box-shadow: 5px 5px 0 var(--color-line);
}

/* Architecture diagram nodes */
.diagram-node {
  transition: transform 0.18s var(--ease-smooth), border-color 0.18s var(--ease-smooth), background-color 0.18s var(--ease-smooth);
}

.diagram-node:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent);
}

/* Work-card whole-card lift (adds to existing background shift) */
.work-card:hover {
  transform: translateY(-3px);
}

/* Case-study jump anchor offset so sticky header doesn't cover targets */
.case-study-block {
  scroll-margin-top: calc(var(--header-height) + 24px);
}

/* Factsheet row hover cue */
.factsheet-row {
  transition: color 0.15s var(--ease-smooth);
}

.factsheet-row:hover strong {
  color: var(--color-accent);
}

/* ==========================================================================
   PROJECT SCREEN GALLERIES + LIGHTBOX
   Real screenshots captured from the running builds. Solid colors, zero gradients.
   ========================================================================== */
.case-gallery-block {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 2px solid var(--color-ink);
}

.case-gallery-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--space-lg);
}

.case-gallery-title {
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  letter-spacing: -0.025em;
  color: var(--color-ink);
}

.case-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: clamp(14px, 2vw, 22px);
}

.case-gallery--phone { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.case-gallery--web   { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.shot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}
.shot-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--color-line-dark);
  background-color: var(--color-paper-light);
  cursor: zoom-in;
  overflow: hidden;
  transition: transform 0.18s var(--ease-smooth), box-shadow 0.18s var(--ease-smooth), border-color 0.18s var(--ease-smooth);
}

.case-gallery--phone .shot-btn { aspect-ratio: 1080 / 2400; }
.case-gallery--web .shot-btn   { aspect-ratio: 16 / 10; }

.shot-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.shot-btn:hover {
  transform: translateY(-3px);
  border-color: var(--color-ink);
  box-shadow: var(--shadow-flat-sm);
}

.shot-btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.shot figcaption {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-secondary);
  text-transform: uppercase;
}
/* Lightbox overlay (built once by JS, reused by every gallery) —
   visibility/opacity base so CSS can fade it in and out (no display cut). */
.lightbox {
  display: flex;
  visibility: hidden;
  opacity: 0;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background-color: rgba(20, 34, 38, 0.94);
  padding: clamp(16px, 4vw, 48px);
  align-items: center;
  justify-content: center;
}

.lightbox.is-open {
  visibility: visible;
  opacity: 1;
}

.lightbox-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: min(1100px, 100%);
  max-height: 100%;
  align-items: center;
}

.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border: 1px solid var(--color-line-dark);
  background-color: var(--color-paper);
}

.lightbox-caption {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
  color: var(--color-paper);
  text-align: center;
}
.lightbox-close,
.lightbox-nav {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ink);
  background-color: var(--color-paper);
  border: 1px solid var(--color-ink);
  padding: 10px 14px;
  cursor: pointer;
  transition: background-color 0.15s var(--ease-smooth), color 0.15s var(--ease-smooth);
}

.lightbox-close { top: clamp(12px, 3vw, 28px); right: clamp(12px, 3vw, 28px); }
.lightbox-nav.prev { left: clamp(8px, 2vw, 24px); top: 50%; transform: translateY(-50%); }
.lightbox-nav.next { right: clamp(8px, 2vw, 24px); top: 50%; transform: translateY(-50%); }

.lightbox-close:hover,
.lightbox-nav:hover {
  background-color: var(--color-ink);
  color: var(--color-paper);
}

.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
  outline: 3px solid var(--color-accent-light);
  outline-offset: 2px;
}

.lightbox-counter {
  position: absolute;
  bottom: clamp(12px, 3vw, 28px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--color-paper);
}
@media (max-width: 640px) {
  .case-gallery--web { grid-template-columns: 1fr; }
  .case-gallery--phone { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .lightbox-nav.prev { left: 8px; }
  .lightbox-nav.next { right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .shot-btn,
  .lightbox-close,
  .lightbox-nav { transition: none; }
  .shot-btn:hover { transform: none; }
}

/* ==========================================================================
   09. ARCHITECTURE DIAGRAMS, THEME TOGGLE, DARK MODE & POLISH
   Rule still holds: SOLID COLORS ONLY. ZERO GRADIENTS.
   ========================================================================== */

/* --- Inline SVG architecture diagrams (flat, token-driven, dark-aware) --- */
.arch-svg-wrap {
  margin: 0 0 var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.arch-svg { display: block; width: 100%; height: auto; min-width: 520px; }
.arch-svg .arch-box { fill: var(--color-paper-light); stroke: var(--color-line-dark); stroke-width: 1.5; }
.arch-svg .arch-box--accent { fill: var(--color-accent-light); stroke: var(--color-accent); }
.arch-svg .arch-box--muted { fill: var(--color-paper-dim); stroke: var(--color-line-dark); }
.arch-svg .arch-boundary { fill: none; stroke: var(--color-line-dark); stroke-width: 1.5; stroke-dasharray: 5 5; }
.arch-svg .arch-flow { stroke: var(--color-line-dark); stroke-width: 1.5; fill: none; }
.arch-svg .arch-title { font-family: var(--font-sans); font-weight: 700; font-size: 13px; fill: var(--color-ink); }
.arch-svg .arch-sub { font-family: var(--font-mono); font-size: 9px; fill: var(--color-secondary); letter-spacing: 0.02em; }
.arch-svg .arch-flow-label { font-family: var(--font-mono); font-size: 8.5px; fill: var(--color-secondary); letter-spacing: 0.03em; }
.arch-svg .arch-zone-label { font-family: var(--font-mono); font-weight: 700; font-size: 9px; fill: var(--color-secondary); letter-spacing: 0.12em; }
.arch-svg .arch-arrow { fill: var(--color-line-dark); }

/* --- Theme toggle control (in header, always visible) --- */
.header-nav { margin-left: auto; }
.theme-toggle {
  display: grid; place-items: center;
  width: 42px; height: 42px; margin-left: 18px; flex-shrink: 0;
  background: transparent; border: 1px solid var(--color-line-dark);
  color: var(--color-ink); cursor: pointer;
  transition: border-color var(--dur-quick) var(--ease-smooth), color var(--dur-quick) var(--ease-smooth), background-color var(--dur-quick) var(--ease-smooth);
}
.theme-toggle:hover { border-color: var(--color-accent); color: var(--color-accent); background-color: var(--color-paper-light); }
/* Sun/moon share one grid cell and crossfade with a quarter-turn roll,
   so the icon flips over instead of hard-cutting between states. */
.theme-toggle svg {
  width: 18px; height: 18px; grid-area: 1 / 1; display: block;
  transition: opacity var(--dur-quick) var(--ease-smooth), transform var(--dur-standard) var(--ease-out-editorial);
}
.theme-toggle .icon-sun  { opacity: 0; transform: rotate(-100deg) scale(0.55); }
.theme-toggle .icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="dark"] .theme-toggle .icon-sun  { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(100deg) scale(0.55); }
@media (max-width: 980px) { .theme-toggle { margin-left: auto; margin-right: 12px; width: 40px; height: 40px; } }
/* --- Dark Mode (token inversion only — solid colors, zero gradients) --- */
[data-theme="dark"] {
  --color-paper: #141B1C;
  --color-paper-light: #1B2426;
  --color-paper-warm: #212B2C;
  --color-paper-dim: #0F1516;

  --color-ink: #ECEAE3;
  --color-ink-dark: #FAF9F5;
  --color-ink-soft: #C4CDCA;

  --color-secondary: #9AA6A3;
  --color-secondary-light: #788683;

  --color-accent: #74B7B1;
  --color-accent-hover: #93CBC5;
  --color-accent-light: #1E3230;

  --color-line: #2B3839;
  --color-line-dark: #3C4B4B;
  --color-line-light: #212D2D;

  --color-panel: #1E2A29;
  --color-panel-hover: #26332F;

  --color-alert-red: #DA7A70;
  --color-alert-dark: #E79389;
  --color-alert-surface: #2A1B19;

  --color-dot-systems: #C79A6B;
  --color-dot-business: #82A2B0;

  --shadow-flat-sm: 4px 4px 0 #0A1011;
  --shadow-flat-md: 8px 8px 0 #0A1011;
  --shadow-flat-lg: 14px 14px 0 #05090A;

  color-scheme: dark;
}
/* Dark-mode fixes where text sits on a now-light accent/ink surface */
[data-theme="dark"] .btn-primary:hover { color: var(--color-paper); }
[data-theme="dark"] .nav-cta:hover,
[data-theme="dark"] .nav-cta.active,
[data-theme="dark"] .jump-pill:hover { color: var(--color-paper); }
/* Dark-mode fixes for hardcoded #FFFFFF hover/focus surfaces */
[data-theme="dark"] .channel-card:hover { background-color: var(--color-panel-hover); }
[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-textarea:focus { background-color: var(--color-paper-warm); }
[data-theme="dark"] .stage-floating-badge:hover { background-color: var(--color-panel-hover); }
/* --- Contact composer feedback states --- */
.composer-note.is-success { color: var(--color-accent); font-weight: 600; }
.composer-note.is-error { color: var(--color-alert-red); font-weight: 600; }
.composer-form.is-sending { opacity: 0.65; pointer-events: none; }

/* --- 404 / Not Found page --- */
.error-shell { min-height: 60vh; display: flex; align-items: center; padding: clamp(40px, 8vw, 96px) 0; }
.error-block { max-width: 660px; }
.error-code {
  font-family: var(--font-mono); font-weight: 700; line-height: 1;
  font-size: clamp(3.5rem, 12vw, 7rem); letter-spacing: -0.02em; color: var(--color-accent);
}
.error-title { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 14px 0 10px; color: var(--color-ink); }
.error-lead { font-size: 1.05rem; color: var(--color-ink-soft); max-width: 52ch; line-height: 1.7; }
.error-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.error-links { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--color-line-dark); display: flex; flex-wrap: wrap; gap: 8px 24px; }
.error-links a { font-family: var(--font-mono); font-size: 0.8rem; color: var(--color-secondary); border-bottom: 1px solid var(--color-line-dark); }
.error-links a:hover { color: var(--color-accent); border-color: var(--color-accent); }

/* ==========================================================================
   19. CINEMATIC LAYER (gradient-free · token-driven · reduced-motion-safe)
   Scroll-progress bar · staged intro reveal · kinetic marquee · magnetic CTA
   ========================================================================== */

/* --- 19a. Global scroll-progress bar (injected into <body> by main.js) --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 10000;              /* rides above the sticky header */
  background-color: transparent;
  pointer-events: none;
}
.scroll-progress__bar {
  height: 100%;
  width: 0;
  background-color: var(--color-accent);
  transition: width 0.08s linear;
}

/* --- 19b. Staged intro reveal (CSS-only; plays once on load) --- */
/* Safe default: fully visible if the animation never runs (no-JS / reduced-motion). */
[data-cinematic-intro] > * { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  @keyframes introRise {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes introHeadline {
    from { opacity: 0; transform: translateY(26px); clip-path: inset(0 0 100% 0); }
    to   { opacity: 1; transform: translateY(0);    clip-path: inset(0 0 0 0); }
  }
  [data-cinematic-intro] > * {
    opacity: 0;
    animation: introRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: calc(0.1s + var(--intro-i, 0) * 0.09s);
    will-change: opacity, transform;
  }
  /* Signature clip-mask rise for the lead headline of the intro block */
  [data-cinematic-intro] .hero-headline,
  [data-cinematic-intro] [data-intro-headline] {
    animation-name: introHeadline;
    animation-duration: 0.95s;
  }
}
/* --- 19c. Kinetic editorial marquee (auto-scroll; pauses on hover) --- */
.marquee {
  border-top: 1px solid var(--color-line-dark);
  border-bottom: 1px solid var(--color-line-dark);
  background-color: var(--color-paper-light);
  overflow: hidden;
  padding: 15px 0;
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 40s linear infinite;
  will-change: transform;
}
.marquee:hover .marquee__track,
.marquee:focus-within .marquee__track { animation-play-state: paused; }
.marquee__group { display: flex; align-items: center; flex-shrink: 0; }
.marquee__item {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-ink);
  white-space: nowrap;
  padding: 0 clamp(18px, 3vw, 38px);
}
.marquee__sep { color: var(--color-accent); font-size: 0.62rem; }
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }   /* two identical groups → seamless loop */
}

/* --- 19d. Magnetic primary CTAs: main.js sets the inline transform; this
   keeps the spring-back smooth (base .btn-primary already transitions transform). */
.btn-primary { will-change: transform; }

/* --- 19e. Reduced-motion: freeze the marquee into a centered static wrap --- */
@media (prefers-reduced-motion: reduce) {
  .marquee__track {
    animation: none;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
  }
  .marquee__group[aria-hidden="true"] { display: none; }
  .scroll-progress__bar { transition: none; }
}

/* ==========================================================================
   20. CINEMATIC SCENES (gradient-free · token-driven · reduced-motion-safe)
   Opening title sequence · scene-cut page curtain · scroll parallax depth
   ========================================================================== */

/* --- 20a. Opening title sequence (homepage · first visit · built by main.js) --- */
.title-seq {
  position: fixed;
  inset: 0;
  z-index: 11000;                          /* above header, progress bar, curtain */
  background-color: var(--color-paper);    /* solid fill — zero gradients */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform: translateY(0);
  transition: transform 0.85s cubic-bezier(0.76, 0, 0.24, 1);
}
.title-seq.is-leaving { transform: translateY(-100%); }   /* curtain lifts to reveal */
.title-seq__inner {
  text-align: center;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.title-seq__chapter {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--color-secondary);
}
.title-seq__name {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 8vw, 5.2rem);
  font-weight: 400;
  line-height: 1.02;
  color: var(--color-ink);
}
.title-seq__name span { color: var(--color-accent); }
.title-seq__role {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-secondary);
}
.title-seq__rule {
  height: 2px;
  width: 88px;
  background-color: var(--color-accent);
  margin-top: 6px;
}
.title-seq__skip {
  position: absolute;
  bottom: 26px;
  left: 0;
  right: 0;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-secondary);
  opacity: 0.7;
}
@media (prefers-reduced-motion: no-preference) {
  @keyframes titleRise {
    from { opacity: 0; transform: translateY(24px); clip-path: inset(0 0 100% 0); }
    to   { opacity: 1; transform: translateY(0);    clip-path: inset(0 0 0 0); }
  }
  @keyframes titleFade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes ruleWipe  { from { width: 0; } to { width: 88px; } }
  .title-seq__chapter { opacity: 0; animation: titleFade 0.6s ease 0.15s both; }
  .title-seq__name    { opacity: 0; animation: titleRise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both; }
  .title-seq__role    { opacity: 0; animation: titleFade 0.7s ease 0.75s both; }
  .title-seq__rule    { animation: ruleWipe 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.95s both; }
  .title-seq__skip    { opacity: 0; animation: titleFade 0.6s ease 1.5s both; }
}
/* --- 20b. Scene-cut page curtain (solid panel wipe on internal navigation) --- */
.page-curtain {
  position: fixed;
  inset: 0;
  z-index: 10600;                          /* above header + progress, below title */
  background-color: var(--color-paper);    /* solid fill — zero gradients */
  border-top: 2px solid var(--color-accent);
  pointer-events: none;
  transform: translateY(100%);             /* parked below the fold */
  transition: transform 0.52s cubic-bezier(0.76, 0, 0.24, 1);
}
.page-curtain.is-covering { transform: translateY(0); }   /* sweeps up to cover */
@media (prefers-reduced-motion: reduce) {
  .page-curtain { transition: none; }      /* main.js also skips covering here */
}

/* --- 20c. Scroll parallax depth (main.js sets the inline transform per node) --- */
@media (prefers-reduced-motion: no-preference) {
  [data-parallax] { will-change: transform; }
}

/* ==========================================================================
   21. MOTION CRAFT LAYER (Premium editorial personality · zero gradients)
   Built on the :root motion tokens:
     entrances/reveals  → --ease-out-editorial (decelerate, land gently)
     state changes      → --ease-smooth
     exits/dismissals   → --ease-accelerate (gentle start, fast departure)
     quick 140ms · standard 300ms · slow 560ms
   Three motion layers: primary actions keep their existing motion; this
   section adds the secondary (icon/arrow follow-through, drawer cascade)
   and ambient (dot breathing, ring drift) layers, plus modal-grade
   enter/exit for the lightbox. All movement is decorative-only and every
   rule is scoped so reduced-motion users get instant, static UI.
   ========================================================================== */

/* --- 21a. Secondary layer: button arrow follow-through on hover --- */
.btn-primary span,
.btn-secondary span {
  display: inline-block;
  transition: transform var(--dur-quick) var(--ease-out-editorial);
}
.btn-primary:hover span   { transform: translateY(3px); }   /* ↓ leans into the scroll */
.btn-secondary:hover span { transform: translate(2px, -2px); } /* ↗ points onward */

/* --- 21b. Ambient layer: status dots breathe, orbit rings drift --- */
@media (prefers-reduced-motion: no-preference) {
  .status-dot,
  .meta-eyebrow .dot-indicator {
    animation: dotBreath 2.6s ease-in-out infinite;   /* sine-ish seamless loop */
  }
  .orbit-one { animation: orbitSwayA 18s ease-in-out infinite; }
  .orbit-two { animation: orbitSwayB 24s ease-in-out infinite; } /* counter-phase */
}
@keyframes dotBreath {
  0%, 100% { opacity: 1;    transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.8); }
}
@keyframes orbitSwayA {
  0%, 100% { transform: rotateX(68deg) rotateZ(-26deg); }
  50%      { transform: rotateX(65deg) rotateZ(-18deg); }
}
@keyframes orbitSwayB {
  0%, 100% { transform: rotateY(65deg) rotateZ(21deg); }
  50%      { transform: rotateY(62deg) rotateZ(30deg); }
}

/* --- 21c. Mobile drawer: settle in / accelerate out + link cascade --- */
/* Choreography budget: 6 links × 40ms steps = 240ms < 500ms stagger cap.
   Base states are set unconditionally (instant for reduced motion);
   only the timed transitions are gated behind no-preference. */
@media (prefers-reduced-motion: no-preference) {
  .mobile-drawer {
    transition: opacity var(--dur-standard) var(--ease-accelerate),
                transform var(--dur-standard) var(--ease-accelerate),
                visibility 0s linear var(--dur-standard);   /* hold visible while fading out */
  }
  .mobile-drawer.is-open {
    transition: opacity var(--dur-standard) var(--ease-out-editorial),
                transform var(--dur-standard) var(--ease-out-editorial),
                visibility 0s linear 0s;
  }
  .mobile-nav-links a {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity var(--dur-standard) var(--ease-out-editorial),
                transform var(--dur-standard) var(--ease-out-editorial);
  }
  .mobile-drawer.is-open .mobile-nav-links a { opacity: 1; transform: none; }
  .mobile-drawer.is-open .mobile-nav-links a:nth-child(1) { transition-delay: 40ms; }
  .mobile-drawer.is-open .mobile-nav-links a:nth-child(2) { transition-delay: 80ms; }
  .mobile-drawer.is-open .mobile-nav-links a:nth-child(3) { transition-delay: 120ms; }
  .mobile-drawer.is-open .mobile-nav-links a:nth-child(4) { transition-delay: 160ms; }
  .mobile-drawer.is-open .mobile-nav-links a:nth-child(5) { transition-delay: 200ms; }
  .mobile-drawer.is-open .mobile-nav-links a:nth-child(6) { transition-delay: 240ms; }
}

/* --- 21d. Lightbox: modal-grade enter/exit + figure rise --- */
@media (prefers-reduced-motion: no-preference) {
  .lightbox {
    transition: opacity var(--dur-standard) var(--ease-accelerate),
                visibility 0s linear var(--dur-standard);
  }
  .lightbox.is-open {
    transition: opacity var(--dur-standard) var(--ease-out-editorial),
                visibility 0s linear 0s;
  }
  .lightbox-figure {
    transform: translateY(16px) scale(0.985);
    transition: transform var(--dur-slow) var(--ease-out-editorial);
  }
  .lightbox.is-open .lightbox-figure { transform: none; }
}

/* --- 21e. State feedback: copy-success settle, composer error shake --- */
/* Success: gentle scale settle (Premium = no overshoot) as the label swaps. */
@keyframes copiedPop {
  0%   { transform: scale(0.97); }
  100% { transform: scale(1); }
}
[data-copy-email].is-copied {
  animation: copiedPop var(--dur-standard) var(--ease-out-editorial);
}

/* Error: firm horizontal shake, 2.5 oscillations, sharp stops, no overshoot. */
@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-9px); }
  40%      { transform: translateX(7px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(3px); }
}
.shake-invalid {
  animation: inputShake 0.38s ease-in-out;
}

/* Composer status notes arrive with a small decelerate rise, not a hard swap. */
@media (prefers-reduced-motion: no-preference) {
  .composer-note.is-success,
  .composer-note.is-error {
    animation: noteArrive var(--dur-standard) var(--ease-out-editorial);
  }
}
@keyframes noteArrive {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* --- 21f. Header scene-in settle (companion to the pageEnter rise) --- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes headerSettle {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: none; }
  }
  .site-header {
    animation: headerSettle 0.55s var(--ease-out-editorial) both;
  }
}

/* ==========================================================================
   22. SCROLLYTELLING SCENES (gradient-free · token-driven · reduced-motion-safe)
   The homepage reads as a five-act scroll film. main.js measures each scene
   once per frame and writes a single 0..1 progress value as a custom
   property; CSS owns every visual mapping. Default states (no JS, reduced
   motion, small screens) are fully readable and static.
     Act 1  hero exit        — depth-layered scrubbed departure
     Act 2  manifesto        — pinned word-by-word illumination
     Act 3  work deck        — sticky editorial panels that stack
     Act 4  capabilities     — pinned horizontal pan
     Act 5  contact finale   — masked-line reveal
   ========================================================================== */

/* --- 22a. Act 1 · Hero exit rigs (main.js sets inline transform/opacity) --- */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *,
  .hero-stage-wrapper {
    will-change: transform, opacity;
  }
}

/* --- 22b. Act 2 · Manifesto (pinned word illumination) --- */
.manifesto-section {
  background-color: var(--color-paper);
  position: relative;            /* cap-section's border-top closes the seam */
}
.manifesto-track {
  /* Unpinned default (no JS / reduced motion / mobile): plain padded block. */
  padding: clamp(64px, 10vh, 120px) 0;
}
.has-scene-js .manifesto-track {
  height: 240vh;                 /* scrub runway */
  padding: 0;
}
.manifesto-sticky {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(24px, 4vh, 44px);
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
  padding-top: var(--header-height);
  max-width: var(--container-max);
  margin: 0 auto;
}
.manifesto-text {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3.4vw, 3.05rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--color-ink);
  max-width: 21em;
  font-weight: 400;
}
.manifesto-text em {
  font-style: italic;
  color: var(--color-accent);
}
.manifesto-word {
  display: inline-block;         /* transforms need a box; spaces live outside spans */
  white-space: pre;
}
.manifesto-foot {
  min-height: 2.4em;             /* reserve the row so the reveal never shifts layout */
}
/* Lit mapping: one custom property (--mp) drives every word. Each word i
   lights up across a 6-word burn window as --mp sweeps 0..1. */
.has-scene-js .manifesto-word {
  --lit: clamp(0, calc((var(--mp, 0) * (var(--mw-total, 30) + 5) - var(--wi, 0)) / 6), 1);
  opacity: calc(0.12 + 0.88 * var(--lit));
  transform: translateY(calc((1 - var(--lit)) * 0.14em));
  will-change: opacity, transform;
}
.has-scene-js .manifesto-foot {
  opacity: clamp(0, calc((var(--mp, 0) - 0.86) * 9), 1);
  transform: translateY(calc(clamp(0, calc((0.96 - var(--mp, 0)) * 10), 1) * 8px));
  transition: none;
}

/* --- 22c. Act 3 · Selected Work deck (CSS-only sticky stack + JS scale) --- */
.work-deck-section {
  padding: clamp(48px, 7vw, 84px) 0 clamp(56px, 8vh, 96px);
  background-color: var(--color-paper);
}
.work-deck {
  display: flex;
  flex-direction: column;
  gap: 13vh;
}
.deck-card {
  position: sticky;
  top: calc(var(--header-height) + 16px + var(--deck-i, 0) * 20px);
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(20px, 3vw, 44px);
  background-color: var(--color-paper-light);
  border: 1px solid var(--color-line-dark);
  box-shadow: var(--shadow-flat-md);
  padding: clamp(18px, 2.4vw, 34px);
  min-height: min(56vh, 520px);
  transform-origin: 50% 0%;
  position: -webkit-sticky;      /* Safari */
  position: sticky;
}
.deck-card__media {
  display: flex;
  min-height: 320px;
}
.deck-card__media .work-card-thumb {
  flex: 1;
  height: auto;
  min-height: 0;
  aspect-ratio: auto;            /* fill the column; body column sets row height */
  margin-bottom: 0;
}
.deck-card__body {
  display: flex;
  flex-direction: column;
  padding: clamp(6px, 1.4vw, 18px) clamp(2px, 1vw, 10px) clamp(2px, 0.6vw, 6px);
  min-width: 0;
}
.deck-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.deck-card__title {
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-top: 14px;
}
.deck-card__body .work-card-desc {
  font-size: clamp(0.95rem, 1.15vw, 1.0625rem);
  max-width: 52ch;
  margin-top: 12px;
}
.deck-card__foot {
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.deck-card__dim {
  position: absolute;
  inset: 0;
  background-color: var(--color-paper);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}
/* Scale/dim mapping: --deck-q rises 0→1 as the NEXT card travels up to pin.
   Default 0 = untouched card, so no-JS and reduced-motion render static. */
.has-scene-js .deck-card {
  transform: translateY(calc(var(--deck-q, 0) * -12px))
             scale(calc(1 - var(--deck-q, 0) * 0.05));
}
.has-scene-js .deck-card__dim {
  opacity: calc(var(--deck-q, 0) * 0.38);
}
@media (prefers-reduced-motion: no-preference) {
  .has-scene-js .deck-card { will-change: transform; }
}

/* --- 22d. Act 4 · Capabilities horizontal pan --- */
.cap-section {
  background-color: var(--color-paper-warm);
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
}
.cap-runway {
  /* Unpinned default: plain section. Pinned runway is desktop+JS only. */
  padding: clamp(64px, 10vh, 110px) 0;
}
.cap-sticky {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(24px, 4vh, 44px);
  padding-top: calc(var(--header-height) + 16px);
  padding-bottom: 32px;
}
.cap-head h2 {
  font-size: clamp(1.7rem, 2.7vw, 2.45rem);
  letter-spacing: -0.03em;
  max-width: 620px;
}
.cap-rule {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--color-accent);
  margin-top: 18px;
  transform: none;               /* fully drawn without JS */
}
.has-scene-js .cap-rule {
  transform: scaleX(var(--cap-p, 0));
  transform-origin: left center;
  will-change: transform;
}
.cap-track {
  display: flex;
  gap: clamp(16px, 2vw, 28px);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 10px 2px 26px;
  scrollbar-width: none;
}
.cap-track::-webkit-scrollbar { display: none; }
.cap-panel {
  flex: 0 0 clamp(300px, 34vw, 440px);
  scroll-snap-align: center;
  background-color: var(--color-paper-light);
  border: 1px solid var(--color-line-dark);
  box-shadow: var(--shadow-flat-sm);
  padding: clamp(20px, 2.2vw, 30px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: clamp(320px, 44vh, 420px);
}
.cap-panel h3 {
  font-size: clamp(1.45rem, 1.9vw, 1.8rem);
  letter-spacing: -0.02em;
}
.cap-list {
  list-style: none;
}
.cap-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}
.cap-list li + li {
  border-top: 1px solid var(--color-line-light);
}
.cap-list li b {
  font-weight: 600;
  font-size: 0.925rem;
  color: var(--color-ink);
}
.cap-list li span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--color-secondary);
  text-align: right;
  white-space: nowrap;
}
.cap-proof {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--color-line);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--color-secondary);
}
.cap-proof a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cap-proof a:hover { color: var(--color-ink); }
.cap-panel--cta {
  justify-content: center;
  align-items: flex-start;
  gap: 14px;
  background-color: var(--color-panel);
  flex-basis: clamp(240px, 24vw, 320px);
  color: var(--color-ink);
}
.cap-cta-arrow {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--color-accent);
  transition: transform var(--dur-standard) var(--ease-out-editorial);
}
.cap-panel--cta:hover .cap-cta-arrow { transform: translateX(8px); }
.cap-cta-label {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
/* Pinned pan (desktop + JS only): the runway becomes the scroll scrub length,
   the sticky frame clips, and main.js transforms the track. */
@media (min-width: 881px) {
  .has-scene-js .cap-runway {
    height: 310vh;
    padding: 0;
  }
  .has-scene-js .cap-sticky {
    overflow: hidden;
  }
  .has-scene-js .cap-track {
    overflow: visible;
    will-change: transform;
  }
}

/* --- 22e. Act 5 · Contact finale (masked-line reveal) --- */
.finale-section {
  /* Compact enough that the whole statement, CTAs and footer share the last
     viewport at max scroll — the reveal happens on the way in. */
  padding: clamp(56px, 8vh, 96px) 0 clamp(48px, 7vh, 80px);
  background-color: var(--color-paper);
  border-bottom: 1px solid var(--color-line);
}
.finale-title {
  font-size: clamp(2.5rem, 6.2vw, 5.2rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.finale-line { display: block; }
.finale-mail {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-secondary);
}
/* Per-line mask: --fp sweeps 0..1 once; line i unmasks inside its window.
   clip-path alone does the masking (negative insets clear ascenders, italic
   overhang and descenders; no overflow clipping to bite descenders). */
.has-scene-js .finale-line {
  --finale-line-p: clamp(0, calc(var(--fp, 1) * 2.4 - var(--li, 0) * 0.7), 1);
}
.has-scene-js .finale-line__inner {
  display: inline-block;
  clip-path: inset(-25% -6% calc((1 - var(--finale-line-p, 1)) * 120%) -6%);
  transform: translateY(calc((1 - var(--finale-line-p, 1)) * 0.45em));
  will-change: transform, clip-path;
}
.has-scene-js .finale-actions {
  opacity: clamp(0, calc((var(--fp, 1) - 0.62) * 5), 1);
  transform: translateY(calc(clamp(0, calc((0.9 - var(--fp, 1)) * 8), 1) * 10px));
}
.finale-actions {
  margin-top: clamp(32px, 5vh, 52px);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* --- 22f. Scene fallbacks: mobile + reduced motion --- */
@media (max-width: 880px) {
  .deck-card {
    grid-template-columns: 1fr;
    top: calc(var(--header-height) + 8px + var(--deck-i, 0) * 12px);
    min-height: 0;
    gap: 18px;
  }
  .deck-card__media { min-height: 0; }
  .deck-card__media .work-card-thumb { aspect-ratio: 16 / 10; }
  .deck-card__foot { flex-direction: column; align-items: flex-start; gap: 12px; }
  .work-deck { gap: 9vh; }
  .has-scene-js .manifesto-track { height: 200vh; }
  .manifesto-text { font-size: clamp(1.55rem, 6.4vw, 2.1rem); }
  .cap-panel { flex-basis: min(86vw, 400px); }
  .finale-title { font-size: clamp(2.1rem, 9vw, 3rem); }
}
@media (prefers-reduced-motion: reduce) {
  /* Belt and suspenders: the engine never adds .has-scene-js under reduced
     motion, but if the OS setting flips mid-session, force everything static. */
  .has-scene-js .manifesto-word,
  .has-scene-js .manifesto-foot,
  .has-scene-js .deck-card,
  .has-scene-js .deck-card__dim,
  .has-scene-js .cap-rule,
  .has-scene-js .finale-line__inner,
  .has-scene-js .finale-actions {
    opacity: 1;
    transform: none;
    clip-path: none;
  }
  .has-scene-js .manifesto-track,
  .has-scene-js .cap-runway { height: auto; padding: clamp(64px, 10vh, 120px) 0; }
  .has-scene-js .cap-sticky { overflow: visible; position: static; min-height: 0; }
  .has-scene-js .cap-track { overflow-x: auto; }
  .has-scene-js .manifesto-sticky { position: static; min-height: 0; padding-top: 0; }
  .deck-card { position: static; }
}
