/* ===========================
   CSS Custom Properties
   =========================== */
:root {
  --navy-deep: #0A1628;
  --navy-mid: #112240;
  --navy-light: #1d3461;
  --cyan: #00c2ff;
  --cyan-dim: rgba(0, 194, 255, 0.15);
  --cyan-border: rgba(0, 194, 255, 0.25);
  --green-accent: #00ff9d;
  --white: #f0f4f8;
  --white-dim: rgba(240, 244, 248, 0.7);
  --white-faint: rgba(240, 244, 248, 0.12);
  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius: 8px;
  --transition: 0.25s ease;
  --ease-out: cubic-bezier(0.22, 0.75, 0.3, 1);

  /* Dark-first page: keep native controls, scrollbars and safe-area
     padding in the same world as the design. */
  color-scheme: dark;
  background: #0A1628;
}

/* ===========================
   Light theme
   Same structure, same accent — just inverted for daylight.
   Toggled by JS setting data-theme="light" on <html>.
   =========================== */
:root[data-theme="light"] {
  color-scheme: light;
  --navy-deep: #F5F7FA;
  --navy-mid: #EBEEF2;
  --navy-light: #DCE1E8;
  --cyan: #0086b3;
  --cyan-dim: rgba(0, 134, 179, 0.1);
  --cyan-border: rgba(0, 134, 179, 0.22);
  --green-accent: #00875f;
  --white: #101820;
  --white-dim: rgba(16, 24, 32, 0.68);
  --white-faint: rgba(16, 24, 32, 0.08);
  background: #F5F7FA;
}

:root[data-theme="light"] .code-block {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 20px 50px rgba(16, 24, 32, 0.1), 0 0 0 1px rgba(0, 134, 179, 0.08);
}

:root[data-theme="light"] .btn-primary { color: #fff; }
:root[data-theme="light"] .marker-dot { background: var(--navy-mid); }
:root[data-theme="light"] .marker-dot.current,
:root[data-theme="light"] .marker-dot.reached { background: var(--cyan); }
:root[data-theme="light"] .grain { opacity: 0.012; }
:root[data-theme="light"] .spotlight {
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 30%), rgba(0, 134, 179, 0.06), transparent 45%);
}

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

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

body {
  background: var(--navy-deep);
  color: var(--white);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
}

::selection {
  background: var(--cyan);
  color: var(--navy-deep);
}

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

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--navy-deep); }
::-webkit-scrollbar-thumb {
  background: var(--navy-light);
  border-radius: 10px;
  border: 2px solid var(--navy-deep);
}
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ===========================
   Ambient Overlays
   =========================== */

/* Cursor spotlight — follows the pointer across the whole page */
.spotlight {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  background: radial-gradient(
    520px circle at var(--mx, 50%) var(--my, 30%),
    rgba(0, 194, 255, 0.07),
    transparent 45%
  );
}

.spotlight.on { opacity: 1; }

/* Film grain */
.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ===========================
   Layout Utilities
   =========================== */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
  position: relative;
  z-index: 3;
}

.section-dark {
  background: var(--navy-mid);
}

.section-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 54px;
  padding-bottom: 0.12em;
  text-wrap: balance;
}

/* Section titles wipe up from behind their own edge.
   The wipe is applied to an inner span, never to the observed h2 —
   an element clipped to zero area never reports as intersecting. */
.section-title .t-in { display: block; }

.js-motion .section-title { overflow: hidden; }

.js-motion .section-title .t-in {
  transform: translateY(108%);
  transition: transform 0.85s var(--ease-out);
}

.js-motion .section-title.visible .t-in {
  transform: translateY(0);
}

.accent {
  color: var(--cyan);
}

/* ===========================
   Navigation
   =========================== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0;
  transition: background var(--transition), box-shadow var(--transition);
}

#navbar.scrolled {
  background: rgba(10, 22, 40, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--cyan-border);
}

.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Reading progress rail under the navbar */
.scroll-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--cyan), var(--green-accent));
  box-shadow: 0 0 10px rgba(0, 194, 255, 0.5);
}

.nav-logo {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: transform 0.3s var(--ease-out);
  display: inline-block;
}

.nav-logo:hover { transform: translateY(-2px); }

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

.nav-links li { position: relative; }

.nav-links a:not(.nav-cta) {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--white-dim);
  transition: color var(--transition);
  position: relative;
  padding-bottom: 4px;
}

/* Sliding underline on hover + active */
.nav-links a:not(.nav-cta)::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.32s var(--ease-out);
}

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

.nav-links a:not(.nav-cta):hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.nav-cta {
  background: var(--cyan-dim);
  border: 1px solid var(--cyan-border);
  color: var(--cyan) !important;
  font-size: 0.85rem;
  padding: 8px 20px;
  border-radius: var(--radius);
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.nav-cta:hover {
  background: rgba(0, 194, 255, 0.25) !important;
  border-color: var(--cyan) !important;
  box-shadow: 0 0 20px rgba(0, 194, 255, 0.25);
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(240, 244, 248, 0.14);
  border-radius: 50%;
  color: var(--white-dim);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition), transform 0.25s var(--ease-out);
}

.tool-btn:hover {
  border-color: var(--cyan-border);
  color: var(--cyan);
  background: var(--cyan-dim);
  transform: translateY(-1px);
}

.tool-btn-text {
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

#themeToggle .icon-moon { display: none; }
:root[data-theme="light"] #themeToggle .icon-sun { display: none; }
:root[data-theme="light"] #themeToggle .icon-moon { display: block; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: transform 0.28s var(--ease-out), opacity 0.2s;
}

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

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: rgba(10, 22, 40, 0.98);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--cyan-border);
  z-index: 999;
  padding: 20px 24px 28px;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.36s var(--ease-out), opacity 0.3s ease;
}

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

.mobile-menu ul {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu a {
  display: block;
  padding: 12px 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--white-dim);
  border-bottom: 1px solid var(--white-faint);
  transition: color var(--transition), padding-left var(--transition);
}

.mobile-menu a:hover { color: var(--cyan); padding-left: 8px; }

.mobile-tools {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--white-faint);
}

.mobile-tools .tool-btn {
  width: auto;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius);
  gap: 8px;
}

.mobile-tools .tool-btn-label {
  font-size: 0.8rem;
  font-weight: 500;
}

/* ===========================
   Hero
   =========================== */
#hero {
  min-height: min(100vh, 820px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 24px 80px;
  position: relative;
  overflow: hidden;
  z-index: 3;
}

/* Slow-drifting ambient glow */
#hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(0, 194, 255, 0.07) 0%, transparent 70%);
  pointer-events: none;
  animation: drift 18s ease-in-out infinite alternate;
}

#hero::after {
  content: '';
  position: absolute;
  bottom: -25%;
  left: -12%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(0, 255, 157, 0.04) 0%, transparent 70%);
  pointer-events: none;
  animation: drift 24s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-60px, 50px, 0) scale(1.15); }
}

/* Node-network canvas — microservice topology, quietly alive */
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero-grid {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Orchestrated entrance — pure CSS, so it plays even if JS never runs */
.anim .hero-content > *,
.anim .hero-visual {
  opacity: 0;
  transform: translateY(18px);
  animation: heroIn 0.8s var(--ease-out) forwards;
}

.anim .hero-content > *:nth-child(1) { animation-delay: 0.08s; }
.anim .hero-content > *:nth-child(2) { animation-delay: 0.16s; }
.anim .hero-content > *:nth-child(3) { animation-delay: 0.26s; }
.anim .hero-content > *:nth-child(4) { animation-delay: 0.34s; }
.anim .hero-content > *:nth-child(5) { animation-delay: 0.42s; }
.anim .hero-content > *:nth-child(6) { animation-delay: 0.5s; }
.anim .hero-visual { animation-delay: 0.3s; }

@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-name {
  font-family: var(--font-head);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

/* Accent word carries a slow sheen */
.hero-name .accent {
  background: linear-gradient(100deg, var(--cyan) 20%, var(--green-accent) 45%, var(--cyan) 70%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: sheen 7s linear infinite;
}

@keyframes sheen {
  from { background-position: 180% 0; }
  to   { background-position: -80% 0; }
}

.hero-role {
  font-family: var(--font-head);
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 400;
  color: var(--white-dim);
  margin-bottom: 24px;
  min-height: 2em;
}

.cursor {
  color: var(--cyan);
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-summary {
  font-size: 0.95rem;
  color: var(--white-dim);
  line-height: 1.75;
  max-width: 500px;
  margin-bottom: 36px;
}

.hero-summary strong {
  color: var(--white);
  font-weight: 500;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.btn-primary {
  background: var(--cyan);
  color: var(--navy-deep);
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 13px 28px;
  border-radius: var(--radius);
  display: inline-block;
  position: relative;
  overflow: hidden;
  transition: background var(--transition), box-shadow var(--transition), transform 0.3s var(--ease-out);
}

/* Light sweeps across the primary button on hover */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s var(--ease-out);
}

.btn-primary:hover::after { left: 125%; }

.btn-primary:hover {
  background: #33cfff;
  box-shadow: 0 8px 30px rgba(0, 194, 255, 0.35);
}

.btn-ghost {
  border: 1px solid var(--cyan-border);
  color: var(--white);
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 13px 28px;
  border-radius: var(--radius);
  display: inline-block;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform 0.3s var(--ease-out);
}

.btn-ghost:hover {
  border-color: var(--cyan);
  background: var(--cyan-dim);
  box-shadow: 0 8px 30px rgba(0, 194, 255, 0.12);
}

.hero-langs {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-langs span {
  font-size: 0.8rem;
  color: var(--white-dim);
  transition: color var(--transition), transform 0.3s var(--ease-out);
}

.hero-langs span:hover { color: var(--white); transform: translateY(-2px); }

/* Code Block */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1200px;
}

.code-block {
  background: rgba(17, 34, 64, 0.82);
  border: 1px solid var(--cyan-border);
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 194, 255, 0.05);
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
  will-change: transform;
}

.code-block:hover {
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 194, 255, 0.22),
              0 0 50px rgba(0, 194, 255, 0.1);
}

.code-header {
  background: var(--navy-light);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.red { background: #ff5f57; }
.dot.amber { background: #febc2e; }
.dot.green { background: #28c840; }

.code-filename {
  margin-left: 12px;
  font-size: 0.75rem;
  color: var(--white-dim);
  font-family: 'Courier New', monospace;
}

.code-body {
  padding: 24px;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  line-height: 1.8;
  overflow-x: auto;
}

/* Caret that rides along while the code types itself in */
.code-caret {
  display: inline-block;
  width: 7px;
  height: 1em;
  background: var(--cyan);
  vertical-align: text-bottom;
  animation: blink 0.7s step-end infinite;
}

.kw { color: #c792ea; }
.cls { color: #82aaff; }
.str { color: #c3e88d; }
.fn { color: #82aaff; }
.num { color: #f78c6c; }

/* Scroll Indicator */
.hero-scroll {
  display: flex;
  justify-content: center;
  margin-top: auto;
  padding-top: 40px;
  position: relative;
  z-index: 1;
}

.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0.45;
}

.scroll-indicator span {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--cyan), transparent);
  animation: scrollAnim 1.8s ease-in-out infinite;
}

@keyframes scrollAnim {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  50% { opacity: 0.3; transform: scaleY(0.5); }
}

/* ===========================
   About
   =========================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 60px;
  align-items: start;
}

.about-text p {
  font-size: 1rem;
  color: var(--white-dim);
  line-height: 1.8;
  margin-bottom: 20px;
  max-width: 600px;
}

.about-text p:last-child { margin-bottom: 0; }

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--cyan-border);
  border: 1px solid var(--cyan-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat-item {
  background: var(--navy-mid);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background var(--transition);
}

.stat-item:hover { background: #16305a; }

.stat-num {
  font-family: var(--font-head);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--white-dim);
  line-height: 1.3;
}

/* ===========================
   Timeline / Experience
   =========================== */
.timeline {
  position: relative;
}

/* Scroll-linked cyan fill running down the timeline */
.tl-rail {
  position: absolute;
  left: 13.5px;
  top: 6px;
  width: 1px;
  height: 0;
  background: linear-gradient(to bottom, var(--cyan), var(--green-accent));
  box-shadow: 0 0 10px rgba(0, 194, 255, 0.6);
  z-index: 1;
  pointer-events: none;
}

.timeline-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 28px;
  margin-bottom: 48px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6px;
  position: relative;
  z-index: 2;
}

.marker-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  background: var(--navy-mid);
  flex-shrink: 0;
  transition: background 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.marker-dot.current,
.marker-dot.reached {
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(0, 194, 255, 0.65);
}

.marker-dot.current { animation: pulse 2.4s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 194, 255, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(0, 194, 255, 0); }
}

.marker-line {
  width: 1px;
  flex: 1;
  background: var(--cyan-border);
  margin-top: 8px;
  min-height: 40px;
}

.timeline-card {
  background: var(--navy-deep);
  border: 1px solid rgba(240, 244, 248, 0.08);
  border-radius: 10px;
  padding: 28px 32px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: border-color var(--transition), transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

/* Cursor-tracked glow inside cards */
.timeline-card::before,
.skill-category::before,
.cert-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  background: radial-gradient(
    360px circle at var(--gx, 50%) var(--gy, 50%),
    rgba(0, 194, 255, 0.12),
    transparent 45%
  );
}

.timeline-card:hover::before,
.skill-category:hover::before,
.cert-card:hover::before { opacity: 1; }

.timeline-card > *,
.skill-category > *,
.cert-card > * {
  position: relative;
  z-index: 1;
}

.timeline-card:hover {
  border-color: var(--cyan-border);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
  gap: 16px;
  flex-wrap: wrap;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card-company {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cyan);
}

.card-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.05em;
}

.current-badge {
  background: rgba(0, 255, 157, 0.12);
  color: var(--green-accent);
  border: 1px solid rgba(0, 255, 157, 0.3);
}

.card-dates {
  font-size: 0.78rem;
  color: var(--white-dim);
  white-space: nowrap;
}

.card-role {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 4px;
}

.card-project {
  font-size: 0.78rem;
  color: var(--cyan);
  margin-bottom: 14px;
  font-style: italic;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--white-dim);
  line-height: 1.7;
  margin-bottom: 16px;
}

.card-tasks {
  margin-bottom: 20px;
}

.card-tasks li {
  font-size: 0.85rem;
  color: var(--white-dim);
  line-height: 1.6;
  padding: 5px 0 5px 18px;
  position: relative;
  transition: color var(--transition);
}

.card-tasks li:hover { color: var(--white); }

.card-tasks li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--cyan);
  font-size: 0.7rem;
  top: 7px;
  transition: transform 0.25s var(--ease-out);
}

.card-tasks li:hover::before { transform: translateX(3px); }

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 4px;
  background: var(--cyan-dim);
  border: 1px solid var(--cyan-border);
  color: var(--cyan);
  transition: background var(--transition), border-color var(--transition), transform 0.25s var(--ease-out);
}

.tag:hover {
  background: rgba(0, 194, 255, 0.28);
  border-color: var(--cyan);
  transform: translateY(-2px);
}

/* ===========================
   Skills
   =========================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.skill-category {
  background: var(--navy-mid);
  border: 1px solid rgba(240, 244, 248, 0.07);
  border-radius: 10px;
  padding: 24px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: border-color var(--transition), transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.skill-category:hover {
  border-color: var(--cyan-border);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.skill-cat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.skill-icon {
  font-size: 1.3rem;
  transition: transform 0.4s var(--ease-out);
}

.skill-category:hover .skill-icon { transform: scale(1.18) rotate(-8deg); }

.skill-cat-header h3 {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stag {
  font-size: 0.72rem;
  font-weight: 400;
  padding: 4px 11px;
  border-radius: 4px;
  background: var(--white-faint);
  color: var(--white-dim);
  border: 1px solid rgba(240, 244, 248, 0.1);
  transition: background var(--transition), color var(--transition), transform 0.25s var(--ease-out);
}

.stag:hover {
  color: var(--white);
  transform: translateY(-2px);
}

.stag.primary {
  background: var(--cyan-dim);
  color: var(--cyan);
  border-color: var(--cyan-border);
  font-weight: 500;
}

/* Tags stagger in once their card is revealed */
.js-motion .reveal .tag,
.js-motion .reveal .stag {
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out),
              background var(--transition), border-color var(--transition), color var(--transition);
}

.js-motion .reveal.visible .tag,
.js-motion .reveal.visible .stag {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ===========================
   Certifications
   =========================== */
.education-block {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(0, 194, 255, 0.07);
  border: 1px solid var(--cyan-border);
  border-radius: 10px;
  padding: 24px 28px;
  margin-bottom: 40px;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.education-block:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

.edu-icon {
  font-size: 2rem;
  transition: transform 0.4s var(--ease-out);
}

.education-block:hover .edu-icon { transform: scale(1.12) rotate(6deg); }

.edu-content h3 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.edu-content p {
  font-size: 0.85rem;
  color: var(--cyan);
}

.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.cert-card {
  background: var(--navy-deep);
  border: 1px solid rgba(240, 244, 248, 0.08);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: border-color var(--transition), transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.cert-card:hover {
  border-color: var(--cyan-border);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.cert-year {
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid var(--cyan-border);
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  height: fit-content;
}

.cert-body h4 {
  font-family: var(--font-head);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 4px;
  line-height: 1.4;
}

.cert-body p {
  font-size: 0.8rem;
  color: var(--white-dim);
  margin-bottom: 6px;
}

.cert-issuer {
  font-size: 0.72rem;
  color: var(--cyan);
  font-weight: 500;
}

/* ===========================
   Contact
   =========================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.contact-lead {
  font-size: 1rem;
  color: var(--white-dim);
  line-height: 1.75;
  margin-bottom: 36px;
  max-width: 400px;
}

.contact-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid rgba(240, 244, 248, 0.08);
  border-radius: var(--radius);
  transition: border-color var(--transition), background var(--transition), transform 0.3s var(--ease-out);
}

.contact-item:hover {
  border-color: var(--cyan-border);
  background: var(--cyan-dim);
  transform: translateX(6px);
}

.contact-icon {
  font-size: 1.2rem;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-out);
}

.contact-item:hover .contact-icon { transform: scale(1.15); }

.contact-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cyan);
  font-weight: 500;
}

.contact-value {
  font-size: 0.88rem;
  color: var(--white);
}

/* Contact Form */
.contact-form-wrap {
  background: var(--navy-mid);
  border: 1px solid rgba(240, 244, 248, 0.08);
  border-radius: 10px;
  padding: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--white-dim);
  letter-spacing: 0.03em;
  transition: color var(--transition);
}

.form-group:focus-within label { color: var(--cyan); }

.form-group input,
.form-group textarea {
  background: rgba(240, 244, 248, 0.04);
  border: 1px solid rgba(240, 244, 248, 0.12);
  border-radius: 6px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--white);
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  resize: vertical;
  width: 100%;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(240, 244, 248, 0.25);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--cyan);
  background: rgba(0, 194, 255, 0.04);
  box-shadow: 0 0 0 3px rgba(0, 194, 255, 0.12);
}

.form-submit {
  width: 100%;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.form-note {
  font-size: 0.8rem;
  color: var(--green-accent);
  text-align: center;
  min-height: 1.2em;
}

/* ===========================
   Back to top
   =========================== */
.to-top {
  position: fixed;
  right: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(10, 22, 40, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--cyan-border);
  color: var(--cyan);
  font-size: 1rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s var(--ease-out), background var(--transition), box-shadow var(--transition);
}

.to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.to-top:hover {
  background: var(--cyan-dim);
  box-shadow: 0 0 22px rgba(0, 194, 255, 0.3);
}

/* ===========================
   Footer
   =========================== */
footer {
  background: var(--navy-mid);
  border-top: 1px solid rgba(240, 244, 248, 0.07);
  padding: 28px 0;
  position: relative;
  z-index: 3;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-logo {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--white-dim);
}

.footer-link {
  font-size: 0.8rem;
  color: var(--cyan);
  transition: opacity var(--transition), transform 0.25s var(--ease-out);
  display: inline-block;
}

.footer-link:hover { opacity: 0.75; transform: translateX(3px); }

/* ===========================
   Reveal Animations
   =========================== */
.js-motion .reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.js-motion .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    display: none;
  }

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

  .about-stats {
    grid-template-columns: repeat(4, 1fr);
  }

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

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .mobile-menu {
    display: block;
  }

  .section {
    padding: 72px 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .about-stats {
    grid-template-columns: 1fr 1fr;
  }

  .timeline-item {
    grid-template-columns: 20px 1fr;
    gap: 18px;
  }

  .tl-rail { left: 9.5px; }

  .card-header {
    flex-direction: column;
    gap: 6px;
  }

  .contact-form-wrap {
    padding: 24px;
  }

  .to-top { right: 16px; }
}

@media (max-width: 480px) {
  #hero {
    padding: 100px 24px 60px;
  }

  .hero-name {
    font-size: 2.8rem;
  }

  .timeline-card {
    padding: 20px;
  }

  .nav-inner { padding: 16px; }
  .nav-tools { gap: 6px; }
  .tool-btn { width: 32px; height: 32px; }
}

/* ===========================
   Reduced motion — everything
   settles instantly, nothing moves
   =========================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal,
  .reveal .tag,
  .reveal .stag,
  .anim .hero-content > *,
  .anim .hero-visual {
    opacity: 1 !important;
    transform: none !important;
  }

  .section-title { overflow: visible !important; }
  .section-title .t-in { transform: none !important; }

  .hero-canvas,
  .spotlight,
  .grain { display: none; }

  .hero-name .accent {
    -webkit-text-fill-color: var(--cyan);
    background: none;
  }
}
