/* ============ Tokens ============ */
:root {
  --bg: #0A0A0B;
  --surface: #131318;
  --surface-2: #1B1B22;
  --text-primary: #F4F4F5;
  --text-muted: #A1A1AA;
  --accent: #A855F7;
  --accent-2: #EC4899;
  --accent-3: #22D3EE;
  --border-subtle: #26262C;
  --font-heading: "Geist", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;
  --nav-h: 72px;
  --content-w: 1248px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: none; cursor: pointer; }

::selection { background: rgba(168, 85, 247, 0.4); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #2a2a33; }

.container {
  width: 100%;
  max-width: calc(var(--content-w) + 96px);
  margin: 0 auto;
  padding: 0 48px;
}

/* ============ Custom cursor ============ */
.cursor-dot,
.cursor-ring,
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10000;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
}

.cursor-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(168, 85, 247, 0.55);
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, opacity 0.3s ease;
  display: grid;
  place-items: center;
}

.cursor-ring::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-2);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.cursor-ring.is-hover {
  width: 56px;
  height: 56px;
  border-color: rgba(236, 72, 153, 0.7);
}

.cursor-ring.is-hover::after { opacity: 1; }

.cursor-glow {
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, transparent 60%);
  transform: translate(-50%, -50%);
  z-index: 1;
}

@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring, .cursor-glow { display: none; }
}

@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a, button, .tilt, .stat, .project-card { cursor: none; }
}

/* ============ Noise overlay ============ */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  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.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ Reveal animation ============ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  will-change: opacity, transform;
}

.reveal.is-in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .count, .hero-line, .glow, .streak { animation: none !important; }
}

/* ============ Nav ============ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 1000;
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border-subtle);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-heading); font-weight: 600; font-size: 20px; letter-spacing: -0.02em; }

.logo-mark {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.55);
  animation: logoPulse 3.2s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(168, 85, 247, 0.45); }
  50% { box-shadow: 0 0 26px rgba(168, 85, 247, 0.85); }
}

.logo-suffix { color: var(--accent); }

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

.nav-link {
  position: relative;
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.3s ease;
  padding: 4px 0;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}

.nav-link:hover { color: var(--text-primary); }
.nav-link:hover::after { transform: scaleX(1); }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-toggle:hover {
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.12);
}

.lang-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 4px 10px;
  transition: color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.lang-btn:hover { color: var(--text-primary); }

.lang-btn.is-active {
  background: linear-gradient(135deg, var(--accent), #9333ea);
  color: #0A0A0B;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.5);
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  z-index: 1001;
}

.burger span {
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-primary);
  transition: transform 0.35s var(--ease-out), opacity 0.25s ease;
}

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

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  padding: 13px 26px;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s ease, background 0.35s ease, color 0.35s ease, border-color 0.35s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-sm { padding: 8px 16px; font-size: 14px; font-weight: 500; border-radius: 8px; }
.btn-lg { padding: 15px 34px; }

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #9333ea);
  color: #0A0A0B;
  box-shadow: 0 4px 24px rgba(168, 85, 247, 0.35);
}

.btn-accent::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s ease;
}

.btn-accent:hover::before { transform: translateX(120%); }

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(168, 85, 247, 0.55);
}

.btn-outline {
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.btn-outline:hover {
  border-color: var(--accent);
  background: rgba(168, 85, 247, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(168, 85, 247, 0.2);
}

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: calc(var(--nav-h) + 72px) 0 96px;
  overflow: hidden;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(20px);
  pointer-events: none;
  animation: float 14s ease-in-out infinite;
}

.glow-center {
  width: 900px;
  height: 470px;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(168, 85, 247, 0.19) 0%, rgba(168, 85, 247, 0) 70%);
}

.glow-right {
  width: 520px;
  height: 420px;
  top: 120px;
  right: -160px;
  background: radial-gradient(ellipse, rgba(236, 72, 153, 0.13) 0%, rgba(236, 72, 153, 0) 70%);
  animation-delay: -4s;
}

.glow-left {
  width: 460px;
  height: 380px;
  top: 220px;
  left: -160px;
  background: radial-gradient(ellipse, rgba(34, 211, 238, 0.09) 0%, rgba(34, 211, 238, 0) 70%);
  animation-delay: -8s;
}

@keyframes float {
  0%, 100% { translate: 0 0; }
  33% { translate: 30px -24px; }
  66% { translate: -24px 18px; }
}

.streak {
  position: absolute;
  height: 56px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.5;
  filter: blur(28px);
  animation: streakMove 11s ease-in-out infinite;
}

.streak-1 {
  width: 520px;
  top: 300px;
  left: -140px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
  transform: rotate(24deg);
}

.streak-2 {
  width: 420px;
  top: 420px;
  right: -120px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: rotate(-18deg);
  animation-delay: -5.5s;
}

@keyframes streakMove {
  0%, 100% { translate: 0 0; opacity: 0.35; }
  50% { translate: 40px -30px; opacity: 0.6; }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 28px;
}

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

@keyframes blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 10px var(--accent-3); }
  50% { opacity: 0.35; box-shadow: 0 0 2px var(--accent-3); }
}

.badge-text { font-size: 13px; color: var(--text-muted); font-family: var(--font-mono); }

.hero-title {
  font-family: var(--font-heading);
  font-size: 58px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.12;
  max-width: 1100px;
}

.hero-line { display: block; }

.hero-line-accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: gradientShift 6s linear infinite;
}

@keyframes gradientShift {
  to { background-position: 200% center; }
}

.hero-subtitle {
  margin-top: 24px;
  max-width: 560px;
  font-size: 17px;
  color: var(--text-muted);
}

.cta-row { display: flex; gap: 16px; margin-top: 40px; }

/* ============ Code window ============ */
.code-window {
  margin-top: 72px;
  width: 100%;
  max-width: 1080px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  text-align: left;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-subtle);
}

.traffic-lights { display: flex; gap: 7px; }

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

.light-red { background: #FF5F57; }
.light-yellow { background: #FEBC2E; }
.light-green { background: #28C840; }

.code-tab {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.code-body {
  position: relative;
  padding: 22px 26px 26px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.9;
}

.code-line {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  white-space: pre;
}

.code-line.is-typed { opacity: 1; transform: translateY(0); }

.code-indent { padding-left: 24px; }

.code-spacer { height: 14px; }

.t-comment { color: #4B4B52; font-style: italic; }
.t-keyword { color: var(--accent-2); }
.t-ident { color: var(--text-primary); }
.t-prop { color: var(--text-primary); }
.t-string { color: #34D399; }
.t-bool { color: #F59E0B; }
.t-punc { color: #6E6E76; }

.code-caret {
  position: absolute;
  bottom: 30px;
  left: 26px;
  width: 8px;
  height: 16px;
  background: var(--accent);
  animation: caretBlink 0.9s steps(1) infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.code-caret.is-visible { opacity: 1; }

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

/* ============ Stats ============ */
.stats { padding: 24px 0 96px; }

.stats-card {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 34px 24px;
}

.stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }

.stat-number {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.stat-number .count {
  background: linear-gradient(120deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.stat-divider { width: 1px; height: 52px; background: var(--border-subtle); }

/* ============ Projects ============ */
.projects { padding: 96px 0; }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 48px;
}

.title-column { display: flex; flex-direction: column; gap: 10px; }

.kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}

.section-title {
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.section-sub { font-size: 14px; color: var(--text-muted); }

.all-projects-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: color 0.3s ease, border-color 0.3s ease, gap 0.3s ease;
}

.all-projects-link:hover { color: var(--accent); border-color: var(--accent); gap: 14px; }

.all-projects-link .arrow {
  color: var(--accent);
  transition: transform 0.3s ease;
  font-size: 15px;
}

.cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.5s var(--ease-out), border-color 0.4s ease, box-shadow 0.4s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.project-card:hover {
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 20px 60px rgba(168, 85, 247, 0.18), 0 4px 20px rgba(0, 0, 0, 0.4);
}

.card-cover { overflow: hidden; aspect-ratio: 400 / 230; background: var(--surface-2); }

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out), filter 0.5s ease;
  filter: saturate(0.92) brightness(0.88);
}

.project-card:hover .card-cover img {
  transform: scale(1.06);
  filter: saturate(1.05) brightness(0.95);
}

.card-content { padding: 24px 26px 26px; }

.card-title {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.card-desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; min-height: 63px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 4px 10px;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.project-card:hover .tag { border-color: rgba(168, 85, 247, 0.4); color: #d8c6f5; }

/* ============ Skills ============ */
.skills { padding: 96px 0; }

.skills-header { margin-bottom: 48px; display: flex; flex-direction: column; gap: 10px; }

.columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.skill-column {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s var(--ease-out);
}

.skill-column:hover {
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 14px 44px rgba(168, 85, 247, 0.12);
  transform: translateY(-4px);
}

.column-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }

.column-mark { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 12px rgba(168, 85, 247, 0.7); }
.mark-pink { background: var(--accent-2); box-shadow: 0 0 12px rgba(236, 72, 153, 0.7); }
.mark-cyan { background: var(--accent-3); box-shadow: 0 0 12px rgba(34, 211, 238, 0.7); }

.column-name {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-primary);
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.3s var(--ease-out);
}

.skill-item:hover { transform: translateX(6px); }

.bullet { color: var(--accent); font-size: 13px; }

.skill-item:hover .bullet { color: var(--accent-2); }

.skill-label { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }

.skill-item:hover .skill-label { color: var(--text-primary); }

/* ============ Contact ============ */
.contact { padding: 96px 0 120px; }

.contact-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.contact-title {
  font-family: var(--font-heading);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  max-width: 780px;
}

.contact-sub { max-width: 520px; font-size: 16px; color: var(--text-muted); line-height: 1.6; }

.contact-inner .btn { margin-top: 12px; }

.contact-email {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.contact-email:hover { color: var(--accent-3); border-color: var(--accent-3); }

.contact-email.is-copied { color: #22c55e; border-color: #22c55e; }

/* ============ Footer ============ */
.footer { border-top: 1px solid var(--border-subtle); padding: 24px 0; }

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

.copyright { font-size: 13px; color: var(--text-muted); }

.footer-links { display: flex; gap: 28px; }

.footer-link {
  font-size: 13px;
  color: var(--text-muted);
  position: relative;
  padding-bottom: 2px;
  transition: color 0.3s ease;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.footer-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}

.footer-link:hover { color: var(--text-primary); }
.footer-link:hover::after { transform: scaleX(1); transform-origin: left; }

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .cards-row { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
  .columns { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
}

@media (max-width: 900px) {
  .container { padding: 0 24px; }
  .hero-title { font-size: 42px; }
  .contact-title { font-size: 34px; }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 80vw);
    background: rgba(19, 19, 24, 0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    padding: 40px 36px;
    transform: translateX(100%);
    transition: transform 0.45s var(--ease-out);
    border-left: 1px solid var(--border-subtle);
  }

  .nav-links.is-open { transform: translateX(0); }

  .nav-link { font-size: 20px; color: var(--text-primary); font-family: var(--font-heading); }

  .burger { display: flex; }
  .nav-cta { display: none; }
}

@media (max-width: 640px) {
  .hero { padding-top: calc(var(--nav-h) + 48px); }
  .hero-title { font-size: 32px; letter-spacing: -0.02em; }
  .hero-subtitle { font-size: 15px; }
  .cta-row { flex-direction: column; align-items: center; width: 100%; }
  .cta-row .btn { width: 100%; max-width: 320px; }
  .stats-card { flex-wrap: wrap; padding: 28px 12px; gap: 20px 0; }
  .stat { flex: 1 1 50%; }
  .stat-divider { display: none; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 20px; }
  .footer-inner { flex-direction: column; align-items: center; text-align: center; }
  .card-desc { min-height: 0; }
  .code-window { margin-top: 40px; }
  .code-body { font-size: 11.5px; line-height: 1.75; padding: 16px 14px 20px; overflow-x: auto; }
  .code-line { white-space: pre-wrap; word-break: break-word; }
  .code-indent { padding-left: 14px; }
  .code-spacer { height: 10px; }
  .code-caret { display: none; }
}

/* ============ Contact modal ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 2000;
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop.is-open { opacity: 1; visibility: visible; pointer-events: auto; }

.contact-modal {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 32px;
  position: relative;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.35s var(--ease-out);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.modal-backdrop.is-open .contact-modal { transform: translateY(0) scale(1); }

.contact-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  transition: all 0.25s ease;
}

.contact-modal-close svg { width: 16px; height: 16px; }

.contact-modal-close:hover { border-color: var(--accent); color: var(--accent); }

.contact-modal-title { font-family: var(--font-heading); font-size: 26px; letter-spacing: -0.02em; margin-top: 8px; }

.contact-modal-sub { color: var(--text-muted); margin-top: 8px; font-size: 14.5px; }

.contact-channels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 24px;
}

.contact-channel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 14px;
  transition: all 0.3s var(--ease-out);
}

.contact-channel:hover {
  border-color: var(--accent);
  background: rgba(168, 85, 247, 0.08);
  transform: translateY(-3px);
}

.contact-channel svg { width: 22px; height: 22px; }

.contact-channel.is-email svg { color: var(--accent-2); }
.contact-channel.is-telegram svg { color: var(--accent-3); }
.contact-channel.is-max svg { color: var(--accent); }

.contact-channel.is-copied {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
}

.contact-channel.is-copied svg { color: #22c55e; }

.contact-form { display: flex; flex-direction: column; gap: 16px; margin-top: 28px; }

.contact-form .field { display: flex; flex-direction: column; gap: 6px; }

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

.contact-form .field-label { font-size: 13px; color: var(--text-muted); font-family: var(--font-heading); }

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  transition: all 0.25s ease;
}

.contact-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A1A1AA' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.contact-form select option { background: var(--surface-2); color: var(--text-primary); }

.contact-form textarea { resize: vertical; min-height: 108px; line-height: 1.5; }

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.12);
}

.contact-form input.is-invalid,
.contact-form select.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.contact-form-btn { width: 100%; margin-top: 4px; }

body.modal-open { overflow: hidden; }

@media (max-width: 640px) {
  .contact-channels { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .contact-channel { padding: 12px 6px; gap: 5px; font-size: 12px; }
  .contact-channel svg { width: 18px; height: 18px; }
  .contact-form .field-row { grid-template-columns: 1fr; }
  .contact-modal { padding: 26px 20px; }
}

/* ============ Project card actions ============ */
.card-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ============ Project details modal ============ */
.project-modal {
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  position: relative;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.35s var(--ease-out);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.modal-backdrop.is-open .project-modal { transform: translateY(0) scale(1); }

.project-modal-cover {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 17px 17px 0 0;
  background: var(--bg);
}

.project-modal-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-modal-content { padding: 26px 30px 30px; }

.project-modal-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.project-modal-desc {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.65;
  margin-top: 14px;
  white-space: pre-line;
}

.project-modal-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 30px 0;
}

.project-modal-gallery:empty { display: none; }

.project-modal-thumb {
  width: 104px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border-subtle);
  padding: 0;
  background: var(--bg);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.project-modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-modal-thumb:hover { border-color: rgba(168, 85, 247, 0.6); transform: translateY(-2px); }

.project-modal-thumb.is-active { border-color: var(--accent); }

.project-modal-link { margin-top: 24px; display: inline-flex; align-items: center; gap: 8px; }

.project-modal-link[hidden] { display: none; }

@media (max-width: 640px) {
  .project-modal-content { padding: 22px 20px 26px; }
  .project-modal-gallery { padding: 12px 20px 0; }
  .project-modal-title { font-size: 21px; }
}

/* ============ Scroll progress bar ============ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 2001;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.65);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
  will-change: transform;
}

/* ============ Hero staggered entrance ============ */
.js .hero [data-hero] { opacity: 0; }

body.is-loaded .hero [data-hero] {
  animation: heroIn 0.9s var(--ease-out) both;
}

body.is-loaded .hero [data-hero="badge"] { animation-delay: 0.1s; }
body.is-loaded .hero [data-hero="title"] { animation-delay: 0.2s; }
body.is-loaded .hero [data-hero="sub"] { animation-delay: 0.34s; }
body.is-loaded .hero [data-hero="cta"] { animation-delay: 0.46s; }
body.is-loaded .hero [data-hero="code"] { animation-delay: 0.62s; }

@keyframes heroIn {
  from { opacity: 0; transform: translateY(28px); filter: blur(6px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* ============ Tech marquee ============ */
.marquee {
  position: relative;
  padding: 22px 0;
  overflow: hidden;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.05), transparent 35%, transparent 65%, rgba(236, 72, 153, 0.05));
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 34s linear infinite;
}

.marquee:hover .marquee-track { animation-play-state: paused; }

.marquee-group { display: flex; align-items: center; flex-shrink: 0; }

.marquee-item {
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 6px 24px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
}

.marquee-item::after {
  content: "✦";
  font-size: 10px;
  color: var(--accent);
  opacity: 0.75;
}

@keyframes marqueeScroll { to { transform: translateX(-50%); } }

/* ============ Spotlight hover ============ */
.project-card { position: relative; }

.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), rgba(168, 85, 247, 0.16), transparent 65%);
}

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

.card-cover, .card-content { position: relative; z-index: 2; }

.skill-column { position: relative; overflow: hidden; }

.skill-column::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(34, 211, 238, 0.1), transparent 65%);
}

.skill-column:hover::after { opacity: 1; }

.skill-column > * { position: relative; z-index: 1; }

/* ============ Animated code-window border ============ */
.code-window {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(120deg, rgba(168, 85, 247, 0.55), rgba(236, 72, 153, 0.45), rgba(34, 211, 238, 0.5), rgba(168, 85, 247, 0.55)) border-box;
  background-size: 320% 320%;
  animation: borderFlow 7s ease infinite;
  transition: box-shadow 0.5s ease;
}

.code-window:hover {
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 44px rgba(168, 85, 247, 0.22);
}

@keyframes borderFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ============ Button ripple ============ */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: rippleAnim 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes rippleAnim { to { transform: scale(3); opacity: 0; } }

/* ============ Nav CTA pulse ============ */
.nav-cta { animation: ctaPulse 3.2s ease-in-out infinite; }

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(168, 85, 247, 0.35); }
  50% { box-shadow: 0 4px 32px rgba(168, 85, 247, 0.65); }
}

/* ============ Mobile menu stagger ============ */
@media (max-width: 900px) {
  .nav-links.is-open .nav-link { animation: navLinkIn 0.45s var(--ease-out) both; }
  .nav-links.is-open .nav-link:nth-child(1) { animation-delay: 0.08s; }
  .nav-links.is-open .nav-link:nth-child(2) { animation-delay: 0.16s; }
  .nav-links.is-open .nav-link:nth-child(3) { animation-delay: 0.24s; }
  .nav-links.is-open .nav-link:nth-child(4) { animation-delay: 0.32s; }
}

@keyframes navLinkIn {
  from { opacity: 0; transform: translateX(26px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============ Channel icons ============ */
.contact-channel svg { transition: transform 0.35s var(--ease-out); }

.contact-channel:hover svg { transform: translateY(-2px) scale(1.15); }

/* ============ Reduced motion & responsive ============ */
@media (prefers-reduced-motion: reduce) {
  .scroll-progress, .marquee-track, .nav-cta, .code-window, .ripple { animation: none !important; }
  body.is-loaded .hero [data-hero] { animation: none; opacity: 1; }
}

@media (max-width: 640px) {
  .marquee { padding: 16px 0; }
  .marquee-item { gap: 32px; padding: 4px 16px; font-size: 12px; }
}
