/* ==========================================================================
   Maxence Bonvallot — Portfolio Design System
   Aesthetic: Swiss-Modernist Graphite + Deep Petrol Teal (Zero Purple)
   Light-first with intentional Dark Mode, OKLCH tokens, strict type ladder
   ========================================================================== */

:root {
  color-scheme: light;

  /* Typography */
  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  /* Type ladder (6 deliberate steps, ~3.6x jump to display) */
  --text-xs: 0.75rem;                          /* 12px — mono labels, ratios */
  --text-sm: 0.875rem;                         /* 14px — nav, buttons, meta */
  --text-base: 1rem;                           /* 16px — body & mobile inputs */
  --text-lg: 1.25rem;                          /* 20px — lead copy, card titles */
  --text-xl: clamp(1.75rem, 2.6vw, 2.25rem);   /* 28–36px — section headings */
  --text-display: clamp(2.65rem, 5.4vw, 4.4rem); /* 42–70px — hero display */

  /* Neutral surface & ink ramp — cool graphite (hue 250) */
  --bg: #f7f8fa;
  --bg-subtle: #eff2f5;
  --surface: #ffffff;
  --surface-hover: #f3f5f8;
  --ink: #111318;
  --ink-secondary: #4b5563;
  --ink-tertiary: #64748b;
  --border: rgba(17, 19, 24, 0.09);
  --border-strong: rgba(17, 19, 24, 0.18);
  --border-dashed: rgba(17, 19, 24, 0.22);

  /* Accent — Deep Petrol Teal (zero purple, WCAG AA >= 5.4:1) */
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-tint: rgba(15, 118, 110, 0.08);
  --accent-border: rgba(15, 118, 110, 0.28);
  --on-accent: #ffffff;

  /* Semantic */
  --status-ok: #15803d;
  --status-ok-tint: rgba(21, 128, 61, 0.1);
  --status-error: #be123c;
  --status-error-tint: rgba(190, 18, 60, 0.08);

  /* Image outline (non-negotiable pure black/white alpha) */
  --img-outline: rgba(0, 0, 0, 0.1);

  /* Header plane */
  --header-bg: rgba(247, 248, 250, 0.86);

  /* Varied border-radius scale */
  --radius-input: 6px;
  --radius-btn: 8px;
  --radius-card: 12px;
  --radius-frame: 16px;
  --radius-pill: 999px;

  /* Layered shadows (ambient + direct, tinted neutral) */
  --shadow-sm: 0 1px 2px rgba(17, 19, 24, 0.05), 0 0 0 1px rgba(17, 19, 24, 0.04);
  --shadow-card: 0 1px 2px rgba(17, 19, 24, 0.04), 0 8px 24px -8px rgba(17, 19, 24, 0.08);
  --shadow-hover: 0 2px 4px rgba(17, 19, 24, 0.06), 0 16px 36px -12px rgba(17, 19, 24, 0.13);
  --shadow-overlay: 0 4px 12px rgba(17, 19, 24, 0.1), 0 24px 60px -12px rgba(17, 19, 24, 0.24);

  /* Layout rhythm */
  --container: 1120px;
  --gutter: clamp(20px, 4vw, 40px);
  --nav-height: 68px;
  --section-gap: clamp(80px, 11vw, 136px);

  /* Motion scale */
  --motion-fast: 120ms;
  --motion-base: 200ms;
  --motion-medium: 280ms;
  --motion-slow: 400ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-emphasized: cubic-bezier(0.2, 0, 0, 1);
}

@supports (color: oklch(0 0 0)) {
  :root {
    --bg: oklch(97.8% 0.003 250);
    --bg-subtle: oklch(95.2% 0.005 250);
    --surface: oklch(100% 0 0);
    --surface-hover: oklch(96.5% 0.004 250);
    --ink: oklch(17% 0.012 250);
    --ink-secondary: oklch(44% 0.015 250);
    --ink-tertiary: oklch(54% 0.014 250);
    --accent: oklch(48% 0.105 182);
    --accent-hover: oklch(41% 0.095 182);
    --accent-tint: oklch(48% 0.105 182 / 0.08);
    --accent-border: oklch(48% 0.105 182 / 0.28);
    --on-accent: oklch(99% 0.002 250);
    --header-bg: oklch(97.8% 0.003 250 / 0.86);
  }
}

/* Dark Mode — elevation via surface lightness + alpha hairlines */
[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0f1217;
  --bg-subtle: #151921;
  --surface: #181d26;
  --surface-hover: #1f2530;
  --ink: #f1f5f9;
  --ink-secondary: #a1aebf;
  --ink-tertiary: #7d8b9e;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --border-dashed: rgba(255, 255, 255, 0.22);

  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-tint: rgba(45, 212, 191, 0.11);
  --accent-border: rgba(45, 212, 191, 0.32);
  --on-accent: #091315;

  --status-ok: #4ade80;
  --status-ok-tint: rgba(74, 222, 128, 0.12);
  --status-error: #fb7185;
  --status-error-tint: rgba(251, 113, 133, 0.12);

  --img-outline: rgba(255, 255, 255, 0.1);
  --header-bg: rgba(15, 18, 23, 0.86);

  --shadow-sm: 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 10px 28px -12px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 18px 40px -14px rgba(0, 0, 0, 0.6);
  --shadow-overlay: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 24px 64px -12px rgba(0, 0, 0, 0.72);
}

@supports (color: oklch(0 0 0)) {
  [data-theme="dark"] {
    --bg: oklch(15% 0.011 255);
    --bg-subtle: oklch(18.5% 0.012 255);
    --surface: oklch(20.5% 0.013 255);
    --surface-hover: oklch(24% 0.014 255);
    --ink: oklch(95% 0.005 255);
    --ink-secondary: oklch(74% 0.012 255);
    --ink-tertiary: oklch(61% 0.012 255);
    --accent: oklch(78% 0.115 180);
    --accent-hover: oklch(84% 0.11 180);
    --accent-tint: oklch(78% 0.115 180 / 0.11);
    --accent-border: oklch(78% 0.115 180 / 0.34);
    --on-accent: oklch(12% 0.015 185);
    --header-bg: oklch(15% 0.011 255 / 0.86);
  }
}

/* ==========================================================================
   Base & Typography
   ========================================================================== */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  font-synthesis: none;
}

main {
  flex: 1;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--ink);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-display);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

h2 {
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
  scroll-margin-top: calc(var(--nav-height) + 28px);
}

h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

p, li, dd {
  margin: 0;
  text-wrap: pretty;
}

p {
  color: var(--ink-secondary);
}

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

img, svg {
  display: block;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  transition: outline-offset var(--motion-fast) var(--ease-out);
}

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

.mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-btn);
  background: var(--ink);
  color: var(--bg);
  font-size: var(--text-sm);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--motion-base) var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

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

/* ==========================================================================
   Header & Navigation (Horizontal structure: Brand left, Nav right)
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--motion-base) var(--ease-out),
              border-color var(--motion-base) var(--ease-out);
}

.site-header.is-scrolled {
  background-color: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border-strong);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--nav-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  min-height: 44px;
  transition: color var(--motion-fast) var(--ease-out);
}

.brand:hover {
  color: var(--accent);
}

.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background-color: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  transition: background-color var(--motion-fast) var(--ease-out),
              color var(--motion-fast) var(--ease-out);
}

.brand:hover .brand__mark {
  background-color: var(--accent);
  color: var(--on-accent);
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--radius-btn);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-secondary);
  transition: color var(--motion-fast) var(--ease-out),
              background-color var(--motion-fast) var(--ease-out);
}

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

/* Signature active nav indicator: pill tint + crisp bottom accent dot */
.nav-link[aria-current="page"] {
  color: var(--accent);
  background-color: var(--accent-tint);
}

.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 14px;
  height: 2px;
  border-radius: var(--radius-pill);
  background-color: var(--accent);
  transform: translateX(-50%);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}

/* Theme toggle with in-place icon swap (motion.md pattern) */
.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background-color: var(--surface);
  color: var(--ink-secondary);
  cursor: pointer;
  transition: color var(--motion-fast) var(--ease-out),
              border-color var(--motion-fast) var(--ease-out),
              background-color var(--motion-fast) var(--ease-out);
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--border-strong);
  background-color: var(--surface-hover);
}

.swap-slot {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.swap-slot > svg {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  opacity: 0;
  transform: scale(0.35);
  filter: blur(2px);
  transition: opacity var(--motion-fast) var(--ease-out),
              transform var(--motion-fast) var(--ease-out),
              filter var(--motion-fast) var(--ease-out);
}

.swap-slot > svg[data-visible="true"] {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

/* Mobile menu button (hidden on desktop) */
.menu-toggle {
  display: none;
}

/* ==========================================================================
   Buttons & Links (3-level CTA hierarchy — never tie)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-btn);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color var(--motion-fast) var(--ease-out),
              border-color var(--motion-fast) var(--ease-out),
              color var(--motion-fast) var(--ease-out),
              box-shadow var(--motion-fast) var(--ease-out),
              transform var(--motion-fast) var(--ease-out);
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform var(--motion-fast) var(--ease-out);
}

.btn:active {
  transform: scale(0.98);
}

/* Level 1: Hero / Page Primary */
.btn--primary {
  background-color: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background-color: var(--accent-hover);
  box-shadow: var(--shadow-card);
}

/* Level 2: Secondary Outline (>= 3:1 border contrast) */
.btn--secondary {
  background-color: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn--secondary:hover {
  background-color: var(--surface-hover);
  border-color: var(--ink-tertiary);
}

/* Level 3: Compact Nav CTA (distinct from Hero Primary) */
.btn--nav {
  min-height: 38px;
  padding: 8px 14px;
  background-color: var(--ink);
  color: var(--bg);
}

.btn--nav:hover {
  background-color: var(--accent);
  color: var(--on-accent);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover .icon-arrow {
    transform: translateX(3px);
  }
  .btn:hover .icon-external {
    transform: translate(2px, -2px);
  }
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-position: from-font;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent-border);
  text-underline-offset: 4px;
  min-height: 36px;
  transition: color var(--motion-fast) var(--ease-out),
              text-decoration-color var(--motion-fast) var(--ease-out);
}

.text-link:hover {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

.text-link svg {
  width: 15px;
  height: 15px;
  transition: transform var(--motion-fast) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .text-link:hover svg {
    transform: translate(2px, -2px);
  }
}

/* ==========================================================================
   Media Slots — Real <img> ready + architectural placeholder state
   ========================================================================== */

.media-slot {
  position: relative;
  margin: 0;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-frame);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  isolation: isolate;
}

.media-slot--portrait {
  aspect-ratio: 4 / 5;
}

.media-slot--landscape {
  aspect-ratio: 16 / 10;
}

.media-slot--compact {
  aspect-ratio: 4 / 3;
}

.media-slot__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  outline: 1px solid var(--img-outline);
  outline-offset: -1px;
  transition: opacity var(--motion-medium) var(--ease-out),
              transform var(--motion-slow) var(--ease-out);
}

.media-slot[data-loaded="true"] .media-slot__img {
  opacity: 1;
  pointer-events: auto;
}

.media-slot[data-loaded="false"] .media-slot__img {
  visibility: hidden;
}

/* Architectural placeholder shown until real image is placed in assets/ */
.media-slot__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px;
  text-align: center;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center center;
  transition: opacity var(--motion-base) var(--ease-out);
}

.media-slot__placeholder::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px dashed var(--border-dashed);
  border-radius: calc(var(--radius-frame) - 6px);
  pointer-events: none;
}

.media-slot[data-loaded="true"] .media-slot__placeholder {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.media-slot__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.media-slot__icon svg {
  width: 22px;
  height: 22px;
}

.media-slot__title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.media-slot__hint {
  max-width: 28ch;
  font-size: var(--text-sm);
  color: var(--ink-secondary);
  line-height: 1.45;
}

.media-slot__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-input);
  background-color: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-tertiary);
}

/* Zoom trigger button (only shown when real project image is loaded) */
.media-slot__zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border-strong);
  background-color: var(--surface);
  color: var(--ink);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--motion-fast) var(--ease-out),
              transform var(--motion-fast) var(--ease-out);
}

.media-slot[data-loaded="true"][data-zoomable="true"] .media-slot__zoom {
  display: inline-flex;
}

.media-slot__zoom svg {
  width: 14px;
  height: 14px;
}

.media-slot__zoom:hover {
  background-color: var(--surface-hover);
}

@media (hover: hover) and (pointer: fine) {
  .media-slot[data-loaded="true"][data-zoomable="true"]:hover .media-slot__img {
    transform: scale(1.02);
  }
}

/* ==========================================================================
   Home — Section 1: Hero (Asymmetric 7/5 Split, Headline ~20% down fold)
   ========================================================================== */

.hero {
  padding-top: clamp(56px, 11vh, 118px);
  padding-bottom: clamp(56px, 8vw, 96px);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.85fr);
  gap: clamp(32px, 5vw, 68px);
  align-items: center;
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background-color: var(--surface);
  border: 1px solid var(--border);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-secondary);
  box-shadow: var(--shadow-sm);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--status-ok);
  box-shadow: 0 0 0 3px var(--status-ok-tint);
}

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

.hero__lead {
  max-width: 46ch;
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--ink-secondary);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}

.hero__visual {
  position: relative;
}

.portrait-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 0 4px;
  font-size: var(--text-sm);
  color: var(--ink-secondary);
}

.portrait-caption strong {
  font-weight: 600;
  color: var(--ink);
}

/* ==========================================================================
   Section Header Shared Grammar
   ========================================================================== */

.section {
  padding-block: var(--section-gap);
}

.section--tinted {
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: clamp(32px, 4vw, 52px);
}

.section-head__copy {
  max-width: 56ch;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

/* ==========================================================================
   Home — Section 2: Selected Work (Asymmetric Variable-Ratio Showcase)
   ========================================================================== */

.work-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 4vw, 44px);
}

/* Featured Project 1: Dominant Split Card (60% media / 40% copy) */
.work-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  padding: clamp(20px, 3vw, 32px);
  border-radius: var(--radius-frame);
  background-color: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: border-color var(--motion-base) var(--ease-out),
              box-shadow var(--motion-base) var(--ease-out),
              transform var(--motion-base) var(--ease-out);
}

/* Project 2: Reversed Asymmetric Split (42% copy / 58% media) */
.work-feature--reversed {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
}

@media (hover: hover) and (pointer: fine) {
  .work-feature:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
  }
}

.work-feature__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.work-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-input);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-secondary);
}

.tag--accent {
  background-color: var(--accent-tint);
  border-color: var(--accent-border);
  color: var(--accent);
}

.work-feature__title {
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.work-feature__desc {
  max-width: 44ch;
  line-height: 1.6;
}

.work-feature__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding-top: 6px;
}

/* ==========================================================================
   Home — Section 3: About & Capabilities (Editorial Index, No Card Grid)
   ========================================================================== */

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.about-intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.about-intro p {
  max-width: 44ch;
}

.capability-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border-strong);
}

.capability-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  padding-block: 22px;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.capability-row__index {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.capability-row__content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.capability-row__title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink);
}

.capability-row__desc {
  font-size: var(--text-sm);
  color: var(--ink-secondary);
  max-width: 54ch;
}

/* ==========================================================================
   Home — Section 4: Education Timeline (Clean Tabular Rows)
   ========================================================================== */

.timeline-table {
  width: 100%;
  border-collapse: collapse;
}

.timeline-table th {
  padding: 12px 16px 14px 0;
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--ink-tertiary);
  border-bottom: 1px solid var(--border-strong);
}

.timeline-table td {
  padding: 20px 16px 20px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.timeline-table tbody tr {
  transition: background-color var(--motion-fast) var(--ease-out);
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  width: 120px;
}

.timeline-degree {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink);
}

.timeline-field {
  color: var(--ink-secondary);
}

.timeline-status {
  text-align: right;
  font-size: var(--text-sm);
  color: var(--ink-tertiary);
  white-space: nowrap;
}

/* ==========================================================================
   Home — Section 5: Final Contact Band
   ========================================================================== */

.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  padding: clamp(28px, 4vw, 48px);
  border-radius: var(--radius-frame);
  background-color: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.cta-band__copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 52ch;
}

/* ==========================================================================
   Projects Page — Case Study Showcases & Filter Controls
   ========================================================================== */

.page-intro {
  padding-top: clamp(48px, 8vh, 88px);
  padding-bottom: clamp(32px, 5vw, 48px);
}

.page-intro__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.page-intro__copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 58ch;
}

.filter-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
  border-radius: var(--radius-btn);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
}

.filter-btn {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: calc(var(--radius-btn) - 2px);
  background: transparent;
  color: var(--ink-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--motion-fast) var(--ease-out),
              color var(--motion-fast) var(--ease-out),
              border-color var(--motion-fast) var(--ease-out),
              box-shadow var(--motion-fast) var(--ease-out);
}

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

.filter-btn[aria-pressed="true"] {
  background-color: var(--surface);
  color: var(--ink);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.case-list {
  display: flex;
  flex-direction: column;
  gap: clamp(56px, 8vw, 96px);
  padding-bottom: var(--section-gap);
}

.case-study {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: clamp(32px, 4vw, 48px);
  border-top: 1px solid var(--border-strong);
}

.case-study[hidden] {
  display: none;
}

.case-study__header {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.7fr);
  gap: 24px 48px;
  align-items: start;
}

.case-study__summary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.case-study__summary p {
  max-width: 58ch;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
  margin: 0;
  padding: 18px 20px;
  border-radius: var(--radius-card);
  background-color: var(--surface);
  border: 1px solid var(--border);
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.spec-item dt {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-tertiary);
}

.spec-item dd {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

/* Asymmetric screenshot gallery: primary 16:10 + secondary detail capture */
.case-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.case-gallery--reversed {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
}

.case-gallery .media-slot {
  height: 100%;
}

/* ==========================================================================
   Contact Page — Asymmetric Info + Accessible Single-Column Form
   ========================================================================== */

.contact-section {
  padding-top: clamp(48px, 8vh, 88px);
  padding-bottom: var(--section-gap);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}

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

.contact-info__lead {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.channel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border-strong);
}

.channel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
  border-bottom: 1px solid var(--border);
}

.channel-item__label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-tertiary);
  margin-bottom: 4px;
}

.channel-item__value {
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border-strong);
  background-color: var(--surface);
  color: var(--ink-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--motion-fast) var(--ease-out),
              border-color var(--motion-fast) var(--ease-out),
              background-color var(--motion-fast) var(--ease-out);
}

.copy-btn:hover {
  color: var(--ink);
  background-color: var(--surface-hover);
}

.copy-btn[data-copied="true"] {
  color: var(--status-ok);
  border-color: var(--status-ok);
}

.contact-card {
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--radius-frame);
  background-color: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

.form-optional {
  font-weight: 400;
  color: var(--ink-tertiary);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--ink-tertiary);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  font-size: var(--text-base); /* >= 16px prevents iOS Safari focus zoom */
  line-height: 1.4;
  color: var(--ink);
  background-color: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-input);
  transition: border-color var(--motion-fast) var(--ease-out),
              box-shadow var(--motion-fast) var(--ease-out),
              background-color var(--motion-fast) var(--ease-out);
}

.form-select {
  cursor: pointer;
}

.form-select option {
  background-color: var(--surface);
  color: var(--ink);
}

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

.form-input:hover,
.form-textarea:hover,
.form-select:hover {
  border-color: var(--ink-tertiary);
}

.form-input:focus-visible,
.form-textarea:focus-visible,
.form-select:focus-visible {
  outline: none;
  border-color: var(--accent);
  background-color: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.form-input[aria-invalid="true"],
.form-textarea[aria-invalid="true"] {
  border-color: var(--status-error);
  background-color: var(--status-error-tint);
}

.form-error {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--status-error);
}

.form-error.is-visible {
  display: flex;
}

.form-error svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.form-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-fieldset legend {
  padding: 0;
  margin-bottom: 4px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

.choice-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border);
  background-color: var(--bg);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink);
  transition: border-color var(--motion-fast) var(--ease-out),
              background-color var(--motion-fast) var(--ease-out);
}

.choice-option:hover {
  border-color: var(--border-strong);
  background-color: var(--surface-hover);
}

.choice-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.choice-option:has(input:checked) {
  border-color: var(--accent-border);
  background-color: var(--accent-tint);
}

.form-submit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding-top: 6px;
}

.form-status {
  display: none;
  padding: 16px 18px;
  border-radius: var(--radius-card);
  border: 1px solid var(--status-ok);
  background-color: var(--status-ok-tint);
  color: var(--ink);
  font-size: var(--text-sm);
}

.form-status.is-visible {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.form-status svg {
  width: 20px;
  height: 20px;
  color: var(--status-ok);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ==========================================================================
   Accessible Screenshot Lightbox Dialog
   ========================================================================== */

.lightbox {
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-frame);
  background-color: var(--surface);
  color: var(--ink);
  max-width: min(92vw, 1080px);
  max-height: 90dvh;
  box-shadow: var(--shadow-overlay);
  overflow: hidden;
}

.lightbox::backdrop {
  background-color: rgba(15, 18, 23, 0.72);
  backdrop-filter: blur(4px);
}

.lightbox__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.lightbox__title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
}

.lightbox__body {
  padding: 16px;
  background-color: var(--bg-subtle);
}

.lightbox__img {
  max-width: 100%;
  max-height: 75dvh;
  margin-inline: auto;
  border-radius: var(--radius-card);
  outline: 1px solid var(--img-outline);
  outline-offset: -1px;
}

/* ==========================================================================
   Footer — Clean, predictable, readable
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 36px;
  background-color: var(--bg);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  font-size: var(--text-sm);
  color: var(--ink-tertiary);
}

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

.footer-links a {
  color: var(--ink-secondary);
  transition: color var(--motion-fast) var(--ease-out);
}

.footer-links a:hover {
  color: var(--accent);
}

/* ==========================================================================
   Scroll Reveal (Progressive Enhancement — safe if JS fails)
   ========================================================================== */

html.js-ready [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--motion-slow) var(--ease-out),
              transform var(--motion-slow) var(--ease-out);
}

html.js-ready [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

html.js-ready [data-reveal="delay-1"] {
  transition-delay: 60ms;
}

html.js-ready [data-reveal="delay-2"] {
  transition-delay: 120ms;
}

/* ==========================================================================
   Responsive Breakpoints (1024px, 768px, 375px)
   ========================================================================== */

@media (max-width: 920px) {
  .hero__grid,
  .work-feature,
  .work-feature--reversed,
  .about-layout,
  .case-study__header,
  .case-gallery,
  .case-gallery--reversed,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .work-feature--reversed .work-feature__body {
    order: 2;
  }

  .hero__visual {
    max-width: 420px;
  }
}

@media (max-width: 720px) {
  .menu-toggle {
    display: inline-grid;
  }

  .nav-group {
    position: relative;
  }

  .nav-drawer {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    z-index: 39;
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 16px var(--gutter) 24px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border-strong);
    box-shadow: var(--shadow-hover);
  }

  .nav-drawer.is-open {
    display: flex;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .nav-link {
    min-height: 44px;
    width: 100%;
    justify-content: flex-start;
  }

  .nav-link[aria-current="page"]::after {
    left: 14px;
    transform: none;
  }

  .nav-actions {
    padding-left: 0;
    border-left: 0;
  }

  .nav-cta-desktop {
    display: none;
  }

  .timeline-table thead {
    display: none;
  }

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

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

  .timeline-table td {
    padding: 2px 0;
    border: 0;
  }

  .timeline-status {
    text-align: left;
    margin-top: 4px;
  }

  .spec-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Reduced Motion Contract (non-negotiable)
   ========================================================================== */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html.js-ready [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
