/* ==========================================================================
   David Gjorgiev — Portfolio (Remaster)
   Design system: "Neo-Tech"
   ========================================================================== */

/* ---------------------------------------------------------------- Tokens */
:root {
  /* Mr. Robot — dark terminal (default) */
  --bg: #0a0a0b;
  --bg-2: #0e0e10;
  --surface: rgba(255, 255, 255, 0.022);
  --surface-solid: #141416;
  --surface-2: #1b1b1e;
  --text: #d7d7d1;
  --muted: #7c7c76;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(224, 30, 60, 0.38);

  --accent: #e01e3c;          /* fsociety crimson */
  --accent-hover: #ff3651;
  --accent-2: #22d3ee;        /* Mr. Robot aqua/cyan */
  --accent-3: #c3073f;
  --grad: linear-gradient(115deg, #c3073f 0%, #e01e3c 55%, #7a0f27 100%);
  --grad-soft: linear-gradient(115deg, rgba(224, 30, 60, 0.16), rgba(34, 211, 238, 0.09));

  --glow: 0 0 0 1px rgba(224, 30, 60, 0.4), 0 12px 48px -8px rgba(224, 30, 60, 0.45);
  --shadow-card: 0 10px 40px -12px rgba(0, 0, 0, 0.8);
  --shadow-hover: 0 18px 56px -16px rgba(224, 30, 60, 0.42);

  --radius: 14px;
  --radius-lg: 18px;
  --radius-sm: 8px;
  --max-w: 1180px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --font-display: 'Space Grotesk', 'JetBrains Mono', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --nav-h: 68px;
  --icon-color: #d7d7d1;
  /* Matte "frosted glass" content backdrop (desktop < 2K).
     --glass-bg   = tint layered on top (raise last alpha = more solid).
     --glass-blur = how frosted the panel is. THIS is what keeps the panel
                    from ever being fully see-through even when --glass-bg
                    alpha is 0. Set it to 0px to make the panel rely only on
                    the --glass-bg alpha (i.e. can then be fully transparent). */
  --glass-bg: rgba(10, 10, 11, 0.80);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-blur: 11px;
}

[data-theme="light"] {
  /* Light theme based on Catppuccin Latte (popular dev light palette),
     tuned toward the Mr. Robot crimson + teal accents. */
  --bg: #e6e9ef;              /* Latte mantle (soft gray, not blinding white) */
  --bg-2: #dce0e8;            /* Latte crust */
  --surface: rgba(76, 79, 105, 0.05);
  --surface-solid: #eff1f5;   /* Latte base — cards read as gently elevated */
  --surface-2: #ccd0da;       /* Latte surface0 */
  --text: #3c3f58;            /* darker than Latte text for strong contrast */
  --muted: #6c6f85;           /* Latte subtext0 */
  --border: rgba(76, 79, 105, 0.18);
  --border-strong: rgba(210, 15, 57, 0.42);

  --accent: #d20f39;          /* Latte red / fsociety crimson */
  --accent-hover: #b60a2f;
  --accent-2: #0e7c86;        /* deep teal-cyan (Mr. Robot aqua, readable on light) */
  --accent-3: #b60a2f;
  --grad: linear-gradient(115deg, #d20f39 0%, #e64553 55%, #9a0a29 100%);
  --grad-soft: linear-gradient(115deg, rgba(210, 15, 57, 0.12), rgba(14, 124, 134, 0.12));

  --glow: 0 0 0 1px rgba(210, 15, 57, 0.3), 0 12px 40px -10px rgba(210, 15, 57, 0.28);
  --shadow-card: 0 10px 30px -14px rgba(60, 63, 88, 0.35);
  --shadow-hover: 0 18px 46px -18px rgba(210, 15, 57, 0.6);
  --icon-color: #3c3f58;

  /* See the dark-theme note above. Lower --glass-blur (e.g. to 0px) if you
     want this light panel to actually read as see-through. */
  --glass-bg: rgba(230, 233, 239, 0.32);
  --glass-border: rgba(76, 79, 105, 0.14);
  --glass-blur: 1px;
}

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

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background 0.5s var(--ease-out), color 0.5s var(--ease-out);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

::selection { background: rgba(224, 30, 60, 0.4); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); background-clip: padding-box; }

/* -------------------------------------------- Terminal backdrop (CMD) */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 20% 0%, rgba(224, 30, 60, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 100%, rgba(34, 211, 238, 0.06), transparent 60%);
}

/* Streaming command log */
.term-scroll {
  position: absolute;
  inset: 0;
  /* ADJUST HEIGHT/REACH OF THE CMD LINES HERE:
     first value = top padding (smaller => lines reach further up). */
  padding: 1.25rem 4vw 5.5rem;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(34, 211, 238, 0.36);
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-shadow: 0 0 6px rgba(34, 211, 238, 0.25);
  /* top fade % controls how high the lines stay visible before fading out */
  mask-image: linear-gradient(to bottom, transparent 0%, #000 4%, #000 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 4%, #000 88%, transparent 100%);
}
[data-theme="light"] .term-scroll {
  color: rgba(14, 108, 118, 0.72);
  text-shadow: none;
}
.term-line { display: block; opacity: 0; animation: termIn 0.18s ease forwards; }
.term-line .tprompt { color: var(--accent); text-shadow: 0 0 6px rgba(224, 30, 60, 0.3); }
.term-line .tcmd { color: rgba(236, 236, 236, 0.55); }
[data-theme="light"] .term-line .tcmd { color: rgba(20, 18, 10, 0.65); }
.term-line .tok { color: var(--accent-2); }
.term-line .terr { color: var(--accent); }
.term-line .tcursor {
  display: inline-block;
  width: 8px; height: 1em;
  background: var(--accent-2);
  vertical-align: -2px;
  animation: caret 1s steps(1) infinite;
}
@keyframes termIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes caret { 50% { opacity: 0; } }

/* Second dim column of code raining on the right */
.term-rain {
  position: absolute;
  top: 0; right: 2vw; bottom: 0;
  width: 26%;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: rgba(34, 211, 238, 0.32);
  text-shadow: 0 0 6px rgba(34, 211, 238, 0.25);
  white-space: pre;
  overflow: hidden;
  text-align: right;
  mask-image: linear-gradient(to bottom, #000, transparent 92%);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 92%);
}
[data-theme="light"] .term-rain { color: rgba(14, 108, 118, 0.5); text-shadow: none; }
@media (max-width: 768px) { .term-rain { display: none; } }

/* CRT scanlines + flicker */
.term-scanlines {
  position: absolute;
  inset: 0;
  /* ===== HORIZONTAL BACKGROUND LINES (scanlines) =====
     Increase the 0.42 alpha below (and/or the `opacity` value) to make the
     horizontal lines MORE visible; decrease them to fade the lines out. */
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.42) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  opacity: 0.7;
  mix-blend-mode: multiply;
  animation: crtFlicker 5s steps(60) infinite;
}
[data-theme="light"] .term-scanlines { opacity: 0.3; }
@keyframes crtFlicker { 0%,100% { opacity: 0.5; } 3% { opacity: 0.62; } 6% { opacity: 0.42; } 9% { opacity: 0.55; } }

/* Vignette framing */
.term-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 100% 80% at 50% 40%, transparent 52%, rgba(0, 0, 0, 0.62) 100%);
}
[data-theme="light"] .term-vignette {
  background: radial-gradient(ellipse 100% 80% at 50% 40%, transparent 55%, rgba(60, 63, 88, 0.22) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .term-line { animation: none; opacity: 1; }
  .term-scanlines { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* --------------------------------------------------------------- Layout */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.section { padding: 5.5rem 0; }

.section-head { margin-bottom: 2.5rem; }

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.section-eyebrow::before {
  content: '';
  width: 26px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.5vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.section-cta { text-align: center; margin-top: 3rem; }

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* -------------------------------------------------------- Scroll progress */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--grad);
  z-index: 200;
  transition: width 0.1s linear;
}

/* ------------------------------------------------------------------- Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  transition: transform 0.4s var(--ease-out), background var(--transition), border-color var(--transition);
}
.nav.nav-hidden { transform: translateY(-100%); }

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
  transition: color var(--transition);
}
.nav-logo::before {
  content: '';
  width: 10px; height: 10px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  transition: transform var(--transition), box-shadow var(--transition);
}
.nav-logo:hover { color: var(--accent); }
.nav-logo:hover::before { transform: scale(1.2) rotate(45deg); box-shadow: 0 0 18px var(--accent); }
/* Scramble/glitch state driven by JS */
.nav-logo.glitch {
  color: var(--accent);
  text-shadow: 1.5px 0 var(--accent), -1.5px 0 var(--accent-2);
}
.nav-logo .dud { color: var(--accent-2); opacity: 0.85; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.15rem;
}

.nav-links li a {
  position: relative;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
}
.nav-links li a::after {
  content: '';
  position: absolute;
  left: 0.85rem; right: 0.85rem;
  bottom: 0.2rem;
  height: 2px;
  background: var(--grad);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.nav-links li a:hover { color: var(--text); }
.nav-links li a:hover::after,
.nav-links li a.active::after { transform: scaleX(1); }
.nav-links li a.active { color: var(--text); }

.nav-tools { display: flex; align-items: center; gap: 0.6rem; }

/* Theme toggle */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.42rem 0.55rem;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  overflow: hidden;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { transition: transform 0.5s var(--ease-out); }
.theme-toggle .toggle-label {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding-right: 0.3rem;
}
.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 9px 8px;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------------------------------------------------------- Buttons */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
  will-change: transform;
}

.btn-primary {
  position: relative;
  color: #fff;
  border: none;
  background: var(--grad);
  background-size: 180% 180%;
  box-shadow: 0 8px 24px -8px rgba(99, 102, 241, 0.6);
  animation: gradShift 6s ease infinite;
}
.btn-primary:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 16px 40px -10px rgba(99, 102, 241, 0.7);
}
@keyframes gradShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* --------------------------------------------------------------- Hero */
.hero {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  align-items: center;
  gap: 3.5rem;
  min-height: calc(100vh - var(--nav-h));
  padding: 3rem 0;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  margin-bottom: 1.6rem;
}
.hero-eyebrow .status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(34, 211, 238, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}

.hero-text h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.02;
  margin-bottom: 1rem;
}

.hero-roles {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3vw, 1.7rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.25rem;
  min-height: 1.6em;
}
.hero-roles .typed-cursor { color: var(--accent); font-weight: 400; }

.hero-sub {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-family: var(--font-mono);
}

.hero-bio {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin-bottom: 2.25rem;
}

.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }

.hero-social { display: flex; gap: 0.6rem; }
.hero-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: transform var(--transition), border-color var(--transition), color var(--transition), background var(--transition);
}
.hero-social a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
}

/* Avatar */
.hero-img-wrap {
  position: relative;
  justify-self: center;
  width: min(340px, 80vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
/* rotating dashed scanner ring (replaces the old color wheel) */
.hero-img-wrap::before {
  content: '';
  position: absolute;
  inset: 1%;
  border-radius: 50%;
  border: 1px dashed rgba(34, 211, 238, 0.38);
  animation: spin 26s linear infinite;
}
.hero-img-wrap::after {
  content: '';
  position: absolute;
  inset: -5%;
  border-radius: 50%;
  border: 1px solid rgba(224, 30, 60, 0.22);
  box-shadow: inset 0 0 34px rgba(34, 211, 238, 0.08);
  animation: spin 34s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hero-img {
  position: relative;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface-solid);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.4), 0 0 42px rgba(34, 211, 238, 0.18), 0 0 64px rgba(224, 30, 60, 0.12);
  z-index: 1;
}

/* floating code circling the photo */
.code-orbit { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.orbit-code {
  position: absolute;
  top: 50%; left: 50%;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent-2);
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.55);
  white-space: nowrap;
  opacity: 0.82;
  will-change: transform;
}
.orbit-code.red { color: var(--accent); text-shadow: 0 0 8px rgba(224, 30, 60, 0.55); }
.orbit-code.dim { opacity: 0.5; font-size: 0.64rem; }

.hero-badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.42rem 0.85rem;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(224, 30, 60, 0.12);
  /* keep text crisp: no backdrop blur, promote to its own layer, snap rendering */
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
.hero-badge svg { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }
.hero-badge.b1 { top: 8%; left: -6%; animation: float1 5s ease-in-out infinite; }
.hero-badge.b2 { bottom: 14%; right: -8%; animation: float2 6s ease-in-out infinite; }
.hero-badge.b3 { bottom: 2%; left: 10%; animation: float1 7s ease-in-out infinite; }
@keyframes float1 { 0%,100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(0,-10px,0); } }
@keyframes float2 { 0%,100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(0,10px,0); } }

/* Page hero (inner pages) */
.page-hero {
  padding: 5rem 0 2.5rem;
  text-align: center;
}
.page-hero .hero-eyebrow { margin-bottom: 1.25rem; }
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
  line-height: 1.05;
}
.page-hero-sub {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 580px;
  margin: 0 auto;
}

/* ------------------------------------ Stats — "system monitor" panel */
.stats-panel {
  position: relative;
  margin: 1rem 0 2.5rem;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.stats-panel::after {
  /* faint scanline texture inside the panel */
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.02) 0 2px, transparent 2px 4px);
}
[data-theme="light"] .stats-panel::after { background: repeating-linear-gradient(to bottom, rgba(60,63,88,0.03) 0 2px, transparent 2px 4px); }

.stats-winbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.win-dots { display: inline-flex; gap: 0.4rem; }
.win-dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--muted); opacity: 0.6; }
.win-dots i:nth-child(1) { background: var(--accent); opacity: 0.9; }
.win-dots i:nth-child(2) { background: #f5b301; opacity: 0.9; }
.win-dots i:nth-child(3) { background: var(--accent-2); opacity: 0.9; }
.win-title { letter-spacing: 0.02em; }
.win-flag {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
}
.win-flag::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px var(--accent-2);
  animation: pulse 2s infinite;
}

.stats-body { display: flex; flex-direction: column; }

.stat-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 1.3fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.3rem 1.4rem;
  text-decoration: none;
  color: var(--text);
  border-top: 1px solid var(--border);
  transition: background var(--transition), padding-left var(--transition);
}
.stats-body .stat-row:first-child { border-top: none; }
.stat-row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: var(--grad);
  box-shadow: 0 0 18px var(--accent);
  transition: width var(--transition);
}
.stat-row:hover {
  background: var(--grad-soft);
  padding-left: 1.9rem;
  color: var(--text);
}
.stat-row:hover::before { width: 3px; }

.stat-cmd {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-cmd .stat-prompt { color: var(--accent); font-weight: 700; margin-right: 0.4rem; }
.stat-row:hover .stat-cmd { color: var(--text); }

.stat-meter {
  position: relative;
  height: 10px;
  border-radius: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.stat-bar {
  position: absolute;
  inset: 0;
  width: 0;
  background: var(--grad);
  box-shadow: 0 0 14px var(--accent);
  transition: width 1.5s var(--ease-out);
}
.stat-bar::after {
  /* moving highlight sweep */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: translateX(-100%);
  animation: barSweep 2.6s ease-in-out infinite;
}
.stats-panel.in .stat-bar { width: var(--fill); }

.stat-val {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  justify-self: end;
  font-family: var(--font-mono);
}
.stat-num {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.45);
}
[data-theme="light"] .stat-num { text-shadow: none; color: var(--accent); }
.stat-val em {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.stat-row:hover .stat-num { color: var(--accent-2); }
[data-theme="light"] .stat-row:hover .stat-num { color: var(--accent); }

@keyframes barSweep {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(200%); }
}

@media (max-width: 640px) {
  .stat-row { grid-template-columns: 1fr auto; gap: 0.75rem 1rem; }
  .stat-meter { grid-column: 1 / -1; order: 3; }
  .stat-num { font-size: 1.7rem; }
}

/* --------------------------------------------------------------- Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  position: relative;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

/* Animated "draw-on" red border — starts at bottom-middle, draws out to both
   sides and up to the top, then retracts in reverse on mouse-out.
   Shared by project cards (home + Projects page) and client review cards. */
.card-border {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}
.card-border path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  filter: drop-shadow(0 0 3px var(--accent));
  transition: stroke-dashoffset 0.6s var(--ease-out);
}
.card:hover .card-border path,
.review-card:hover .card-border path { stroke-dashoffset: 0; }
/* Project cards only: dash overshoots the path length so the two halves fully
   meet at the top-centre (no 1-2px gap) and are completely hidden when idle
   (no tiny line peeking through). Review cards keep their original values. */
.card .card-border path { stroke-dasharray: 1.1 2; stroke-dashoffset: 1.1; }
.card:hover .card-border path { stroke-dashoffset: 0; }

.card-img-wrap { position: relative; overflow: hidden; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.card-img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  background: var(--surface-2);
  transition: transform 0.5s var(--ease-out);
}
.card:hover .card-img { transform: scale(1.06); }
.card-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--surface-solid), transparent 55%);
  opacity: 0.5;
}

.card-body {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.7rem;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.card-desc { font-size: 0.88rem; color: var(--muted); flex: 1; }
.card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tag-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.22rem 0.6rem;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.card-actions { display: flex; gap: 0.6rem; margin-top: 0.4rem; flex-wrap: wrap; }
.card-actions a, .btn-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex: 1;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.55rem 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}
.card-actions .btn-demo { background: var(--grad); color: #fff; border: none; }
.card-actions .btn-demo:hover { transform: translateY(-2px); color: #fff; box-shadow: 0 8px 20px -8px rgba(99,102,241,0.6); }
.card-actions .btn-repo, .btn-preview {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.card-actions .btn-repo:hover, .btn-preview:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* --------------------------------------------------------- Filter bar */
.filter-bar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.filter-btn:hover { color: var(--text); border-color: var(--accent); }
.filter-btn.active { background: var(--grad); color: #fff; border-color: transparent; }

.projects-grid { grid-template-columns: repeat(3, 1fr); }

.confidential-notice {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  max-width: 720px;
  margin: 0 auto 2.5rem;
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  background: var(--grad-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}
.confidential-notice svg { flex-shrink: 0; color: var(--accent); }

/* --------------------------------------------------------------- Skills */
.skills-category { margin-bottom: 3rem; }
.skills-category-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.skills-category-title::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 3px;
  background: var(--grad);
}
.skills-chips { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.skill-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.6rem 1rem;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.skill-chip:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.skill-chip img { width: 22px; height: 22px; object-fit: contain; }
.skill-name { font-size: 0.88rem; font-weight: 600; color: var(--text); }

.level-badge {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.level-beginner { background: rgba(34,211,238,0.14); color: var(--accent-2); border: 1px solid rgba(34,211,238,0.3); }
.level-intermediate { background: rgba(251,146,60,0.15); color: #fb923c; border: 1px solid rgba(251,146,60,0.3); }
.level-advanced { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }

/* Marquee (home tech scroll) */
.carousel-wrap {
  overflow: hidden;
  width: 100%;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.carousel-track {
  display: flex;
  gap: 0.9rem;
  width: max-content;
  animation: marquee 40s linear infinite;
}
.carousel-track:hover { animation-play-state: paused; }
.carousel-track .tag-pill {
  white-space: nowrap;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* --------------------------------------------------------------- Reviews */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.review-card {
  position: relative;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.review-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.review-quote-mark {
  position: absolute;
  top: 0.4rem; right: 1.5rem;
  font-size: 6rem;
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.18;
  font-family: Georgia, serif;
  pointer-events: none; user-select: none;
}
.review-header { display: flex; align-items: center; gap: 0.9rem; }
.review-avatar {
  width: 54px; height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
  background: var(--grad) border-box;
  box-shadow: 0 0 0 2px var(--bg-2) inset;
  flex-shrink: 0;
}
.review-meta { display: flex; flex-direction: column; gap: 0.25rem; }
.review-name { font-family: var(--font-display); font-size: 0.98rem; font-weight: 700; color: var(--text); }
.review-role { font-size: 0.8rem; color: var(--muted); }
.review-stars-container { display: flex; align-items: center; gap: 5px; }
.review-rating-num { font-weight: 700; font-family: var(--font-mono); font-size: 0.82rem; color: var(--text); }
.review-stars { display: flex; align-items: center; gap: 2px; }
.review-text { font-size: 0.92rem; color: var(--muted); line-height: 1.7; }

/* -------------------------------------------------------- Timeline */
.timelines-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}
.timeline-heading {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.timeline-heading::before {
  content: '';
  width: 22px; height: 22px;
  border-radius: 7px;
  background: var(--grad-soft);
  border: 1px solid var(--border-strong);
}
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-2), transparent);
}
.timeline-item { position: relative; margin-bottom: 2rem; }
.timeline-dot {
  position: absolute;
  left: -2rem; top: 6px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--grad);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent);
}
.timeline-content {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: transform var(--transition), border-color var(--transition);
}
.timeline-content:hover { transform: translateX(5px); border-color: var(--accent); }
.timeline-date {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.5rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.timeline-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 0.2rem; }
.timeline-org { font-size: 0.875rem; color: var(--muted); margin-bottom: 0.75rem; }
.timeline-bullets { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.timeline-bullets li { font-size: 0.87rem; color: var(--muted); padding-left: 1.1rem; position: relative; }
.timeline-bullets li::before {
  content: '';
  position: absolute; left: 0; top: 0.6em;
  width: 6px; height: 6px; border-radius: 2px;
  background: var(--grad);
}

/* Certifications */
.certs-scroll { display: flex; gap: 1.5rem; overflow-x: auto; padding: 0.5rem 0 1rem; scrollbar-width: thin; }
.cert-card {
  max-width: 320px;
  min-width: 240px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.cert-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.cert-img { width: 100%; height: auto; object-fit: contain; border-radius: 8px; margin-bottom: 0.5rem; }
.cert-name { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; color: var(--text); }
.cert-issuer { font-size: 0.82rem; color: var(--muted); }
.cert-date { font-family: var(--font-mono); font-size: 0.76rem; color: var(--accent); font-weight: 500; }

/* --------------------------------------------------------------- Contact */
.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 2.5rem;
  align-items: start;
}
.contact-info-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; margin-bottom: 1.5rem; }
.contact-list { list-style: none; display: flex; flex-direction: column; gap: 1.1rem; margin-bottom: 2rem; }
.contact-list li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color var(--transition), transform var(--transition);
}
.contact-list li:hover { border-color: var(--accent); transform: translateX(4px); }
.contact-label { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; color: var(--muted); }
.contact-value { font-size: 0.95rem; color: var(--text); font-weight: 500; }
.contact-link { color: var(--accent); }
.contact-link:hover { color: var(--accent-hover); }
.map-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }

.contact-form-wrap {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}
.contact-form { display: flex; flex-direction: column; gap: 1.2rem; }
.form-group { display: flex; flex-direction: column; gap: 0.45rem; }
.form-group label { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.contact-form input, .contact-form textarea {
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.8rem 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  resize: none;            /* no manual drag-resize */
  width: 100%;
}
.contact-form textarea {
  min-height: 150px;       /* fixed starting height */
  max-height: 420px;       /* grows up to here, then scrolls */
  overflow-y: auto;
  line-height: 1.6;
}
.contact-form input:focus, .contact-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--muted); opacity: 0.6; }
.form-submit-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.form-status { font-size: 0.875rem; font-weight: 600; padding: 0.5rem 0.9rem; border-radius: 10px; opacity: 0; transition: opacity 0.3s ease; }
.form-status.success { opacity: 1; background: rgba(34,197,94,0.12); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.form-status.error { opacity: 1; background: rgba(248,113,113,0.12); color: #f87171; border: 1px solid rgba(248,113,113,0.3); }

/* --------------------------------------------------------------- Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  max-width: var(--max-w);
  margin: 5rem auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.2rem;
  position: relative;
  z-index: 1;
}
.footer-copy { font-size: 0.85rem; color: var(--muted); }
.footer-links { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}
.footer-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* --------------------------------------------------- Gallery modal */
.gallery-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(4, 4, 10, 0.9);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  backdrop-filter: blur(14px);
  padding: 2rem;
}
.gallery-modal.open { display: flex; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.gallery-close {
  position: absolute;
  top: 1.25rem; right: 1.5rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  width: 42px; height: 42px;
  border-radius: 50%;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  transition: background var(--transition);
  z-index: 10;
}
.gallery-close:hover { background: rgba(255,255,255,0.2); }
.gallery-stage { display: flex; align-items: center; justify-content: center; max-width: 100%; max-height: 100%; }
.gallery-media { max-width: 100%; max-height: 78vh; object-fit: contain; display: block; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.gallery-nav { display: flex; align-items: center; gap: 1.5rem; }
.gallery-arrow {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  color: #fff;
  font-size: 1.1rem;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.gallery-arrow:hover { background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.4); }
.gallery-counter { font-family: var(--font-mono); font-size: 0.85rem; color: rgba(255,255,255,0.7); min-width: 54px; text-align: center; }

/* --------------------------------------------------- Zoom modal (certs) */
.zoomable-img { cursor: zoom-in; transition: opacity 0.2s ease; }
.zoomable-img:hover { opacity: 0.9; }
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: rgba(4,4,10,0.96);
  backdrop-filter: blur(10px);
  touch-action: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}
.modal-overlay.is-active { display: flex !important; opacity: 1; }
.modal-wrapper { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; height: 100svh; width: 100vw; overflow: hidden; }
.modal-content {
  display: block;
  max-width: 100% !important; max-height: 100% !important;
  width: auto !important; height: auto !important;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  cursor: grab;
  transform-origin: center center;
  will-change: transform;
}
.modal-content.smooth-transition { transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1); }
.modal-content:active { cursor: grabbing; }
.modal-close {
  position: absolute;
  top: 20px; right: 25px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 100000;
  line-height: 1;
  background: none; border: none;
}

/* --------------------------------------------- Theme view transition */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 9999; }

/* --------------------------------------------- Reveal (fallback + JS) */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.reveal.visible { opacity: 1; transform: none; }

/* --------------------------------------------------------- Responsive */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; text-align: center; gap: 2.5rem; min-height: auto; padding-top: 2rem; }
  .hero-text { order: 2; }
  .hero-img-wrap { order: 1; width: min(280px, 70vw); }
  .hero-eyebrow, .hero-cta, .hero-social { justify-content: center; }
  .hero-bio { margin-left: auto; margin-right: auto; }
  .card-grid, .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .timelines-wrap { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: flex-end;   /* float menu items to the right */
    text-align: right;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem 1.25rem;
    gap: 0.25rem;
    margin-left: 0;
  }
  .nav-links.open { display: flex; animation: fadeIn 0.25s ease; }
  .nav-links li { width: auto; }
  .nav-links li a { display: block; padding: 0.7rem 0.85rem; }
  .nav-links li a::after { display: none; }
  .nav-links li a.active, .nav-links li a:hover { background: var(--surface-2); }
  .contact-wrap { grid-template-columns: 1fr; }
  .footer { flex-direction: column; align-items: flex-start; }
  .section { padding: 4rem 0; }
}

@media (max-width: 600px) {
  .card-grid, .projects-grid, .reviews-grid { grid-template-columns: 1fr; }
  .section { padding: 3rem 0; }
  .page-hero { padding: 3rem 0 1.5rem; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn-primary, .hero-cta .btn-secondary { width: 100%; }
  .contact-form-wrap { padding: 1.4rem; }
  .hero-badge { font-size: 0.68rem; padding: 0.3rem 0.6rem; }
  .theme-toggle .toggle-label { display: none; }
}

@media (min-width: 1024px) {
  .theme-toggle .toggle-label { display: inline; }
}

/* ------------------------------------------------------ Glitch text */
.glitch { position: relative; display: inline-block; }
/* page headings must stay block-level so the eyebrow sits ABOVE them */
.page-hero h1.glitch { display: block; }
.hero-text h1 .glitch { color: var(--accent); }
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.glitch::before { color: var(--accent-2); animation: glitchTop 3.6s infinite steps(2, end); }
.glitch::after  { color: #fff; mix-blend-mode: screen; animation: glitchBot 4.3s infinite steps(2, end); }
[data-theme="light"] .glitch::after { color: #000; mix-blend-mode: normal; }

@keyframes glitchTop {
  0%, 87%, 100% { opacity: 0; transform: translate(0, 0); clip-path: inset(0 0 100% 0); }
  88% { opacity: 0.9; transform: translate(-3px, -2px); clip-path: inset(0 0 58% 0); }
  91% { opacity: 0.9; transform: translate(2px, 1px);  clip-path: inset(8% 0 42% 0); }
  94% { opacity: 0.8; transform: translate(-2px, 0);   clip-path: inset(0 0 72% 0); }
  95% { opacity: 0; }
}
@keyframes glitchBot {
  0%, 89%, 100% { opacity: 0; transform: translate(0, 0); clip-path: inset(100% 0 0 0); }
  90% { opacity: 0.85; transform: translate(3px, 2px);  clip-path: inset(62% 0 0 0); }
  93% { opacity: 0.85; transform: translate(-2px, -1px); clip-path: inset(45% 0 12% 0); }
  96% { opacity: 0; }
}

/* Scramble dud glyphs (section titles decoding on reveal) */
.section-title .dud,
.page-hero h1 .dud { color: var(--accent-2); opacity: 0.85; }

/* ------------------------------------------------ Button hacker glitch */
.btn-primary:hover {
  animation: gradShift 6s ease infinite, btnGlitch 0.36s steps(2, end) 1;
}
@keyframes btnGlitch {
  0%   { transform: translateY(-3px); box-shadow: -3px 0 var(--accent-2), 3px 0 rgba(255,255,255,0.5), 0 16px 40px -10px rgba(224,30,60,0.7); }
  50%  { transform: translate(2px, -3px); box-shadow: 3px 0 var(--accent-2), -3px 0 rgba(255,255,255,0.5), 0 16px 40px -10px rgba(224,30,60,0.7); }
  100% { transform: translateY(-3px); box-shadow: 0 16px 40px -10px rgba(224,30,60,0.7); }
}

/* Reveal: quick "signal lock" flicker on top of the GSAP slide */
.reveal.locking { animation: lockFlicker 0.3s steps(2, end) 1; }
@keyframes lockFlicker {
  0% { opacity: 0.4; }
  25% { opacity: 0.9; transform: translateX(-2px); }
  50% { opacity: 0.5; }
  75% { opacity: 1; transform: translateX(1px); }
  100% { opacity: 1; transform: none; }
}

/* -------------------------------- Mobile readability veil (point 1) */
@media (max-width: 768px) {
  /* Frosted matte layer between the terminal background and the content
     so text stays readable on small screens. */
  body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }
}

/* -------------------------- Desktop readability glass (sub-2K screens) */
/* On desktop screens smaller than 2K the busy terminal backdrop hurts
   readability. A matte frosted-glass panel sits behind the main content
   column (terminal effect stays visible in the side gutters). On 2K+
   displays there's enough room that the raw effect stays readable, so the
   panel is intentionally not applied. */
@media (min-width: 769px) and (max-width: 2559px) {
  main {
    position: relative;
    z-index: 1;
  }
  main::before {
    content: '';
    position: absolute;
    /* small top gap so the panel doesn't sit flush against the navbar */
    top: 15rem;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    border-radius: var(--radius-lg);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(var(--glass-blur)) saturate(115%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(115%);
    pointer-events: none;
  }
}

/* ------------------------------------ Page transition loader (Mr. Robot) */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
.page-loader::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.4) 3px, rgba(0,0,0,0) 4px);
  opacity: 0.5;
  mix-blend-mode: multiply;
}
html.site-ready .page-loader { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-box { position: relative; z-index: 1; width: min(440px, 82vw); text-align: center; }
.loader-logo {
  font-family: var(--font-display);
  font-size: clamp(2rem, 9vw, 3.4rem);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
}
.loader-line {
  position: relative;
  height: 4px;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.loader-bar {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 42%;
  background: var(--grad);
  box-shadow: 0 0 14px var(--accent);
  animation: loaderBar 1s ease-in-out infinite;
}
@keyframes loaderBar {
  0%   { transform: translateX(-130%); }
  100% { transform: translateX(320%); }
}
.loader-status {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-2);
}
.loader-status::after { content: '_'; animation: caret 1s steps(1) infinite; }

@media (prefers-reduced-motion: reduce) {
  .loader-bar { animation: none; width: 100%; transform: none; }
}
