:root {
  --bg: #f6f8fc;
  --alt: #eef3fb;
  --surface: #ffffff;
  --ink: #14233b;
  --muted: #5a6882;
  --accent: #1d4ed8;
  --accent-deep: #14367a;
  --accent-soft: #eaf0fe;
  --accent-2: #0ea5a4;
  --dark: #0b1733;
  --line: #e5eaf3;
  --radius: 18px;
  --max: 1080px;
  --shadow: 0 30px 60px -32px rgba(20, 35, 59, 0.4);
  --shadow-sm: 0 16px 36px -24px rgba(20, 35, 59, 0.3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
h1, h2, h3, .brand { font-family: "Fraunces", Georgia, serif; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.75s ease, transform 0.75s ease; }
.reveal.in { opacity: 1; transform: none; }

/* HEADER */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 23, 51, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { font-weight: 700; font-size: 18px; color: #fff; }
.brand span { color: #8fb4ff; font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: 22px; list-style: none; margin: 0; padding: 0; font-size: 14px; font-weight: 500; }
.nav-links a { color: rgba(255,255,255,0.75); transition: color 0.2s; }
.nav-links a:hover { color: #fff; }
.nav-cta { color: #0b1733 !important; background: #fff; padding: 7px 16px; border-radius: 999px; }
.nav-cta:hover { background: #8fb4ff; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: #fff; border-radius: 2px; }

.lang-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 1px solid rgba(255,255,255,0.25); border-radius: 999px;
  padding: 5px 12px; cursor: pointer; font-family: "JetBrains Mono", monospace; font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.7);
}
.lang-toggle:hover { border-color: #8fb4ff; }
.lang-opt { transition: color 0.15s; }
.lang-opt.active { color: #8fb4ff; }
.lang-sep { color: rgba(255,255,255,0.3); }

/* HERO */
.hero { position: relative; background: var(--dark); color: #fff; overflow: hidden; padding-bottom: 70px; margin-top: -66px; padding-top: 66px; }
.hero-aurora {
  position: absolute; inset: -20% -10% auto -10%; height: 120%;
  background:
    radial-gradient(60% 60% at 20% 15%, rgba(29,78,216,0.55) 0%, rgba(29,78,216,0) 60%),
    radial-gradient(50% 55% at 85% 10%, rgba(14,165,164,0.45) 0%, rgba(14,165,164,0) 60%),
    radial-gradient(55% 55% at 65% 80%, rgba(124,92,255,0.35) 0%, rgba(124,92,255,0) 60%);
  filter: blur(10px); animation: drift 16s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(0,-3%,0) scale(1.06); } }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; align-items: center; padding-top: 72px; padding-bottom: 20px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: #8fb4ff; font-weight: 600; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 22px; }
.eyebrow::before { content: ""; width: 30px; height: 2px; background: linear-gradient(90deg, #8fb4ff, var(--accent-2)); }
.hero h1 { font-size: clamp(44px, 7vw, 76px); line-height: 1.0; margin: 0 0 24px; font-weight: 600; letter-spacing: -0.02em; }
.hero-sub { color: rgba(255,255,255,0.8); font-size: 18px; max-width: 46ch; margin: 0 0 36px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.btn { display: inline-block; padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: 15px; font-family: "Inter", sans-serif; transition: transform 0.18s ease, box-shadow 0.25s ease; cursor: pointer; border: 1px solid transparent; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: #fff; color: var(--dark); box-shadow: 0 16px 34px -14px rgba(0,0,0,0.5); }
.btn-primary:hover { box-shadow: 0 22px 44px -14px rgba(0,0,0,0.55); }
.btn-ghost { border: 1px solid rgba(255,255,255,0.3); color: #fff; background: transparent; }
button.btn-ghost { color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,0.08); }

/* section-alt buttons / contact buttons keep dark style via context */
.section .btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; box-shadow: 0 16px 30px -14px rgba(29,78,216,0.6); }

.hero-photo { position: relative; display: flex; justify-content: center; }
.hero-photo-ring { position: absolute; width: 290px; height: 290px; border-radius: 50%; background: conic-gradient(from 140deg, rgba(143,180,255,0.8), rgba(14,165,164,0.6), rgba(124,92,255,0.6), rgba(143,180,255,0.8)); filter: blur(2px); animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero-photo img { position: relative; z-index: 1; width: 250px; height: 300px; object-fit: cover; object-position: top; border-radius: 20px; border: 4px solid rgba(255,255,255,0.9); box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6); }

/* METRICS — own calm band below hero */
.metrics { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 56px auto; padding: 0 24px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 20px; text-align: center; box-shadow: var(--shadow-sm); transition: transform 0.2s ease, box-shadow 0.25s ease; }
.metric:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.metric-num { display: block; font-family: "Fraunces", serif; font-size: 28px; font-weight: 700; color: var(--accent); line-height: 1.1; margin-bottom: 8px; }
.metric-label { color: var(--muted); font-size: 13px; }

/* SECTIONS */
.section { padding: 84px 24px; }
.section-alt { background: var(--alt); }
.section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 40px; }
.section-no { font-family: "JetBrains Mono", monospace; font-size: 14px; font-weight: 500; color: var(--accent-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; }
.section-title { font-size: clamp(28px, 4vw, 40px); font-weight: 600; margin: 0; letter-spacing: -0.015em; }

/* ABOUT */
.about-grid { display: grid; grid-template-columns: 1.5fr 0.8fr; gap: 48px; align-items: start; }
.about-grid .lead { font-size: 20px; color: var(--ink); margin: 0 0 18px; line-height: 1.55; }
.about-grid p { color: var(--muted); margin: 0 0 16px; }
.about-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.about-facts li { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; padding: 14px 18px; box-shadow: var(--shadow-sm); }
.about-facts strong { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 3px; }

/* EXPERIENCE / EDUCATION timeline with spine */
.xp { position: relative; display: grid; gap: 30px; padding-left: 34px; }
.xp::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); opacity: 0.4; }
.xp-item { position: relative; }
.xp-dot { position: absolute; left: -34px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); box-shadow: 0 0 0 4px rgba(29,78,216,0.12); }
.xp-meta { font-family: "JetBrains Mono", monospace; font-size: 13px; color: var(--accent); margin-bottom: 8px; }
.xp-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow-sm); transition: transform 0.2s ease, box-shadow 0.25s ease; }
.xp-body:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.xp-body h3 { margin: 0 0 12px; font-size: 20px; font-weight: 600; }
.xp-body .at { display: block; color: var(--muted); font-weight: 500; font-family: "Inter", sans-serif; font-size: 15px; margin-top: 2px; }
.xp-body p { color: var(--muted); margin: 10px 0 0; }
.xp-body ul { margin: 0; padding-left: 18px; display: grid; gap: 7px; }
.xp-body li { color: var(--muted); }

/* SKILLS */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.skill-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); transition: transform 0.2s ease, box-shadow 0.25s ease; }
.skill-group:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.skill-group h3 { margin: 0 0 16px; font-size: 16px; color: var(--accent); font-weight: 600; font-family: "Inter", sans-serif; letter-spacing: 0.01em; }
.skill-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.skill-group li { color: var(--ink); font-size: 14px; padding-left: 20px; position: relative; }
.skill-group li::before { content: ""; position: absolute; left: 0; top: 8px; width: 7px; height: 7px; border-radius: 2px; background: var(--accent-2); transform: rotate(45deg); }

.languages { margin-top: 28px; }
.languages h3 { margin: 0 0 14px; font-size: 16px; color: var(--accent); font-weight: 600; font-family: "Inter", sans-serif; }
.lang-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.lang-chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 18px; font-size: 14px; color: var(--ink); box-shadow: var(--shadow-sm); }
.lang-chip em { color: var(--muted); font-style: normal; font-size: 13px; }

/* PUBLICATIONS */
.pub-card { position: relative; display: grid; grid-template-columns: 80px 1fr; gap: 24px; background: linear-gradient(135deg, var(--dark), #152a56); color: #fff; border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); overflow: hidden; }
.pub-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(143,180,255,0.3), transparent 70%); }
.pub-card .pub-year { position: relative; z-index: 1; font-family: "Fraunces", serif; font-weight: 700; font-size: 22px; color: #8fb4ff; }
.pub-body { position: relative; z-index: 1; }
.pub-body h3 { margin: 0 0 8px; font-size: 21px; font-weight: 600; }
.pub-body p { color: rgba(255,255,255,0.78); margin: 0 0 14px; }
.pub-link { color: #8fb4ff; font-weight: 600; font-size: 14px; }
.pub-link:hover { color: #fff; }

/* CERTIFICATIONS */
.cert-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.cert { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.cert-key { display: flex; align-items: center; gap: 18px; border: 1px solid var(--accent-soft); }
.cert-badge { flex: none; width: 56px; height: 56px; border-radius: 14px; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; font-family: "JetBrains Mono", monospace; font-weight: 500; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.cert-key strong { display: block; font-size: 15px; }
.cert-issuer { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }

/* CONTACT */
.contact-card { background: linear-gradient(135deg, var(--dark), #15306a); color: #fff; border-radius: 26px; padding: 64px 40px; text-align: center; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.contact-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(50% 80% at 50% 0%, rgba(143,180,255,0.25), transparent 70%); }
.contact-card > * { position: relative; z-index: 1; }
.contact-card h2 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 12px; font-weight: 600; }
.contact-lead { color: rgba(255,255,255,0.82); max-width: 48ch; margin: 0 auto 28px; font-size: 18px; }
.contact-card .btn-primary { background: #fff; color: var(--dark); }

/* FOOTER */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; }
.site-footer p { color: var(--muted); font-size: 14px; text-align: center; margin: 0; }

/* CV MODAL */
.cv-modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; background: rgba(11, 23, 51, 0.6); backdrop-filter: blur(5px); padding: 24px; }
.cv-modal.open { display: flex; }
.cv-modal-box { position: relative; background: var(--surface); border-radius: var(--radius); padding: 36px 40px; max-width: 430px; width: 100%; text-align: center; box-shadow: var(--shadow); }
.cv-modal-box h3 { margin: 0 0 8px; font-size: 22px; font-weight: 600; }
.cv-modal-box p { color: var(--muted); margin: 0 0 22px; font-size: 15px; }
.cv-modal-actions { display: flex; gap: 14px; justify-content: center; }
.cv-modal-actions .btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; }
.cv-modal-close { position: absolute; top: 12px; right: 16px; background: none; border: 0; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; }
.cv-modal-close:hover { color: var(--ink); }

/* RESPONSIVE */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links { position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; gap: 0; align-items: stretch; background: var(--dark); border-bottom: 1px solid rgba(255,255,255,0.1); max-height: 0; overflow: hidden; transition: max-height 0.3s; }
  .nav-links.open { max-height: 480px; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 14px 24px; }
  .nav-links .lang-toggle { margin: 12px 24px; }
  .hero-inner { grid-template-columns: 1fr; padding-top: 48px; gap: 36px; }
  .hero-photo { order: -1; }
  .hero-photo-ring { width: 230px; height: 230px; }
  .hero-photo img { width: 210px; height: 250px; }
  .hero { padding-bottom: 50px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 14px; margin: 36px auto; }
  .about-grid, .skills-grid, .cert-grid { grid-template-columns: 1fr; }
}
