:root {
  --bg: #081018;
  --bg-raise: #101a2a;
  --heading: #f5f8fc;
  --text: #d5deeb;
  --muted: #b7c4d8;
  --soft: #93a4bd;
  --line: rgba(186, 210, 245, 0.14);
  --line-strong: rgba(186, 210, 245, 0.28);
  --accent: #9ec0ff;
  --accent-solid: #2563eb;
  --accent-solid-hover: #1d4ed8;
  --glass: rgba(14, 24, 40, 0.72);
  --shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
  --header: 4.25rem;
  --radius: 20px;
  --max: 1120px;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --display: "Outfit", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  background: var(--bg);
  color-scheme: dark;
  overflow-x: clip;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 480px at 100% -10%, rgba(37, 99, 235, 0.22), transparent 58%),
    radial-gradient(680px 420px at -10% 15%, rgba(56, 189, 248, 0.08), transparent 52%),
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: auto, auto, 76px 76px, 76px 76px;
}

body.nav-open {
  overflow: hidden;
}

body.nav-open::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(4, 8, 16, 0.62);
}

::selection {
  background: rgba(158, 192, 255, 0.35);
  color: #fff;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--heading);
}

p,
ul,
ol {
  margin: 0;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 80;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--heading);
  color: #081018;
  font-weight: 650;
}

.skip:focus {
  top: 0.8rem;
}

.container {
  width: min(var(--max), calc(100% - clamp(2.5rem, 8vw, 7rem)));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header);
  background: rgba(8, 16, 24, 0.72);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(8, 16, 24, 0.88);
}

.header-bar {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: 0.35rem;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 26, 42, 0.8);
}

.lang-btn {
  min-width: 2.4rem;
  min-height: 2rem;
  padding: 0 0.55rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.lang-btn.is-active {
  background: var(--accent-solid);
  color: #fff;
}

.lang-btn:hover {
  color: var(--heading);
}

.lang-btn.is-active:hover {
  color: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  color: var(--heading);
  text-decoration: none;
}

.brand::before {
  content: "";
  width: 3px;
  height: 1.85rem;
  border-radius: 99px;
  background: linear-gradient(180deg, #9ec0ff, #2563eb);
  flex: none;
}

.brand-copy {
  display: grid;
  gap: 0.12rem;
  line-height: 1.1;
}

.brand-name {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.brand-role {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 26, 42, 0.8);
  color: var(--heading);
  cursor: pointer;
}

.burger,
.burger::before,
.burger::after {
  display: block;
  width: 16px;
  height: 1.5px;
  margin-inline: auto;
  border-radius: 99px;
  background: currentColor;
  position: relative;
}

.burger::before,
.burger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
}

.burger::before {
  top: -5px;
}

.burger::after {
  top: 5px;
}

.nav-toggle[aria-expanded="true"] .burger {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .burger::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .burger::after {
  top: 0;
  transform: rotate(-45deg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.35rem 0.7rem;
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.35rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--heading);
}

.nav-link.is-active::after,
.nav-link:hover::after {
  transform: scaleX(1);
}

.hero {
  padding: 3.25rem 0 4.25rem;
}

.hero-grid {
  display: grid;
  gap: 2.25rem;
}

.eyebrow,
.index,
.kicker {
  margin: 0 0 0.85rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  color: var(--heading);
  font-family: var(--display);
  font-size: clamp(2.15rem, 6vw, 4.6rem);
  font-weight: 620;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.subtitle {
  max-width: 40rem;
  margin-top: 1.25rem;
  color: var(--text);
  font-size: 1.12rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.75rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--display);
  font-size: 0.98rem;
  font-weight: 580;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.btn-primary {
  background: var(--accent-solid);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-solid-hover);
  color: #fff;
}

.btn-primary:hover svg {
  transform: translateX(3px);
}

.btn-ghost {
  border-color: var(--line-strong);
  background: rgba(16, 26, 42, 0.45);
  color: var(--heading);
}

.btn-ghost:hover {
  border-color: rgba(158, 192, 255, 0.55);
  background: rgba(37, 99, 235, 0.12);
  color: var(--heading);
}

.location-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.15rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.location-line svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.focus-card {
  padding: 1.25rem 1.25rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20, 34, 56, 0.78), rgba(10, 18, 32, 0.62));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.focus-card h2 {
  margin: 0 0 0.85rem;
  color: var(--heading);
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.focus-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.focus-list li {
  display: grid;
  grid-template-columns: minmax(8.5rem, auto) 1fr;
  gap: 0.75rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
}

.focus-list strong {
  color: var(--heading);
  font-weight: 620;
}

.focus-list span {
  color: var(--muted);
}

section {
  scroll-margin-top: calc(var(--header) + 0.8rem);
  padding: 4.5rem 0;
}

.section-head {
  max-width: 40rem;
  margin-bottom: 1.75rem;
}

.section-head h2,
.job h3,
.project-body h3,
.panel h3,
.education h3 {
  margin: 0;
  color: var(--heading);
  font-family: var(--display);
  font-weight: 610;
  letter-spacing: -0.03em;
}

.section-head h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.15;
}

.lead {
  margin-top: 1rem;
  color: var(--heading);
  font-size: 1.18rem;
  line-height: 1.55;
}

.about-grid,
.contact-grid {
  display: grid;
  gap: 1.25rem;
}

.prose {
  display: grid;
  gap: 1rem;
}

.prose p {
  margin: 0;
}

.stack {
  display: grid;
  gap: 1rem;
}

.panel {
  padding: 1.2rem 1.25rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(14, 24, 40, 0.72);
  backdrop-filter: blur(14px);
}

.panel h3 {
  margin-bottom: 0.9rem;
  font-size: 1.05rem;
}

.facts {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

.facts div {
  display: grid;
  gap: 0.15rem;
}

.facts dt {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.facts dd {
  margin: 0;
  color: var(--heading);
}

.lang-list,
.duties,
.highlights,
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lang-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}

.lang-list span {
  color: var(--heading);
}

.lang-list strong {
  color: var(--muted);
  font-weight: 550;
  text-align: right;
}

.job,
.education,
.project-card,
.skill-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 22, 38, 0.78);
  backdrop-filter: blur(12px);
}

.job,
.education {
  padding: 1.4rem 1.3rem 1.35rem;
}

.job-top,
.education-top,
.project-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.job h3,
.education h3,
.project-body h3 {
  font-size: 1.45rem;
  line-height: 1.2;
}

.meta {
  margin-top: 0.35rem;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(158, 192, 255, 0.35);
  background: rgba(37, 99, 235, 0.14);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary {
  margin-top: 1rem;
  max-width: 48rem;
}

.block-label {
  margin: 1.35rem 0 0.75rem;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project-top .kicker {
  margin: 0;
}

.interests {
  margin-top: 1rem;
}

.duties,
.highlights {
  display: grid;
  gap: 0.65rem;
}

.duties li,
.highlights li {
  position: relative;
  padding-left: 1rem;
}

.duties li::before,
.highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent-solid);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.92rem;
}

.jobs {
  display: grid;
  gap: 1rem;
}

.education {
  margin-top: 1rem;
}

.edu-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  margin: 1rem 0 0;
}

.edu-stats div {
  display: grid;
  gap: 0.15rem;
}

.edu-stats dt {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.edu-stats dd {
  margin: 0;
  color: var(--heading);
  font-family: var(--display);
  font-size: 1.2rem;
}

.cert-note {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.degree {
  margin-top: 0.4rem;
  color: var(--heading);
  font-size: 1.05rem;
}

.skill-grid {
  display: grid;
  gap: 1rem;
}

.skill-card {
  padding: 1.15rem 1.15rem 1.2rem;
}

.skill-card h3 {
  margin: 0 0 0.9rem;
  color: var(--heading);
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 600;
}

.skill-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skill-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.skill-top span:first-child {
  color: var(--heading);
}

.level {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
}

.meter span {
  height: 4px;
  border-radius: 99px;
  background: rgba(158, 192, 255, 0.16);
}

.meter span.on {
  background: linear-gradient(90deg, #2563eb, #8eb6ff);
}

.section-note {
  max-width: 44rem;
  margin-bottom: 1.25rem;
  color: var(--muted);
}

.project-grid {
  display: grid;
  gap: 1rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-top: 2px solid rgba(158, 192, 255, 0.28);
}

.project-card.is-featured {
  border-top-color: #6ea8ff;
}

.project-body,
.highlights {
  padding: 1.25rem 1.2rem;
}

.project-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}

.project-body .tags {
  margin-top: auto;
}

.highlights {
  margin: 0;
  border-top: 1px solid var(--line);
}

.contact-copy h2 {
  margin: 0;
  color: var(--heading);
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 610;
  letter-spacing: -0.04em;
  line-height: 1.08;
  text-wrap: balance;
}

.contact-copy p {
  max-width: 38rem;
  margin-top: 1rem;
}

.contact-links {
  display: grid;
  gap: 0.75rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 76px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(14, 24, 40, 0.72);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.contact-link:hover {
  border-color: rgba(158, 192, 255, 0.5);
  color: inherit;
  transform: translateY(-2px);
}

.contact-icon {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.16);
  color: var(--accent);
}

.contact-icon svg {
  width: 18px;
  height: 18px;
}

.contact-link span {
  display: grid;
  min-width: 0;
}

.contact-label {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-value {
  color: var(--heading);
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

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

.footer-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--heading);
}

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (max-width: 1039px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .header-tools {
    margin-left: auto;
  }

  .lang-btn {
    min-height: 2.5rem;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    right: 0;
    display: grid;
    gap: 0.15rem;
    max-height: calc(100svh - var(--header) - 1.25rem);
    padding: 0.45rem;
    overflow: auto;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: #0c1626;
    box-shadow: var(--shadow);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
  }

  .nav-links.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .nav-link {
    width: 100%;
    min-height: 48px;
    padding-inline: 0.9rem;
    border-radius: 10px;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link.is-active,
  .nav-link:hover {
    background: rgba(37, 99, 235, 0.14);
  }
}

@media (max-width: 720px) {
  .container {
    width: min(var(--max), calc(100% - 2rem));
  }

  .brand-role {
    display: none;
  }

  section {
    padding: 3.4rem 0;
  }

  .hero {
    padding: 2.2rem 0 3rem;
  }

  .focus-list li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .cta-row {
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .lang-list li,
  .skill-top,
  .job-top {
    align-items: flex-start;
  }

  .lang-list strong,
  .level {
    text-align: left;
  }
}

@media (min-width: 721px) {
  .duties {
    grid-template-columns: 1fr 1fr;
    column-gap: 1.5rem;
  }
}

@media (min-width: 800px) {
  .skill-grid {
    grid-template-columns: 1fr 1fr;
  }

  .skill-card.is-broad {
    grid-column: 1 / -1;
  }

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

  .project-card.is-wide {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
  }

  .project-card.is-wide .highlights {
    border-top: 0;
    border-left: 1px solid var(--line);
  }
}

@media (min-width: 960px) {
  .hero-grid,
  .about-grid,
  .contact-grid {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
    gap: 3rem;
  }

  .hero-grid {
    align-items: center;
    gap: 4rem;
  }

  .contact-grid {
    align-items: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

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

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header,
  .focus-card,
  .panel,
  .job,
  .education,
  .project-card,
  .skill-card,
  .contact-link {
    background: #121c2e;
  }
}

@media print {
  body {
    background: #fff;
    color: #172033;
  }

  body::before,
  .site-header,
  .nav-toggle,
  .cta-row,
  .focus-card {
    display: none;
  }

  .hero {
    min-height: 0;
    padding-top: 0;
  }

  a {
    color: #172033;
  }

  .job,
  .education,
  .project-card,
  .skill-card,
  .panel,
  .contact-link {
    background: #fff;
    border-color: #d5dbe6;
    box-shadow: none;
  }
}
