:root {
  --gold: #d4a843;
  --gold-dim: #a07830;
  --cream: #f5f0e8;
  --ink: #0e0c08;
  --ink2: #1c1814;
  --fog: #2a2520;
  --accent: #e8623a;
  --teal: #2cb8a0;
  --violet: #7c4fe0;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--cream);
  font-family: 'DM Mono', monospace;
  cursor: none;
  overflow-x: hidden;
}

/* ── CUSTOM CURSOR ── */
#cursor-dot {
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
  position: fixed; z-index: 9999;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform 0.05s, background 0.2s;
}
#cursor-ring {
  width: 36px; height: 36px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  position: fixed; z-index: 9998;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, width 0.2s, height 0.2s, opacity 0.2s;
  opacity: 0.6;
}
body:hover #cursor-ring { opacity: 1; }
@media (pointer: coarse) {
  body { cursor: auto; }
  #cursor-dot, #cursor-ring { display: none; }
}

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.2rem 3rem;
  background: rgba(14,12,8,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 0.5px solid rgba(212,168,67,0.2);
}
.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 1.1rem;
  color: var(--gold); letter-spacing: 0.1em;
  text-decoration: none;
}
.nav-links { display: flex; gap: 2.5rem; list-style: none; }
.nav-links a {
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(245,240,232,0.55); text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--gold); }

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none; border: none;
  cursor: pointer; padding: 4px; z-index: 201;
}
.nav-hamburger span {
  display: block; width: 24px; height: 1.5px;
  background: var(--gold);
  transition: all 0.3s ease;
  transform-origin: center;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-menu {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(14,12,8,0.97);
  backdrop-filter: blur(24px);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: 'Syne', sans-serif;
  font-size: 1.8rem; font-weight: 700;
  color: rgba(245,240,232,0.55);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.2s;
}
.mobile-menu a:hover, .mobile-menu a:active { color: var(--gold); }

/* ── SECTIONS BASE ── */
section { min-height: 100vh; position: relative; overflow: hidden; }
canvas.bg-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%; z-index: 0;
}
.section-content {
  position: relative; z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 8rem 3rem 5rem;
}

/* ── HERO ── */
#hero { display: flex; align-items: center; background: var(--ink); }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 4rem; align-items: center;
}
.hero-tag {
  font-size: 0.68rem; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1.2rem;
  display: flex; align-items: center; gap: 0.8rem;
}
.hero-tag::before { content: ''; display: block; width: 32px; height: 1px; background: var(--gold); }
h1.hero-name {
  font-family: 'Syne', sans-serif;
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 800; line-height: 0.95;
  letter-spacing: -0.02em; color: var(--cream);
}
h1.hero-name span { color: var(--gold); }
.hero-subtitle {
  font-family: 'Fraunces', serif; font-style: italic;
  font-size: 1.3rem; color: rgba(245,240,232,0.55);
  margin-top: 1.2rem; line-height: 1.5;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: 0.8rem;
  margin-top: 2.5rem; padding: 0.85rem 2rem;
  background: var(--gold); color: var(--ink);
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: 0.8rem; letter-spacing: 0.15em;
  text-transform: uppercase; text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.hero-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(212,168,67,0.35); }
.hero-cta-ghost {
  display: inline-flex; align-items: center; gap: 0.8rem;
  margin-top: 2.5rem; margin-left: 1rem; padding: 0.85rem 2rem;
  border: 1px solid rgba(212,168,67,0.4);
  color: var(--gold); font-family: 'Syne', sans-serif;
  font-weight: 700; font-size: 0.8rem; letter-spacing: 0.15em;
  text-transform: uppercase; text-decoration: none; transition: background 0.2s;
}
.hero-cta-ghost:hover { background: rgba(212,168,67,0.08); }
.hero-photo-frame {
  position: relative; width: 340px; height: 420px;
  box-shadow: 0 20px 60px rgba(212,168,67,0.25);
}
.hero-photo-frame::before {
  content: ''; position: absolute; inset: -10px;
  border: 1px solid rgba(212,168,67,0.3); transform: rotate(2deg);
}
.hero-photo-frame::after {
  content: ''; position: absolute; inset: -20px;
  border: 1px solid rgba(212,168,67,0.1); transform: rotate(-1.5deg);
}
.hero-photo-frame img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top; display: block;
  filter: grayscale(0%) contrast(1.1); border-radius: 12px;
}
.hero-stats { display: flex; gap: 2.5rem; margin-top: 2.5rem; flex-wrap: wrap; }
.hero-buttons {
  display: flex; flex-direction: column;
  align-items: flex-start; margin-top: 2rem;
}
.top-buttons { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.center-btn { margin-top: 1.2rem; margin-left: 0 !important; }
.stat-item { border-left: 2px solid var(--gold); padding-left: 1rem; }
.stat-num { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.8rem; color: var(--gold); }
.stat-label { font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(245,240,232,0.4); margin-top: 0.2rem; }

/* ── SECTION HEADERS ── */
.section-eyebrow {
  font-size: 0.65rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 0.8rem;
  display: flex; align-items: center; gap: 0.8rem;
}
.section-eyebrow::before { content: ''; display: block; width: 24px; height: 1px; background: var(--gold); }
.section-title {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1; letter-spacing: -0.02em; margin-bottom: 3rem;
}

/* ── ABOUT ── */
#about { background: var(--ink2); position: relative; }
#galaxy-canvas { z-index: 0; }
#about .section-content { position: relative; z-index: 2; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: start; }
.about-text { font-family: 'Fraunces', serif; font-size: 1.1rem; line-height: 1.8; color: rgba(245,240,232,0.7); }
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.skill-chip {
  padding: 0.6rem 1rem;
  border: 0.5px solid rgba(212,168,67,0.25);
  font-size: 0.7rem; letter-spacing: 0.12em;
  color: rgba(245,240,232,0.6); transition: border-color 0.2s, color 0.2s;
}
.skill-chip:hover { border-color: var(--gold); color: var(--cream); }
.achievements-row { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.achievement-pill {
  padding: 0.5rem 1.2rem;
  background: rgba(212,168,67,0.1);
  border: 0.5px solid rgba(212,168,67,0.3);
  font-size: 0.7rem; letter-spacing: 0.1em; color: var(--gold);
}

/* ── PROJECTS ── */
#projects { background: var(--ink); }
.projects-stack { display: flex; flex-direction: column; gap: 6rem; }
.project-block {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4rem; align-items: center; position: relative;
}
.project-block.reverse { direction: rtl; }
.project-block.reverse > * { direction: ltr; }
.project-visual {
  position: relative; height: 340px; overflow: hidden;
  border: 0.5px solid rgba(212,168,67,0.1);
}
.project-canvas { width: 100%; height: 100%; display: block; }
.project-label {
  position: absolute; bottom: 1rem; left: 1rem;
  font-size: 0.6rem; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--gold); opacity: 0.7;
}
.project-num {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: 5rem; color: rgba(212,168,67,0.08);
  line-height: 1; margin-bottom: -1.5rem;
}
.project-title {
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: 1.8rem; color: var(--cream);
  line-height: 1.1; margin-bottom: 0.8rem;
}
.project-desc { font-size: 0.82rem; line-height: 1.8; color: rgba(245,240,232,0.55); margin-bottom: 1.2rem; }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.tag {
  padding: 0.3rem 0.8rem;
  border: 0.5px solid rgba(212,168,67,0.3);
  font-size: 0.62rem; letter-spacing: 0.15em; text-transform: uppercase;
  color: rgba(212,168,67,0.7);
}
.project-link {
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); text-decoration: none;
  display: flex; align-items: center; gap: 0.5rem; transition: gap 0.2s;
}
.project-link:hover { gap: 1rem; }
.project-link::after { content: '→'; }

/* ── CONFERENCE ── */
#conference {
  background: linear-gradient(135deg, #0e0c08 0%, #1a1508 100%);
  min-height: 50vh; display: flex; align-items: center;
}
.conf-card {
  border: 1px solid rgba(212,168,67,0.25);
  padding: 3rem; max-width: 700px; position: relative;
}
.conf-card::before {
  content: '"'; font-family: 'Fraunces', serif;
  font-size: 8rem; color: rgba(212,168,67,0.08);
  position: absolute; top: -2rem; left: 1.5rem; line-height: 1;
}
.conf-name {
  font-family: 'Fraunces', serif; font-style: italic;
  font-size: 1.4rem; color: var(--cream);
  line-height: 1.5; margin-bottom: 1.2rem;
}
.conf-meta { font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); opacity: 0.7; }
.ieee-row { display: flex; align-items: center; gap: 1.2rem; margin-top: 1.2rem; flex-wrap: wrap; }
.ieee-badge {
  display: flex; align-items: center; height: 38px; padding: 0 1.2rem;
  background: rgba(44,184,160,0.1); border: 0.5px solid rgba(44,184,160,0.4);
  font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--teal);
}
.cert-btn {
  display: flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 1.5rem;
  border: 0.5px solid rgba(44,184,160,0.4); color: var(--teal);
  text-decoration: none; font-size: 0.65rem;
  letter-spacing: 0.2em; text-transform: uppercase; transition: all 0.2s;
}
.cert-btn:hover { background: rgba(44,184,160,0.1); transform: translateY(-2px); }

/* ── EXPERIENCE ── */
#experience { background: var(--ink2); }
.exp-card {
  border-left: 2px solid var(--gold);
  padding: 2rem 2.5rem; background: rgba(212,168,67,0.04);
  margin-bottom: 2rem; transition: background 0.3s;
}
.exp-card:hover { background: rgba(212,168,67,0.08); }
.exp-role { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.2rem; color: var(--cream); }
.exp-company { color: var(--gold); font-size: 0.9rem; margin: 0.3rem 0; }
.exp-period { font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(245,240,232,0.35); margin-bottom: 1rem; }
.exp-points { list-style: none; }
.exp-points li {
  font-size: 0.8rem; line-height: 1.8; color: rgba(245,240,232,0.55);
  padding-left: 1.2rem; position: relative; margin-bottom: 0.4rem;
}
.exp-points li::before { content: '—'; position: absolute; left: 0; color: var(--gold); opacity: 0.5; }

/* ── CONTACT ── */
#contact { background: var(--ink); min-height: 60vh; display: flex; align-items: center; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center; }
.contact-big {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 0.95; letter-spacing: -0.02em;
}
.contact-big span { color: var(--gold); }
.contact-links { display: flex; flex-direction: column; gap: 1.2rem; }
.contact-item {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1.2rem 1.5rem;
  border: 0.5px solid rgba(212,168,67,0.15);
  text-decoration: none; color: var(--cream);
  transition: border-color 0.2s, background 0.2s;
}
.contact-item:hover { border-color: var(--gold); background: rgba(212,168,67,0.05); }
.contact-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  background: rgba(212,168,67,0.12);
  display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
}
.contact-label { font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(245,240,232,0.35); }
.contact-val { font-family: 'Syne', sans-serif; font-size: 0.9rem; }

/* ── FOOTER ── */
footer {
  padding: 2rem 3rem;
  border-top: 0.5px solid rgba(212,168,67,0.15);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.65rem; letter-spacing: 0.15em; text-transform: uppercase;
  color: rgba(245,240,232,0.25); flex-wrap: wrap; gap: 0.5rem;
}

/* ── SCROLL ANIMATIONS ── */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ═══════════════════════════════════
   TABLET  769px – 1024px
═══════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) {
  nav { padding: 1rem 2rem; }
  .section-content { padding: 7rem 2rem 4rem; }
  .hero-grid { grid-template-columns: 1fr 280px; gap: 2.5rem; }
  .hero-photo-frame { width: 260px; height: 320px; }
  .about-grid { gap: 3rem; }
  .project-block { gap: 2.5rem; }
  .contact-grid { gap: 3rem; }
}

/* ═══════════════════════════════════
   MOBILE  ≤768px
═══════════════════════════════════ */
@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  .section-content { padding: 6rem 1.5rem 4rem; }

  /* Hero: photo on top, text below */
  #hero { align-items: flex-start; min-height: 100svh; }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: left;
  }
  .hero-grid > div:last-child { order: -1; }
  .hero-photo-frame { width: 180px; height: 220px; margin: 0 auto; }
  h1.hero-name { font-size: clamp(2.6rem, 11vw, 3.8rem); }
  .hero-subtitle { font-size: 1rem; }
  .hero-stats { gap: 1.5rem; }
  .stat-num { font-size: 1.4rem; }
  .hero-buttons { align-items: stretch; width: 100%; }
  .top-buttons { flex-direction: column; gap: 0.8rem; width: 100%; }
  .hero-cta {
    width: 100%; justify-content: center; margin-top: 0;
  }
  .hero-cta-ghost {
    width: 100%; justify-content: center;
    margin-top: 0; margin-left: 0;
  }
  .center-btn { margin-top: 0.8rem; width: 100%; justify-content: center; }
  .top-buttons .hero-cta:first-child { margin-top: 0; }

  /* About */
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-text { font-size: 1rem; }
  .skills-grid { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .achievement-pill { font-size: 0.62rem; padding: 0.4rem 0.8rem; }

  /* Projects */
  .project-block,
  .project-block.reverse { grid-template-columns: 1fr; direction: ltr; gap: 2rem; }
  .project-block.reverse > * { direction: ltr; }
  .project-visual { height: 220px; }
  .project-num { font-size: 3rem; }
  .project-title { font-size: 1.3rem; }
  .projects-stack { gap: 4rem; }

  /* Conference */
  .conf-card { padding: 2rem 1.2rem; }
  .conf-name { font-size: 1.05rem; }
  .ieee-row { flex-direction: column; align-items: stretch; gap: 0.7rem; }
  .ieee-badge, .cert-btn { width: 100%; justify-content: center; height: 44px; }

  /* Experience */
  .exp-card { padding: 1.4rem 1rem; }
  .exp-role { font-size: 1rem; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .contact-big { font-size: clamp(2rem, 10vw, 2.8rem); }
  .contact-val { font-size: 0.76rem; word-break: break-all; }
  .contact-item { gap: 1rem; padding: 1rem; }

  footer { padding: 1.5rem; justify-content: center; text-align: center; }
}

/* ═══════════════════════════════════
   SMALL PHONES  ≤390px
═══════════════════════════════════ */
@media (max-width: 390px) {
  .section-content { padding: 5.5rem 1rem 3rem; }
  h1.hero-name { font-size: 2.4rem; }
  .hero-subtitle { font-size: 0.9rem; }
  .hero-stats { flex-direction: column; gap: 1rem; }
  .skills-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 1.8rem; }
}
