/* ============ Tokens ============ */
:root {
  --bg: #0d0f17;
  --bg-1: #12151f;
  --bg-2: #171b28;
  --surface: #1a1e2c;
  --border: #2a2f40;
  --ink: #f0ede3;
  --ink-soft: #a8aec2;
  --ink-dim: #6b7186;
  --gold: #d9ab5c;
  --gold-soft: #e8c88a;
  --gold-dim: rgba(217, 171, 92, 0.12);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'IBM Plex Sans', -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', 'SF Mono', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}
@media (hover: none) { body { cursor: auto; } }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
section { position: relative; padding: 7rem 6vw; max-width: 1280px; margin: 0 auto; }
@media (max-width: 768px) { section { padding: 4.5rem 6vw; } }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; text-wrap: balance; }

/* ============ Custom cursor ============ */
.cursor-dot {
  position: fixed; top: 0; left: 0; width: 10px; height: 10px;
  background: var(--gold); border-radius: 50%; pointer-events: none;
  z-index: 9999; mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: width .25s var(--ease), height .25s var(--ease), background .25s var(--ease);
}
.cursor-dot.is-hover { width: 44px; height: 44px; background: rgba(217,171,92,0.35); }
@media (hover: none) { .cursor-dot { display: none; } }

/* ============ Scroll progress ============ */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  z-index: 9998; transition: width .1s linear;
}

/* ============ Nav ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  padding: 1.4rem 6vw; transition: background .3s var(--ease), padding .3s var(--ease), border-color .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(13, 15, 23, 0.82); backdrop-filter: blur(12px);
  padding: 0.9rem 6vw; border-color: var(--border);
}
.nav__inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.nav__logo { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; letter-spacing: 0.02em; }
.nav__logo span { color: var(--gold); }
.nav__links { display: flex; gap: 2.2rem; }
.nav__links a {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-soft); position: relative; padding-bottom: 4px; transition: color .25s;
}
.nav__links a::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 0; height: 1px; background: var(--gold);
  transition: width .3s var(--ease);
}
.nav__links a:hover, .nav__links a.is-active { color: var(--ink); }
.nav__links a.is-active::after, .nav__links a:hover::after { width: 100%; }
.nav__cta {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase;
  border: 1px solid var(--border); padding: 0.55rem 1.1rem; border-radius: 999px;
  transition: border-color .25s, color .25s, background .25s;
}
.nav__cta:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }
.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav__burger span { width: 22px; height: 2px; background: var(--ink); display: block; transition: transform .25s, opacity .25s; }
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__cta { display: none; }
  .nav__burger { display: flex; }
}
.nav__burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; background: var(--bg-1); z-index: 490;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.8rem;
  transform: translateY(-100%); transition: transform .4s var(--ease); opacity: 0;
}
.mobile-menu.is-open { transform: translateY(0); opacity: 1; }
.mobile-menu a { font-family: var(--serif); font-size: 1.8rem; color: var(--ink); }
.mobile-menu a:hover { color: var(--gold); }

/* ============ Hero ============ */
.hero {
  min-height: 100svh; display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  padding: 0 6vw; position: relative; overflow: hidden;
  background: radial-gradient(circle at 15% 20%, rgba(159,176,216,0.07), transparent 42%), linear-gradient(135deg, #0b0d14 0%, #12151f 45%, #191f30 100%);
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.55; }
.hero__glow {
  position: absolute; width: 60vw; height: 60vw; max-width: 700px; max-height: 700px;
  background: radial-gradient(circle, rgba(217,171,92,0.10), transparent 70%);
  top: -10%; right: -10%; pointer-events: none;
}
.hero__inner { position: relative; z-index: 2; max-width: 820px; }
.eyebrow {
  font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1.4rem;
}
.hero__name {
  font-size: clamp(3rem, 8vw, 6rem); line-height: 0.98; letter-spacing: -0.01em; color: var(--ink);
  margin-bottom: 1.2rem;
}
.hero__role {
  font-family: var(--mono); font-size: clamp(1rem, 2.2vw, 1.35rem); color: var(--gold-soft);
  margin-bottom: 1.6rem; min-height: 1.8em;
}
.cursor-blink { animation: blink 1s steps(1) infinite; color: var(--gold); }
@keyframes blink { 50% { opacity: 0; } }
.hero__sub { font-size: clamp(1rem, 1.6vw, 1.2rem); color: var(--ink-soft); max-width: 640px; margin-bottom: 2.6rem; }
.hero__sub strong { color: var(--ink); font-weight: 500; }
.hero__cta { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.95rem 1.8rem; border-radius: 999px; display: inline-flex; align-items: center; gap: 0.5rem;
  transition: transform .3s var(--ease), background .3s, border-color .3s, color .3s;
}
.btn--primary { background: var(--gold); color: #12151f; font-weight: 500; }
.btn--primary:hover { transform: translateY(-2px); background: var(--gold-soft); }
.btn--ghost { border: 1px solid var(--border); color: var(--ink); }
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--gold); color: var(--gold); }

.hero__scroll {
  position: absolute; bottom: 2.4rem; left: 6vw; display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  z-index: 2;
}
.hero__scroll span {
  width: 1px; height: 40px; background: linear-gradient(var(--gold), transparent);
  animation: scrollpulse 1.8s ease-in-out infinite;
}
.hero__scroll p { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-dim); }
@keyframes scrollpulse { 0%, 100% { transform: scaleY(1); opacity: .6; } 50% { transform: scaleY(0.5); opacity: 1; } }

/* ============ Reveal on scroll ============ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.hero__inner .reveal { transition-delay: calc(var(--i, 0) * 0.08s); }

/* ============ Stats ============ */
.stats { padding: 4rem 6vw; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-1); }
.stats__grid { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
@media (max-width: 768px) { .stats__grid { grid-template-columns: repeat(2, 1fr); } }
.stat { text-align: left; }
.stat__num {
  display: block; font-family: var(--serif); font-size: clamp(2.2rem, 4vw, 3.2rem); color: var(--gold);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.stat__label { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); letter-spacing: 0.02em; line-height: 1.5; }

/* ============ Section headers ============ */
.section__tag {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); display: block; margin-bottom: 1rem;
}
.section__head h2 { font-size: clamp(2rem, 4vw, 3.2rem); color: var(--ink); line-height: 1.08; margin-bottom: 1rem; }
.section__intro { color: var(--ink-soft); max-width: 560px; font-size: 1.05rem; }

/* ============ About ============ */
.about__grid { display: grid; grid-template-columns: 260px 1fr; gap: 4.5rem; margin-top: 3rem; align-items: start; }
@media (max-width: 768px) { .about__grid { grid-template-columns: 1fr; gap: 2.5rem; } }
.about__portrait { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.portrait-frame {
  width: 160px; height: 160px; border-radius: 50%; overflow: hidden; border: 1px solid var(--border);
  padding: 6px; position: relative;
}
.portrait-frame::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%; padding: 1px;
  background: conic-gradient(var(--gold), transparent 40%, transparent 60%, var(--gold));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.portrait-frame img { border-radius: 50%; width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.portrait-caption { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-soft); display: flex; align-items: center; gap: 0.5rem; }
.portrait-dot { width: 7px; height: 7px; border-radius: 50%; background: #6fd58a; box-shadow: 0 0 0 3px rgba(111,213,138,0.18); flex-shrink: 0; }
.about__text p { color: var(--ink-soft); font-size: 1.08rem; margin-bottom: 1.3rem; max-width: 62ch; }
.about__text strong { color: var(--ink); font-weight: 500; }
.text-link { font-family: var(--mono); font-size: 0.85rem; color: var(--gold); border-bottom: 1px solid transparent; transition: border-color .25s; }
.text-link:hover { border-color: var(--gold); }

/* ============ Timeline ============ */
.timeline { margin-top: 3rem; position: relative; padding-left: 2.4rem; border-left: 1px solid var(--border); }
.tl-item { position: relative; padding-bottom: 3.2rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -2.55rem; top: 0.35rem; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--gold);
}
.tl-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.8rem; margin-bottom: 0.3rem; }
.tl-content h3 { font-size: 1.4rem; color: var(--ink); }
.tl-date { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-dim); }
.tl-org { color: var(--gold-soft); font-size: 0.92rem; margin-bottom: 0.9rem; font-family: var(--mono); }
.tl-content ul { display: flex; flex-direction: column; gap: 0.55rem; max-width: 68ch; }
.tl-content li { color: var(--ink-soft); font-size: 1rem; padding-left: 1.1rem; position: relative; }
.tl-content li::before { content: '—'; position: absolute; left: 0; color: var(--ink-dim); }
.tl-content strong { color: var(--ink); font-weight: 500; }

/* ============ Work / Projects ============ */
.work__grid { margin-top: 3rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.8rem; }
@media (max-width: 860px) { .work__grid { grid-template-columns: 1fr; } }
.project {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  transition: border-color .35s, transform .35s var(--ease), box-shadow .35s var(--ease);
  will-change: transform;
}
.project:hover { border-color: rgba(217,171,92,0.4); box-shadow: 0 20px 60px -20px rgba(0,0,0,0.6); }
.project__link { display: block; }
.project__image { aspect-ratio: 16/10; overflow: hidden; background: var(--bg-2); }
.project__image img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .6s var(--ease); }
.project:hover .project__image img { transform: scale(1.06); }
.project__body { padding: 1.6rem 1.7rem 1.8rem; }
.project__row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.project__row h3 { font-size: 1.3rem; color: var(--ink); }
.project__arrow { font-family: var(--mono); color: var(--gold); font-size: 1.1rem; transition: transform .3s var(--ease); }
.project:hover .project__arrow { transform: translate(3px, -3px); }
.project__body p { color: var(--ink-soft); font-size: 0.96rem; margin-bottom: 1.1rem; }

.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags span {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--ink-soft); border: 1px solid var(--border); padding: 0.3rem 0.7rem; border-radius: 999px;
}
.tags--lg span { font-size: 0.82rem; padding: 0.5rem 1rem; }

/* ============ Skills ============ */
.skills__grid { margin-top: 3rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
@media (max-width: 860px) { .skills__grid { grid-template-columns: 1fr; } }
.skill-group h3 { font-family: var(--mono); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-dim); margin-bottom: 1rem; font-weight: 500; }
.edu { margin-top: 4rem; padding-top: 3rem; border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5rem; }
@media (max-width: 768px) { .edu { grid-template-columns: 1fr; } }
.edu__item h4 { font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); margin-bottom: 0.6rem; }
.edu__item p { color: var(--ink-soft); line-height: 1.7; }

/* ============ Contact ============ */
.contact { text-align: left; }
.contact__inner h2 { font-size: clamp(2.4rem, 6vw, 4.2rem); margin-bottom: 1.2rem; }
.contact__inner p { color: var(--ink-soft); font-size: 1.15rem; max-width: 500px; margin-bottom: 2.4rem; }
.contact__links { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ============ Footer ============ */
.footer {
  padding: 2.2rem 6vw; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  border-top: 1px solid var(--border); font-family: var(--mono); font-size: 0.75rem; color: var(--ink-dim);
}
