/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0a0f;
  --bg-card: #0f0f1a;
  --bg-card-hover: #141428;
  --accent: #00d4ff;
  --accent-dim: rgba(0, 212, 255, 0.15);
  --accent-glow: rgba(0, 212, 255, 0.4);
  --text: #e2e8f0;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --border: rgba(0, 212, 255, 0.12);
  --border-hover: rgba(0, 212, 255, 0.35);
  --gradient-hero: linear-gradient(180deg, transparent 0%, transparent 80%, rgba(10,10,15,0.35) 100%);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* ===== CANVAS (Three.js) ===== */
/* ===================================================================
 * CSS-only animated hero background
 * - 4 aurora "blobs" (large radial gradients) that drift via transform
 * - SVG grid overlay (static, very subtle)
 * - Horizontal scanline that sweeps vertically
 * - 21 floating particle specks rising upward
 * All animations use transform/opacity only (compositor fast path),
 * so they don't pressure the GPU process the way WebGL did.
 * =================================================================== */

#hero-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background-color: #04060c;
  /* base floor glow (static) */
  background-image:
    radial-gradient(ellipse 90% 70% at 50% 100%, rgba(10, 30, 80, 0.55) 0%, rgba(0, 0, 0, 0) 70%);
}

/* --- Single mesh-gradient div: multiple stacked radial gradients baked
   into one background, animated via background-position + transform.
   Only ONE compositor layer, no mix-blend-mode, no filter:blur, no
   large multi-element stack. --- */
.hero-mesh {
  position: absolute;
  inset: -10%;
  background-color: transparent;
  /* Very low-alpha wide radial gradients on the outside edges of the
     hero, so the middle reads as deep space and only a soft cosmic
     haze creeps in at the corners. */
  background-image:
    radial-gradient(ellipse 60% 50% at 10% 20%, rgba(60, 140, 255, 0.13) 0%, rgba(0,0,0,0) 60%),
    radial-gradient(ellipse 60% 55% at 90% 15%, rgba(140, 80, 255, 0.10) 0%, rgba(0,0,0,0) 60%),
    radial-gradient(ellipse 55% 45% at 85% 85%, rgba(40, 200, 200, 0.09) 0%, rgba(0,0,0,0) 60%),
    radial-gradient(ellipse 55% 50% at 15% 90%, rgba(80, 120, 255, 0.09) 0%, rgba(0,0,0,0) 60%);
  opacity: 0.9;
}

/* --- Subtle SVG grid overlay (static, no animation) --- */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80'><path d='M 80 0 L 0 0 0 80' fill='none' stroke='rgba(120,180,255,0.055)' stroke-width='1'/></svg>");
  background-size: 80px 80px;
}



/* --- Flowing wave lines: 8 SVG paths that scroll horizontally at
       different speeds, creating an undulating data-flow / audio-wave
       effect across the lower half of the hero. Each wave is a doubled-
       width bezier (3200 units for a 1600 viewport) so the seamless
       tile loops without gaps via translateX animation. --- */
.hero-waves {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

/* Wave paths are animated by hero.js which updates the SVG d attribute
   each frame so the waves genuinely undulate. No CSS keyframes needed. */

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 3rem;
  background: rgba(8, 10, 18, 0.78);
  border-bottom: 1px solid rgba(0, 212, 255, 0.06);
  transition: background 0.3s ease, border-color 0.3s ease;
}

nav.scrolled {
  background: rgba(10, 10, 15, 0.92);
  border-bottom-color: var(--border);
}

.nav-logo {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-decoration: none;
}

.nav-logo span {
  color: var(--text-muted);
  font-weight: 400;
}

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

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a.active {
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.45);
}

.nav-cta {
  padding: 0.5rem 1.2rem;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent) !important;
  border-radius: 4px;
  transition: all 0.2s ease !important;
}

.nav-cta::after { display: none !important; }

.nav-cta:hover,
.nav-cta.active {
  background: var(--accent-dim) !important;
  box-shadow: 0 0 20px var(--accent-glow), 0 0 42px rgba(0, 212, 255, 0.35);
}

.nav-cta.active {
  /* override the generic .nav-links a.active text-shadow so only the
     border/background glow reads, not a glowing label */
  text-shadow: none;
}

/* ===== HERO ===== */
#hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  overflow: hidden;
  perspective: 1500px;
}

.hero-content { transform-style: preserve-3d; }

/* Elements that get revealed by hyperspaceReveal start hidden */
.hero-eyebrow,
#hero-name,
.hero-tagline,
.hero-cta-group,
.scroll-indicator { will-change: transform, filter, opacity; }

.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 2rem;
  max-width: 900px;
}

.hero-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  opacity: 0;
}

#hero-name {
  font-family: 'Chakra Petch', 'Inter', system-ui, sans-serif;
  /* clamp so the name scales down on narrow viewports and stays on one line */
  font-size: clamp(1.8rem, 12vw, 7rem);
  font-weight: 700;
  font-stretch: 100%;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--text);
  margin-bottom: 1.5rem;
  min-height: 1em;
  text-transform: uppercase;
  text-shadow: 0 0 28px rgba(120, 200, 255, 0.22), 0 0 72px rgba(60, 140, 255, 0.10);
  visibility: hidden;
  white-space: nowrap;
}

/* Hyperspace-reveal characters: each letter is its own transform target.
   While the reveal is running, the #hero-name carries a `.warping` class
   that paints every char with a thick glowing halo via text-shadow.
   Because CSS transform: scale() scales the entire paint including
   text-shadow, starting the letters at scale(8) turns the halo into a
   huge blurry streak that reads as motion-blur out of warp, without
   using filter: blur() (which was GPU-expensive). The class is removed
   once the animation settles so steady-state text is crisp. */
.name-char {
  display: inline-block;
  transform-origin: center center;
  transition: text-shadow 0.25s ease-out, color 0.25s ease-out;
}

#hero-name.warping {
  color: #eaf6ff;
}
#hero-name.warping .name-char {
  color: #eaf6ff;
  text-shadow:
    0 0 8px  rgba(200, 230, 255, 0.95),
    0 0 18px rgba(120, 200, 255, 0.85),
    0 0 36px rgba(80,  150, 255, 0.70),
    0 0 72px rgba(40,  100, 220, 0.45);
}

/* Lightweight scroll-reveal (IntersectionObserver adds .in-view) */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.reveal.in-view {
  opacity: 1;
  transform: none;
}
.stack-pill.reveal {
  transform: scale(0.9);
}
.stack-pill.reveal.in-view {
  transform: scale(1);
}

/* Realistic broken-fluorescent illumination: card content is always
   rendered, a dark ::after overlay sits above it and its opacity
   flickers away. Mimics a light source in the room turning on above
   a physically present card, rather than the card itself appearing
   from nothing. */
.project-card.reveal {
  /* Card content stays fully visible; overlay handles the dimming. */
  opacity: 1;
  transform: none;
  transition: none;
}
.project-card.reveal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #050810;
  pointer-events: none;
  opacity: 0.93;
  z-index: 5;
  border-radius: inherit;
}
.project-card.reveal.in-view::after {
  animation: flicker-light-a 1.05s steps(1, end) forwards;
}
.project-card.reveal.in-view:nth-child(2)::after { animation: flicker-light-b 1.15s steps(1, end) forwards; animation-delay: 0.05s; }
.project-card.reveal.in-view:nth-child(3)::after { animation: flicker-light-c 1.00s steps(1, end) forwards; animation-delay: 0.11s; }
.project-card.reveal.in-view:nth-child(4)::after { animation: flicker-light-b 1.10s steps(1, end) forwards; animation-delay: 0.03s; }
.project-card.reveal.in-view:nth-child(5)::after { animation: flicker-light-a 1.20s steps(1, end) forwards; animation-delay: 0.15s; }
.project-card.reveal.in-view:nth-child(6)::after { animation: flicker-light-c 1.08s steps(1, end) forwards; animation-delay: 0.07s; }
.project-card.reveal.in-view:nth-child(7)::after { animation: flicker-light-b 1.03s steps(1, end) forwards; animation-delay: 0.18s; }

/* Overlay opacity is INVERTED vs brightness: 0.93 = dark (lights off),
   0 = lights on full. Holds at dark, brief strikes of near-0, shaky
   ramp, residual twitch near the end, then full-on. */
@keyframes flicker-light-a {
  0%   { opacity: 0.93; }
  10%  { opacity: 0.93; }  /* hold dark */
  12%  { opacity: 0.00; }  /* first strike */
  14%  { opacity: 0.90; }
  22%  { opacity: 0.90; }  /* dead gap */
  25%  { opacity: 0.05; }
  27%  { opacity: 0.88; }
  36%  { opacity: 0.88; }  /* long dead gap */
  40%  { opacity: 0.08; }
  43%  { opacity: 0.72; }
  48%  { opacity: 0.00; }
  52%  { opacity: 0.55; }
  58%  { opacity: 0.00; }
  64%  { opacity: 0.30; }
  70%  { opacity: 0.00; }
  82%  { opacity: 0.00; }
  84%  { opacity: 0.48; }  /* residual twitch */
  86%  { opacity: 0.00; }
  100% { opacity: 0.00; }
}
@keyframes flicker-light-b {
  0%   { opacity: 0.93; }
  8%   { opacity: 0.04; }
  11%  { opacity: 0.92; }
  20%  { opacity: 0.92; }  /* dead */
  24%  { opacity: 0.00; }
  27%  { opacity: 0.90; }
  38%  { opacity: 0.90; }  /* long dead */
  42%  { opacity: 0.08; }
  45%  { opacity: 0.78; }
  50%  { opacity: 0.00; }
  55%  { opacity: 0.50; }
  62%  { opacity: 0.00; }
  68%  { opacity: 0.25; }
  74%  { opacity: 0.00; }
  86%  { opacity: 0.00; }
  88%  { opacity: 0.42; }  /* residual twitch */
  90%  { opacity: 0.00; }
  100% { opacity: 0.00; }
}
@keyframes flicker-light-c {
  0%   { opacity: 0.93; }
  6%   { opacity: 0.93; }  /* hold dark */
  9%   { opacity: 0.06; }
  12%  { opacity: 0.90; }
  18%  { opacity: 0.90; }  /* dead */
  22%  { opacity: 0.00; }
  25%  { opacity: 0.88; }
  34%  { opacity: 0.88; }  /* long dead */
  38%  { opacity: 0.03; }
  42%  { opacity: 0.65; }
  47%  { opacity: 0.00; }
  53%  { opacity: 0.45; }
  60%  { opacity: 0.00; }
  66%  { opacity: 0.22; }
  72%  { opacity: 0.00; }
  84%  { opacity: 0.00; }
  86%  { opacity: 0.38; }  /* residual twitch */
  88%  { opacity: 0.00; }
  100% { opacity: 0.00; }
}

/* NOTE: prefers-reduced-motion guard intentionally omitted for the
   card flicker. The illumination effect is a core part of the design
   language of this section, and users with reduce-motion enabled were
   reporting that the cards never appeared to fire up at all, so the
   guard is gone even at the cost of strict a11y compliance. */

.hero-tagline {
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  color: var(--text-muted);
  letter-spacing: 0.04em;
  line-height: 1.5;
  opacity: 0;
  margin-bottom: 2.5rem;
}

.hero-tagline span {
  color: var(--text-dim);
}

.hero-cta-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  background: var(--accent);
  color: #0a0a0f;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 4px;
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 50px rgba(0, 212, 255, 0.5);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  opacity: 0;
}

.scroll-indicator span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.2); }
}

/* ===== SECTIONS ===== */
section {
  position: relative;
  z-index: 2;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6rem 2rem;
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  opacity: 0.8;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 600px;
  line-height: 1.7;
}

/* ===== ABOUT ===== */
#about {
  background: linear-gradient(180deg, var(--bg) 0%, #0c0c16 50%, var(--bg) 100%);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-top: 3rem;
}

.about-text p {
  color: var(--text-dim);
  line-height: 1.85;
  font-size: 1.05rem;
}

.about-text p + p {
  margin-top: 1.25rem;
}

.about-text strong {
  color: var(--text);
  font-weight: 600;
}

.about-terminal {
  background: #0c0c1a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  line-height: 1.8;
  position: relative;
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

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

.terminal-title {
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-left: 0.5rem;
}

.terminal-line {
  display: flex;
  gap: 0.75rem;
}

.t-prompt { color: var(--accent); }
.t-cmd { color: #e2e8f0; display: inline-block; }
.t-comment { color: var(--text-muted); }
.t-out { color: #a3e635; margin-left: 1.5rem; display: block; min-height: 1.4em; }
.t-out-dim { color: var(--text-muted); margin-left: 1.5rem; display: block; min-height: 1.4em; }

/* Terminal typewriter: a JS typer walks through each .t-out /
   .t-out-dim in order and streams characters with variable delay,
   moving a single blinking .typing-cursor from line to line. The
   CSS here just resets the container reveal and styles the cursor. */
.about-terminal.reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

.typing-cursor {
  display: inline-block;
  width: 0.55ch;
  height: 1em;
  vertical-align: -0.18em;
  background: #a3e635;
  margin-left: 1px;
  box-shadow: 0 0 8px rgba(163, 230, 53, 0.55);
  animation: typing-blink 0.95s steps(1, end) infinite;
}
.t-out-dim .typing-cursor {
  background: var(--text-muted);
  box-shadow: 0 0 6px rgba(200, 200, 200, 0.35);
}
@keyframes typing-blink {
  0%, 50%   { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* ===== PROJECTS ===== */
#projects {
  background: var(--bg);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Cards with a real link get a pointer; static-label cards stay default */
.project-card:has(a.card-link) { cursor: pointer; }

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: 0 20px 60px rgba(0, 212, 255, 0.08), 0 0 0 1px rgba(0, 212, 255, 0.1);
}

.project-card:hover::before {
  opacity: 1;
}

.card-media {
  margin: -1.75rem -1.75rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: #0b1120;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  display: block;
  transition: transform 0.5s ease;
}

/* Placeholder for cards without a screenshot so they don't look
   like they're missing their top section */
.card-media-placeholder {
  margin: -1.75rem -1.75rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #0b1120 0%, #0e1628 50%, #0b1120 100%);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.card-media-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80'><path d='M 80 0 L 0 0 0 80' fill='none' stroke='rgba(120,180,255,0.04)' stroke-width='1'/></svg>");
  background-size: 40px 40px;
}
.card-media-placeholder::after {
  content: '';
  position: absolute;
  width: 50%;
  height: 50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.06) 0%, transparent 70%);
}

.project-card:hover .card-media img {
  transform: scale(1.03);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.card-head .card-title {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.card-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.2s;
  font-family: 'JetBrains Mono', monospace;
  flex: 0 0 auto;
  white-space: nowrap;
  padding-top: 0.35rem;
  /* Stretched link: the ::after covers the whole card so clicking
     anywhere on the card follows the link, not just the URL text. */
  position: static;
}
a.card-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.card-link-static {
  cursor: default;
  pointer-events: none;
  /* Allow long client labels to wrap rather than overlap the title */
  white-space: normal;
  text-align: right;
  max-width: 45%;
  line-height: 1.35;
}

.card-link:hover { color: var(--accent); }

.card-link svg {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
}

.card-link:hover svg {
  transform: translate(2px, -2px);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  padding: 0.2rem 0.6rem;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 3px;
  color: var(--accent);
  font-size: 0.68rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: all 0.2s;
}

.project-card:hover .tag {
  background: rgba(0, 212, 255, 0.12);
  border-color: rgba(0, 212, 255, 0.25);
}

/* ===== CLIENTS ===== */
#clients {
  background: linear-gradient(180deg, var(--bg) 0%, #0c0c16 100%);
}

.clients-intro {
  max-width: 600px;
  margin-bottom: 3rem;
}

.clients-intro p {
  color: var(--text-muted);
  line-height: 1.7;
}

.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.client-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem 1.5rem 3.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  /* Left accent bar per card set via nth-child below */
  border-left: 3px solid var(--card-accent, var(--border));
}

/* Industry keyword watermark - sized to fit inside the card */
.client-card::before {
  content: var(--card-label, '');
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.6rem;
  font-family: 'Chakra Petch', 'Inter', system-ui, sans-serif;
  font-size: clamp(0.65rem, 2.5vw, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  color: var(--card-accent, rgba(120, 180, 255, 0.08));
  opacity: 0.18;
  pointer-events: none;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Per-card theme: accent colour + industry label */
.client-card:nth-child(1) {
  --card-accent: #4db8ff;
  --card-label: 'RAIL & LOGISTICS';
}
.client-card:nth-child(2) {
  --card-accent: #4de8b0;
  --card-label: 'REAL ESTATE';
}
.client-card:nth-child(3) {
  --card-accent: #c090ff;
  --card-label: 'FINANCIAL CRM';
}
.client-card:nth-child(4) {
  --card-accent: #ff7090;
  --card-label: 'AI SURVEILLANCE';
}

.client-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.06);
}

/* ====================================================================
 * Client card 3D FLIP-IN reveal
 *
 * Each card is standing nearly edge-on away from the viewer and
 * rotates flat into place with a gentle overshoot, fading in as it
 * goes. When it reaches the overshoot frame, the border ignites with
 * a cyan accent glow that then decays back to the resting style.
 * The whole row rotates in sequence left-to-right on a stagger.
 *
 * Real 3D perspective via the parent .clients-grid perspective, no
 * filter, no mix-blend, no expensive compositor effects.
 * ==================================================================== */
.clients-grid {
  perspective: 1600px;
  perspective-origin: 50% 40%;
}

.client-card.reveal {
  opacity: 0;
  transform: rotateY(72deg) translate3d(-20px, 0, -60px);
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.client-card.reveal.in-view {
  animation: client-flipin 1.1s cubic-bezier(0.2, 0.75, 0.25, 1.05) forwards;
}

.client-card.reveal.in-view:nth-child(2) { animation-delay: 0.16s; }
.client-card.reveal.in-view:nth-child(3) { animation-delay: 0.32s; }
.client-card.reveal.in-view:nth-child(4) { animation-delay: 0.48s; }

@keyframes client-flipin {
  0% {
    opacity: 0;
    transform: rotateY(72deg) translate3d(-20px, 0, -60px);
    border-color: rgba(0, 212, 255, 0);
    box-shadow: none;
  }
  55% {
    opacity: 1;
    transform: rotateY(-6deg) translate3d(0, 0, 20px);
    border-color: rgba(0, 212, 255, 0.75);
    box-shadow:
      0 0 0 1px rgba(0, 212, 255, 0.45),
      0 22px 48px rgba(0, 180, 255, 0.28),
      0 0 34px rgba(0, 212, 255, 0.35);
  }
  78% {
    transform: rotateY(2deg) translate3d(0, 0, 6px);
    border-color: rgba(0, 212, 255, 0.50);
    box-shadow:
      0 0 0 1px rgba(0, 212, 255, 0.22),
      0 10px 28px rgba(0, 180, 255, 0.18),
      0 0 18px rgba(0, 212, 255, 0.18);
  }
  100% {
    opacity: 1;
    transform: rotateY(0) translate3d(0, 0, 0);
    border-color: var(--border);
    box-shadow: none;
  }
}

.client-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.client-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== TECH STACK ===== */
#stack {
  background: var(--bg);
}

.stack-categories {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.stack-category-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stack-category-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

.stack-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.stack-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.stack-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
  transform: translateY(-2px);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
  flex-shrink: 0;
}

/* ===== CONTACT ===== */
#contact {
  /* Transparent so the fixed hero-bg (mesh + waves) shows through,
     connecting the hero and contact areas visually. */
  background: transparent;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
  margin-top: 3rem;
}

.contact-items {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.contact-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.08);
}

.contact-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent-dim);
  border: 1px solid rgba(0, 212, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  font-size: 1rem;
}

.contact-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 0.15rem;
}

.contact-value {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
}

.contact-note {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
}

.contact-note strong {
  color: var(--accent);
  font-weight: 600;
}

/* ===== FOOTER ===== */
footer {
  position: relative;
  z-index: 2;
  background: var(--bg);
  border-top: 1px solid rgba(0, 212, 255, 0.06);
  padding: 2rem;
  text-align: center;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent); }

/* ===== REVEAL ANIMATIONS ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  nav {
    padding: 1rem 1.5rem;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 600px) {
  .section-inner {
    padding: 4rem 1.25rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .clients-grid {
    grid-template-columns: 1fr 1fr;
  }

  nav {
    padding: 1rem;
  }

  .hero-cta-group {
    flex-direction: column;
    align-items: center;
  }
}

/* ===== SELECTION ===== */
::selection {
  background: rgba(0, 212, 255, 0.25);
  color: white;
}

/* ===== SECTION DIVIDER ===== */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  max-width: 1100px;
  margin: 0 auto;
}
