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

:root {
  --bg: #07070b;
  --bg-soft: #0a0a12;
  --bg-card: #0f0f17;
  --bg-card-hover: #14141f;
  --border: #1c1c2b;
  --border-hover: #33334d;
  --text: #c9d1d9;
  --text-dim: #6e7681;
  --text-bright: #f0f6fc;
  --accent: #00e5a0;
  --accent-dim: #00e5a033;
  --accent-glow: #00e5a022;
  --accent2: #7c5cfc;
  --accent2-dim: #7c5cfc33;
  --red: #ff6b6b;
  --yellow: #ffd93d;
  --green: #00e5a0;
  --blue: #58a6ff;
  --purple: #bc8cff;
  --string: #a5d6ff;
  --keyword: #ff7b72;
  --comment: #4a5568;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --gradient: linear-gradient(120deg, var(--accent), var(--accent2));
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 16px 40px -24px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 0 1px var(--accent-dim), 0 20px 60px -28px var(--accent-glow);
  --maxw: 1040px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 14px;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--text-bright);
}

::selection {
  background: var(--accent-dim);
  color: var(--text-bright);
}

/* Skip link — visible only when focused via keyboard */
.skip-link {
  position: fixed;
  top: -64px;
  left: 1rem;
  z-index: 300;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--bg) !important;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 0 0 8px 8px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: none;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 10px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dim);
}

/* ── Ambient Background ──────────────────────────────────── */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(rgba(124, 92, 252, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 92, 252, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

.bg-glow {
  position: fixed;
  z-index: -2;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  pointer-events: none;
}

.bg-glow-1 {
  top: -10%;
  left: -5%;
  width: 45vw;
  height: 45vw;
  max-width: 620px;
  max-height: 620px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.16;
  animation: drift1 18s ease-in-out infinite alternate;
}

.bg-glow-2 {
  top: 30%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  max-width: 680px;
  max-height: 680px;
  background: radial-gradient(circle, var(--accent2) 0%, transparent 70%);
  opacity: 0.16;
  animation: drift2 22s ease-in-out infinite alternate;
}

@keyframes drift1 {
  to { transform: translate(60px, 40px) scale(1.1); }
}
@keyframes drift2 {
  to { transform: translate(-50px, 60px) scale(1.15); }
}

.bg-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Scroll Progress ─────────────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  z-index: 200;
  background: var(--gradient);
  box-shadow: 0 0 12px var(--accent);
  transition: width 0.1s linear;
}

/* ── Navigation ──────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(7, 7, 11, 0.6);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.nav.scrolled {
  background: rgba(7, 7, 11, 0.82);
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent) !important;
  letter-spacing: -0.5px;
  transition: text-shadow 0.3s ease;
}

.nav-logo:hover {
  text-shadow: 0 0 16px var(--accent-dim);
}

.nav-links {
  display: flex;
  gap: 1.6rem;
}

.nav-links a {
  position: relative;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 400;
  padding: 0.4rem 0;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1.5px;
  background: var(--gradient);
  border-radius: 2px;
  transition: width 0.25s 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-socials {
  display: flex;
  gap: 0.8rem;
}

.nav-socials a {
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-socials a:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 16px -4px var(--accent-dim);
}

/* Resume download button (desktop + mobile) */
.nav-socials a.nav-resume,
.nav-mobile-socials a.nav-resume {
  background: var(--gradient);
  color: var(--bg);
  border-color: transparent;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.3s ease, filter 0.2s ease;
}

.nav-socials a.nav-resume:hover,
.nav-mobile-socials a.nav-resume:hover {
  color: var(--bg);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px var(--accent-glow);
  filter: brightness(1.08);
}

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

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

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

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 1rem 2rem 1.5rem;
  border-top: 1px solid var(--border);
  background: rgba(7, 7, 11, 0.95);
}

.nav-mobile.open {
  display: flex;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-mobile a {
  color: var(--text-dim);
  padding: 0.7rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.nav-mobile a:hover {
  color: var(--accent);
}

.nav-mobile-socials {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
}

.nav-mobile-socials a {
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* ── Terminal Window ─────────────────────────────────────── */
.terminal-window {
  position: relative;
  background: linear-gradient(180deg, var(--bg-card), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.terminal-window::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.terminal-window:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.terminal-window:hover::before {
  opacity: 0.6;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.dot.red { background: var(--red); box-shadow: 0 0 8px -2px var(--red); }
.dot.yellow { background: var(--yellow); box-shadow: 0 0 8px -2px var(--yellow); }
.dot.green { background: var(--green); box-shadow: 0 0 8px -2px var(--green); }

.terminal-window:hover .dot { transform: scale(1.1); }

.terminal-title {
  margin-left: 10px;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.terminal-body {
  padding: 1.6rem;
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 7rem 2rem 4rem;
  max-width: 940px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  margin-bottom: 1.6rem;
  font-size: 0.72rem;
  color: var(--text);
  background: rgba(0, 229, 160, 0.06);
  border: 1px solid var(--accent-dim);
  border-radius: 100px;
  transition: all 0.3s ease;
}

.hero-badge:hover {
  color: var(--text-bright);
  border-color: var(--accent);
  box-shadow: 0 0 20px -6px var(--accent-dim);
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse-dot 2s ease-out infinite;
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(0, 229, 160, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(0, 229, 160, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 229, 160, 0); }
}

.hero-terminal {
  width: 100%;
}

.hero-terminal .terminal-body {
  padding: 2.2rem;
}

.code-comment {
  color: var(--comment);
  font-style: italic;
}

.code-line {
  color: var(--text);
}

.code-line.indent {
  padding-left: 2rem;
}

.code-keyword { color: var(--keyword); }
.code-var { color: var(--blue); }
.code-key { color: var(--purple); }
.code-string { color: var(--string); }

.hero-tagline {
  color: var(--accent);
  font-size: 0.92rem;
  display: inline;
}

.cursor {
  color: var(--accent);
  animation: blink-cursor 1s step-end infinite;
  font-size: 0.92rem;
}

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

.blink {
  color: var(--green);
  animation: blink-dot 2s ease-in-out infinite;
}

@keyframes blink-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  width: 100%;
  margin-top: 2rem;
}

.stat {
  position: relative;
  text-align: center;
  padding: 1.3rem 0.5rem;
  background: linear-gradient(180deg, var(--bg-card), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.stat::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120px 60px at 50% 0%, var(--accent-glow), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px -24px var(--accent-glow);
}

.stat:hover::after { opacity: 1; }

.stat-num {
  display: block;
  font-size: 1.7rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  display: block;
  font-size: 0.62rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Sections ────────────────────────────────────────────── */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 5.5rem 2rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 2rem;
}

.section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
  margin-left: 0.5rem;
}

.prompt {
  color: var(--accent);
  margin-right: 0.2rem;
}

.section-sub {
  color: var(--text-dim);
  font-size: 0.75rem;
  margin-top: -1.5rem;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── About ───────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 2.4rem;
}

.about-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.1rem;
}

.field-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.25rem;
}

.field-value {
  color: var(--text-bright);
  font-size: 0.85rem;
}

.status-online { color: var(--green); }

.about-mission {
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.85;
  border-left: 2px solid var(--accent-dim);
  padding-left: 1.2rem;
}

/* ── Experience Timeline ─────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 2.2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent2), transparent);
  opacity: 0.5;
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-dot {
  position: absolute;
  left: -2.2rem;
  top: 1.6rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  z-index: 1;
  transition: box-shadow 0.3s ease;
}

.timeline-item:first-child .timeline-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow), 0 0 16px var(--accent-dim);
  animation: pulse-dot 2.5s ease-out infinite;
}

.timeline-item:hover .timeline-dot {
  box-shadow: 0 0 16px var(--accent-dim);
}

.commit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.commit-hash {
  color: var(--yellow);
  font-size: 0.75rem;
}

.commit-date {
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 100px;
}

.commit-author {
  color: var(--text-dim);
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.commit-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 1rem;
}

.commit-company { color: var(--accent); font-weight: 500; }
.commit-location { color: var(--text-dim); font-weight: 400; font-size: 0.85rem; }

.commit-diff {
  margin-bottom: 1.1rem;
}

.diff-add {
  color: var(--green);
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  line-height: 1.6;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.diff-add:hover {
  background: rgba(0, 229, 160, 0.05);
}

/* ── Tech Tags ───────────────────────────────────────────── */
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag {
  font-size: 0.65rem;
  padding: 0.25rem 0.65rem;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 100px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.tag:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* ── Projects Grid ───────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem;
}

.project-card {
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-5px);
}

.project-card .terminal-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.6rem;
}

.project-desc {
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.65;
  margin-bottom: 0.9rem;
}

.project-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  margin-bottom: 0.9rem;
}

.project-stat {
  font-size: 0.7rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.project-links {
  display: flex;
  gap: 0.8rem;
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.project-link {
  font-size: 0.75rem;
  color: var(--accent);
  transition: color 0.2s ease;
}

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

/* ── Skills ──────────────────────────────────────────────── */
.skills-body {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.skill-group {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: start;
  gap: 1rem;
}

.skill-category {
  color: var(--purple);
  font-size: 0.8rem;
  font-weight: 500;
  padding-top: 0.35rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  font-size: 0.75rem;
  padding: 0.4rem 0.9rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.25s ease;
  cursor: default;
}

.skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -8px var(--accent-dim);
}

/* ── Achievements ────────────────────────────────────────── */
.featured-achievements {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  margin-bottom: 1rem;
}

.feat-card .feat-body {
  display: flex;
  gap: 1.6rem;
  align-items: stretch;
}

.feat-gallery {
  display: flex;
  gap: 0.5rem;
  flex: 1.4;
  min-width: 0;
}

.feat-shot {
  flex: 1 1 0;
  min-width: 0;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
}

.feat-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.feat-shot:hover img {
  transform: scale(1.07);
}

.feat-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
}

.feat-place {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
}

.feat-place.gold {
  color: var(--yellow);
  background: rgba(255, 217, 61, 0.1);
  border: 1px solid rgba(255, 217, 61, 0.3);
}

.feat-place.silver {
  color: #cbd5e1;
  background: rgba(203, 213, 225, 0.08);
  border: 1px solid rgba(203, 213, 225, 0.25);
}

.feat-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-bright);
}

.feat-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text);
}

.feat-key {
  display: inline-block;
  min-width: 70px;
  color: var(--purple);
}

.feat-key::after { content: ':'; }

.feat-link {
  margin-top: auto;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  transition: all 0.25s ease;
}

.feat-link:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text-bright);
  transform: translateY(-1px);
}

.other-sub {
  margin-top: 3rem;
  margin-bottom: 1rem;
  text-transform: none;
  letter-spacing: 0;
  font-style: italic;
  color: var(--comment);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0.9rem;
}

.achievement-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.2rem;
  background: linear-gradient(180deg, var(--bg-card), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.achievement-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 14px 34px -22px var(--accent-glow);
}

.achievement-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.achievement-text {
  font-size: 0.8rem;
  color: var(--text);
}

/* ── Contact ─────────────────────────────────────────────── */
.contact-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-required {
  color: var(--red);
  margin-left: 2px;
}

.form-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  outline: none;
  resize: vertical;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder { color: var(--text-dim); }

.form-textarea { min-height: 120px; }

.form-submit {
  position: relative;
  overflow: hidden;
  background: var(--gradient);
  color: var(--bg);
  border: none;
  padding: 0.85rem 1.6rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  align-self: flex-start;
}

.form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -12px var(--accent-glow);
}

.form-submit::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transition: left 0.5s ease;
}

.form-submit:hover::after { left: 140%; }

.contact-alt {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.6rem;
}

.contact-link {
  color: var(--text);
  font-size: 0.8rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.contact-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
}

.footer-text {
  color: var(--text-dim);
  font-size: 0.75rem;
  margin-bottom: 0.3rem;
}

.footer-tech { color: var(--accent); }

.footer-copy {
  color: var(--text-dim);
  font-size: 0.65rem;
  opacity: 0.6;
}

/* ── Scroll Reveal ───────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  body { font-size: 13px; }

  .nav-links,
  .nav-socials { display: none; }

  .nav-toggle { display: flex; }

  .hero {
    padding: 6rem 1.2rem 4rem;
    min-height: 100vh;
  }

  .hero-terminal .terminal-body { padding: 1.4rem; }

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

  .section { padding: 3.5rem 1.2rem; }

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

  .about-mission { border-left: none; padding-left: 0; }

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

  .skill-group { grid-template-columns: 1fr; gap: 0.5rem; }

  .skill-category { padding-top: 0; }

  .code-line.indent { padding-left: 1rem; }

  .commit-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .contact-links { flex-direction: column; }

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

  .feat-card .feat-body { flex-direction: column; gap: 1rem; }

  .feat-shot { height: 130px; }
}

@media (max-width: 480px) {
  .hero-stats {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  .stat-num { font-size: 1.35rem; }

  .terminal-body { padding: 1.1rem; }

  .timeline { padding-left: 1.6rem; }

  .timeline-dot { left: -1.6rem; }
}

/* ── Nav controls + Day/Night theme toggle ───────────────── */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.theme-toggle {
  position: relative;
  width: 66px;
  height: 31px;
  flex: none;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 999px;
}

.theme-toggle .dnt-shell {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.47);
}

/* Day/Night toggle — ported from dynamicComponents (dayNightToggle) */
.dnt-shell {
  --dnt-w: 140px;
  --dnt-h: 64px;
  --dnt-knob: 52px;
  --dnt-pad: 6px;
  --dnt-slide: 76px;
  position: relative;
  display: block;
  width: var(--dnt-w);
  height: var(--dnt-h);
  border-radius: 999px;
  overflow: hidden;
  border: 3px solid rgba(180, 180, 200, 0.35);
  box-shadow:
    inset 0 4px 8px rgba(0, 0, 0, 0.18),
    0 2px 6px rgba(0, 0, 0, 0.12);
  user-select: none;
}

.dnt-track {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, #87CEEB 0%, #a8b8d8 40%, #7b8cc2 100%);
  transition: background 0.5s ease;
}

.dnt-shell.night .dnt-track {
  background: linear-gradient(135deg, #1a2344 0%, #2a3560 50%, #1e2a4a 100%);
}

.dnt-clouds {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.dnt-shell.night .dnt-clouds { opacity: 0; }

.dnt-cloud {
  position: absolute;
  background: #fff;
  border-radius: 999px;
}
.dnt-cloud::before,
.dnt-cloud::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}
.dnt-cloud.c1 { right: 14%; top: 24%; width: 28px; height: 10px; }
.dnt-cloud.c1::before { width: 14px; height: 14px; left: 3px; top: -7px; }
.dnt-cloud.c1::after { width: 18px; height: 18px; right: 2px; top: -10px; }
.dnt-cloud.c2 { right: 26%; top: 50%; width: 20px; height: 7px; opacity: 0.7; }
.dnt-cloud.c2::before { width: 10px; height: 10px; left: 2px; top: -5px; }
.dnt-cloud.c2::after { width: 13px; height: 13px; right: 1px; top: -7px; }

.dnt-stars {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s ease 0.15s;
}

.dnt-shell.night .dnt-stars { opacity: 1; }

.dnt-star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
}
.dnt-star.s1 { width: 3px; height: 3px; top: 22%; left: 14%; opacity: 0.9; }
.dnt-star.s2 { width: 2px; height: 2px; top: 40%; left: 26%; opacity: 0.7; }
.dnt-star.s3 { width: 3px; height: 3px; top: 60%; left: 10%; opacity: 0.8; }
.dnt-star.s4 { width: 2px; height: 2px; top: 30%; left: 38%; opacity: 0.6; }
.dnt-star.s5 { width: 4px; height: 4px; top: 55%; left: 32%; opacity: 0.5; }
.dnt-star.s6 { width: 2px; height: 2px; top: 18%; left: 48%; opacity: 0.7; }
.dnt-star.s7 { width: 3px; height: 3px; top: 68%; left: 44%; opacity: 0.6; }
.dnt-star.s8 { width: 2px; height: 2px; top: 72%; left: 20%; opacity: 0.8; }
.dnt-star.s9 { width: 3px; height: 3px; top: 46%; left: 18%; opacity: 0.5; }

.dnt-star.shaped::before,
.dnt-star.shaped::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}
.dnt-star.shaped::before { height: 40%; top: 30%; left: -40%; right: -40%; width: 180%; }
.dnt-star.shaped::after { width: 40%; left: 30%; top: -40%; bottom: -40%; height: 180%; }

.dnt-shell.night .dnt-star { animation: twinkle 3s ease-in-out infinite; }
.dnt-star.s2 { animation-delay: 0.4s; }
.dnt-star.s3 { animation-delay: 0.9s; }
.dnt-star.s4 { animation-delay: 1.5s; }
.dnt-star.s5 { animation-delay: 0.2s; }
.dnt-star.s6 { animation-delay: 1.1s; }
.dnt-star.s7 { animation-delay: 2.0s; }
.dnt-star.s8 { animation-delay: 0.7s; }
.dnt-star.s9 { animation-delay: 1.8s; }

@keyframes twinkle {
  0%, 100% { opacity: var(--star-o, 0.7); }
  50% { opacity: 0.2; }
}

.dnt-knob-wrap {
  position: absolute;
  top: 50%;
  left: var(--dnt-pad);
  transform: translateY(-50%);
  width: var(--dnt-knob);
  height: var(--dnt-knob);
  z-index: 5;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.dnt-shell.night .dnt-knob-wrap {
  transform: translateY(-50%) translateX(var(--dnt-slide));
}

.dnt-sun {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff6a8, #f5d442 50%, #e8b830 100%);
  box-shadow:
    0 0 18px 4px rgba(245, 212, 66, 0.5),
    inset 0 -3px 6px rgba(200, 160, 0, 0.25);
  opacity: 1;
  transform: scale(1) rotate(0deg);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.dnt-shell.night .dnt-sun {
  opacity: 0;
  transform: scale(0.5) rotate(-90deg);
}

.dnt-moon {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 40%, #f0efe6, #d4d0c0 60%, #bbb8a8 100%);
  box-shadow:
    0 0 12px 2px rgba(210, 210, 200, 0.3),
    inset 0 -3px 6px rgba(100, 100, 80, 0.2);
  opacity: 0;
  transform: scale(0.5) rotate(90deg);
  transition: opacity 0.35s ease 0.1s, transform 0.45s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

.dnt-shell.night .dnt-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.dnt-crater {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, #b5b2a0, #a09d8e);
  opacity: 0.45;
}
.dnt-crater.cr1 { width: 30%; height: 30%; top: 25%; left: 50%; }
.dnt-crater.cr2 { width: 22%; height: 22%; top: 55%; left: 30%; }
.dnt-crater.cr3 { width: 16%; height: 16%; top: 50%; left: 60%; }

.dnt-knob-shadow {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  z-index: -1;
  box-shadow:
    4px 0 0 0 rgba(120, 120, 140, 0.25),
    8px 0 0 0 rgba(120, 120, 140, 0.15),
    12px 0 0 0 rgba(120, 120, 140, 0.08);
  transition: box-shadow 0.45s ease;
}

.dnt-shell.night .dnt-knob-shadow {
  box-shadow:
    -4px 0 0 0 rgba(100, 110, 140, 0.3),
    -8px 0 0 0 rgba(100, 110, 140, 0.18),
    -12px 0 0 0 rgba(100, 110, 140, 0.08);
}

/* ── Light theme ─────────────────────────────────────────── */
:root.light {
  --bg: #eef1f7;
  --bg-soft: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f4f6fb;
  --border: #e2e6ef;
  --border-hover: #c4ccda;
  --text: #38404f;
  --text-dim: #69707f;
  --text-bright: #0b1120;
  --accent: #02a578;
  --accent-dim: rgba(2, 165, 120, 0.14);
  --accent-glow: rgba(2, 165, 120, 0.2);
  --accent2: #6d4bf0;
  --accent2-dim: rgba(109, 75, 240, 0.14);
  --red: #e5484d;
  --yellow: #d39800;
  --green: #0f9d6e;
  --blue: #0969da;
  --purple: #8250df;
  --string: #0a6e57;
  --keyword: #cf222e;
  --comment: #8a93a3;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 14px 34px -22px rgba(20, 30, 60, 0.22);
  --shadow-glow: 0 0 0 1px var(--accent-dim), 0 22px 54px -28px var(--accent-glow);
  color-scheme: light;
}

:root.light .nav { background: rgba(255, 255, 255, 0.62); }
:root.light .nav.scrolled { background: rgba(255, 255, 255, 0.85); }
:root.light .nav-mobile { background: rgba(255, 255, 255, 0.97); }
:root.light .terminal-bar { background: rgba(0, 0, 0, 0.04); }
:root.light .project-stat { background: rgba(0, 0, 0, 0.05); }
:root.light .nav-mobile a { border-bottom-color: rgba(0, 0, 0, 0.06); }
:root.light .bg-glow { opacity: 0.12; }
:root.light .bg-noise { opacity: 0.018; }

/* Text on gradient fills must stay light in light mode */
:root.light .form-submit,
:root.light .nav-socials a.nav-resume,
:root.light .nav-mobile-socials a.nav-resume {
  color: #fff;
}

:root.light .feat-place.silver {
  color: #5b6472;
  background: rgba(91, 100, 114, 0.1);
  border-color: rgba(91, 100, 114, 0.28);
}
