/* ═══════════════════════════════════════
   RICO MELLO PORTFOLIO — GLOBAL STYLES
   Death Stranding + Matrix Visual Identity
═══════════════════════════════════════ */

/* ═══════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════ */
:root {
  /* Colour palette */
  --bg:          #F0EDE8;
  --ink:         #080808;
  --ink-soft:    #141414;
  --ink-mid:     #4A4A4A;
  --ink-dim:     #6B6B6B;   /* WCAG AA on --bg: 4.75:1 */
  --ink-on-dark: rgba(240, 237, 232, 0.72);  /* prose on dark surfaces — ~9:1 on --ink-soft */
  --accent:      #00E87A;
  --accent-on-light: #008C50;  /* darker accent for prose/labels on --bg — ~4.6:1 (WCAG AA small text) */
  --error:       #FF3333;

  /* Typography */
  --f-display:   'Rajdhani', sans-serif;
  --f-mono:      'Space Mono', monospace;
  --f-body:      'Inter', sans-serif;

  /* Layout */
  --nav-h:       64px;
  --ease:        cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Letter-spacing scale */
  --ls-tight:    0.05em;
  --ls-base:     0.1em;
  --ls-wide:     0.18em;
  --ls-xwide:    0.22em;
}

/* ═══════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 300;
  overflow-x: hidden;
}

/* Custom cursor only on fine-pointer (mouse) devices — touch keeps native */
@media (pointer: fine) {
  body { cursor: none; }
  a, button, input, textarea { cursor: none; }
}

/* ═══════════════════════════════════════
   CUSTOM CURSOR
═══════════════════════════════════════ */
#cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 9999;
  top: 0; left: 0;
  will-change: transform;
  transition: width 0.2s var(--ease), height 0.2s var(--ease);
}

#cursor-ring {
  position: fixed;
  width: 34px;
  height: 34px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  top: 0; left: 0;
  opacity: 0.5;
  will-change: transform;
  transition: width 0.3s var(--ease), height 0.3s var(--ease), opacity 0.3s;
}

#cursor.hovering    { width: 5px; height: 5px; }
#cursor-ring.hovering { width: 52px; height: 52px; opacity: 1; }

/* Hide the custom cursor + ring entirely on touch / coarse-pointer devices.
   fx.js already skips the lerp loop when pointer is not fine, but the
   elements remain in the DOM (position: fixed) and would sit visible at
   their last-known coords — the ring is 34px, bright green, and would
   float over content, giving a "T becomes ?" optical illusion. */
@media (pointer: coarse), (hover: none) {
  #cursor,
  #cursor-ring { display: none !important; }
}

/* ═══════════════════════════════════════
   CODE CASCADE CANVAS
═══════════════════════════════════════ */
#cascade {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ═══════════════════════════════════════
   NAV
═══════════════════════════════════════ */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  z-index: 500;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

nav::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  height: 1px;
  background: var(--ink);
  width: 0;
  animation: navLine 1.4s var(--ease) 0.3s forwards;
}

@keyframes navLine { to { width: 100%; } }

.nav-logo {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.22em;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
}

.nav-logo em {
  color: var(--accent-on-light);
  font-style: normal;
}

.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
}

.nav-links a {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--ink-mid);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative;
  padding-bottom: 3px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}

.nav-links a:hover,
.nav-links a.is-active { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.is-active::after { width: 100%; }

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 2.2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* ─── Hamburger toggle (mobile) ─── */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--ink);
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: border-color 0.2s, background 0.2s;
}
.nav-toggle:hover { border-color: var(--accent); }

.nav-toggle-bar {
  display: block;
  width: 18px; height: 1.5px;
  background: var(--ink);
  position: relative;
  transition: background 0.2s;
}
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: '';
  position: absolute;
  left: 0;
  width: 18px; height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), top 0.3s var(--ease);
}
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after  { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after  { top: 0; transform: rotate(-45deg); }

/* ─── Fullscreen mobile overlay ─── */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 400;
  display: none;
  flex-direction: column;
  padding: calc(var(--nav-h) + 24px) 24px 28px;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.nav-overlay.is-open {
  display: flex;
  opacity: 1;
}
.nav-overlay::before {
  content: '';
  position: absolute;
  top: var(--nav-h);
  left: 24px; right: 24px;
  height: 1px;
  background: rgba(8,8,8,0.12);
}

.nav-overlay-links {
  list-style: none;
  display: flex; flex-direction: column;
  gap: 0;
  margin: 8px 0 0;
  padding: 0;
  flex: 1;
}
.nav-overlay-links li {
  border-bottom: 1px solid rgba(8,8,8,0.1);
}
.nav-overlay-links a {
  display: flex; align-items: center;
  gap: 12px;
  padding: 22px 4px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s var(--ease), padding-left 0.3s var(--ease);
  min-height: 44px;
}
.nav-overlay-links a::before {
  content: '//';
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-right: 4px;
  position: relative; top: -2px;
}
.nav-overlay-links a:hover,
.nav-overlay-links a:focus-visible { color: var(--accent); padding-left: 12px; }

.nav-overlay-status {
  display: flex; align-items: center; gap: 10px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid rgba(8,8,8,0.1);
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.nav-overlay-status em {
  color: var(--ink);
  font-style: normal;
}

/* Lock body scroll when overlay open */
body.nav-locked { overflow: hidden; touch-action: none; }

/* ═══════════════════════════════════════
   SHARED UTILITIES
═══════════════════════════════════════ */
section { position: relative; z-index: 1; }

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.in { opacity: 1; transform: none; }

.sec-label {
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  position: absolute;
  left: 16px;
  top: 50%;
  translate: 0 -50%;
  color: var(--ink-dim);
  pointer-events: none;
}

.sec-num  { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.1em; color: var(--accent-on-light); }

.sec-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 0.9;
}

/* Corner marker mixin (applied via class) */
.corners { position: absolute; inset: 0; pointer-events: none; }

.corners::before,
.corners::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid var(--accent);
  opacity: 0;
  transition: opacity 0.3s;
}

.corners::before { top: 14px; left: 14px; border-width: 1px 0 0 1px; }
.corners::after  { bottom: 14px; right: 14px; border-width: 0 1px 1px 0; }

/* ═══════════════════════════════════════
   01 — HERO
═══════════════════════════════════════ */
#hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--nav-h) 48px 48px;
  position: relative;
}

.hero-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 72px 80px;
  position: relative;
  max-width: 900px;
  width: 100%;
}

/* Hero corner brackets */
.hc { position: absolute; width: 24px; height: 24px; border: 1px solid var(--ink); }
.hc-tl { top: 0; left: 0; border-width: 1px 0 0 1px; }
.hc-tr { top: 0; right: 0; border-width: 1px 1px 0 0; }
.hc-bl { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
.hc-br { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

.hero-eyebrow {
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  color: var(--accent-on-light);
  text-transform: uppercase;
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) 1.2s forwards;
}

.hero-name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(4.5rem, 13vw, 11rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 0.82;
  color: var(--ink);
  opacity: 0;
  animation: fadeUp 1.1s var(--ease) 1.5s forwards;
}

/* Decode effect — word + character wrappers.
   .word keeps the chars of a single word atomic so the browser never breaks
   mid-word (e.g. "SELECTED WORK" splitting into "SELECTED WO / RK").
   decode.js groups each word in <span class="word"> around the chars. */
.word {
  white-space: nowrap;
  display: inline-block;
}

.hero-name .char,
[data-decode] .char,
[data-glitch-only] .char {
  display: inline-block;
  transition: color 0.08s;
  will-change: color;
}

.hero-name .char.glitch,
[data-decode] .char.glitch,
[data-glitch-only] .char.glitch {
  /* Glitch flash keeps the bright brand --accent — it's a brief animation
     state, the luma glow is part of the effect, not readable prose. */
  color: var(--accent);
}

.hero-name .char.decoding,
[data-decode] .char.decoding,
[data-glitch-only] .char.decoding {
  color: var(--ink-dim);
}

.hero-divider {
  width: 100%;
  height: 1px;
  background: var(--ink);
  margin: 28px 0;
  transform: scaleX(0);
  transform-origin: left;
  animation: scaleX 0.9s var(--ease) 2.3s forwards;
}

@keyframes scaleX { to { transform: scaleX(1); } }

.hero-title {
  font-family: var(--f-mono);
  font-size: clamp(0.62rem, 1.3vw, 0.82rem);
  letter-spacing: 0.28em;
  color: var(--ink-mid);
  text-transform: uppercase;
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) 2.7s forwards;
}

.hero-stats {
  display: flex;
  gap: 48px;
  margin-top: 52px;
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) 3s forwards;
}

.stat-val {
  display: block;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.stat-lbl {
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 52px;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  padding: 16px 36px;
  position: relative;
  overflow: hidden;
  transition: color 0.4s;
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) 3.3s forwards;
}

.hero-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateX(-101%);
  transition: transform 0.4s var(--ease);
  z-index: -1;
}

.hero-cta:hover { color: var(--bg); }
.hero-cta:hover::before { transform: translateX(0); }

.cta-arr { transition: transform 0.3s; display: inline-block; }
.hero-cta:hover .cta-arr { transform: translateX(6px); }

.hero-hud {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid rgba(8,8,8,0.12);
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) 3.6s forwards;
}

.hud-item {
  font-family: var(--f-mono);
  font-size: 0.56rem;
  letter-spacing: 0.15em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

.hud-item em {
  color: var(--accent-on-light);
  font-style: normal;
}

.hero-scroll-ind {
  position: absolute;
  bottom: 40px;
  left: 50%;
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) 4s forwards;
}

.scroll-lbl {
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

.scroll-line {
  width: 1px; height: 52px;
  background: rgba(8,8,8,0.15);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  animation: scrollPulse 2.4s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(200%); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════
   02 — WORK
═══════════════════════════════════════ */
#work {
  padding: 120px 60px 120px 80px;
}

.sec-header {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 56px;
}

/* Asymmetric 12-col grid, 3 rows */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: 380px 380px 280px;
  gap: 3px;
}

/* Bento layout — 4 cards. DOM order in index.html drives positioning:
   1st card  → big hero (left, 2 rows tall)
   2nd card  → top-right (1 row)
   3rd card  → mid-right (1 row)
   4th card  → wide bottom (full row)
   To re-order featured cards, change DOM order in index.html, not CSS. */
.pcard:nth-child(1) { grid-column: 1 / 9;  grid-row: 1 / 3; }   /* hero */
.pcard:nth-child(2) { grid-column: 9 / 13; grid-row: 1 / 2; }
.pcard:nth-child(3) { grid-column: 9 / 13; grid-row: 2 / 3; }
.pcard:nth-child(4) { grid-column: 1 / 13; grid-row: 3 / 4; }   /* wide bottom */

.pcard {
  position: relative;
  overflow: hidden;
  background: var(--ink-soft);
  display: block;
  text-decoration: none;
}

.pcard-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.7s var(--ease), filter 0.5s;
  filter: grayscale(25%);
}

/* Per-card artwork — data-bg attributes keep index.html free of inline styles
   (Rule 7). Use card key to pick the background. Order mirrors the DOM. */
.pcard-bg[data-bg="case-01"] {
  background-image:
    linear-gradient(135deg, rgba(10,14,20,0.0) 0%, rgba(13,26,46,0.0) 45%, rgba(10,31,26,0.0) 100%),
    url('assets/screenshot-hero.jpg');
  background-position: center top;
}
.pcard-bg[data-bg="case-02"] {
  background-image: url('assets/lds-case%20002/lds-mainpage.png');
}
.pcard-bg[data-bg="case-03"] {
  background-image: url('assets/urbs-case%20003/urbs-app.png');
}
.pcard-bg[data-bg="case-04"] {
  background-image: url('assets/fior-case%20004/fior-hifi.png');
}
/* case-05 bg removed 2026-04-23 — card is hidden from index.html until ready.
   Re-add this rule alongside the card if 005 is brought back. */

.pcard:hover .pcard-bg {
  transform: scale(1.05);
  filter: grayscale(0%);
}

.pcard-overlay {
  position: absolute;
  inset: 0;
  /* Quasi-uniform overlay — covers the whole card so artwork stays consistent
     end-to-end. Slight gradient (0.7 base -> 0.5 top) preserves a touch of
     depth so the card doesn't look flat. */
  background: linear-gradient(
    to top,
    rgba(8,8,8,0.7) 0%,
    rgba(8,8,8,0.5) 100%
  );
}

/* Scan line animation on hover */
.pcard-scan {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  pointer-events: none;
  top: -5%;
  opacity: 0;
}

.pcard:hover .pcard-scan {
  opacity: 0.7;
  animation: scanDown 1.6s linear;
}

@keyframes scanDown {
  from { top: -5%; }
  to   { top: 105%; }
}

/* Corner markers */
.pcard .corners::before,
.pcard .corners::after { opacity: 0; }
.pcard:hover .corners::before,
.pcard:hover .corners::after { opacity: 1; }

.pcard-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 28px 32px;
}

.pcard-num {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 8px;
}

.pcard-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 2.5vw, 1.9rem);
  color: var(--bg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 0.95;
}

.pcard-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.ptag {
  font-family: var(--f-mono);
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  color: rgba(240,237,232,0.55);
  border: 1px solid rgba(240,237,232,0.18);
  padding: 3px 10px;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════
   03 — ABOUT
═══════════════════════════════════════ */
#about {
  padding: 120px 60px 120px 80px;
  background: var(--ink-soft);
  color: var(--bg);
  position: relative;
  overflow: hidden;
}

/* subtle grid pattern for DS feel */
#about::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(240,237,232,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240,237,232,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

#about .sec-num { color: rgba(0,232,122,0.75); }
#about .sec-title { color: var(--bg); }

.about-portrait {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
}

.about-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: contrast(1.05);
  transition: filter 0.5s;
}

.about-portrait:hover img { filter: contrast(1.1) brightness(1.05); }

.about-portrait .corners::before,
.about-portrait .corners::after { opacity: 1; }

.about-portrait-scan {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  animation: portraitScan 4s linear infinite;
  pointer-events: none;
}

@keyframes portraitScan {
  0%   { top: -5%; opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.6; }
  100% { top: 105%; opacity: 0; }
}

.about-intro {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(1rem, 1.4vw, 1.35rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
  color: rgba(240,237,232,0.85);
}

.about-intro em { color: var(--accent); font-style: normal; font-weight: 700; }

.about-grid {
  display: grid;
  grid-template-columns: 260px 1fr 1fr;
  gap: 60px;
  align-items: start;
  position: relative;
}

/* Left col: portrait + intro stacked */
.about-portrait-col {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.about-bio p {
  font-size: 0.95rem;
  line-height: 1.85;
  color: rgba(240,237,232,0.78);
  margin-bottom: 20px;
  padding-left: 26px;
  position: relative;
}

.about-bio p::before {
  content: '//';
  position: absolute;
  left: 0;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  color: var(--accent);
  top: 2px;
}

.about-bio strong {
  color: rgba(240,237,232,0.95);
  font-weight: 500;
}

.about-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-decoration: none;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  padding: 14px 28px;
  position: relative;
  overflow: hidden;
  transition: color 0.4s;
}

.about-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-101%);
  transition: transform 0.4s var(--ease);
  z-index: -1;
}

.about-link:hover { color: var(--ink); }
.about-link:hover::before { transform: translateX(0); }

/* Timeline */
.mini-label {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  color: rgba(240,237,232,0.55);   /* WCAG AA on --ink-soft */
  text-transform: uppercase;
  margin-bottom: 20px;
}

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px; bottom: 10px;
  width: 1px;
  background: rgba(240,237,232,0.12);
}

.tl-item {
  position: relative;
  margin-bottom: 28px;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.tl-item.in { opacity: 1; transform: none; }

.tl-item::before {
  content: '';
  position: absolute;
  left: -32px; top: 9px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.tl-date {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 4px;
}

.tl-role {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(240,237,232,0.92);
  line-height: 1.1;
}

.tl-company {
  font-family: var(--f-mono);
  font-size: 0.62rem;
  color: rgba(240,237,232,0.55);   /* WCAG AA on --ink-soft */
  margin-top: 4px;
  letter-spacing: 0.1em;
}

/* Skills */
.skills-wrap { margin-top: 44px; }

.skills-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.skill {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: rgba(240,237,232,0.6);
  border: 1px solid rgba(240,237,232,0.12);
  padding: 6px 14px;
  text-transform: uppercase;
  transition: border-color 0.25s, color 0.25s;
}

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

/* ═══════════════════════════════════════
   04 — TESTIMONIALS (DS Carousel)
═══════════════════════════════════════ */
#testimonials {
  padding: 120px 60px 80px 80px;
  position: relative;
}

/* HUD bar: counter + arrows */
.carousel-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.carousel-counter {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--ink-mid);
  text-transform: uppercase;
}

.carousel-counter span { color: var(--accent); }

.carousel-arrows {
  display: flex;
  gap: 3px;
}

.carousel-arrow {
  width: 48px;
  height: 48px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}

.carousel-arrow::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateX(-101%);
  transition: transform 0.35s var(--ease);
  z-index: 0;
}

.carousel-arrow:hover { color: var(--bg); }
.carousel-arrow:hover::before { transform: translateX(0); }
.carousel-arrow span,
.carousel-arrow { z-index: 1; }

/* Viewport + Track */
.carousel-viewport {
  overflow: hidden;
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 3px;
  transition: transform 0.55s var(--ease);
  cursor: grab;
  user-select: none;
}

.carousel-track:active { cursor: grabbing; }

/* Individual card — DS style */
.tcard {
  flex: 0 0 calc(33.333% - 2px);
  background: var(--ink);
  padding: 36px 32px 28px;
  position: relative;
  overflow: hidden;
  min-height: 340px;
  display: flex;
  flex-direction: column;
}

.tcard .corners::before,
.tcard .corners::after {
  opacity: 0.3;
  transition: opacity 0.4s;
}

.tcard:hover .corners::before,
.tcard:hover .corners::after { opacity: 1; }

/* Scan line on hover */
.tcard-scan {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  pointer-events: none;
  top: -5%;
  opacity: 0;
}

.tcard:hover .tcard-scan {
  opacity: 0.6;
  animation: scanDown 1.8s linear;
}

/* Card index label */
.tcard-idx {
  font-family: var(--f-mono);
  font-size: 0.55rem;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 16px;
  display: block;
}

/* Quote */
.tcard-quote {
  flex: 1;
  position: relative;
}

.tcard-quote::before {
  content: '"';
  position: absolute;
  top: -20px;
  left: -6px;
  font-family: var(--f-display);
  font-size: 6rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.06;
  line-height: 1;
  pointer-events: none;
}

.tcard-quote p {
  font-family: var(--f-body);
  font-size: 0.92rem;
  line-height: 1.75;
  color: rgba(240, 237, 232, 0.8);
  font-weight: 300;
  font-style: italic;
  position: relative;
  z-index: 1;
}

/* Author */
.tcard-author {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(240, 237, 232, 0.08);
}

.tcard-name {
  font-family: var(--f-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bg);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tcard-role {
  font-family: var(--f-mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
}

/* HUD footer inside card */
.tcard-hud {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  font-family: var(--f-mono);
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  color: rgba(240, 237, 232, 0.5);   /* WCAG AA on testimonial card dark bg */
  text-transform: uppercase;
}

.tcard-hud em {
  font-style: normal;
  color: rgba(0, 232, 122, 0.65);
}

/* CTA button — same style as hero */
.testimonials-cta {
  margin-top: 40px;
  text-align: center;
}

.ds-cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  padding: 16px 36px;
  position: relative;
  overflow: hidden;
  transition: color 0.4s;
}

.ds-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateX(-101%);
  transition: transform 0.4s var(--ease);
  z-index: -1;
}

.ds-cta:hover { color: var(--bg); }
.ds-cta:hover::before { transform: translateX(0); }
.ds-cta .cta-arr { transition: transform 0.3s; display: inline-block; }
.ds-cta:hover .cta-arr { transform: translateX(6px); }

/* ═══════════════════════════════════════
   05 — CONTACT
═══════════════════════════════════════ */
/* Contact section runs in dark mode and merges into the dark footer
   below — closing the page with a single dark zone (form + meta).
   Bottom padding gives the form room to breathe before the footer divider;
   the dark-on-dark continuity keeps the unified zone effect. */
#contact {
  padding: 120px 60px 96px 80px;
  position: relative;
  background: var(--ink);
  color: var(--bg);
}

/* Section header overrides for dark surface — title would otherwise inherit
   ink (invisible) and the vertical sec-label would sit at low-contrast dim. */
#contact .sec-title { color: var(--bg); }
#contact .sec-label { color: var(--ink-on-dark); }

/* Tagline spans full width above grid */
.contact-tagline {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.6rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.05;
  color: var(--bg);
  margin-top: 48px;
  margin-bottom: 48px;
}

.contact-tagline em { color: var(--accent); font-style: normal; font-weight: 700; }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
  align-items: start;
}

.contact-details { display: flex; flex-direction: column; gap: 18px; }

.c-detail {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(240,237,232,0.12);
}

.c-lbl {
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  color: var(--ink-on-dark);
  text-transform: uppercase;
  min-width: 76px;
}

.c-val {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--bg);
  text-decoration: none;
  transition: color 0.2s;
}

.c-val:hover { color: var(--accent); }
.c-val.avail { color: var(--accent); }

/* Form — slightly lifted dark surface against the contact section background
   so the form still reads as a contained "card" inside the dark zone.
   --ink-soft (#141414) gives a subtle elevation vs --ink (#080808) section bg. */
.c-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--ink-soft);
  padding: 40px 36px;
  position: relative;
}

/* DS corner markers on form */
.c-form::before,
.c-form::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--accent);
  border-style: solid;
  opacity: 0.5;
}

.c-form::before {
  top: 12px; left: 12px;
  border-width: 1px 0 0 1px;
}

.c-form::after {
  bottom: 12px; right: 12px;
  border-width: 0 1px 1px 0;
}

.f-group {
  position: relative;
  padding: 20px 0;
  border-bottom: 1px solid rgba(240,237,232,0.08);
}

.f-group:last-of-type { border-bottom: none; }

.f-label {
  display: block;
  font-family: var(--f-mono);
  font-size: 0.55rem;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.f-input, .f-textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(240,237,232,0.2);
  padding: 8px 0;
  font-family: var(--f-body);
  font-size: 0.9rem;
  color: var(--bg);
  outline: none;
  transition: border-color 0.3s;
  appearance: none;
  -webkit-appearance: none;
}

.f-input:focus,
.f-textarea:focus {
  border-bottom-color: var(--accent);
}

.f-input::placeholder,
.f-textarea::placeholder {
  color: rgba(240,237,232,0.55);   /* WCAG AA on --ink */
  font-style: italic;
}

.f-textarea {
  resize: none;
  min-height: 120px;
}

/* Submit — accent fill, ink text */
.f-submit {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--ink);
  text-transform: uppercase;
  background: var(--accent);
  border: 1px solid var(--accent);
  padding: 16px 36px;
  position: relative;
  overflow: hidden;
  transition: color 0.4s, background 0.4s;
  width: fit-content;
}

@media (pointer: fine) {
  .f-submit { cursor: none; }
}

.f-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg);
  transform: translateX(-101%);
  transition: transform 0.4s var(--ease);
  z-index: 0;
}

.f-submit:hover { color: var(--ink); border-color: var(--bg); }
.f-submit:hover::before { transform: translateX(0); }
.f-submit span { position: relative; z-index: 1; }

/* ═══════════════════════════════════════
   FORM VALIDATION — DS Error States
═══════════════════════════════════════ */

/* Error state on inputs */
.f-input.f-invalid,
.f-textarea.f-invalid {
  border-bottom-color: var(--error);
  animation: ds-glitch 0.3s ease;
}

.f-input.f-invalid:focus,
.f-textarea.f-invalid:focus {
  border-bottom-color: var(--error);
}

/* Error message container */
.f-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255, 51, 51, 0.06);
  border-left: 2px solid var(--error);
  opacity: 0;
  transform: translateY(-4px);
  animation: ds-error-in 0.3s ease forwards;
}

.f-error-icon {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--error);
  white-space: nowrap;
  padding-top: 1px;
}

.f-error-msg {
  font-family: var(--f-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: rgba(240, 237, 232, 0.7);
  line-height: 1.5;
  text-transform: uppercase;
}

/* Success flash on valid submit */
.f-input.f-valid,
.f-textarea.f-valid {
  border-bottom-color: var(--accent);
}

/* Submit button error state */
.f-submit.f-submit-error {
  animation: ds-btn-reject 0.4s ease;
}

/* ═══════════════════════════════════════
   HONEYPOT — invisible to humans, bots fill it.
   Off-screen but still rendered (display:none would skip bot focus).
═══════════════════════════════════════ */
.f-honeypot {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ═══════════════════════════════════════
   ASYNC SUBMIT STATES — loading / network error / success card
═══════════════════════════════════════ */

/* Loading: dim + disable cursor while POST in flight */
.f-submit.is-loading {
  opacity: 0.65;
  cursor: wait;
  pointer-events: none;
}

/* Network error — sits between the last field and the submit button.
   Same DS visual language as .f-error (red border-left + uppercase mono). */
.f-network-error {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 18px 0 8px;
  padding: 10px 14px;
  background: rgba(255, 51, 51, 0.06);
  border-left: 2px solid var(--error);
  animation: ds-error-in 0.3s ease forwards;
  opacity: 0;
}
.f-network-error .f-error-icon {
  font-family: var(--f-mono); font-size: 0.6rem;
  letter-spacing: 0.15em; color: var(--error);
  text-transform: uppercase;
}
.f-network-error .f-error-msg {
  font-family: var(--f-mono); font-size: 0.65rem;
  letter-spacing: 0.08em; color: var(--bg);
  text-transform: uppercase; line-height: 1.5; flex: 1;
}
.f-network-error .f-error-fallback {
  font-family: var(--f-mono); font-size: 0.6rem;
  letter-spacing: 0.12em; color: var(--accent);
  text-transform: uppercase; text-decoration: none;
  border-bottom: 1px dotted rgba(0,232,122,0.4);
  padding-bottom: 1px;
  transition: border-color 0.25s, color 0.25s;
}
.f-network-error .f-error-fallback:hover {
  color: #ffffff; border-bottom-color: var(--accent);
}

/* Success card — replaces the entire form when message lands.
   Mirrors .c-form chrome (--ink-soft + accent corner brackets). */
.f-success-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--ink-soft);
  padding: 56px 36px;
  animation: ds-error-in 0.4s ease forwards;
  opacity: 0;
}
.f-success-card::before,
.f-success-card::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border-color: var(--accent);
  border-style: solid;
  opacity: 0.5;
}
.f-success-card::before { top: 12px; left: 12px;     border-width: 1px 0 0 1px; }
.f-success-card::after  { bottom: 12px; right: 12px; border-width: 0 1px 1px 0; }

.f-success-mark {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  margin-bottom: 24px;
  background: rgba(0, 232, 122, 0.06);
}

.f-success-title {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}

.f-success-body {
  font-family: var(--f-body);
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--ink-on-dark);
  max-width: 420px;
  margin: 0 0 28px;
}
.f-success-body a {
  color: var(--bg);
  text-decoration: none;
  border-bottom: 1px dotted rgba(240,237,232,0.4);
  padding-bottom: 1px;
  transition: border-color 0.25s, color 0.25s;
}
.f-success-body a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.f-success-reset {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 12px 24px;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.f-success-reset:hover {
  background: var(--accent);
  color: var(--ink);
}

@keyframes ds-glitch {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-3px); }
  40%  { transform: translateX(3px); }
  60%  { transform: translateX(-2px); }
  80%  { transform: translateX(1px); }
  100% { transform: translateX(0); }
}

@keyframes ds-error-in {
  0%   { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes ds-btn-reject {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-4px); }
  50%  { transform: translateX(4px); }
  75%  { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

/* ═══════════════════════════════════════
   FOOTER — DS Classified Document Style
═══════════════════════════════════════ */
footer {
  background: var(--ink);
  padding: 24px 80px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 40px;
  position: relative;
  overflow: hidden;
}

/* Subtle scan line at footer top edge — now acts as a quiet divider
   between the contact zone and the meta/legal footer (since both are
   dark-on-dark after 2026-04-23 unification). */
footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  opacity: 0.18;
}

/* Left — classified badge */
.foot-classified {
  display: flex;
  align-items: center;
  gap: 10px;
}

.foot-tag {
  font-family: var(--f-mono);
  font-size: 0.5rem;
  letter-spacing: 0.28em;
  color: var(--ink);
  background: var(--accent);
  padding: 3px 8px;
  text-transform: uppercase;
}

.foot-divider {
  font-family: var(--f-mono);
  font-size: 0.55rem;
  color: rgba(240,237,232,0.45);   /* WCAG AA on --ink */
}

.foot-id {
  font-family: var(--f-mono);
  font-size: 0.5rem;
  letter-spacing: 0.18em;
  color: rgba(240,237,232,0.55);   /* WCAG AA on --ink */
  text-transform: uppercase;
}

/* Centre — copyright */
.foot-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.foot-copy {
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.foot-copy-label { color: rgba(240,237,232,0.45); }
.foot-copy-sep   { color: rgba(240,237,232,0.45); }   /* WCAG AA on --ink */
.foot-copy-name  { color: var(--bg); font-weight: 700; }

.foot-clearance {
  font-family: var(--f-mono);
  font-size: 0.44rem;
  letter-spacing: 0.14em;
  color: rgba(240,237,232,0.55);   /* WCAG AA on --ink */
  text-transform: uppercase;
}

/* Right — links */
.foot-links {
  display: flex;
  gap: 20px;
  justify-content: flex-end;
}

.foot-link {
  font-family: var(--f-mono);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  color: rgba(240,237,232,0.4);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.25s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.foot-link-prefix {
  color: var(--accent);
  opacity: 0.5;
  transition: opacity 0.25s;
}

.foot-link:hover { color: var(--bg); }
.foot-link:hover .foot-link-prefix { opacity: 1; }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 1024px) {
  nav { padding: 0 32px; }
  .nav-links { gap: 24px; }

  #hero { padding: var(--nav-h) 32px 40px; }
  .hero-wrap { padding: 56px 40px; }
  .hero-stats { gap: 32px; }

  #work, #about, #contact { padding: 100px 40px; }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 360px 360px 360px;
  }

  /* Tablet — hero stays full width on row 1, two side-by-side on row 2,
     fourth card spans full width on row 3 (replaces the old 5th card). */
  .pcard:nth-child(1) { grid-column: 1 / -1; grid-row: 1 / 2; }
  .pcard:nth-child(2) { grid-column: 1 / 2;  grid-row: 2 / 3; }
  .pcard:nth-child(3) { grid-column: 2 / 3;  grid-row: 2 / 3; }
  .pcard:nth-child(4) { grid-column: 1 / -1; grid-row: 3 / 4; }

  .tcard { flex: 0 0 calc(50% - 2px); }

  .about-grid { grid-template-columns: 200px 1fr; gap: 40px; }
  .about-grid > .reveal:last-child { grid-column: 1 / -1; }

  .contact-grid { gap: 40px; }
  .sec-label { display: none; }

  footer { padding: 24px 40px; gap: 24px; }
}

/* Hamburger kicks in here — desktop nav links and status hide, hamburger shows */
@media (max-width: 860px) {
  nav { padding: 0 20px; }
  .nav-links { display: none; }
  .nav-status { display: none; }
  .nav-toggle { display: inline-flex; }
}

@media (max-width: 768px) {
  #testimonials { padding: 80px 20px; }
  .tcard { flex: 0 0 calc(100% - 40px); min-height: 300px; padding: 28px 24px 20px; }
  .carousel-arrow { width: 40px; height: 40px; }
  .ds-cta { padding: 14px 24px; font-size: 0.65rem; }

  /* Hero — extra top padding so eyebrow breathes from nav, extra bottom padding
     so the HUD never collides with the next section. SCROLL indicator hidden:
     on mobile it's redundant and was floating over "STATUS · CONNECTED". */
  #hero { padding: calc(var(--nav-h) + 40px) 20px 96px; }
  .hero-wrap { padding: 40px 20px; }
  .hero-stats { gap: 28px; }
  .hero-scroll-ind { display: none; }

  /* Hero HUD strip — wrap into 2x2 grid so items stop colliding */
  .hero-hud {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    justify-content: stretch;
  }
  .hud-item { font-size: 0.54rem; letter-spacing: 0.12em; }

  #work, #about, #contact { padding: 80px 20px; }

  /* Section header (//003 Selected Work) — stack number above title on mobile
     so long titles never have to share a baseline row with the marker and
     never wrap awkwardly. */
  .sec-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 40px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 240px);
    gap: 8px;
  }

  /* Mobile — single column stack, all cards span full width */
  .pcard,
  .pcard:nth-child(1),
  .pcard:nth-child(2),
  .pcard:nth-child(3),
  .pcard:nth-child(4) {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .pcard-content { padding: 20px 24px; }
  .pcard-title { font-size: 1.15rem; }

  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-portrait { height: 260px; }
  .about-portrait-col { flex-direction: row; align-items: flex-end; gap: 20px; }
  .about-portrait { width: 160px; min-width: 160px; height: 200px; }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .contact-tagline { font-size: clamp(1.8rem, 8vw, 2.4rem); }

  footer { grid-template-columns: 1fr; gap: 16px; padding: 24px 20px; text-align: center; }
  .foot-classified { justify-content: center; }
  .foot-links { justify-content: center; }
  .foot-clearance { display: none; }
  .sec-label { display: none; }
}

/* Ultra-narrow — drop the secondary HUD items so two main ones stay readable */
@media (max-width: 380px) {
  .hero-hud { grid-template-columns: 1fr; gap: 6px; }
  .hud-item:nth-child(3),
  .hud-item:nth-child(4) { display: none; }
}

/* ═══════════════════════════════════════
   ACCESSIBILITY
═══════════════════════════════════════ */

/* Skip link — visible on focus only */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 12px 24px;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus { top: 16px; }

/* Visible focus ring for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Respect motion preferences */
@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;
  }

  html { scroll-behavior: auto; }
}
