/* =========================================
   NIKHIL MOURYA — PORTFOLIO
   "Research Lab Meets Personal OS"
   ========================================= */

/* ─── TOKENS ─── */
:root {
  --bg:           #020a04;
  --surface:      #071009;
  --surface-2:    #0a1a0c;
  --accent:       #22c55e;
  --accent-hi:    #86efac;
  --cyan:         #4ade80;
  --text:         #f0fdf4;
  --muted:        #4d7a58;
  --faint:        #2d4f34;
  --border:       #0f2414;

  --ff-sans: 'Inter', -apple-system, system-ui, sans-serif;
  --ff-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --fz-xs:  0.72rem;
  --fz-sm:  0.875rem;
  --fz-md:  1rem;
  --fz-lg:  1.125rem;
  --fz-xl:  1.25rem;
  --fz-2xl: 1.5rem;
  --fz-3xl: 1.875rem;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;

  --ease: 200ms ease;
  --ease-md: 300ms ease;
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--ff-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a  { text-decoration: none; color: inherit; }
li { list-style: none; }
img { max-width: 100%; display: block; }
button { font: inherit; border: none; background: none; cursor: pointer; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── SELECTION ─── */
::selection { background: var(--accent); color: #fff; }

/* ─── LAYOUT ─── */
.container {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 24px;
  position: relative;
  z-index: 1;
}
.section     { padding-block: 72px; position: relative; }
.section-alt { background: transparent; }

/* ─── SCROLL NARRATIVE BACKGROUNDS ─── */
#about, #skills, #projects, #experience, #contact {
  position: relative;
  isolation: isolate;
}

#about::before, #skills::before, #projects::before, #experience::before, #contact::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

#about::before, #projects::before, #contact::before {
  background: rgba(2, 10, 4, 0.92);
}

#skills::before, #experience::before {
  background: rgba(7, 16, 9, 0.92);
}

/* ─── SECTION HEADER ─── */
.section-hd   { margin-bottom: 40px; position: relative; z-index: 1; }
.section-title {
  font-size: var(--fz-3xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  display: inline-block;
  position: relative;
  padding-left: 20px;
}
.section-title::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* ─── INLINE CODE ─── */
.mono-code {
  font-family: var(--ff-mono);
  font-size: 0.88em;
  background: rgba(34,197,94,.1);
  color: var(--accent-hi);
  border: 1px solid rgba(34,197,94,.2);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
}

/* ─── SCROLL REVEAL ─── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 420ms ease calc(var(--d, 0ms)),
              transform 420ms ease calc(var(--d, 0ms));
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ─── HERO ANIMATIONS ─── */
.anim-fade-up {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 560ms ease calc(var(--d, 0ms)) forwards;
}
.anim-fade-in {
  opacity: 0;
  animation: fadeIn 560ms ease calc(var(--d, 0ms)) forwards;
}
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  to { opacity: 1; }
}

/* ─── BUTTONS ─── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 11px 22px;
  background: var(--accent);
  color: #fff;
  font-size: var(--fz-sm);
  font-weight: 600;
  border-radius: var(--radius);
  transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
}
.btn-primary:hover {
  background: var(--accent-hi);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(34,197,94,.35);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 11px 22px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--fz-sm);
  font-weight: 500;
  border-radius: var(--radius);
  transition: border-color var(--ease), color var(--ease), transform var(--ease);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════
   NAV
══════════════════════════════════════ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: 60px;
  z-index: 100;
  background: rgba(5,7,13,.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: border-color var(--ease-md);
}
.nav.scrolled { border-bottom-color: transparent; }

.nav-inner {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: var(--fz-md);
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: color var(--ease);
}
.nav-logo:hover { color: var(--accent-hi); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-link {
  font-size: var(--fz-sm);
  font-weight: 500;
  color: var(--muted);
  position: relative;
  padding-bottom: 2px;
  transition: color var(--ease);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width var(--ease-md);
}
.nav-link:hover          { color: var(--text); }
.nav-link:hover::after   { width: 100%; }
.nav-link.active         { color: var(--accent-hi); }
.nav-link.active::after  { width: 100%; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px; height: 28px;
}
.nav-toggle span {
  display: block;
  width: 100%; height: 1.5px;
  background: var(--text);
  transition: var(--ease-md);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ══════════════════════════════════════
   HERO
══════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 60px;
}

/* Neural network canvas */
#nn-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -10;
  display: block;
  pointer-events: none;
}

/* Matrix / binary cursor FX canvas
   Sits just above the neural-net canvas.
   NO mix-blend-mode — we use clearRect every frame and draw at
   low alpha directly, so the effect is visually identical across
   every scroll section regardless of background colour. */
#matrix-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -9;
  display: block;
  pointer-events: none;
  /* transparent by default — all drawing is at low alpha in JS */
}

@media (prefers-reduced-motion: reduce) {
  #matrix-canvas { opacity: 0.4; }
}

/* Gradient mesh */
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 55% at 18% 62%, rgba(34,197,94,.09) 0%, transparent 100%),
    radial-gradient(ellipse 40% 35% at 82% 28%, rgba(74,222,128,.05) 0%, transparent 100%);
  animation: heroPulse 18s ease-in-out infinite alternate;
}
@keyframes heroPulse {
  0%   { opacity: .65; }
  100% { opacity: 1; }
}

/* Subtle grid */
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(15,36,20,.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,36,20,.18) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, transparent 5%, black 25%, black 75%, transparent 95%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 24px;
  padding-block: 80px;
  opacity: var(--hero-opacity, 0);
  transition: opacity 400ms ease;
}
.hero-label {
  font-family: var(--ff-mono);
  font-size: var(--fz-sm);
  color: var(--faint);
  letter-spacing: .06em;
  margin-bottom: 24px;
}
.hero-name {
  font-size: clamp(3.2rem, 9vw, 7.5rem);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: .94;
  margin-bottom: 24px;
}
.hero-role {
  font-family: var(--ff-mono);
  font-size: var(--fz-md);
  color: var(--muted);
  margin-bottom: 20px;
}
.hero-desc {
  font-size: var(--fz-lg);
  color: var(--muted);
  max-width: 480px;
  line-height: 1.62;
  margin-bottom: 40px;
}
.br-lg { display: none; }
.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── CURRENT STRIP ── */
.current-strip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 8px 16px;
  background: rgba(34, 197, 94, 0.05);
  border: 1px solid rgba(34, 197, 94, 0.15);
  border-radius: 999px;
  font-family: var(--ff-mono);
  font-size: var(--fz-xs);
}

.current-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulseDot 2.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  50%       { opacity: 0.6; box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

.current-label {
  color: var(--muted);
}

.current-link {
  color: var(--accent-hi);
  transition: color var(--ease);
}

.current-link:hover {
  color: var(--text);
}

/* Avatar — float right area inside hero-content on desktop */
.hero-avatar {
  position: absolute;
  top: 104px; /* aligned perfectly with top of .hero-name */
  right: 24px;
  z-index: 1;
}
/* ── TERMINAL AVATAR FRAME ── */
.term-frame {
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 
    0 0 0 1px rgba(34,197,94,0.15),
    0 20px 60px rgba(0,0,0,0.5),
    0 0 40px rgba(34,197,94,0.06);
  transition: all 300ms ease;
  display: flex;
  flex-direction: column;
}

.term-frame:hover {
  border-color: rgba(34,197,94,0.4);
  box-shadow: 
    0 0 0 1px rgba(34,197,94,0.25),
    0 25px 65px rgba(0,0,0,0.6),
    0 0 50px rgba(34,197,94,0.1);
}

.term-titlebar {
  height: 36px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
  display: flex;
  align-items: center;
  padding: 0 14px;
  position: relative;
}

.term-dots {
  display: flex;
  gap: 7px;
  width: 48px;
}

.t-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  transition: filter 300ms ease;
}

.t-red { background: #ff5f57; }
.t-yellow { background: #febc2e; }
.t-green { background: #28c840; }

.term-frame:hover .t-dot {
  filter: brightness(1.2);
}

.term-title {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.04em;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.term-spacer {
  width: 48px;
}

.term-photo {
  position: relative;
  width: 100%;
  line-height: 0;
}

.term-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/5;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.08) brightness(0.92);
  display: block;
}

/* Cyan tint overlay */
.term-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(74, 222, 128, 0.08);
  mix-blend-mode: color;
  pointer-events: none;
  transition: background 300ms ease;
}

.term-frame:hover .term-photo::after {
  background: rgba(74, 222, 128, 0.13);
}

/* Scanline overlay */
.term-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.03) 3px,
    rgba(0,0,0,0.03) 4px
  );
  pointer-events: none;
  z-index: 2;
}

.term-statusbar {
  height: 24px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-radius: 0 0 10px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--faint);
}

.s-dot {
  color: #4ade80;
  animation: sPulse 2.5s infinite ease-in-out;
}

@keyframes sPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@media (max-width: 1024px) {
  .term-frame {
    width: 220px;
  }
}

/* Scroll indicator */
.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}
.scroll-track {
  width: 4px; height: 36px;
  border: 1px solid var(--faint);
  border-radius: 2px;
  overflow: hidden;
}
.scroll-thumb {
  width: 100%; height: 50%;
  background: var(--accent);
  border-radius: 1px;
  animation: scrollAnim 2s ease-in-out infinite;
}
@keyframes scrollAnim {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(200%); }
}

/* ══════════════════════════════════════
   ABOUT
══════════════════════════════════════ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  margin-bottom: 56px;
}

.body-lg {
  font-size: var(--fz-lg);
  color: var(--muted);
  line-height: 1.72;
  margin-bottom: 24px;
}

/* Focus — 2×2 cards (default) */
.focus-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 32px;
}
.focus-grid.focus-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.focus-tile {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--ease), background var(--ease);
}
.focus-tile.focus-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: start;
  padding: 16px 18px;
  border-radius: 0;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-top: none;
  border-bottom: 1px solid var(--border);
}
.focus-tile.focus-row:first-child {
  border-top: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.focus-tile.focus-row:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
}
.focus-tile.focus-row:hover {
  border-color: var(--border);
  background: rgba(34,197,94,.03);
  box-shadow: inset 3px 0 0 var(--accent);
}
.focus-num {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--faint);
  line-height: 1.4;
  padding-top: 2px;
}
.focus-main {
  min-width: 0;
}
.focus-tile.focus-row .focus-name {
  margin-bottom: 6px;
}
.focus-tag {
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  color: var(--accent-hi);
  border: 1px solid rgba(34,197,94,.35);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
  align-self: start;
  margin-top: 2px;
}
@media (max-width: 540px) {
  .focus-tile.focus-row {
    grid-template-columns: 32px minmax(0, 1fr);
  }
  .focus-num {
    grid-row: 1 / span 2;
  }
  .focus-main {
    grid-column: 2;
    grid-row: 1;
  }
  .focus-tag {
    grid-column: 2;
    grid-row: 2;
    margin-top: 4px;
    white-space: normal;
    max-width: 100%;
  }
}
.focus-tile:hover {
  border-color: var(--accent);
  background: rgba(34,197,94,.04);
}
.focus-name {
  font-size: var(--fz-sm);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.focus-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Terminal card */
.terminal-card {
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--ff-mono);
  transition: border-color var(--ease);
}
.terminal-card:hover { border-color: rgba(34,197,94,.4); }

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.t-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.t-red    { background: #ff5f57; }
.t-yellow { background: #febc2e; }
.t-green  { background: #28c840; }
.t-title  {
  margin-left: 8px;
  font-size: var(--fz-xs);
  color: var(--faint);
}

.terminal-body {
  padding: 14px 16px 12px;
  font-size: 0.8125rem;
  line-height: 1.45;
}
.t-line {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  column-gap: 12px;
  align-items: baseline;
  margin: 0;
  padding: 5px 0;
  font-size: inherit;
  line-height: inherit;
}
.t-line.t-sep {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.t-gap { margin-top: 8px; }
.t-key {
  color: var(--faint);
  flex-shrink: 0;
  user-select: none;
  font-size: 0.75rem;
  opacity: 0.9;
}
.t-val {
  color: var(--muted);
  word-break: break-word;
}
.t-val.t-accent { color: var(--accent-hi); }
.t-val.t-cyan   { color: var(--cyan); }
.t-cursor {
  font-size: inherit;
  color: var(--accent);
  margin: 8px 0 0;
  line-height: 1;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Highlights */
.highlights {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.hl-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--ease), background var(--ease);
}
.hl-item:hover {
  border-color: rgba(34,197,94,.35);
  background: rgba(34,197,94,.03);
}
.hl-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  min-width: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--accent);
}
.hl-title {
  font-size: var(--fz-sm);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.hl-text {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

/* About — vertical timeline highlights */
.highlights.hl-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 0;
  margin-top: 16px;
}
.hl-timeline .hl-item {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 8px 20px;
  align-items: start;
  padding: 22px 0 26px;
  border: none;
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.hl-timeline .hl-item:last-child {
  border-bottom: none;
}
.hl-timeline .hl-item:hover {
  background: transparent;
  border-color: var(--border);
}
.hl-year {
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--faint);
  text-align: right;
  padding-top: 6px;
  line-height: 1.35;
}
.hl-body {
  min-width: 0;
  padding-left: 20px;
  margin-left: 0;
  border-left: 1px solid var(--border);
}
.hl-timeline .hl-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 10px;
  margin-bottom: 8px;
  line-height: 1.35;
}
.hl-badge {
  flex-shrink: 0;
  font-family: var(--ff-mono);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-hi);
  border: 1px solid rgba(34,197,94,.4);
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1.2;
}
.hl-stat {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  line-height: 1.35;
}
.hl-timeline .hl-text {
  margin-bottom: 0;
}

/* ══════════════════════════════════════
   SKILLS
══════════════════════════════════════ */
/* ── SKILLS TICKER ── */
.ticker-wrapper {
  overflow: hidden;
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
}

.ticker-row {
  display: flex;
  gap: 12px;
  width: max-content;
  margin-bottom: 16px;
}

.ticker-row:last-child { margin-bottom: 0; }

.ticker-row-inner {
  display: flex;
  flex-shrink: 0;
  gap: 12px;
  animation: tickerLeft 30s linear infinite;
}

.ticker-row:nth-child(2) .ticker-row-inner {
  animation: tickerRight 35s linear infinite;
}

.ticker-row:hover .ticker-row-inner {
  animation-play-state: paused;
}

@keyframes tickerLeft {
  0%   { transform: translateX(0); }
  100% { transform: translateX(calc(-100% - 12px)); }
}

@keyframes tickerRight {
  0%   { transform: translateX(calc(-100% - 12px)); }
  100% { transform: translateX(0); }
}

.ticker-pill {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 10px;
  padding: 8px 16px;
  background: #071009;
  border: 1px solid #0f2414;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #4d7a58;
  white-space: nowrap;
  cursor: default;
  transition: all 200ms ease;
  user-select: none;
}

.ticker-pill:hover {
  border-color: #22c55e;
  color: #f0fdf4;
  background: rgba(34,197,94,0.06);
}

.ticker-pill img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* ══════════════════════════════════════
   PROJECTS
══════════════════════════════════════ */
.proj-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}


.proj-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--ease-md), transform var(--ease-md), box-shadow var(--ease-md);
  isolation: isolate;
}
.proj-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(34,197,94,.12);
}

/* Gradient top border stripe */
.proj-top-bar {
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hi) 50%, transparent 100%);
  opacity: 0;
  transition: opacity var(--ease-md);
}
.proj-card:hover .proj-top-bar { opacity: 1; }

.proj-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }

.proj-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.proj-num {
  font-family: var(--ff-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--border);
  line-height: 1;
  letter-spacing: -.03em;
  transition: color var(--ease-md);
}
.proj-card:hover .proj-num { color: rgba(34,197,94,.3); }

.proj-gh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--faint);
  font-size: 16px;
  transition: border-color var(--ease), color var(--ease);
}
.proj-gh:hover {
  border-color: var(--accent);
  color: var(--accent-hi);
}

.proj-name {
  font-size: var(--fz-xl);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 8px;
}
.proj-hook {
  font-size: var(--fz-sm);
  color: var(--accent-hi);
  font-style: italic;
  margin-bottom: 20px;
}

/* Stat chips */
.proj-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.stat-chip {
  font-family: var(--ff-mono);
  font-size: var(--fz-xs);
  color: var(--accent-hi);
  background: rgba(34,197,94,.08);
  border: 1px solid rgba(34,197,94,.18);
  border-radius: var(--radius-sm);
  padding: 3px 9px;
}

/* Tech tags */
.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-family: var(--ff-mono);
  font-size: var(--fz-xs);
  color: var(--faint);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
}

/* ══════════════════════════════════════
   EXPERIENCE — TIMELINE
══════════════════════════════════════ */
.exp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px 50px;
}
.exp-col-title {
  font-size: var(--fz-sm);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 8px; bottom: 8px;
  width: 1px;
  background: repeating-linear-gradient(
    to bottom,
    var(--border) 0px,
    var(--border) 6px,
    transparent 6px,
    transparent 12px
  );
}

.tl-entry {
  position: relative;
  padding-bottom: 36px;
}
.tl-entry:last-child { padding-bottom: 0; }

.tl-dot {
  position: absolute;
  left: -24px;
  top: 8px;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  transition: border-color var(--ease), background var(--ease);
}
.tl-entry:hover .tl-dot {
  border-color: var(--accent);
  background: rgba(34,197,94,.2);
}

.tl-body {
  transition: opacity var(--ease);
}
.tl-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.tl-role {
  font-size: var(--fz-md);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 2px;
}
.tl-company {
  font-size: var(--fz-xs);
  color: var(--faint);
}
.tl-date {
  font-family: var(--ff-mono);
  font-size: var(--fz-xs);
  color: var(--accent-hi);
  white-space: nowrap;
  margin-top: 3px;
  flex-shrink: 0;
}
.tl-bullets {
  padding-left: 16px;
}
.tl-bullets li {
  list-style: disc;
  font-size: var(--fz-sm);
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 4px;
}
.tl-desc {
  font-size: var(--fz-sm);
  color: var(--muted);
  line-height: 1.6;
}

/* Hover glow on entry */
.tl-entry:hover .tl-role { color: var(--accent-hi); }

/* ══════════════════════════════════════
   CONTACT
══════════════════════════════════════ */
.contact-section {
  background: var(--bg);
  text-align: center;
}
.contact-inner { max-width: 720px; margin-inline: auto; }

.contact-heading {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.2;
  margin-bottom: 52px;
}

.contact-links {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.clink {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color var(--ease-md), background var(--ease-md), transform var(--ease);
}
.clink:hover {
  border-color: var(--accent);
  background: rgba(34,197,94,.05);
  transform: translateY(-2px);
}
.clink-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 20px;
  color: var(--muted);
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}
.clink:hover .clink-icon {
  border-color: var(--accent);
  color: var(--accent-hi);
  background: rgba(34,197,94,.1);
}
.clink-label {
  font-size: var(--fz-sm);
  font-weight: 600;
  color: var(--text);
}
.clink-sub {
  font-family: var(--ff-mono);
  font-size: var(--fz-xs);
  color: var(--faint);
  text-align: center;
  word-break: break-all;
}

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  padding-block: 24px;
}
.footer-txt {
  font-family: var(--ff-mono);
  font-size: var(--fz-xs);
  color: var(--faint);
  text-align: center;
}

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

/* ── Tablet 768px ── */
@media (max-width: 900px) {
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .exp-grid    { grid-template-columns: 1fr; }
  .proj-grid   { grid-template-columns: 1fr; }
  .contact-links { grid-template-columns: repeat(3, 1fr); }
  .about-grid  { gap: 40px; }
}

/* ── Mobile 768px nav ── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    inset: 60px 0 auto 0;
    background: rgba(5,7,13,.97);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 12px 0;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-link {
    width: 100%;
    padding: 12px 24px;
    font-size: var(--fz-md);
  }
  .nav-link::after { display: none; }

  .hero-avatar { display: none; }
  .hero-name { font-size: clamp(2.8rem, 13vw, 4.5rem); }
  .hero-desc  { font-size: var(--fz-md); }

  .focus-grid:not(.focus-rows) { grid-template-columns: 1fr; }
}

/* ── Mobile 580px ── */
@media (max-width: 580px) {
  .section { padding-block: 64px; }
  .section-title { font-size: var(--fz-2xl); }
  .skills-grid   { grid-template-columns: 1fr; }
  .contact-links { grid-template-columns: 1fr 1fr; }
  .proj-grid     { grid-template-columns: 1fr; }
  .focus-grid:not(.focus-rows) { grid-template-columns: 1fr; }
  .hero-cta      { flex-direction: column; align-items: flex-start; }
}

/* ── Wide desktop ── */
@media (min-width: 1024px) {
  .about-grid { grid-template-columns: 1fr 380px; }
  .highlights:not(.hl-timeline) { grid-template-columns: 1fr 1fr 1fr; }
  .br-lg      { display: inline; }
}




/* ── LOSS CURVE WIDGET ── */
.loss-canvas {
  position: absolute;
  bottom: 84px;
  right: 24px;
  border: 1px solid #0f2414;
  border-radius: 8px;
  background: rgba(7, 16, 9, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1;
  opacity: 0;
  animation: fadeIn 560ms ease 1200ms forwards;
}

@media (max-width: 900px) {
  .loss-canvas { display: none; }
}

/* ── NEURON PULSE ── */
.proj-card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #4ade80;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.proj-card.pulsing::after {
  animation: neuronPulse 600ms ease-out forwards;
}

@keyframes neuronPulse {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(18);
    opacity: 0;
  }
}

/* ══════════════════════════════════════
   INFERENCE ENGINE WIDGET
══════════════════════════════════════ */
.inference-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 60px;
}

.inference-card {
  padding: 24px;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  font-family: var(--ff-mono);
  transition: transform var(--ease-md), box-shadow var(--ease-md);
  position: relative;
  overflow: hidden;
  will-change: transform, box-shadow;
}

.inference-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(74, 222, 128, 0.12);
}

.inf-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 2;
}

.inf-title {
  font-size: var(--fz-md);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color var(--ease);
}

.inference-card:hover .inf-title {
  color: var(--accent-hi);
}

.inf-status {
  font-size: var(--fz-xs);
  color: var(--cyan);
  transition: color var(--ease), text-shadow var(--ease);
}

.inference-card:hover .inf-status {
  color: var(--accent-hi);
  text-shadow: 0 0 8px rgba(134, 239, 172, 0.4);
}

.inf-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.inf-line {
  font-size: var(--fz-sm);
  color: var(--muted);
  line-height: 1.6;
}

.inf-sys {
  color: var(--faint);
  display: inline-block;
  min-width: 90px;
}

.inf-val {
  font-weight: 500;
}

@keyframes pulse-glow {
  0%, 100% {
    text-shadow: 0 0 4px rgba(74, 222, 128, 0.2);
    opacity: 0.9;
    color: var(--accent);
  }
  50% {
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.8);
    opacity: 1;
    color: var(--accent-hi);
  }
}

.pulse-val {
  animation: pulse-glow 3s infinite ease-in-out;
}

.inf-cursor {
  margin-top: 20px;
  color: var(--accent);
  animation: blink 1s step-end infinite;
  font-size: var(--fz-sm);
  position: relative;
  z-index: 2;
}

.inference-card:hover .inf-cursor {
  color: var(--accent-hi);
}

/* Hover Scan Line Effect */
.inference-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 20%;
  background: linear-gradient(to bottom, transparent, rgba(74, 222, 128, 0.3), transparent);
  transform: translateY(-100%);
  pointer-events: none;
  z-index: 10;
}

.inference-card:hover::after {
  animation: scanline 1.5s forwards ease-in-out;
}

@keyframes scanline {
  0% { transform: translateY(-100%); opacity: 1; }
  100% { transform: translateY(500%); opacity: 0; }
}