/* ═══════════════════════════════════════════════════════════
   ECAS LAI — Portfolio v2
   "The IDE you never close"
   ══════════════════════════════════════════════════════════ */

/* ── Design tokens ───────────────────────────────────────── */
:root {
  --color-bg:        #0a0a0a;
  --color-surface:   #111111;
  --color-surface-2: #161616;
  --color-text:      rgba(254, 254, 254, 0.95);
  --color-dim:       rgba(254, 254, 254, 0.65);  /* 8.42:1 on #0a0a0a — AAA */
  --color-dimmer:    rgba(254, 254, 254, 0.14);
  --color-maroon:    #8B1A1A;
  --color-maroon-b:  #DA4545;                    /* 4.64:1 — AA large; max achievable for red */
  --color-orange:    #D9693A;                    /* 5.69:1 — passes AA large text */
  --color-orange-dim:rgba(217, 105, 58, 0.15);
  --color-border:    rgba(254, 254, 254, 0.07);
  --color-border-mid:rgba(254, 254, 254, 0.12);

  --font-display: 'Hanken Grotesk', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --font-body:    'DM Sans', sans-serif;

  --ease-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-back:  cubic-bezier(0.34, 1.56, 0.64, 1);

  --section-pad: clamp(5rem, 10vw, 9rem);
  --container:   min(1200px, 90vw);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: auto; /* Lenis handles smooth scroll */
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  cursor: none; /* custom cursor */
}

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

ul {
  list-style: none;
}

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

img, canvas {
  display: block;
  max-width: 100%;
}


/* ── Section watermark ───────────────────────────────────── */
.section-watermark {
  position: absolute;
  bottom: -0.12em;
  right: 0;                          /* flush to section right edge */
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(5rem, 11vw, 10rem);
  line-height: 1;
  color: var(--color-text);
  opacity: 0.045;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 0;
  letter-spacing: -0.03em;
}

/* ── Section inner wrapper (about, stack) ────────────────── */
.section-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--section-pad) clamp(1.5rem, 6vw, 5rem);
}

/* ── Custom Cursor ───────────────────────────────────────── */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
}

.cursor-crosshair {
  position: absolute;
  width: 28px;
  height: 28px;
  transition: opacity 0.15s ease;
  /* transform is managed entirely by gsap.quickTo — no CSS transform here */
}

.cursor-crosshair::before,
.cursor-crosshair::after {
  content: '';
  position: absolute;
  background: rgba(254, 254, 254, 0.85);
  border-radius: 0;
  transition: background 0.2s ease, transform 0.2s var(--ease-expo);
}

/* horizontal bar */
.cursor-crosshair::before {
  width: 100%;
  height: 1px;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

/* vertical bar */
.cursor-crosshair::after {
  width: 1px;
  height: 100%;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.cursor-dot {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(254, 254, 254, 0.9);
  border-radius: 50%;
  transition: background 0.2s ease;
  /* transform managed by gsap.quickTo */
}

/* Hover state — scale handled by gsap.to() in JS, only color overrides here */
body.cursor-hovering .cursor-crosshair::before,
body.cursor-hovering .cursor-crosshair::after {
  background: var(--color-maroon-b);
}

body.cursor-hovering .cursor-dot {
  background: var(--color-maroon-b);
}

/* ── Typography helpers ──────────────────────────────────── */
.section-num {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-dim);   /* 8.42:1 — AAA; maroon fails 7:1 at this size */
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text);
}

.section-header {
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

/* ── Navbar ──────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.5rem clamp(1.5rem, 5vw, 3rem);
  transition: transform 0.45s var(--ease-expo),
              opacity 0.3s ease,
              border-bottom 0.3s ease,
              background 0.3s ease;
  opacity: 0;
  transform: translateY(-20px);
}

#navbar.nav-hidden {
  pointer-events: none; /* GSAP handles the transform */
}

#navbar.nav-scrolled {
  border-bottom: 1px solid var(--color-border);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container);
  margin: 0 auto;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--color-text);
  transition: color 0.2s ease;
}

.nav-logo:hover {
  color: var(--color-orange);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--color-dim);
  position: relative;
  transition: color 0.2s ease;
  padding-bottom: 2px;
}

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

.nav-links a:hover,
.nav-links a.nav-active {
  color: var(--color-text);
}

.nav-links a.nav-active::after {
  width: 100%;
}

.nav-links a:hover::after {
  width: 100%;
}

/* ── Hamburger button — hidden on desktop ────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
  position: relative;
}

.nav-ham-line {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--color-text);
  transform-origin: center;
  transition: transform 0.28s var(--ease-expo), opacity 0.2s ease, width 0.2s ease;
}

/* Open state — morphs to × */
.nav-hamburger.is-open .nav-ham-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-hamburger.is-open .nav-ham-line:nth-child(2) {
  opacity: 0;
  width: 0;
}
.nav-hamburger.is-open .nav-ham-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Backdrop — full-screen dim layer behind the open nav */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.65);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.nav-backdrop.is-visible {
  display: block;
}

.nav-backdrop.is-open {
  opacity: 1;
}

/* ── Nav CTA — "Hire Me" ghost pill ─────────────────────── */
.nav-links .nav-cta {
  padding: 0.3rem 0.88rem 0.3rem 0.78rem;
  padding-bottom: 0.3rem;        /* override the 2px from nav-links a */
  border: 1px solid var(--color-border-mid);
  border-radius: 100px;
  color: var(--color-dim);
  transition: color 0.2s ease, border-color 0.22s ease,
              background 0.22s ease, box-shadow 0.22s ease;
}

.nav-links .nav-cta::after {
  display: none;                 /* no underline — it's a pill button */
}

.nav-links .nav-cta:hover {
  color: var(--color-text);
  border-color: var(--color-maroon-b);
  background: rgba(218, 69, 69, 0.10);
  box-shadow: 0 0 14px rgba(218, 69, 69, 0.12);
}

.nav-links .nav-cta.nav-active {
  color: var(--color-text);
  border-color: var(--color-maroon-b);
  background: rgba(218, 69, 69, 0.12);
}

/* ── Contact page nav: back link + logo grouped left ─────── */
.nav-left {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--color-dim);
  text-decoration: none;
  padding: 0.3rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-back:hover {
  color: var(--color-text);
  border-bottom-color: var(--color-orange);
}

.nav-back-arrow {
  display: inline-block;
  font-size: 0.8rem;
  transition: transform 0.2s ease;
  line-height: 1;
}

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

.nav-back-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* "Contact" page label in nav — not a link, just a current-page indicator */
.nav-cta--page {
  cursor: default;
  pointer-events: none;
  display: inline-block;
}

/* ── Hero ────────────────────────────────────────────────── */
#hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform-origin: center center;
  will-change: transform, opacity;
}

#binary-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 2vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-label {
  position: absolute;
  top: clamp(5rem, 8vh, 7rem);
  left: clamp(1.5rem, 6vw, 5rem);
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--color-dim);
  opacity: 0;
}

.hero-name {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: center;
  gap: 1.5em;
  line-height: 0.88;
  flex-wrap: nowrap;
  margin: 0;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.name-ecas {
  font-family: var(--font-display);
  font-size: 15vw;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--color-text);
  display: block;
  line-height: 0.88;
}

.name-last {
  font-family: var(--font-display);
  font-size: 15vw;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--color-text);
  display: block;
  line-height: 0.88;
}

/* ── Hero name wrap — name + glow line container ────── */
.hero-name-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
}

/* Corner bracket markers */
.hero-brk {
  position: absolute;
  width: 18px;
  height: 18px;
  border-style: solid;
  border-color: var(--color-maroon-b);
  border-width: 0;
  opacity: 0;
}
.hero-brk--tl { top: 0;    left: 0;  border-top-width: 2px; border-left-width: 2px;   }
.hero-brk--tr { top: 0;    right: 0; border-top-width: 2px; border-right-width: 2px;  }
.hero-brk--bl { bottom: 0; left: 0;  border-bottom-width: 2px; border-left-width: 2px;  }
.hero-brk--br { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }

/* Glow line — maroon with bright hot-spot at center */
.hero-glow-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent          0%,
    var(--color-maroon)  18%,
    var(--color-maroon-b) 38%,
    rgba(255, 215, 215, 0.95) 50%,
    var(--color-maroon-b) 62%,
    var(--color-maroon)  82%,
    transparent          100%
  );
  box-shadow: 0 0 12px rgba(218, 69, 69, 0.5), 0 0 28px rgba(218, 69, 69, 0.2);
  margin-top: 0.14em;
  opacity: 0;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(0.66rem, 1.02vw, 0.9rem);
  font-weight: 300;
  letter-spacing: 0.26em;
  color: var(--color-dim);
  text-transform: uppercase;
  margin-bottom: 1.4rem;
  opacity: 0;
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  font-weight: 300;
  color: rgba(254, 254, 254, 0.7);
  opacity: 0;
  margin-bottom: 1.4rem;  /* badge now provides the gap to CTAs */
}

/* ── Hero badge — inline, recruiter-visible ──────────────── */
.hero-badge {
  display: inline-flex;
  align-self: center;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1.2rem 0.55rem 0.95rem;
  background: rgba(39, 201, 63, 0.10);
  border: 1px solid rgba(39, 201, 63, 0.45);
  border-radius: 100px;
  box-shadow: 0 0 18px rgba(39, 201, 63, 0.12);
  margin-top: 2.4rem;
  margin-bottom: 2rem;
  opacity: 0;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #27C93F;
  flex-shrink: 0;
  animation: badge-pulse 2.2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(39, 201, 63, 0.6); }
  50%       { box-shadow: 0 0 0 6px rgba(39, 201, 63, 0);   }
}

.badge-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: #27C93F;                /* full brightness — 9.6:1 contrast */
}

/* ── Hero CTAs ───────────────────────────────────────────── */
.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
}

.cta-btn {
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1vw, 0.82rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 0.7rem 1.4rem;
  border-radius: 2px;
  transition: all 0.22s ease;
  white-space: nowrap;
}

.cta-btn--primary {
  background: var(--color-maroon);
  color: rgba(254, 254, 254, 0.9);
  border: 1px solid var(--color-maroon);
}

.cta-btn--primary:hover {
  background: var(--color-maroon-b);
  border-color: var(--color-maroon-b);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 26, 26, 0.4);
}

.cta-btn--ghost {
  background: transparent;
  color: var(--color-dim);
  border: 1px solid var(--color-border-mid);
}

.cta-btn--ghost:hover {
  border-color: var(--color-dim);
  color: var(--color-text);
  transform: translateY(-2px);
}

/* ── Hero scroll hint (centered) ─────────────────────────── */
.hero-scroll-hint {
  position: absolute;
  bottom: 2.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  opacity: 0;           /* faded in by load sequence */
  color: rgba(254, 254, 254, 0.45);
  animation: scroll-drop 2.2s ease-in-out infinite;
}

.scroll-icon {
  display: block;
  width: 12px;
  height: 36px;
}

@keyframes scroll-drop {
  0%   { transform: translateX(-50%) translateY(0);    opacity: 0.35; }
  50%  { transform: translateX(-50%) translateY(7px);  opacity: 0.75; }
  100% { transform: translateX(-50%) translateY(0);    opacity: 0.35; }
}

/* ── Glitch overlay — shared by index.html + contact.html ── */
#glitch-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-bg);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

#glitch-overlay.is-active {
  visibility: visible;
}

.glitch-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(255, 255, 255, 0.025) 3px,
    rgba(255, 255, 255, 0.025) 4px
  );
  pointer-events: none;
}

.glitch-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0;
  pointer-events: none;
}

/* ── About ───────────────────────────────────────────────── */
#about {
  position: relative;
  overflow: hidden;
  z-index: 2; /* slides over pinned hero during A+B transition */
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#about .section-inner {
  padding-top: clamp(2.5rem, 4.5vw, 4rem);
  padding-bottom: clamp(2rem, 3.5vw, 3.5rem);
  width: 100%;
}

/* All subsequent sections stack above hero too */
#tech-stack, #projects, #experience, #contact {
  position: relative;
  z-index: 2;
}

.about-terminal {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  max-width: 760px;
  opacity: 0;
  transform: translateY(30px);
}

.terminal-bar {
  background: var(--color-surface);
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border-bottom: 1px solid var(--color-border);
}

.term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.term-red    { background: #FF5F56; }
.term-yellow { background: #FFBD2E; }
.term-green  { background: #27C93F; }

.terminal-filename {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 300;
  color: var(--color-dim);
  margin-left: 0.5rem;
  letter-spacing: 0.04em;
}

.terminal-body {
  padding: 1.5rem 1.5rem 1.8rem;
  background: var(--color-bg);
  border-left: 2px solid var(--color-maroon);
}

.terminal-prompt {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--color-dim);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.about-status {
  margin-top: 1.2rem;
  margin-bottom: 0;
}

.prompt-sym {
  color: var(--color-orange);
  font-size: 0.85rem;
}

.about-text {
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 1.3vw, 1.05rem);
  font-weight: 300;
  line-height: 1.75;
  color: rgba(254, 254, 254, 0.8);
  padding-left: 1.2rem;
}

.status-value {
  color: var(--color-orange);
}

/* ── Tech Stack ──────────────────────────────────────────── */
#tech-stack {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--color-border);
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#tech-stack .section-inner {
  padding-top: clamp(2rem, 3.5vw, 3.5rem);
  padding-bottom: clamp(1.5rem, 2.5vw, 2.5rem);
  width: 100%;
}

#tech-stack .section-header,
#about .section-header {
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

.stack-intro {
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 1.3vw, 1.05rem);
  font-weight: 300;
  color: var(--color-dim);
  max-width: 560px;
  line-height: 1.65;
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
  opacity: 0;
  transform: translateY(12px);
}

/* Primary tools row */
.stack-primary {
  display: flex;
  gap: clamp(0.6rem, 1.5vw, 1.2rem);
  flex-wrap: nowrap;
  margin-bottom: 0;
  opacity: 0;
  transform: translateY(16px);
}

.stack-primary-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  min-width: 0;
  flex: 1;
  transition: border-color 0.2s ease, background 0.2s ease;
  cursor: default;
}

.stack-primary-item:hover {
  border-color: var(--color-orange);
  background: var(--color-orange-dim);
}

.stack-icon {
  width: 22px;
  height: 22px;
  opacity: 0.55;
  margin-bottom: 0.2rem;
  transition: opacity 0.2s ease;
}

.stack-primary-item:hover .stack-icon {
  opacity: 1;
}

.stack-primary-name {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--color-text);
}

.stack-primary-note {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--color-dim);
}

.stack-divider {
  height: 1px;
  background: var(--color-border);
  margin: clamp(0.8rem, 1.5vw, 1.2rem) 0;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem 1.8rem;
}

.stack-col {
  opacity: 0;
  transform: translateY(20px);
}

.stack-category {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-dim);   /* 8.42:1 — 0.68rem is tiny, needs AAA */
  margin-bottom: 0.7rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-border);
}

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.03em;
  color: var(--color-dim);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  padding: 0.28rem 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  cursor: default;
}

.tag:hover {
  color: var(--color-orange);
  border-color: var(--color-orange);
  background: var(--color-orange-dim);
}

.tag-icon {
  width: 11px;
  height: 11px;
  opacity: 0.45;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.tag:hover .tag-icon {
  opacity: 0.75;
}

/* Currently exploring */
.stack-exploring {
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 300;
  color: var(--color-dimmer);
  letter-spacing: 0.04em;
  opacity: 0;
}

.exploring-label {
  color: var(--color-dim);   /* 8.42:1 — small inherited font size */
  margin-right: 0.5rem;
}

/* ── Manifesto ───────────────────────────────────────────── */
#manifesto {
  position: relative;
  height: 100vh;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--color-border);
  overflow: hidden;
}

/* Label floats above — absolutely positioned so it doesn't
   shift the flex centroid of the text block */
.manifesto-label {
  position: absolute;
  top: clamp(3.5rem, 6vw, 5rem);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--color-dim);   /* 8.42:1 — 0.72rem needs 7:1 */
  opacity: 0;
  z-index: 1;
}

.manifesto-text {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-text);
  letter-spacing: -0.025em;
  text-align: center;
  width: 100%;
  max-width: clamp(520px, 72vw, 960px);
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  position: relative;
  z-index: 1;
}

/* One block per line — injected by JS */
.m-line {
  display: block;
  text-align: center;
  /* opacity not set here — individual .mc chars handle it */
}

/* Chars start invisible; JS reveals them as user scrolls */
.manifesto-text .mc {
  opacity: 0;
}

/* Blinking cursor — position:fixed so it can track typed-text end
   across the dynamic translateY centering shifts.
   Font props must match .manifesto-text exactly. */
.mf-cursor {
  position: fixed;
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.025em;
  color: var(--color-maroon-b);
  pointer-events: none;
  z-index: 200;
  animation: mf-blink 0.9s step-end infinite;
  /* top / left set by JS on every scroll frame */
}

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

/* Mobile: pin stays active (JS handles it) — adjust font + layout only */
@media (max-width: 768px) {
  #manifesto {
    min-height: 100vh;   /* ensure full viewport during pin */
  }
  .manifesto-text {
    font-size: clamp(1.5rem, 7vw, 2.4rem);
    max-width: 100%;
    padding: 0 1.5rem;
  }
  .mf-cursor { display: none !important; }  /* not created on mobile */
}

/* ── Projects ────────────────────────────────────────────── */
#projects {
  height: 100vh;
  min-height: 560px;
  border-top: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}

/* Watermark sits above the peek panel so it bleeds over it */
#projects .section-watermark {
  z-index: 14;
  pointer-events: none;
}

/* Overlay: section label + counter */
.proj-overlay-meta {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem clamp(1.5rem, 6vw, 5rem);
  pointer-events: none;
}

.proj-section-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--color-maroon-b);
}

.proj-counter {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--color-dim);
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

#proj-current {
  color: var(--color-text);
  font-weight: 500;
}

.proj-sep { color: var(--color-dimmer); }

/* Viewport */
.projects-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.projects-track {
  display: flex;
  width: 400%;
  height: 100%;
  will-change: transform;
}

/* Each slide: full-screen two-column (info + visual) */
.project-slide {
  flex: 0 0 25%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 4vw, 5rem);
  /* Right padding reserves space for the peek panel */
  padding: 5.5rem calc(clamp(130px, 10vw, 180px) + clamp(1.5rem, 3vw, 3rem)) 3rem clamp(2rem, 6vw, 5rem);
  border-left: 1px solid transparent;
  transition: border-color 0.5s ease;
}

.project-slide:nth-child(1) { background: #0a0a0a; }
.project-slide:nth-child(2) { background: #0c0a09; }
.project-slide:nth-child(3) { background: #09090c; }
.project-slide:nth-child(4) { background: #0b0a09; }

.project-slide.active {
  border-left-color: var(--color-maroon);
}

/* Project info — constrained width for readability */
.proj-info {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 560px;
}

.proj-num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--color-dim);   /* 8.42:1 — 0.68rem needs 7:1 */
  margin-bottom: 0.4rem;
}

.proj-name {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5.5vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text);
  line-height: 1;
  margin-bottom: 0;
}

.proj-divider {
  height: 1px;
  background: var(--color-border);
  margin: 1.2rem 0 1.4rem;
}

.proj-desc {
  font-family: var(--font-body);
  font-size: clamp(0.88rem, 1.1vw, 1rem);
  font-weight: 300;
  line-height: 1.75;
  color: rgba(254, 254, 254, 0.6);
  margin-bottom: 1.4rem;
}

.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.8rem;
}

.proj-tag {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--color-dim);                    /* 8.42:1 — orange fails 7:1 at 0.63rem */
  border: 1px solid rgba(217, 105, 58, 0.30); /* updated to match new --color-orange */
  border-radius: 2px;
  padding: 0.22rem 0.55rem;
}

.proj-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--color-dim);
  border: 1px solid var(--color-border);
  padding: 0.55rem 1rem;
  border-radius: 2px;
  align-self: flex-start;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.proj-link:hover {
  color: var(--color-text);
  border-color: var(--color-border-mid);
  background: var(--color-surface);
}

.proj-link-arrow {
  transition: transform 0.2s var(--ease-expo);
}

.proj-link:hover .proj-link-arrow {
  transform: translate(2px, -2px);
}

/* Right panel — image visual */
.proj-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.proj-visual-link {
  display: block;
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--color-border-mid);
  border-radius: 3px;
  background: var(--color-surface);
  cursor: none;
  transition: border-color 0.3s ease, transform 0.4s var(--ease-expo);
}

.proj-visual-link:hover {
  border-color: var(--color-orange);
  transform: scale(1.02);
}

.proj-visual-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: brightness(0.88) saturate(0.9);
  opacity: 0;
  transition: filter 0.4s ease, transform 0.5s var(--ease-expo);
  transform: scale(1);
  /* opacity managed by gsap.to() in initProjectImageCycle — not CSS transition */
}

.proj-visual-link:hover .proj-visual-img.active {
  filter: brightness(0.96) saturate(1);
  transform: scale(1.04);
}

/* Overlay that dims slightly, lifts on hover */
.proj-visual-link::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(10,10,10,0.05) 0%, rgba(10,10,10,0.45) 100%);
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.proj-visual-link:hover::after {
  opacity: 0.5;
}

/* Pill indicators */
.proj-visual-dots {
  position: absolute;
  bottom: 0.9rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 2;
  pointer-events: none;
}

.proj-visual-dot {
  display: block;
  height: 3px;
  width: 18px;
  border-radius: 100px;
  background: rgba(254, 254, 254, 0.28);
  transition: width 0.35s var(--ease-expo), background 0.35s ease;
}

.proj-visual-dot.active {
  width: 32px;
  background: rgba(254, 254, 254, 0.88);
}

/* Placeholder dot-grid when no image yet */
.proj-visual-link:not(:has(img))::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(254,254,254,0.05) 1px, transparent 1px);
  background-size: 20px 20px;
}

.preview-window {
  width: 100%;
  max-width: 500px;
  background: #0d0d0d;
  border: 1px solid var(--color-border-mid);
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(254, 254, 254, 0.03);
}

.preview-bar {
  background: #181818;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid var(--color-border);
}

.preview-title {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 300;
  color: var(--color-dim);
  margin-left: 0.5rem;
  letter-spacing: 0.04em;
}

.preview-code {
  padding: 1.2rem 1.4rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 300;
  line-height: 1.9;
  overflow: hidden;
}

.pc-line        { display: block; white-space: pre; color: rgba(254,254,254,0.70); }  /* 9.66:1 — AAA */
.pc-prompt      { color: rgba(254,254,254,0.92); }
.pc-dim         { color: rgba(254,254,254,0.62); }  /* 7.66:1 — AAA */
.pc-faint       { color: rgba(254,254,254,0.48); }  /* 4.94:1 — AA */
.pc-ok          { color: #4ade80; }
.pc-warn        { color: #fbbf24; }
.pc-err         { color: #f87171; }
.pc-val         { color: var(--color-orange); }
.pc-key         { color: #c084fc; }
.pc-str         { color: #67e8f9; }

/* Prev button */
.proj-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 14;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 300;
  color: var(--color-dim);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.proj-nav:hover {
  color: var(--color-text);
  border-color: var(--color-border-mid);
  background: var(--color-surface);
}

.proj-nav:disabled { opacity: 0.18; pointer-events: none; }
.proj-prev { left: clamp(0.75rem, 1.5vw, 1.5rem); }

/* Roller panel — right-edge project drum */
.proj-peek-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: clamp(130px, 10vw, 180px);
  background: rgba(8, 8, 8, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-left: 1px solid var(--color-border-mid);
  z-index: 13;
  overflow: hidden;
}

/* Fade masks top and bottom so items bleed off naturally */
.proj-peek-panel::before,
.proj-peek-panel::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 30%;
  pointer-events: none;
  z-index: 2;
}
.proj-peek-panel::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(8,8,8,0.95), transparent);
}
.proj-peek-panel::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(8,8,8,0.95), transparent);
}

/* The scrolling drum strip */
.proj-roller {
  position: absolute;
  left: 0; right: 0;
  top: 0;
  will-change: transform;
}

/* Each slot has a fixed height so GSAP math is predictable */
.roller-item {
  height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 1.6rem;
  transform-origin: left center;
  will-change: transform, opacity;
  cursor: none;
}

.roller-num {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: var(--color-orange);
  margin-bottom: 0.2rem;
  display: block;
}

.roller-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(0.95rem, 1.3vw, 1.2rem);
  line-height: 1.1;
  color: var(--color-text);
  display: block;
}

/* Progress bar */
.proj-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-border);
}

.proj-progress-fill {
  height: 100%;
  background: var(--color-maroon-b);
  width: 25%;
  transition: width 0.5s var(--ease-expo);
}

/* Mobile-only scroll hint — always hidden on desktop */
.proj-mobile-hint {
  display: none;
}

/* ── Experience ──────────────────────────────────────────── */
#experience {
  position: relative;
  height: 100vh;
  overflow: hidden;
  border-top: 1px solid var(--color-border);
}

/* ── Experience panels ────────────────────────────────────── */
.exp-section-num {
  position: absolute;
  top: clamp(1.5rem, 3vw, 2.5rem);
  left: clamp(1.5rem, 4vw, 4rem);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--color-dim);   /* 8.42:1 — 0.7rem needs 7:1 */
  z-index: 10;
}

/* Persistent spine line — always visible across all panels */
.exp-spine-line {
  position: absolute;
  left: clamp(3.5rem, 7vw, 7rem);
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--color-border-mid);
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

/* Glow runner that travels down the spine during transitions */
.exp-line-runner {
  position: absolute;
  left: -1px;
  width: 3px;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--color-orange), transparent);
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  border-radius: 2px;
}

.exp-panel {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr clamp(220px, 30vw, 420px);
  align-items: center;
  column-gap: clamp(2rem, 4vw, 5rem);
  padding-left: clamp(5.5rem, 11vw, 11rem);
  padding-right: clamp(2rem, 6vw, 6rem);
  padding-top: 4rem;
  padding-bottom: 4rem;
  will-change: transform, opacity;
}

/* Dot on the spine line for the active panel */
.exp-dot {
  position: absolute;
  left: calc(clamp(3.5rem, 7vw, 7rem) - 5px);
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-maroon);
  border: 2px solid var(--color-bg);
  box-shadow: 0 0 0 1px var(--color-maroon);
  z-index: 4;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.exp-panel.active .exp-dot {
  background: var(--color-orange);
  box-shadow: 0 0 0 1px var(--color-orange), 0 0 12px rgba(200,91,42,0.35);
}

/* Right-column image stack */
.exp-deco-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-self: center;
  height: clamp(320px, 62vh, 540px);
}

/* Decorative image placeholders */
.exp-deco {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border-mid);
  border-radius: 2px;
  overflow: hidden;
  pointer-events: none;
}

/* Dot-grid on empty slots */
.exp-deco::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: radial-gradient(circle, rgba(254,254,254,0.06) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
}

/* When an <img> is present: swap dot-grid for a vignette overlay */
.exp-deco:has(img)::before {
  background-image: none;
  background: linear-gradient(
    165deg,
    rgba(10, 10, 10, 0.08) 0%,
    rgba(10, 10, 10, 0.55) 100%
  );
}

/* Image itself fills the slot */
.exp-deco img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  z-index: 0;
  filter: brightness(0.9) saturate(0.9) blur(0.45px);
  user-select: none;
  -webkit-user-drag: none;
}

/* Top image — tilts left, offset left of --b */
.exp-deco--a {
  transform: translateX(-14%) rotate(-2.5deg);
  flex: 0.85;
}

/* Bottom image — tilts right */
.exp-deco--b {
  transform: rotate(2.5deg);
  flex: 1;
}

/* Main content block — grid column 1 */
.exp-body {
  position: relative;
  z-index: 2;
  grid-column: 1;
  max-width: 580px;
}

.exp-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  color: var(--color-dim);
  margin-bottom: 0.85rem;
  text-transform: uppercase;
}

.exp-company {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3rem, 7.5vw, 6rem);
  line-height: 0.88;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: 0.65rem;
}

.exp-role {
  font-family: var(--font-body);
  font-size: clamp(0.85rem, 1.3vw, 1rem);
  font-weight: 300;
  color: var(--color-dim);   /* 8.42:1 — role text is static, needs 7:1 at 0.85rem */
  letter-spacing: 0.04em;
  margin-bottom: 1.8rem;
}

.exp-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 540px;
}

.exp-bullets li {
  font-family: var(--font-body);
  font-size: clamp(0.8rem, 1.1vw, 0.9rem);
  font-weight: 300;
  line-height: 1.7;
  color: rgba(254, 254, 254, 0.78);  /* 11.0:1 — was 0.55 (6.2:1) */
  padding-left: 1.2rem;
  position: relative;
}

.exp-bullets li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--color-orange);
  font-size: 1.2rem;
  line-height: 1.5;
}

/* Panel counter — bottom right */
.exp-counter {
  position: absolute;
  bottom: clamp(1.5rem, 3vw, 2.5rem);
  right: clamp(1.5rem, 4vw, 4rem);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--color-dim);
  z-index: 10;
}

/* ── Contact ─────────────────────────────────────────────── */
#contact {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  min-height: 80vh;
}

.contact-inner {
  flex: 1;
  padding: var(--section-pad) clamp(1.5rem, 6vw, 5rem);
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
}

.contact-num {
  margin-bottom: 1.5rem;
}

/* Editorial hero — heading + magnetic button */
.contact-hero {
  display: flex;
  align-items: flex-end;
  gap: 2.5rem;
  margin-bottom: 3.5rem;
  opacity: 0;
}

.contact-heading {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 7.5vw, 7rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 0.88;
  color: var(--color-text);
}

.contact-accent {
  color: var(--color-orange);
}

/* Magnetic circle button */
.contact-magnet {
  flex-shrink: 0;
  width:  clamp(68px, 7vw, 96px);
  height: clamp(68px, 7vw, 96px);
  border-radius: 50%;
  background: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.55rem;    /* visual baseline alignment with text */
  will-change: transform;
  cursor: none;
  transition: background 0.25s ease;
}

.contact-magnet:hover { background: var(--color-orange); }

.magnet-icon {
  font-size: clamp(1.3rem, 1.8vw, 1.65rem);
  color: var(--color-bg);
  display: block;
  line-height: 1;
}

.contact-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--color-dim);
  margin-bottom: 3.5rem;
  opacity: 0;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 600px;
}

.contact-link {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--color-border);
  opacity: 0;
  transform: translateX(-12px);
  transition: border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.contact-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-orange);
  transition: width 0.35s var(--ease-expo);
}

.contact-link:hover::before {
  width: 100%;
}

.contact-link-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-dim);
  transition: color 0.2s ease;
}

.contact-link-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--color-text);
  transition: color 0.2s ease;
}

.contact-link-arrow {
  font-size: 1rem;
  color: var(--color-dim);
  transition: transform 0.25s var(--ease-expo), color 0.2s ease;
}

.contact-link:hover .contact-link-label { color: var(--color-orange); }
.contact-link:hover .contact-link-value { color: var(--color-text); }
.contact-link:hover .contact-link-arrow {
  color: var(--color-orange);
  transform: translate(3px, -3px);
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  padding: 1.5rem clamp(1.5rem, 6vw, 5rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--color-border);
}

.footer-note {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--color-dim);
}

/* Right-side credit — slightly dimmer than the legal copyright text */
.footer-note--dim {
  color: rgba(254, 254, 254, 0.28);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 1024px) {
  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 3rem;
  }

  .name-ecas, .name-last {
    font-size: clamp(10vw, 12vw, 180px);
  }

  .exp-company {
    font-size: clamp(2.8rem, 7vw, 5rem);
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --section-pad: 4rem;
  }

  /* Kill custom cursor on touch */
  @media (pointer: coarse) {
    body { cursor: auto; }
    a, button { cursor: pointer; }
    .cursor { display: none; }
  }

  /* Show hamburger, slide nav links in as a drawer */
  .nav-hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(280px, 80vw);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
    padding: 2.5rem 2rem;
    background: rgba(17, 17, 17, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid var(--color-border);
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.38s var(--ease-expo);
  }

  .nav-links.is-open {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 1.1rem;
    letter-spacing: 0.06em;
    opacity: 0.7;
    transition: opacity 0.2s ease, color 0.2s ease;
  }

  .nav-links a:hover,
  .nav-links a.nav-active {
    opacity: 1;
  }

  .nav-links .nav-cta {
    margin-top: 0.5rem;
    padding: 0.55rem 1.2rem;
    font-size: 0.85rem;
  }

  .name-ecas, .name-last {
    font-size: clamp(2.8rem, 15vw, 120px);  /* min 44.8px, caps at 120px */
  }

  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  /* Projects — single-project slider (same as desktop, single column layout) */
  #projects {
    height: 100vh;
    overflow: hidden;
  }

  /* Viewport → flex column so overlay-meta takes its natural height
     and the track fills the remaining space, preventing the 30px clip */
  .projects-viewport {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .proj-overlay-meta { flex-shrink: 0; }

  .projects-track {
    /* Keep flex row — JS controls transform via xPercent */
    flex-direction: row;
    width: 400%;
    flex: 1 1 auto;
    min-height: 0;
    /* height: 100% removed — viewport flex handles it */
  }

  .project-slide {
    flex: 0 0 25%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    grid-template-columns: unset;  /* override desktop grid */
    padding: 3rem 1.5rem 1.5rem;   /* reduced top: nav is hidden by scroll; bottom: tighter */
    border-left: none;
    border-top: 3px solid transparent;
    overflow: hidden;              /* no internal scroll — content must fit */
  }

  .project-slide.active {
    border-top-color: var(--color-maroon);
  }

  /* Image above text */
  .proj-visual {
    order: -1;
    height: auto;
    margin-bottom: 1.5rem;
    justify-content: flex-start;
  }

  .proj-visual-link {
    max-width: 100%;
    aspect-ratio: 16 / 9;
  }

  /* Tap-to-advance affordance on project name */
  .proj-name {
    font-size: clamp(1.8rem, 7vw, 3rem);
    cursor: pointer;
  }

  .proj-name::after {
    content: ' →';
    font-size: 0.65em;
    opacity: 0.4;
    letter-spacing: 0;
  }

  /* Hide desktop-only chrome */
  .proj-nav { display: none; }
  .proj-peek-panel { display: none; }
  .proj-progress { display: none; }
  .proj-mobile-hint { display: none; }
  .proj-overlay-meta { position: relative; padding: 0.75rem 1.5rem 0; }

  /* Experience: keep 100vh + hidden so panels can overlay each other correctly */
  #experience {
    height: 100vh;
    overflow: hidden;
  }

  .exp-company {
    font-size: clamp(2.4rem, 9vw, 3.5rem);
  }

  /* Ghost background image — sits behind the text like a memory.
     Absolutely positioned, fills the panel, very low opacity. */
  .exp-deco-stack {
    position: absolute;
    inset: 0;
    z-index: 0;           /* behind .exp-body (z-index auto / 1) */
    height: 100%;
    flex-direction: column;
    gap: 0;
    pointer-events: none;
  }

  .exp-deco {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    flex: none;
    border-radius: 0;
    overflow: hidden;
    transform: none;       /* remove desktop tilt */
  }

  /* Only show first image; hide secondary */
  .exp-deco:nth-child(n+2) { display: none; }

  .exp-deco::before { display: none; }  /* remove dot-grid overlay */

  /* Edge-fade vignette — blends the ghost image into the dark background */
  .exp-deco::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
      linear-gradient(to right,  rgba(10,10,10,0.7) 0%, transparent 40%, transparent 60%, rgba(10,10,10,0.7) 100%),
      linear-gradient(to bottom, rgba(10,10,10,0.5) 0%, transparent 35%, transparent 65%, rgba(10,10,10,0.5) 100%);
    pointer-events: none;
  }

  .exp-deco img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.1);            /* slightly oversize — fills past panel edges */
    /* Fully greyscale, dim, softly blurred = "distant memory" */
    opacity: 0.12;
    filter: grayscale(1) brightness(0.5) blur(2px);
    user-select: none;
    -webkit-user-drag: none;
  }

  /* Ensure panel content sits on top */
  .exp-body {
    position: relative;
    z-index: 1;
  }
  .exp-dot   { z-index: 2; }
  .exp-counter { z-index: 2; }

  .exp-panel {
    position: absolute;    /* overlay panels — GSAP cross-fades between them */
    inset: 0;
    grid-template-columns: 1fr;
    padding-left: clamp(3.5rem, 8vw, 6rem);
    padding-right: 1.5rem;
    padding-top: 3rem;
    padding-bottom: 3rem;
    overflow: hidden;      /* clips ghost image to the panel boundary */
  }

  .exp-bullets {
    max-width: 100%;
  }

  .contact-link {
    grid-template-columns: 70px 1fr auto;
  }

  .site-footer {
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-start;
  }

  .proj-counter { display: none; }

  /* About + stack: revert to auto-height on mobile */
  #about,
  #tech-stack {
    height: auto;
    display: block;
  }

  #about .section-inner,
  #tech-stack .section-inner {
    padding-top: var(--section-pad);
    padding-bottom: var(--section-pad);
    width: auto;
  }

  .stack-primary {
    flex-wrap: wrap;
    gap: clamp(0.8rem, 2vw, 1.2rem);
  }

  /* Hero enhancements — mobile overrides */

  /* Stack ECAS above LAI vertically */
  .hero-name {
    flex-direction: column;
    align-items: center;
    gap: 0.05em;
  }

  .name-ecas,
  .name-last { font-size: clamp(3.2rem, 22vw, 160px); }

  .hero-name-wrap { padding: 8px 14px; }

  .hero-badge {
    font-size: 0.72rem;
    padding: 0.45rem 1rem 0.45rem 0.8rem;
    margin-top: 1.8rem;
    margin-bottom: 1.5rem;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .cta-btn {
    font-size: 0.7rem;
    padding: 0.65rem 1.2rem;
  }
}

/* ── Very narrow phones (<400px) — extra clamp safety ─────── */
@media (max-width: 400px) {
  .name-ecas, .name-last {
    font-size: clamp(2.8rem, 20vw, 120px);
  }
}

/* ── Scroll-triggered initial states ─────────────────────── */
/* Elements start hidden before GSAP animates them in */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
}
