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

:root {
  --bg:          #050508;
  --bg-2:        #0a0a14;
  --surface:     #0f0f1a;
  --surface-2:   #16162a;
  --border:      rgba(255,255,255,0.07);
  --text:        #f0f0f8;
  --text-muted:  #8888aa;
  --accent-1:    #6C63FF;
  --accent-2:    #00D4FF;
  --accent-3:    #FF6B9D;
  --accent-4:    #00FFB2;
  --gradient:    linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --gradient-2:  linear-gradient(135deg, var(--accent-3), var(--accent-1));
  --font-sans:   'Inter', system-ui, sans-serif;
  --font-display:'Syne', sans-serif;
  --radius:      16px;
  --radius-sm:   8px;
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}
body.loading { overflow: hidden; }

::selection { background: rgba(108,99,255,0.3); color: #fff; }

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

img, canvas { display: block; }

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

/* ============================================================
   PRELOADER
============================================================ */
#preloader {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}
#preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }

.preloader-inner {
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}
.preloader-logo {
  width: 72px; height: 72px;
  animation: preloader-spin 2s linear infinite;
}
@keyframes preloader-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.preloader-bar {
  width: 160px; height: 2px;
  background: var(--surface-2);
  border-radius: 1px; overflow: hidden;
}
.preloader-fill {
  height: 100%;
  background: var(--gradient);
  width: 0%;
  transition: width 0.1s linear;
  border-radius: 1px;
}

/* ============================================================
   CUSTOM CURSOR
============================================================ */
#cursor-outer {
  position: fixed;
  width: 40px; height: 40px;
  border: 1.5px solid rgba(108,99,255,0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out),
              border-color 0.3s, background 0.3s;
  mix-blend-mode: difference;
}
#cursor-inner {
  position: fixed;
  width: 6px; height: 6px;
  background: var(--accent-1);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.1s;
}
body.cursor-hover #cursor-outer {
  width: 60px; height: 60px;
  background: rgba(108,99,255,0.1);
  border-color: var(--accent-1);
}
body.cursor-text #cursor-outer { width: 4px; height: 24px; border-radius: 2px; }

/* ============================================================
   NAVBAR
============================================================ */
#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center;
  padding: 20px 5%;
  z-index: 100;
  transition: padding 0.3s var(--ease-out), background 0.3s, backdrop-filter 0.3s;
}
#navbar.scrolled {
  padding: 14px 5%;
  background: rgba(5,5,8,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-logo { margin-right: auto; cursor: pointer; }
.nav-logo svg { transition: transform 0.3s var(--ease-spring); }
.nav-logo:hover svg { transform: rotate(30deg) scale(1.1); }

.nav-links {
  display: flex; gap: 36px; list-style: none;
  margin-right: 40px;
}
.nav-links a {
  font-size: 0.875rem; font-weight: 500;
  color: var(--text-muted);
  position: relative;
  transition: color 0.3s;
  letter-spacing: 0.02em;
}
.nav-links a::after {
  content: '';
  position: absolute; bottom: -4px; left: 0;
  width: 0%; height: 1px;
  background: var(--gradient);
  transition: width 0.3s var(--ease-out);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  padding: 10px 22px;
  background: var(--gradient);
  border-radius: 100px;
  font-size: 0.875rem; font-weight: 600;
  letter-spacing: 0.02em;
  transition: opacity 0.3s, transform 0.3s var(--ease-spring), box-shadow 0.3s;
}
.nav-cta:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108,99,255,0.4);
}

.nav-hamburger {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none;
  cursor: none; padding: 4px;
}
.nav-hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Menu */
#mobile-menu {
  position: fixed; inset: 0;
  background: rgba(5,5,8,0.97);
  backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center;
  z-index: 99;
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
}
#mobile-menu.open { opacity: 1; visibility: visible; }
#mobile-menu ul { list-style: none; text-align: center; }
#mobile-menu li { margin: 20px 0; }
#mobile-menu a {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 800;
  color: var(--text-muted);
  transition: color 0.3s;
}
#mobile-menu a:hover { color: var(--text); }

/* ============================================================
   CONTAINERS & LAYOUT
============================================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5%;
}

section { position: relative; }

.section-label {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--accent-1);
  margin-bottom: 16px;
}
.section-label::before {
  content: '';
  display: block;
  width: 24px; height: 1px;
  background: var(--accent-1);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 48px;
}

.section-header { margin-bottom: 64px; }

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   REVEAL ANIMATIONS
============================================================ */
.reveal-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   HERO
============================================================ */
#hero {
  min-height: 100vh;
  display: flex; align-items: center;
  position: relative; overflow: hidden;
}

#hero-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.hero-content {
  position: relative; z-index: 2;
  padding: 120px 0 80px;
  max-width: 900px;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  background: rgba(108,99,255,0.1);
  border: 1px solid rgba(108,99,255,0.3);
  border-radius: 100px;
  font-size: 0.8rem; font-weight: 500;
  color: var(--accent-2);
  margin-bottom: 32px;
  animation: fadeSlideDown 0.8s var(--ease-out) 0.5s both;
}
.badge-dot {
  width: 7px; height: 7px;
  background: var(--accent-4);
  border-radius: 50%;
  animation: pulse-dot 2s ease infinite;
}
@keyframes pulse-dot {
  0%,100% { box-shadow: 0 0 0 0 rgba(0,255,178,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(0,255,178,0); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
  overflow: hidden;
}
.title-line {
  display: block;
  padding-right: 0.05em; /* Avoid clipping the last character of wide fonts */
  animation: titleReveal 1s var(--ease-out) both;
  position: relative;
}
.title-line:nth-child(1) { animation-delay: 0.6s; }
.title-line:nth-child(2) { animation-delay: 0.75s; }
.title-line:nth-child(3) { animation-delay: 0.9s; }

/* Glitch Effect Styles */
.title-line.glitch::before,
.title-line.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--bg);
  clip: rect(0, 0, 0, 0);
}
.title-line.glitch::before {
  left: 3px;
  text-shadow: -2px 0 var(--accent-3);
  animation: glitch-anim-1 0.3s linear infinite;
}
.title-line.glitch::after {
  left: -3px;
  text-shadow: -2px 0 var(--accent-2), 2px 2px var(--accent-1);
  animation: glitch-anim-2 0.3s linear infinite;
}
.title-line.gradient-text.glitch::before,
.title-line.gradient-text.glitch::after {
  background: var(--bg);
  -webkit-background-clip: unset;
  background-clip: unset;
  -webkit-text-fill-color: var(--text);
}

@keyframes glitch-anim-1 {
  0% { clip-path: inset(40% 0 61% 0); }
  20% { clip-path: inset(92% 0 1% 0); }
  40% { clip-path: inset(15% 0 80% 0); }
  60% { clip-path: inset(80% 0 5% 0); }
  80% { clip-path: inset(5% 0 92% 0); }
  100% { clip-path: inset(40% 0 61% 0); }
}
@keyframes glitch-anim-2 {
  0% { clip-path: inset(25% 0 58% 0); }
  20% { clip-path: inset(14% 0 80% 0); }
  40% { clip-path: inset(64% 0 26% 0); }
  60% { clip-path: inset(5% 0 92% 0); }
  80% { clip-path: inset(82% 0 2% 0); }
  100% { clip-path: inset(25% 0 58% 0); }
}

@keyframes titleReveal {
  from { opacity: 0; transform: translateY(60px) skewY(3deg); }
  to   { opacity: 1; transform: translateY(0) skewY(0); }
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 540px;
  margin-bottom: 40px;
  animation: fadeSlideDown 1s var(--ease-out) 1.1s both;
  line-height: 1.7;
}
.hero-subtitle em { font-style: normal; color: var(--text); font-weight: 500; }

.hero-actions {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-bottom: 64px;
  animation: fadeSlideDown 1s var(--ease-out) 1.5s both;
}

.hero-stat-highlight {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
  animation: fadeSlideDown 1s var(--ease-out) 1.3s both;
}
.hero-stat-highlight .stat-num {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8vw, 5.5rem);
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 0.9;
  letter-spacing: -0.02em;
}
.hero-stat-highlight .stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  line-height: 1.3;
}

.hero-scroll-indicator {
  position: absolute; bottom: 40px; right: 5%;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-muted);
  animation: fadeSlideDown 1s var(--ease-out) 2s both;
}
.scroll-line {
  width: 1px; height: 48px;
  background: linear-gradient(to bottom, var(--accent-1), transparent);
  animation: scroll-pulse 2s ease infinite;
}
@keyframes scroll-pulse {
  0%,100% { opacity: 1; transform: scaleY(1); }
  50%      { opacity: 0.4; transform: scaleY(0.7); }
}

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  border-radius: 100px;
  font-size: 0.9rem; font-weight: 600;
  letter-spacing: 0.02em;
  border: none; cursor: none;
  position: relative; overflow: hidden;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s, opacity 0.3s;
}
.btn svg { width: 18px; height: 18px; transition: transform 0.3s var(--ease-spring); }
.btn:hover svg { transform: translateX(4px); }

.btn-primary {
  background: var(--gradient);
  color: #fff;
}
.btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #00D4FF, #6C63FF);
  opacity: 0;
  transition: opacity 0.4s;
}
.btn-primary:hover { box-shadow: 0 12px 40px rgba(108,99,255,0.5); }
.btn-primary:hover::before { opacity: 1; }
.btn-primary span, .btn-primary svg { position: relative; z-index: 1; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: rgba(108,99,255,0.5);
  box-shadow: 0 0 30px rgba(108,99,255,0.1);
}

/* Magnetic effect applied via JS */
.magnetic { transition: transform 0.3s var(--ease-out); }

/* ============================================================
   ABOUT
============================================================ */
#about {
  padding: 140px 0;
  overflow: hidden;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about-visual { position: relative; }

.about-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4/5;
}

.about-image-placeholder {
  width: 100%; height: 100%;
  border-radius: 24px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
}
.about-image-placeholder canvas {
  width: 100%; height: 100%;
}

.about-tag {
  position: absolute;
  padding: 10px 18px;
  background: rgba(10,10,20,0.8);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem; font-weight: 600;
  white-space: nowrap;
  animation: float-tag 4s ease-in-out infinite;
}
.tag-1 { top: 10%; right: -8%; animation-delay: 0s; }
.tag-2 { bottom: 30%; right: -12%; animation-delay: 1.2s; }
.tag-3 { bottom: 10%; left: -5%; animation-delay: 2.4s; }
@keyframes float-tag {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.about-text .section-label { display: flex; }
.about-body {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 20px;
}

.about-signature {
  display: flex; align-items: center; gap: 16px;
  margin-top: 32px;
  color: var(--text-muted); font-size: 0.9rem;
}
.signature-svg { width: 120px; }
.signature-svg path {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  transition: stroke-dashoffset 1.5s var(--ease-out);
}
.about-signature.visible .signature-svg path { stroke-dashoffset: 0; }

/* ============================================================
   SKILLS
============================================================ */
#skills { padding: 140px 0; background: var(--bg-2); }

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

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  position: relative; overflow: hidden;
  transition: border-color 0.3s, transform 0.3s var(--ease-spring), box-shadow 0.3s;
  cursor: default;
}
.skill-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(108,99,255,0.08), transparent 70%);
  opacity: 0; transition: opacity 0.4s;
}
.skill-card:hover {
  border-color: rgba(108,99,255,0.4);
  transform: translateY(-6px);
  box-shadow: 0 24px 60px rgba(108,99,255,0.15);
}
.skill-card:hover::before { opacity: 1; }

.skill-icon {
  width: 52px; height: 52px;
  margin-bottom: 20px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  padding: 10px;
}
.skill-icon svg { width: 32px; height: 32px; }

.skill-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 700;
  margin-bottom: 8px;
}
.skill-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; }

.skill-bar {
  height: 3px;
  background: var(--surface-2);
  border-radius: 2px; overflow: hidden;
}
.skill-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 2px;
  width: 0%;
  transition: width 1.2s var(--ease-out);
}

/* ============================================================
   PROJECTS
============================================================ */
#projects { padding: 140px 0; }

.projects-list { display: flex; flex-direction: column; gap: 2px; }

.project-card {
  display: grid;
  grid-template-columns: 80px 1fr 380px;
  gap: 0;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  transition: border-color 0.4s, box-shadow 0.4s;
  position: relative;
}
.project-card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 3px; height: 0%;
  background: var(--gradient);
  transition: height 0.4s var(--ease-out);
}
.project-card:hover { border-color: rgba(108,99,255,0.3); box-shadow: 0 30px 80px rgba(0,0,0,0.4); }
.project-card:hover::before { height: 100%; }

.project-meta {
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  padding: 36px 16px;
  border-right: 1px solid var(--border);
  gap: 8px;
}
.project-number {
  font-family: var(--font-display);
  font-size: 0.7rem; font-weight: 700;
  color: var(--accent-1); letter-spacing: 0.1em;
}
.project-year { font-size: 0.7rem; color: var(--text-muted); writing-mode: vertical-rl; letter-spacing: 0.1em; }

.project-content { padding: 36px 40px; display: flex; flex-direction: column; justify-content: center; }

.project-tags {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.project-tags span {
  padding: 4px 12px;
  background: rgba(108,99,255,0.1);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: 100px;
  font-size: 0.72rem; font-weight: 500;
  color: var(--accent-1);
}

.project-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  transition: color 0.3s;
}
.project-card:hover .project-title { color: var(--accent-2); }

.project-desc {
  font-size: 0.9rem; color: var(--text-muted); line-height: 1.7;
  margin-bottom: 28px;
}

.project-links { display: flex; align-items: center; gap: 20px; }
.project-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.85rem; font-weight: 600; color: var(--text);
  transition: color 0.3s, gap 0.3s;
}
.project-link svg { width: 16px; height: 16px; transition: transform 0.3s var(--ease-spring); }
.project-link:hover { color: var(--accent-1); gap: 12px; }
.project-link:hover svg { transform: translateX(4px); }

.project-link-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border-radius: 50%; color: var(--text-muted);
  transition: color 0.3s, background 0.3s, transform 0.3s var(--ease-spring);
}
.project-link-icon:hover { color: var(--text); background: var(--surface-2); transform: scale(1.15); }
.project-link-icon svg { width: 17px; height: 17px; }

.project-visual {
  position: relative; overflow: hidden;
  background: var(--bg);
  min-height: 260px;
}
.project-canvas-wrap { width: 100%; height: 100%; }
.project-canvas-wrap canvas { width: 100% !important; height: 100% !important; }

.projects-cta { display: flex; justify-content: center; margin-top: 48px; }

/* ============================================================
   EXPERIENCE / TIMELINE
============================================================ */
#experience { padding: 140px 0; background: var(--bg-2); }

.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}
.timeline-line {
  position: absolute; left: 50%; top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--accent-1) 20%, var(--accent-1) 80%, transparent);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  width: calc(50% - 40px);
  margin-bottom: 60px;
}
.timeline-item[data-side="left"]  { margin-left: 0; margin-right: auto; }
.timeline-item[data-side="right"] { margin-left: auto; margin-right: 0; }

.timeline-dot {
  position: absolute; top: 24px;
  width: 12px; height: 12px;
  background: var(--accent-1);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(108,99,255,0.6);
  animation: dot-pulse 2s ease infinite;
}
.timeline-item[data-side="left"]  .timeline-dot { right: -56px; }
.timeline-item[data-side="right"] .timeline-dot { left: -56px; }

@keyframes dot-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(108,99,255,0.5); }
  50%      { box-shadow: 0 0 0 8px rgba(108,99,255,0); }
}

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  transition: border-color 0.3s, transform 0.3s var(--ease-spring), box-shadow 0.3s;
}
.timeline-card:hover {
  border-color: rgba(108,99,255,0.3);
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.timeline-period {
  font-size: 0.75rem; font-weight: 600;
  color: var(--accent-1); letter-spacing: 0.08em;
  text-transform: uppercase;
}
.timeline-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 700;
  margin: 8px 0 4px;
}
.timeline-company {
  font-size: 0.85rem; color: var(--text-muted);
  display: block; margin-bottom: 12px;
}
.timeline-card p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 16px; }
.timeline-skills { display: flex; gap: 8px; flex-wrap: wrap; }
.timeline-skills span {
  padding: 3px 10px;
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 100px;
  font-size: 0.72rem; font-weight: 500;
  color: var(--accent-2);
}

/* ============================================================
   CONTACT
============================================================ */
#contact {
  padding: 140px 0;
  position: relative; overflow: hidden;
}
#contact-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; opacity: 0.4;
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px; align-items: center;
  position: relative; z-index: 1;
}

.contact-text .section-title { margin-bottom: 20px; }
.contact-text p { color: var(--text-muted); font-size: 1rem; line-height: 1.7; margin-bottom: 40px; }

.contact-links { display: flex; flex-direction: column; gap: 16px; }
.contact-link {
  display: inline-flex; align-items: center; gap: 14px;
  color: var(--text-muted); font-size: 0.9rem;
  transition: color 0.3s, gap 0.3s;
}
.contact-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.contact-link:hover { color: var(--text); gap: 18px; }

/* Glassmorphism Form */
.glass-card {
  background: rgba(15,15,26,0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 40px;
}

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

.form-group {
  position: relative;
}
.form-group input,
.form-group textarea {
  width: 100%;
  background: transparent;
  border: none; border-bottom: 1px solid var(--border);
  padding: 12px 0;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  resize: none;
  transition: border-color 0.3s;
}
.form-group textarea { min-height: 100px; }
.form-group label {
  position: absolute; top: 12px; left: 0;
  font-size: 0.85rem; color: var(--text-muted);
  pointer-events: none;
  transition: top 0.3s, font-size 0.3s, color 0.3s;
}
.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
  top: -14px; font-size: 0.72rem; color: var(--accent-1);
}
.form-line {
  position: absolute; bottom: 0; left: 0;
  width: 0%; height: 1px;
  background: var(--gradient);
  transition: width 0.4s var(--ease-out);
}
.form-group input:focus ~ .form-line,
.form-group textarea:focus ~ .form-line { width: 100%; }

.form-submit { width: 100%; justify-content: center; }

/* ============================================================
   FOOTER
============================================================ */
#footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.footer-brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
}
.footer-copy { font-size: 0.8rem; color: var(--text-muted); }
.footer-links a {
  font-size: 0.8rem; color: var(--text-muted);
  transition: color 0.3s;
}
.footer-links a:hover { color: var(--text); }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1024px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .project-card { grid-template-columns: 60px 1fr; }
  .project-visual { display: none; }
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .about-visual { max-width: 400px; margin: 0 auto; }
}

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

  .hero-stats { flex-wrap: wrap; gap: 20px; }
  .stat-divider { display: none; }

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

  .timeline-line { left: 20px; }
  .timeline-item { width: 100%; padding-left: 56px; margin-left: 0 !important; margin-right: 0 !important; }
  .timeline-item .timeline-dot { left: 14px !important; right: auto !important; }

  .contact-inner { grid-template-columns: 1fr; gap: 48px; }

  .footer-inner { flex-direction: column; text-align: center; }

  .hero-title { font-size: clamp(2.4rem, 12vw, 4rem); }
}

@media (max-width: 480px) {
  .project-card { grid-template-columns: 1fr; }
  .project-meta { flex-direction: row; padding: 20px 24px 0; border-right: none; border-bottom: 1px solid var(--border); }
  .project-year { writing-mode: horizontal-tb; }
  .glass-card { padding: 24px 20px; }
  .hero-actions { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   NOISE TEXTURE OVERLAY
============================================================ */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 9999;
}

/* ============================================================
   NAV ACTIVE LINK (scroll-spy)
============================================================ */
.nav-links a.active { color: var(--text); }
.nav-links a.active::after { width: 100%; }

/* ============================================================
   CONTACT FORM STATUS
============================================================ */
.form-status {
  font-size: 0.85rem;
  line-height: 1.5;
  min-height: 1.2em;
  margin-top: -8px;
  color: var(--text-muted);
  transition: color 0.3s;
}
.form-status.ok    { color: var(--accent-4); }
.form-status.error { color: var(--accent-3); }

/* ============================================================
   KEYBOARD FOCUS (accessibility)
============================================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================================
   TOUCH / NO-HOVER DEVICES
   The custom cursor is useless without a real pointer —
   restore the native cursor and hide the custom one.
============================================================ */
@media (hover: none), (pointer: coarse) {
  body { cursor: auto; }
  #cursor-outer, #cursor-inner { display: none; }
  a, button, .btn, .nav-hamburger, .project-link, .magnetic { cursor: pointer; }
  input, textarea { cursor: text; }
}

/* ============================================================
   REDUCED MOTION (accessibility)
   Honor the OS "reduce motion" setting: stop animations,
   reveal content immediately, restore the native cursor.
============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html { scroll-behavior: auto; }
  body { cursor: auto; }
  #cursor-outer, #cursor-inner { display: none; }
  .reveal-up { opacity: 1 !important; transform: none !important; }
  .skill-fill { transition: none !important; }
}
