/* ============================================================
   Gunasekaran A — Portfolio
   index.css
   Organized in sections. CSS custom properties drive the whole
   theme so the palette / spacing can be tuned from one place.
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; } /* Lenis handles smooth scroll; avoid double-smoothing */
img { max-width: 100%; display: block; }
button { font: inherit; }
a { color: inherit; }
ul { list-style: none; }

/* ---------- Design tokens ---------- */
:root {
  /* Color: deep PCB-charcoal base, phosphor green / signal cyan / copper amber accents */
  --bg: #0a0e14;
  --bg-alt: #0d131c;
  --surface: rgba(20, 26, 36, 0.55);
  --surface-solid: #131a24;
  --border: rgba(63, 208, 255, 0.14);
  --border-strong: rgba(57, 255, 136, 0.4);

  --green: #39ff88;
  --green-dim: #1f9c56;
  --cyan: #3fd0ff;
  --amber: #ffb454;
  --danger: #ff6b6b;

  --text: #edf2f7;
  --text-dim: #93a1b3;
  --text-faint: #566175;

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

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 26px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1240px;

  --nav-h: 84px;
}

/* ---------- Base ---------- */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: default;
}

::selection { background: var(--green); color: #06110a; }

/* thin styled scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--green-dim), var(--cyan)); border-radius: 10px; }

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

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
}

/* ---------- Section heading system ---------- */
.section {
  position: relative;
  padding: 140px 0 120px;
}

.section-head {
  max-width: 640px;
  margin-bottom: 64px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--green);
  margin-bottom: 18px;
}

.eyebrow::before { content: '//'; color: var(--text-faint); }

.section-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(32px, 4.2vw, 48px);
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.section-title .accent { color: var(--green); }

.section-desc {
  color: var(--text-dim);
  font-size: 16px;
  max-width: 52ch;
}

/* ---------- Background atmosphere (fixed, behind everything) ---------- */
.bg-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.bg-atmosphere::before {
  /* faint circuit / dot grid */
  content: '';
  position: absolute;
  inset: -10%;
  background-image:
    radial-gradient(rgba(63, 208, 255, 0.09) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 30%, transparent 75%);
}

.aurora {
  position: absolute;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  will-change: transform;
}

.aurora-1 { background: var(--green-dim); top: -20%; left: -10%; }
.aurora-2 { background: var(--cyan); top: 10%; right: -15%; opacity: 0.22; }
.aurora-3 { background: var(--amber); bottom: -25%; left: 20%; opacity: 0.12; }

#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* ---------- Custom cursor (desktop only, added via JS) ---------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 10000;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
}

.cursor-dot { width: 6px; height: 6px; background: var(--green); }
.cursor-ring {
  width: 34px; height: 34px;
  border: 1.5px solid rgba(57, 255, 136, 0.5);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.cursor-ring.is-active {
  width: 56px; height: 56px;
  background: rgba(63, 208, 255, 0.08);
  border-color: var(--cyan);
}

.cursor-spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(600px circle at var(--sx, 50%) var(--sy, 50%), rgba(57, 255, 136, 0.06), transparent 60%);
}

body.has-fine-pointer { cursor: none; }
body.has-fine-pointer a,
body.has-fine-pointer button { cursor: none; }

/* ---------- Glass utility ---------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease);
}

.btn-primary {
  background: linear-gradient(120deg, var(--amber), #ff9a3c);
  color: #201200;
  box-shadow: 0 8px 24px rgba(255, 180, 84, 0.25);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(255, 180, 84, 0.4); }

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green), 0 8px 24px rgba(57, 255, 136, 0.15);
  transform: translateY(-3px);
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: height 0.4s var(--ease), background 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}

.navbar.is-scrolled {
  height: 66px;
  background: rgba(10, 14, 20, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo img { width: 30px; height: 30px; border-radius: 6px; }

.logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
  color: var(--text);
}
.logo-text .highlight { color: var(--green); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  position: relative;
  display: inline-block;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
  color: var(--text-dim);
  transition: color 0.3s var(--ease);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px; bottom: 4px;
  height: 1px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.nav-links a:hover,
.nav-links a.is-active { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.is-active::after { transform: scaleX(1); }

.nav-cta {
  margin-left: 12px;
  padding: 9px 20px;
  font-size: 13px;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 600;
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.35s var(--ease), opacity 0.25s var(--ease);
}

.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 550;
  background: rgba(8, 11, 16, 0.98);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transform: translateY(-100%);
  transition: transform 0.5s var(--ease);
}

.mobile-menu.is-open { transform: translateY(0); }

.mobile-menu a {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}
.mobile-menu a:hover { color: var(--green); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 80px;
}

.hero-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 60px;
}

.hero-text .eyebrow { margin-bottom: 22px; }

.hero-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 22px;
}

.hero-name .char { display: inline-block; will-change: transform, opacity; }
.hero-name .accent-line { display: block; color: var(--green); text-shadow: 0 0 30px rgba(57, 255, 136, 0.35); }

.role-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-dim);
  height: 30px;
  margin-bottom: 24px;
}

.role-typewriter { color: var(--cyan); }
.role-cursor {
  display: inline-block;
  width: 2px; height: 1.1em;
  background: var(--green);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-intro {
  max-width: 46ch;
  color: var(--text-dim);
  font-size: 16px;
  margin-bottom: 34px;
}

.hero-cta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 38px;
}

.hero-socials {
  display: flex;
  gap: 14px;
}

.social-chip {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.social-chip img { width: 19px; height: 19px; }
.social-chip:hover {
  transform: translateY(-4px);
  border-color: var(--green);
  box-shadow: 0 8px 22px rgba(57, 255, 136, 0.2);
}

/* Hero visual: photo in glass frame with circuit tracery */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-photo-frame {
  position: relative;
  width: min(360px, 80vw);
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  padding: 10px;
  background: linear-gradient(160deg, rgba(57, 255, 136, 0.25), rgba(63, 208, 255, 0.1));
  will-change: transform;
  transform-style: preserve-3d;
}

.hero-photo-frame::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, var(--green), transparent 40%, var(--cyan));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.7;
}

.hero-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-lg) - 8px);
}

.hero-traces {
  position: absolute;
  inset: -60px;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
}

.hero-glow {
  position: absolute;
  width: 70%;
  height: 70%;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(57, 255, 136, 0.25), transparent 70%);
  filter: blur(30px);
  z-index: -2;
}

.scroll-cue {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.scroll-cue-line {
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--green), transparent);
  animation: scrollcue 1.8s ease-in-out infinite;
}

@keyframes scrollcue {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  50.1% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- reveal base ---------- */
[data-reveal] { opacity: 1; }
.js-anim [data-reveal] { opacity: 0; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .js-anim [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   ABOUT / STATS
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: start;
}

.about-bio {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 56ch;
}
.about-bio strong { color: var(--text); font-weight: 600; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.stat-card {
  padding: 26px 22px;
  border-radius: var(--radius-md);
  text-align: left;
}

.stat-number {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(30px, 3.4vw, 40px);
  color: var(--green);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

/* ============================================================
   JOURNEY — circuit-trace timeline (signature element)
   ============================================================ */
.journey {
  background: linear-gradient(180deg, transparent, rgba(63, 208, 255, 0.03), transparent);
}

.circuit-track {
  position: relative;
  padding-left: 46px;
}

.circuit-rail {
  position: absolute;
  left: 12px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--border-strong), var(--border-strong)) no-repeat;
  background-size: 100% 0%;
  transition: background-size 0.1s linear;
}

.circuit-rail::before {
  content: '';
  position: absolute;
  inset: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.06);
  z-index: -1;
}

.circuit-node {
  position: relative;
  padding: 0 0 52px 34px;
}
.circuit-node:last-child { padding-bottom: 4px; }

.circuit-node::before {
  /* solder point */
  content: '';
  position: absolute;
  left: -35px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--green);
  box-shadow: 0 0 0 4px var(--bg), 0 0 14px rgba(57, 255, 136, 0.5);
  z-index: 2;
}

.circuit-node.is-current::before {
  border-color: var(--amber);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px rgba(255, 180, 84, 0.25), 0 0 18px rgba(255, 180, 84, 0.7);
  animation: nodePulse 1.8s infinite ease-in-out;
}

@keyframes nodePulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px rgba(255, 180, 84, 0.25), 0 0 18px rgba(255, 180, 84, 0.7); }
  50% { box-shadow: 0 0 0 4px var(--bg), 0 0 0 10px rgba(255, 180, 84, 0.12), 0 0 26px rgba(255, 180, 84, 0.9); }
}

.circuit-node h4 {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--text);
  margin-bottom: 6px;
}

.circuit-node .node-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--amber);
  border: 1px solid rgba(255, 180, 84, 0.4);
  border-radius: 999px;
  padding: 2px 10px;
  margin-left: 10px;
  vertical-align: middle;
}

.circuit-node p {
  color: var(--text-dim);
  font-size: 14.5px;
  max-width: 62ch;
}
.circuit-node p strong { color: var(--cyan); font-weight: 600; }

/* ============================================================
   SKILLS
   ============================================================ */
.skill-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.filter-pill {
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.filter-pill:hover { color: var(--text); border-color: var(--border-strong); }
.filter-pill.is-active {
  background: var(--green);
  border-color: var(--green);
  color: #06170d;
  font-weight: 600;
}

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

.skill-card {
  position: relative;
  padding: 24px 20px;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
  will-change: transform;
}

.skill-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%), rgba(57, 255, 136, 0.14), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.skill-card:hover::before { opacity: 1; }
.skill-card:hover { border-color: var(--border-strong); }

.skill-card.is-hidden { display: none; }

.skill-icon-large {
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  filter: brightness(0) saturate(100%) invert(85%) sepia(28%) saturate(600%) hue-rotate(75deg);
  transition: transform 0.35s var(--ease);
}
.skill-card:hover .skill-icon-large { transform: translateY(-3px) scale(1.08); }

.skill-card h4 {
  font-family: var(--font-heading);
  font-size: 16px;
  margin-bottom: 6px;
}

.skill-card p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ============================================================
   EXPERIENCE (internships)
   ============================================================ */
.exp-track {
  position: relative;
  padding-left: 46px;
}

.exp-rail {
  position: absolute;
  left: 19px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.exp-rail-fill {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(var(--green), var(--cyan));
  transition: height 0.1s linear;
}

.exp-item {
  position: relative;
  padding: 0 0 44px 34px;
}
.exp-item:last-child { padding-bottom: 0; }

.exp-marker {
  position: absolute;
  left: -46px;
  top: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface-solid);
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.exp-marker img { width: 22px; height: 22px; object-fit: contain; }

.exp-card {
  padding: 22px 24px;
  border-radius: var(--radius-md);
}

.exp-card h3 { font-family: var(--font-heading); font-size: 18px; margin-bottom: 4px; }
.exp-date { font-family: var(--font-mono); font-size: 12px; color: var(--amber); display: block; margin-bottom: 10px; }
.exp-card p { color: var(--text-dim); font-size: 14.5px; }

/* ============================================================
   EDUCATION
   ============================================================ */
.education-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.education-card {
  padding: 26px 24px;
  border-radius: var(--radius-md);
  position: relative;
}

.edu-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 14px;
}

.education-card h4 {
  font-family: var(--font-heading);
  font-size: 17px;
  margin-bottom: 10px;
  color: var(--text);
}

.education-card p { font-size: 13.5px; color: var(--text-dim); margin-bottom: 4px; }
.education-card .edu-score {
  margin-top: 12px;
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--green);
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

/* ============================================================
   ACHIEVEMENTS (events)
   ============================================================ */
.achieve-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.achieve-card {
  padding: 26px 24px;
  border-radius: var(--radius-md);
  transition: transform 0.35s var(--ease);
}
.achieve-card:hover { transform: translateY(-6px); border-color: var(--border-strong); }

.achieve-card h4 { font-family: var(--font-heading); font-size: 17px; margin-bottom: 4px; }
.achieve-meta { font-family: var(--font-mono); font-size: 12px; color: var(--cyan); display: block; margin-bottom: 10px; }
.achieve-card p { font-size: 14px; color: var(--text-dim); }

/* ============================================================
   CERTIFICATES
   ============================================================ */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.cert-tile {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-solid);
}

.cert-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease), filter 0.5s var(--ease);
  filter: saturate(0.85);
}

.cert-tile:hover img { transform: scale(1.08); filter: saturate(1.1); }

.cert-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  background: linear-gradient(0deg, rgba(6, 9, 14, 0.92), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.cert-tile:hover .cert-overlay { opacity: 1; }

.cert-overlay span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}

.cert-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 11, 0.94);
  padding: 40px;
}
.cert-modal.is-open { display: flex; }

.cert-modal-inner {
  position: relative;
  max-width: 900px;
  width: 100%;
  text-align: center;
}

.cert-modal-inner img {
  max-height: 78vh;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.cert-caption {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}

.cert-close,
.cert-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.cert-close:hover, .cert-nav:hover { border-color: var(--green); background: rgba(57, 255, 136, 0.1); }

.cert-close { top: -56px; right: 0; }
.cert-prev { left: -60px; top: 50%; transform: translateY(-50%); }
.cert-next { right: -60px; top: 50%; transform: translateY(-50%); }

/* ============================================================
   PROJECTS
   ============================================================ */
.project-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 40px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.project-card {
  position: relative;
  padding: 28px 26px;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
  display: none;
  flex-direction: column;
  min-height: 220px;
}
.project-card.is-visible { display: flex; }

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(63, 208, 255, 0.14), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.project-card:hover::before { opacity: 1; }
.project-card:hover { transform: translateY(-6px); border-color: var(--border-strong); }

.project-status {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.project-status.status-done { color: var(--green); border: 1px solid rgba(57, 255, 136, 0.4); }
.project-status.status-idea { color: var(--amber); border: 1px solid rgba(255, 180, 84, 0.4); }

.project-card h3 { font-family: var(--font-heading); font-size: 19px; margin-bottom: 10px; }
.project-card p { color: var(--text-dim); font-size: 14.5px; flex-grow: 1; }

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 4px;
}
.project-tags span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  background: rgba(63, 208, 255, 0.08);
  border: 1px solid rgba(63, 208, 255, 0.2);
  padding: 3px 10px;
  border-radius: 999px;
}

.project-links { margin-top: 16px; }
.project-links a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.project-links a:hover { border-color: var(--green); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 60px;
}

.contact-social-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 30px;
}

.contact-social-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.contact-social-card:hover { transform: translateX(6px); border-color: var(--border-strong); }
.contact-social-card img { width: 22px; height: 22px; }
.contact-social-card .label { font-family: var(--font-heading); font-size: 14px; color: var(--text); display: block; }
.contact-social-card .sub { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }

.form-field {
  position: relative;
  margin-bottom: 22px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 18px 16px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  resize: none;
  transition: border-color 0.3s var(--ease);
}

.form-field textarea { min-height: 130px; padding-top: 22px; }

.form-field label {
  position: absolute;
  left: 16px;
  top: 17px;
  color: var(--text-faint);
  font-size: 15px;
  pointer-events: none;
  transition: transform 0.25s var(--ease), font-size 0.25s var(--ease), color 0.25s var(--ease);
}

.form-field input:focus,
.form-field textarea:focus { outline: none; border-color: var(--green); }

.form-field input:focus ~ label,
.form-field input:not(:placeholder-shown) ~ label,
.form-field textarea:focus ~ label,
.form-field textarea:not(:placeholder-shown) ~ label {
  transform: translateY(-10px);
  font-size: 11px;
  color: var(--green);
  font-family: var(--font-mono);
}

.form-status {
  margin-top: 6px;
  min-height: 22px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.form-status.is-success { color: var(--green); }
.form-status.is-error { color: var(--danger); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  position: relative;
  padding-top: 60px;
}

.footer-wave {
  display: block;
  width: 100%;
  color: var(--surface-solid);
}

.footer-inner {
  background: var(--surface-solid);
  padding: 40px 0 30px;
  text-align: center;
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 20px;
}

.footer p { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-faint); }

.back-to-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 400;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), border-color 0.3s var(--ease);
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { border-color: var(--green); box-shadow: 0 0 20px rgba(57, 255, 136, 0.25); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .hero-inner { grid-template-columns: 1fr; text-align: left; }
  .hero-visual { order: -1; margin-bottom: 20px; }
  .hero-photo-frame { width: min(300px, 60vw); margin: 0 auto; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .education-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .container { padding: 0 24px; }
  .navbar-inner { padding: 0 24px; }
  .section { padding: 100px 0 80px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .education-grid { grid-template-columns: 1fr; }
  .circuit-track, .exp-track { padding-left: 30px; }
  .cert-prev { left: 6px; }
  .cert-next { right: 6px; }
  .cert-close { top: 10px; right: 10px; }
}

@media (max-width: 560px) {
  .hero-cta-row { flex-direction: column; align-items: stretch; }
  .hero-cta-row .btn { justify-content: center; }
  .stats-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  body.has-fine-pointer { cursor: auto; }
}

@media (min-width: 1600px) {
  :root { --container: 1400px; }
}

/* hide custom cursor on coarse pointers regardless of JS state */
@media (pointer: coarse) {
  .cursor-dot, .cursor-ring, .cursor-spotlight { display: none !important; }
  body.has-fine-pointer { cursor: auto; }
}
