/* ---------- Reset & base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0c12;
  --bg-soft: #10131c;
  --surface: #131722;
  --surface-2: #171c28;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);
  --text: #eef0f5;
  --text-dim: #a4acc0;
  --text-faint: #6b7386;
  --accent: #6ee7ff;
  --accent-2: #a78bfa;
  --accent-grad: linear-gradient(120deg, #6ee7ff, #a78bfa);
  --success: #4ade80;
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1080px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

h1, h2, h3, .nav__brand, .portrait-badge {
  font-family: "Space Grotesk", "Inter", sans-serif;
  letter-spacing: -0.01em;
}

img { max-width: 100%; display: block; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }

.accent {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Background decoration ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 90%);
}

.bg-glow {
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 1100px;
  height: 700px;
  z-index: -1;
  background: radial-gradient(circle, rgba(110,231,255,0.14) 0%, rgba(167,139,250,0.08) 45%, transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 18px 0;
  background: rgba(10,12,18,0.7);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(20px, 6vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav__brand {
  font-weight: 700;
  font-size: 1.25rem;
}
.nav__brand span { color: var(--accent); }

.nav__links {
  display: flex;
  gap: 28px;
  flex: 1;
  justify-content: center;
}

.nav__links a {
  font-size: 0.92rem;
  color: var(--text-dim);
  font-weight: 500;
  position: relative;
  padding: 4px 0;
  transition: color 0.2s ease;
}
.nav__links a:hover { color: var(--text); }
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--accent-grad);
  transition: width 0.25s ease;
}
.nav__links a:hover::after { width: 100%; }

.nav__cta { white-space: nowrap; }

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

.mobile-menu {
  display: none;
  position: sticky;
  top: 64px;
  z-index: 99;
  background: rgba(10,12,18,0.97);
  border-bottom: 1px solid var(--border);
}
.mobile-menu.open { display: block; }

.mobile-menu__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 8px clamp(20px, 6vw, 64px) 16px;
}
.mobile-menu a {
  padding: 12px 0;
  color: var(--text-dim);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn--primary {
  background: var(--accent-grad);
  color: #05070c;
  box-shadow: 0 8px 24px -8px rgba(110,231,255,0.45);
}
.btn--primary:hover { box-shadow: 0 12px 30px -8px rgba(167,139,250,0.55); }

.btn--outline {
  background: rgba(255,255,255,0.03);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn--outline:hover { border-color: var(--accent); background: rgba(110,231,255,0.06); }

.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
  padding: 9px 18px;
}
.btn--ghost:hover { background: rgba(255,255,255,0.05); }

/* ---------- Layout helpers ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 0 clamp(20px, 6vw, 64px); }

.section { padding: 96px 0; border-top: 1px solid var(--border); }
.section:first-of-type { border-top: none; }

.section__head { margin-bottom: 48px; max-width: 640px; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}

.section__head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
  padding: 90px 0 100px;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 18px 0 22px;
}

.hero__lede {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 560px;
  margin-bottom: 32px;
}
.hero__lede strong { color: var(--text); }

.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 34px; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: 0.88rem;
  color: var(--text-faint);
}

.hero__portrait { display: flex; flex-direction: column; align-items: center; position: relative; }

.portrait-ring {
  width: min(320px, 80%);
  aspect-ratio: 1/1;
  border-radius: 50%;
  padding: 6px;
  background: conic-gradient(from 180deg, #6ee7ff, #a78bfa, #6ee7ff);
  position: relative;
  animation: float 5s ease-in-out infinite;
}
.portrait-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
  border: 6px solid var(--bg);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

.portrait-badge {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 10px 20px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.85rem;
  box-shadow: 0 10px 30px -12px rgba(0,0,0,0.6);
}
.portrait-badge strong { color: var(--accent); font-size: 1rem; }
.portrait-badge span { color: var(--text-faint); }

/* ---------- About ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  align-items: start;
}

.about__text { color: var(--text-dim); font-size: 1.02rem; }

.about__stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}
.stat strong { display: block; font-size: 1.15rem; color: var(--text); margin-bottom: 4px; font-family: "Space Grotesk", sans-serif; }
.stat span { color: var(--text-faint); font-size: 0.88rem; }

/* ---------- Skills ---------- */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.skill-card {
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.skill-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }

.skill-card__icon { font-size: 1.6rem; margin-bottom: 14px; }
.skill-card h3 { font-size: 1.05rem; margin-bottom: 16px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
}

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--accent), var(--accent-2) 60%, transparent);
  opacity: 0.5;
}

.timeline__item { position: relative; padding-bottom: 28px; }
.timeline__item:last-child { padding-bottom: 0; }

.timeline__dot {
  position: absolute;
  left: -28px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(110,231,255,0.12);
}

.timeline__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 22px 24px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.timeline__card:hover { border-color: var(--border-strong); transform: translateX(4px); }
.timeline__card--compact { padding: 18px 24px; }

.timeline__card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.timeline__card-head h3 { font-size: 1.05rem; }
.timeline__period { font-size: 0.82rem; color: var(--text-faint); white-space: nowrap; }
.timeline__sub { color: var(--text-dim); font-size: 0.88rem; margin-top: 4px; }

.role-list { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.role-list li + li { margin-top: 8px; }
.role-list__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.88rem;
  flex-wrap: wrap;
}
.role-list__row strong { color: var(--text); font-weight: 600; }
.role-list__row span { color: var(--text-faint); white-space: nowrap; }

/* ---------- Education ---------- */
.edu__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.edu__grid--single {
  grid-template-columns: 1fr;
  max-width: 480px;
}
.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
}
.edu-card__icon { font-size: 1.5rem; margin-bottom: 12px; }
.edu-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.edu-card__school { color: var(--text-dim); font-size: 0.9rem; }
.edu-card__period {
  display: inline-block;
  margin: 10px 0 14px;
  font-size: 0.78rem;
  color: var(--accent);
  border: 1px solid var(--border-strong);
  padding: 3px 10px;
  border-radius: 999px;
}
.edu-card p { color: var(--text-faint); font-size: 0.9rem; }

/* ---------- Contact ---------- */
.section--contact { padding-bottom: 60px; }
.contact__card {
  background: radial-gradient(circle at top left, rgba(110,231,255,0.08), transparent 60%), var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: clamp(32px, 6vw, 64px);
  text-align: center;
}
.contact__card h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin: 12px 0 14px; }
.contact__lede { color: var(--text-dim); max-width: 560px; margin: 0 auto 30px; }
.contact__actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.contact__location { color: var(--text-faint); font-size: 0.9rem; }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 28px 20px 40px;
  color: var(--text-faint);
  font-size: 0.82rem;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__cta { display: none; }
  .nav__toggle { display: flex; }

  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 56px; }
  .hero__actions, .hero__meta { justify-content: center; }
  .hero__portrait { order: -1; }

  .about__grid { grid-template-columns: 1fr; }
  .skills__grid { grid-template-columns: 1fr; }
  .edu__grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .timeline { padding-left: 20px; }
  .timeline__dot { left: -20px; }
}

/* ---------- Print / PDF export ---------- */
/* A condensed, resume-style rendering used to generate the downloadable PDF.
   Overrides the flashy web layout with a compact single-column document. */
@media print {
  @page { margin: 12mm 14mm; }

  .bg-grid, .bg-glow, .nav, .mobile-menu, .nav__toggle,
  #cvPdfLink, .portrait-badge, .hero__actions a.btn--outline {
    display: none !important;
  }

  * { animation: none !important; transition: none !important; box-shadow: none !important; }

  html, body { background: #ffffff; color: #14161c; font-size: 9.5pt; line-height: 1.35; }

  .reveal { opacity: 1 !important; transform: none !important; }

  main { max-width: none !important; padding: 0 !important; }

  h1, h2, h3, .nav__brand, .stat strong, .role-list__row strong, .hero__lede strong,
  .timeline__card-head h3, .edu-card h3 {
    color: #0b0e14 !important;
  }
  .accent { -webkit-text-fill-color: #4c6fff; color: #4c6fff; background: none; }
  .eyebrow { color: #4c6fff; font-size: 8pt; }

  .hero__lede, .about__text, .hero__meta, .timeline__sub, .contact__lede,
  .edu-card p, .edu-card__school, .stat span, .role-list__row span, .timeline__period {
    color: #3a3f4c;
  }

  /* Hero: small inline photo next to name, no floating/rings */
  .hero {
    display: flex !important;
    flex-direction: row-reverse;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 16px;
    padding: 0 0 10px !important;
    text-align: left !important;
    border-bottom: 1px solid #ddd;
  }
  .hero__text { max-width: none; }
  .hero h1 { font-size: 19pt; margin: 4px 0 8px; }
  .hero__lede { font-size: 9.5pt; max-width: none; margin-bottom: 10px; }
  .hero__actions .btn { padding: 5px 12px; font-size: 8.5pt; }
  .hero__meta { font-size: 8.5pt; gap: 4px 14px; }
  .hero__portrait { flex: 0 0 auto; }
  .portrait-ring {
    width: 84px !important;
    padding: 2px;
    animation: none !important;
  }
  .portrait-ring img { border-width: 2px; }

  .section {
    padding: 10px 0 !important;
    border-top: 1px solid #ddd;
  }
  .section__head { margin-bottom: 10px; page-break-inside: avoid; }
  .section__head h2 { font-size: 13pt; }

  .about__grid { grid-template-columns: 1fr !important; gap: 10px; }
  .about__text br + br { display: none; }
  .about__stats { flex-direction: row !important; flex-wrap: wrap; gap: 8px !important; }
  .stat { flex: 1 1 150px; padding: 8px 10px; }
  .stat strong { font-size: 0.95rem; }
  .stat span { font-size: 7.8pt; }

  .skills__grid { grid-template-columns: repeat(3, 1fr) !important; gap: 10px; }
  .skill-card { padding: 10px 12px; }
  .skill-card__icon { display: none; }
  .skill-card h3 { font-size: 9.5pt; margin-bottom: 8px; }
  .tags { gap: 4px; }
  .tags li { padding: 2px 8px; font-size: 7.6pt; }

  .timeline { padding-left: 16px; }
  .timeline::before { left: 3px; }
  .timeline__dot { left: -16px; width: 8px; height: 8px; }
  .timeline__item { padding-bottom: 8px; page-break-inside: avoid; }
  .timeline__card { padding: 8px 12px; }
  .timeline__card--compact { padding: 6px 12px; }
  .timeline__card-head h3 { font-size: 9.5pt; }
  .timeline__period, .role-list__row span { font-size: 7.8pt; }
  .timeline__sub { font-size: 8pt; margin-top: 2px; }
  .role-list { margin-top: 6px; padding-top: 6px; }
  .role-list li + li { margin-top: 4px; }
  .role-list__row { font-size: 8.2pt; }

  .edu__grid { grid-template-columns: 1fr !important; }
  .edu-card { padding: 10px 12px; }
  .edu-card__icon { display: none; }
  .edu-card h3 { font-size: 9.5pt; }
  .edu-card__period { font-size: 7.6pt; margin: 4px 0 6px; color: #4c6fff !important; }

  .section--contact { padding-bottom: 4px !important; }
  .contact__card { padding: 12px 16px; text-align: left; }
  .contact__card h2 { font-size: 12pt; }
  .contact__lede { margin: 6px 0 10px; }
  .contact__actions { justify-content: flex-start; }

  .stat, .skill-card, .timeline__card, .edu-card, .contact__card {
    background: #f6f7fb;
    border: 1px solid #e2e4ea;
  }

  .tags li { background: #eef0f7; border-color: #dfe2ea; color: #3a3f4c; }

  .btn { border: 1px solid #c7cbd6 !important; color: #14161c !important; background: #fff !important; }
  .btn--primary { background: #eef0f7 !important; }

  .footer { display: none; }
}
