/* ============================================================
   0. BASE
============================================================ */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}
:root{
  --bg:#04060b;
  --ink:#e9f0f8; --mut:#97a3b7; --dim:#6b7585;
  --phos:#4dff88; --phos2:#8affb4; --phosdim:#2c7a4b;
  --cyan:#6ee7ff; --violet:#a78bfa; --amber:#ffc46b;
  --mono:'JetBrains Mono',ui-monospace,monospace;
  --sans:'Inter',system-ui,sans-serif;
  --disp:'Space Grotesk',var(--sans);
  --crt-b:1; /* screen brightness (knob) */
}
html{scroll-behavior:smooth}
body{
  font-family:var(--sans); color:var(--ink); background:var(--bg);
  overflow-x:hidden; -webkit-font-smoothing:antialiased;
  background-image:
    radial-gradient(1200px 800px at 70% -10%, rgba(110,231,255,.06), transparent 60%),
    radial-gradient(1000px 700px at 12% 110%, rgba(167,139,250,.055), transparent 60%),
    radial-gradient(900px 600px at 50% 50%, rgba(77,255,136,.02), transparent 65%);
}
::selection{background:rgba(77,255,136,.25);color:#eafff2}
::-webkit-scrollbar{width:8px}
::-webkit-scrollbar-track{background:#06080f}
::-webkit-scrollbar-thumb{background:#1b2434;border-radius:4px}
::-webkit-scrollbar-thumb:hover{background:#26334a}
:focus-visible{outline:2px solid rgba(77,255,136,.55);outline-offset:3px;border-radius:6px}
a{color:inherit}

#bg-canvas{position:fixed;inset:0;width:100%;height:100%;z-index:0;pointer-events:none;transition:opacity .8s, filter 1.4s cubic-bezier(0.2, 0.8, 0.25, 1)}
/* scroll-aware contrast scrim: ~0 in hero, fades in over content bands so cards/text stay readable
   over the bright crystal glow. Opacity is driven from the scroll rAF in main.js. */
#scrim{position:fixed;inset:0;z-index:1;pointer-events:none;opacity:0;transition:opacity .3s linear;
  background:radial-gradient(130% 100% at 50% 38%,
    rgba(3,6,12,.56) 0%, rgba(3,6,12,.70) 45%, rgba(2,4,9,.88) 100%)}
/* CSS fallback blobs — only shown if WebGL fails */
.blob{position:fixed;border-radius:50%;filter:blur(90px);opacity:.16;z-index:0;pointer-events:none;display:none}
.blob.b1{width:520px;height:520px;background:#0e6e8c;top:-140px;right:-120px;animation:blobdrift 26s ease-in-out infinite alternate}
.blob.b2{width:460px;height:460px;background:#5b3fa8;bottom:-160px;left:-140px;animation:blobdrift 32s ease-in-out infinite alternate-reverse}
@keyframes blobdrift{from{transform:translate(0,0) scale(1)}to{transform:translate(60px,50px) scale(1.15)}}
html.no-webgl .blob{display:block}

/* film grain over everything (unifies glass layers) */
#grain{position:fixed;inset:-50%;width:200%;height:200%;z-index:250;pointer-events:none;opacity:.05;mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation:grainmove 1.2s steps(4) infinite;}
@keyframes grainmove{0%{transform:translate(0,0)}25%{transform:translate(-2%,1.5%)}50%{transform:translate(1.5%,-1%)}75%{transform:translate(-1%,-2%)}100%{transform:translate(2%,1%)}}

/* scroll progress */
#scrollbar-top{position:fixed;top:0;left:0;right:0;height:2px;z-index:400;pointer-events:none}
#scrollbar-top i{display:block;height:100%;width:100%;transform-origin:0 50%;transform:scaleX(0);
  background:linear-gradient(90deg,var(--phosdim),var(--phos),var(--cyan));box-shadow:0 0 12px rgba(77,255,136,.55)}

/* ============================================================
   1. LIQUID GLASS SYSTEM — Tiered Premium Glass
   Tier 1 (lg-hero, lg-feature): Full SVG lens refraction + premium glass
   Tier 2 (lg-card, .proj): Enhanced blur + pseudo-refraction + edge highlights
   Tier 3 (lg-chip, lg-btn, #dock, #orb): Lightweight optimized blur
============================================================ */

/* ---- BASE GLASS (Tier 2 default) ---- */
.lg{
  position:relative;
  border-radius:26px;
  /* More transparent — lets 3D scene breathe through */
  background:
    linear-gradient(160deg,
      rgba(255,255,255,.045) 0%,
      rgba(255,255,255,.01) 30%,
      rgba(255,255,255,.005) 50%,
      rgba(255,255,255,.01) 70%,
      rgba(255,255,255,.035) 100%
    ),
    /* Subtle colored inner glow for depth perception */
    radial-gradient(ellipse 85% 55% at 50% 15%, rgba(110,231,255,.012), transparent 65%),
    radial-gradient(ellipse 55% 35% at 50% 85%, rgba(167,139,250,.008), transparent 65%);
  /* Tier 2: Enhanced blur with saturation/contrast for optical clarity */
  backdrop-filter:blur(12px) saturate(1.9) brightness(1.015) contrast(1.06);
  -webkit-backdrop-filter:blur(12px) saturate(1.9) brightness(1.015) contrast(1.06);
  box-shadow:
    /* Deep ambient shadow */
    0 28px 72px -22px rgba(1,4,12,.78),
    0 10px 28px -10px rgba(1,4,12,.48),
    /* Crisp glass edge — barely visible */
    inset 0 0 0 1px rgba(255,255,255,.06),
    /* Top highlight */
    inset 0 1.5px 0 rgba(255,255,255,.18),
    inset 0 -1px 0 rgba(255,255,255,.03),
    /* Inner bevel for thickness */
    inset 0 14px 28px -12px rgba(255,255,255,.06),
    inset 0 -10px 20px -10px rgba(0,0,0,.12);
  transition:box-shadow .35s cubic-bezier(.2,.8,.25,1), background .25s ease, transform .45s cubic-bezier(.22,.9,.3,1.2);
}

/* Safari fallback */
html.sf .lg{
  backdrop-filter:blur(14px) saturate(1.9) brightness(1.015) contrast(1.06);
}

/* ---- TIER 1: HERO + FEATURE CARDS — Full SVG Lens Refraction ---- */
html[data-tier="A"]:not(.sf) .lg-hero,
html[data-tier="A"]:not(.sf) .lg-feature{
  backdrop-filter:url(#lensAL) blur(3px) saturate(1.95) brightness(1.03) contrast(1.1);
  -webkit-backdrop-filter:url(#lensAL) blur(3px) saturate(1.95) brightness(1.03) contrast(1.1);
}

/* ---- TIER 3: SMALL UI — Lightweight Blur ---- */
html[data-tier="A"]:not(.sf) #dock,
html[data-tier="A"]:not(.sf) #orb{
  backdrop-filter:blur(16px) saturate(1.85) brightness(1.02) contrast(1.05);
  -webkit-backdrop-filter:blur(16px) saturate(1.85) brightness(1.02) contrast(1.05);
}
html[data-tier="B"]:not(.sf) #dock,
html[data-tier="B"]:not(.sf) #orb{
  backdrop-filter:url(#lensAL) blur(2px) saturate(1.85) brightness(1.03) contrast(1.06);
}

/* ---- FAUX EDGE-REFRACTION for big feature cards without the SVG lens (Tier B/C) ---- */
html[data-tier="B"] .lg-feature, html[data-tier="C"] .lg-feature{
  background-image:
    linear-gradient(160deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,.006) 40%, rgba(255,255,255,.006) 60%, rgba(255,255,255,.05) 100%),
    radial-gradient(130% 95% at 50% -8%, rgba(120,215,255,.06), transparent 55%),
    radial-gradient(150% 120% at -8% 50%, rgba(110,255,180,.035), transparent 46%),
    radial-gradient(150% 120% at 108% 50%, rgba(180,150,255,.045), transparent 46%);
}

/* ---- CURSOR-TRACKED SPECULAR HIGHLIGHT (all tiers) ---- */
.lg::after{
  content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:
    radial-gradient(70px circle at var(--mx,50%) var(--my,18%),
      rgba(255,255,255,.34) 0%, rgba(255,255,255,.12) 22%, transparent 55%),
    radial-gradient(240px circle at var(--mx,50%) var(--my,18%),
      rgba(200,235,255,.14) 0%, rgba(255,255,255,.05) 34%, transparent 68%);
  opacity:0;transition:opacity .18s ease;
}

/* ---- CHROMATIC ABERRATION EDGE GLOW (Tier 1 + 2) ---- */
.lg::before{
  content:"";position:absolute;inset:-2px;border-radius:inherit;pointer-events:none;z-index:-1;
  opacity:0;transition:opacity .35s ease, filter .35s ease;
  box-shadow:
    -1.2px 0 5px rgba(255,60,60,.05),
    1.2px 0 5px rgba(60,60,255,.05),
    0 -1.2px 5px rgba(60,255,60,.03);
  filter:blur(1.2px);
}

/* ---- HOVER STATES ---- */
.lg:hover::after{opacity:1}
.lg:hover::before{opacity:1}

/* Hover: brighten glass slightly */
.lg:hover{
  background:
    linear-gradient(160deg,
      rgba(255,255,255,.07) 0%,
      rgba(255,255,255,.018) 30%,
      rgba(255,255,255,.008) 50%,
      rgba(255,255,255,.018) 70%,
      rgba(255,255,255,.05) 100%
    ),
    radial-gradient(ellipse 85% 55% at 50% 15%, rgba(110,231,255,.02), transparent 65%),
    radial-gradient(ellipse 55% 35% at 50% 85%, rgba(167,139,250,.012), transparent 65%);
}

/* ---- PRESS: TACTILE FEEDBACK ---- */
.lg:active{
  transform:scale(0.992);
  box-shadow:
    0 14px 36px -14px rgba(1,4,12,.82),
    0 5px 18px -5px rgba(1,4,12,.5),
    inset 0 0 0 1px rgba(255,255,255,.05),
    inset 0 2px 4px rgba(0,0,0,.18),
    inset 0 -2px 4px rgba(255,255,255,.02),
    inset 0 8px 16px -8px rgba(255,255,255,.04),
    inset 0 -6px 12px -6px rgba(0,0,0,.1);
  transition:transform .04s, box-shadow .04s;
}

/* Cursor-responsive readability: text pops on hover */
.lg:hover p,.lg:hover .stat-h span,.lg:hover .tl-t{color:#d0dce8}

/* ---- TIER 2 PSEUDO-REFRACTION (lg-card) ----
   Simulates background distortion using CSS filter on a pseudo-element.
   Much cheaper than SVG lens, runs on GPU. Only on hover to save perf. ---- */
.lg-card{
  position:relative;
  border-radius:28px;
  padding:clamp(26px,4vw,44px);
}
.lg-card::before{
  content:"";position:absolute;inset:-1px;border-radius:inherit;pointer-events:none;z-index:-1;
  opacity:0;transition:opacity .3s ease;
  /* Subtle magnification/distortion simulation */
  backdrop-filter:blur(0.8px) saturate(1.1) contrast(1.02);
  -webkit-backdrop-filter:blur(0.8px) saturate(1.1) contrast(1.02);
  /* Chromatic edge */
  box-shadow:
    -0.8px 0 3px rgba(255,60,60,.04),
    0.8px 0 3px rgba(60,60,255,.04),
    0 -0.8px 3px rgba(60,255,60,.02);
  filter:blur(0.6px);
}
.lg-card:hover::before{opacity:1}

/* Feature card variant — gets full refraction on Tier A */
.lg-feature{
  border-radius:28px;
  padding:clamp(28px,4.5vw,48px);
}

/* Hero variant — highest tier */
.lg-hero{
  border-radius:26px 26px 20px 20px;
  padding:0;
}

/* Standard card variant — cheaper blur, no SVG lens */
.lg-card{
  border-radius:28px;
  padding:clamp(26px,4vw,44px);
}
.lg-card{border-radius:28px;padding:clamp(26px,4vw,44px)}
/* ---- TIER 3: CHIPS & BUTTONS ----
   Lightweight blur, no refraction. Tier overrides in section 1 handle quality scaling. ---- */
.lg-chip{
  border-radius:999px;padding:7px 14px;font-family:var(--mono);font-size:11px;letter-spacing:.05em;
  color:var(--ink);display:inline-flex;align-items:center;gap:7px;
  /* static glass: no backdrop-filter - these sit on card glass, blur added nothing */
  background:linear-gradient(160deg,rgba(255,255,255,.105),rgba(255,255,255,.04));
  box-shadow:0 6px 18px -6px rgba(1,4,12,.5),inset 0 0 0 1px rgba(255,255,255,.08),inset 0 1px 0 rgba(255,255,255,.18);
  transition:transform .3s cubic-bezier(.22,.9,.3,1.4),box-shadow .3s ease,background .15s ease;
}
.lg-chip:hover{transform:translateY(-2px);background:linear-gradient(160deg,rgba(255,255,255,.16),rgba(255,255,255,.05))}
.lg-chip .cdot{width:6px;height:6px;border-radius:50%;flex:none}
.lg-btn{
  border-radius:999px;padding:12px 26px;font-family:var(--mono);font-size:12.5px;font-weight:500;letter-spacing:.06em;
  color:var(--ink);cursor:pointer;border:none;display:inline-flex;align-items:center;gap:9px;user-select:none;
  /* static glass: no backdrop-filter */
  background:linear-gradient(160deg,rgba(255,255,255,.14),rgba(255,255,255,.05));
  box-shadow:0 10px 28px -8px rgba(1,4,12,.6),inset 0 0 0 1px rgba(255,255,255,.1),inset 0 1.5px 1px rgba(255,255,255,.25);
  transition:transform .25s cubic-bezier(.22,.9,.3,1.4),box-shadow .3s ease,background .2s ease;text-decoration:none;
}
.lg-btn:hover{box-shadow:0 14px 34px -8px rgba(1,4,12,.7),inset 0 0 0 1px rgba(255,255,255,.18),inset 0 1.5px 1px rgba(255,255,255,.35); transform:translateY(-2px)}
.lg-btn:active{transform:translateY(1px) scale(0.98); box-shadow:0 4px 16px -6px rgba(1,4,12,.7),inset 0 0 0 1px rgba(255,255,255,.12),inset 0 1px 2px rgba(0,0,0,.18); transition:transform .05s, box-shadow .05s}
.lg-btn.primary{
  color:#03150a;
  background:linear-gradient(160deg,rgba(138,255,180,.85),rgba(77,255,136,.65));
  box-shadow:0 12px 34px -8px rgba(77,255,136,.35),inset 0 0 0 1px rgba(255,255,255,.45),inset 0 1.5px 1px rgba(255,255,255,.75);
}
.lg-btn.primary:hover{box-shadow:0 16px 44px -8px rgba(77,255,136,.5),inset 0 0 0 1px rgba(255,255,255,.55),inset 0 1.5px 1px rgba(255,255,255,.85)}
.lg-btn.primary:active{background:linear-gradient(160deg,rgba(138,255,180,1),rgba(77,255,136,.85))}

/* ============================================================
   2. NAV DOCK
============================================================ */
#dock{
  position:fixed;top:18px;left:50%;transform:translateX(-50%);z-index:300;
  display:flex;align-items:center;gap:6px;padding:9px 12px;border-radius:999px;
  max-width:calc(100vw - 32px);
  animation:dockIn 1s .3s cubic-bezier(.2,.9,.25,1.2) both;
}
@keyframes dockIn{from{opacity:0;transform:translateX(-50%) translateY(-70px)}to{opacity:1;transform:translateX(-50%) translateY(0)}}
.dock-logo{font-family:var(--mono);font-size:13px;color:var(--phos);letter-spacing:.04em;padding:0 12px 0 8px;text-shadow:0 0 14px rgba(77,255,136,.6);white-space:nowrap}
.dock-logo b{color:var(--ink);font-weight:500;text-shadow:none}
.dock-links{display:flex;gap:2px}
.dock-links a{
  font-size:13px;font-weight:500;color:var(--mut);text-decoration:none;padding:8px 15px;border-radius:999px;
  transition:color .25s,background .25s;position:relative;white-space:nowrap;
}
.dock-links a:hover{color:var(--ink)}
.dock-links a.active{color:var(--ink);background:rgba(255,255,255,.09);box-shadow:inset 0 0 0 1px rgba(255,255,255,.1),inset 0 1px 0 rgba(255,255,255,.18)}
.dock-cta{margin-left:6px;padding:9px 18px;font-size:11.5px}
#dock .lg-btn{backdrop-filter:none;-webkit-backdrop-filter:none} /* nested inside dock's backdrop */
@media(max-width:760px){
  .dock-links a{padding:8px 9px;font-size:12px}
  .dock-logo span{display:none}
  .dock-cta{display:none}
}

/* ============================================================
   3. HERO — CRT MONITOR
============================================================ */
#hero{position:relative;z-index:5;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:110px 18px 70px}
.monitor-shell{width:min(860px,94vw);position:relative;animation:monIn 1.4s .15s cubic-bezier(.2,.8,.25,1) both}
@keyframes monIn{from{opacity:0;transform:translateY(46px) scale(.96)}to{opacity:1;transform:none}}

/* Premium glass bezel when lg-feature is applied */
.monitor-shell.lg-feature .bezel{
  background:
    radial-gradient(140% 100% at 50% 0%,rgba(255,255,255,.04),transparent 55%),
    linear-gradient(165deg,#2a2d33 0%,#1e1f23 34%,#141518 68%,#0d0e10 100%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.08),
    0 0 0 2px rgba(0,0,0,.3),
    0 0 0 3.5px rgba(255,255,255,.03),
    0 40px 90px -20px rgba(0,0,0,.9),
    0 80px 160px -40px rgba(0,0,0,.7),
    inset 0 2px 2px rgba(255,255,255,.08),
    inset 0 -3px 6px rgba(0,0,0,.6),
    /* Inner phosphor glow */
    inset 0 0 60px -10px rgba(77,255,136,.03),
    inset 0 0 100px -20px rgba(110,231,255,.02);
  /* Subtle glass refraction on bezel edges */
  backdrop-filter:blur(2px) saturate(1.3);
  -webkit-backdrop-filter:blur(2px) saturate(1.3);
}

.bezel{
  position:relative;border-radius:26px 26px 20px 20px;
  padding:24px 24px 30px;transition:transform .3s ease-out;
  background:
    radial-gradient(140% 100% at 50% 0%,rgba(255,255,255,.05),transparent 55%),
    linear-gradient(165deg,#33363c 0%,#232529 34%,#16171a 68%,#101114 100%);
  box-shadow:
    0 0 0 1px #45484f, 0 0 0 2px #1b1c20, 0 0 0 3.5px #3a3d44,
    0 40px 90px -20px rgba(0,0,0,.85), 0 80px 160px -40px rgba(0,0,0,.6),
    inset 0 2px 2px rgba(255,255,255,.10), inset 0 -3px 6px rgba(0,0,0,.55);
}
.screw{position:absolute;width:11px;height:11px;border-radius:50%;
  background:radial-gradient(circle at 35% 30%,#7d818a,#3d4046 55%,#232529);
  box-shadow:inset 0 1px 1px rgba(255,255,255,.35),inset 0 -1px 1px rgba(0,0,0,.6),0 1px 1px rgba(0,0,0,.5)}
.screw::after{content:"";position:absolute;left:1.5px;right:1.5px;top:50%;height:1.4px;margin-top:-0.7px;background:linear-gradient(90deg,#101114 20%,#6a6e76 50%,#101114 80%);border-radius:1px}
.screw.tl{top:9px;left:9px;transform:rotate(21deg)} .screw.tr{top:9px;right:9px;transform:rotate(-48deg)}
.screw.bl{bottom:9px;left:9px;transform:rotate(76deg)} .screw.br{bottom:9px;right:9px;transform:rotate(-12deg)}

.vents{height:12px;margin:0 44px 14px;border-radius:3px;
  background:repeating-linear-gradient(90deg,transparent 0 7px,rgba(0,0,0,.55) 7px 10px,rgba(255,255,255,.05) 10px 11px,transparent 11px 14px);
  box-shadow:inset 0 1px 2px rgba(0,0,0,.6),0 1px 0 rgba(255,255,255,.05)}

.crt{position:relative;border-radius:16px;overflow:hidden;background:#020403;aspect-ratio:16/10;
  box-shadow:
    inset 0 0 0 2px #000, inset 0 0 0 3.5px rgba(255,255,255,.05),
    inset 0 0 90px rgba(0,0,0,.9),
    0 0 34px rgba(77,255,136,.07), 0 0 110px rgba(77,255,136,.045),
    /* Inner phosphor glow */
    inset 0 0 60px -20px rgba(77,255,136,.08),
    inset 0 0 100px -30px rgba(110,231,255,.05);
  cursor:crosshair;
  /* Subtle glass surface on CRT */
  backdrop-filter:blur(1px) saturate(1.2);
  -webkit-backdrop-filter:blur(1px) saturate(1.2);
}
/* CRT overlays: scanlines + aperture grille + vignette + glare + sweep — all above text */
.crt .fx{position:absolute;inset:0;pointer-events:none}
.fx-scan{z-index:20;opacity:.45;background:repeating-linear-gradient(0deg,transparent 0 2px,rgba(0,0,0,.22) 2px 3.5px);mix-blend-mode:multiply;animation:scanJitter 8s ease-in-out infinite}
.fx-grille{z-index:21;opacity:.5;background:repeating-linear-gradient(90deg,rgba(255,40,80,.04) 0 1px,rgba(40,255,130,.04) 1px 2px,rgba(60,120,255,.04) 2px 3px);animation:grilleShift 12s linear infinite}
.fx-vig{z-index:22;background:radial-gradient(ellipse 90% 80% at 50% 50%,transparent 50%,rgba(0,0,0,.35) 85%,rgba(0,0,0,.55) 100%);animation:vigBreathe 6s ease-in-out infinite}
.fx-glare{z-index:23;background:
  linear-gradient(112deg,transparent 26%,rgba(255,255,255,.055) 33%,rgba(255,255,255,.012) 42%,transparent 49%),
  linear-gradient(112deg,transparent 60%,rgba(255,255,255,.028) 65%,transparent 71%);
  animation:glareShift 10s ease-in-out infinite}
/* JS-driven full-CRT scan pass (see crtFace in main.js) — starts hidden */
.fx-sweep{z-index:24;height:90px;top:0;opacity:0;will-change:transform,opacity;
  background:linear-gradient(180deg,transparent,rgba(160,255,200,.06) 40%,rgba(200,255,224,.14) 50%,rgba(160,255,200,.06) 60%,transparent);
  box-shadow:0 0 18px rgba(160,255,200,.12)}

/* ===== Dithered phosphor portrait ("Harsh T.") + descending beam ===== */
.crt-face{position:absolute;z-index:11;pointer-events:none;
  right:4%;top:11%;width:42%;height:74%;
  opacity:.94;mix-blend-mode:screen;
  filter:brightness(var(--crt-b)) drop-shadow(0 0 6px rgba(77,255,136,.34));
  animation:crt-flicker 3s infinite}
.face-tag{position:absolute;z-index:12;pointer-events:none;
  right:5.5%;top:8%;width:35%;text-align:center;
  font-family:var(--mono);font-weight:700;font-size:clamp(11px,1.85vw,16px);
  letter-spacing:.30em;color:var(--phos);text-shadow:0 0 10px rgba(77,255,136,.75);
  opacity:0;animation:faceTagIn .7s 2.7s both}
@keyframes faceTagIn{from{opacity:0;transform:translateY(-6px)}to{opacity:.95;transform:none}}
/* reserve right column for the portrait on wider screens */
@media(min-width:720px){.crt-inner{padding-right:41%}}
@media(max-width:719px){.crt-face,.face-tag{display:none}}

/* Dynamic CRT overlay animations */
@keyframes scanJitter{
  0%,100%{opacity:.45;transform:translateY(0)}
  25%{opacity:.5}
  50%{opacity:.4;transform:translateY(0.5px)}
  75%{opacity:.48}
}
@keyframes grilleShift{
  0%{background-position:0 0}
  100%{background-position:6px 0}
}
@keyframes vigBreathe{
  0%,100%{opacity:1;background:radial-gradient(ellipse 90% 80% at 50% 50%,transparent 50%,rgba(0,0,0,.35) 85%,rgba(0,0,0,.55) 100%)}
  50%{opacity:.85;background:radial-gradient(ellipse 95% 85% at 50% 50%,transparent 55%,rgba(0,0,0,.28) 85%,rgba(0,0,0,.48) 100%)}
}
@keyframes glareShift{
  0%,100%{opacity:1;transform:translateX(-5%)}
  50%{opacity:.7;transform:translateX(5%)}
}

.crt-inner{position:absolute;inset:0;z-index:10;padding:clamp(18px,4.5vw,40px) clamp(20px,5vw,46px);overflow:hidden;
  filter:brightness(var(--crt-b));
  /* Subtle CRT screen curvature */
  border-radius:8px;
  box-shadow:
    inset 0 0 40px -10px rgba(0,0,0,.5),
    inset 0 0 80px -20px rgba(77,255,136,.03);
  animation: crt-flicker 3s infinite, crt-on 1s .05s cubic-bezier(.2,.85,.3,1.15) both;}
@keyframes crt-on{
  0%{transform:scaleY(.004) scaleX(.7);filter:brightness(6)}
  55%{transform:scaleY(.012) scaleX(1.02);filter:brightness(5)}
  100%{transform:scaleY(1) scaleX(1);filter:brightness(var(--crt-b))}
}
@keyframes crt-flicker{
  0%,100%{opacity:1} 
  91.8%{opacity:1} 92%{opacity:.93} 92.3%{opacity:1}
  95.8%{opacity:1} 96%{opacity:.96} 96.3%{opacity:1}
  98.7%{opacity:1} 98.9%{opacity:.97} 99.1%{opacity:1}
}
.crt.off .crt-inner{animation:crt-off .45s ease-in both}
@keyframes crt-off{to{transform:scaleY(.006);filter:brightness(4);opacity:0}}
.crt.degauss{animation:degauss .55s ease-out}
@keyframes degauss{
  0%{transform:skewX(0) scale(1);filter:hue-rotate(0deg)}
  20%{transform:skewX(2.4deg) scale(1.012,.985);filter:hue-rotate(-24deg)}
  45%{transform:skewX(-1.8deg) scale(.99,1.008);filter:hue-rotate(18deg)}
  70%{transform:skewX(.9deg) scale(1.005);filter:hue-rotate(-6deg)}
  100%{transform:none;filter:none}
}
/* terminal text */
.term{font-family:var(--mono);font-size:clamp(12px,1.75vw,14px);font-weight:500;line-height:1.85;color:var(--phos);
  text-shadow:
    0 0 6px rgba(77,255,136,.85),
    0 0 14px rgba(77,255,136,.4),
    0 0 34px rgba(77,255,136,.14);
  animation:phosphorPulse 3s ease-in-out infinite;}
.term .pr{color:#5fb7ff;text-shadow:0 0 6px rgba(95,183,255,.8)}
.term .cm{color:#dce8f2;text-shadow:0 0 5px rgba(220,232,242,.35)}
.term .dim{color:var(--phosdim);text-shadow:none}
.term .out{color:var(--phos2)}
.term .ok{color:#aaffcc;text-shadow:0 0 10px rgba(170,255,204,.7)}
.term .err{color:#ff7d6b}
.term pre{font-family:inherit;line-height:1.16;font-size:clamp(8px,1.6vw,12px);color:var(--phos2);opacity:.9;margin:4px 0}
.term .hi{
  display:block;font-size:clamp(32px,7vw,72px);font-weight:700;letter-spacing:.03em;line-height:1.02;margin:10px 0 2px;color:#eafff2;
  text-shadow:
    0 0 8px rgba(77,255,136,1),
    0 0 22px rgba(77,255,136,.75),
    0 0 54px rgba(77,255,136,.4),
    0 0 110px rgba(77,255,136,.18);
  animation:hiIn 1s cubic-bezier(.2,.8,.3,1.1) both, phosphorPulse 2.5s ease-in-out infinite;}
@keyframes hiIn{from{opacity:0;letter-spacing:.4em;filter:blur(8px)}to{opacity:1;letter-spacing:.03em;filter:blur(0)}}
@keyframes phosphorPulse{
  0%,100%{
    text-shadow:
      0 0 6px rgba(77,255,136,.85),
      0 0 14px rgba(77,255,136,.4),
      0 0 34px rgba(77,255,136,.14);
  }
  50%{
    text-shadow:
      0 0 10px rgba(77,255,136,1),
      0 0 22px rgba(77,255,136,.6),
      0 0 48px rgba(77,255,136,.25),
      0 0 80px rgba(77,255,136,.12);
  }
}
@keyframes nameBreathe{0%,100%{text-shadow:0 0 8px rgba(77,255,136,1),0 0 22px rgba(77,255,136,.75),0 0 54px rgba(77,255,136,.4),0 0 110px rgba(77,255,136,.18)}50%{text-shadow:0 0 14px rgba(234,255,242,1),0 0 36px rgba(77,255,136,.9),0 0 80px rgba(77,255,136,.6),0 0 140px rgba(77,255,136,.25)}}
.term .hi{animation:hiIn 1s cubic-bezier(.2,.8,.3,1.1) both,nameBreathe 4s 1.2s ease-in-out infinite}
.term .role{display:block;font-size:clamp(11px,2.2vw,16px);color:var(--phos2);letter-spacing:.28em;margin:2px 0 10px;text-transform:uppercase;
  text-shadow:0 0 10px rgba(138,255,180,.5);animation:hiIn 1s .15s cubic-bezier(.2,.8,.3,1.1) both}
.term .badges{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px;animation:hiIn .9s .3s both}
.term .badge{font-size:9.5px;letter-spacing:.1em;border:1px solid rgba(77,255,136,.4);color:var(--phos2);border-radius:4px;padding:3px 9px;
  box-shadow:0 0 10px rgba(77,255,136,.12), inset 0 0 8px rgba(77,255,136,.08)}
.term .badge.live{border-color:rgba(138,255,180,.7)}
.term .badge.live::before{content:'';display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--phos);margin-right:6px;
  box-shadow:0 0 8px var(--phos)}
.term .cur{display:inline-block;width:9px;height:1.05em;background:var(--phos);vertical-align:text-bottom;margin-left:2px;
  box-shadow:0 0 9px rgba(77,255,136,.9);animation:phosphorPulse 1s ease-in-out infinite}
@keyframes blink{50%{opacity:0}}
/* chin: brand + knob + led */
.chin{display:flex;align-items:center;justify-content:center;gap:18px;margin-top:16px}
.chin .brand{font-family:var(--mono);font-size:9px;letter-spacing:.34em;color:#5a5e66;text-transform:uppercase;user-select:none}
.knob{width:22px;height:22px;border-radius:50%;cursor:pointer;position:relative;
  background:radial-gradient(circle at 38% 30%,#4a4d54,#22242a 60%,#15161a);
  box-shadow:inset 0 1.5px 1px rgba(255,255,255,.25),inset 0 -2px 3px rgba(0,0,0,.6),0 2px 4px rgba(0,0,0,.5);
  transition:transform .45s cubic-bezier(.3,1.4,.4,1)}
.knob::after{content:"";position:absolute;top:2.5px;left:50%;width:2px;height:6.5px;margin-left:-1px;border-radius:2px;
  background:linear-gradient(#cfd3da,#7d818a);box-shadow:0 0 3px rgba(0,0,0,.6)}
.knob:hover{box-shadow:inset 0 1.5px 1px rgba(255,255,255,.3),inset 0 -2px 3px rgba(0,0,0,.6),0 0 12px rgba(77,255,136,.25)}
.led{width:9px;height:9px;border-radius:50%;cursor:pointer;flex:none;
  background:var(--phos);box-shadow:0 0 7px rgba(77,255,136,.95),0 0 16px rgba(77,255,136,.5);transition:.3s}
.desk-glow{width:min(560px,80vw);height:46px;margin-top:6px;border-radius:50%;
  background:radial-gradient(ellipse at center,rgba(77,255,136,.14),rgba(110,231,255,.06) 45%,transparent 72%);
  filter:blur(6px)}
.scroll-hint{margin-top:44px;display:flex;flex-direction:column;align-items:center;gap:10px;animation:hint 2.4s ease-in-out infinite}
.scroll-hint span{font-family:var(--mono);font-size:10px;letter-spacing:.4em;color:var(--mut)}
.scroll-hint i{width:1px;height:44px;background:linear-gradient(180deg,var(--phos),transparent);box-shadow:0 0 8px rgba(77,255,136,.5)}
@keyframes hint{0%,100%{opacity:.35;transform:translateY(0)}50%{opacity:.85;transform:translateY(7px)}}

/* ============================================================
   4. TICKER
============================================================ */
.ticker{position:relative;z-index:5;margin:-30px auto 0;width:min(880px,92vw);overflow:hidden;border-radius:999px;
  background:linear-gradient(160deg,rgba(255,255,255,.06),rgba(255,255,255,.015));
  backdrop-filter:blur(14px) saturate(1.6);-webkit-backdrop-filter:blur(14px) saturate(1.6);
  box-shadow:0 10px 30px -10px rgba(1,4,12,.5),inset 0 0 0 1px rgba(255,255,255,.08),inset 0 1px 0 rgba(255,255,255,.14);
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent);
  mask-image:linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent)}
.ticker-track{display:flex;gap:0;width:max-content;animation:tick 30s linear infinite;padding:11px 0}
.ticker span{font-family:var(--mono);font-size:11px;font-weight:500;letter-spacing:.14em;color:var(--mut);white-space:nowrap;padding:0 26px}
.ticker b{color:var(--phos);font-weight:400}
@keyframes tick{to{transform:translateX(-50%)}}

/* ============================================================
   5. SECTIONS
============================================================ */
main{position:relative;z-index:5}
.wrap{max-width:1080px;margin:0 auto;padding:0 24px}
section.block{padding:92px 0 10px}
.sec-head{margin-bottom:30px}
.kicker{font-family:var(--mono);font-size:11px;letter-spacing:.32em;color:var(--phos);text-transform:uppercase;display:flex;align-items:center;gap:12px;margin-bottom:14px}
.kicker::before{content:"";width:26px;height:1px;background:linear-gradient(90deg,transparent,var(--phos));box-shadow:0 0 8px rgba(77,255,136,.6)}
.sec-title{
  font-family:var(--disp);
  font-size:clamp(36px,5.5vw,64px);
  font-weight:700;
  letter-spacing:-.025em;
  line-height:1.04;
  color:transparent;
  background:linear-gradient(110deg, #8b96a8 0%, #8b96a8 35%, #ffffff 48%, #dff2ff 52%, #8b96a8 65%, #8b96a8 100%);
  background-size:300% 100%;
  background-position:300% 0;
  -webkit-background-clip:text;
  background-clip:text;
}
.sec-title.shimmer-active{animation:cineGlow 2.2s cubic-bezier(.16,1,.3,1) forwards}
@keyframes cineGlow{
  0%{background-position:300% 0; background-image:linear-gradient(110deg, #8b96a8 0%, #8b96a8 35%, #ffffff 48%, #dff2ff 52%, #8b96a8 65%, #8b96a8 100%);}
  60%{background-position:-100% 0; background-image:linear-gradient(110deg, #dbe4f0 20%, #ffffff 45%, #ffffff 55%, #dbe4f0 80%);}
  100%{background-position:-200% 0; background-image:linear-gradient(110deg, #8b96a8 0%, #c8d4e8 35%, #ffffff 48%, #e8f4ff 52%, #c8d4e8 65%, #8b96a8 100%);}
}
.sec-title .char{transition:opacity .02s}
.sec-lead{color:var(--mut);font-size:15px;max-width:560px;margin-top:12px;line-height:1.75}

/* Data stream divider */
.data-stream{width:100%;height:1px;background:rgba(255,255,255,.06);position:relative;margin:90px 0;overflow:hidden}
.data-stream::after{content:'';position:absolute;top:0;left:-200px;width:200px;height:100%;
  background:linear-gradient(90deg,transparent,var(--phos),transparent);box-shadow:0 0 12px var(--phos);
  animation:streamFlow 5s cubic-bezier(.3,0,.7,1) infinite}
@keyframes streamFlow{0%{left:-200px}100%{left:100%}}

/* about */
.about-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:clamp(26px,4vw,52px)}
.about-grid>div,.contact-grid>div{min-width:0}
.about-grid h2{font-family:var(--disp);font-size:clamp(28px,3.8vw,42px);font-weight:700;line-height:1.12;margin-bottom:18px;letter-spacing:-.02em;
  background:linear-gradient(150deg,#fff,rgba(255,255,255,.55));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}
.about-grid p{color:#a8b6c8;font-size:14.5px;line-height:1.9;margin-bottom:14px}
.about-grid p b{color:var(--ink);font-weight:500}
.lg:hover p{color:#c0ccdb}
.about-cta{display:flex;gap:12px;flex-wrap:wrap;margin-top:22px}
.loc{display:flex;align-items:center;gap:8px;font-family:var(--mono);font-size:11px;color:var(--dim);margin-bottom:18px;letter-spacing:.08em}
.loc i{color:var(--phos)}
.skills{display:flex;flex-wrap:wrap;gap:9px;margin-bottom:30px}
.stats .stat{margin-bottom:17px}
.stat-h{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:7px}
.stat-h span{font-size:12.5px;color:var(--mut)}
.stat-h b{font-family:var(--mono);font-size:12px;font-weight:500;color:var(--cyan);text-shadow:0 0 10px rgba(110,231,255,.4)}
.stat-bar{height:4px;border-radius:99px;background:rgba(255,255,255,.06);overflow:hidden;box-shadow:inset 0 1px 2px rgba(0,0,0,.4)}
.stat-fill{height:100%;width:0;border-radius:99px;background:linear-gradient(90deg,var(--phosdim),var(--phos) 60%,var(--cyan));
  box-shadow:0 0 10px rgba(77,255,136,.5);transition:width 1.4s cubic-bezier(.25,.8,.25,1)}
/* timeline */
.timeline{margin-top:34px;border-top:1px solid rgba(255,255,255,.07);padding-top:28px;overflow-x:auto;scrollbar-width:none}
.timeline::-webkit-scrollbar{display:none}
.tl-track{display:flex;min-width:640px}
.tl-item{flex:1;position:relative;padding:26px 14px 0 14px}
.tl-item::before{content:"";position:absolute;top:5px;left:0;right:0;height:2px;background:rgba(255,255,255,.07);border-radius:2px}
.tl-item::after{content:"";position:absolute;top:1.5px;left:14px;width:9px;height:9px;border-radius:50%;
  background:var(--phos);box-shadow:0 0 10px rgba(77,255,136,.8)}
.tl-item:nth-child(2)::after{background:var(--cyan);box-shadow:0 0 10px rgba(110,231,255,.8)}
.tl-item:nth-child(3)::after{background:var(--violet);box-shadow:0 0 10px rgba(167,139,250,.8)}
.tl-item:nth-child(4)::after{background:var(--amber);box-shadow:0 0 10px rgba(255,196,107,.8)}
.tl-item:nth-child(5)::after{background:var(--phos2);box-shadow:0 0 10px rgba(138,255,180,.8)}
.tl-y{font-family:var(--mono);font-size:12px;color:var(--ink);font-weight:500;margin-bottom:4px}
.tl-t{font-size:11.5px;color:var(--dim);line-height:1.5}

/* projects */
.proj-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(300px,100%),1fr));gap:18px}
.proj-top{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:16px;transform:translateZ(30px)}
.proj-yr{font-family:var(--mono);font-size:10.5px;color:var(--dim);letter-spacing:.1em;padding:4px 10px;border-radius:99px;
  background:rgba(255,255,255,.05);box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}
.proj h3{font-family:var(--disp);font-size:clamp(18px,2.2vw,22px);font-weight:700;margin-bottom:8px;transform:translateZ(26px);letter-spacing:-.01em}
.proj p{font-size:13px;color:#b9c5d6;line-height:1.75;margin-bottom:16px;transform:translateZ(20px)}
.proj-tags{display:flex;flex-wrap:wrap;gap:6px;transform:translateZ(16px)}
.proj-tags span{font-family:var(--mono);font-size:9.5px;letter-spacing:.05em;color:var(--cyan);
  padding:3.5px 10px;border-radius:99px;background:rgba(110,231,255,.07);box-shadow:inset 0 0 0 1px rgba(110,231,255,.16)}

/* contact */
.contact-grid{display:grid;grid-template-columns:1fr 1fr;gap:clamp(26px,4vw,48px)}
.c-links{display:flex;flex-direction:column;gap:10px;margin-top:24px}
.c-link{display:flex;align-items:center;gap:14px;padding:13px 16px;border-radius:16px;text-decoration:none;
  background:rgba(255,255,255,.04);box-shadow:inset 0 0 0 1px rgba(255,255,255,.07),inset 0 1px 0 rgba(255,255,255,.08);
  font-size:13.5px;color:var(--mut);transition:transform .2s cubic-bezier(.22,.9,.3,1.4), color .2s, background .2s, box-shadow .2s}
.c-link:hover{color:var(--ink);background:rgba(255,255,255,.07);transform:translateX(5px);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.14),inset 0 1px 0 rgba(255,255,255,.14),0 8px 24px -10px rgba(0,0,0,.5)}
.c-link:active{transform:translateX(2px) scale(0.98); background:rgba(255,255,255,.1); box-shadow:inset 0 0 0 1px rgba(255,255,255,.1),inset 0 1px 2px rgba(0,0,0,.1); transition:transform .05s, box-shadow .05s, background .05s}
.c-link i{width:20px;font-size:17px;color:var(--cyan);text-shadow:0 0 12px rgba(110,231,255,.4)}
.c-link .arr{margin-left:auto;color:var(--dim);font-size:14px;transition:transform .2s cubic-bezier(.22,.9,.3,1.4)}
.c-link:hover .arr{transform:translateX(3px)}
.c-link:active .arr{transform:translateX(1px) scale(0.95)}
.form .frow{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.field{position:relative;margin-bottom:12px}
.field input,.field textarea{
  width:100%;padding:14px 16px;border-radius:15px;border:none;outline:none;resize:none;
  font-family:var(--sans);font-size:13.5px;color:var(--ink);
  background:rgba(0,0,0,.28);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.09),inset 0 2px 6px rgba(0,0,0,.35);
  transition:box-shadow .3s ease}
.field input::placeholder,.field textarea::placeholder{color:var(--dim)}
.field input:focus,.field textarea:focus{box-shadow:inset 0 0 0 1px rgba(77,255,136,.5),inset 0 2px 6px rgba(0,0,0,.35),0 0 0 3px rgba(77,255,136,.12)}
.field.shake{animation:shake .4s}
@keyframes shake{0%,100%{transform:none}25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}

footer{position:relative;z-index:5;text-align:center;padding:70px 20px 46px;font-family:var(--mono);font-size:11px;color:#3d4654;letter-spacing:.06em}
footer .ok{color:var(--phosdim)}
footer .ok::before{content:"●";color:var(--phos);margin-right:7px;text-shadow:0 0 8px rgba(77,255,136,.7)}
footer b{color:var(--mut);font-weight:400}

/* ============================================================
   6. LIQUID ORB (draggable lens) + toast
============================================================ */
#orb{
  position:fixed;z-index:260;width:128px;height:128px;border-radius:50%;cursor:grab;user-select:none;touch-action:none;
  top:7vh;right:5vw;
  /* Tier 3 base: lightweight */
  backdrop-filter:blur(6px) saturate(2.1) brightness(1.12) contrast(1.15);
  -webkit-backdrop-filter:blur(6px) saturate(2.1) brightness(1.12) contrast(1.15);
  background:
    radial-gradient(circle at 32% 26%,rgba(255,255,255,.22) 0%, rgba(255,255,255,.04) 30%, rgba(255,255,255,.008) 50%, rgba(255,255,255,.05) 70%, rgba(255,255,255,.02) 100%),
    /* Internal caustic glow */
    radial-gradient(ellipse 65% 65% at 38% 28%, rgba(110,231,255,.06), transparent 70%),
    radial-gradient(ellipse 45% 45% at 72% 72%, rgba(167,139,250,.04), transparent 70%),
    /* Subtle rainbow edge */
    conic-gradient(from 0deg at 50% 50%, 
      rgba(255,60,60,.03) 0deg, 
      rgba(60,255,60,.03) 120deg, 
      rgba(60,60,255,.03) 240deg, 
      rgba(255,60,60,.03) 360deg);
  box-shadow:
    0 32px 70px -18px rgba(1,4,12,.85),
    inset 0 0 0 1px rgba(255,255,255,.2),
    inset 0 4px 4px rgba(255,255,255,.45),
    inset 0 -4px 5px rgba(255,255,255,.12),
    inset 0 0 40px rgba(255,255,255,.08);
  animation:orbFloat 6s ease-in-out infinite;
  transition:box-shadow .3s ease, transform .2s ease, backdrop-filter .3s ease;
}
html.sf #orb{backdrop-filter:blur(8px) saturate(2.0) brightness(1.1) contrast(1.1)}
/* TIER A ONLY: Full lensBL refraction — the showcase piece */
html[data-tier="A"]:not(.sf) #orb{
  backdrop-filter:url(#lensBL) blur(4px) saturate(2.15) brightness(1.15) contrast(1.2);
  -webkit-backdrop-filter:url(#lensBL) blur(4px) saturate(2.15) brightness(1.15) contrast(1.2);
  /* Animated internal caustics on Tier A */
  background:
    radial-gradient(circle at 32% 26%,rgba(255,255,255,.25) 0%, rgba(255,255,255,.04) 30%, rgba(255,255,255,.008) 50%, rgba(255,255,255,.05) 70%, rgba(255,255,255,.02) 100%),
    radial-gradient(ellipse 65% 65% at 38% 28%, rgba(110,231,255,.08), transparent 70%),
    radial-gradient(ellipse 45% 45% at 72% 72%, rgba(167,139,250,.05), transparent 70%),
    conic-gradient(from 0deg at 50% 50%, 
      rgba(255,60,60,.04) 0deg, 
      rgba(60,255,60,.04) 120deg, 
      rgba(60,60,255,.04) 240deg, 
      rgba(255,60,60,.04) 360deg);
  box-shadow:
    0 36px 80px -20px rgba(1,4,12,.9),
    inset 0 0 0 1px rgba(255,255,255,.25),
    inset 0 5px 5px rgba(255,255,255,.5),
    inset 0 -5px 6px rgba(255,255,255,.15),
    inset 0 0 50px rgba(255,255,255,.1);
}
html[data-tier="B"]:not(.sf) #orb{
  backdrop-filter:url(#lensBL) blur(2px) saturate(2.0) brightness(1.1) contrast(1.1);
}
#orb:active{cursor:grabbing; transform:scale(0.9); box-shadow:
  0 18px 40px -12px rgba(1,4,12,.9),
  inset 0 0 0 1px rgba(255,255,255,.3),
  inset 0 3px 5px rgba(255,255,255,.5),
  inset 0 -3px 5px rgba(255,255,255,.15),
  inset 0 0 25px rgba(255,255,255,.1);
}
#orb .orb-hint{position:absolute;inset:0;display:grid;place-items:center;font-family:var(--mono);font-size:9px;letter-spacing:.3em;
  color:rgba(255,255,255,.75);text-shadow:0 1px 4px rgba(0,0,0,.6);pointer-events:none;opacity:.9;transition:opacity .5s}
#orb.seen .orb-hint{opacity:0}
@keyframes orbFloat{0%,100%{margin-top:0}50%{margin-top:-12px}}
#toast{position:fixed;bottom:26px;right:26px;z-index:500;padding:14px 20px;border-radius:16px;font-family:var(--mono);font-size:12px;
  color:var(--ink);opacity:0;transform:translateY(16px);transition:.45s cubic-bezier(.2,.9,.3,1.2);pointer-events:none;
  background:linear-gradient(160deg,rgba(255,255,255,.1),rgba(255,255,255,.03));
  backdrop-filter:blur(18px) saturate(1.7);-webkit-backdrop-filter:blur(18px) saturate(1.7);
  box-shadow:0 20px 50px -12px rgba(0,0,0,.6),inset 0 0 0 1px rgba(255,255,255,.12),inset 0 1px 0 rgba(255,255,255,.22)}
#toast.show{opacity:1;transform:none}
#toast .tk{color:var(--phos)}

/* ============================================================
   6b. PREMIUM LAYER — cursor / word reveal / marquee / shine
============================================================ */
/* .cursor-dot / .cursor-ring / .cursor-ring.hot are defined once in the CURSOR TRAIL block below */
.sec-title .w{display:inline-block;opacity:0;transform:translateY(26px) rotate(3deg);
  transition:opacity .8s ease,transform .8s cubic-bezier(.2,.8,.25,1)}
.reveal.in .sec-title .w{opacity:1;transform:none}
.foot-marquee{overflow:hidden;margin:0 0 36px;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 14%,#000 86%,transparent);
  mask-image:linear-gradient(90deg,transparent,#000 14%,#000 86%,transparent)}
.fm-track{display:flex;width:max-content;animation:tick 26s linear infinite;
  font-family:var(--disp);font-weight:700;font-size:clamp(58px,9vw,130px);line-height:1;letter-spacing:.03em;
  color:transparent;-webkit-text-stroke:1.5px rgba(233,240,248,.20)}
.fm-track span{white-space:nowrap;padding-right:.5em}
.lg-btn{position:relative;overflow:hidden}
.lg-btn::before{content:"";position:absolute;top:0;left:-80%;width:45%;height:100%;transform:skewX(-24deg);
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.30),transparent);
  transition:left .65s ease;pointer-events:none}
.lg-btn:hover::before{left:135%}
.spin{display:inline-block;animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* ============================================================
   7. REVEALS + RESPONSIVE
============================================================ */
.reveal{opacity:0;transform:translateY(30px);filter:blur(6px);transition:opacity .9s ease,transform .9s cubic-bezier(.2,.8,.25,1),filter .9s ease;transition-delay:var(--d,0s)}
.reveal.in{opacity:1;transform:none;filter:blur(0)}
@media(max-width:860px){
  .about-grid,.contact-grid{grid-template-columns:1fr}
  .form .frow{grid-template-columns:1fr}
  #orb{display:none}
  section.block{padding:66px 0 6px}
  #hero{padding-top:96px}
}
/* mobile glass: skip SVG lens on tiny elements (perf), keep it on cards */
@media(max-width:640px){
  .field input,.field textarea{font-size:16px} /* stops iOS zoom-on-focus */
  #toast{left:16px;right:16px;max-width:none}
  .lg-card{border-radius:22px;padding:24px 18px}
  .proj{padding:20px}
  .sec-head{margin-bottom:22px}
}
@media(max-width:420px){
  #dock{gap:2px;padding:8px 8px}
  .dock-links a{padding:8px 7px;font-size:11.5px}
  .dock-logo{padding:0 6px 0 4px;font-size:12px}
  .chin .brand{letter-spacing:.2em}
}
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.2s !important}
  #grain{display:none}
}
/* skill chip stagger-in */
.skills .lg-chip{opacity:0;transform:translateY(12px);transition:opacity .5s ease,transform .5s cubic-bezier(.2,.8,.3,1)}
.reveal.in .skills .lg-chip{opacity:1;transform:none}
.reveal.in .skills .lg-chip:nth-child(1){transition-delay:.05s}
.reveal.in .skills .lg-chip:nth-child(2){transition-delay:.1s}
.reveal.in .skills .lg-chip:nth-child(3){transition-delay:.15s}
.reveal.in .skills .lg-chip:nth-child(4){transition-delay:.2s}
.reveal.in .skills .lg-chip:nth-child(5){transition-delay:.25s}
.reveal.in .skills .lg-chip:nth-child(6){transition-delay:.3s}
.reveal.in .skills .lg-chip:nth-child(7){transition-delay:.35s}
.reveal.in .skills .lg-chip:nth-child(8){transition-delay:.4s}
.reveal.in .skills .lg-chip:nth-child(9){transition-delay:.45s}
.reveal.in .skills .lg-chip:nth-child(10){transition-delay:.5s}
.reveal.in .skills .lg-chip:nth-child(11){transition-delay:.55s}
.reveal.in .skills .lg-chip:nth-child(12){transition-delay:.6s}
.reveal.in .skills .lg-chip:nth-child(13){transition-delay:.65s}
.reveal.in .skills .lg-chip:nth-child(14){transition-delay:.7s}
.reveal.in .skills .lg-chip:nth-child(15){transition-delay:.75s}
/* stat bar glow pulse after fill */
@keyframes barGlow{0%,100%{box-shadow:0 0 10px rgba(77,255,136,.5)}50%{box-shadow:0 0 18px rgba(77,255,136,.9),0 0 28px rgba(110,231,255,.4)}}
.stat-fill.done{animation:barGlow 2s ease-in-out 1}

/* ---- Project card stagger on grid entry ---- */
/* Cards start as reveal elements; give each a progressively longer delay */
.proj-grid .proj:nth-child(1){--d:0s}
.proj-grid .proj:nth-child(2){--d:.07s}
.proj-grid .proj:nth-child(3){--d:.14s}
.proj-grid .proj:nth-child(4){--d:.21s}
.proj-grid .proj:nth-child(5){--d:.28s}
.proj-grid .proj:nth-child(6){--d:.35s}

/* ---- Section micro-animations: kicker → lead ---- */
/* kicker line gets a subtle left-slide in */
.kicker{opacity:0;transform:translateX(-14px);transition:opacity .6s ease, transform .6s cubic-bezier(.2,.8,.25,1)}
.reveal.in .kicker{opacity:1;transform:none}
/* sec-lead fades in slightly after title */
.sec-lead{opacity:0;transform:translateY(10px);transition:opacity .7s ease, transform .7s cubic-bezier(.2,.8,.25,1);transition-delay:.5s}
.reveal.in .sec-lead{opacity:1;transform:none}

/* contact links stagger in */
.c-links .c-link{opacity:0;transform:translateX(-12px);transition:opacity .5s ease, transform .5s cubic-bezier(.2,.8,.25,1), color .3s ease, background .3s ease, box-shadow .3s ease}
.reveal.in .c-links .c-link{opacity:1;transform:none}
.reveal.in .c-links .c-link:nth-child(1){transition-delay:.1s}
.reveal.in .c-links .c-link:nth-child(2){transition-delay:.18s}
.reveal.in .c-links .c-link:nth-child(3){transition-delay:.26s}
.reveal.in .c-links .c-link:nth-child(4){transition-delay:.34s}
.reveal.in .c-links .c-link:nth-child(5){transition-delay:.42s}
/* Restore hover on contact links (override the opacity:0 when hovered) */
.reveal.in .c-links .c-link:hover{color:var(--ink);background:rgba(255,255,255,.07);transform:translateX(5px);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.14),inset 0 1px 0 rgba(255,255,255,.14),0 8px 24px -10px rgba(0,0,0,.5)}
/* footer marquee visibility boost */
.fm-track{-webkit-text-stroke:1.5px rgba(233,240,248,.28)}
/* orb inner glow */
#orb::before{content:'';position:absolute;inset:20%;border-radius:50%;
  background:radial-gradient(circle,rgba(110,231,255,.15),transparent 70%);pointer-events:none;z-index:-1}
/* skip-to-content link (a11y) */
.sr-skip{position:absolute;top:-50px;left:0;background:#000;color:#fff;padding:8px 18px;z-index:999;font-size:13px;
  transition:top .3s ease;border-radius:0 0 8px 0;text-decoration:none}
.sr-skip:focus{top:0}

/* ============================================================
   GLASS WOBBLE HOVER
============================================================ */
@keyframes glassWobble{
  0%{transform:perspective(1100px) rotateX(0) rotateY(0) scale(1)}
  20%{transform:perspective(1100px) rotateX(-.6deg) rotateY(.8deg) scale(1.004)}
  40%{transform:perspective(1100px) rotateX(.4deg) rotateY(-.5deg) scale(1.002)}
  60%{transform:perspective(1100px) rotateX(-.2deg) rotateY(.3deg) scale(1.001)}
  100%{transform:perspective(1100px) rotateX(0) rotateY(0) scale(1)}
}
.lg-card.wobble,.lg-feature.wobble{animation:glassWobble .7s ease-out}

/* ============================================================
   IMPROVED PROJECT CARD HOVER + PRESS
   — premium lift + color glow + icon pop + instant link reveal
============================================================ */
.proj{
  border-radius:22px;padding:24px;cursor:pointer;transform-style:preserve-3d;
  transition:
    box-shadow .38s cubic-bezier(.2,.8,.25,1),
    transform .28s cubic-bezier(.2,.8,.25,1),
    opacity .8s ease,
    filter .8s ease
}
/* lg-feature base provides glass; proj adds accent glow */
/* readability floor: a dark base painted UNDER the glass gradients (background-color
   sits below background-image) so cards stay legible over the bright crystal glow. */
.proj{background-color:rgba(8,12,20,.48)}
.proj:hover{background-color:rgba(8,12,20,.40)}
.proj:hover{
  transform:translateY(-5px);
  box-shadow:
    0 28px 60px -14px rgba(1,4,12,.82),
    0 8px 20px rgba(1,4,12,.4),
    inset 0 0 0 1px rgba(255,255,255,.20),
    inset 0 1.5px 1px rgba(255,255,255,.36),
    inset 0 20px 34px -20px rgba(255,255,255,.18),
    0 0 52px -12px var(--pg,rgba(110,231,255,.4))
}
.proj:active{
  transform:translateY(-2px) scale(0.99);
  box-shadow:
    0 12px 28px -8px rgba(1,4,12,.8),
    0 4px 12px rgba(1,4,12,.4),
    inset 0 0 0 1px rgba(255,255,255,.15),
    inset 0 1px 2px rgba(0,0,0,.15),
    0 0 30px -8px var(--pg,rgba(110,231,255,.3));
  transition:transform .05s, box-shadow .05s;
}

/* Colored top accent bar — width expands on hover */
.proj-accent{
  position:absolute;top:0;left:0;right:0;height:2px;border-radius:22px 22px 0 0;
  background:linear-gradient(90deg,var(--pg,rgba(110,231,255,.6)),transparent 70%);
  opacity:0;transform:scaleX(0);transform-origin:left;
  transition:opacity .35s ease, transform .45s cubic-bezier(.2,.8,.25,1)
}
.proj:hover .proj-accent{opacity:1;transform:scaleX(1)}

/* Icon gets a gentle pop on hover */
.proj-ico{
  width:44px;height:44px;border-radius:13px;display:grid;place-items:center;font-size:20px;color:var(--ink);
  background:linear-gradient(160deg,rgba(255,255,255,.14),rgba(255,255,255,.03));
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.12),inset 0 1px 0 rgba(255,255,255,.25),0 8px 20px -8px var(--pg,rgba(110,231,255,.35));
  transition:transform .3s cubic-bezier(.2,.9,.3,1.4), box-shadow .3s ease
}
.proj:hover .proj-ico{
  transform:scale(1.12);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.2),inset 0 1px 0 rgba(255,255,255,.35),0 10px 26px -6px var(--pg,rgba(110,231,255,.55))
}

/* proj-more link: always visible (but dim) on card — slides in crisp on hover */
.proj-more{
  display:inline-flex;align-items:center;gap:6px;margin-top:14px;
  font-family:var(--mono);font-size:11px;color:var(--phos);text-decoration:none;
  opacity:0;transform:translateX(-6px) translateZ(22px);
  transition:opacity .28s ease, transform .28s cubic-bezier(.2,.8,.25,1)
}
.proj:hover .proj-more,.proj:focus-within .proj-more{opacity:1;transform:translateX(0) translateZ(22px)}
.proj.is-live{cursor:pointer}
.proj-more:focus-visible{outline:2px solid var(--phos);outline-offset:3px;border-radius:4px}
@media (hover:none){.proj.is-live .proj-more{opacity:.9;transform:translateX(0) translateZ(22px)}}

/* ============================================================
   CURSOR TRAIL — comet tail with fading dots
============================================================ */
.cursor-dot{position:fixed;z-index:600;width:6px;height:6px;border-radius:50%;background:#eafff2;
  box-shadow:0 0 10px rgba(77,255,136,.8);pointer-events:none;transform:translate(-50%,-50%)}
.cursor-ring{position:fixed;z-index:599;width:34px;height:34px;border-radius:50%;
  border:1.5px solid rgba(233,240,248,.32);pointer-events:none;transform:translate(-50%,-50%);
  transition:width .25s ease,height .25s ease,border-color .25s ease,background .25s ease}
.cursor-ring.hot{width:54px;height:54px;border-color:rgba(77,255,136,.7);background:rgba(77,255,136,.06)}
.trail-dot{position:fixed;z-index:598;width:4px;height:4px;border-radius:50%;
  background:rgba(77,255,136,.6);pointer-events:none;transform:translate(-50%,-50%);
  transition:opacity .1s ease;
  box-shadow:0 0 6px rgba(77,255,136,.4)}
@media(pointer:coarse){.cursor-dot,.cursor-ring,.trail-dot{display:none}}

/* ============================================================
   MAGNETIC BUTTONS — pull animation on nav links
============================================================ */
.dock-links a,.lg-btn,.c-link{transition:transform .3s cubic-bezier(.22,.9,.3,1.4),color .25s,background .25s}

/* ============================================================
   SCROLL STORYTELLING — hero pin styles
============================================================ */
.hero-pin{position:relative;z-index:10}
#hero.pinned .monitor-shell{will-change:transform,opacity,filter}

/* Section entrance: slide from different directions */
.reveal-left{opacity:0;transform:translateX(-60px);filter:blur(6px);transition:opacity .9s ease,transform .9s cubic-bezier(.2,.8,.25,1),filter .9s ease}
.reveal-right{opacity:0;transform:translateX(60px);filter:blur(6px);transition:opacity .9s ease,transform .9s cubic-bezier(.2,.8,.25,1),filter .9s ease}
.reveal-scale{opacity:0;transform:scale(.92);filter:blur(6px);transition:opacity .9s ease,transform .9s cubic-bezier(.2,.8,.25,1),filter .9s ease}
.reveal-left.in,.reveal-right.in,.reveal-scale.in{opacity:1;transform:none;filter:blur(0)}

/* ---- adaptive quality: trim GPU-costly overlays on lighter tiers / under load ---- */
html[data-tier="B"] #grain, html[data-tier="C"] #grain, html.lowfx #grain{display:none}
html.lowfx .trail-dot{display:none}
html[data-tier="C"] .lg::before, html[data-tier="C"] .caustic{display:none}

/* ============================================================
   14. PONG — the orb becomes the ball. Desktop only.
   Perf note: nothing that moves every frame carries a
   backdrop-filter. The arena backdrop is a flat gradient and the
   paddles/ball get their glass from gradients + inset rims, so
   game mode costs three transform writes a frame and nothing else.
============================================================ */
#pong{
  position:fixed;inset:0;z-index:400;
  background:
    radial-gradient(120% 95% at 50% 44%, rgba(4,7,13,.80), rgba(2,4,9,.94) 68%);
  opacity:0;transition:opacity .28s ease;
}
#pong[hidden]{display:none}
#pong.is-open{opacity:1}

/* Arena bounds: the ball reflects off these, not off the viewport edge. */
html.pong-on #dock{opacity:0;pointer-events:none;transform:translateY(-14px);transition:opacity .25s ease,transform .25s ease}
html.pong-on .cursor-ring,html.pong-on .cursor-trail{opacity:0}

.pong-net{
  position:absolute;left:50%;top:5%;bottom:5%;width:2px;transform:translateX(-1px);
  background:repeating-linear-gradient(180deg,
    rgba(122,255,170,.20) 0 10px, transparent 10px 24px);
}
.pong-wall{
  position:absolute;left:4%;right:4%;height:2px;border-radius:2px;
  background:linear-gradient(90deg,transparent,rgba(122,255,170,.34) 16%,rgba(122,255,170,.34) 84%,transparent);
  box-shadow:0 0 18px -2px rgba(77,255,136,.3);
}
.pong-wall.top{top:5%}
.pong-wall.bot{bottom:5%}

/* Half glass, same vocabulary as .lg — gradient body, bright top rim,
   hairline outline — but no backdrop blur, since these move. */
.pong-paddle{
  position:absolute;left:0;top:0;width:13px;height:108px;border-radius:999px;
  transform:translate3d(0,0,0);will-change:transform;
  background:
    linear-gradient(180deg,
      rgba(255,255,255,.32) 0%,
      rgba(255,255,255,.10) 42%,
      rgba(255,255,255,.07) 62%,
      rgba(255,255,255,.22) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.16),
    inset 0 2px 0 rgba(255,255,255,.42),
    inset 0 -2px 0 rgba(255,255,255,.12),
    0 10px 26px -10px rgba(1,4,12,.8);
}
.pong-paddle.p1{
  box-shadow:
    inset 0 0 0 1px rgba(160,255,196,.55),
    inset 0 2px 0 rgba(255,255,255,.7),
    inset 0 -2px 0 rgba(122,255,170,.3),
    0 0 30px -4px rgba(77,255,136,.55),
    0 10px 26px -10px rgba(1,4,12,.8);
}
.pong-paddle.p2{
  box-shadow:
    inset 0 0 0 1px rgba(176,225,255,.5),
    inset 0 2px 0 rgba(255,255,255,.66),
    inset 0 -2px 0 rgba(150,215,255,.26),
    0 0 30px -5px rgba(110,190,255,.45),
    0 10px 26px -10px rgba(1,4,12,.8);
}

/* Push (2-player only). Armed is a held breath, fired is the hit landing.
   box-shadow only, so it costs nothing on the frames that matter. */
.pong-paddle{transition:box-shadow .16s ease}
.pong-paddle.is-armed{
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.8),
    inset 0 0 12px rgba(255,255,255,.4),
    0 0 42px -2px rgba(138,255,180,.85),
    0 0 90px -12px rgba(77,255,136,.6);
}
.pong-paddle.p2.is-armed{
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.8),
    inset 0 0 12px rgba(255,255,255,.4),
    0 0 42px -2px rgba(176,225,255,.8),
    0 0 90px -12px rgba(110,190,255,.55);
}
.pong-paddle.is-fired{
  transition:none;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,1),
    inset 0 0 18px rgba(255,255,255,.7),
    0 0 70px 2px rgba(255,255,255,.55),
    0 0 130px -6px rgba(138,255,180,.7);
}

/* HUD reads as terminal output, not scoreboard chrome. */
.pong-hud{
  position:absolute;top:30px;left:50%;transform:translateX(-50%);
  display:flex;gap:36px;white-space:nowrap;
  font-family:var(--mono);font-size:11.5px;letter-spacing:.2em;
  color:rgba(196,212,232,.45);
}
.pong-hud b{
  font-weight:500;color:var(--phos);
  text-shadow:0 0 14px rgba(77,255,136,.5);
}

.pong-panel{
  position:absolute;left:50%;top:68%;transform:translate(-50%,-50%);
  width:min(88vw,420px);text-align:center;font-family:var(--mono);
  transition:opacity .22s ease;
}
#pong.is-live .pong-panel{opacity:0;pointer-events:none}
.pong-line{
  margin:0 0 20px;font-size:14px;line-height:1.7;
  color:var(--phos);text-shadow:0 0 16px rgba(77,255,136,.45);
}
.pong-line em{font-style:normal;color:#eafff1}
.pong-modes{display:flex;gap:9px;justify-content:center}
.pong-mode{
  font:inherit;font-size:10.5px;letter-spacing:.16em;
  padding:9px 15px;border-radius:999px;cursor:pointer;
  color:rgba(196,212,232,.6);
  background:rgba(255,255,255,.045);
  border:1px solid rgba(255,255,255,.1);
  transition:color .2s,background .2s,border-color .2s,box-shadow .2s;
}
.pong-mode:hover{color:var(--ink);background:rgba(255,255,255,.085)}
.pong-mode.is-on{
  color:#eafff1;background:rgba(77,255,136,.13);
  border-color:rgba(138,255,180,.32);
  box-shadow:0 0 20px -6px rgba(77,255,136,.45);
}
.pong-keys{
  margin:22px 0 0;font-size:10.5px;line-height:2;letter-spacing:.12em;
  color:rgba(196,212,232,.38);
}
.pong-keys b{font-weight:500;color:rgba(214,228,244,.72)}

/* The orb in play. transform is written every frame, so the base
   #orb transition (transform .2s) has to go or the ball smears
   behind its own physics. Same reason the lens filter is dropped. */
#orb.is-ball{
  z-index:401;cursor:default;
  animation:none;transition:none;
  will-change:transform;
  backdrop-filter:none;-webkit-backdrop-filter:none;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,.9) 0%, rgba(233,255,242,.5) 14%, rgba(122,255,170,.16) 42%, rgba(77,255,136,.06) 70%, transparent 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.34),
    inset 0 3px 6px rgba(255,255,255,.5),
    0 0 34px -4px rgba(77,255,136,.55),
    0 0 90px -20px rgba(77,255,136,.4);
}
#orb.is-ball .orb-hint{opacity:0}
#orb:focus-visible{outline:2px solid var(--phos);outline-offset:8px}

/* Pong is desktop-only, matching the orb's own pointer:fine gate. */
@media (pointer:coarse),(max-width:720px){
  #pong{display:none !important}
}

#bg-canvas.dimmed { filter: brightness(0.65) contrast(1.05); }
