:root {
  --bg: #07111f;
  --bg-elevated: #0b1728;
  --surface: #0e1c2f;
  --surface-2: #12233a;
  --text: #f4f7fb;
  --muted: #9fafc3;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #69a2ff;
  --accent-strong: #8ab6ff;
  --accent-soft: rgba(105, 162, 255, 0.12);
  --header-bg: rgba(7, 17, 31, 0.82);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --max: 1180px;
}

html[data-theme="light"] {
  --bg: #f5f7fb;
  --bg-elevated: #eef3f9;
  --surface: #ffffff;
  --surface-2: #eaf0f7;
  --text: #0c1828;
  --muted: #566579;
  --line: rgba(12, 24, 40, 0.10);
  --line-strong: rgba(12, 24, 40, 0.16);
  --accent: #245fc6;
  --accent-strong: #164da9;
  --accent-soft: rgba(36, 95, 198, 0.10);
  --header-bg: rgba(245, 247, 251, 0.88);
  --shadow: 0 24px 70px rgba(35, 56, 82, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  transition: background-color 220ms ease, color 220ms ease;
}

::selection {
  background: var(--accent);
  color: #06101d;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--text);
  color: var(--bg);
  border-radius: 10px;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.wrap {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}

.section {
  padding: 120px 0;
  position: relative;
}

.section-toned {
  background: var(--bg-elevated);
  border-block: 1px solid var(--line);
}

/* Header */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.site-header.scrolled {
  border-bottom-color: var(--line);
}

.nav-shell {
  width: min(var(--max), calc(100% - 48px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: var(--accent-soft);
}

.desktop-nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}

.desktop-nav a,
.nav-linkedin {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  transition: color 150ms ease;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.nav-linkedin:hover {
  color: var(--text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-linkedin {
  margin-left: 8px;
}

.theme-toggle,
.menu-toggle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.theme-toggle:hover,
.menu-toggle:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.menu-toggle {
  display: none;
}

.menu-toggle span {
  display: block;
  width: 17px;
  height: 1.5px;
  background: currentColor;
  transition: transform 180ms ease;
}

.menu-toggle span + span {
  margin-top: 5px;
}

.menu-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

.mobile-nav {
  border-top: 1px solid var(--line);
  padding: 12px 24px 22px;
  background: var(--header-bg);
}

.mobile-nav a {
  display: block;
  padding: 11px 0;
  color: var(--muted);
  font-weight: 650;
}

/* Hero */

.hero {
  min-height: 100svh;
  padding-top: 150px;
  padding-bottom: 100px;
  display: grid;
  align-items: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  width: 700px;
  height: 700px;
  right: -280px;
  top: 4%;
  background: radial-gradient(
    circle,
    rgba(68, 126, 224, 0.13),
    transparent 68%
  );
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.75fr);
  gap: clamp(52px, 8vw, 110px);
  align-items: center;
}

.eyebrow,
.section-kicker,
.card-label {
  margin: 0 0 16px;
  color: var(--accent-strong);
  font-size: 0.77rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(4rem, 8vw, 7.6rem);
  line-height: 0.91;
  letter-spacing: -0.065em;
  font-weight: 780;
  max-width: 760px;
}

.hero-intro {
  max-width: 680px;
  margin: 32px 0 0;
  color: var(--muted);
  font-size: clamp(1.06rem, 1.6vw, 1.28rem);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border-radius: 14px;
  font-size: 0.94rem;
  font-weight: 750;
  border: 1px solid transparent;
  transition: transform 150ms ease, background-color 150ms ease,
    border-color 150ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  background: var(--accent);
  color: #06101d;
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.button.secondary:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

/* Hero photo */

.hero-photo-wrap {
  position: relative;
  width: 320px;
  height: 430px;
  justify-self: center;
}

.photo-glow {
  position: absolute;
  inset: 12% 5% -10% 10%;
  border-radius: 45%;
  filter: blur(40px);
  background: radial-gradient(
    circle,
    rgba(105, 162, 255, 0.22),
    transparent 70%
  );
  pointer-events: none;
}

.hero-photo {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: clamp(28px, 4vw, 48px);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* General sections */

.split-section {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: clamp(60px, 9vw, 130px);
}

h2 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.2rem, 4.5vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  font-weight: 760;
}

.body-copy {
  max-width: 680px;
  font-size: 1.08rem;
}

.body-copy p {
  margin: 0 0 22px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.91rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 28px;
  margin-bottom: 58px;
}

.text-link {
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 760;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
}

.text-link:hover {
  border-bottom-color: currentColor;
}

/* Experience timeline */

.timeline {
  max-width: 980px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 34px;
  position: relative;
  padding-bottom: 18px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 166px;
  top: 28px;
  bottom: -18px;
  width: 1px;
  background: var(--line);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-date {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  padding-top: 22px;
  text-align: right;
}

.timeline-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 25px 28px;
}

.timeline-card::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 28px;
  width: 10px;
  height: 10px;
  border: 3px solid var(--bg-elevated);
  border-radius: 999px;
  background: var(--accent);
}

.timeline-card h3,
.summary-title,
.info-card h3,
.interest-card h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
  font-weight: 760;
}

.company {
  display: block;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.timeline-note {
  margin: 14px 0 0;
  color: var(--muted);
}

.role-line {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
}

.status-pill {
  padding: 6px 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid rgba(105, 162, 255, 0.18);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

details.expandable {
  padding: 0;
}

details.expandable summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  cursor: pointer;
  padding: 25px 28px;
}

details.expandable summary::-webkit-details-marker {
  display: none;
}

.expand-label {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 760;
}

.expand-label::after {
  content: " +";
}

details[open] .expand-label::after {
  content: " -";
}

.experience-details {
  border-top: 1px solid var(--line);
  padding: 0 28px 25px;
  color: var(--muted);
}

.experience-details ul {
  margin: 22px 0 0;
  padding-left: 20px;
}

.experience-details li {
  margin: 9px 0;
}

.earlier-role {
  margin: 18px 0 0;
  font-size: 0.92rem;
}

/* Education */

.education-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.info-card,
.interest-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 32px;
}

.info-card p {
  margin: 8px 0 0;
}

/* Outside work */

.interests-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.interest-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
}

.interest-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.interest-card p {
  color: var(--muted);
  margin: 14px 0 0;
}

/* Contact */

.contact-section {
  padding-top: 100px;
}

.contact-card {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 60px;
  align-items: center;
  padding: clamp(34px, 5vw, 64px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(
      circle at 85% 10%,
      rgba(105, 162, 255, 0.12),
      transparent 34%
    ),
    var(--surface);
}

.contact-copy {
  max-width: 680px;
  color: var(--muted);
  margin: 22px 0 0;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.contact-actions .text-link {
  text-align: center;
  padding-top: 8px;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: 0.87rem;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a:hover {
  color: var(--text);
}

/* Reveal animations */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 650ms ease, transform 650ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Accessibility */

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Tablet */

@media (max-width: 900px) {
  .desktop-nav,
  .nav-linkedin {
    display: none;
  }

  .nav-actions {
    margin-left: auto;
  }

  .menu-toggle {
    display: block;
  }

  .hero {
    min-height: auto;
    padding-top: 128px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .hero-copy {
    order: 1;
  }

  .hero-photo-wrap {
    order: 2;
    width: min(300px, 75%);
    margin: 0 auto;
  }

  .scroll-cue {
    display: none;
  }

  .split-section {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .contact-card {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .interests-grid {
    grid-template-columns: 1fr;
  }

  .interest-card {
    min-height: 0;
  }
}

/* Mobile */

@media (max-width: 680px) {
  .wrap,
  .nav-shell {
    width: min(100% - 30px, var(--max));
  }

  .section {
    padding: 84px 0;
  }

  .nav-shell {
    height: 68px;
  }

  .hero {
    padding-top: 112px;
    padding-bottom: 78px;
  }

  .hero h1 {
    font-size: clamp(3.25rem, 17vw, 5rem);
  }

  .hero-intro {
    margin-top: 24px;
  }

  .hero-actions {
    margin-top: 28px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    margin-bottom: 38px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 9px;
    padding-bottom: 16px;
  }

  .timeline-date {
    text-align: left;
    padding-top: 0;
  }

  .timeline-item::before,
  .timeline-card::before {
    display: none;
  }

  .timeline-card {
    padding: 22px;
  }

  details.expandable summary {
    padding: 22px;
  }

  .experience-details {
    padding: 0 22px 22px;
  }

  .education-grid {
    grid-template-columns: 1fr;
  }

  .info-card,
  .interest-card {
    padding: 26px;
  }

  .contact-card {
    padding: 28px 22px;
    border-radius: 22px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

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