:root {
  --bg: #05070a;
  --bg-2: #0a0d12;
  --fg: #e7ecef;
  --fg-dim: #8a94a0;
  --fg-faint: #4a525c;
  --mint: #5eead4;
  --cyan: #22d3ee;
  --blue: #6366f1;
  --violet: #8b5cf6;
  --line: rgba(94, 234, 212, 0.18);
  --line-strong: rgba(94, 234, 212, 0.4);
  --card-bg: rgba(10, 14, 20, 0.72);
  --card-border: rgba(255, 255, 255, 0.08);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--fg); }
body {
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}
body.term-locked { overflow: hidden; }
body.term-locked main { z-index: 85; }
body.term-locked .bg {
  opacity: 0.22;
  filter: blur(12px) brightness(0.25) saturate(0.45);
}
body.term-locked .nav,
body.term-locked .mini-nav,
body.term-locked .marquee { opacity: 0.08; }
body.term-locked .card.term:not(.is-maximized) {
  opacity: 0.04 !important;
  filter: blur(5px) saturate(0.55);
  pointer-events: none;
}
a { color: inherit; text-decoration: none; }
img, video, canvas { display: block; max-width: 100%; }

/* -------- scroll progress bar -------- */
#scrollProgress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 99;
  background: rgba(255, 255, 255, 0.04);
  pointer-events: none;
}
#scrollProgress i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--mint) 0%, var(--cyan) 35%, var(--blue) 70%, var(--violet) 100%);
  box-shadow: 0 0 8px rgba(94, 234, 212, 0.55), 0 0 16px rgba(139, 92, 246, 0.35);
  transform-origin: left center;
  transition: width 80ms linear;
}

/* -------- preloader -------- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: radial-gradient(ellipse at 50% 60%, #0b1016 0%, #05070a 70%, #000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 700ms ease, visibility 700ms ease;
}
#preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.pl-inner { text-align: center; }
.pl-brand {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--fg);
  margin-bottom: 18px;
}
.pl-brand span { color: var(--mint); }
.pl-bar {
  width: 220px;
  height: 1px;
  background: rgba(255,255,255,0.08);
  position: relative;
  margin: 0 auto 12px;
  overflow: hidden;
}
.pl-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--mint), var(--blue));
  transition: width 160ms linear;
  box-shadow: 0 0 12px rgba(94,234,212,0.5);
}
.pl-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.1em;
}
.pl-dim { color: var(--fg-faint); }

/* -------- background cube -------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 60%, #0b1016 0%, #05070a 70%, #000 100%);
  transition: opacity 180ms ease, filter 180ms ease;
}
#cubeCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  will-change: filter, transform;
  mix-blend-mode: screen;
  filter: saturate(1.05) contrast(1.05);
  transform-origin: 50% 50%;
  transition: filter 160ms;
}
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(94,234,212,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(94,234,212,0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  pointer-events: none;
}
.bg-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0,0,0,0.55) 90%),
    linear-gradient(180deg, rgba(0,0,0,0.25), transparent 20%, transparent 80%, rgba(0,0,0,0.5));
  pointer-events: none;
}
.bg-noise {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  opacity: 0.055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: noise 1.2s steps(6) infinite;
}
@keyframes noise {
  0%   { transform: translate(0, 0); }
  16%  { transform: translate(-4%, 3%); }
  33%  { transform: translate(3%, -2%); }
  50%  { transform: translate(-2%, -3%); }
  66%  { transform: translate(4%, 2%); }
  83%  { transform: translate(-3%, 4%); }
  100% { transform: translate(0, 0); }
}

/* -------- native cursor -------- */
html, body, a, button { cursor: auto; }

/* -------- nav -------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 36px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  mix-blend-mode: difference;
}
.brand { color: var(--fg); font-weight: 500; }
.brand span { color: var(--mint); }
.nav nav { display: flex; gap: 24px; align-items: center; }
.nav nav a {
  color: var(--fg-dim);
  transition: color 160ms;
  display: inline-flex;
  align-items: center;
  will-change: transform;
}
.nav nav a:hover { color: var(--mint); }
.icon-link { padding: 6px; margin: -6px -6px -6px 4px; }
.icon-link svg { display: block; transition: transform 200ms; }
.icon-link:hover svg { transform: rotate(-6deg) scale(1.08); }

/* -------- mini nav -------- */
.mini-nav {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  display: grid;
  gap: 10px;
  padding: 10px 8px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: rgba(10, 14, 20, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.mini-dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  transition: transform 180ms, border-color 180ms, background 180ms, box-shadow 180ms;
}
.mini-dot:hover { transform: scale(1.15); border-color: var(--mint); }
.mini-dot.is-active {
  background: var(--mint);
  border-color: var(--mint);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.16), 0 0 18px rgba(94, 234, 212, 0.45);
}
.mini-dot span {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms;
}
.mini-nav:hover .mini-dot span,
.mini-dot.is-active span { opacity: 1; }

/* -------- main layout -------- */
main { position: relative; z-index: 2; }

/* -------- hero -------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 0 48px;
  overflow: hidden;
}
.hero-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 75% at 25% 55%, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.7) 35%, transparent 75%),
    linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 35%, transparent 65%);
}
.hero-inner {
  position: relative;
  max-width: 640px;
  margin-left: clamp(8px, 6vw, 120px);
}
.eyebrow {
  font-family: var(--mono);
  color: var(--mint);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 20px;
  text-shadow: 0 0 20px rgba(0,0,0,0.9);
}
.hero h1 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(44px, 7vw, 88px);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 22px;
  background: linear-gradient(110deg, #eafffb 0%, var(--mint) 40%, var(--blue) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 30px rgba(0,0,0,0.9));
}
.tagline {
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--fg-dim);
  max-width: 520px;
  margin-bottom: 28px;
  text-shadow: 0 1px 20px rgba(0,0,0,0.9);
}
.hero-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dim);
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-meta .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px var(--mint), 0 0 20px rgba(94,234,212,0.5);
  animation: pulse 2.2s ease-in-out infinite;
}
.hero-meta .sep { color: var(--fg-faint); }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-faint);
  animation: drift 2.4s ease-in-out infinite;
}
@keyframes drift {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.6; }
  50% { transform: translate(-50%, 6px); opacity: 1; }
}

/* -------- marquee -------- */
.marquee {
  position: relative;
  z-index: 2;
  overflow: hidden;
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  background: rgba(6,9,13,0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 14px 0;
  transition: background 220ms ease, border-color 220ms ease;
}
.marquee:hover {
  background: rgba(8, 12, 18, 0.75);
  border-color: var(--line-strong);
}
.marquee:hover .marquee-track {
  animation-play-state: paused;
  color: var(--fg);
  transform: scale(1.015);
}
.marquee-track {
  display: flex;
  gap: 28px;
  white-space: nowrap;
  animation: slide 32s linear infinite;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
  transition: color 220ms ease, transform 280ms ease;
  transform-origin: left center;
  will-change: transform;
}
.marquee-track span:not(.m-dot) { padding-right: 4px; }
.m-dot { color: var(--mint); }
@keyframes slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* -------- content panels -------- */
.panel {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 48px;
}
.panel-left .card { margin-left: clamp(8px, 6vw, 120px); }

.card {
  max-width: 560px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 40px 80px -30px rgba(0,0,0,0.75),
    0 0 0 1px rgba(94,234,212,0.04),
    0 0 40px -10px rgba(99,102,241,0.15);
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 700ms ease, transform 700ms ease;
  overflow: hidden;
  position: relative;
}
.card.in { opacity: 1; transform: translateY(0); }
.card.pulse-cue {
  animation: cardPulseCue 980ms cubic-bezier(.2,.8,.2,1);
}
@keyframes cardPulseCue {
  0%, 100% {
    border-color: var(--card-border);
    box-shadow:
      0 1px 0 rgba(255,255,255,0.06) inset,
      0 40px 80px -30px rgba(0,0,0,0.75),
      0 0 0 1px rgba(94,234,212,0.04),
      0 0 40px -10px rgba(99,102,241,0.15);
  }
  45% {
    border-color: rgba(94,234,212,0.42);
    box-shadow:
      0 1px 0 rgba(255,255,255,0.1) inset,
      0 44px 84px -30px rgba(0,0,0,0.78),
      0 0 0 1px rgba(94,234,212,0.2),
      0 0 54px -10px rgba(94,234,212,0.35),
      0 0 62px -12px rgba(99,102,241,0.28);
  }
}

/* mac-terminal chrome */
.term-bar {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  background: linear-gradient(180deg, rgba(30, 40, 52, 0.9), rgba(16, 22, 30, 0.9));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}
.term-bar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(94, 234, 212, 0.35), rgba(99, 102, 241, 0.35), transparent);
}
.term-dots { display: flex; gap: 7px; flex: 0 0 auto; }
.term-dots i {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0.5px rgba(0,0,0,0.3) inset;
}
.term-dots i.term-dot-btn {
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}
.term-dots i.term-dot-btn:hover { transform: scale(1.12); filter: brightness(1.08); }
.term-dots i.term-dot-btn.is-locked {
  opacity: 0.35;
  filter: saturate(0.25) brightness(0.85);
  cursor: not-allowed;
}
.term-dots i.term-dot-btn.is-locked:hover { transform: none; filter: saturate(0.25) brightness(0.85); }
.term-dots i.term-dot-btn.shake { animation: dotShake 360ms ease; }
@keyframes dotShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-2px); }
  40%      { transform: translateX(2px); }
  60%      { transform: translateX(-1.5px); }
  80%      { transform: translateX(1.5px); }
}
.term-dots i.term-dot-btn:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}
.term-dots i:nth-child(1) { background: #ff5f57; }
.term-dots i:nth-child(2) { background: #febc2e; }
.term-dots i:nth-child(3) { background: #28c840; }
.term-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
}
.term-spacer { flex: 1; }
.term-body { padding: 28px 32px 30px; }

.tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mint);
  margin-bottom: 16px;
}
.tag[data-type].is-typing::after {
  content: "▍";
  display: inline-block;
  margin-left: 2px;
  color: var(--mint);
  animation: caretBlink 900ms steps(2, start) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }
.card h2 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(26px, 3vw, 40px);
  letter-spacing: -0.01em;
  margin-bottom: 20px;
  color: var(--fg);
}
.card p {
  color: var(--fg-dim);
  margin-bottom: 14px;
  font-size: 15px;
}
.card p:last-child { margin-bottom: 0; }

.card.term.is-minimized .term-body { display: none; }

.term-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  z-index: 79;
}
.term-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* -- maximized terminal: real mac window feel, slightly translucent ---- */
.card.term.is-maximized {
  position: fixed;
  inset: 4vh 4vw;
  transform: none !important;
  opacity: 1 !important;
  width: auto;
  max-width: none;
  max-height: none;
  background: rgba(10, 17, 24, 0.62);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-color: rgba(94,234,212,0.28);
  margin: 0;
  z-index: 82;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.1) inset,
    0 60px 120px -32px rgba(0,0,0,0.9),
    0 0 0 1px rgba(94,234,212,0.14),
    0 0 80px -12px rgba(99,102,241,0.38);
  animation: termOpen 260ms cubic-bezier(.2,.8,.2,1);
}
@keyframes termOpen {
  from { opacity: 0; transform: scale(0.985) translateY(6px) !important; }
  to   { opacity: 1; transform: none !important; }
}
.card.term.is-maximized .term-bar {
  background: linear-gradient(180deg, rgba(34, 46, 60, 0.65), rgba(20, 28, 38, 0.55));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.card.term.is-maximized .term-body {
  max-height: calc(92vh - 34px);
  overflow: auto;
  background: transparent;
}
.card.term.is-maximized .term-title { color: #eaf4f7; }
.card.term.is-maximized .term-body p,
.card.term.is-maximized .proj-desc,
.card.term.is-maximized .proj-meta,
.card.term.is-maximized .links a,
.card.term.is-maximized .chips span {
  color: #d2dce6;
}

/* when maximized is active, keep the cube/bg faintly visible behind */
body.term-locked .bg { opacity: 0.38; filter: blur(10px) brightness(0.5) saturate(0.6); }

/* -- hint arrow + handwritten text (desktop only) --------------------- */
.term-hint {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  pointer-events: none;
  color: #ffffff;
  opacity: 0.92;
  z-index: 1;
  /* keep this higher/left so the arrow points toward the card without crossing it */
  top: clamp(-8px, 1vh, 24px);
  left: calc(clamp(8px, 6vw, 120px) + 8px);
  transition: opacity 400ms ease, transform 400ms ease;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.7));
}
.term-hint-text {
  font-family: "Caveat", "Comic Sans MS", cursive;
  font-weight: 600;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.1;
  transform: rotate(-4deg);
  white-space: nowrap;
  padding-top: 4px;
}
.term-hint-arrow {
  width: 88px;
  height: 66px;
  /* sits under text and ends in whitespace above the about terminal */
  margin: -2px 0 0 18px;
  transform: rotate(-2deg);
  animation: hintBob 2.6s ease-in-out infinite;
}
@keyframes hintBob {
  0%, 100% { transform: rotate(-2deg) translate(0, 0); }
  50%      { transform: rotate(0deg) translate(-2px, 3px); }
}
body.term-hint-used .term-hint { opacity: 0; transform: translateY(-6px); }
body.term-locked .term-hint { opacity: 0; }
@media (max-width: 720px) { .term-hint { display: none; } }

.about-card { max-width: 560px; }
.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 12px;
  align-items: stretch;
}
.about-visual {
  position: relative;
  margin: 4px 0 0;
  min-height: 120px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  background: #090d13;
  box-shadow: inset 0 0 0 1px rgba(94,234,212,0.08), 0 15px 35px -22px rgba(0,0,0,0.8);
}
.about-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(1.04) contrast(1.03);
}
.about-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9,13,19,0.85) 0%, rgba(9,13,19,0.35) 22%, transparent 42%),
    linear-gradient(180deg, rgba(5,7,10,0.16) 0%, rgba(5,7,10,0.48) 100%);
  pointer-events: none;
}

.projects { list-style: none; display: grid; gap: 4px; perspective: 900px; }
.proj {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-top: 1px solid var(--card-border);
  transition: background 200ms, padding-left 200ms, border-color 200ms, transform 220ms cubic-bezier(.2,.8,.2,1);
  transform-style: preserve-3d;
  will-change: transform;
}
.proj[data-tilt] {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}
.proj[data-tilt].is-tilting { transition: transform 80ms linear; }
.proj[data-tilt] .proj-thumb,
.proj[data-tilt] .proj-text,
.proj[data-tilt] .proj-arrow {
  transform: translate3d(calc(var(--px, 0) * -6px), calc(var(--py, 0) * -6px), 24px);
  transition: transform 220ms cubic-bezier(.2,.8,.2,1);
}
.proj[data-tilt].is-tilting .proj-thumb,
.proj[data-tilt].is-tilting .proj-text,
.proj[data-tilt].is-tilting .proj-arrow { transition: transform 80ms linear; }
.proj[data-tilt] .proj-thumb {
  transform: translate3d(calc(var(--px, 0) * -10px), calc(var(--py, 0) * -10px), 40px);
}
.proj[data-tilt] .proj-text {
  transform: translate3d(calc(var(--px, 0) * -4px), calc(var(--py, 0) * -4px), 18px);
}
.projects li:last-child .proj { border-bottom: 1px solid var(--card-border); }
.proj:hover {
  background: rgba(94,234,212,0.04);
  padding-left: 22px;
  border-color: var(--line-strong);
}
.proj:hover .proj-arrow { transform: translateX(4px); color: var(--mint); }
.proj-thumb {
  display: block;
  width: 56px; height: 56px;
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 30% 30%, var(--t1, #5eead4) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 70%, var(--t2, #6366f1) 0%, transparent 55%),
    linear-gradient(135deg, #0a0d12, #12171f);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.4), 0 0 20px -6px rgba(94,234,212,0.15);
  position: relative;
  overflow: hidden;
}
.proj-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
  transition: transform 350ms ease, filter 350ms ease;
}
.proj:hover .proj-thumb img {
  transform: scale(1.08);
  filter: saturate(1.15);
}
.proj-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 60%, rgba(0,0,0,0.35) 100%);
  pointer-events: none;
}
.proj-badge {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 2px 7px;
  margin-left: 8px;
  vertical-align: 3px;
  color: var(--mint);
  background: rgba(94,234,212,0.08);
  border: 1px solid rgba(94,234,212,0.3);
  border-radius: 999px;
}
.proj-text { display: grid; gap: 4px; min-width: 0; }
.proj-title { font-family: var(--mono); font-size: 16px; color: var(--fg); }
.proj-desc { color: var(--fg-dim); font-size: 14px; }
.proj-meta { font-family: var(--mono); font-size: 11px; color: var(--fg-faint); }
.proj-arrow {
  font-family: var(--mono);
  color: var(--fg-faint);
  transition: transform 200ms, color 200ms;
}

/* copy / link-row / resume */
.link-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--card-border); }
.link-row a { border-bottom: 0 !important; flex: 1; }
.copy-btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px;
  background: transparent;
  color: var(--fg-dim);
  border: 1px solid var(--card-border);
  border-radius: 4px;
  cursor: pointer;
  transition: color 160ms, border-color 160ms, background 160ms;
}
.copy-btn:hover { color: var(--mint); border-color: var(--line-strong); background: rgba(94,234,212,0.05); }
.copy-btn { position: relative; }
.copy-btn.copied {
  color: #04120f;
  background: var(--mint);
  border-color: var(--mint);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.18), 0 0 22px rgba(94, 234, 212, 0.45);
  animation: copiedPop 260ms cubic-bezier(.2,.8,.2,1);
}
@keyframes copiedPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* sparks */
.spark {
  position: fixed;
  top: 0; left: 0;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 6px var(--mint), 0 0 12px rgba(94,234,212,0.6);
  pointer-events: none;
  z-index: 95;
  will-change: transform, opacity;
}
.spark.s-blue { background: var(--blue); box-shadow: 0 0 6px var(--blue), 0 0 12px rgba(99,102,241,0.6); }
.spark.s-violet { background: var(--violet); box-shadow: 0 0 6px var(--violet), 0 0 12px rgba(139,92,246,0.6); }
.link-meta { color: var(--fg-faint); font-size: 11px; }

/* toast */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 20px);
  z-index: 80;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 10px 16px;
  background: rgba(10,14,20,0.9);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--mint);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.stack-grid { display: grid; gap: 14px; margin-top: 8px; }
.stack-group { display: grid; gap: 8px; }
.stack-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span {
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  color: var(--fg-dim);
  background: rgba(255,255,255,0.015);
  transition: all 160ms;
}
.chips span:hover {
  color: var(--mint);
  border-color: var(--line-strong);
  background: rgba(94,234,212,0.06);
}

/* -- github activity heatmap -- */
.gh-activity {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 8px;
}
.gh-activity-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.gh-activity-label { color: var(--fg-faint); }
.gh-activity-head a {
  color: var(--fg-dim);
  transition: color 160ms;
}
.gh-activity-head a:hover { color: var(--mint); }
.gh-activity-chart {
  width: 100%;
  overflow: hidden;
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--card-border);
}
.gh-activity-chart img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.9;
  filter: drop-shadow(0 0 12px rgba(94, 234, 212, 0.12));
}
.gh-activity-fallback {
  display: none;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-faint);
}
.gh-activity-fallback a { color: var(--mint); border-bottom: 1px dotted rgba(94,234,212,0.35); }
.gh-activity.gh-fail .gh-activity-chart { display: none; }
.gh-activity.gh-fail .gh-activity-fallback { display: block; }

.links { list-style: none; display: grid; gap: 2px; margin-top: 8px; }
.links a {
  display: inline-block;
  padding: 10px 0;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg);
  border-bottom: 1px solid var(--card-border);
  transition: color 160ms, border-color 160ms, padding-left 200ms;
}
.links a:hover { color: var(--mint); border-color: var(--line-strong); padding-left: 8px; }

footer {
  position: relative;
  z-index: 2;
  padding: 40px 48px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-faint);
  border-top: 1px solid var(--card-border);
  margin-top: 40px;
}

@media (max-width: 720px) {
  .nav { padding: 18px 20px; }
  .nav nav { gap: 10px; }
  .nav nav a[href^="#"] { display: none; }
  .mini-nav {
    right: auto;
    left: 50%;
    top: auto;
    bottom: 16px;
    transform: translateX(-50%);
    grid-auto-flow: column;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 14px;
  }
  .mini-dot {
    width: auto;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .mini-dot span {
    display: block;
    position: static;
    transform: none;
    opacity: 1;
    font-size: 9px;
    letter-spacing: 0.1em;
  }
  .mini-dot.is-active span { color: #04120f; }
  .about-layout { grid-template-columns: 1fr; gap: 12px; }
  .about-visual { min-height: 110px; }
  .card.term.is-maximized {
    inset: 3vh 2vw;
  }
  .card.term.is-maximized .term-body { max-height: calc(94vh - 34px); }
  .proj-text { gap: 6px; }
  .proj-desc {
    color: #c9d6e2;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.75);
  }
  .proj-meta {
    font-size: 12px;
    color: #d8e4ef;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8);
  }
  .hero, .panel { padding: 80px 20px; }
  .hero-inner, .panel-left .card { margin-left: 0; }
  .term-body { padding: 22px 20px; }
  footer { padding: 24px 20px; flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .card { opacity: 1; transform: none; }
  .bg-noise { display: none; }
}
