:root {
  --bg: #0f172a;
  --panel: #111827;
  --text: #172033;
  --muted: #475569;
  --text-inverse: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --surface-soft-strong: #e2e8f0;
  --line: #dbe3ee;
  --line-strong: #b8c7db;
  --line-print: #d7dde5;
  --accent: #2563eb;
  --accent-wash: rgba(37, 99, 235, 0.18);
  --nav-text: #cbd5e1;
  --nav-link: #93c5fd;
  --nav-border: rgba(255, 255, 255, 0.08);
  --nav-hover: rgba(148, 163, 184, 0.12);
  --surface-card: rgba(255, 255, 255, 0.96);
  --surface-border: rgba(255, 255, 255, 0.55);
  --focus-ring: #1d4ed8;
  --focus-ring-inverse: #bfdbfe;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  --radius: 18px;
  --nav-width: 280px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, var(--accent-wash), transparent 30%),
    linear-gradient(180deg, var(--surface-soft) 0%, var(--surface-soft-strong) 100%);
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  text-decoration: none;
}

.skip-link {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 20;
  transform: translateY(-200%);
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-inverse);
  font-weight: 700;
  transition: transform 0.18s ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline-color: var(--focus-ring-inverse);
}

.site-shell {
  display: grid;
  grid-template-columns: var(--nav-width) minmax(0, 1fr);
  min-height: 100vh;
}

.side-nav {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 28px 20px;
  background: linear-gradient(180deg, var(--bg), var(--panel));
  color: var(--nav-text);
  border-right: 1px solid var(--nav-border);
}

.nav-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

/* Shared nav header used by the desktop sidebar and compact mobile top bar. */
.nav-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: block;
  flex: 1;
  min-width: 0;
  color: var(--text-inverse);
  text-decoration: none;
}

.brand:focus-visible,
.side-nav nav a:focus-visible,
.nav-footer a:focus-visible {
  outline-color: var(--focus-ring-inverse);
}

.brand-name {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.15;
}

.brand-role {
  display: block;
  margin-top: 6px;
  color: var(--nav-link);
  font-size: 0.92rem;
}

.menu-toggle {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--nav-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-inverse);
  cursor: pointer;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  background: var(--nav-hover);
  text-decoration: none;
}

.menu-toggle:focus-visible {
  outline: 3px solid var(--focus-ring-inverse);
  outline-offset: 3px;
}

.menu-toggle-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: background 0.18s ease, transform 0.18s ease;
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: top 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.menu-toggle-icon::before {
  top: -6px;
}

.menu-toggle-icon::after {
  top: 6px;
}

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

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

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

.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;
}

.nav-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.side-nav nav ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-nav nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--nav-text);
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.side-nav nav a:hover,
.side-nav nav a[aria-current="true"] {
  background: var(--nav-hover);
  color: var(--text-inverse);
}

.side-nav nav a:hover {
  transform: translateX(2px);
}

.side-nav nav a:focus-visible {
  background: var(--nav-hover);
  color: var(--text-inverse);
}

.nav-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--nav-border);
  font-size: 0.94rem;
}

.nav-footer a {
  color: var(--nav-link);
}

.content {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 32px 56px;
}

.card {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  background: var(--surface-card);
  box-shadow: var(--shadow);
}

.card-pad {
  padding: 24px;
}

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

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.section-stack {
  display: grid;
  gap: 18px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--bg);
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 1.05;
}

.card-title {
  margin: 0 0 8px;
  color: var(--bg);
  font-size: 1.1rem;
}

.hero {
  padding: 32px;
}

.hero-role {
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 600;
}

.hero-summary {
  margin: 0;
  font-size: 1.05rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.button:hover,
.button:focus-visible {
  border-color: var(--line-strong);
  text-decoration: none;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--text-inverse);
}

.section {
  margin-top: 28px;
  scroll-margin-top: 24px;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  color: var(--bg);
  font-size: 1.9rem;
  line-height: 1.1;
}

.role-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.role-title {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.role-subtitle {
  margin: 0 0 12px;
  color: var(--muted);
}

.role-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: right;
  white-space: nowrap;
}

ul {
  margin: 0;
  padding-left: 20px;
}

li + li {
  margin-top: 8px;
}

.compact-list li {
  line-height: 1.7;
}

.compact-list li + li {
  margin-top: 12px;
}

.education-card p {
  margin: 0;
  color: var(--muted);
}

/* Switch from the desktop sidebar to a compact top bar below desktop width. */
@media (max-width: 980px) {
  .site-shell {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: sticky;
    top: 0;
    z-index: 15;
    height: auto;
    padding: 14px 16px;
    border-right: 0;
  }

  .nav-inner {
    height: auto;
  }

  .nav-header {
    align-items: center;
    margin-bottom: 0;
  }

  .brand-name {
    font-size: 1.2rem;
  }

  .brand-role {
    font-size: 0.86rem;
  }

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

  /* Right-aligned flyout menu anchored under the hamburger button. */
  .nav-panel {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 5;
    width: min(320px, calc(100vw - 32px));
    max-height: calc(100vh - 110px);
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(17, 24, 39, 0.98);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28);
    overflow-y: auto;
  }

  .side-nav[data-menu-open="true"] .nav-panel {
    display: flex;
    animation: nav-panel-reveal 0.18s ease both;
  }

  .side-nav nav a {
    padding: 12px 14px;
  }

  .side-nav nav ul {
    grid-template-columns: 1fr;
  }

  .nav-footer {
    margin-top: 16px;
    padding-top: 16px;
  }

  .content {
    padding: 22px 16px 36px;
  }
}

@media (max-width: 720px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .side-nav nav ul {
    grid-template-columns: 1fr;
  }

  .card-pad,
  .hero {
    padding: 20px;
  }

  .role-top {
    display: block;
  }

  .role-meta {
    margin-top: 10px;
    text-align: left;
    white-space: normal;
  }

  /* Keep the flyout menu inside narrow phone viewports. */
  .nav-panel {
    width: min(300px, calc(100vw - 24px));
  }
}

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

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

  .skip-link,
  .side-nav[data-menu-open="true"] .nav-panel,
  .side-nav nav a:hover {
    animation: none;
    transform: none;
  }
}

@media print {
  body {
    background: var(--surface);
  }

  .skip-link,
  .side-nav {
    display: none;
  }

  .site-shell {
    display: block;
  }

  .content {
    max-width: none;
    padding: 0;
  }

  .card {
    border: 1px solid var(--line-print);
    background: var(--surface);
    box-shadow: none;
  }

  .section {
    margin-top: 16px;
    break-inside: avoid;
  }

  .button {
    display: none;
  }
}

@keyframes nav-panel-reveal {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
