/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #0e0e0e;
  color: #e0e0e0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Canvas trail (fixed, behind everything) ── */
#trailCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── Typography base ── */
h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 0.4rem;
}
h3 { font-size: 1rem; font-weight: 600; color: #fff; }
p { line-height: 1.65; }
.muted { color: #999; }
.section-sub { color: #666; font-size: 0.9rem; margin-bottom: 2.5rem; }

/* ── Layout helpers ── */
.inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 5rem 2rem;
}
.section-base { position: relative; z-index: 10; }
.section-alt  { background: #111; position: relative; z-index: 10; }
.two-col { display: flex; gap: 3.5rem; align-items: center; }

/* ── Nav ── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 62px;
  background: rgba(14, 14, 14, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  z-index: 1000;
}
.nav-content {
  width: 92%;
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: #fff;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-links a {
  color: #aaa;
  text-decoration: none;
  padding: 6px 12px;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 6px;
  transition: color 0.18s, background 0.18s;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.06); }
.cv-btn {
  font-size: 0.82rem;
  font-weight: 700;
  color: #8891ff;
  text-decoration: none;
  border: 1px solid rgba(102, 117, 255, 0.35);
  padding: 6px 14px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.cv-btn:hover { background: #6675ff; color: #fff; border-color: #6675ff; }

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 62px;
  position: relative;
  z-index: 10;
}
.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 680px;
  padding: 0 2rem;
}
.hero-eyebrow {
  font-family: 'VT323', monospace;
  font-size: 1.35rem;
  color: #666;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.hero-name {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
  line-height: 1.1;
}
.hero-role {
  font-size: 1.35rem;
  color: #6675ff;
  font-weight: 500;
  min-height: 2rem;
  display: flex;
  align-items: center;
  gap: 1px;
}
.cursor {
  animation: blink 1s step-end infinite;
  color: #6675ff;
  font-weight: 300;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-tagline-removed { display: none; }
.hero-cta {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.btn-primary {
  padding: 11px 28px;
  background: #6675ff;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.18s, box-shadow 0.18s;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(102, 117, 255, 0.4); }
.btn-ghost {
  padding: 11px 28px;
  background: transparent;
  color: #ccc;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: border-color 0.18s, color 0.18s, transform 0.18s;
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.4); color: #fff; transform: translateY(-3px); }

/* ── About ── */
.about-photo { flex: 0 0 auto; }
.photo-placeholder {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(102, 117, 255, 0.07);
  border: 2px dashed rgba(102, 117, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6675ff;
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  letter-spacing: 1px;
}
.about-body { flex: 1; min-width: 0; }
.about-body h2 { margin-bottom: 1rem; }
.tag-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.tag {
  background: rgba(102, 117, 255, 0.1);
  border: 1px solid rgba(102, 117, 255, 0.22);
  color: #9aa0ff;
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 100px;
  font-weight: 500;
}

/* ── Skills ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
  margin-top: 0.5rem;
}
.skill-group {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  transition: border-color 0.2s;
}
.skill-group:hover { border-color: rgba(102, 117, 255, 0.25); }
.skill-group h3 {
  font-family: 'Jersey 10', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  color: #6675ff;
  letter-spacing: 1px;
  margin-bottom: 0.9rem;
  text-transform: uppercase;
}
.pill-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ccc;
  font-size: 0.82rem;
  padding: 4px 12px;
  border-radius: 100px;
}
.pill-row.sm .pill { font-size: 0.75rem; padding: 3px 10px; }

/* ── Projects ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.25rem;
}
.project-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: border-color 0.2s, transform 0.2s;
}
.project-card:hover { border-color: rgba(102, 117, 255, 0.4); transform: translateY(-4px); }
.project-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}
.project-top h3 { color: #fff; font-size: 1rem; }
.status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 100px;
  background: rgba(102, 117, 255, 0.12);
  color: #9aa0ff;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.project-card > p { color: #888; font-size: 0.88rem; flex: 1; }
.project-links { display: flex; gap: 1.25rem; }
.project-links a {
  color: #6675ff;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: opacity 0.15s;
}
.project-links a:hover { opacity: 0.65; }

/* ── Experience / Timeline ── */
.timeline { position: relative; padding-left: 2rem; margin-top: 1rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: rgba(102, 117, 255, 0.18);
  border-radius: 2px;
}
.tl-item { position: relative; padding-bottom: 2.5rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: -2rem;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #6675ff;
  border: 2px solid #0e0e0e;
  box-shadow: 0 0 0 3px rgba(102, 117, 255, 0.2);
  transform: translateX(-5px);
}
.tl-body { padding-left: 0.5rem; }
.tl-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.2rem;
}
.tl-header h3 { font-size: 1rem; }
.tl-date { font-size: 0.78rem; color: #6675ff; font-weight: 600; flex-shrink: 0; }
.tl-org { font-size: 0.82rem; color: #666; margin-bottom: 0.4rem; }
.tl-body > .muted { font-size: 0.88rem; }

/* ── Vision break ── */
.vision-break {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(to bottom, transparent, rgba(102,117,255,0.04), transparent);
  position: relative;
  z-index: 10;
}
.vision-break p {
  font-family: 'VT323', monospace;
  font-size: 1.6rem;
  color: #777;
  letter-spacing: 1px;
}
.vision-attr { font-size: 0.9rem !important; color: #555 !important; margin-top: 0.5rem; font-family: 'Inter', sans-serif !important; }

/* ── Contact ── */
.contact-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}
.contact-chip {
  color: #ccc;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: border-color 0.18s, color 0.18s, transform 0.18s;
}
.contact-chip:hover { border-color: #6675ff; color: #9aa0ff; transform: translateY(-2px); }

/* ── Footer ── */
footer {
  padding: 2rem;
  text-align: center;
  color: #444;
  font-size: 0.82rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 10;
}

/* ── Trail widget ── */
.trail-widget {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 8px;
  outline: none;
}
.trail-tab {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(20, 20, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1rem;
  transition: transform 0.2s ease;
}
.trail-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(18, 18, 18, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  transform-origin: left center;
  transform: scaleX(0);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.trail-widget:hover .trail-panel,
.trail-widget:focus-within .trail-panel,
.trail-widget.open .trail-panel {
  transform: scaleX(1);
  opacity: 1;
  pointer-events: auto;
}
.trail-widget.open .trail-tab,
.trail-widget:hover .trail-tab,
.trail-widget:focus-within .trail-tab { transform: rotate(90deg); }
.trail-text { font-size: 0.82rem; color: #888; font-weight: 600; }

/* ── Toggle switch ── */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  background: #2a2a2a;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}
.slider::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 4px; top: 4px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: transform 0.2s;
}
.switch input:checked + .slider { background: #6675ff; }
.switch input:checked + .slider::after { transform: translateX(20px); }

/* ── Profile image ── */
.profile-img {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(102, 117, 255, 0.3);
  display: block;
}

/* ── Bio text ── */
.bio-hey {
  font-family: 'VT323', monospace;
  font-size: 3rem;
  color: #6675ff;
  letter-spacing: 1px;
  line-height: 1.1;
}
.bio-p1 { font-size: 0.9rem; line-height: 1.8; }
.bio-p2 { font-size: 0.88rem; line-height: 1.8; margin-top: 1rem; }

/* ── Glitch name ── */
#glitchName {
  color: #9aa0ff;
  font-weight: 600;
  display: inline-block;
  position: relative;
}
@keyframes glitch-clip {
  0%   { clip-path: inset(0 0 90% 0); transform: translate(-2px, 0); }
  25%  { clip-path: inset(60% 0 10% 0); transform: translate(2px, 0); }
  50%  { clip-path: inset(30% 0 50% 0); transform: translate(-1px, 0); }
  75%  { clip-path: inset(80% 0 5% 0);  transform: translate(1px, 0); }
  100% { clip-path: inset(0);           transform: none; }
}
#glitchName.glitching {
  animation: glitch-clip 0.12s steps(1) forwards;
  color: #fff;
}

/* ── Status badge variants ── */
.status-badge.paused {
  background: rgba(255, 180, 60, 0.12);
  color: #f0a840;
}

/* ── Writing timeline entry (parallel thread) ── */
.tl-item.tl-writing {
  margin-left: 1.25rem;
  opacity: 0.88;
}
.tl-dot.tl-dot-writing {
  background: #555;
  box-shadow: 0 0 0 3px rgba(150, 150, 150, 0.15);
}
.tl-date.tl-date-writing { color: #666; }
.tl-org.tl-org-writing { color: #555; }
.tl-item.tl-writing .tl-body {
  border-left: 1px dashed rgba(255,255,255,0.07);
  padding-left: 1rem;
}
.tl-link {
  color: #6675ff;
  text-decoration: none;
  font-weight: 600;
}
.tl-link:hover { opacity: 0.7; }

/* ── Hero tagline (below CTA) ── */
.hero-tagline {
  color: #555;
  font-size: 0.82rem;
  font-style: italic;
  max-width: 420px;
  line-height: 1.6;
  margin-top: 0.25rem;
  letter-spacing: 0.2px;
}

/* ── Contact static chip ── */
.contact-chip-static {
  cursor: default;
  color: #777;
  border-color: rgba(255,255,255,0.07);
}
.contact-chip-static:hover {
  transform: none;
  border-color: rgba(255,255,255,0.07);
  color: #777;
}

/* ── Language selector ── */
.lang-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  justify-content: center;
}
.lang-btn {
  font-family: 'VT323', monospace;
  font-size: 1rem;
  letter-spacing: 2.5px;
  color: rgba(102, 117, 255, 0.28);
  background: none;
  border: 1px solid rgba(102, 117, 255, 0.12);
  padding: 3px 13px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.lang-btn:hover {
  color: rgba(102, 117, 255, 0.65);
  border-color: rgba(102, 117, 255, 0.3);
}
.lang-btn.active {
  color: #9aa0ff;
  border-color: rgba(102, 117, 255, 0.45);
  background: rgba(102, 117, 255, 0.07);
  box-shadow: 0 0 8px rgba(102, 117, 255, 0.12);
}

/* ── Cyberpunk glitch overlay ── */
#glitchOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
}
#glitchOverlay.active {
  animation: lang-glitch 0.55s steps(1) forwards;
}
@keyframes lang-glitch {
  0%   { opacity: 0;    background: transparent;              clip-path: inset(0 0 100% 0); transform: none; }
  7%   { opacity: 0.75; background: rgba(102,117,255,0.18);   clip-path: inset(0 0 72% 0);  transform: translateX(-4px); }
  14%  { opacity: 0.6;  background: rgba(0,255,255,0.1);      clip-path: inset(38% 0 28% 0); transform: translateX(5px); }
  21%  { opacity: 0.85; background: rgba(255,0,255,0.08);     clip-path: inset(65% 0 8% 0);  transform: translateX(-3px); }
  28%  { opacity: 0.5;  background: rgba(102,117,255,0.14);   clip-path: inset(12% 0 55% 0); transform: translateX(3px); }
  35%  { opacity: 1;    background: rgba(10,10,10,0.93);      clip-path: inset(0);           transform: translateX(0); }
  42%  { opacity: 0.9;  background: rgba(102,117,255,0.2);    clip-path: inset(78% 0 0 0);   transform: translateX(-4px); }
  49%  { opacity: 0.6;  background: rgba(0,255,255,0.07);     clip-path: inset(0 0 58% 0);   transform: translateX(3px); }
  56%  { opacity: 0.35; background: rgba(255,0,255,0.05);     clip-path: inset(42% 0 35% 0); transform: translateX(-2px); }
  63%  { opacity: 0.18; background: rgba(102,117,255,0.08);   clip-path: inset(0);           transform: translateX(1px); }
  72%  { opacity: 0.07; clip-path: inset(0); transform: none; }
  100% { opacity: 0;    clip-path: inset(0); transform: none; }
}

/* ── Nav right group + hamburger ── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  outline: none;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #aaa;
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease, background 0.18s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); background: #fff; }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: #fff; }

/* ── Responsive — Tablet ── */
@media (max-width: 860px) {
  .two-col { flex-direction: column; text-align: center; }
  .about-photo { flex: unset; display: flex; justify-content: center; }
  .profile-img { width: 200px; height: 200px; }
  .tag-row { justify-content: center; }
  .tl-header { flex-direction: column; gap: 0.15rem; }
}

/* ── Responsive — Mobile ── */
@media (max-width: 680px) {
  /* Hamburger visible, nav links become dropdown */
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: 62px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(11,11,11,0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 0.5rem 1.5rem 1rem;
    z-index: 999;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 12px 2px;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    border-radius: 0;
    width: 100%;
  }
  .nav-links a:last-child { border-bottom: none; }

  /* Hero */
  .hero-name { font-size: 2rem; }
  .hero-cta { flex-direction: column; align-items: center; }
  .btn-primary, .btn-ghost { width: 100%; text-align: center; }

  /* About */
  .profile-img { width: 170px; height: 170px; }

  /* Timeline writing indent reduced */
  .tl-item.tl-writing { margin-left: 0.5rem; }
}

/* ── Responsive — Small phones ── */
@media (max-width: 420px) {
  .inner { padding: 3.5rem 1.25rem; }
  .hero-name { font-size: 1.7rem; }
  .hero-content { padding: 0 1.25rem; }
  .profile-img { width: 140px; height: 140px; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .contact-links { flex-direction: column; align-items: center; }
  .contact-chip { width: 100%; text-align: center; }
  .vision-break p { font-size: 1.25rem; }
}
