:root {
  --bg: #0a0e14;
  --bg-soft: #10151d;
  --surface: #131a24;
  --border: #212b38;
  --text: #e8ecf1;
  --text-muted: #8b96a5;
  --accent: #2fe0c9;
  --accent-dim: #1a8f7e;
  --accent-2: #ffb454;
  --accent-3: #8b7cf6;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --ease: cubic-bezier(.22,1,.36,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

.mono { font-family: var(--font-mono); letter-spacing: 0.04em; }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* film grain, whisper level */
.grain {
  position: fixed; inset: 0; z-index: 500; pointer-events: none;
  opacity: 0.03; mix-blend-mode: overlay;
  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.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- NAV ---------- */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 5vw;
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
nav.scrolled {
  background: rgba(10,14,20,0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-mark {
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
  color: var(--text);
}
.nav-mark span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
  font-size: 0.92rem; color: var(--text-muted);
  transition: color 0.25s var(--ease);
  position: relative;
}
.nav-links a:not(.nav-cta)::after {
  content: ''; position: absolute; left: 0; bottom: -4px; width: 0; height: 1px;
  background: var(--accent); transition: width 0.3s var(--ease);
}
.nav-links a:not(.nav-cta):hover { color: var(--text); }
.nav-links a:not(.nav-cta):hover::after { width: 100%; }
.nav-cta {
  border: 1px solid var(--border); padding: 8px 16px; border-radius: 30px;
  font-size: 0.85rem; color: var(--text) !important;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav-cta:hover { border-color: var(--accent); background: rgba(47,224,201,0.08); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; z-index: 110;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  padding: 0 5vw; overflow: hidden;
}
#net {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0;
  opacity: 0.55;
}
.hero-inner { position: relative; z-index: 1; max-width: 900px; padding-top: 60px; }

.eyebrow {
  display: flex; align-items: center; gap: 10px;
  color: var(--accent); font-size: 0.85rem; margin-bottom: 26px;
  opacity: 0; animation: fadeUp 0.8s var(--ease) 0.15s forwards;
}
.eyebrow span:first-child { color: var(--text-muted); }
.cycle { color: var(--accent); min-width: 8ch; display: inline-block; }
.cursor { animation: blink 1s steps(1) infinite; color: var(--accent); }

.hero-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 1.08;
  letter-spacing: -0.02em;
  opacity: 0; animation: fadeUp 0.9s var(--ease) 0.3s forwards;
}
.hero-title em {
  font-style: normal; color: var(--accent);
  text-shadow: 0 0 30px rgba(47,224,201,0.35);
}
.hero-sub {
  margin-top: 26px; max-width: 620px; color: var(--text-muted);
  font-size: 1.08rem;
  opacity: 0; animation: fadeUp 0.9s var(--ease) 0.5s forwards;
}
.hero-actions {
  margin-top: 42px; display: flex; gap: 18px; flex-wrap: wrap;
  opacity: 0; animation: fadeUp 0.9s var(--ease) 0.7s forwards;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 30px; border-radius: 40px; font-size: 0.95rem; font-weight: 500;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease), border-color 0.35s var(--ease);
}
.btn-primary {
  background: var(--accent); color: #05130f;
  box-shadow: 0 0 0 rgba(47,224,201,0);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(47,224,201,0.25); }
.btn-ghost {
  border: 1px solid var(--border); color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-2px); }
.btn-large { margin-top: 48px; padding: 16px 40px; font-size: 1rem; }

.scroll-cue {
  position: absolute; bottom: 40px; left: 5vw; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--text-muted); font-size: 0.7rem;
  opacity: 0; animation: fadeUp 0.9s var(--ease) 1s forwards;
}
.scroll-line {
  width: 1px; height: 50px; background: linear-gradient(var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(18px);} to { opacity: 1; transform: translateY(0);} }
@keyframes blink { 50% { opacity: 0; } }
@keyframes scrollPulse { 0%,100% { transform: scaleY(1); opacity: 0.6; } 50% { transform: scaleY(0.6); opacity: 1; } }

/* ---------- SECTIONS ---------- */
.section { position: relative; padding: 140px 5vw; scroll-margin-top: 84px; }
.section-inner { max-width: 1100px; margin: 0 auto; }
.tag {
  display: inline-block; color: var(--accent); font-size: 0.78rem; margin-bottom: 18px;
}
.section h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -0.01em;
  max-width: 700px;
}

[data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

.two-col { display: grid; grid-template-columns: 200px 1fr; gap: 40px; }
.col-body p { color: var(--text-muted); max-width: 620px; margin-top: 20px; font-size: 1.05rem; }
.col-body h2 { margin-bottom: 8px; }
.col-body strong { color: var(--accent); }

/* ---------- SKILLS ---------- */
.skills-grid {
  margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
}
.skill-card {
  background: var(--bg-soft); padding: 34px 28px; transition: background 0.3s var(--ease), transform 0.35s var(--ease);
  transition-delay: 0s;
}
.skill-card:hover { background: var(--surface); transform: translateY(-4px); }
.skill-icon {
  display: inline-block; color: var(--accent-dim); font-size: 0.75rem; margin-bottom: 16px;
  border: 1px solid var(--border); padding: 3px 8px; border-radius: 20px;
}
.skill-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; margin-bottom: 10px; }
.skill-card p { color: var(--text-muted); font-size: 0.92rem; }

/* ---------- TIMELINE ---------- */
.timeline { position: relative; margin-top: 60px; padding-left: 44px; }
.timeline-line {
  position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; height: calc(100% - 12px);
  overflow: visible;
}
.timeline-line line {
  stroke: var(--accent); stroke-width: 2;
  stroke-dasharray: 100; stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.1s linear;
  vector-effect: non-scaling-stroke;
}
.timeline-item { position: relative; padding-bottom: 64px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -50px; top: 4px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent-dim);
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.timeline-item.is-visible .timeline-dot {
  border-color: var(--accent); box-shadow: 0 0 14px rgba(47,224,201,0.55);
}
.timeline-date { color: var(--accent); font-size: 0.75rem; }
.timeline-item h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; margin: 10px 0 16px; }
.timeline-item ul li {
  color: var(--text-muted); position: relative; padding-left: 20px; margin-bottom: 10px; font-size: 0.98rem;
}
.timeline-item ul li::before {
  content: ''; position: absolute; left: 0; top: 0.6em; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-dim);
}

.education { margin-top: 90px; padding-top: 50px; border-top: 1px solid var(--border); }
.edu-grid { margin-top: 26px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.edu-grid h4 { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 8px; }
.edu-grid p { color: var(--text-muted); font-size: 0.82rem; }

/* ---------- CONTACT ---------- */
.contact-section { background: var(--bg-soft); overflow: hidden; }
#netFooter { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.35; }
.contact-section .section-inner { position: relative; z-index: 1; text-align: center; }
.contact-title { margin: 0 auto 18px; font-size: clamp(2.2rem, 5vw, 3.4rem); }
.contact-sub { color: var(--text-muted); max-width: 560px; margin: 0 auto; font-size: 1.05rem; }

.contact-grid {
  margin: 56px auto 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; max-width: 720px;
}
.contact-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 24px; text-align: left; cursor: pointer; font-family: inherit;
  color: var(--text);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.contact-card span.mono { color: var(--accent); font-size: 0.7rem; }
.contact-card strong { font-size: 1rem; font-weight: 500; word-break: break-word; }
.copy-hint { color: var(--text-muted) !important; font-size: 0.65rem !important; }

/* ---------- FOOTER ---------- */
.site-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 30px 5vw; color: var(--text-muted); font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ---------- TOAST ---------- */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--accent); color: #05130f; padding: 12px 24px; border-radius: 30px;
  font-size: 0.85rem; font-weight: 500; opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease); z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .edu-grid { grid-template-columns: 1fr; gap: 22px; }
  .contact-grid { grid-template-columns: 1fr; }
  .nav-links {
    position: fixed; top: 0; right: 0; height: 100vh; width: min(78vw, 320px);
    background: rgba(10,14,20,0.98); backdrop-filter: blur(20px);
    flex-direction: column; justify-content: center; align-items: flex-start;
    padding: 40px; gap: 26px; transform: translateX(100%);
    transition: transform 0.4s var(--ease); border-left: 1px solid var(--border);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-toggle { display: flex; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (max-width: 560px) {
  .skills-grid { grid-template-columns: 1fr; }
  .section { padding: 100px 6vw; }
}

@media (max-height: 700px) {
  .scroll-cue { display: none; }
  .hero { min-height: auto; padding-top: 120px; padding-bottom: 60px; }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  #net, #netFooter { display: none; }
}
