:root {
  --bg: #080d1a;
  --bg-elevated: #0d1528;
  --card: rgba(17, 28, 52, 0.74);
  --card-strong: rgba(20, 33, 61, 0.94);
  --text: #f8fafc;
  --muted: #9ca9bd;
  --soft: #c8d3e3;
  --line: rgba(148, 163, 184, 0.18);
  --brand: #8bd5ff;
  --brand-strong: #38bdf8;
  --accent: #c4b5fd;
  --success: #5eead4;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
  --radius-lg: 32px;
  --radius-md: 22px;
  --radius-sm: 14px;
  --container: 1140px;
  --nav-height: 78px;
}

:root[data-theme='light'] {
  --bg: #f6f8fb;
  --bg-elevated: #ffffff;
  --card: rgba(255, 255, 255, 0.84);
  --card-strong: rgba(255, 255, 255, 0.97);
  --text: #0f172a;
  --muted: #56647a;
  --soft: #334155;
  --line: rgba(15, 23, 42, 0.12);
  --brand: #0369a1;
  --brand-strong: #0284c7;
  --accent: #6d28d9;
  --success: #0f766e;
  --shadow: 0 28px 90px rgba(15, 23, 42, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 12%, rgba(56, 189, 248, 0.2), transparent 30%),
    radial-gradient(circle at 88% 8%, rgba(196, 181, 253, 0.18), transparent 28%),
    linear-gradient(180deg, var(--bg), var(--bg) 42%, var(--bg-elevated));
  line-height: 1.6;
  min-height: 100vh;
}

body.nav-open {
  overflow: hidden;
}

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

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 1000;
  transform: translateY(-140%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 180ms ease;
}

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

.container {
  width: min(calc(100% - 40px), var(--container));
  margin-inline: auto;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(8, 13, 26, 0.72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
  transition: background 180ms ease, box-shadow 180ms ease;
}

:root[data-theme='light'] .site-header {
  background: rgba(246, 248, 251, 0.78);
}

.site-header.is-scrolled {
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-strong), var(--accent));
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  box-shadow: 0 16px 38px rgba(56, 189, 248, 0.2);
}

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

.brand-copy strong {
  font-size: 0.98rem;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a,
.theme-toggle,
.nav-toggle {
  color: var(--soft);
  border: 1px solid transparent;
  background: transparent;
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.nav-links a:hover,
.theme-toggle:hover,
.nav-toggle:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.12);
  border-color: var(--line);
}

.theme-toggle {
  color: var(--brand);
  border-color: var(--line);
}

.nav-toggle {
  display: none;
}

.hero {
  min-height: calc(100vh - var(--nav-height));
  display: grid;
  align-items: center;
  overflow: hidden;
  padding-top: 76px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.78fr);
  gap: 54px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--brand);
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(3.2rem, 7.2vw, 6.9rem);
  line-height: 0.92;
  letter-spacing: -0.075em;
  margin-bottom: 26px;
  max-width: 940px;
}

h2 {
  font-size: clamp(2.2rem, 4vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  margin-bottom: 18px;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.22;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero-lede,
.section-heading p,
.contact-card p {
  color: var(--soft);
  font-size: 1.08rem;
  max-width: 740px;
}

.hero-lede {
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  margin-bottom: 34px;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 800;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
  cursor: pointer;
}

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

.button.primary {
  background: linear-gradient(135deg, var(--brand-strong), var(--accent));
  border-color: transparent;
  color: white;
  box-shadow: 0 18px 44px rgba(56, 189, 248, 0.24);
}

.button.secondary {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
}

.button.ghost {
  background: transparent;
  color: var(--soft);
}

.credential-strip {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.credential-strip span,
.tag-row span,
.logo-row span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.09);
  color: var(--soft);
  font-weight: 800;
  font-size: 0.84rem;
}

.hero-card {
  position: relative;
}

.terminal-card {
  background: var(--card-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.terminal-top {
  display: flex;
  gap: 8px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.08);
}

.terminal-top span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--line);
}

.terminal-body {
  padding: 24px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
}

.terminal-body p {
  color: var(--brand);
  margin-bottom: 16px;
}

.prompt {
  color: var(--success);
}

.terminal-body ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
  color: var(--soft);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.metric-grid div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  backdrop-filter: blur(14px);
}

.metric-grid strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.05em;
}

.metric-grid span {
  display: block;
  color: var(--muted);
  margin-top: 8px;
  font-weight: 700;
  font-size: 0.86rem;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  pointer-events: none;
  opacity: 0.52;
}

.hero-orb.one {
  width: 280px;
  height: 280px;
  right: -90px;
  top: 160px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.38), transparent 68%);
}

.hero-orb.two {
  width: 220px;
  height: 220px;
  left: -70px;
  bottom: 100px;
  background: radial-gradient(circle, rgba(196, 181, 253, 0.3), transparent 68%);
}

.logos {
  padding: 28px 0;
  border-block: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.04);
}

.logo-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.logo-row span {
  color: var(--muted);
  background: transparent;
}

.section-heading {
  max-width: 820px;
  margin-bottom: 42px;
}

.impact-grid,
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.impact-card,
.project-card,
.skill-group,
.contact-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.14);
}

.impact-card {
  padding: 28px;
  min-height: 280px;
}

.card-kicker {
  display: inline-block;
  color: var(--success);
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  font-size: 0.76rem;
  margin-bottom: 50px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.impact-card p,
.project-card p,
.skill-group p,
.timeline-content li {
  color: var(--soft);
}

.split-section {
  border-top: 1px solid var(--line);
}

.split-grid {
  display: grid;
  grid-template-columns: 0.38fr 0.62fr;
  gap: 54px;
}

.sticky-heading {
  position: sticky;
  top: calc(var(--nav-height) + 40px);
  align-self: start;
}

.timeline {
  display: grid;
  gap: 18px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 26px;
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius-lg);
}

.timeline-date {
  color: var(--brand);
  font-weight: 900;
  font-size: 0.86rem;
}

.company {
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 18px;
}

.timeline-content ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 12px;
}

.timeline-item.compact .timeline-content ul {
  gap: 8px;
}

.muted {
  background:
    linear-gradient(180deg, rgba(148, 163, 184, 0.05), transparent),
    rgba(148, 163, 184, 0.03);
  border-block: 1px solid var(--line);
}

.project-grid {
  grid-template-columns: repeat(4, 1fr);
}

.project-card {
  padding: 22px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.project-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 34px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  font-weight: 800;
}

.project-topline a {
  color: var(--brand);
}

.project-card p {
  flex: 1;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.tag-row span {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 0.75rem;
}

.skills-layout {
  display: grid;
  grid-template-columns: 0.34fr 0.66fr;
  gap: 44px;
  align-items: start;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.skill-group {
  padding: 24px;
}

.skill-group h3 {
  color: var(--brand);
}

.skill-group p {
  margin: 0;
}

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

.contact-card {
  padding: clamp(28px, 6vw, 58px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 42px;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.contact-card::before {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -130px;
  top: -120px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22), transparent 68%);
  pointer-events: none;
}

.contact-card > * {
  position: relative;
}

.contact-actions {
  justify-content: flex-end;
  max-width: 370px;
}

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

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.footer p {
  margin: 0;
}

.footer a {
  color: var(--brand);
  font-weight: 800;
}

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

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

.delay-1 { transition-delay: 90ms; }
.delay-2 { transition-delay: 180ms; }
.delay-3 { transition-delay: 270ms; }

@media (max-width: 1020px) {
  .hero-grid,
  .split-grid,
  .skills-layout,
  .contact-card {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: 40px;
  }

  .sticky-heading {
    position: static;
  }

  .impact-grid,
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-actions {
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 780px) {
  :root {
    --nav-height: 70px;
  }

  .container {
    width: min(calc(100% - 28px), var(--container));
  }

  .section {
    padding: 70px 0;
  }

  .brand-copy small {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: fixed;
    inset: var(--nav-height) 14px auto 14px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--card-strong);
    border-radius: 22px;
    box-shadow: var(--shadow);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a,
  .theme-toggle {
    width: 100%;
    text-align: left;
    justify-content: flex-start;
  }

  h1 {
    font-size: clamp(3rem, 14vw, 5.2rem);
  }

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

  .hero-actions .button,
  .contact-actions .button {
    width: 100%;
  }

  .metric-grid,
  .impact-grid,
  .project-grid,
  .skills-grid,
  .timeline-item {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    gap: 14px;
  }

  .impact-card,
  .project-card {
    min-height: auto;
  }

  .card-kicker,
  .project-topline {
    margin-bottom: 20px;
  }

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

@media print {
  :root {
    --bg: #ffffff;
    --bg-elevated: #ffffff;
    --card: #ffffff;
    --card-strong: #ffffff;
    --text: #111827;
    --muted: #374151;
    --soft: #1f2937;
    --line: #d1d5db;
    --brand: #0f172a;
    --brand-strong: #0f172a;
    --accent: #0f172a;
  }

  body {
    background: #fff;
    font-size: 11pt;
  }

  .site-header,
  .hero-actions,
  .hero-orb,
  .logos,
  .project-topline a,
  .contact-actions,
  .footer,
  .skip-link {
    display: none !important;
  }

  .section,
  .hero {
    padding: 18px 0;
    min-height: auto;
  }

  .container {
    width: 100%;
  }

  h1 {
    font-size: 32pt;
  }

  h2 {
    font-size: 22pt;
  }

  .hero-grid,
  .split-grid,
  .skills-layout,
  .impact-grid,
  .project-grid,
  .skills-grid,
  .contact-card,
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .impact-card,
  .project-card,
  .skill-group,
  .timeline-item,
  .terminal-card,
  .metric-grid div,
  .contact-card {
    border: 1px solid #d1d5db;
    box-shadow: none;
    break-inside: avoid;
  }

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