:root {
  --bg: #0b1220;
  --bg-elevated: #121a2b;
  --bg-soft: #161f33;
  --text: #e8eefc;
  --muted: #9aabc9;
  --faint: #6b7c99;
  --line: rgba(232, 238, 252, 0.1);
  --accent: #5b8cff;
  --accent-2: #3dd6c6;
  --accent-soft: rgba(91, 140, 255, 0.14);
  --radius: 18px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --max: 1120px;
  --font: "DM Sans", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(91, 140, 255, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(61, 214, 198, 0.1), transparent 50%),
    var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

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

.container.narrow {
  width: min(760px, calc(100% - 2.5rem));
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(11, 18, 32, 0.75);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(11, 18, 32, 0.9);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 1rem;
}

.logo {
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
}

.logo span {
  color: var(--accent-2);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  font-size: 0.92rem;
  color: var(--muted);
}

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

.nav-cta {
  color: var(--text) !important;
  background: var(--accent-soft);
  border: 1px solid rgba(91, 140, 255, 0.35);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: var(--text);
}

/* Hero */
.hero {
  padding: 4.5rem 0 5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 2.5rem;
  align-items: start;
}

.eyebrow {
  color: var(--accent-2);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 1rem;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  line-height: 1.05;
  margin: 0 0 0.85rem;
  letter-spacing: -0.02em;
}

.hero h1 em {
  font-style: italic;
  color: #c9d7ff;
}

.hero-role {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1rem;
}

.hero-lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 38rem;
  margin: 0 0 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #3d6ef5);
  color: #fff;
  box-shadow: 0 10px 30px rgba(91, 140, 255, 0.3);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.btn-ghost:hover {
  border-color: rgba(91, 140, 255, 0.45);
}

.hero-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  color: var(--faint);
  font-size: 0.92rem;
}

.hero-meta a:hover {
  color: var(--accent-2);
}

.hero-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.stat {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.stat:first-child {
  padding-top: 0.25rem;
}

.stat strong {
  display: block;
  font-size: 1.65rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.stat span {
  color: var(--muted);
  font-size: 0.92rem;
}

.stack-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.25rem;
}

.stack-pills span {
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  background: rgba(255, 255, 255, 0.02);
}

/* Sections */
.section {
  padding: 4.5rem 0;
}

.section-alt {
  background: rgba(255, 255, 255, 0.015);
  border-block: 1px solid var(--line);
}

.section-label {
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
}

.section h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
}

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

.section-intro {
  max-width: 40rem;
  margin: -0.5rem 0 2rem;
}

/* Timeline */
.timeline {
  display: grid;
  gap: 1.25rem;
  margin-top: 2rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.timeline-when {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.when {
  font-weight: 700;
  font-size: 0.92rem;
}

.where {
  color: var(--faint);
  font-size: 0.85rem;
}

.timeline-body h3 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.org {
  color: var(--accent) !important;
  font-weight: 600;
  margin: 0 0 0.85rem !important;
}

.org span {
  color: var(--faint);
  font-weight: 500;
}

.timeline-body ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.timeline-body li + li {
  margin-top: 0.4rem;
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
  margin-top: 2rem;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.45rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.project-card:hover {
  border-color: rgba(91, 140, 255, 0.4);
  transform: translateY(-2px);
  background: rgba(91, 140, 255, 0.05);
}

.project-card.featured {
  grid-column: 1 / -1;
  background:
    linear-gradient(135deg, rgba(91, 140, 255, 0.12), rgba(61, 214, 198, 0.05)),
    rgba(255, 255, 255, 0.02);
}

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

.tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.dates {
  color: var(--faint);
  font-size: 0.85rem;
}

.project-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.client {
  color: var(--accent) !important;
  font-weight: 600;
  margin: 0 0 0.75rem !important;
  font-size: 0.95rem;
}

.project-card p {
  margin: 0 0 1rem;
  font-size: 0.96rem;
}

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

.tech li {
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.skill-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.02);
}

.skill-block h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.skill-block p {
  margin: 0;
  font-size: 0.94rem;
}

/* Education */
.edu-list {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.edu-list article {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.15rem;
  background: rgba(255, 255, 255, 0.02);
}

.edu-list h3 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}

.edu-list .org {
  margin: 0 !important;
  color: var(--muted) !important;
  font-weight: 500;
}

.achievements h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.achievements ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.achievements li + li {
  margin-top: 0.5rem;
}

/* Contact */
.section-contact {
  padding-bottom: 5.5rem;
}

.section-contact h2 {
  margin-bottom: 0.75rem;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 1rem;
}

.refs {
  color: var(--faint) !important;
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 2rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 0.9rem;
}

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

/* Responsive */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

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

  .project-card.featured {
    grid-column: auto;
  }

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

  .nav {
    position: absolute;
    right: 1.25rem;
    top: 72px;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    min-width: 200px;
    padding: 0.85rem;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(18, 26, 43, 0.98);
    box-shadow: var(--shadow);
    display: none;
  }

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

  .nav a {
    width: 100%;
    padding: 0.55rem 0.5rem;
  }
}

@media (max-width: 560px) {
  .hero {
    padding-top: 2.5rem;
  }

  .section {
    padding: 3.25rem 0;
  }
}
