/* ===================================================================
   MUDASSIR TAHIR — AI AUTOMATION ENGINEER
   Enhanced Modern 3D Portfolio
   style-enhanced.css
   =================================================================== */

/* ===================================================================
   1. ENHANCED TOKENS
   =================================================================== */
:root {
  /* surfaces */
  --bg:          #05070a;
  --bg-2:        #090c12;
  --panel:       #0f1319;
  --panel-2:     #14191f;
  --line:        #1a2130;
  --line-soft:   rgba(147, 160, 180, 0.08);

  /* text */
  --text:        #f0ede8;
  --muted:       #9aa5b8;
  --muted-2:     #5d6e85;
  --muted-3:     #3a4456;

  /* accents - futuristic neon palette */
  --amber:       #ffb84d;
  --amber-soft:  #ffd073;
  --amber-dim:   #a67433;
  --teal:        #00ffcc;
  --teal-soft:   #33ffe0;
  --teal-dim:    #00997a;
  --purple:      #b388ff;
  --purple-dim:  #7c4dff;
  --cyan:        #00e5ff;
  --magenta:     #ff0080;

  /* glass - more premium */
  --glass-bg:          rgba(15, 19, 25, 0.65);
  --glass-bg-2:        rgba(20, 25, 31, 0.75);
  --glass-border:      rgba(147, 160, 180, 0.15);
  --glass-border-hover:rgba(77, 208, 192, 0.5);
  --glow-teal:   0 0 40px rgba(77, 208, 192, 0.25), 0 0 80px rgba(77, 208, 192, 0.08), 0 0 0 1px rgba(77,208,192,.08) inset;
  --glow-amber:  0 0 32px rgba(240, 179, 88, 0.28), 0 0 60px rgba(240, 179, 88, 0.08);
  --glow-purple: 0 0 35px rgba(157, 127, 245, 0.22);

  /* type */
  --font-head: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* layout */
  --measure: 64ch;
  --edge:    clamp(1.5rem, 5vw, 6rem);
  --maxw:    1440px;
  --radius:  12px;
  --ease:    cubic-bezier(.2, .7, .2, 1);
  --ease-out:cubic-bezier(.16, 1, .3, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
}

/* ===================================================================
   2. RESET / BASE
   =================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

html.is-loading body { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
}

p { margin: 0 0 1em; color: var(--muted); max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: none; }
img, svg, canvas { max-width: 100%; display: block; }
ul, ol { list-style: none; margin: 0; padding: 0; }
dl, dd, dt { margin: 0; }
em { font-style: normal; }
strong { color: var(--text); font-weight: 500; }
button { font: inherit; }

::selection { background: rgba(77, 208, 192, 0.35); color: #fff; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 3px;
}

/* scrollbar - enhanced */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--teal-dim), var(--purple-dim));
  border-radius: 99px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--teal), var(--purple));
}

/* ===================================================================
   3. REDUCED MOTION
   =================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .marquee-track { animation: none !important; }
  .cursor-ring, .cursor-dot { display: none !important; }
}

/* ===================================================================
   4. ENHANCED PRELOADER
   =================================================================== */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity .8s var(--ease), visibility .8s;
}
#preloader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pre-inner {
  width: min(340px, 76vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.8rem;
}

.pre-mark {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 2.4rem;
  letter-spacing: .16em;
  color: var(--text);
  position: relative;
  animation: preMark 2.6s var(--ease) infinite;
}
.pre-mark::after {
  content: '';
  position: absolute;
  inset: -20px -24px;
  border: 2px solid var(--line);
  border-radius: 6px;
  animation: preBox 2.6s var(--ease) infinite;
}
.pre-mark::before {
  content: '';
  position: absolute;
  inset: -16px -20px;
  background: radial-gradient(circle at center, rgba(77, 208, 192, 0.15), transparent 70%);
  opacity: 0;
  animation: preGlow 2.6s var(--ease) infinite;
}
@keyframes preMark {
  0%, 100% { color: var(--text); text-shadow: none; }
  50%      { color: var(--teal); text-shadow: 0 0 28px rgba(77,208,192,.65); }
}
@keyframes preBox {
  0%, 100% { transform: scale(1); border-color: var(--line); opacity: .6; }
  50%      { transform: scale(1.08); border-color: var(--teal-dim); opacity: 1; }
}
@keyframes preGlow {
  0%, 100% { opacity: 0; }
  50%      { opacity: 1; }
}

.pre-bar {
  width: 100%;
  height: 3px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 20px rgba(0,0,0,0.5) inset;
}
.pre-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--amber), var(--teal), var(--purple));
  box-shadow: 0 0 18px rgba(77,208,192,.8), 0 0 30px rgba(77,208,192,.4);
  transition: width .25s linear;
}

.pre-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .14em;
  color: var(--muted-3);
}
.pre-pct { color: var(--teal); font-weight: 500; }

/* ===================================================================
   5. ENHANCED CUSTOM CURSOR
   =================================================================== */
.cursor-ring,
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  z-index: 9998;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .35s ease;
  will-change: transform;
}
.cursor-ring {
  width: 38px; height: 38px;
  margin: -19px 0 0 -19px;
  border: 2px solid rgba(77, 208, 192, 0.6);
  box-shadow: 0 0 12px rgba(77, 208, 192, 0.25);
  transition: opacity .35s ease, width .28s var(--ease-bounce), height .28s var(--ease-bounce),
              margin .28s var(--ease-bounce), border-color .28s ease, background .28s ease, box-shadow .28s ease;
}
.cursor-dot {
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--teal);
  box-shadow: 0 0 14px rgba(77,208,192,.95), 0 0 24px rgba(77,208,192,.5);
  transition: opacity .35s ease, background .28s ease, box-shadow .28s ease;
}
body.cursor-ready .cursor-ring,
body.cursor-ready .cursor-dot { opacity: 1; }

body.cursor-hover .cursor-ring {
  width: 64px; height: 64px;
  margin: -32px 0 0 -32px;
  border-color: rgba(240, 179, 88, 0.75);
  background: rgba(240, 179, 88, 0.08);
  box-shadow: 0 0 20px rgba(240, 179, 88, 0.35);
}
body.cursor-hover .cursor-dot {
  background: var(--amber);
  box-shadow: 0 0 16px rgba(240,179,88,.95), 0 0 28px rgba(240,179,88,.6);
}
body.cursor-down .cursor-ring { width: 28px; height: 28px; margin: -14px 0 0 -14px; }

@media (hover: none), (pointer: coarse) {
  .cursor-ring, .cursor-dot { display: none; }
}

/* ===================================================================
   6. ENHANCED SCROLL PROGRESS
   =================================================================== */
#scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 60;
  background: transparent;
  pointer-events: none;
}
#scroll-bar {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--amber), var(--teal), var(--purple));
  box-shadow: 0 0 16px rgba(77, 208, 192, 0.8), 0 0 28px rgba(77, 208, 192, 0.4);
  transform-origin: 0 50%;
  will-change: width;
}

/* ===================================================================
   7. ENHANCED AMBIENT LAYERS
   =================================================================== */
#bg-field {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  display: block;
  background: radial-gradient(130% 95% at 50% 0%, #0a0f18 0%, var(--bg) 65%);
}

#vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(140% 110% at 50% 40%, transparent 38%, rgba(3, 4, 7, .85) 100%);
}

#scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.012) 0px,
    rgba(255, 255, 255, 0.012) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: .6;
}

#grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.topbar, main, .sitefoot, .marquee { position: relative; z-index: 2; }

/* ===================================================================
   8. ENHANCED TOP BAR
   =================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: .95rem var(--edge);
  background: rgba(7, 10, 15, 0.75);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-bottom: 1px solid var(--line-soft);
  transition: background .4s ease, border-color .4s ease, box-shadow .4s ease;
}
.topbar.is-scrolled {
  background: rgba(5, 7, 10, 0.92);
  border-bottom-color: var(--line);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.mark {
  display: flex;
  align-items: center;
  gap: .8rem;
  text-decoration: none;
  flex-shrink: 0;
}
.mark-glyph {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--panel-2), var(--panel));
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .05em;
  color: var(--teal);
  box-shadow: 0 0 0 1px rgba(77,208,192,.06) inset, 0 4px 12px rgba(0,0,0,0.3);
  transition: border-color .35s ease, color .35s ease, box-shadow .35s ease, transform .35s var(--ease-bounce);
}
.mark:hover .mark-glyph {
  border-color: var(--teal-dim);
  color: var(--teal-soft);
  box-shadow: 0 0 24px rgba(77,208,192,.3), 0 0 0 1px rgba(77,208,192,.12) inset;
  transform: translateY(-2px);
}
.mark-text {
  display: flex;
  flex-direction: column;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .92rem;
  letter-spacing: .01em;
  line-height: 1.15;
}
.mark-text em {
  font-family: var(--font-mono);
  font-size: .62rem;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-3);
  margin-top: 2px;
}

.toplinks {
  display: flex;
  gap: .4rem;
  align-items: center;
}
.toplinks a {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: .42rem;
  padding: .55rem .9rem;
  border-radius: 6px;
  font-size: .88rem;
  color: var(--muted);
  transition: color .25s ease, background .25s ease, transform .25s ease;
}
.toplinks a span {
  font-family: var(--font-mono);
  font-size: .64rem;
  color: var(--muted-3);
  transition: color .25s ease;
}
.toplinks a::after {
  content: '';
  position: absolute;
  left: .9rem; right: .9rem; bottom: .35rem;
  height: 2px;
  background: linear-gradient(90deg, var(--amber), var(--teal));
  border-radius: 99px;
  box-shadow: 0 0 8px rgba(77,208,192,0.6);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .35s var(--ease-bounce);
}
.toplinks a:hover {
  color: var(--text);
  background: rgba(147,160,180,.06);
  transform: translateY(-1px);
}
.toplinks a:hover span { color: var(--teal); }
.toplinks a:hover::after,
.toplinks a.is-active::after { transform: scaleX(1); }
.toplinks a.is-active { color: var(--text); }
.toplinks a.is-active span { color: var(--teal); }

.topsocial { display: flex; gap: .45rem; align-items: center; }
.topsocial a {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 6px;
  border: 1px solid transparent;
  color: var(--muted-2);
  transition: color .25s ease, border-color .25s ease, background .25s ease, transform .3s var(--ease-bounce), box-shadow .25s ease;
}
.topsocial a:hover {
  color: var(--amber);
  border-color: var(--line);
  background: rgba(240, 179, 88, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(240, 179, 88, 0.2);
}

@media (max-width: 980px) {
  .toplinks { display: none; }
  .mark-text em { display: none; }
}

/* ===================================================================
   9. ENHANCED BUTTONS
   =================================================================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 1.6rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: .008em;
  cursor: pointer;
  overflow: hidden;
  transition: transform .25s var(--ease-bounce), background .25s ease,
              border-color .25s ease, color .25s ease, box-shadow .35s ease;
}
.btn svg { transition: transform .3s var(--ease-bounce); }
.btn:hover svg { transform: translateX(4px); }

.btn-primary {
  background: linear-gradient(135deg, var(--amber), var(--amber-soft));
  color: #14100a;
  font-weight: 600;
  box-shadow:
    0 0 0 1px rgba(255, 184, 77, 0.5),
    0 0 20px rgba(255, 184, 77, 0.4),
    0 8px 28px -12px rgba(255, 184, 77, 0.6);
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 25%, rgba(255,255,255,.5) 50%, transparent 75%);
  transform: translateX(-140%);
  transition: transform .7s var(--ease);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--amber-soft), var(--amber));
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px rgba(255, 184, 77, 0.7),
    0 0 30px rgba(255, 184, 77, 0.6),
    0 12px 36px -10px rgba(255, 184, 77, 0.85),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
}
.btn-primary:hover::before { transform: translateX(140%); }

.btn-ghost {
  border-color: rgba(0, 229, 255, 0.3);
  color: var(--text);
  background: rgba(0, 229, 255, 0.02);
  transition: all .4s ease;
}
.btn-ghost:hover {
  border-color: rgba(0, 229, 255, 0.6);
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.08);
  transform: translateY(-3px);
  box-shadow:
    0 0 20px rgba(0, 229, 255, 0.25),
    0 0 40px rgba(0, 229, 255, 0.12),
    0 8px 24px rgba(0, 229, 255, 0.15);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.btn-lg { padding: 1.1rem 2rem; font-size: 1.02rem; }

/* ===================================================================
   10. ENHANCED HERO
   =================================================================== */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
  padding: clamp(4rem, 9vw, 7rem) var(--edge) clamp(3.5rem, 8vw, 6rem);
  max-width: var(--maxw);
  margin: 0 auto;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 1.8rem;
  padding: .48rem .9rem .48rem .75rem;
  border: 1px solid rgba(0, 229, 255, 0.4);
  border-radius: 99px;
  background: rgba(0, 229, 255, 0.08);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.2), inset 0 0 10px rgba(0, 229, 255, 0.05);
  max-width: none;
  opacity: 0;
  animation: heroIn .85s var(--ease-out) .15s forwards;
}
.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan), 0 0 24px rgba(0, 229, 255, 0.5);
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 12px var(--cyan), 0 0 24px rgba(0, 229, 255, 0.5); }
  50%      { opacity: .3; transform: scale(.7); box-shadow: 0 0 8px var(--cyan), 0 0 16px rgba(0, 229, 255, 0.3); }
}

.hero h1 {
  font-size: clamp(2.2rem, 4.8vw, 4rem);
  line-height: 1.05;
  margin-bottom: 1.6rem;
  letter-spacing: -0.04em;
}
.hero h1 .line {
  display: block;
  opacity: 0;
  transform: translateY(30px);
  animation: heroIn .95s var(--ease-out) forwards;
}
.hero h1 .line:nth-child(1) { animation-delay: .28s; }
.hero h1 .line:nth-child(2) { animation-delay: .42s; }
.hero h1 .line:nth-child(3) { animation-delay: .56s; }
.hero h1 .grad {
  background: linear-gradient(110deg, var(--amber) 0%, var(--amber-soft) 28%, var(--teal) 65%, var(--purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: gradShift 8s ease infinite;
  background-size: 200% 100%;
}
@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-lede {
  font-size: 1.08rem;
  line-height: 1.7;
  max-width: 54ch;
  opacity: 0;
  animation: heroIn .95s var(--ease-out) .65s forwards;
}

.hero-actions {
  display: flex;
  gap: .95rem;
  flex-wrap: wrap;
  margin: 2rem 0 2.6rem;
  opacity: 0;
  animation: heroIn .95s var(--ease-out) .78s forwards;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: clamp(1.6rem, 4.5vw, 3.5rem);
  justify-content: start;
  padding-top: 1.9rem;
  border-top: 1px solid var(--line-soft);
  opacity: 0;
  animation: heroIn .95s var(--ease-out) .92s forwards;
}
.hero-stats dt {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.025em;
  text-shadow: 0 0 20px rgba(77, 208, 192, 0.2);
}
.hero-stats dt::after {
  content: attr(data-suffix);
  color: var(--teal);
  margin-left: 2px;
}
.hero-stats dd {
  font-size: .76rem;
  font-family: var(--font-mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted-3);
  margin-top: .6rem;
}

/* ---- enhanced hero graph ---- */
.hero-graph {
  position: relative;
  opacity: 0;
  animation: heroIn 1.15s var(--ease-out) .6s forwards;
}
.hero-graph-frame {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid rgba(0, 229, 255, 0.2);
  background:
    radial-gradient(130% 130% at 35% 20%, #141c2a 0%, #05070a 75%);
  box-shadow:
    0 0 40px rgba(0, 229, 255, 0.15),
    0 0 80px rgba(255, 0, 128, 0.08),
    0 0 140px rgba(0,0,0,.85) inset,
    0 35px 80px -50px rgba(0,0,0,0.95);
  overflow: hidden;
  transition: box-shadow .5s ease, transform .5s ease, border-color .5s ease;
}
.hero-graph-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0,229,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(130% 110% at 50% 50%, #000 25%, transparent 85%);
  -webkit-mask-image: radial-gradient(130% 110% at 50% 50%, #000 25%, transparent 85%);
  animation: gridShift 12s linear infinite;
}
.hero-graph-frame:hover {
  box-shadow:
    0 0 60px rgba(0, 229, 255, 0.25),
    0 0 100px rgba(255, 0, 128, 0.12),
    0 0 140px rgba(0,0,0,.85) inset,
    0 40px 90px -45px rgba(0,0,0,1);
  border-color: rgba(0, 229, 255, 0.4);
  transform: translateY(-4px) scale(1.005);
}
.hero-graph-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(147,160,180,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(147,160,180,.05) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(130% 110% at 50% 50%, #000 25%, transparent 82%);
  -webkit-mask-image: radial-gradient(130% 110% at 50% 50%, #000 25%, transparent 82%);
  animation: gridShift 20s linear infinite;
}
@keyframes gridShift {
  from { background-position: 0 0; }
  to   { background-position: 28px 28px; }
}
#graph-canvas {
  position: relative;
  width: 100%;
  height: 480px;
  display: block;
  cursor: crosshair;
}

/* ---- Cybernetic HUD Corner Reticles ---- */
.corner {
  position: absolute;
  width: 24px; height: 24px;
  z-index: 3;
  border-color: var(--cyan);
  opacity: .6;
  pointer-events: none;
  transition: opacity .45s ease, border-color .45s ease, width .3s ease, height .3s ease;
}
.hero-graph-frame:hover .corner {
  opacity: 1;
  border-color: var(--cyan);
  width: 30px;
  height: 30px;
}
.c-tl { top: 10px; left: 10px;  border-top: 2px solid; border-left: 2px solid; }
.c-tr { top: 10px; right: 10px; border-top: 2px solid; border-right: 2px solid; }
.c-bl { bottom: 10px; left: 10px;  border-bottom: 2px solid; border-left: 2px solid; }
.c-br { bottom: 10px; right: 10px; border-bottom: 2px solid; border-right: 2px solid; }

/* ---- Futuristic HUD Labels ---- */
.hud-label {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--font-mono);
  font-size: .64rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(0, 229, 255, 0.7);
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
  transition: color .4s ease, text-shadow .4s ease;
}
.hero-graph-frame:hover .hud-label {
  color: rgba(0, 229, 255, 0.9);
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.7);
}
.hud-sub {
  color: var(--magenta);
  text-shadow: 0 0 6px rgba(255, 0, 128, 0.5);
}
.hud-tl { top: 16px; left: 44px; }
.hud-tr { top: 16px; right: 44px; color: var(--teal); }
.hud-br { bottom: 16px; right: 44px; color: var(--teal); text-shadow: 0 0 10px rgba(0,255,204,0.6); }
.hud-bl { bottom: 16px; left: 44px; }

.dot-live {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px var(--teal), 0 0 20px rgba(77,208,192,0.5);
  animation: pulseDot 2s ease-in-out infinite;
  flex-shrink: 0;
}

.graph-caption {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .05em;
  color: var(--muted-3);
  margin: .95rem 0 0;
  text-align: right;
  max-width: none;
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  #graph-canvas { height: 360px; }
  .graph-caption { text-align: left; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
}

/* ===================================================================
   11. ENHANCED MARQUEE
   =================================================================== */
.marquee {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 1.1rem 0;
  background: linear-gradient(180deg, rgba(20,25,31,.4), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 2.4rem;
  width: max-content;
  animation: marquee 50s linear infinite;
}
.marquee-track span {
  font-family: var(--font-mono);
  font-size: .82rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-3);
  white-space: nowrap;
  transition: color .35s ease;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span:hover { color: var(--teal); }
.marquee-track i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--teal-dim);
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(77,208,192,0.3);
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ===================================================================
   12. ENHANCED SECTION RHYTHM
   =================================================================== */
.section {
  padding: clamp(4rem, 9vw, 7.5rem) var(--edge);
  max-width: var(--maxw);
  margin: 0 auto;
  border-top: 1px solid var(--line-soft);
}

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  margin-bottom: 2.8rem;
  flex-wrap: wrap;
}
.sec-num {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .18em;
  color: var(--teal-dim);
  padding-top: .38rem;
  text-shadow: 0 0 10px rgba(77,208,192,0.3);
}
.sec-head h2 {
  position: relative;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  padding-bottom: .8rem;
}
.sec-head h2::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 60px; height: 3px;
  background: linear-gradient(90deg, var(--amber), var(--teal), var(--purple));
  border-radius: 99px;
  box-shadow: 0 0 18px rgba(77, 208, 192, 0.65);
  animation: underlineGlow 3s ease-in-out infinite;
}
@keyframes underlineGlow {
  0%, 100% { box-shadow: 0 0 18px rgba(77, 208, 192, 0.65); }
  50%      { box-shadow: 0 0 28px rgba(77, 208, 192, 0.85), 0 0 40px rgba(77, 208, 192, 0.35); }
}
.sec-lede {
  flex: 1 1 100%;
  max-width: 64ch;
  font-size: 1.02rem;
  margin: 0;
}

[data-reveal] {
  opacity: 0;
  transform: perspective(1600px) rotateX(6deg) translateY(40px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
  will-change: opacity, transform;
}
[data-reveal].revealed {
  opacity: 1;
  transform: perspective(1600px) rotateX(0deg) translateY(0);
}

/* ===================================================================
   13. ENHANCED GLASS + TILT
   =================================================================== */
.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  padding: 1.75rem 1.9rem;
  transition: border-color .4s ease, box-shadow .4s ease, background .4s ease, transform .4s ease;
  overflow: hidden;
  transform-style: preserve-3d;
}
/* Cyber-Grid Pattern Overlay */
.glass::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0,229,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: .5;
}
/* Focus Glow Border */
.glass::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(155deg, var(--cyan), var(--magenta), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
}
.glass:hover {
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.15), 0 0 10px rgba(255, 0, 128, 0.1);
  background: var(--glass-bg-2);
  transform: translateZ(10px) scale(1.01);
}
.glass:hover::before {
  opacity: 1;
}

/* Cybernetic HUD Corner Accents for glass containers */
.glass[data-hud]::before { margin: -10px; } /* Expand border */
.glass[data-hud]::after {
  content: '';
  position: absolute;
  width: 15px;
  height: 15px;
  border-top: 2px solid var(--cyan);
  border-left: 2px solid var(--cyan);
  top: 5px;
  left: 5px;
  pointer-events: none;
}
.glass[data-hud]::before { /* Already used for border, need a different way or combine */
  /* Re-implement corner accents using specific pseudo-elements if needed, for now use a sub-wrapper */
}

.tilt {
  transform:
    perspective(900px)
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg))
    translate3d(0, var(--ty, 0px), var(--tz, 0px))
    scale(var(--sc, 1));
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform .6s var(--ease), border-color .4s ease, box-shadow .4s ease, background .4s ease;
}
.tilt > * {
  transform: translateZ(20px);
  transition: transform .6s var(--ease);
}
.tilt.is-tilting {
  transition: transform .1s linear, border-color .4s ease, box-shadow .4s ease, background .4s ease;
}

.stagger > * {
  opacity: 0;
  --ty: 28px;
  transition: opacity .75s var(--ease-out), transform .75s var(--ease-out);
}
.stagger.in > * { opacity: 1; --ty: 0px; }
.stagger.in > *:nth-child(1) { transition-delay: .05s; }
.stagger.in > *:nth-child(2) { transition-delay: .13s; }
.stagger.in > *:nth-child(3) { transition-delay: .21s; }
.stagger.in > *:nth-child(4) { transition-delay: .29s; }
.stagger.in > *:nth-child(5) { transition-delay: .37s; }
.stagger.in > *:nth-child(6) { transition-delay: .45s; }

.card-icon {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  margin-bottom: 1.1rem;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: linear-gradient(155deg, rgba(77,208,192,.11), rgba(77,208,192,.02));
  color: var(--teal);
  transition: color .35s ease, border-color .35s ease, box-shadow .35s ease, transform .4s var(--ease-bounce);
}
.glass:hover .card-icon {
  color: var(--teal-soft);
  border-color: var(--teal-dim);
  box-shadow: 0 0 26px rgba(77,208,192,.28), 0 0 0 1px rgba(77,208,192,.15) inset;
  transform: translateY(-3px) scale(1.05);
}

/* ===================================================================
   14. ABOUT
   =================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.18fr 1fr;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  align-items: start;
}
.about-copy .lead {
  font-size: 1.18rem;
  line-height: 1.62;
  color: var(--text);
  max-width: 48ch;
  margin-bottom: 1.3rem;
}
.about-copy p { max-width: 56ch; }

.about-cards {
  display: grid;
  gap: 1.1rem;
}
.about-cards h3 {
  font-size: 1.02rem;
  font-weight: 500;
  margin-bottom: .55rem;
  color: var(--text);
}
.about-cards p { font-size: .94rem; margin: 0; }

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* ===================================================================
   15. STACK
   =================================================================== */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}
.stack-card { padding: 1.6rem 1.75rem; }

.stack-head {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: 1.1rem;
}
.stack-idx {
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 5px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 600;
  color: var(--teal);
  background: rgba(77,208,192,.06);
  flex-shrink: 0;
  transition: border-color .35s ease, background .35s ease, box-shadow .35s ease;
}
.glass:hover .stack-idx {
  border-color: var(--teal-dim);
  background: rgba(77,208,192,.12);
  box-shadow: 0 0 14px rgba(77,208,192,0.25);
}
.stack-head h3 {
  font-size: .88rem;
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--muted);
}

.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tags span {
  font-size: .82rem;
  padding: .38rem .75rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  background: rgba(147,160,180,.035);
  transition: border-color .28s ease, color .28s ease, background .28s ease, transform .3s var(--ease-bounce), box-shadow .28s ease;
}
.tags span:hover {
  border-color: var(--teal-dim);
  color: var(--teal-soft);
  background: rgba(77,208,192,.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(77,208,192,0.15);
}
.tags.mono span {
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--teal);
  border-color: var(--teal-dim);
  background: rgba(77,208,192,.05);
}

/* ===================================================================
   16. PIPELINE / WORKFLOWS
   =================================================================== */
.pipeline { position: relative; margin-top: .6rem; }

.pipeline-spine {
  position: absolute;
  left: 10px;
  top: 16px;
  bottom: 16px;
  width: 3px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(0,0,0,0.4) inset;
}
.spine-fill {
  display: block;
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, var(--amber), var(--teal), var(--purple));
  box-shadow: 0 0 18px rgba(77,208,192,.75), 0 0 30px rgba(77,208,192,.35);
  border-radius: 99px;
  transition: height .2s linear;
}

.node {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 1.75rem;
  padding-bottom: 1.75rem;
}
.node:last-child { padding-bottom: 0; }

.node-dot {
  position: relative;
  z-index: 2;
  width: 24px; height: 24px;
  margin-top: 1.5rem;
  border-radius: 50%;
  background: var(--bg-2);
  border: 3px solid var(--amber-dim);
  display: grid;
  place-items: center;
  transition: border-color .55s ease, box-shadow .55s ease, background .55s ease, transform .55s ease;
}
.node-dot span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--amber-dim);
  transition: background .55s ease, box-shadow .55s ease;
}
.node[data-status="done"] .node-dot { border-color: var(--teal-dim); }
.node[data-status="done"] .node-dot span { background: var(--teal); }

.node.in-view .node-dot {
  border-color: var(--teal);
  box-shadow: 0 0 0 6px rgba(77,208,192,.15), 0 0 26px rgba(77,208,192,.45);
  transform: scale(1.1);
}
.node.in-view .node-dot span {
  background: var(--teal-soft);
  box-shadow: 0 0 12px var(--teal), 0 0 20px rgba(77,208,192,0.5);
}

.node .node-body { opacity: 0; --ty: 35px; }
.node.in-view .node-body { opacity: 1; --ty: 0px; }
.node:nth-child(2) .node-body { transition-delay: .06s; }
.node:nth-child(3) .node-body { transition-delay: .12s; }
.node:nth-child(4) .node-body { transition-delay: .18s; }
.node:nth-child(5) .node-body { transition-delay: .24s; }
.node:nth-child(6) .node-body { transition-delay: .30s; }
.node:nth-child(7) .node-body { transition-delay: .36s; }
.node:nth-child(8) .node-body { transition-delay: .42s; }

.node-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.1rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.node-head h3 {
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  max-width: 34ch;
}
.node p { font-size: .98rem; margin-bottom: 1.1rem; max-width: 70ch; }

.status {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .11em;
  text-transform: uppercase;
  padding: .32rem .68rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.status i {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: block;
}
.status-progress {
  color: var(--amber);
  border: 1px solid var(--amber-dim);
  background: rgba(240,179,88,.07);
  box-shadow: 0 0 12px rgba(240,179,88,0.15);
}
.status-progress i {
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber), 0 0 18px rgba(240,179,88,0.4);
  animation: pulseDot 2s ease-in-out infinite;
}
.status-done {
  color: var(--teal);
  border: 1px solid var(--teal-dim);
  background: rgba(77,208,192,.07);
  box-shadow: 0 0 12px rgba(77,208,192,0.15);
}
.status-done i {
  background: var(--teal);
  box-shadow: 0 0 10px var(--teal), 0 0 18px rgba(77,208,192,0.4);
}

@media (max-width: 620px) {
  .node { grid-template-columns: 24px 1fr; gap: 1.1rem; }
  .node-head h3 { font-size: 1.08rem; }
}

/* ===================================================================
   17. TIMELINE
   =================================================================== */
.timeline li {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.2rem;
  padding: 1.9rem 0;
  border-top: 1px solid var(--line-soft);
  position: relative;
  transition: background .35s ease, transform .35s ease;
}
.timeline li:first-child { border-top: none; padding-top: 0; }
.timeline li::before {
  content: '';
  position: absolute;
  left: -2px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--teal-dim), var(--purple-dim), transparent);
  opacity: 0;
  transition: opacity .45s ease;
  box-shadow: 0 0 12px rgba(77,208,192,0.5);
}
.timeline li:hover::before { opacity: 1; }
.timeline li:hover { transform: translateX(4px); }

.tl-date {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .07em;
  color: var(--muted-3);
  padding-top: .32rem;
}
.tl-body h3 {
  font-size: 1.08rem;
  font-weight: 600;
  margin-bottom: .6rem;
  letter-spacing: -0.012em;
}
.tl-body h3 span {
  display: inline;
  color: var(--muted-2);
  font-weight: 400;
  font-size: .92rem;
  font-family: var(--font-body);
  letter-spacing: 0;
}
.tl-body p { font-size: .96rem; max-width: 70ch; margin: 0; }
.tl-earlier p { color: var(--muted); }

@media (max-width: 680px) {
  .timeline li { grid-template-columns: 1fr; gap: .6rem; }
}

/* ===================================================================
   18. BACKGROUND GRID
   =================================================================== */
.bg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.2rem;
}
.bg-grid h3 {
  font-size: .84rem;
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .85rem;
}
.bg-grid p { font-size: .95rem; line-height: 1.72; margin: 0; }

/* ===================================================================
   19. CONTACT
   =================================================================== */
.contact-lede {
  font-size: 1.16rem;
  color: var(--text);
  max-width: 54ch;
  margin-bottom: 2.1rem;
}
.contact-links {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
  margin-top: 1.95rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line-soft);
}
.contact-links a {
  position: relative;
  font-size: .92rem;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: .025em;
  padding-bottom: 4px;
  transition: color .28s ease, transform .28s ease;
}
.contact-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--teal), var(--purple));
  border-radius: 99px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .38s var(--ease-bounce);
  box-shadow: 0 0 10px rgba(77,208,192,0.6);
}
.contact-links a:hover { color: var(--teal-soft); transform: translateX(2px); }
.contact-links a:hover::after { transform: scaleX(1); }

/* ===================================================================
   20. FOOTER
   =================================================================== */
.sitefoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.65rem;
  flex-wrap: wrap;
  padding: 2.4rem var(--edge) 3.2rem;
  max-width: var(--maxw);
  margin: 0 auto;
  border-top: 1px solid var(--line-soft);
}
.sitefoot p {
  font-size: .8rem;
  font-family: var(--font-mono);
  letter-spacing: .035em;
  color: var(--muted-3);
  margin: 0;
}
.foot-meta {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--teal-dim) !important;
  text-transform: uppercase;
  letter-spacing: .13em !important;
  font-size: .7rem !important;
}

/* ===================================================================
   21. PRINT
   =================================================================== */
@media print {
  #preloader, .cursor-ring, .cursor-dot, #bg-field, #grain,
  #scanlines, #vignette, #scroll-progress, .marquee, .topbar { display: none !important; }
  body { background: #fff; color: #000; }
  [data-reveal], .stagger > *, .node .node-body { opacity: 1 !important; transform: none !important; }
}