:root {
  --bg: #0f1218;
  --bg-elevated: #171b24;
  --surface: #1e2430;
  --text: #e6e9ef;
  --text-muted: #8b95a8;
  --accent: #6eb4ff;
  --accent-dim: rgba(110, 180, 255, 0.15);
  --border: rgba(255, 255, 255, 0.08);
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --radius: 12px;
  --nav-h: 64px;
  --transition: 180ms ease;
}

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

html {
  scroll-behavior: smooth;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: #9cc8ff;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  border-radius: 6px;
  z-index: 200;
}

.skip-link:focus {
  left: 12px;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem 2rem;
  padding: 0.6rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(15, 18, 24, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  line-height: 1.15;
  text-align: center;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nav-toggle {
  display: none;
  position: absolute;
  right: clamp(1rem, 4vw, 2.5rem);
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-toggle span {
  transition: transform var(--transition), opacity var(--transition);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: block;
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--text);
  background: var(--accent-dim);
}

main {
  padding-top: calc(var(--nav-h) + 12px);
}

.view {
  display: none;
  min-height: calc(100vh - var(--nav-h) - 12px);
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 2.5rem) 4rem;
  animation: fadeIn 280ms ease;
  text-align: center;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  max-width: 720px;
  margin: 0 auto;
}

.hero-photo {
  width: clamp(148px, 38vw, 204px);
  height: clamp(148px, 38vw, 204px);
  margin: 0 auto 1.35rem;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--border);
  box-shadow:
    0 0 0 1px rgba(110, 180, 255, 0.12),
    0 12px 40px rgba(0, 0, 0, 0.45);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

.hero .tagline {
  font-size: 1.15rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 1.5rem;
}

.hero-lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin: 0 auto 2rem;
  max-width: 58ch;
  text-align: center;
}

.hero-lead p {
  margin: 0 0 1.1rem;
}

.hero-lead p:last-child {
  margin-bottom: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.hero-actions .btn {
  letter-spacing: 0.04em;
  font-size: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: #0a0c10;
}

.btn-primary:hover {
  background: #8dc0ff;
  color: #0a0c10;
}

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

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

.section-inner {
  max-width: 720px;
  margin: 0 auto;
}

.section-inner h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.prose {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.prose strong {
  color: var(--text);
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin: 0 auto 1rem;
  max-width: 640px;
  text-align: center;
}

.card:last-child {
  margin-bottom: 0;
}

.card-header {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 1rem;
  margin-bottom: 0.75rem;
  text-align: center;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0;
  color: var(--text);
}

.card-company {
  font-weight: 600;
  color: var(--accent);
  margin: 0;
  font-size: 0.95rem;
}

.card-dates {
  font-size: 0.88rem;
  color: var(--text-muted);
  white-space: normal;
}

.card ul {
  margin: 0.5rem auto 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  display: inline-block;
  text-align: left;
  max-width: 100%;
}

.card li {
  margin-bottom: 0.45rem;
}

.card li:last-child {
  margin-bottom: 0;
}

.card-body {
  margin-top: 0.25rem;
}

.employment-card.is-collapsed .card-body li:nth-child(n + 4) {
  display: none;
}

.employment-card-toggle {
  margin-top: 0.85rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.employment-card-toggle[hidden] {
  display: none;
}

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

.skill-tags li {
  padding: 0.35rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
}

.contact-grid {
  display: grid;
  gap: 1rem;
  justify-items: center;
}

.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-align: center;
}

.contact-item span {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.contact-item a {
  font-weight: 600;
  word-break: break-word;
}

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

.project-list > li {
  margin-bottom: 1rem;
}

.project-list > li:last-child {
  margin-bottom: 0;
}

.project-card {
  text-align: center;
}

.project-repo-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.project-repo-title a {
  color: var(--accent);
  transition: color var(--transition);
}

.project-repo-title a:hover {
  color: #9cc8ff;
}

.project-videos {
  width: 100%;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: left;
}

.project-videos-heading {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.02em;
}

.project-card .project-video-series {
  list-style: none;
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
  color: inherit;
}

.project-card .project-video-series > li {
  width: 100%;
  margin-bottom: 0;
  padding-left: 0;
}

.project-video-card {
  width: 100%;
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.project-video-frame {
  position: relative;
  width: 100%;
  max-width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #0a0c10;
}

.project-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.project-video-link {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.site-footer {
  padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  nav {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    transition: max-height 240ms ease;
  }

  nav.is-open {
    max-height: 320px;
  }

  .nav-list {
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.25rem 1.25rem;
    gap: 0.15rem;
  }

  .nav-list a {
    padding: 0.6rem 0.75rem;
  }
}

.section-heading-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.section-heading-row h2 {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  margin: 0;
  padding-bottom: 0;
  border-bottom: none;
  text-align: center;
}

.resume-download-btn {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  letter-spacing: 0.04em;
  font-size: 0.85rem;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .section-heading-row {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.85rem;
  }

  .section-heading-row h2 {
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
  }

  .resume-download-btn {
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
  }
}

.resume-download-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

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

body.resume-modal-open {
  overflow: hidden;
}

.resume-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.resume-modal[hidden] {
  display: none;
}

.resume-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 14, 0.72);
  backdrop-filter: blur(4px);
}

.resume-modal__dialog {
  position: relative;
  width: min(100%, 26rem);
  max-height: min(90vh, 32rem);
  overflow: auto;
  padding: 1.35rem 1.5rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.resume-modal__title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.resume-modal__lead {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.resume-modal__fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.resume-modal__checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.resume-modal__checklist label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  transition: background var(--transition);
}

.resume-modal__checklist label:hover {
  background: var(--surface);
}

.resume-modal__checklist input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.resume-modal__error {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: #f08080;
}

.resume-modal__error[hidden] {
  display: none;
}

.resume-modal__actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.resume-pdf-build-host {
  position: fixed;
  left: 0;
  top: 0;
  z-index: -1;
  width: 210mm;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.resume-pdf-document {
  background: #ffffff;
  color: #1a1f28;
  padding: 10mm;
  font-family: var(--font-body);
  text-align: left;
}

.resume-pdf-document .view {
  display: block !important;
  min-height: auto;
  padding: 0 0 6mm;
  animation: none;
  text-align: left;
}

.resume-pdf-document .hero {
  max-width: none;
  text-align: center;
  margin-bottom: 4mm;
}

.resume-pdf-document .hero-photo {
  width: 88px;
  height: 88px;
  margin-bottom: 4mm;
}

.resume-pdf-document .hero h1 {
  font-size: 1.65rem;
  margin-bottom: 2mm;
}

.resume-pdf-document .hero .tagline {
  font-size: 0.95rem;
  color: #1565c0;
  margin-bottom: 3mm;
}

.resume-pdf-document .hero-lead {
  font-size: 0.82rem;
  color: #3d4654;
  max-width: none;
  text-align: left;
}

.resume-pdf-document .hero-lead p {
  margin-bottom: 2.5mm;
}

.resume-pdf-document .section-inner {
  max-width: none;
}

.resume-pdf-document .section-inner h2 {
  font-size: 1.1rem;
  text-align: left;
  border-bottom-color: #d8dee8;
  color: #1a1f28;
  margin-bottom: 3mm;
  padding-bottom: 2mm;
}

.resume-pdf-document .prose {
  color: #3d4654;
  font-size: 0.82rem;
}

.resume-pdf-document .card {
  background: #f6f8fb;
  border-color: #d8dee8;
  max-width: none;
  text-align: left;
  padding: 3mm 4mm;
  margin-bottom: 3mm;
  page-break-inside: avoid;
}

.resume-pdf-document .card-header {
  align-items: flex-start;
  text-align: left;
}

.resume-pdf-document .card-title {
  font-size: 0.92rem;
  color: #1a1f28;
}

.resume-pdf-document .card-company {
  color: #1565c0;
  font-size: 0.82rem;
}

.resume-pdf-document .card-dates {
  color: #5c6778;
  font-size: 0.78rem;
}

.resume-pdf-document .card ul {
  font-size: 0.78rem;
  color: #3d4654;
  margin-top: 2mm;
}

.resume-pdf-document .skill-tags {
  justify-content: flex-start;
}

.resume-pdf-document .skill-tags li {
  background: #eef2f8;
  border-color: #d8dee8;
  color: #1a1f28;
  font-size: 0.75rem;
}

.resume-pdf-document .project-list {
  font-size: 0.78rem;
  text-align: left;
}

.resume-pdf-document .project-repo-title {
  font-size: 0.85rem;
}

.resume-pdf-document .project-repo-title a {
  color: #1565c0;
  word-break: break-word;
}

.resume-pdf-document .contact-grid {
  justify-items: start;
  grid-template-columns: 1fr 1fr;
  gap: 3mm;
}

.resume-pdf-document .contact-item {
  align-items: flex-start;
  font-size: 0.78rem;
}

.resume-pdf-document .contact-item span {
  color: #5c6778;
  font-weight: 600;
}

.resume-pdf-document .contact-item a {
  color: #1565c0;
}
