:root {
  --bg: #090f1d;
  --surface: #111a2f;
  --surface-strong: #16223d;
  --text: #e7eefc;
  --muted: #9fb0d1;
  --border: #273a61;
  --primary: #4e89ff;
  --primary-strong: #76a5ff;
  --accent: #33d2b4;
  --accent-strong: #65e6cd;
  --shadow: 0 20px 44px rgba(3, 9, 24, 0.45);
}

body[data-theme="dark"] {
  --bg: #090f1d;
  --surface: #111a2f;
  --surface-strong: #16223d;
  --text: #e7eefc;
  --muted: #9fb0d1;
  --border: #273a61;
  --primary: #4e89ff;
  --primary-strong: #76a5ff;
  --accent: #33d2b4;
  --accent-strong: #65e6cd;
  --shadow: 0 20px 44px rgba(3, 9, 24, 0.45);
}

body[data-theme="light"] {
  --bg: #f4f7ff;
  --surface: #ffffff;
  --surface-strong: #eff4ff;
  --text: #1c2434;
  --muted: #596684;
  --border: #d4ddf1;
  --primary: #2f5fe5;
  --primary-strong: #234ec8;
  --accent: #0f9f87;
  --accent-strong: #0b7f6c;
  --shadow: 0 16px 36px rgba(27, 49, 120, 0.14);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

a {
  color: var(--primary);
}

a:hover {
  color: var(--primary-strong);
}

.container {
  width: min(1080px, calc(100% - 2.5rem));
  margin: 0 auto;
}

.site-header {
  background:
    radial-gradient(circle at 16% 8%, rgba(78, 137, 255, 0.33), transparent 38%),
    radial-gradient(circle at 84% 10%, rgba(51, 210, 180, 0.22), transparent 40%),
    linear-gradient(180deg, rgba(9, 15, 29, 0.86), transparent 58%),
    var(--bg);
  padding-bottom: 2.2rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0.85rem 1rem;
  margin-top: 0.35rem;
  backdrop-filter: blur(10px);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(1, 6, 20, 0.28);
}

.brand {
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
  color: var(--text);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.1rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover {
  border-bottom-color: var(--accent);
}

.hero {
  padding: 4rem 0 1.2rem;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 0.85rem;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular,
    Menlo, monospace;
}

h1 {
  margin: 0;
  max-width: 22ch;
  line-height: 1.2;
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  text-wrap: balance;
}

.hero-summary {
  margin: 1rem 0 1.4rem;
  max-width: 72ch;
  color: var(--muted);
}

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

.tech-badges li {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-strong) 85%, transparent);
  color: var(--text);
  border-radius: 999px;
  padding: 0.26rem 0.62rem;
  font-size: 0.82rem;
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular,
    Menlo, monospace;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.6rem 0.92rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: color-mix(in srgb, var(--primary) 75%, var(--accent) 25%);
  color: #fff;
}

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

.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.quick-facts {
  margin: 1.35rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.62rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.quick-facts li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0.72rem 0.85rem;
  box-shadow: var(--shadow);
}

.section {
  padding: 1.65rem 0;
  scroll-margin-top: 5.5rem;
}

.section h2 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.28rem, 2vw, 1.6rem);
  letter-spacing: 0.01em;
}

.section h2::before {
  content: "# ";
  color: var(--accent);
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular,
    Menlo, monospace;
}

.timeline-item,
.card,
.skills-grid > div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.timeline-item {
  margin: 0 0 0.85rem;
  padding: 1rem 1rem 0.4rem;
  position: relative;
  overflow: hidden;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(var(--primary), var(--accent));
}

.timeline-item ul {
  margin-top: 0.55rem;
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
}

.timeline-top h3 {
  margin: 0;
  font-size: 1.03rem;
}

.timeline-top span {
  color: var(--muted);
  font-size: 0.95rem;
  white-space: nowrap;
}

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

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.85rem;
}

.card {
  padding: 1rem;
  border-top: 2px solid color-mix(in srgb, var(--accent) 40%, var(--border) 60%);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-top-color: var(--accent);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.card h3 {
  margin: 0;
}

.project-repo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-strong);
  flex-shrink: 0;
}

.project-repo:hover,
.project-repo:focus-visible {
  color: var(--accent-strong);
  border-color: var(--accent);
}

.project-repo svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}

.skills-grid > div {
  padding: 1rem;
  border-left: 3px solid color-mix(in srgb, var(--primary) 60%, transparent);
}

.skills-grid h3 {
  margin-top: 0;
  margin-bottom: 0.45rem;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0;
}

.contact-list li {
  margin-bottom: 0.48rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 1.2rem;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.2rem 0;
}

@media (max-width: 840px) {
  .nav {
    position: relative;
    top: auto;
  }

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

  .nav-links {
    display: none;
    position: absolute;
    right: 1rem;
    top: calc(100% + 0.5rem);
    flex-direction: column;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 0.8rem;
    box-shadow: var(--shadow);
  }

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

  .timeline-top {
    flex-direction: column;
  }

  .timeline-top span {
    white-space: normal;
  }

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

@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-strong: #ffffff;
    --text: #000000;
    --muted: #2c2c2c;
    --border: #b3b3b3;
    --primary: #000000;
    --primary-strong: #000000;
    --shadow: none;
  }

  body {
    font-size: 11pt;
  }

  .nav,
  .hero-actions,
  .site-footer {
    display: none !important;
  }

  .site-header {
    background: #fff;
    padding-bottom: 0;
  }

  .hero {
    padding: 0.3rem 0 0.8rem;
  }

  .section {
    break-inside: avoid;
    padding: 0.45rem 0;
  }

  a {
    color: #000;
    text-decoration: none;
  }
}
