@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,300;1,9..144,400;1,9..144,500;1,9..144,600&family=JetBrains+Mono:wght@400;500&family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

/* ── RENGOK — self-hosted (place font file in /fonts/) ── */
@font-face {
  font-family: 'Rengok';
  src: url('fonts/Rengok.woff2') format('woff2'),
       url('fonts/Rengok.woff')  format('woff'),
       url('fonts/Rengok.otf')   format('opentype'),
       url('fonts/Rengok.ttf')   format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ── TOKENS ─────────────────────────────── */
:root {
  --bg:           #0a0a0a;
  --fg:           #f0f0f0;
  --fg-2:         #c8c8c8;   /* secondary text — readable but stepped down */
  --muted:        #8a8a8a;   /* tertiary — labels, dates, handles */
  --border:       rgba(255,255,255,0.075);
  --border-hover: rgba(255,255,255,0.18);
  --nav-bg:       rgba(10,10,10,0.85);
  --card:         rgba(255,255,255,0.03);
  --card-hover:   rgba(255,255,255,0.055);
  --tag:          rgba(255,255,255,0.065);
  --shadow:       0 4px 24px rgba(0,0,0,.45);
  --shadow-lg:    0 12px 48px rgba(0,0,0,.6);
  --sans:         'Inter', system-ui, sans-serif;
  --serif:        'Fraunces', Georgia, serif;
  --mono:         'JetBrains Mono', monospace;
  --display:      'Rengok', 'Fraunces', Georgia, serif;
  --headline:     'Rengok', 'Fraunces', Georgia, serif;
  --body:         'Lora', Georgia, serif;
  --ease:         cubic-bezier(.4,0,.2,1);
  --spring:       cubic-bezier(.34,1.56,.64,1);
  --max:          760px;
  --frame:        12px;
  --r:            18px;
  --bg-glow:      linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
}
[data-theme="light"] {
  --bg:           #faf8f5;
  --fg:           #0e0e10;
  --fg-2:         #2e2e35;
  --muted:        #5d6b82;
  --border:       rgba(0,0,0,.045);
  --border-hover: rgba(0,0,0,.08);
  --nav-bg:       rgba(255,255,255,.85);
  --card:         #faf8f5;
  --card-hover:   #f5f2ee;
  --tag:          rgba(0,0,0,.025);
  --shadow:       0 8px 24px rgba(0,0,0,.035);
  --shadow-lg:    0 16px 36px rgba(0,0,0,.075);
  --bg-glow:      linear-gradient(180deg, #faf8f5 0%, #f0ece6 100%);
}

/* ── RESET ───────────────────────────────── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;background:transparent}
/* html background is transparent — the shader canvas sits behind body and shows through */

/* Prevent flash of unstyled content while shader loads */
html:not(.shader-ready) .hero {
  opacity: 0;
  transition: opacity 0.4s ease;
}
html.shader-ready .hero {
  opacity: 1;
}

/* Body: transparent over hero so shader shows, solid color below hero via main gradient */
body{font-family:var(--body);background-color:transparent;color:var(--fg);overflow-x:hidden;line-height:1.7;font-size:15px;font-weight:400;letter-spacing:-0.01em;transition:color 0.5s var(--ease)}

/* Page background color — sits behind the shader canvas */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: #0a0a0a;
  transition: background-color 0.5s var(--ease);
}
[data-theme="light"] body::before {
  background-color: #faf8f5;
}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%}
button{cursor:pointer;border:none;background:none;font:inherit;color:inherit}
ul{list-style:none}

/* ── HERO SHADER (Paper Design GrainGradient) ── */
#hero-shader {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 0;           /* sits above transparent html, below body content */
  pointer-events: none;
  will-change: opacity;
  /* Fallback gradient shown before WebGL initializes */
  background: radial-gradient(
    ellipse at 30% 40%, 
    rgba(251, 146, 60, 0.15) 0%, 
    rgba(250, 204, 21, 0.1) 25%, 
    rgba(244, 114, 182, 0.08) 50%, 
    transparent 70%
  );
  transition: background 0.5s var(--ease), opacity 0.5s ease;
}

[data-theme="light"] #hero-shader {
  background: radial-gradient(
    ellipse at 30% 40%, 
    rgba(251, 146, 60, 0.08) 0%, 
    rgba(250, 204, 21, 0.05) 25%, 
    rgba(244, 114, 182, 0.04) 50%, 
    transparent 70%
  );
}

/* Shell sits above the shader */
.shell {
  position: relative;
  z-index: 1;
  padding: var(--frame) var(--frame) 0;
  background: transparent;
}

/* Hero is fully transparent — shader shows through */
.hero {
  position: relative;
  z-index: 1;
  isolation: isolate;
  background: transparent !important;
}

.hero .hero-grid {
  position: relative;
  z-index: 3;
}

/*
 * main background: transparent for the hero viewport, then smooth fade to solid.
 * Multi-stop gradient creates seamless transition without dark band.
 */
.home-page main {
  background: linear-gradient(
    to bottom, 
    transparent calc(100vh - 200px),
    rgba(10, 10, 10, 0.3) calc(100vh - 100px),
    rgba(10, 10, 10, 0.7) calc(100vh - 50px),
    #0a0a0a calc(100vh - 12px)
  );
  transition: background 0.5s var(--ease);
}
[data-theme="light"] .home-page main {
  background: linear-gradient(
    to bottom, 
    transparent calc(100vh - 200px),
    rgba(250, 248, 245, 0.3) calc(100vh - 100px),
    rgba(250, 248, 245, 0.7) calc(100vh - 50px),
    #faf8f5 calc(100vh - 12px)
  );
}
@media(max-width:860px) {
  /* No frame padding on mobile */
  .home-page main {
    background: linear-gradient(
      to bottom, 
      transparent calc(100vh - 200px),
      rgba(10, 10, 10, 0.3) calc(100vh - 100px),
      rgba(10, 10, 10, 0.7) calc(100vh - 50px),
      #0a0a0a 100vh
    );
    transition: background 0.5s var(--ease);
  }
  [data-theme="light"] .home-page main {
    background: linear-gradient(
      to bottom, 
      transparent calc(100vh - 200px),
      rgba(250, 248, 245, 0.3) calc(100vh - 100px),
      rgba(250, 248, 245, 0.7) calc(100vh - 50px),
      #faf8f5 100vh
    );
  }
}

/* about/projects pages — no shader, solid bg via body::before */
.about-page,
.projects-page {
  background-color: transparent;
}

/* ── FRAME RAILS ─────────────────────────── */
.rail{position:fixed;background:rgba(10,10,10,0.88);z-index:60;pointer-events:none;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);transition:background 0.5s var(--ease)}
[data-theme="light"] .rail{background:rgba(250,248,245,0.88)}
.rail-t{top:0;left:0;right:0;height:var(--frame)}
.rail-l{top:var(--frame);left:0;bottom:0;width:var(--frame)}
.rail-r{top:var(--frame);right:0;bottom:0;width:var(--frame)}
@media(max-width:860px){.rail{display:none}}

/* ── SKIP LINK ───────────────────────────── */
.skip{position:absolute;top:-9em;left:1em;padding:.5em 1em;background:var(--fg);color:var(--bg);border-radius:.5em;font-size:.85em;z-index:999;transition:top .2s}
.skip:focus{top:1em}

/* ── PAGE SHELL ──────────────────────────── */
.wrap{max-width:var(--max);margin:0 auto;padding:0 28px}

/* ── NAV ─────────────────────────────────── */
.nav{position:fixed;top:20px;left:50%;transform:translateX(-50%);z-index:100}
.nav-pill{
  position:relative;display:flex;align-items:center;gap:2px;
  background:rgba(5,5,5,0.4);
  border:1px solid rgba(255,255,255,0.06);
  border-radius:100px;
  padding:5px;
  backdrop-filter:blur(32px) saturate(180%);
  -webkit-backdrop-filter:blur(32px) saturate(180%);
  box-shadow:
    inset 0 1px 0 0 rgba(255,255,255,0.08),
    inset 0 -1px 0 0 rgba(0,0,0,0.5),
    0 8px 32px rgba(0,0,0,0.4),
    0 1px 2px rgba(0,0,0,0.3);
  transition: all 0.3s var(--ease), background 0.5s var(--ease), border-color 0.5s var(--ease);
}
.nav-pill:hover {
  background:rgba(5,5,5,0.55);
  border-color:rgba(255,255,255,0.1);
  box-shadow:
    inset 0 1px 0 0 rgba(255,255,255,0.12),
    inset 0 -1px 0 0 rgba(0,0,0,0.6),
    0 12px 40px rgba(0,0,0,0.35),
    0 2px 4px rgba(0,0,0,0.4);
}
[data-theme="light"] .nav-pill{
  background:rgba(255,255,255,0.5);border:1px solid rgba(0,0,0,0.04);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.9), inset 0 -1px 0 0 rgba(0,0,0,0.02), 0 8px 32px rgba(0,0,0,0.04)
}
[data-theme="light"] .nav-pill:hover{
  background:rgba(255,255,255,0.65);
  border-color:rgba(0,0,0,0.08);
}
.nav-ind{
  position:absolute;border-radius:100px;
  background:rgba(255,255,255,0.09);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.12), 0 1px 3px rgba(0,0,0,0.3);
  transition:left .42s var(--spring),top .42s var(--spring),width .42s var(--spring),height .42s var(--spring);
  pointer-events:none
}
[data-theme="light"] .nav-ind{
  background:rgba(0,0,0,0.06);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.9), 0 1px 3px rgba(0,0,0,0.06)
}
.nav-a{
  position:relative;z-index:1;
  display:flex;align-items:center;gap:6px;
  padding:7px 16px;border-radius:100px;
  font-size:13px;font-weight:500;color:rgba(255,255,255,0.45);
  transition:color .25s var(--ease);white-space:nowrap;text-decoration:none
}
.nav-a:hover,.nav-a.on{color:rgba(255,255,255,0.95)}
[data-theme="light"] .nav-a{color:rgba(0,0,0,0.45)}
[data-theme="light"] .nav-a:hover,[data-theme="light"] .nav-a.on{color:rgba(0,0,0,0.9)}
/* Icon inside nav link */
.nav-icon{
  width:14px;height:14px;flex-shrink:0;
  stroke-width:2;
  opacity:0.7;
  transition:opacity .25s var(--ease)
}
.nav-a:hover .nav-icon,.nav-a.on .nav-icon{opacity:1}
.nav-sep{width:1px;height:18px;background:rgba(255,255,255,0.08);flex-shrink:0;margin:0 2px}
[data-theme="light"] .nav-sep{background:rgba(0,0,0,0.08)}
.theme-btn{
  width:34px;height:34px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  font-size:15px;color:rgba(255,255,255,0.7);flex-shrink:0;
  transition:color .25s,background .25s,transform .2s var(--spring)
}
.theme-btn svg{display:block;flex-shrink:0}
.theme-btn:hover{color:rgba(255,255,255,0.95);background:rgba(255,255,255,0.08);transform:rotate(20deg) scale(1.1)}
[data-theme="light"] .theme-btn{color:rgba(0,0,0,0.6)}
[data-theme="light"] .theme-btn:hover{color:rgba(0,0,0,0.9);background:rgba(0,0,0,0.06);transform:rotate(-20deg) scale(1.1)}

/* ── TUBELIGHT NAV ───────────────────────── */
.nav-tubelight {
  position: absolute;
  /* sits just above the top edge of .nav-pill */
  bottom: calc(100% + 3px);
  height: 2px;
  border-radius: 100px;
  background: #ffffff;
  pointer-events: none;
  overflow: visible;
  /* spring transition — matches .nav-ind timing */
  transition:
    left    0.42s cubic-bezier(0.34,1.56,0.64,1),
    width   0.42s cubic-bezier(0.34,1.56,0.64,1),
    opacity 0.28s ease;
  /* Only a crisp tight bar glow — no wide horizontal blob */
  box-shadow:
    0 0 3px 1px  rgba(255,255,255,1.0),
    0 0 7px 2px  rgba(255,255,255,0.75);
}
/* Smooth triangular light cone spreading downward */
.nav-tubelight::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 280%;
  height: 120px;
  pointer-events: none;
  /* Symmetric cone: bright at top-centre, smooth falloff to edges and bottom */
  background: radial-gradient(
    ellipse 42% 88% at 50% 0%,
    rgba(255,255,255,0.60) 0%,
    rgba(255,255,255,0.32) 22%,
    rgba(255,255,255,0.10) 52%,
    rgba(255,255,255,0.02) 72%,
    transparent 88%
  );
  filter: blur(4px);
}
/* Light theme — dark charcoal bar + cone */
[data-theme="light"] .nav-tubelight {
  background: rgba(10,10,12,0.6);
  box-shadow:
    0 0 3px 1px  rgba(0,0,0,0.50),
    0 0 7px 2px  rgba(0,0,0,0.28);
}
[data-theme="light"] .nav-tubelight::after {
  background: radial-gradient(
    ellipse 42% 88% at 50% 0%,
    rgba(0,0,0,0.38) 0%,
    rgba(0,0,0,0.18) 22%,
    rgba(0,0,0,0.06) 52%,
    rgba(0,0,0,0.01) 72%,
    transparent 88%
  );
}
/* Hide on mobile — pill is hidden there */
@media (max-width: 600px) {
  .nav-tubelight { display: none; }
}

/* ── DIVIDER ─────────────────────────────── */
.hr{
  height:1px;
  background:linear-gradient(90deg,transparent 0%,rgba(251,146,60,0.38) 28%,rgba(251,146,60,0.55) 50%,rgba(251,146,60,0.38) 72%,transparent 100%);
  position:relative;z-index:2;
  box-shadow:0 0 16px rgba(251,146,60,0.1);
}
[data-theme="light"] .hr{
  background:linear-gradient(90deg,transparent 0%,rgba(251,146,60,0.22) 28%,rgba(251,146,60,0.38) 50%,rgba(251,146,60,0.22) 72%,transparent 100%);
  box-shadow:0 0 10px rgba(251,146,60,0.07);
}

/* ── Light Rays background effect ─────────────────────────────────────
   Injected by light-rays.js into every section except .hero.
   .lr-wrap clips the rays; .lr-ray is each animated beam.             */
.lr-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.lr-ray {
  position: absolute;
  top: -8%;
  transform-origin: top center;
  transform: translateX(-50%) rotate(var(--lr-rot, 0deg));
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(160, 210, 255, 0.18) 15%,
    rgba(160, 210, 255, 0.18) 85%,
    transparent 100%
  );
  opacity: 0;
  animation: lr-pulse ease-in-out infinite;
  will-change: opacity, transform;
}
@keyframes lr-pulse {
  0%, 100% {
    opacity: 0;
    transform: translateX(-50%) rotate(var(--lr-rot, 0deg));
  }
  30%, 70% {
    opacity: var(--lr-op, 0.55);
    transform: translateX(-50%) rotate(calc(var(--lr-rot, 0deg) + 2deg));
  }
}
/* In light mode rays are barely visible — keep it minimal */
[data-theme="light"] .lr-ray {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(100, 140, 200, 0.06) 15%,
    rgba(100, 140, 200, 0.06) 85%,
    transparent 100%
  );
}
/* section content must sit above the ray layer */
.sec > *:not(.lr-wrap),
.lwt-section > *:not(.lr-wrap),
.connect > *:not(.lr-wrap) {
  position: relative;
  z-index: 1;
}
/* ─────────────────────────────────────────────────────────────────── */

/* ── SECTION SPACING ─────────────────────── */
.sec{
  padding:96px 0;
  position:relative;
  z-index:2;
  background:rgba(5,5,5,0.3);
  backdrop-filter:blur(40px) saturate(180%);
  -webkit-backdrop-filter:blur(40px) saturate(180%);
  border-top:1px solid rgba(255,255,255,0.04);
  border-bottom:1px solid rgba(255,255,255,0.04);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.02), inset 0 -1px 0 0 rgba(0,0,0,0.3);
  transition:background 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.sec-sm{
  padding:64px 0;
  position:relative;
  z-index:2;
  background:rgba(5,5,5,0.25);
  backdrop-filter:blur(40px) saturate(180%);
  -webkit-backdrop-filter:blur(40px) saturate(180%);
  border-top:1px solid rgba(255,255,255,0.04);
  border-bottom:1px solid rgba(255,255,255,0.04);
  transition:background 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
[data-theme="light"] .sec,
[data-theme="light"] .sec-sm{
  background:rgba(255,255,255,0.4);
  border-color:rgba(0,0,0,0.04);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.9), inset 0 -1px 0 0 rgba(0,0,0,0.02);
}

/* ── LABEL ───────────────────────────────── */
.label{
  display:block;font-family:var(--mono);font-size:10.5px;font-weight:500;
  text-transform:uppercase;letter-spacing:.18em;color:var(--muted);margin-bottom:8px;
  transition:color 0.5s var(--ease);
}
.label strong, .lwt-eyebrow strong {
  font-weight: 800;
  color: var(--fg);
}

/* ── SHINY TEXT GLOBAL TRANSITION ─────────── */
.shiny-text {
  transition: filter 0.5s var(--ease);
}

/* ── CIRCLE-SPREAD VIEW TRANSITION ───────── */
/* Suppress the default crossfade so our JS clip-path animation runs cleanly */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* Smooth transition for all shiny text during theme change */
html.theme-transitioning .shiny-text {
  opacity: 0.95;
  transition: opacity 0.3s var(--ease), filter 0.5s var(--ease);
}

/* ── HEADING STYLES ──────────────────────── */
.h-xl{
  font-family:var(--headline);font-size:clamp(48px,8vw,80px);
  font-weight:700;line-height:1.06;letter-spacing:-.03em
}
.h-lg{
  font-family:var(--headline);font-size:clamp(36px,5vw,54px);
  font-weight:700;line-height:1.1;letter-spacing:-.025em
}
.h-md{font-family:var(--headline);font-size:clamp(20px,3vw,28px);font-weight:700;font-style:italic;line-height:1.3}
.h-xl em,.h-lg em,.h-md em{font-style:italic;font-weight:500}

/* ── BUTTONS ─────────────────────────────── */
.btn-p{
  display:inline-flex;align-items:center;gap:8px;
  padding:11px 24px;background:var(--fg);color:var(--bg);
  border-radius:100px;font-size:13.5px;font-weight:600;
  border:1px solid transparent;
  transition:opacity .22s,transform .22s
}
.btn-p:hover{opacity:.84;transform:translateY(-1px)}

.btn-s{
  display:inline-flex;align-items:center;gap:8px;
  padding:11px 24px;border:1px solid rgba(255,255,255,0.06);
  background:rgba(255,255,255,0.02);
  border-radius:100px;font-size:13.5px;font-weight:500;color:var(--fg);
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.06), inset 0 -1px 0 0 rgba(0,0,0,0.25), 0 4px 12px rgba(0,0,0,0.15);
  transition:background .22s,border-color .22s,transform .22s,box-shadow .22s
}
.btn-s:hover{
  background:rgba(255,255,255,0.06);
  border-color:rgba(255,255,255,0.15);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.15), inset 0 -1px 0 0 rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.25);
  transform:translateY(-2px)
}
[data-theme="light"] .btn-s{
  background:rgba(255,255,255,0.55);border-color:rgba(0,0,0,0.05);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.85), inset 0 -1px 0 0 rgba(0,0,0,0.02), 0 4px 12px rgba(0,0,0,0.02);
}
[data-theme="light"] .btn-s:hover{
  background:rgba(255,255,255,0.75);border-color:rgba(0,0,0,0.09);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.95), inset 0 -1px 0 0 rgba(0,0,0,0.03), 0 8px 24px rgba(0,0,0,0.04);
}

/* ── HERO ────────────────────────────────── */
.hero{min-height:100vh;display:flex;align-items:center;padding:80px 0 0}
.hero-grid{display:grid;grid-template-columns:1fr 280px;gap:52px;align-items:center}
.hero-eyebrow{font-size:14px;font-weight:500;color:rgba(255,255,255,0.85);margin-bottom:18px;display:block;text-shadow:0 1px 8px rgba(0,0,0,0.5);transition:color 0.5s var(--ease), text-shadow 0.5s var(--ease)}
[data-theme="light"] .hero-eyebrow{color:rgba(0,0,0,0.65);text-shadow:none}
.hero-desc{font-family:var(--body);font-size:15px;max-width:400px;margin-top:18px;line-height:1.78;color:rgba(255,255,255,0.72);text-shadow:0 1px 10px rgba(0,0,0,0.5);transition:color 0.5s var(--ease), text-shadow 0.5s var(--ease)}
[data-theme="light"] .hero-desc{color:rgba(0,0,0,0.82);text-shadow:none}
.hero-desc strong { color: var(--fg); font-weight: 700; }
.hero-ctas{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:28px}

/* ── RESUME BUTTON ───────────────────────── */
.btn-resume {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 9px 18px;
  background: var(--fg);
  color: var(--bg);
  border-radius: 8px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: opacity .22s, transform .22s, box-shadow .22s;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
  white-space: nowrap;
}
.btn-resume:hover { opacity: .85; transform: translateY(-1px); box-shadow: 0 5px 16px rgba(0,0,0,.4); }
[data-theme="light"] .btn-resume { background: #0e0e10; color: #faf8f5; }

/* ── CONTACT ME DROPDOWN ─────────────────── */
.contact-dropdown-wrap {
  position: relative;
}

.btn-contact-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.06), 0 2px 10px rgba(0,0,0,.15);
  transition: background .22s, border-color .22s, transform .22s;
  white-space: nowrap;
}
.btn-contact-toggle:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}
.btn-contact-toggle .chevron-icon {
  transition: transform .25s var(--ease);
  flex-shrink: 0;
  opacity: 0.7;
}
.btn-contact-toggle[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}
[data-theme="light"] .btn-contact-toggle {
  background: rgba(255,255,255,0.55);
  border-color: rgba(0,0,0,0.07);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.85), 0 2px 10px rgba(0,0,0,.04);
}
[data-theme="light"] .btn-contact-toggle:hover {
  background: rgba(255,255,255,0.75);
  border-color: rgba(0,0,0,0.12);
}

.contact-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: unset;
  width: max-content;
  background: #0e0e0e;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.6);
  z-index: 200;
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  pointer-events: none;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
  display: flex;
  flex-direction: row;
  gap: 3px;
}
.contact-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
[data-theme="light"] .contact-dropdown {
  background: #efefef;
  border-color: rgba(0,0,0,0.07);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
}

.contact-dropdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 9px;
  color: rgba(255,255,255,0.5);
  transition: background .15s, color .15s, transform .15s;
  cursor: pointer;
  text-decoration: none;
  min-width: 58px;
  text-align: center;
}
.contact-dropdown-item:hover {
  background: transparent;
  color: rgba(255,255,255,0.85);
  transform: translateY(-1px);
}
[data-theme="light"] .contact-dropdown-item {
  color: rgba(0,0,0,0.4);
}
[data-theme="light"] .contact-dropdown-item:hover {
  background: transparent;
  color: rgba(0,0,0,0.8);
}

.cdi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .15s var(--ease);
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.06);
}
.contact-dropdown-item:hover .cdi-icon {
  transform: scale(1.06);
}

/* Each icon has its own brand color on a shared dark tile */
.cdi-call     { color: #4a90d9; }
.cdi-whatsapp { color: #25d366; }
.cdi-email    { color: #e06060; }
.cdi-linkedin { color: #0a8fd1; }

[data-theme="light"] .cdi-icon {
  background: #e4e4e4;
  border-color: rgba(0,0,0,0.06);
}
[data-theme="light"] .cdi-call     { color: #2563a8; }
[data-theme="light"] .cdi-whatsapp { color: #1a7a3c; }
[data-theme="light"] .cdi-email    { color: #b91c1c; }
[data-theme="light"] .cdi-linkedin { color: #0a5fa3; }

.cdi-icon svg, .cdi-icon img { width: 18px; height: 18px; }

.cdi-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cdi-label {
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .07em;
  line-height: 1;
  color: inherit;
}
.cdi-sub { display: none; }

/* Projects page header */
.projects-header{padding:clamp(88px,12vw,120px) 0 clamp(36px,5vw,56px);text-align:center}

/* Hero h1 — bold white with shiny sweep (dark) / dark shiny (light) */
.hero .h-xl.shiny-text {
  font-weight: 700;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.75) 20%,
    rgba(255, 255, 255, 1)    40%,
    rgba(220, 240, 255, 1)    50%,
    rgba(255, 255, 255, 1)    60%,
    rgba(255, 255, 255, 0.75) 80%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shiny-sweep 5s linear infinite;
  filter: drop-shadow(0 2px 20px rgba(255,255,255,0.15));
  transition: filter 0.5s var(--ease);
  /* Prevent gradient flicker during theme transition */
  will-change: filter;
}
[data-theme="light"] .hero .h-xl.shiny-text {
  background: linear-gradient(
    120deg,
    rgba(14, 14, 16, 0.6)  20%,
    rgba(14, 14, 16, 1)    40%,
    rgba(80,  60, 20, 1)   50%,
    rgba(14, 14, 16, 1)    60%,
    rgba(14, 14, 16, 0.6)  80%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shiny-sweep 5s linear infinite;
  filter: none;
}

/* Smooth gradient transition during theme change */
html.theme-transitioning .hero .h-xl.shiny-text {
  animation-play-state: paused;
  opacity: 0.95;
  transition: opacity 0.3s var(--ease), filter 0.5s var(--ease);
}

/* Portrait */
.portrait{position:relative;width:280px;height:340px;flex-shrink:0;cursor:pointer}
.portrait-ring{
  position:absolute;inset:-9px;border-radius:calc(var(--r)+9px);
  border:1px solid var(--border);pointer-events:none;
  transition:border-color .6s var(--ease), transform .6s var(--ease), box-shadow .6s var(--ease);
  animation:pulse 5s ease-in-out infinite
}
@keyframes pulse{0%,100%{opacity:.35}50%{opacity:.75}}
.portrait img{
  width:100%;height:100%;object-fit:cover;object-position:center top;
  border-radius:var(--r);
  display:block;will-change:transform, filter;
  filter: grayscale(100%) contrast(1.1) brightness(0.95);
  transition:transform .6s var(--ease), filter .6s var(--ease), box-shadow .6s var(--ease);
}
.portrait:hover img{
  filter: grayscale(0%) contrast(1.05) brightness(1.05);
  transform: scale(1.04);
  box-shadow: 0 12px 32px rgba(251, 146, 60, 0.3);
}
.portrait:hover .portrait-ring{
  border-color: var(--border);
  transform: scale(1.02);
}
.portrait-fb{
  position:absolute;inset:0;border-radius:var(--r);border:1px solid var(--border);
  background:linear-gradient(160deg,#111 0%,#1a1a2e 100%);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px
}
.portrait-fb span:first-child{font-family:var(--headline);font-size:52px;font-weight:300;color:rgba(255,255,255,.8);line-height:1}
.portrait-fb span:last-child{font-family:var(--mono);font-size:9px;color:rgba(255,255,255,.3);text-transform:uppercase;letter-spacing:.12em}

/* ── PROJECT CARDS (home grid) ───────────── */
.proj-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:36px}
@media(max-width:600px){.proj-grid{grid-template-columns:1fr}}

.proj-card{
  border:1px solid var(--border);border-radius:var(--r);
  overflow:hidden;background:var(--card);
  box-shadow: var(--shadow);
  transition:background .28s,transform .32s var(--ease),box-shadow .32s var(--ease),border-color .28s
}
.proj-card:hover{background:var(--card-hover);transform:translateY(-5px);box-shadow:var(--shadow-lg);border-color:var(--border-hover)}

.proj-img{width:100%;aspect-ratio:16/10;overflow:hidden;position:relative}
.proj-img-in{
  width:100%;height:100%;display:flex;align-items:center;justify-content:center;
  transition:transform .5s var(--ease)
}
.proj-card:hover .proj-img-in{transform:scale(1.06)}

.proj-body{padding:20px 22px 22px}
.proj-client{
  display:block;font-family:var(--mono);font-size:10px;font-weight:500;
  text-transform:uppercase;letter-spacing:.15em;color:var(--muted);margin-bottom:10px
}
.proj-title{font-family:var(--headline);font-size:15.5px;font-weight:300;font-style:italic;line-height:1.45;margin-bottom:8px}
.proj-desc{font-size:13px;color:var(--muted);line-height:1.68;margin-bottom:14px}
.proj-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.proj-role{font-family:var(--mono);font-size:10.5px;color:var(--muted)}
.proj-arrow{font-size:12px;font-weight:600;color:var(--fg);opacity:0;transition:opacity .25s,letter-spacing .25s}
.proj-card:hover .proj-arrow{opacity:1}

/* ── PROJECT LIST (projects page) ────────── */
.proj-list-item{padding:52px 0;border-bottom:1px solid var(--border)}
.proj-list-item:first-of-type{padding-top:0}
.proj-list-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}
.proj-list-img{
  width:100%;aspect-ratio:16/8;border-radius:var(--r);
  overflow:hidden;border:1px solid var(--border);margin-bottom:24px
}
.proj-list-img-in{width:100%;height:100%;display:flex;align-items:center;justify-content:center;transition:transform .5s var(--ease)}
.proj-list-item:hover .proj-list-img-in{transform:scale(1.025)}
.proj-list-h{font-family:var(--headline);font-size:clamp(20px,2.8vw,28px);font-weight:500;font-style:italic;line-height:1.3;margin-bottom:12px}
.proj-list-p{font-size:15px;color:var(--fg-2);line-height:1.8;margin-bottom:14px}
.proj-list-role{font-family:var(--mono);font-size:11px;color:var(--muted)}
.tags{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}
.tag{
  font-size:11px;font-family:var(--mono);font-weight:500;
  padding:4px 12px;border-radius:100px;
  background:var(--tag);border:1px solid var(--border);color:var(--muted)
}
.proj-ext{
  display:inline-flex;align-items:center;gap:6px;padding:7px 16px;
  border:1px solid var(--border);border-radius:100px;
  font-size:12.5px;font-weight:600;color:var(--fg);
  transition:background .22s,border-color .22s
}
.proj-ext:hover{background:var(--tag);border-color:var(--border-hover)}

/* ── LET'S WORK TOGETHER ────────────────── */
.lwt-section {
  position: relative;
  padding: 100px 0 96px;
  text-align: center;
  overflow: hidden;
  z-index: 2;
  background: rgba(5,5,5,0.35);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-top: 1px solid rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
[data-theme="light"] .lwt-section {
  background: rgba(255,255,255,0.45);
  border-color: rgba(0,0,0,0.04);
}

/* Grid background removed */
.lwt-bg-grid { display: none; }

.lwt-wrap { position: relative; z-index: 1; }

.lwt-eyebrow {
  display: block;        /* was inline-block — block guarantees its own line */
  width: 100%;
  text-align: center;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
  transition: color 0.5s var(--ease);
}

.lwt-heading {
  font-family: var(--headline);
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.05;
  margin-bottom: 28px;
  /* shiny sweep matching portfolio style */
  background: linear-gradient(
    120deg,
    rgba(255,255,255,0.65) 20%,
    rgba(255,255,255,1)    40%,
    rgba(220,240,255,1)    50%,
    rgba(255,255,255,1)    60%,
    rgba(255,255,255,0.65) 80%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shiny-sweep 5s linear infinite;
  filter: drop-shadow(0 2px 20px rgba(255,255,255,0.1));
}
[data-theme="light"] .lwt-heading {
  background: linear-gradient(
    120deg,
    rgba(14,14,16,0.55) 20%,
    rgba(14,14,16,1)    40%,
    rgba(80,60,20,1)    50%,
    rgba(14,14,16,1)    60%,
    rgba(14,14,16,0.55) 80%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shiny-sweep 5s linear infinite;
  filter: none;
}

.lwt-desc {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.85;
  color: var(--fg-2);
  margin-bottom: 40px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  transition: color 0.5s var(--ease);
}

.lwt-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.lwt-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  transition: opacity .2s, transform .2s, box-shadow .2s;
  white-space: nowrap;
}
.lwt-btn:hover { transform: translateY(-2px); }

.lwt-btn-primary {
  background: var(--fg);
  color: var(--bg);
  border: 1px solid transparent;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.lwt-btn-primary:hover { opacity: .85; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
[data-theme="light"] .lwt-btn-primary { background: #0e0e10; color: #faf8f5; }

.lwt-btn-secondary {
  background: transparent;
  color: var(--fg);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.06), 0 2px 10px rgba(0,0,0,.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lwt-btn-secondary:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.25);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.12), 0 6px 18px rgba(0,0,0,.25);
}
[data-theme="light"] .lwt-btn-secondary {
  border-color: rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.5);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.85), 0 2px 10px rgba(0,0,0,.04);
}
[data-theme="light"] .lwt-btn-secondary:hover {
  background: rgba(255,255,255,0.75);
  border-color: rgba(0,0,0,0.18);
}

/* ── MAGNETIC BUTTON WRAPPER ─────────────── */
.magnetic-wrap {
  /* Larger invisible hit area — pull starts before cursor touches button */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  margin: -20px;
  cursor: pointer;
}
/* GPU-composite the transform so the browser never triggers layout */
.magnetic-wrap [data-magnetic-inner] {
  will-change: transform;
}
/* Disable the generic lwt-btn:hover translateY — JS drives the transform */
.magnetic-wrap .lwt-btn:hover {
  transform: none;
}
.magnetic-wrap:hover [data-magnetic-inner].lwt-btn-primary {
  opacity: .85;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}

.lwt-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.lwt-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  transition: color .2s;
}
.lwt-link:hover { color: var(--fg); }
.lwt-dot {
  color: var(--muted);
  font-size: 14px;
  opacity: 0.4;
  line-height: 1;
}

@media (max-width: 600px) {
  .lwt-heading { font-size: clamp(28px, 9vw, 48px); }
  .lwt-desc br { display: none; }
  .lwt-links { gap: 10px; }
  .lwt-dot { display: none; }
  .lwt-links { flex-direction: column; gap: 8px; }
}

/* ── CONNECT SECTION ─────────────────────── */
.connect{
  padding:96px 0;
  border-top:1px solid rgba(255,255,255,0.04);
  text-align:center;
  position:relative;
  z-index:2;
  background:rgba(5,5,5,0.3);
  backdrop-filter:blur(40px) saturate(180%);
  -webkit-backdrop-filter:blur(40px) saturate(180%);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.02);
  transition:background 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
[data-theme="light"] .connect{
  background:rgba(255,255,255,0.4);
  border-color:rgba(0,0,0,0.04);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.9);
}
.connect-h { text-align: center; margin-bottom: 48px; font-size: clamp(24px, 3.5vw, 36px); }
.connect-p{font-size:15.5px;color:var(--fg-2);line-height:1.78;max-width:440px;margin:0 auto 36px}
.connect-ctas{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;margin-bottom:32px}
.connect-icons{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap}
.icon-btn{
  width:40px;height:40px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  border:1px solid rgba(255,255,255,0.06);color:var(--muted);
  background:rgba(255,255,255,0.02);
  backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.05), 0 2px 8px rgba(0,0,0,0.1);
  transition:color .22s,background .22s,border-color .22s,box-shadow .22s,transform .22s
}
.icon-btn svg{width:17px;height:17px}
.icon-btn:hover{
  color:var(--fg);background:rgba(255,255,255,0.06);
  border-color:rgba(255,255,255,0.15);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.15), 0 4px 12px rgba(0,0,0,0.2);
  transform:translateY(-2px)
}
[data-theme="light"] .icon-btn{
  background:rgba(255,255,255,0.5);border-color:rgba(0,0,0,0.04);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.8), 0 2px 8px rgba(0,0,0,0.02);
}
[data-theme="light"] .icon-btn:hover{
  background:rgba(255,255,255,0.75);border-color:rgba(0,0,0,0.08);
}

/* copy email btn state */
.copy-ok{background:#16a34a!important;color:#fff!important;border-color:#16a34a!important}

/* ── ASCII WAVE ──────────────────────────── */
#ascii-wave-container{
  width:100%;
  height:128px;
  overflow:hidden;
  display:block;
  background:var(--bg);
  transition:background 0.5s var(--ease);
}
@media(max-width:600px){
  #ascii-wave-container{height:80px}
}

/* ── FOOTER ──────────────────────────────── */
.footer{
  border-top:1px solid rgba(255,255,255,0.06);
  padding:64px 0 48px;
  position:relative;
  z-index:2;
  background:rgba(5,5,5,0.35);
  backdrop-filter:blur(40px) saturate(180%);
  -webkit-backdrop-filter:blur(40px) saturate(180%);
  transition:background 0.5s var(--ease), border-color 0.5s var(--ease);
}
[data-theme="light"] .footer{
  background:rgba(255,255,255,0.45);
  border-color:rgba(0,0,0,0.06);
}

.footer-grid{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:48px;
  margin-bottom:48px;
}

.footer-col h3{
  font-family:var(--mono);
  font-size:10px;
  font-weight:600;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:18px;
  transition:color 0.5s var(--ease);
}

.footer-links{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.footer-link{
  font-family:var(--body);
  font-size:14px;
  color:var(--fg-2);
  transition:color .22s,transform .22s;
  display:inline-block;
  width:fit-content;
}
.footer-link:hover{
  color:var(--fg);
  transform:translateX(4px);
}

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

.footer-info-item{
  font-family:var(--body);
  font-size:13.5px;
  color:var(--fg-2);
  line-height:1.6;
  transition:color 0.5s var(--ease);
}

.footer-info-item a{
  color:var(--fg);
  transition:color .22s;
  text-decoration:underline;
  text-decoration-color:rgba(255,255,255,0.2);
  text-underline-offset:3px;
}
.footer-info-item a:hover{
  text-decoration-color:var(--fg);
}
[data-theme="light"] .footer-info-item a{
  text-decoration-color:rgba(0,0,0,0.2);
}

.footer-location{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.footer-location-city{
  font-family:var(--body);
  font-size:14px;
  font-weight:600;
  color:var(--fg);
  transition:color 0.5s var(--ease);
}

.footer-location-time{
  font-family:var(--mono);
  font-size:12px;
  color:var(--muted);
  transition:color 0.5s var(--ease);
}

.footer-bottom{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding-top:32px;
  border-top:1px solid rgba(255,255,255,0.06);
  flex-wrap:wrap;
  gap:16px;
}
[data-theme="light"] .footer-bottom{
  border-color:rgba(0,0,0,0.06);
}

.footer-copyright{
  font-family:var(--mono);
  font-size:11.5px;
  color:var(--muted);
  transition:color 0.5s var(--ease);
}

.footer-back-top{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-family:var(--mono);
  font-size:11px;
  font-weight:600;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
  padding:8px 16px;
  border:1px solid rgba(255,255,255,0.08);
  border-radius:8px;
  background:rgba(255,255,255,0.03);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  transition:all .22s var(--ease);
}
.footer-back-top:hover{
  color:var(--fg);
  background:rgba(255,255,255,0.06);
  border-color:rgba(255,255,255,0.15);
  transform:translateY(-2px);
}
[data-theme="light"] .footer-back-top{
  background:rgba(255,255,255,0.5);
  border-color:rgba(0,0,0,0.08);
}
[data-theme="light"] .footer-back-top:hover{
  background:rgba(255,255,255,0.75);
  border-color:rgba(0,0,0,0.14);
}

.footer-back-top svg{
  width:14px;
  height:14px;
  transition:transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink:0;
}
.footer-back-top:hover svg{
  transform:translateY(-4px);
  animation:bounce-up 0.6s ease-in-out;
}

@keyframes bounce-up {
  0%, 100% { transform: translateY(-4px); }
  50% { transform: translateY(-8px); }
}

/* Mobile footer */
@media(max-width:768px){
  .footer{padding:48px 0 36px;}
  .footer-grid{
    grid-template-columns:1fr;
    gap:36px;
    margin-bottom:36px;
  }
  .footer-bottom{
    flex-direction:column;
    align-items:center;
    text-align:center;
    gap:12px;
  }
}

@media(max-width:600px){
  .footer{padding:40px 0 32px;}
  .footer-grid{gap:28px;margin-bottom:28px;}
  .footer-col h3{font-size:9.5px;margin-bottom:14px;}
  .footer-link{font-size:13px;}
  .footer-info-item{font-size:12.5px;}
  .footer-location-time{font-size:11px;white-space:pre-line;}
}

@media(min-width:769px) and (max-width:960px){
  .footer-grid{
    grid-template-columns:repeat(2, 1fr);
    gap:40px;
  }
  .footer-col:last-child{
    grid-column:1 / -1;
  }
}

/* ── ABOUT PAGE ──────────────────────────── */
.about-hero{
  padding:clamp(88px,12vw,120px) 0 clamp(48px,6vw,72px);
  position:relative;
  z-index:2;
  background:rgba(5,5,5,0.3);
  backdrop-filter:blur(40px) saturate(180%);
  -webkit-backdrop-filter:blur(40px) saturate(180%);
  border-bottom:1px solid rgba(255,255,255,0.04);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.02);
  transition:background 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
[data-theme="light"] .about-hero{
  background:rgba(255,255,255,0.4);
  border-color:rgba(0,0,0,0.04);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.9);
}
.about-h{font-family:var(--headline);font-size:clamp(32px,6.5vw,64px);font-weight:700;line-height:1.08;letter-spacing:-.03em;margin-bottom:36px;transition:filter 0.5s var(--ease)}
.about-h strong{font-weight:600}

/* Diagonal rose→red→orange gradient on the about hero heading */
.about-h.shiny-text {
  background: linear-gradient(
    135deg,
    #F43F5E 0%,
    #EF4444 35%,
    #F97316 65%,
    #F43F5E 100%
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: about-gradient 15s ease infinite;
  filter: none;
}
@keyframes about-gradient {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}
[data-theme="light"] .about-h.shiny-text {
  background: linear-gradient(
    135deg,
    #E11D48 0%,
    #DC2626 35%,
    #EA580C 65%,
    #E11D48 100%
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: about-gradient 15s ease infinite;
  filter: none;
}
.about-bio{font-size:16px;color:var(--fg-2);line-height:1.85;max-width:660px;transition:color 0.5s var(--ease)}
.about-bio strong{color:var(--fg);font-weight:600;transition:color 0.5s var(--ease)}
.about-bio p+p{margin-top:20px}
.stats{display:flex;gap:40px;flex-wrap:wrap;margin-top:40px}
.stat-n{font-family:var(--headline);font-size:36px;font-weight:500;line-height:1;letter-spacing:-.03em;display:block;transition:color 0.5s var(--ease)}
.stat-l{font-family:var(--mono);font-size:10px;text-transform:uppercase;letter-spacing:.14em;color:var(--muted);display:block;margin-top:6px;transition:color 0.5s var(--ease)}

/* 2-col about grid */
.about2{display:grid;grid-template-columns:1fr 1fr;gap:60px;align-items:start}

/* Experience / Education lists */
.list-h{font-family:var(--headline);font-size:18px;font-weight:700;letter-spacing:-.01em;margin-bottom:22px}
.xp-item{
  display:flex;align-items:flex-start;gap:14px;padding:16px;
  background:rgba(5,5,5,0.4);
  border:1px solid rgba(255,255,255,0.06);border-radius:12px;
  margin-bottom:12px;
  backdrop-filter:blur(32px) saturate(180%);-webkit-backdrop-filter:blur(32px) saturate(180%);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.04), 0 4px 12px rgba(0,0,0,0.2);
  transition:all .3s var(--ease);
}
.xp-item:hover{
  background:rgba(5,5,5,0.55);
  border-color:rgba(251,146,60,0.3);
  transform:translateY(-2px);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.08), 0 8px 24px rgba(251,146,60,0.2);
}
.xp-item:last-child{margin-bottom:0}
[data-theme="light"] .xp-item{
  background:rgba(255,255,255,0.5);border-color:rgba(0,0,0,0.04);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.9), 0 4px 12px rgba(0,0,0,0.02);
}
[data-theme="light"] .xp-item:hover{
  background:rgba(255,255,255,0.7);border-color:rgba(251,146,60,0.2);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.95), 0 8px 24px rgba(251,146,60,0.1);
}
.xp-logo{
  width:38px;height:38px;border-radius:9px;border:1px solid var(--border);
  background:var(--tag);display:flex;align-items:center;justify-content:center;
  font-size:11px;font-weight:700;flex-shrink:0;overflow:hidden;font-family:var(--sans);color:var(--fg)
}
.xp-logo img{width:22px;height:22px;object-fit:contain}
.xp-body{flex:1;min-width:0}
.xp-co{font-family:var(--body);font-size:14px;font-weight:600;line-height:1.3;color:var(--fg)}
.xp-role{font-family:var(--body);font-size:13px;color:var(--fg-2);margin-top:3px;line-height:1.4}
.xp-date{font-family:var(--mono);font-size:10.5px;color:var(--muted);flex-shrink:0;padding-top:3px}

/* Skills */
.skills{display:flex;flex-wrap:wrap;gap:10px}
.skill{
  font-size:13px;font-weight:500;padding:8px 18px;
  border:1px solid rgba(255,255,255,0.06);border-radius:100px;
  background:rgba(5,5,5,0.4);color:var(--fg);cursor:default;
  backdrop-filter:blur(32px) saturate(180%);-webkit-backdrop-filter:blur(32px) saturate(180%);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.04), 0 2px 8px rgba(0,0,0,0.15);
  transition:all .25s var(--ease);
}
.skill:hover{
  background:linear-gradient(135deg, rgba(251,146,60,0.15), rgba(250,204,21,0.15));
  border-color:rgba(251,146,60,0.4);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.08), 0 4px 12px rgba(251,146,60,0.25);
  transform:translateY(-2px);
}
[data-theme="light"] .skill{
  background:rgba(255,255,255,0.5);border-color:rgba(0,0,0,0.04);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.9), 0 2px 8px rgba(0,0,0,0.02);
}
[data-theme="light"] .skill:hover{
  background:linear-gradient(135deg, rgba(251,146,60,0.1), rgba(250,204,21,0.1));
  border-color:rgba(251,146,60,0.3);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.95), 0 4px 12px rgba(251,146,60,0.15);
}

/* Stack marquee */
.mq-wrap{overflow:hidden;position:relative}
.mq-wrap::before,.mq-wrap::after{
  content:'';position:absolute;top:0;bottom:0;width:80px;z-index:2;pointer-events:none
}
.mq-wrap::before{left:0;background:linear-gradient(90deg,var(--bg),transparent)}
.mq-wrap::after{right:0;background:linear-gradient(-90deg,var(--bg),transparent)}
.mq-track{display:flex;gap:14px;width:max-content;animation:mq 30s linear infinite}
.mq-wrap:hover .mq-track{animation-play-state:paused}
@keyframes mq{0%{transform:translateX(0)}100%{transform:translateX(-50%)}}
.mq-item{
  display:flex;align-items:center;gap:10px;padding:10px 20px;
  border:1px solid var(--border);border-radius:100px;
  background:var(--card);white-space:nowrap;
  font-size:13px;font-weight:500
}
.mq-item img{width:20px;height:20px;object-fit:contain}

/* ── DEVELOPMENT STACK ───────────────────── */
.dev-stack-sec { padding: 80px 0; }

.dev-stack-heading {
  font-family: var(--headline);
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -.025em;
  margin-bottom: 48px;
  background: linear-gradient(
    120deg,
    rgba(255,255,255,0.7) 20%,
    rgba(255,255,255,1)   40%,
    rgba(220,240,255,1)   50%,
    rgba(255,255,255,1)   60%,
    rgba(255,255,255,0.7) 80%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shiny-sweep 5s linear infinite;
}
[data-theme="light"] .dev-stack-heading {
  background: linear-gradient(
    120deg,
    rgba(14,14,16,0.55) 20%,
    rgba(14,14,16,1)    40%,
    rgba(80,60,20,1)    50%,
    rgba(14,14,16,1)    60%,
    rgba(14,14,16,0.55) 80%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shiny-sweep 5s linear infinite;
}

.dev-stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 48px;
}

.dev-stack-col { display: flex; flex-direction: column; gap: 14px; }

.dev-stack-cat {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.5s var(--ease);
}

.dev-stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* individual tag */
.dst {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .2s, border-color .2s, color .2s, transform .2s, box-shadow .2s;
  cursor: default;
  white-space: nowrap;
  box-shadow: none;
}
.dst img, .dst svg {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
}
.dst:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.95);
  transform: translateY(-1px);
  box-shadow: none;
}
[data-theme="light"] .dst {
  border-color: rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.55);
  color: rgba(0,0,0,0.7);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.85), 0 1px 4px rgba(0,0,0,0.04);
}
[data-theme="light"] .dst:hover {
  background: rgba(255,255,255,0.8);
  border-color: rgba(0,0,0,0.14);
  color: rgba(0,0,0,0.9);
}
[data-theme="light"] .dst img { filter: none; }

/* highlighted tag (first in each group, like the image) */
.dst-active {
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.75);
  box-shadow: none;
}
[data-theme="light"] .dst-active {
  border-color: rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.55);
  color: rgba(0,0,0,0.7);
}

@media (max-width: 760px) {
  .dev-stack-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 28px; }
}
@media (max-width: 480px) {
  .dev-stack-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* Platforms grid */
.plat-grid{display:flex;flex-wrap:wrap;justify-content:center;gap:16px}
.plat-grid > .plat{flex:0 0 clamp(140px,22vw,164px)}
/* ── Outer wrapper — transparent, just holds the spotlight + inner card ── */
.plat{
  position:relative;
  display:flex;flex-direction:column;
  border-radius:var(--r);
  transition:transform .3s var(--ease);
  padding:4px;  /* gap so spotlight peeks around inner card edges */
}
/* ── Inner dark card — all visual styling lives here ── */
.plat-inner{
  position:relative;
  z-index:1;
  display:flex;flex-direction:column;align-items:center;gap:10px;
  padding:24px 16px;
  background:#0d0d0d;
  border:1px solid rgba(255,255,255,0.06);
  border-radius:calc(var(--r) - 3px);text-align:center;
  backdrop-filter:blur(32px) saturate(180%);-webkit-backdrop-filter:blur(32px) saturate(180%);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.04), 0 8px 24px rgba(0,0,0,0.2);
  transition:all .3s var(--ease);
  flex:1;width:100%;
}

/* ── Border-glow beam ─────────────────────────────────────────────────────
   10° conic-gradient cone aimed at the cursor via JS-set --plat-angle.
   Uses --plat-angle (not --ga) to avoid the @property --ga inherits:false
   conflict used by the project-card spin effect.
   Only the 1.5px padding ring is visible (mask-composite: exclude).     */
.plat::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--r) + 1px);
  padding: 1.5px;
  background: conic-gradient(
    from calc(var(--plat-angle, 0deg) - 5deg),
    transparent  0deg,
    #dc2626      2deg,     /* red   — leading edge   */
    #ff6500      5deg,     /* orange — cone peak      */
    #facc15      8deg,     /* yellow — trailing edge  */
    transparent 10deg,    /* 10° total (coneSpread=10) */
    transparent 360deg
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: var(--plat-glow-op, 0);
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 1;
}

/* Hover lift — on outer wrapper only */
.plat:hover{
  transform:translateY(-4px);
}
.plat:hover .plat-inner{
  background:#111113;
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.08), 0 12px 32px rgba(0,0,0,0.3);
}
[data-theme="light"] .plat-inner{
  background:rgba(255,255,255,0.5);border:1px solid rgba(0,0,0,0.04);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.9), 0 8px 24px rgba(0,0,0,0.02);
}
[data-theme="light"] .plat:hover .plat-inner{
  background:rgba(255,255,255,0.72);
  box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.95), 0 12px 32px rgba(0,0,0,0.07);
}
/* ── Aceternity Card Hover spotlight ─────────────────────────────────────
   .card-spot is injected by card-hover.js, sits as a sibling BEFORE
   .plat-inner in DOM order — so it's naturally behind the dark card.
   Light gray tint that peeks around the edges of the black .plat-inner. */
.card-spot {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(165, 168, 185, 0.13);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  will-change: transform, opacity;
}
[data-theme="light"] .card-spot {
  background: rgba(110, 115, 135, 0.10);
}

.plat-ico{width:46px;height:46px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-family:var(--mono);font-size:13px;font-weight:700}
.plat-ico img{width:28px;height:28px;object-fit:contain}
.plat-name{font-family:var(--body);font-size:13.5px;font-weight:600;letter-spacing:-.01em}
.plat-handle{font-size:11px;font-family:var(--mono);color:var(--muted)}
.plat-badge{font-size:10.5px;color:var(--fg-2);background:var(--tag);border:1px solid var(--border);border-radius:100px;padding:3px 10px}

/* Platform accent hovers — border-colour changes removed; ::before glow handles it */

/* ══════════════════════════════════════════
   BORDER GLOW  —  ReactBits style
   Rotating conic-gradient beam on the border
   Uses @property for smooth CSS-native spin
══════════════════════════════════════════ */

/* Register the angle property for animation */
@property --ga {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* The spin keyframe */
@keyframes ga { to { --ga: 360deg; } }

/*
 * .gl  =  glow wrapper
 *   – provides the 1.5px gradient "border" via padding
 *   – ::after holds the rotating conic-gradient beam
 *   – inner child gets a solid bg + z-index so content is never obscured
 */
.gl {
  position: relative;
  border-radius: calc(var(--r) + 2px);
  padding: 1.5px;
  /* default border colour while beam is hidden */
  background: var(--border);
  /* run the angle counter always; opacity controls visibility */
  --ga: 0deg;
  animation: ga 5s linear infinite;
}

.gl::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(
    from var(--ga),
    transparent      0%,
    transparent     58%,
    #fb923ce6       70%,   /* orange */
    #facc15e6       78%,   /* yellow */
    #f472b6cc       85%,   /* pink   */
    transparent     93%
  );
  opacity: 0;
  transition: opacity .38s ease;
  pointer-events: none;
}

/* Hover: beam appears */
.gl:hover::after { opacity: 1; }

/* Always-on variant (portrait, connect section) */
.gl-on::after { opacity: 1 !important; }

/* Slower / subtler pulse for portrait */
.gl-portrait { animation-duration: 7s; }
.gl-portrait::after {
  background: conic-gradient(
    from var(--ga),
    transparent      0%,
    transparent     62%,
    rgba(251,146,60,.75) 73%,
    rgba(250,204,21,.65) 81%,
    rgba(244,114,182,.55) 88%,
    transparent     94%
  );
  opacity: 1;
}

/* Inner child — sits above ::after */
.gl > * {
  position: relative;
  z-index: 1;
  border-radius: calc(var(--r) - 1px) !important;
  background: rgba(13, 10, 8, 0.55) !important;
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  border: none !important;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06), inset 0 -1px 0 0 rgba(0, 0, 0, 0.3) !important;
}
[data-theme="light"] .gl > * {
  background: rgba(255, 255, 255, 0.55) !important;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.9), inset 0 -1px 0 0 rgba(0, 0, 0, 0.03) !important;
}

/* Portrait inner override — keep the portrait-fb gradient */
.gl-portrait > .portrait { background: transparent !important; border-radius: var(--r) !important; }
.gl-portrait > .portrait .portrait-fb { border-radius: var(--r) !important; }

/* Platform card accent glows — replaced by border-glow.js + .plat::before */

/* ── HERO NAME (Rengok display font) ─────── */
.hero-name {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.02em;
}
[data-theme="light"] .hero-name {
  color: #0e0e10;
}

/* ── UI ELEMENTS stay on Inter (true UI only) ── */
.nav-a, .btn-p, .btn-s, .label, .skill, .tag,
.form-group label, .form-group input, .form-group textarea,
.contact-submit-btn, .proj-link-new,
.footer span, .footer a,
.hero-eyebrow {
  font-family: var(--sans);
}

/* ── CONTENT ELEMENTS use body font (Lora) ── */
.xp-co, .xp-role, .plat-name, .plat-badge,
.proj-features-list li, .about-bio, .hero-desc,
.lwt-desc {
  font-family: var(--body);
}

/* ── SCROLL REVEAL ───────────────────────── */
.r{opacity:0;transform:translateY(20px);transition:opacity .65s var(--ease),transform .65s var(--ease)}
.r.in{opacity:1;transform:none}

/* ══════════════════════════════════════════
   RESPONSIVE — mobile-first, all breakpoints
   320px → 480px → 600px → 768px → 960px
           → 1100px → 1280px → 1440px → 1920px+
══════════════════════════════════════════ */

/* ── Base fluid fixes (all sizes) ────────── */
.hero {
  /* svh = small viewport height — avoids soft-keyboard issues on mobile */
  min-height: 100svh;
  min-height: 100vh; /* fallback for browsers without svh */
}

/* Hero paragraph — fluid max-width */
.hero-desc {
  max-width: min(400px, 100%);
}

/* Platform cards — fluid base so they never overflow */
.plat-grid > .plat {
  flex: 0 0 clamp(140px, 22vw, 164px);
}

/* ── Frame rails hidden on mobile ─────────── */
@media(max-width: 860px) {
  .shell { padding: 0; }
}

/* ── 1100px — project grid 4→2 cols ──────── */
@media(max-width: 1100px) {
  .proj-grid-new {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
}

/* ── 960px — tablet landscape ────────────── */
@media(max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr 220px;
    gap: 32px;
  }
  .portrait {
    width: 220px;
    height: 268px;
  }
  .proj-card-new {
    padding: 28px 24px;
    min-height: 360px;
  }
  .about2 {
    gap: 40px;
  }
}

/* ── 900px — contact grid stacks ─────────── */
@media(max-width: 900px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    max-width: 600px;
  }
  .contact-image-wrap {
    min-height: 280px;
  }
}

/* ── 768px — tablet portrait / large phone ── */
@media(max-width: 768px) {
  /* Hero */
  .hero {
    padding: 100px 0 48px;
    align-items: flex-start;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }
  .hero-eyebrow { text-align: center; }
  .hero-ctas    { justify-content: center; }
  .hero p[style] { max-width: 100% !important; }

  /* Portrait — centered, fluid */
  .portrait {
    width: clamp(160px, 45vw, 220px);
    height: auto;
    aspect-ratio: 210 / 256;
    margin: 0 auto;
  }
  .portrait img { height: 100%; }

  /* About page hero */
  .about-hero {
    padding: 96px 0 48px;
    text-align: center;
  }
  .about-bio  { margin: 0 auto; }
  .stats      { justify-content: center; gap: 24px; }

  /* About 2-col → 1-col */
  .about2 {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* Sections */
  .sec    { padding: 64px 0; }
  .sec-sm { padding: 44px 0; }
  .connect { padding: 64px 0; }

  /* Project grid → 1 col */
  .proj-grid-new {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .proj-card-new { min-height: auto; }

  /* Contact */
  .contact-icon-overlay {
    width: 110px;
    height: 110px;
  }
  .contact-icon-overlay svg {
    width: 60px;
    height: 60px;
  }

  /* Platform cards — 2 per row */
  .plat-grid > .plat {
    flex: 0 0 calc(50% - 8px);
  }

  /* Stats numbers */
  .stat-n { font-size: 28px; }
}

/* ── 600px — small phones ─────────────────── */
@media(max-width: 600px) {
  /* Wrap padding */
  .wrap    { padding: 0 16px; }
  .wrap-lg { padding: 0 16px; }

  /* Nav — tighter */
  .nav-pill { padding: 4px; gap: 1px; }
  .nav-a    { padding: 6px 11px; font-size: 12px; }
  .theme-btn { width: 32px; height: 32px; font-size: 14px; }

  /* Hero */
  .hero { padding: 88px 0 40px; }
  .hero-eyebrow { font-size: 13px; }

  /* Sections */
  .sec    { padding: 52px 0; }
  .sec-sm { padding: 36px 0; }
  .connect { padding: 52px 0; }

  /* Project cards */
  .proj-card-new {
    padding: 24px 20px;
  }
  .proj-icon-box {
    width: 42px;
    height: 42px;
  }
  .proj-icon-box svg {
    width: 18px;
    height: 18px;
  }
  .proj-title-new { font-size: 17px; }
  .proj-features-list li { font-size: 13.5px; }

  /* Projects page header */
  .projects-page .wrap-lg > div[style] {
    padding-top: 88px !important;
    padding-bottom: 36px !important;
  }

  /* Experience items */
  .xp-item { padding: 14px; gap: 10px; }
  .xp-co   { font-size: 13.5px; }
  .xp-role { font-size: 12px; }
  .xp-date { font-size: 10px; }

  /* Skills */
  .skill { padding: 7px 14px; font-size: 12.5px; }

  /* Platform grid */
  .plat-grid { gap: 10px; }
  .plat-grid > .plat { flex: 0 0 calc(50% - 5px); }
  .plat-inner { padding: 18px 12px; }
  .plat-name { font-size: 12.5px; }

  /* Contact */
  .contact-image-wrap { min-height: 240px; }
  .contact-icon-overlay {
    width: 96px;
    height: 96px;
    border-radius: 18px;
  }
  .contact-icon-overlay svg { width: 52px; height: 52px; }
  .form-group input,
  .form-group textarea { padding: 14px 16px; font-size: 14px; }
  .contact-submit-btn { padding: 15px 20px; font-size: 14px; }

  /* Stats */
  .stats { gap: 20px; }
  .stat-n { font-size: 26px; }
  .stat-l { font-size: 9.5px; }

  /* About hero */
  .about-hero { padding: 88px 0 40px; }
}

/* ── 480px — micro phones (iPhone SE etc.) ── */
@media(max-width: 480px) {
  /* Nav — prevent overflow on 320px screens */
  .nav { width: calc(100% - 24px); }
  .nav-pill {
    width: 100%;
    justify-content: center;
    padding: 4px;
    gap: 0;
  }
  .nav-a    { padding: 6px 9px; font-size: 11.5px; }
  .theme-btn { width: 30px; height: 30px; font-size: 13px; }

  /* Hero */
  .hero { padding: 80px 0 36px; }
  .portrait {
    width: clamp(140px, 42vw, 180px);
  }

  /* Platform cards — full width on very small screens */
  .plat-grid > .plat { flex: 0 0 100%; }

  /* Contact overlay */
  .contact-icon-overlay {
    width: 84px;
    height: 84px;
    border-radius: 16px;
  }
  .contact-icon-overlay svg { width: 44px; height: 44px; }

  /* Tighten section spacing */
  .sec    { padding: 44px 0; }
  .sec-sm { padding: 32px 0; }
  .connect { padding: 44px 0; }

  /* About hero */
  .about-hero { padding: 80px 0 36px; }
}

/* ── 360px — very small Android phones ────── */
@media(max-width: 360px) {
  .wrap    { padding: 0 12px; }
  .wrap-lg { padding: 0 12px; }
  .nav-a   { padding: 5px 7px; font-size: 11px; }
  .hero-eyebrow { font-size: 12px; }
  .proj-card-new { padding: 20px 16px; }
  .skill { padding: 6px 12px; font-size: 12px; }
  .xp-logo { width: 32px; height: 32px; font-size: 9px; }
}

/* ── 1280px — large desktop ───────────────── */
@media(min-width: 1280px) {
  .proj-grid-new {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
  .hero-grid {
    grid-template-columns: 1fr 280px;
    gap: 52px;
  }
  .portrait { width: 280px; height: 340px; }
}

/* ── 1440px — wide desktop ────────────────── */
@media(min-width: 1440px) {
  .wrap-lg { max-width: 1280px; }
  .proj-grid-new { gap: 24px; }
  .proj-card-new {
    padding: 36px 32px;
    min-height: 420px;
  }
  .contact-grid { max-width: 1100px; }
  .hero-grid { grid-template-columns: 1fr 320px; gap: 64px; }
  .portrait { width: 320px; height: 388px; }
}

/* ── 1920px — ultra-wide ──────────────────── */
@media(min-width: 1920px) {
  .wrap-lg { max-width: 1500px; }
  .proj-grid-new { gap: 28px; }
  .proj-card-new {
    padding: 40px 36px;
    min-height: 460px;
  }
  .contact-grid { max-width: 1280px; }
  .hero-grid { grid-template-columns: 1fr 360px; gap: 80px; }
  .portrait { width: 360px; height: 437px; }
  .wrap { max-width: 860px; }
}

/* ── ACETERNITY TYPEWRITER EFFECT ─────────── */
#typewriter-root {
  display: inline;
}

.tw-wrapper {
  display: inline;
}

/* Cursor inherits the gradient color from the parent h1 */
.tw-cursor {
  display: inline-block;
  margin-left: 2px;
  font-weight: 300;
  animation: tw-blink 1.06s step-end infinite;
  vertical-align: baseline;
  /* Use a solid colour so it's visible against the gradient text */
  -webkit-text-fill-color: #F97316;
  color: #F97316;
}
[data-theme="light"] .tw-cursor {
  -webkit-text-fill-color: #EA580C;
  color: #EA580C;
}
@keyframes tw-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
/* Cursor stays solid while actively typing, blinks only during pauses */
.tw-cursor.tw-typing {
  animation: none;
  opacity: 1;
}

/* ── SHINY TEXT EFFECT ────────────────────── */
.shiny-text {
  background: linear-gradient(
    120deg,
    rgba(220, 220, 220, 0.75) 20%,
    rgba(255, 255, 255, 1)    45%,
    rgba(255, 255, 255, 1)    55%,
    rgba(220, 220, 220, 0.75) 80%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shiny-sweep 6s linear infinite;
  display: inline-block;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.55));
}
[data-theme="light"] .shiny-text {
  background: linear-gradient(
    120deg,
    rgba(10, 10, 10, 0.65) 20%,
    rgba(10, 10, 10, 1)    45%,
    rgba(10, 10, 10, 1)    55%,
    rgba(10, 10, 10, 0.65) 80%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: none;
}
@keyframes shiny-sweep {
  0% { background-position: 100% center; }
  100% { background-position: -100% center; }
}

/* ── proj-hl span: re-apply gradient so background-clip:text still works ── */
#proj-hl,
#about-proj-hl,
#hero-fsd {
  background: inherit;
  background-size: inherit;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  position: relative;
  vertical-align: baseline;
}

/* ── SOCIAL HOVER ACCENTS ────────────────── */
/* border-colour overrides removed — ::before glow replaces them */

/* X icon: adapts to theme */
.x-ico {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}
[data-theme="light"] .x-ico {
  background: rgba(0, 0, 0, 0.07) !important;
  color: #0e0e10 !important;
}

/* ── PREMIUM PROJECT CARDS (ReactBits style) ── */
.wrap-lg {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 2;
}

.proj-grid-new {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 48px;
  margin-bottom: 48px;
}

.proj-card-new {
  display: flex;
  flex-direction: column;
  padding: 32px 28px;
  background: rgba(5, 5, 5, 0.4);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-radius: 18px;
  height: 100%;
  min-height: 400px;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.04), 0 10px 30px -10px rgba(0,0,0,0.4);
  transition: all 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
}

[data-theme="light"] .proj-card-new {
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.95), 0 10px 30px -10px rgba(0,0,0,0.06);
}

/* Animated gradient background on hover */
.proj-card-new::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(255, 255, 255, 0.04),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}

.proj-card-new:hover::before {
  opacity: 1;
}

[data-theme="light"] .proj-card-new::before {
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(0, 0, 0, 0.03),
    transparent 40%
  );
}

/* Lift and enhance on hover (JS handles tilt) */
.proj-card-new:hover {
  border-color: rgba(255,255,255,0.12);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.08), 0 20px 50px -15px rgba(0,0,0,0.6);
}

[data-theme="light"] .proj-card-new:hover {
  border-color: rgba(0,0,0,0.08);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,1), 0 20px 50px -15px rgba(0,0,0,0.12);
}

/* Ensure content stays above the ::before gradient */
.proj-card-new > * {
  position: relative;
  z-index: 1;
}

.proj-header-new {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.proj-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 20px;
  transition: all 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.proj-card-new:hover .proj-icon-box {
  transform: rotate(8deg) scale(1.1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.proj-icon-box.green {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.08);
}

.proj-card-new:hover .proj-icon-box.green {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.25);
}

.proj-icon-box.blue {
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.08);
}

.proj-card-new:hover .proj-icon-box.blue {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
}

.proj-icon-box.yellow {
  color: #eab308;
  border-color: rgba(234, 179, 8, 0.25);
  background: rgba(234, 179, 8, 0.08);
}

.proj-card-new:hover .proj-icon-box.yellow {
  background: rgba(234, 179, 8, 0.15);
  border-color: rgba(234, 179, 8, 0.4);
  box-shadow: 0 8px 24px rgba(234, 179, 8, 0.25);
}

.proj-icon-box.purple {
  color: #a855f7;
  border-color: rgba(168, 85, 247, 0.25);
  background: rgba(168, 85, 247, 0.08);
}

.proj-card-new:hover .proj-icon-box.purple {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.25);
}

[data-theme="light"] .proj-icon-box {
  background: rgba(0,0,0,0.01);
  border-color: rgba(0,0,0,0.05);
}

[data-theme="light"] .proj-icon-box.green {
  background: rgba(34, 197, 94, 0.08);
}
[data-theme="light"] .proj-icon-box.blue {
  background: rgba(59, 130, 246, 0.08);
}
[data-theme="light"] .proj-icon-box.yellow {
  background: rgba(234, 179, 8, 0.08);
}
[data-theme="light"] .proj-icon-box.purple {
  background: rgba(168, 85, 247, 0.08);
}

.proj-num-new {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.proj-title-new {
  font-family: var(--headline);
  font-size: 19px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.proj-features-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  list-style: none;
  padding: 0;
}

.proj-features-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--fg-2);
  line-height: 1.55;
  font-weight: 400;
  transition: padding-left 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              color 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  padding-left: 0;
}

.proj-card-new:hover .proj-features-list li {
  padding-left: 4px;
}

.proj-features-list li svg {
  flex-shrink: 0;
  margin-top: 3px;
  color: #22c55e;
  transition: transform 0.18s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.proj-card-new:hover .proj-features-list li svg {
  transform: scale(1.15);
}

[data-theme="light"] .proj-features-list li {
  color: #2e3748;
}

.proj-link-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
  margin-top: auto;
  padding-top: 12px;
  letter-spacing: 0.01em;
  transition: color 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              gap   0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
}

.proj-link-new::after {
  content: '→';
  position: absolute;
  right: -18px;
  opacity: 0;
  transition: opacity 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              right  0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.proj-card-new:hover .proj-link-new {
  color: var(--fg);
  gap: 8px;
}

.proj-card-new:hover .proj-link-new::after {
  opacity: 1;
  right: -22px;
}

/* ── SCROLL REVEAL ───────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: start;
  text-align: left;
  max-width: 1000px;
  margin: 0 auto;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.form-group label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg);
  margin-bottom: 4px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 18px 20px;
  border-radius: 16px;
  font-family: var(--sans);
  font-size: 16px; /* 16px minimum prevents iOS auto-zoom */
  font-weight: 400;
  color: var(--fg);
  background: rgba(5, 5, 5, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.04), 
    0 4px 16px rgba(0, 0, 0, 0.1);
  transition: all 0.3s var(--ease);
  resize: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
  font-weight: 400;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  background: rgba(5, 5, 5, 0.4);
  border-color: rgba(251, 146, 60, 0.4);
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(251, 146, 60, 0.2),
    0 8px 32px rgba(251, 146, 60, 0.15);
  transform: translateY(-1px);
}

.form-group textarea {
  min-height: 120px;
  line-height: 1.6;
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group textarea {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.95), 
    0 4px 16px rgba(0, 0, 0, 0.03);
  color: var(--fg);
}

[data-theme="light"] .form-group input:focus,
[data-theme="light"] .form-group textarea:focus {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(251, 146, 60, 0.3);
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 1),
    0 0 0 1px rgba(251, 146, 60, 0.15),
    0 8px 32px rgba(251, 146, 60, 0.1);
}

.contact-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 18px 24px;
  border-radius: 16px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  background: linear-gradient(135deg, #fb923c 0%, #facc15 100%);
  color: #000;
  border: none;
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.3),
    0 8px 24px rgba(251, 146, 60, 0.3);
  transition: all 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}

.contact-submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #facc15 0%, #f472b6 100%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.contact-submit-btn:hover::before {
  opacity: 1;
}

.contact-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.4),
    0 12px 32px rgba(251, 146, 60, 0.4);
}

.contact-submit-btn span,
.contact-submit-btn svg {
  position: relative;
  z-index: 1;
}

.contact-submit-btn svg {
  transition: transform 0.3s var(--ease);
}

.contact-submit-btn:hover svg {
  transform: translateX(4px);
}

[data-theme="light"] .contact-submit-btn {
  background: linear-gradient(135deg, #fb923c 0%, #facc15 100%);
  color: #000;
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.4),
    0 8px 24px rgba(251, 146, 60, 0.2);
}

[data-theme="light"] .contact-submit-btn:hover {
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.5),
    0 12px 32px rgba(251, 146, 60, 0.3);
}

.contact-image-wrap {
  width: 100%;
  height: 100%;
  min-height: 380px;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 5, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.04), 0 12px 40px rgba(0, 0, 0, 0.25);
  transition: all 0.4s var(--ease);
}

.contact-image-wrap:hover {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.08), 0 16px 50px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .contact-image-wrap {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.95), 0 12px 40px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .contact-image-wrap:hover {
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 1), 0 16px 50px rgba(0, 0, 0, 0.08);
}

/* ── MAGNET LINES ─────────────────────────── */
.magnet-lines-container {
  display: grid;
  justify-items: center;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 380px;
  padding: 16px;
}

.magnet-lines-container span {
  display: block;
  border-radius: 999px;
  transform-origin: center;
  will-change: transform;
  transform: rotate(var(--rotate));
  transition: transform 0.08s linear;
  opacity: 0.85;
}

.magnet-lines-container:hover span {
  opacity: 1;
}

/* Coding Icon Overlay */
.contact-icon-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
  border-radius: 24px;
  background: rgba(5, 5, 5, 0.6);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06), 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: all 0.4s var(--ease);
}

[data-theme="light"] .contact-icon-overlay {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.95), 0 20px 60px rgba(0, 0, 0, 0.08);
}

.contact-icon-overlay svg {
  color: var(--fg);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  transition: color 0.4s var(--ease);
}

.contact-image-wrap:hover .contact-icon-overlay {
  border-color: rgba(251, 146, 60, 0.3);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1), 0 25px 70px rgba(251, 146, 60, 0.25);
}

[data-theme="light"] .contact-image-wrap:hover .contact-icon-overlay {
  border-color: rgba(251, 146, 60, 0.25);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 1), 0 25px 70px rgba(251, 146, 60, 0.15);
}

.contact-image-wrap:hover .contact-icon-overlay svg {
  color: #fb923c;
}

.contact-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  transition: transform 0.5s var(--ease);
}

.contact-image-wrap:hover .contact-image {
  transform: scale(1.025);
}





/* ══════════════════════════════════════════
   LIGHT THEME — comprehensive overrides
   All hardcoded dark colors fixed here
══════════════════════════════════════════ */

/* Portrait fallback card */
[data-theme="light"] .portrait-fb {
  background: linear-gradient(160deg, #f0ece6 0%, #e8e0d8 100%);
  border-color: rgba(0,0,0,0.06);
}
[data-theme="light"] .portrait-fb span:first-child {
  color: rgba(14,14,16,0.8);
}
[data-theme="light"] .portrait-fb span:last-child {
  color: rgba(14,14,16,0.35);
}

/* Portrait image — full grayscale in light mode */
[data-theme="light"] .portrait img {
  filter: grayscale(100%) contrast(1.1) brightness(0.95);
}
[data-theme="light"] .portrait:hover img {
  filter: grayscale(0%) contrast(1.05) brightness(1.05);
}

/* Sections — already have light overrides but ensure border is visible */
[data-theme="light"] .sec {
  border-top-color: rgba(0,0,0,0.05);
  border-bottom-color: rgba(0,0,0,0.05);
}

/* Nav pill active link indicator */
[data-theme="light"] .nav-ind {
  background: linear-gradient(135deg, rgba(251,146,60,0.12), rgba(250,204,21,0.12));
}

/* Marquee fade edges */
[data-theme="light"] .mq-wrap::before {
  background: linear-gradient(90deg, #faf8f5, transparent);
}
[data-theme="light"] .mq-wrap::after {
  background: linear-gradient(-90deg, #faf8f5, transparent);
}

/* Project cards new — text colors */
[data-theme="light"] .proj-num-new {
  color: rgba(0,0,0,0.35);
}
[data-theme="light"] .proj-title-new {
  color: #0e0e10;
}
[data-theme="light"] .proj-features-list li {
  color: #2e3748;
}
[data-theme="light"] .proj-link-new {
  color: rgba(14,14,16,0.6);
}
[data-theme="light"] .proj-card-new:hover .proj-link-new {
  color: #0e0e10;
}

/* Contact form inputs */
[data-theme="light"] .form-group label {
  color: #0e0e10;
}

/* Contact icon overlay svg */
[data-theme="light"] .contact-icon-overlay svg {
  filter: none;
  color: rgba(14,14,16,0.7);
}

/* Typing cursor */
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background-color: rgba(255,255,255,0.85);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: tw-blink 1.06s step-end infinite;
}
[data-theme="light"] .typing-cursor {
  background-color: #0e0e10;
}

/* Hero section — ensure no dark bleed-through on light */
[data-theme="light"] .hero {
  background: transparent !important;
}

/* About hero strong text — inherits gradient from parent */
[data-theme="light"] .about-h strong {
  color: inherit;
}

/* Stat numbers */
[data-theme="light"] .stat-n {
  color: #0e0e10;
}

/* List heading */
[data-theme="light"] .list-h {
  color: #0e0e10;
}

/* Projects page header text */
[data-theme="light"] .projects-header .h-lg,
[data-theme="light"] .projects-header p {
  color: var(--fg);
}

/* Scroll reveal — ensure light bg sections don't show dark bg flash */
[data-theme="light"] .sec,
[data-theme="light"] .sec-sm,
[data-theme="light"] .connect,
[data-theme="light"] .about-hero {
  background: rgba(250,248,245,0.6);
  backdrop-filter: blur(40px) saturate(160%);
  -webkit-backdrop-filter: blur(40px) saturate(160%);
}

/* About/projects page body bg */
[data-theme="light"] body.about-page,
[data-theme="light"] body.projects-page {
  background-color: #faf8f5;
}

/* Home page main — light fade */
[data-theme="light"] .home-page main {
  background: linear-gradient(
    to bottom,
    transparent calc(100vh - 200px),
    rgba(250,248,245,0.4) calc(100vh - 100px),
    rgba(250,248,245,0.85) calc(100vh - 50px),
    #faf8f5 calc(100vh - 12px)
  );
}


/* ══════════════════════════════════════════
   MOBILE NAV — Hamburger menu
   Replaces pill nav on screens ≤ 600px
══════════════════════════════════════════ */

/* Hamburger button — hidden on desktop */
.nav-hamburger {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(5,5,5,0.5);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
  z-index: 200;
  position: relative;
  flex-shrink: 0;
  transition: background 0.25s, border-color 0.25s;
}
[data-theme="light"] .nav-hamburger {
  background: rgba(255,255,255,0.6);
  border-color: rgba(0,0,0,0.08);
}
.nav-hamburger:hover {
  background: rgba(251,146,60,0.15);
  border-color: rgba(251,146,60,0.3);
}

/* Three-line icon */
.nav-hamburger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--fg);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease), width 0.3s var(--ease);
  position: absolute;
}
.nav-hamburger span:nth-child(1) { transform: translateY(-5px); }
.nav-hamburger span:nth-child(2) { width: 18px; }
.nav-hamburger span:nth-child(3) { transform: translateY(5px); width: 12px; }

/* Open state — X icon */
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg); width: 18px; }

/* ── HAMBURGER MENU OVERLAY ──────────────── */

/* Wrapper — full-screen, z above content but below nav */
.nav-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
}
.nav-drawer.open {
  pointer-events: all;
}

/* Backdrop — hidden now; the panel IS the overlay */
.nav-drawer-backdrop {
  display: none;
}

/* ── Drawer close button (×) ─────────────── */
.drawer-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  z-index: 10;
  /* hidden until drawer opens */
  opacity: 0;
  transform: rotate(-90deg) scale(0.7);
  transition: opacity 0.3s var(--ease) 0.1s,
              transform 0.35s var(--spring) 0.1s,
              background 0.2s, color 0.2s, border-color 0.2s;
}
.nav-drawer.open .drawer-close-btn {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
.drawer-close-btn:hover {
  background: rgba(251,146,60,0.15);
  border-color: rgba(251,146,60,0.35);
  color: #fb923c;
}
.drawer-close-btn svg {
  flex-shrink: 0;
  transition: transform 0.2s var(--spring);
}
.drawer-close-btn:hover svg {
  transform: rotate(90deg) scale(1.1);
}

/* Full-screen panel — structured space-between layout */
.nav-drawer-panel {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(155deg, #6e1c00 0%, #c94200 35%, #ff6500 68%, #ff9200 100%);
  clip-path: circle(0px at var(--ham-x, calc(100% - 36px)) var(--ham-y, 36px));
  transition: clip-path 0.62s cubic-bezier(0.77, 0, 0.18, 1);
  transform: none !important;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: max(64px, calc(52px + env(safe-area-inset-top))) 36px max(52px, calc(44px + env(safe-area-inset-bottom)));
  overflow: hidden;
}
/* Dual radial vignette — bright top-left, dark bottom-right */
.nav-drawer-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 15% 12%, rgba(255,255,255,0.13) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 90%, rgba(0,0,0,0.22) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.nav-drawer.open .nav-drawer-panel {
  clip-path: circle(200% at var(--ham-x, calc(100% - 36px)) var(--ham-y, 36px));
}

/* Hamburger spans turn white over the overlay */
.nav-hamburger.open span { background: #ffffff; }

/* ── Brand header ───────────────────────── */
.ham-brand {
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.40s var(--ease) 0.08s, transform 0.40s var(--ease) 0.08s;
}
.nav-drawer.open .ham-brand {
  opacity: 1;
  transform: translateY(0);
}
.ham-initials {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  color: rgba(255,255,255,0.96);
  letter-spacing: -0.02em;
  line-height: 1;
}
.ham-tagline {
  font-size: 10.5px;
  font-family: var(--mono);
  color: rgba(255,255,255,0.48);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* ── Nav links — numbered with dividers ─── */
.nav-drawer-links {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  position: relative;
  z-index: 1;
}
.nav-drawer-link {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255,255,255,0.13);
  width: 100%;
  font-size: clamp(38px, 12vw, 58px);
  font-weight: 700;
  font-family: var(--headline);
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  letter-spacing: -0.025em;
  line-height: 1;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.38s var(--ease), transform 0.38s var(--ease),
              color 0.22s, padding-left 0.28s var(--ease);
  background: none !important;
}
.nav-drawer-links .nav-drawer-link:first-child {
  border-top: 1px solid rgba(255,255,255,0.13);
}
.nav-drawer-link.ham-in    { opacity: 1; transform: translateY(0); }
.nav-drawer-link:hover     { color: #ffffff; padding-left: 6px; }
.nav-drawer-link.on        { color: #ffffff; background: none !important; }
/* All theme variants inside orange overlay stay white */
[data-theme="light"] .nav-drawer-link,
[data-theme="light"] .nav-drawer-link:hover,
[data-theme="light"] .nav-drawer-link.on {
  background: none !important;
  color: rgba(255,255,255,0.88);
}
[data-theme="light"] .nav-drawer-link:hover { color: #ffffff; padding-left: 6px; }
[data-theme="light"] .nav-drawer-link.on    { color: #ffffff; }

/* Number prefix */
.ham-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,0.40);
  letter-spacing: 0.06em;
  align-self: center;
  flex-shrink: 0;
  transition: color 0.22s;
  padding-bottom: 3px;
}
.nav-drawer-link:hover .ham-num { color: rgba(255,255,255,0.70); }
.nav-drawer-link.on    .ham-num { color: rgba(255,255,255,0.60); }
.ham-label { flex: 1; }

/* ── Footer: social row + theme toggle ──── */
.nav-drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0;
  border-top: none;
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.40s var(--ease) 0.42s, transform 0.40s var(--ease) 0.42s;
}
.nav-drawer.open .nav-drawer-footer {
  opacity: 1;
  transform: translateY(0);
}
.ham-social {
  display: flex;
  align-items: center;
  gap: 9px;
}
.ham-soc-link {
  font-family: var(--mono);
  font-size: 10.5px;
  color: rgba(255,255,255,0.48);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  transition: color 0.2s;
}
.ham-soc-link:hover { color: rgba(255,255,255,0.92); }
.ham-soc-dot {
  color: rgba(255,255,255,0.20);
  font-size: 11px;
  line-height: 1;
  user-select: none;
}
.nav-drawer-theme-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.20);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.25s, transform 0.2s var(--spring);
}
.nav-drawer-theme-btn:hover {
  background: rgba(255,255,255,0.24);
  transform: rotate(20deg) scale(1.1);
}
[data-theme="light"] .nav-drawer-theme-btn {
  /* Drawer panel is always warm-orange — white stays correct in both themes */
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.28);
  color: #ffffff;
}

/* ── Activate hamburger on mobile ─────────── */
@media (max-width: 600px) {
  /* Hide the pill nav */
  .nav-pill { display: none; }

  /* Show hamburger + drawer */
  .nav-hamburger { display: flex; }
  .nav-drawer     { display: block; }

  /* Reposition nav to top-right */
  .nav {
    top: 16px;
    left: auto;
    right: 16px;
    transform: none;
  }
}

/* ══════════════════════════════════════════
   RESPONSIVE IMPROVEMENTS — comprehensive
   Fills gaps identified in audit
══════════════════════════════════════════ */

/* ── Safe area insets (iPhone notch/home bar) */
@supports (padding: env(safe-area-inset-bottom)) {
  .footer {
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }
  @media (max-width: 600px) {
    .nav { top: calc(16px + env(safe-area-inset-top)); }
    .nav-drawer-panel { padding-top: calc(80px + env(safe-area-inset-top)); }
  }
}

/* ── prefers-reduced-motion ───────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .mq-track { animation: none; }
  .portrait-ring { animation: none; }
  #hero-shader { transition: none; }
  /* Reveal elements immediately — avoid opacity-0 flash when transitions are instant */
  .r { opacity: 1 !important; transform: none !important; }
}

/* ── Touch-friendly tap targets ──────────── */
@media (hover: none) and (pointer: coarse) {
  /* Disable hover-only effects on touch */
  .proj-card-new:hover { transform: none; }
  .xp-item:hover       { transform: none; }
  .plat:hover          { transform: none; }
  .skill:hover         { transform: none; }
  .btn-p:hover         { transform: none; }
  .btn-s:hover         { transform: none; }

  /* Larger tap targets */
  .nav-a    { min-height: 44px; display: flex; align-items: center; }
  .btn-p,
  .btn-s    { min-height: 48px; }
  .icon-btn { width: 48px; height: 48px; }
  .theme-btn { width: 44px; height: 44px; }

  /* Disable WebGL-heavy shader on low-end touch devices */
  /* (shader.js handles this via JS, CSS just ensures fallback looks good) */
}

/* ── Fluid gap fixes ──────────────────────── */
.about2 {
  gap: clamp(24px, 5vw, 60px);
}
.hero-grid {
  gap: clamp(24px, 4vw, 52px);
}
.contact-grid {
  gap: clamp(24px, 4vw, 48px);
}

/* ── Contact image wrap — fluid min-height ── */
.contact-image-wrap,
.magnet-lines-container {
  min-height: clamp(220px, 40vw, 380px);
}

/* Hide gradient lines box on tablets and mobile (laptop only) */
@media (max-width: 1024px) {
  .contact-image-wrap {
    display: none;
  }
}

/* ── Stats — fluid gap ────────────────────── */
.stats {
  gap: clamp(16px, 4vw, 40px);
}

/* ── Wrap padding — fluid ─────────────────── */
.wrap {
  padding: 0 clamp(16px, 4vw, 28px);
}
.wrap-lg {
  padding: 0 clamp(16px, 4vw, 28px);
}

/* ── Section padding — fluid ──────────────── */
.sec    { padding: clamp(48px, 8vw, 96px) 0; }
.sec-sm { padding: clamp(32px, 6vw, 64px) 0; }
.connect { padding: clamp(48px, 8vw, 96px) 0; }
.about-hero { padding: clamp(80px, 12vw, 120px) 0 clamp(40px, 6vw, 72px); }

/* ── Hero padding — fluid ─────────────────── */
.hero { padding: clamp(72px, 10vw, 100px) 0 0; }

/* ── Projects header — fluid ──────────────── */
.projects-header {
  padding: clamp(80px, 12vw, 120px) 0 clamp(32px, 5vw, 56px);
}

/* ── Tablet: 768px–1024px improvements ────── */
@media (min-width: 601px) and (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .portrait {
    width: clamp(180px, 25vw, 260px);
    height: auto;
    aspect-ratio: 210 / 256;
  }
  .portrait img { height: 100%; }

  .proj-grid-new {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

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

  .plat-grid > .plat {
    flex: 0 0 clamp(140px, 20vw, 160px);
  }
}

/* ── Mobile: ≤ 600px — full overhaul ─────── */
@media (max-width: 600px) {
  /* Hero — single column, portrait on top */
  .hero {
    align-items: flex-start;
    padding-top: 72px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
  }
  /* Portrait first on mobile */
  .hero-grid > div:last-child { order: -1; }

  .hero-eyebrow { text-align: center; font-size: 13px; }
  .hero-ctas    { justify-content: center; flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
  .hero-ctas .btn-resume,
  .hero-ctas .btn-contact-toggle { justify-content: center; }
  .contact-dropdown-wrap { position: relative; }
  .contact-dropdown { left: 50%; transform: translateX(-50%) translateY(-6px) scale(0.97); }
  .contact-dropdown.open { left: 50%; transform: translateX(-50%) translateY(0) scale(1); }
  .hero-desc { font-size: 14px; max-width: 100%; }

  /* Portrait */
  .portrait {
    width: clamp(140px, 50vw, 200px);
    height: auto;
    aspect-ratio: 210 / 256;
    margin: 0 auto;
  }
  .portrait img { height: 100%; }

  /* Project cards */
  .proj-grid-new {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .proj-card-new {
    padding: 24px 20px;
    min-height: auto;
  }

  /* About 2-col → 1-col */
  .about2 { grid-template-columns: 1fr; }

  /* About hero */
  .about-hero { text-align: center; }
  .about-bio  { margin: 0 auto; }
  .stats      { justify-content: center; }

  /* Contact grid stacks */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .contact-image-wrap { min-height: 200px; }
  .magnet-lines-container { min-height: 200px; }

  /* Platform cards — 2 per row */
  .plat-grid > .plat { flex: 0 0 calc(50% - 8px); }
  .plat-inner { padding: 16px 12px; gap: 8px; }
  .plat-name { font-size: 12px; }
  .plat-handle { font-size: 10px; }
  .plat-badge { font-size: 9.5px; padding: 2px 8px; }

  /* Skills */
  .skills { gap: 8px; }
  .skill  { padding: 7px 14px; font-size: 12.5px; }

  /* XP items */
  .xp-item { padding: 12px; gap: 10px; }
  .xp-co   { font-size: 13px; }
  .xp-role { font-size: 12px; }
  .xp-date { font-size: 10px; }
  .xp-logo { width: 34px; height: 34px; font-size: 9px; }

  /* Stats */
  .stat-n { font-size: clamp(22px, 6vw, 28px); }
  .stat-l { font-size: 9px; }

  /* Connect icons */
  .connect-icons { gap: 10px; }
  .icon-btn { width: 44px; height: 44px; border-radius: 12px; }

  /* Form */
  .form-group input,
  .form-group textarea { padding: 14px 16px; font-size: 16px; } /* 16px prevents iOS auto-zoom */
  .contact-submit-btn  { padding: 16px 20px; font-size: 14px; }

  /* Marquee items */
  .mq-item { padding: 8px 16px; font-size: 12.5px; gap: 8px; }
  .mq-item img { width: 18px; height: 18px; }
}

/* ── Very small: ≤ 380px ──────────────────── */
@media (max-width: 380px) {
  .hero-grid { gap: 20px; }
  .plat-grid > .plat { flex: 0 0 100%; }
  .proj-card-new { padding: 20px 16px; }
  .skill { padding: 6px 12px; font-size: 12px; }
  .hero-ctas .btn-resume,
  .hero-ctas .btn-contact-toggle { max-width: 100%; }
}

/* ── Ultrawide: ≥ 2560px ──────────────────── */
@media (min-width: 2560px) {
  :root { --max: 960px; }
  .wrap-lg { max-width: 1800px; }
  .proj-grid-new {
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
  }
  .proj-card-new { padding: 44px 40px; min-height: 500px; }
  .hero-grid { grid-template-columns: 1fr 400px; gap: 96px; }
  .portrait { width: 400px; height: 485px; }
  .contact-grid { max-width: 1400px; }
  body { font-size: 16px; }
}

/* ── 4K: ≥ 3840px ─────────────────────────── */
@media (min-width: 3840px) {
  :root { --max: 1100px; }
  .wrap-lg { max-width: 2400px; }
  body { font-size: 18px; }
  .nav-pill { padding: 8px; gap: 4px; }
  .nav-a { padding: 10px 24px; font-size: 16px; }
  .proj-card-new { padding: 52px 48px; min-height: 600px; }
}

/* ══════════════════════════════════════════
   INTERACTIONS — creative polish
══════════════════════════════════════════ */

/* Skill ripple keyframe */
@keyframes skill-ripple {
  0%   { width: 0;     height: 0;     opacity: 1; }
  100% { width: 200px; height: 200px; opacity: 0; }
}

/* Scroll progress bar — hide on reduced motion */
@media (prefers-reduced-motion: reduce) {
  #scroll-bar { display: none; }
}

/* Stat numbers — prevent layout shift during count animation */
.stat-n {
  min-width: 3ch;
  display: inline-block;
  will-change: filter, opacity;
  /* Smooth the blur-to-sharp transition driven by JS */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Hero canvas particles — don't clip portrait */
.hero { overflow: visible; }
.hero canvas { border-radius: 0; }

/* Project card spotlight — enhance the existing radial gradient */
.proj-card-new::before {
  background: radial-gradient(
    400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(251, 146, 60, 0.07),
    transparent 60%
  );
}
[data-theme="light"] .proj-card-new::before {
  background: radial-gradient(
    400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(251, 146, 60, 0.05),
    transparent 60%
  );
}

/* Skill tags — cursor pointer to hint they're clickable */
.skill { cursor: pointer; }

/* ══════════════════════════════════════════════════════════════════════
   MOBILE / TABLET PERFORMANCE
   Touch / coarse-pointer devices: disable all heavy JS-driven animations.
   Laptop/desktop (pointer:fine) keeps everything.
   ascii-wave is intentionally excluded — user requested it stays.
══════════════════════════════════════════════════════════════════════ */
@media (pointer: coarse), (max-width: 1024px) and (hover: none) {

  /* ── Border-glow beam: always hidden, JS won't run but CSS fallback ── */
  .plat::before { opacity: 0 !important; }

  /* ── Card hover spotlight: hide completely ────────────────────────── */
  .card-spot { display: none !important; }

  /* ── Cursor trail: hidden (JS skips touch, but ensure no flash) ───── */
  .cursor-trail, #cursor-trail { display: none !important; }

  /* ── Magnet lines canvas: hide ─────────────────────────────────────── */
  .magnet-lines-container canvas,
  #magnet-lines-canvas { display: none !important; }

  /* ── Variable proximity text: disable blur/scale transitions ─────── */
  .variable-proximity { filter: none !important; transform: none !important; }

  /* ── Hover lift on platform cards: disable ──────────────────────── */
  .plat:hover { transform: none !important; }

  /* ── Project card spotlight mouse-tracking gradient: disable ─────── */
  .proj-card-new::before { background: none !important; }

  /* ── Project card hover lift: reduce to near-zero ────────────────── */
  .proj-card-new:hover { transform: translateY(-2px) !important; }

  /* ── Focus/blur cards: disable heavy transitions ─────────────────── */
  .focus-card { transition: opacity 0.2s ease !important; filter: none !important; }

  /* ── Shader canvas: hidden on mobile (JS skips already, but safety) ─ */
  #hero-shader-canvas { display: none !important; }

  /* ── Reduce all transition durations for snappier feel ───────────── */
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.15s !important;
    scroll-behavior: auto !important;
  }

  /* ── But DON'T kill ascii-wave animations (explicitly restore) ────── */
  #ascii-wave-container,
  #ascii-wave-container * {
    animation-duration: revert !important;
    animation-iteration-count: revert !important;
    transition-duration: revert !important;
  }

  /* ── Magnetic button: no transform on mobile ────────────────────── */
  .btn-resume, .btn-contact-toggle { transform: none !important; }
}

/* ── Respect prefers-reduced-motion globally ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.15s !important;
  }
  /* Preserve ascii-wave */
  #ascii-wave-container,
  #ascii-wave-container * {
    animation-duration: revert !important;
    animation-iteration-count: revert !important;
  }
  .plat::before { opacity: 0 !important; }
  .card-spot { display: none !important; }
  .cursor-trail, #cursor-trail { display: none !important; }
}

/* Stagger children — ensure they start hidden for stagger reveal */
.xp-list .xp-item,
.plat-grid .plat {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.xp-list .xp-item.in,
.plat-grid .plat.in {
  opacity: 1;
  transform: none;
}

/* Skills stagger */
.skills .skill {
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease),
              background 0.25s var(--ease), border-color 0.25s var(--ease),
              box-shadow 0.25s var(--ease);
}
.skills .skill.in {
  opacity: 1;
  transform: none;
}

/* Project grid stagger */
.proj-grid-new .r {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.proj-grid-new .r.in {
  opacity: 1;
  transform: none;
}

/* Nav active dot removed — tubelight handles the active state */

/* Smooth focus ring for accessibility */
:focus-visible {
  outline: 2px solid rgba(251, 146, 60, 0.7);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Portrait — subtle scale on page load */
@keyframes portrait-enter {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.portrait {
  animation: portrait-enter 0.8s 0.3s var(--ease) both;
}
@media (prefers-reduced-motion: reduce) {
  .portrait { animation: none; }
}

/* Floating label on xp-date — subtle pill */
.xp-date {
  background: var(--tag);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 2px 10px;
  white-space: nowrap;
}

/* Plat badge — subtle glow on hover */
.plat:hover .plat-badge {
  background: rgba(251, 146, 60, 0.1);
  border-color: rgba(251, 146, 60, 0.25);
  transition: background 0.3s, border-color 0.3s;
}


/* ══════════════════════════════════════════
   DRAGGABLE FOOTER CARD
══════════════════════════════════════════ */
.draggable-footer-card {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 520px;
  max-width: calc(100vw - 48px);
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.5);
  z-index: 9999;
  cursor: default;
  opacity: 0;
  transform: translate(0, 100px) scale(0.95);
  transition: opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

.draggable-footer-card.visible {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

.draggable-footer-card.dragging {
  cursor: grabbing;
  box-shadow: 
    0 30px 80px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(251, 146, 60, 0.3),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.12);
  transition: box-shadow 0.2s ease;
}

[data-theme="light"] .draggable-footer-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.03);
}

/* Drag Handle */
.drag-handle {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  cursor: grab;
  padding: 8px 16px;
  border-radius: 8px;
  transition: background 0.2s ease;
  z-index: 10;
}

.drag-handle:hover {
  background: rgba(255, 255, 255, 0.05);
}

.drag-handle:active {
  cursor: grabbing;
}

[data-theme="light"] .drag-handle:hover {
  background: rgba(0, 0, 0, 0.03);
}

.drag-dots {
  display: grid;
  grid-template-columns: repeat(3, 4px);
  gap: 4px;
  opacity: 0.3;
  transition: opacity 0.2s ease;
}

.drag-handle:hover .drag-dots {
  opacity: 0.6;
}

.drag-dots span {
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
}

/* Card Content */
.footer-card-content {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 32px;
  padding: 48px 32px 32px;
  align-items: center;
}

.footer-card-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(16, 185, 129, 0.15));
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #22c55e;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
}

.footer-card-badge svg {
  flex-shrink: 0;
  animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

[data-theme="light"] .footer-card-badge {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.1));
  border-color: rgba(34, 197, 94, 0.25);
  color: #16a34a;
}

.footer-card-title {
  font-family: var(--headline);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--fg);
  margin: 0;
  transition: color 0.5s var(--ease);
}

.footer-card-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.footer-card-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--body);
  font-size: 14px;
  color: var(--fg-2);
  transition: color 0.2s ease, transform 0.2s ease;
  width: fit-content;
}

.footer-card-link:hover {
  color: var(--fg);
  transform: translateX(4px);
}

.footer-card-link svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.footer-card-link:hover svg {
  opacity: 1;
}

.footer-card-location {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  transition: color 0.5s var(--ease), border-color 0.5s var(--ease);
}

[data-theme="light"] .footer-card-location {
  border-color: rgba(0, 0, 0, 0.06);
}

.footer-card-location svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* Visual Section */
.footer-card-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-card-visual {
  width: 160px;
  height: 160px;
  border-radius: 16px;
  background: linear-gradient(135deg, 
    rgba(251, 146, 60, 0.15) 0%,
    rgba(250, 204, 21, 0.15) 50%,
    rgba(244, 114, 182, 0.15) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.footer-card-visual:hover {
  transform: scale(1.05);
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.15),
    0 8px 24px rgba(251, 146, 60, 0.2);
}

[data-theme="light"] .footer-card-visual {
  background: linear-gradient(135deg, 
    rgba(251, 146, 60, 0.1) 0%,
    rgba(250, 204, 21, 0.1) 50%,
    rgba(244, 114, 182, 0.1) 100%);
  border-color: rgba(0, 0, 0, 0.08);
}

.visual-text {
  font-family: var(--headline);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 1) 50%,
    rgba(255, 255, 255, 0.9) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  z-index: 1;
}

[data-theme="light"] .visual-text {
  background: linear-gradient(
    135deg,
    rgba(10, 10, 10, 0.8) 0%,
    rgba(10, 10, 10, 1) 50%,
    rgba(10, 10, 10, 0.8) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.visual-subtitle {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  z-index: 1;
  transition: color 0.5s var(--ease);
}

/* Close Button */
.footer-card-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.footer-card-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
  transform: scale(1.1);
}

[data-theme="light"] .footer-card-close {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .footer-card-close:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: #dc2626;
}

/* Responsive */
@media (max-width: 768px) {
  .draggable-footer-card {
    width: calc(100vw - 32px);
    bottom: 16px;
    right: 16px;
  }
  
  .footer-card-content {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 40px 24px 24px;
  }
  
  .footer-card-right {
    justify-content: flex-start;
  }
  
  .footer-card-visual {
    width: 120px;
    height: 120px;
  }
  
  .visual-text {
    font-size: 36px;
  }
  
  .footer-card-title {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .draggable-footer-card {
    width: calc(100vw - 24px);
    bottom: 12px;
    right: 12px;
  }
  
  .footer-card-content {
    padding: 36px 20px 20px;
    gap: 20px;
  }
  
  .footer-card-visual {
    width: 100px;
    height: 100px;
  }
  
  .visual-text {
    font-size: 32px;
  }
  
  .footer-card-title {
    font-size: 20px;
  }
  
  .footer-card-link {
    font-size: 13px;
  }
}


/* ══════════════════════════════════════════
   ABOUT HERO WITH FLIPPING BOARD
══════════════════════════════════════════ */
.about-content-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  align-items: center;
  margin-top: 36px;
}

.about-flipping-board {
  position: relative;
}

/* Flipping Board Container — tight around the tiles */
.flipping-board-container {
  width: 100%;
  padding: 28px 20px;
  background: rgba(5, 5, 5, 0.4);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.04), 0 10px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

[data-theme="light"] .flipping-board-container {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.9), 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Flipping Board */
.flipping-board {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}

.flip-row {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.flip-tile {
  position: relative;
  width: 14px;
  height: 22px;
  perspective: 280px;
  transform-style: preserve-3d;
}

.flip-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #212121 0%, #0e0e0e 52%, #141414 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.98);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 0 8px rgba(249, 115, 22, 0.3), 0 1px 2px rgba(0, 0, 0, 0.8);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.09),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.6),
    0 2px 6px rgba(0, 0, 0, 0.55);
}

[data-theme="light"] .flip-face {
  background: linear-gradient(180deg, #e8e8e8 0%, #d0d0d0 52%, #dadada 100%);
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(10, 10, 10, 0.95);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.1),
    0 2px 5px rgba(0, 0, 0, 0.1);
}

.flip-front { transform: rotateX(0deg); }
.flip-back  { transform: rotateX(180deg); }

/* Authentic midline seam — the characteristic split-flap divider */
.flip-midline {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 1px;
  background: rgba(0, 0, 0, 0.72);
  z-index: 5;
  pointer-events: none;
  transform: translateY(-0.5px);
}
[data-theme="light"] .flip-midline {
  background: rgba(0, 0, 0, 0.22);
}

/* ── Flip animations ────────────────────────────────────────── */
@keyframes flipFrontOut {
  0%   { transform: rotateX(0deg);   }
  100% { transform: rotateX(-90deg); }
}
@keyframes flipBackIn {
  0%   { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg);  }
}

/* Final character flip — 90ms + 90ms = 180ms (smoother) */
.flip-tile.flipping .flip-front {
  animation: flipFrontOut 0.09s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}
.flip-tile.flipping .flip-back {
  animation: flipBackIn  0.09s cubic-bezier(0, 0.55, 0.45, 1) 0.09s forwards;
}

/* Scramble flip — 35ms + 35ms = 70ms (faster wheel spin) */
.flip-tile.scrambling .flip-front {
  animation: flipFrontOut 0.035s linear forwards;
}
.flip-tile.scrambling .flip-back {
  animation: flipBackIn  0.035s linear 0.035s forwards;
}

/* Responsive */
@media (max-width: 960px) {
  .about-content-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: start;
  }
  .about-flipping-board {
    max-width: 380px;
    margin: 0 auto;
  }
}

@media (max-width: 600px) {
  .flipping-board-container { padding: 20px 14px; }
  .flip-tile  { width: 11px; height: 17px; }
  .flip-face  { font-size: 10px; }
  .flipping-board { gap: 5px; }
  .flip-row   { gap: 3px; }
}

@media (max-width: 480px) {
  .flipping-board-container { padding: 16px 12px; }
  .flip-tile  { width: 9px; height: 14px; }
  .flip-face  { font-size: 8px; }
  .flipping-board { gap: 4px; }
  .flip-row   { gap: 2px; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   PERFORMANCE OPTIMISATIONS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Layout containment on repeated card/list elements
   Stops the browser re-computing the rest of the page
   when any single card changes size or content.
   NOTE: .r is intentionally excluded — it's a generic reveal
   class applied to inline elements too (e.g. eyebrow spans)
   and contain:layout breaks their normal document flow.      */
.xp-item, .skill, .plat, .proj-card {
  contain: layout style;
}

/* content-visibility removed — iOS Safari has rendering bugs
   with it (misplaced elements, scroll jump). The IntersectionObserver
   pauses on canvas elements already handle the real perf win.   */

/* ── Mobile / tablet: cut expensive GPU effects ────────── */
@media (max-width: 1024px) {
  /* Halve the blur radius on every backdrop-filter.
     blur(40px) → blur(16px) saves ~60% of the GPU fill cost. */
  .nav-pill {
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
  }
  .flipping-board-container,
  .proj-card,
  .xp-item,
  .contact-card,
  .skill-section,
  .about-glass {
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
  }
  /* Disable the fixed scroll-progress rail blur */
  .rail {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* ── Phone: remove backdrop-filter entirely ─────────────── */
@media (max-width: 640px) {
  .nav-pill,
  .flipping-board-container,
  .proj-card,
  .xp-item,
  .contact-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Prefer GPU-composited properties only.
   Suppress will-change on elements that don't need it at rest. */
@media (max-width: 1024px) {
  .portrait, .portrait-ring {
    will-change: auto;
  }
}

/* Respect the OS-level "reduce motion" preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ascii-wave-container { display: none; }
}


/* ══════════════════════════════════════════
   FOCUS CARDS — Aceternity-style hover effect
   When any card is hovered, siblings dim + blur
══════════════════════════════════════════ */

/*
 * Asymmetric transitions:
 * - Enter (blur in): fast at 0.25s so it feels responsive
 * - Exit (blur out): slow at 0.55s with a gentle ease so it dissolves
 *   rather than snapping off. JS adds a small delay before removing
 *   has-focus so this exit transition actually plays.
 */
.proj-grid-new .r {
  transition:
    opacity   0.55s cubic-bezier(0.4, 0, 0.2, 1),
    filter    0.55s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.55s cubic-bezier(0.34, 1.2, 0.64, 1);
  will-change: opacity, filter, transform;
}

/* When entering focus state — snap in quickly */
.proj-grid-new.has-focus .r {
  opacity: 0.38;
  filter: blur(2px) saturate(0.55);
  transform: scale(0.972);
  transition:
    opacity   0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    filter    0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.25s cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* Focused wrapper — stays crisp and lifts slightly */
.proj-grid-new.has-focus .r:has(.proj-card-new.focused) {
  opacity: 1;
  filter: none;
  transform: scale(1.015);
}

/* Fallback for browsers without :has() */
.proj-grid-new.has-focus .r.focused-wrapper {
  opacity: 1;
  filter: none;
  transform: scale(1.015);
}

/* Focused card — sharper border + tighter glow */
.proj-card-new.focused {
  border-color: rgba(255, 255, 255, 0.16) !important;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.09),
    0 20px 48px -12px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.05) !important;
  transition:
    border-color 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow   0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

[data-theme="light"] .proj-card-new.focused {
  border-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 1),
    0 20px 48px -12px rgba(0, 0, 0, 0.12) !important;
}

/* Disable focus effect on touch devices */
@media (hover: none) and (pointer: coarse) {
  .proj-grid-new .r {
    will-change: auto;
  }
  .proj-grid-new.has-focus .r {
    opacity: 1;
    filter: none;
    transform: none;
  }
  .proj-grid-new.has-focus .r:has(.proj-card-new.focused),
  .proj-grid-new.has-focus .r.focused-wrapper {
    transform: none;
  }
}

/* ── PIXEL IMAGE — canvas overlay for hero portrait ── */
.portrait canvas.pixel-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--r);
  pointer-events: none;
  z-index: 2;
  /* GPU-composited layer for smooth pixel animation */
  will-change: opacity;
  backface-visibility: hidden;
}

/* While pixel canvas is active, suppress the img hover effects
   so they don't fight the canvas overlay */
.portrait:has(canvas.pixel-canvas) img {
  transition: opacity 0.3s ease !important;
}

/* ══════════════════════════════════════════════════════════════════════
   LAPTOP / DESKTOP RENDERING PERFORMANCE
   GPU-compositing, content-visibility, and paint optimizations.
══════════════════════════════════════════════════════════════════════ */

/* ── content-visibility: skip rendering off-screen sections ────────────
   Browser defers paint+layout for sections below the fold.
   contain-intrinsic-size prevents layout shift when they become visible. */
@media (min-width: 1025px) {
  .sec {
    content-visibility: auto;
    contain-intrinsic-size: 0 600px;
  }
  .lwt-section {
    content-visibility: auto;
    contain-intrinsic-size: 0 400px;
  }
  .connect {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
  }
}

/* ── GPU-promote composited layers for animated elements ────────────── */
.plat,
.plat-inner,
.proj-card-new,
.nav-pill,
.portrait,
.card-spot,
.btn-resume,
.btn-contact-toggle {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Remove will-change after animation settles (JS-driven hover) */
.plat:not(:hover),
.proj-card-new:not(:hover) {
  will-change: auto;
}

/* ── Cursor-trail canvas: own compositor layer ──────────────────────── */
canvas[style*="z-index:9999"] {
  will-change: contents;
}

/* ── Smooth scrolling on desktop only ─────────────────────────────── */
@media (min-width: 1025px) and (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ── Image rendering optimization ──────────────────────────────────── */
img {
  image-rendering: auto;
}
.portrait img,
.plat-ico img {
  image-rendering: -webkit-optimize-contrast;
}

/* ── Reduce paint area: use transform instead of top/left for fixed els */
.nav {
  transform: translateX(-50%) translateZ(0); /* centre + promote to own GPU layer */
}
/* On mobile the nav is top-right, not centred — restore correct transform */
@media (max-width: 600px) {
  .nav {
    transform: translateZ(0); /* keep GPU layer, drop the X centering */
  }
}

/* ── SCREEN-READER ONLY (visually hidden, SEO readable) ─────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── FORM UX IMPROVEMENTS ────────────────────────────────────────────── */

/* Required field asterisk */
.form-group label .req {
  color: #f87171;
  margin-left: 3px;
  font-size: 13px;
  line-height: 1;
  vertical-align: middle;
}

/* Form status feedback (aria-live region) */
.form-status {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--green);
  text-align: center;
  margin-top: 12px;
  min-height: 18px;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  letter-spacing: 0.04em;
}
.form-status.visible { opacity: 1; }
[data-theme="light"] .form-status { color: #15803d; }

/* Textarea: allow vertical resize only */
.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* Nav active item - reinforce with aria-current for screen readers */
.nav-a[aria-current="page"] {
  color: rgba(255,255,255,0.95);
}
[data-theme="light"] .nav-a[aria-current="page"] {
  color: rgba(0,0,0,0.9);
}

/* ── Font rendering: sub-pixel on desktop ───────────────────────────── */
@media (min-width: 1025px) {
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
}

/* ══════════════════════════════════════════
   POLISH REFINEMENTS
══════════════════════════════════════════ */

/* ── STATUS BADGE ─────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px 5px 9px;
  border: 1px solid rgba(34,197,94,0.22);
  background: rgba(34,197,94,0.05);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: #4ade80;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
  width: fit-content;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.04), 0 2px 10px rgba(34,197,94,0.07);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.status-badge:hover {
  border-color: rgba(34,197,94,0.38);
  background: rgba(34,197,94,0.09);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.06), 0 4px 14px rgba(34,197,94,0.14);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  position: relative;
}
.status-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(34,197,94,0.35);
  animation: status-ping 2.4s ease-in-out infinite;
}
@keyframes status-ping {
  0%, 100% { transform: scale(0.85); opacity: 0.9; }
  60%       { transform: scale(1.8);  opacity: 0;   }
}
[data-theme="light"] .status-badge {
  color: #15803d;
  border-color: rgba(21,128,61,0.25);
  background: rgba(21,128,61,0.05);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.9), 0 2px 10px rgba(21,128,61,0.06);
}
[data-theme="light"] .status-dot { background: #16a34a; }
[data-theme="light"] .status-dot::after { background: rgba(22,163,74,0.28); }
@media (max-width: 768px) {
  .status-badge { margin-bottom: 16px; }
}

/* ── SCROLL INDICATOR ─────────────────────── */
.scroll-indicator {
  position: absolute;
  bottom: clamp(28px, 5vh, 48px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  z-index: 5;
}
.si-text {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.6;
}
.si-line {
  width: 1px;
  height: 38px;
  background: linear-gradient(to bottom, rgba(138,138,138,0.65), transparent);
  transform-origin: top;
  animation: si-drop 2.2s cubic-bezier(0.4,0,0.6,1) infinite;
}
@keyframes si-drop {
  0%   { transform: scaleY(0); opacity: 1;   transform-origin: top;    }
  48%  { transform: scaleY(1); opacity: 1;   transform-origin: top;    }
  49%  {                                      transform-origin: bottom; }
  100% { transform: scaleY(0); opacity: 0.2; transform-origin: bottom; }
}
@media (max-width: 768px)              { .scroll-indicator { display: none; } }
@media (prefers-reduced-motion: reduce){ .scroll-indicator { display: none; } }

/* ── LABEL DECORATION ─────────────────────── */
.label::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(251,146,60,0.65);
  margin-right: 9px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  flex-shrink: 0;
}
/* Labels inside LWT eyebrow don't get the dot since it's centered */
.lwt-eyebrow::before { display: none; }

/* ── PER-CARD COLOR ACCENTS ON HOVER ─────── */
/* Color-matched spotlight radial */
.proj-card-new:has(.proj-icon-box.green)::before {
  background: radial-gradient(400px circle at var(--mouse-x,50%) var(--mouse-y,50%), rgba(34,197,94,0.09), transparent 60%);
}
.proj-card-new:has(.proj-icon-box.blue)::before {
  background: radial-gradient(400px circle at var(--mouse-x,50%) var(--mouse-y,50%), rgba(59,130,246,0.09), transparent 60%);
}
.proj-card-new:has(.proj-icon-box.yellow)::before {
  background: radial-gradient(400px circle at var(--mouse-x,50%) var(--mouse-y,50%), rgba(234,179,8,0.09), transparent 60%);
}
.proj-card-new:has(.proj-icon-box.purple)::before {
  background: radial-gradient(400px circle at var(--mouse-x,50%) var(--mouse-y,50%), rgba(168,85,247,0.09), transparent 60%);
}

/* Color-matched border + drop shadow on hover (higher specificity overrides base rule) */
.proj-card-new:has(.proj-icon-box.green):hover {
  border-color: rgba(34,197,94,0.22);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.08), 0 20px 50px -12px rgba(34,197,94,0.28);
}
.proj-card-new:has(.proj-icon-box.blue):hover {
  border-color: rgba(59,130,246,0.22);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.08), 0 20px 50px -12px rgba(59,130,246,0.28);
}
.proj-card-new:has(.proj-icon-box.yellow):hover {
  border-color: rgba(234,179,8,0.22);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.08), 0 20px 50px -12px rgba(234,179,8,0.28);
}
.proj-card-new:has(.proj-icon-box.purple):hover {
  border-color: rgba(168,85,247,0.22);
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.08), 0 20px 50px -12px rgba(168,85,247,0.28);
}
