/* ===== Tokens ===== */
:root {
  --bg: #08080c;
  --bg-alt: #0e0e15;
  --panel: #131320;
  --panel-border: #24243a;
  --text: #eceaf5;
  --text-dim: #9491ab;
  --text-faint: #5c5a73;
  --violet: #8b6bff;
  --violet-dim: #5c46b3;
  --amber: #f5b942;
  --green: #4ade80;
  --red: #ff6b6b;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 10px;
}

* { 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;
}

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

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* faint grid backdrop */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(139,107,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139,107,255,0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

/* ===== Nav ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(8,8,12,0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.navbar.scrolled { border-bottom-color: var(--panel-border); background: rgba(8,8,12,0.92); }

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  gap: 40px;
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}
.nav-logo .dot { color: var(--amber); }

.nav-links {
  display: flex;
  gap: 28px;
  margin-right: auto;
}
.nav-links a {
  font-size: 0.88rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  transition: color 0.2s ease;
  position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links .nav-links-cta { display: none; }

.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  border: 1px solid var(--panel-border);
  padding: 8px 16px;
  border-radius: 100px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.nav-cta:hover { border-color: var(--violet); color: var(--violet); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); }

/* ===== Hero ===== */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 140px 32px 80px;
  max-width: 1200px;
  margin: 0 auto;
}
.hero-inner { max-width: 720px; }

.hero-eyebrow {
  font-family: var(--font-mono);
  color: var(--text-faint);
  font-size: 0.85rem;
  margin-bottom: 18px;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.hero-role {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  color: var(--text-dim);
  margin-bottom: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
}
.role-prefix { color: var(--text-faint); }
.role-cycle { color: var(--amber); font-weight: 500; }
.cursor { color: var(--violet); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 560px;
  margin-bottom: 36px;
}

.hero-actions { display: flex; gap: 14px; margin-bottom: 40px; flex-wrap: wrap; }

.btn {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 13px 26px;
  border-radius: 100px;
  display: inline-block;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--violet);
  color: #0a0a12;
  font-weight: 600;
}
.btn-primary:hover { box-shadow: 0 0 0 4px rgba(139,107,255,0.18); transform: translateY(-1px); }
.btn-ghost {
  border-color: var(--panel-border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }
.btn-full { width: 100%; text-align: center; border: none; cursor: pointer; }

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.hero-link { color: var(--text-dim); transition: color 0.2s ease; }
.hero-link:hover { color: var(--violet); }

/* console */
/* keep intro text clear of the right-hand column on narrower desktop windows */
@media (min-width: 981px) {
  .hero-inner { max-width: min(720px, calc(100% - 412px)); }
}

/* right-hand column: photo on top, console below */
.hero-visual {
  position: absolute;
  right: 32px;
  top: 111px;
  width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px;
}

/* circular photo frame */
.hero-photo {
  width: 260px;
  height: 260px;
  padding: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--amber));
  box-shadow: 0 0 0 8px rgba(139,107,255,0.08), 0 18px 50px rgba(139,107,255,0.25);
  flex-shrink: 0;
}
.hero-photo-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--panel);
  border: 4px solid var(--bg);
}
.hero-photo-inner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
.hero-photo-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 4.4rem;
  color: var(--violet);
}

.hero-console {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.console-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--panel-border);
  background: #0d0d17;
}
.console-dot { width: 10px; height: 10px; border-radius: 50%; }
.console-dot.red { background: var(--red); }
.console-dot.amber { background: var(--amber); }
.console-dot.green { background: var(--green); }
.console-title { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); margin-left: 8px; }
.console-body {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  padding: 18px 16px;
  min-height: 220px;
  white-space: pre-wrap;
  line-height: 1.7;
}
.console-body .kw { color: var(--violet); }
.console-body .str { color: var(--amber); }
.console-body .out { color: var(--green); }

.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.scroll-line { width: 40px; height: 1px; background: var(--text-faint); position: relative; overflow: hidden; }
.scroll-line::after {
  content: '';
  position: absolute; left: -40px; top: 0;
  width: 40px; height: 1px; background: var(--violet);
  animation: scrollmove 2s ease-in-out infinite;
}
@keyframes scrollmove { 50% { left: 100%; } 100% { left: 100%; } }

@media (max-width: 980px) {
  .hero-console { display: none; }
  .hero {
    justify-content: flex-start;
    padding: 118px 32px 110px;
  }
  .hero-visual {
    position: static;
    width: auto;
    gap: 0;
  }
  .hero-photo { width: 190px; height: 190px; }
  .hero-photo-fallback { font-size: 3rem; }
}

/* half-width windows / tablets: photo sits to the right of the intro text */
@media (min-width: 601px) and (max-width: 980px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 32px;
    align-content: start;
  }
  .hero-inner { grid-column: 1; grid-row: 1; }
  .hero-visual { grid-column: 2; grid-row: 1; align-self: start; margin-top: 8px; }
}

/* phones: photo stacks above the intro text */
@media (max-width: 600px) {
  .hero-visual { order: -1; align-self: flex-start; margin-bottom: 26px; }
  .hero-photo { width: 140px; height: 140px; }
  .hero-photo-fallback { font-size: 2.4rem; }
}

/* ===== Sections ===== */
.section { position: relative; z-index: 1; padding: 110px 32px; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--panel-border); border-bottom: 1px solid var(--panel-border); }
.section-inner { max-width: 1100px; margin: 0 auto; }

.eyebrow {
  font-family: var(--font-mono);
  color: var(--violet);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 600;
  margin-bottom: 40px;
  max-width: 700px;
}

/* About */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 60px; align-items: start; }
.about-text h2 { margin-bottom: 22px; }
.about-text p { color: var(--text-dim); margin-bottom: 16px; max-width: 520px; }

.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 22px 18px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.stat-card:hover { border-color: var(--violet-dim); transform: translateY(-2px); }
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: 6px;
}
.stat-label { font-size: 0.85rem; color: var(--text-dim); }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.skill-col h3 {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--violet);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.skill-col ul li {
  padding: 10px 0;
  border-bottom: 1px solid var(--panel-border);
  color: var(--text-dim);
  font-size: 0.95rem;
}
.skill-col ul li:hover { color: var(--text); }

/* Experience timeline */
.timeline { border-left: 1px solid var(--panel-border); margin-left: 6px; }
.timeline-item {
  position: relative;
  padding: 0 0 48px 34px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -6px; top: 4px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--violet);
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--amber);
}
.timeline-content h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 8px 0 12px;
  font-weight: 600;
}
.timeline-org { color: var(--text-dim); font-weight: 400; font-size: 1rem; }
.timeline-content ul li {
  color: var(--text-dim);
  font-size: 0.95rem;
  padding: 5px 0;
  padding-left: 18px;
  position: relative;
}
.timeline-content ul li::before {
  content: '—';
  position: absolute; left: 0; color: var(--text-faint);
}

/* Projects */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.project-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.project-card:hover { border-color: var(--violet-dim); transform: translateY(-4px); }
.project-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.project-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--amber);
  background: rgba(245,185,66,0.08);
  padding: 4px 10px;
  border-radius: 100px;
}
.project-link { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); }
.project-link:hover { color: var(--violet); }
.project-card h3 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 12px; }
.project-card p { color: var(--text-dim); font-size: 0.92rem; margin-bottom: 20px; flex-grow: 1; }
.project-stack { display: flex; flex-wrap: wrap; gap: 8px; }
.project-stack span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  border: 1px solid var(--panel-border);
  padding: 4px 9px;
  border-radius: 100px;
}

/* Education */
.edu-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 30px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.edu-left h3 { font-family: var(--font-display); font-size: 1.25rem; margin-bottom: 8px; }
.edu-org { color: var(--text-dim); font-size: 0.95rem; }
.edu-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.edu-gpa { font-family: var(--font-mono); color: var(--amber); font-weight: 600; }
.edu-date { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-faint); }

/* Contact */
.contact-sub { color: var(--text-dim); max-width: 560px; margin-bottom: 44px; margin-top: -20px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 50px; }

.contact-row {
  display: flex;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--panel-border);
  transition: padding-left 0.2s ease;
}
.contact-row:hover { padding-left: 6px; color: var(--violet); }
.contact-label { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-faint); }
.contact-value { font-size: 0.95rem; }

.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: flex; flex-direction: column; gap: 8px; }
.form-row label { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); }
.form-row input, .form-row textarea {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--violet);
}
.form-row textarea { min-height: 110px; }
.form-status { font-family: var(--font-mono); font-size: 0.82rem; color: var(--green); min-height: 1em; }

/* Footer */
.footer { border-top: 1px solid var(--panel-border); padding: 28px 32px; position: relative; z-index: 1; }
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  flex-wrap: wrap;
  gap: 8px;
}

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .nav-cta { display: none; }
  .nav-toggle { display: flex; margin-left: auto; padding: 8px; }
  .nav-toggle span { transition: transform 0.25s ease, opacity 0.2s ease; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* dropdown menu */
  .nav-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 4px 32px 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--panel-border);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }
  .nav-links.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }
  .nav-links a {
    display: block;
    padding: 14px 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--panel-border);
  }
  .nav-links li:last-child a { border-bottom: none; }
  .nav-links .nav-links-cta { display: block; }
  .nav-links .nav-links-cta a { color: var(--violet); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .hero { padding-top: 104px; }
  .about-stats { grid-template-columns: 1fr; }
  .edu-card { flex-direction: column; align-items: flex-start; }
  .edu-right { align-items: flex-start; }
}
/* ===== Social Sidebar ===== */
.social-sidebar {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: rgba(8, 8, 12, 0.7);
  backdrop-filter: blur(10px);
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  transition: all 0.3s ease;
}

.social-sidebar a {
  color: var(--text-dim);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.social-sidebar a:hover {
  color: var(--violet);
  background: rgba(139, 107, 255, 0.1);
  transform: scale(1.1);
}

.social-sidebar a svg {
  width: 20px;
  height: 20px;
}

/* Hide on mobile */
@media (max-width: 1280px) {
  .social-sidebar {
    display: none;
  }
}
/* ===== Mobile Social Links ===== */
.mobile-social {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--panel-border);
  margin-top: 8px;
}

.mobile-social a {
  font-size: 0.82rem;
  color: var(--text-dim);
  padding: 6px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 100px;
  transition: all 0.2s ease;
}

.mobile-social a:hover {
  color: var(--violet);
  border-color: var(--violet);
}

/* ===== Social Sidebar ===== */
.social-sidebar {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: rgba(8, 8, 12, 0.7);
  backdrop-filter: blur(10px);
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  transition: all 0.3s ease;
}

.social-sidebar a {
  color: var(--text-dim);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.social-sidebar a:hover {
  color: var(--violet);
  background: rgba(139, 107, 255, 0.1);
  transform: scale(1.1);
}

.social-sidebar a svg {
  width: 20px;
  height: 20px;
}

/* Hide social sidebar on mobile */
@media (max-width: 1280px) {
  .social-sidebar {
    display: none;
  }
}
