:root {
  --bg: #07111f;
  --bg-soft: #0b1728;
  --surface: #0f1e31;
  --surface-2: #13243a;
  --surface-glass: rgba(12, 27, 46, .72);
  --text: #f4f7fb;
  --text-soft: #a9b7c9;
  --muted: #718096;
  --line: rgba(255, 255, 255, .11);
  --accent: #25c8e8;
  --accent-2: #878cff;
  --accent-soft: rgba(37, 200, 232, .12);
  --shadow: 0 30px 80px rgba(0, 0, 0, .28);
  --header-bg: rgba(7, 17, 31, .78);
  --max: 1180px;
  --radius-sm: 12px;
  --radius: 22px;
  --radius-lg: 34px;
}

html[data-theme="light"] {
  --bg: #f6f8fb;
  --bg-soft: #eef3f8;
  --surface: #ffffff;
  --surface-2: #edf3f8;
  --surface-glass: rgba(255, 255, 255, .82);
  --text: #122033;
  --text-soft: #536277;
  --muted: #7a8899;
  --line: rgba(15, 35, 58, .12);
  --accent: #087f9c;
  --accent-2: #5d62df;
  --accent-soft: rgba(8, 127, 156, .09);
  --shadow: 0 30px 80px rgba(21, 41, 69, .12);
  --header-bg: rgba(246, 248, 251, .82);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  margin: 0;
  font-family: Inter, "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
body.menu-open { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.skip-link {
  position: fixed; left: 16px; top: -100px; z-index: 999;
  background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px;
}
.skip-link:focus { top: 16px; }
.container { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }

.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100;
  background: var(--header-bg); border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.site-header.scrolled { border-color: var(--line); box-shadow: 0 12px 30px rgba(0,0,0,.08); }
.nav-wrap { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: "Avenir Next", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 800; letter-spacing: -.02em; }
.brand-mark {
  width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid rgba(37, 200, 232, .34);
  border-radius: 12px; color: #06111d; font-size: 13px; letter-spacing: -.05em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 26px rgba(37, 200, 232, .17);
}
.brand-text { font-size: 15px; }
.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav > a { position: relative; color: var(--text-soft); font-size: 14px; font-weight: 600; transition: color .2s ease; }
.main-nav > a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -9px; height: 2px; background: var(--accent); transition: right .25s ease; }
.main-nav > a:hover, .main-nav > a.active { color: var(--text); }
.main-nav > a:hover::after, .main-nav > a.active::after { right: 0; }
.theme-toggle, .menu-toggle { border: 1px solid var(--line); color: var(--text); background: var(--surface); cursor: pointer; }
.theme-toggle { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; }
.theme-toggle svg { width: 19px; height: 19px; }
html[data-theme="dark"] .theme-toggle .sun, html[data-theme="light"] .theme-toggle .moon { display: none; }
.menu-toggle { display: none; width: 44px; height: 44px; border-radius: 12px; padding: 11px; }
.menu-toggle span { display: block; height: 2px; margin: 4px 0; background: currentColor; border-radius: 999px; transition: transform .2s ease, opacity .2s ease; }

.hero { position: relative; overflow: hidden; padding: 150px 0 58px; background: radial-gradient(circle at 70% 22%, rgba(76, 103, 255, .13), transparent 29%), var(--bg); }
.hero-grid-bg { position: absolute; inset: 0; opacity: .25; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 72px 72px; mask-image: linear-gradient(to bottom, black, transparent 90%); }
.hero-orb { position: absolute; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.hero-orb-one { width: 360px; height: 360px; right: -140px; top: 90px; background: radial-gradient(circle, rgba(37, 200, 232, .19), transparent 68%); }
.hero-orb-two { width: 300px; height: 300px; left: -140px; bottom: 20px; background: radial-gradient(circle, rgba(135, 140, 255, .13), transparent 70%); }
.hero-layout { position: relative; display: grid; grid-template-columns: 1.2fr .8fr; gap: 82px; align-items: center; }
.eyebrow { margin: 0 0 18px; color: var(--accent); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .16em; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(37, 200, 232, .1); }
h1, h2, h3 { font-family: "Avenir Next", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; margin-top: 0; line-height: 1.15; letter-spacing: -.035em; }
h1 { max-width: 820px; margin-bottom: 24px; font-size: clamp(3rem, 6vw, 5.25rem); font-weight: 800; }
h2 { margin-bottom: 0; font-size: clamp(2.25rem, 4vw, 3.55rem); }
h3 { font-size: 1.25rem; }
.hero-lead { max-width: 720px; margin: 0 0 34px; color: var(--text-soft); font-size: clamp(1.05rem, 2vw, 1.24rem); }
.hero-lead strong { color: var(--text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 13px; margin-bottom: 33px; }
.button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 11px; padding: 0 20px; border: 1px solid transparent; border-radius: 14px; font-size: 14px; font-weight: 700; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease; }
.button:hover { transform: translateY(-2px); }
.button svg { width: 18px; height: 18px; }
.button-primary { color: #04121c; background: linear-gradient(135deg, var(--accent), #5be2cf); box-shadow: 0 16px 40px rgba(37, 200, 232, .18); }
.button-secondary { color: var(--text); border-color: var(--line); background: var(--surface-glass); }
.button-secondary:hover { border-color: rgba(37, 200, 232, .42); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 26px; color: var(--text-soft); font-size: 14px; }
.hero-meta span, .hero-meta a { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta svg { width: 17px; height: 17px; color: var(--accent); }
.hero-meta a:hover { color: var(--text); }

.hero-visual { position: relative; }
.profile-frame { position: relative; width: min(100%, 410px); margin-left: auto; padding: 12px; border: 1px solid var(--line); border-radius: 34px; background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.015)); box-shadow: var(--shadow); }
.profile-frame::before { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; background: linear-gradient(145deg, rgba(37,200,232,.35), transparent 34%, transparent 66%, rgba(135,140,255,.25)); }
.profile-frame img { width: 100%; aspect-ratio: .84; object-fit: cover; object-position: 50% 38%; border-radius: 25px; }
.profile-label { position: absolute; z-index: 2; top: 28px; right: 27px; padding: 7px 12px; color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; background: rgba(5,15,26,.64); backdrop-filter: blur(8px); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.profile-card { position: absolute; left: -46px; bottom: 34px; display: flex; align-items: center; gap: 12px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-glass); box-shadow: 0 22px 50px rgba(0,0,0,.22); backdrop-filter: blur(18px); }
.profile-card-icon { width: 41px; height: 41px; display: grid; place-items: center; border-radius: 12px; color: var(--accent); background: var(--accent-soft); }
.profile-card-icon svg { width: 23px; height: 23px; }
.profile-card span:last-child { display: grid; }
.profile-card strong { font-family: "Avenir Next", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 13px; }
.profile-card small { color: var(--text-soft); font-size: 11px; }
.stats-strip { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 80px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats-strip > div { min-height: 104px; display: flex; flex-direction: column; justify-content: center; padding: 18px 28px; border-right: 1px solid var(--line); }
.stats-strip > div:first-child { padding-left: 0; }
.stats-strip > div:last-child { border-right: 0; }
.stats-strip strong { font-family: "Avenir Next", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 21px; }
.stats-strip span { color: var(--text-soft); font-size: 12px; }

.section { padding: 112px 0; }
.section-tinted { background: var(--bg-soft); }
.split-layout { display: grid; grid-template-columns: .75fr 1.25fr; gap: 90px; align-items: start; }
.section-heading { max-width: 690px; }
.heading-row { max-width: none; display: grid; grid-template-columns: 1.2fr .8fr; gap: 70px; align-items: end; margin-bottom: 54px; }
.heading-row > p { margin: 0 0 5px; color: var(--text-soft); }
.large-copy { margin: 0 0 20px; color: var(--text); font-family: "Avenir Next", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: clamp(1.45rem, 2.4vw, 2.1rem); line-height: 1.35; letter-spacing: -.025em; }
.profile-content > p:not(.large-copy) { color: var(--text-soft); }
.focus-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 46px; }
.focus-card { position: relative; min-height: 230px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; transition: transform .25s ease, border-color .25s ease; }
.focus-card:hover { transform: translateY(-4px); border-color: rgba(37,200,232,.35); }
.card-number { display: block; margin-bottom: 48px; color: var(--accent); font-family: "Avenir Next", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 12px; font-weight: 800; }
.focus-card h3 { margin-bottom: 10px; }
.focus-card p { margin: 0; color: var(--text-soft); font-size: 14px; }

.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.project-card { min-height: 390px; display: flex; flex-direction: column; padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.project-card:hover { transform: translateY(-5px); border-color: rgba(37,200,232,.33); box-shadow: 0 24px 55px rgba(0,0,0,.12); }
.project-featured { grid-row: span 2; min-height: 798px; padding: 42px; background: linear-gradient(160deg, rgba(37,200,232,.12), transparent 34%), var(--surface); }
.project-topline { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 45px; color: var(--text-soft); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.project-icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 36px; border-radius: 17px; color: var(--accent); background: var(--accent-soft); }
.project-icon svg { width: 29px; height: 29px; }
.project-card h3 { max-width: 520px; margin-bottom: 16px; font-size: clamp(1.55rem, 3vw, 2.4rem); }
.project-card:not(.project-featured) h3 { font-size: 1.58rem; }
.project-card p { margin: 0 0 28px; color: var(--text-soft); }
.project-featured p { max-width: 650px; font-size: 1.08rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: auto 0 0; padding: 0; list-style: none; }
.tag-list li { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-soft); font-size: 11px; font-weight: 600; }

.timeline { position: relative; max-width: 980px; margin: 62px auto 0; }
.timeline::before { content: ""; position: absolute; left: 179px; top: 10px; bottom: 10px; width: 1px; background: var(--line); }
.timeline-item { position: relative; display: grid; grid-template-columns: 150px 1fr; gap: 62px; padding: 0 0 58px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: 173px; top: 9px; width: 13px; height: 13px; border: 3px solid var(--bg); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline-date { padding-top: 1px; color: var(--accent); font-family: "Avenir Next", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 13px; font-weight: 800; text-align: right; }
.timeline-kicker { margin: 0 0 8px; color: var(--text-soft); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.timeline-content h3 { margin-bottom: 11px; font-size: 1.55rem; }
.timeline-content > p:last-child { margin: 0; color: var(--text-soft); }

.skills-layout { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 54px; }
.skill-panel { padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.skill-panel-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 28px; }
.skill-panel-head span { color: var(--accent); font-size: 11px; font-weight: 800; }
.skill-panel-head h3 { margin: 0; font-size: 1.36rem; }
.skill-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.skill-chips span { padding: 8px 12px; border-radius: 10px; color: var(--text-soft); background: var(--bg-soft); font-size: 12px; font-weight: 600; }

.credentials-layout { display: grid; grid-template-columns: .75fr 1.25fr; gap: 90px; }
.credentials-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.credential-card { min-height: 218px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.credential-type { display: block; margin-bottom: 38px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.credential-card h3 { margin-bottom: 10px; }
.credential-card p { margin: 0; color: var(--text-soft); font-size: 14px; }
.credential-featured { grid-column: 1 / -1; min-height: auto; }
.credential-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 22px; color: var(--accent); font-size: 13px; font-weight: 800; }
.credential-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.credential-link svg { width: 16px; height: 16px; }
.additional-info { grid-column: 2; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; padding-top: 16px; }
.additional-info > div { display: grid; gap: 4px; padding: 20px 24px; border-top: 1px solid var(--line); }
.additional-info span { color: var(--text-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.additional-info strong { font-family: "Avenir Next", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; }

.contact-section { padding: 38px 0 90px; }
.contact-card { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; padding: 64px; border-radius: var(--radius-lg); color: #f7fbff; background: linear-gradient(135deg, #0f5163 0%, #152d60 58%, #3e3f8b 100%); box-shadow: var(--shadow); }
.contact-card::after { content: ""; position: absolute; width: 330px; height: 330px; right: -110px; top: -150px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; box-shadow: 0 0 0 58px rgba(255,255,255,.045), 0 0 0 116px rgba(255,255,255,.03); }
.contact-copy, .contact-actions { position: relative; z-index: 1; }
.contact-copy .eyebrow { color: #7ee8ff; }
.contact-copy h2 { margin-bottom: 18px; }
.contact-copy p:last-child { max-width: 520px; margin: 0; color: rgba(255,255,255,.74); }
.contact-actions { display: grid; gap: 12px; }
.contact-link { display: flex; align-items: center; gap: 14px; padding: 15px 17px; border: 1px solid rgba(255,255,255,.16); border-radius: 15px; background: rgba(255,255,255,.07); transition: background .2s ease, transform .2s ease; }
.contact-link:hover { transform: translateX(3px); background: rgba(255,255,255,.12); }
.contact-icon { width: 41px; height: 41px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.1); }
.contact-icon svg { width: 21px; height: 21px; }
.contact-link span:last-child { display: grid; }
.contact-link small { color: rgba(255,255,255,.62); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.contact-link strong { font-size: 14px; }
.button-light { margin-top: 4px; color: #10233e; background: #fff; justify-self: start; }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 108px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer-brand { font-size: 14px; }
.footer-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.site-footer p { color: var(--text-soft); font-size: 12px; }
.back-top { display: inline-flex; align-items: center; gap: 7px; color: var(--text-soft); font-size: 12px; font-weight: 700; }
.back-top:hover { color: var(--text); }
.back-top svg { width: 15px; height: 15px; }

.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

@media (max-width: 980px) {
  .main-nav { position: fixed; inset: 76px 0 auto; display: grid; gap: 0; padding: 18px 20px 25px; border-bottom: 1px solid var(--line); background: var(--bg); transform: translateY(-140%); opacity: 0; pointer-events: none; transition: transform .25s ease, opacity .25s ease; }
  .main-nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .main-nav > a { padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 16px; }
  .main-nav > a::after { display: none; }
  .theme-toggle { margin-top: 16px; }
  .menu-toggle { display: block; }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .hero-layout { grid-template-columns: 1fr; gap: 60px; }
  .hero-copy { max-width: 780px; }
  .profile-frame { margin: 0 auto; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .stats-strip > div:nth-child(2) { border-right: 0; }
  .stats-strip > div:first-child { padding-left: 28px; }
  .stats-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .split-layout, .credentials-layout { grid-template-columns: 1fr; gap: 44px; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-featured { grid-row: auto; min-height: auto; }
  .additional-info { grid-column: 1; }
  .contact-card { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .container { width: min(calc(100% - 28px), var(--max)); }
  .section { padding: 82px 0; }
  .hero { padding-top: 126px; }
  h1 { font-size: clamp(2.65rem, 13vw, 4.2rem); }
  .hero-meta { display: grid; gap: 12px; }
  .profile-frame { width: min(88%, 390px); }
  .profile-card { left: -20px; bottom: 22px; padding: 12px; }
  .stats-strip { margin-top: 58px; }
  .stats-strip > div { min-height: 92px; padding: 16px; }
  .stats-strip > div:first-child { padding-left: 16px; }
  .stats-strip strong { font-size: 17px; }
  .heading-row { grid-template-columns: 1fr; gap: 22px; margin-bottom: 38px; }
  .focus-grid, .skills-layout, .credentials-grid, .additional-info { grid-template-columns: 1fr; }
  .credential-featured { grid-column: auto; }
  .focus-card { min-height: 205px; }
  .project-card, .project-featured { padding: 26px; }
  .project-card { min-height: 360px; }
  .project-topline { margin-bottom: 30px; }
  .timeline::before { left: 5px; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; padding-left: 35px; }
  .timeline-item::before { left: -1px; }
  .timeline-date { text-align: left; }
  .contact-card { padding: 38px 24px; border-radius: 24px; }
  .footer-inner { padding: 30px 0; flex-direction: column; text-align: center; }
}

@media (max-width: 440px) {
  .brand-text { display: none; }
  .hero-actions { display: grid; }
  .button { width: 100%; }
  .stats-strip { grid-template-columns: 1fr; }
  .stats-strip > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .stats-strip > div:last-child { border-bottom: 0; }
  .profile-card { left: -8px; right: -8px; bottom: 14px; }
  .profile-label { top: 20px; right: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .hero-actions, .theme-toggle, .menu-toggle, .contact-section, .site-footer, .hero-grid-bg, .hero-orb { display: none !important; }
  body, .hero, .section, .section-tinted { background: #fff !important; color: #111 !important; }
  .hero { padding-top: 30px; }
  .section { padding: 30px 0; }
  .hero-layout, .split-layout, .credentials-layout { grid-template-columns: 1fr; }
  .profile-frame { max-width: 240px; margin: 0; }
  .project-card, .focus-card, .skill-panel, .credential-card { break-inside: avoid; border-color: #ccc; color: #111; }
  p, .hero-lead, .timeline-content > p:last-child, .project-card p, .focus-card p, .credential-card p { color: #333 !important; }
}
