* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Brand */
  --emerald-900: #0F3D34;
  --emerald-700: #134E43;
  --sage-100: #E6F0E9;
  --cream-100: #F7F6F1;
  --gold-500: #C8A96A;

  /* Text */
  --text-primary: #0F3D34;
  --text-secondary: #65776F;
  --text-on-dark: #F7F6F1;
  --text-on-dark-muted: rgba(247, 246, 241, 0.62);

  /* Surfaces */
  --surface-main: #F7F6F1;
  --surface-subtle: #E6F0E9;
  --surface-sidebar: #0F3D34;
  --surface-portrait: #134E43;

  /* Accent */
  --accent: #C8A96A;

  /* Borders */
  --border-light: rgba(15, 61, 52, 0.12);
  --border-dark: rgba(247, 246, 241, 0.14);

  /* Radius */
  --radius-sm: 3px;
  --radius-md: 5px;

  /* Motion */
  --ease-premium: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Type */
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Courier New', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--surface-main);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
svg { display: block; }
img { max-width: 100%; display: block; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Shell ---------- */
.site-shell {
  display: grid;
  grid-template-columns: 84px minmax(370px, 30vw) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface-sidebar);
  display: flex;
  flex-direction: column;
  padding: 34px 0 28px;
  z-index: 40;
}
.sidebar-logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--text-on-dark);
  text-align: center;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}
.lang-switch {
  display: block;
  width: 30px;
  margin: 0 auto 34px;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-on-dark-muted);
  border: 1px solid var(--border-dark);
  border-radius: 999px;
  padding: 4px 0;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.lang-switch:hover { color: var(--accent); border-color: var(--accent); }
.sidebar-nav {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px 0;
  border-left: 2px solid transparent;
  color: var(--text-on-dark-muted);
  font-size: 0.86rem;
  letter-spacing: 0.2px;
  transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.nav-icon {
  width: 16px;
  height: 16px;
  color: inherit;
  flex-shrink: 0;
  z-index: 2;
}
.nav-icon svg { width: 100%; height: 100%; }
.nav-icon-linkedin { width: 22px; height: 22px; }

/* Liquid flyout: hidden pill that flows out from behind the icon on hover */
.nav-flyout {
  position: absolute;
  left: 100%;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-sidebar);
  border: 1px solid var(--border-dark);
  border-left: none;
  padding: 11px 20px 11px 16px;
  border-radius: 0 40px 40px 0;
  white-space: nowrap;
  box-shadow: 6px 6px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scaleX(0.15);
  transform-origin: left center;
  transition: opacity 0.25s ease, transform 0.45s var(--ease-premium), border-radius 0.45s var(--ease-premium);
  z-index: 5;
}
.nav-item:hover .nav-flyout,
.nav-item:focus-visible .nav-flyout {
  opacity: 1;
  transform: translateY(-50%) scaleX(1);
  border-radius: 0 6px 6px 0;
  pointer-events: auto;
}
.nav-num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: inherit;
  opacity: 0.8;
}
.nav-line {
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease-premium);
}
.nav-item:hover { background: var(--surface-portrait); color: var(--text-on-dark); }
.nav-item:hover .nav-line { width: 12px; }
.nav-item.active {
  color: var(--text-on-dark);
  border-left-color: var(--accent);
  background: var(--surface-portrait);
}
.nav-item.active .nav-line { width: 16px; }

.sidebar-socials {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
}
.sidebar-socials a {
  width: 15px;
  height: 15px;
  color: var(--text-on-dark-muted);
  transition: color 0.25s ease;
}
.sidebar-socials svg { width: 100%; height: 100%; }
.sidebar-socials a:hover { color: var(--accent); }

/* ---------- Drawer toggle (mobile) ---------- */
.drawer-toggle {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 80;
  flex-direction: column;
  gap: 5px;
  background: var(--surface-sidebar);
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 12px;
}
.drawer-toggle span { display: block; width: 18px; height: 2px; background: var(--text-on-dark); }
.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 61, 52, 0.5);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

/* ---------- Portrait panel ---------- */
.portrait-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--surface-portrait);
}
.portrait-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  filter: grayscale(25%) contrast(1.02) brightness(0.96);
}
.portrait-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(19, 78, 67, 0.08) 0%, rgba(19, 78, 67, 0.05) 30%, rgba(19, 78, 67, 0.78) 68%, var(--surface-portrait) 96%);
}
.portrait-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 34px 32px 38px;
  text-align: center;
}
.portrait-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.9rem;
  color: var(--text-on-dark);
  margin-bottom: 12px;
}
.portrait-rule {
  width: 34px;
  height: 1px;
  background: var(--accent);
  margin: 0 auto 14px;
}
.portrait-role {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
  line-height: 1.7;
  margin-bottom: 10px;
}
.portrait-location {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
}

/* ---------- Content panel ---------- */
.content-panel { background: var(--surface-main); }

.page-section {
  padding: 100px 56px;
  border-bottom: 1px solid var(--border-light);
}
.page-section:last-child { border-bottom: none; }
.section-inner { max-width: 1000px; }

.section-sage { background: var(--surface-subtle); }
.section-emerald {
  background: var(--surface-sidebar);
  color: var(--text-on-dark-muted);
}

.page-header { margin-bottom: 36px; }
.page-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 22px;
}
.page-kicker-dark { color: var(--text-on-dark-muted); margin-bottom: 22px; }
.kicker-rule { width: 26px; height: 1px; background: var(--accent); display: inline-block; }

.page-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.2rem, 3.4vw, 2.9rem);
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: -0.3px;
}

.section-body {
  color: var(--text-secondary);
  max-width: 75ch;
  margin-bottom: 16px;
  font-size: 1rem;
}
.section-body strong { color: var(--text-primary); font-weight: 600; }

.section-pullquote {
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--text-primary);
  max-width: 68ch;
  margin: 28px 0 16px;
  padding-left: 20px;
  border-left: 2px solid var(--accent);
}

/* ---------- About: stats + education ---------- */
.stat-row-outer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin: 44px 0 32px;
}
.stat-row-outer .stat-row { margin: 0; }
.stat-row {
  display: flex;
  align-items: baseline;
  gap: 28px;
  margin: 44px 0 32px;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  color: var(--text-primary);
  line-height: 1.1;
  white-space: nowrap;
}
.stat-label {
  font-size: 0.68rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.stat-divider { width: 1px; height: 40px; background: var(--accent); opacity: 0.5; align-self: center; }

.stat-selected { max-width: 220px; }
.stat-eyebrow {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
}
.stat-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text-primary);
  line-height: 1.3;
}
.stat-caption { font-size: 0.7rem; color: var(--text-secondary); }

.education-line {
  font-size: 0.86rem;
  color: var(--text-secondary);
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  max-width: 75ch;
  margin-top: 56px;
}

.stat-caveat {
  font-size: 0.74rem;
  color: var(--text-secondary);
  opacity: 0.7;
  margin-top: -20px;
  margin-bottom: 8px;
}

/* ---------- Section sub-heads (used within About) ---------- */
.section-subhead {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--text-primary);
  margin: 56px 0 12px;
}
.section-lead {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.section-caption {
  font-size: 0.76rem;
  color: var(--text-secondary);
  opacity: 0.7;
  margin-top: 12px;
}
.text-link {
  display: inline-block;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-primary);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  margin-top: 8px;
  transition: opacity 0.2s ease;
}
.text-link:hover { opacity: 0.7; }

/* ---------- Capabilities ---------- */
.capability-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 40px;
  margin: 28px 0 20px;
}
.capability h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.capability p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.55; margin-bottom: 8px; }

/* ---------- Condensed progression timeline (About) ---------- */
.timeline-condensed { margin-top: 24px; }
.timeline-condensed .timeline-item { margin-bottom: 26px; }
.timeline-condensed .timeline-role { font-size: 1.05rem; margin-bottom: 2px; }
.timeline-condensed .timeline-item-current .timeline-role { font-size: 1.2rem; }
.timeline-condensed .timeline-dates { margin-bottom: 4px; }
.timeline-condensed .tag-row { margin-top: 6px; }
.timeline-phase-narrative {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 60ch;
  margin: 6px 0 12px;
}
.timeline-phase-sub { font-size: 0.76rem; color: var(--text-secondary); margin-top: 10px; }
.timeline-phase-sub strong { color: var(--text-primary); font-weight: 600; }

/* ---------- Experience: summary + related-project link ---------- */
.timeline-official-role {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.timeline-summary { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.6; margin-bottom: 16px; }
.timeline-progression {
  font-size: 0.78rem;
  color: var(--text-secondary);
  opacity: 0.85;
  margin: -10px 0 18px;
}
.timeline-item .project-jump {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}

/* ---------- Project domains (featured project) ---------- */
.project-domains {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px 32px;
  margin: 22px 0 20px;
}
.project-domain h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.02rem;
  color: var(--text-on-dark);
  margin-bottom: 5px;
}
.project-domain p { color: var(--text-on-dark-muted); font-size: 0.85rem; line-height: 1.5; margin-bottom: 6px; }

/* ---------- Tag: single component used everywhere a technology is named ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 7px 8px; }
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1;
  padding: 5px 10px;
  border-radius: 3px;
  border: 1px solid var(--border-light);
  background: rgba(15, 61, 52, 0.03);
  color: var(--text-secondary);
  white-space: nowrap;
}
.tag.tag-core {
  color: var(--text-primary);
  font-weight: 600;
  border-color: rgba(200, 169, 106, 0.45);
  background: rgba(200, 169, 106, 0.1);
}
.tag.tag-historical { opacity: 0.6; }

.tag-row-dark .tag {
  border-color: var(--border-dark);
  background: rgba(247, 246, 241, 0.05);
  color: var(--text-on-dark-muted);
}
.tag-row-dark .tag.tag-core {
  color: var(--text-on-dark);
  border-color: rgba(200, 169, 106, 0.55);
  background: rgba(200, 169, 106, 0.16);
}

/* ---------- Tech stack: curated / complete toggle ---------- */
.tech-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  margin: 40px 0 8px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--accent);
}
.tech-toggle-arrow { transition: transform 0.3s var(--ease-premium); }
.tech-toggle[aria-expanded="true"] .tech-toggle-arrow { transform: rotate(90deg); }
.tech-groups-complete { margin-top: 32px; }

/* ---------- Experience timeline ---------- */
.timeline {
  position: relative;
  margin-top: 40px;
  padding-left: 26px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--accent);
  opacity: 0.4;
}
.timeline-item { position: relative; margin-bottom: 48px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-marker {
  position: absolute;
  left: -26px;
  top: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline-item-current .timeline-marker { width: 8px; height: 8px; left: -27px; }
.timeline-dates {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.timeline-role {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.timeline-item-current .timeline-role { font-size: 1.5rem; }
.timeline-org { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 18px; }
.timeline-tag { color: var(--text-secondary); opacity: 0.7; font-size: 0.82rem; }
.timeline-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.timeline-list li {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
  padding-left: 18px;
  position: relative;
}
.timeline-list li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }
.timeline-body { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.65; margin-bottom: 16px; }
.timeline-item .tag-row { margin-top: 4px; }

/* ---------- Projects ---------- */
.project-featured {
  background: var(--surface-portrait);
  color: var(--text-on-dark-muted);
  border-radius: var(--radius-md);
  padding: 40px 44px;
  margin: 40px 0 28px;
}
.project-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.project-featured h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.7rem;
  color: var(--text-on-dark);
  margin-bottom: 10px;
}
.project-featured .project-meta { color: var(--text-on-dark-muted); margin-bottom: 18px; }
.project-jump { color: var(--accent); }
.project-featured p { color: var(--text-on-dark-muted); font-size: 0.92rem; line-height: 1.6; margin-bottom: 12px; }
.project-outcome {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border-dark);
}
.project-featured strong { color: var(--text-on-dark); font-weight: 600; }

.project-secondary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
.project-secondary h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.project-secondary .project-meta { font-size: 0.76rem; color: var(--text-secondary); opacity: 0.8; margin-bottom: 10px; display: block; }
.project-secondary p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 10px; }

/* ---------- Tech stack ---------- */
.tech-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px 36px;
  margin-top: 34px;
}
.tech-group {
  border-top: 1px solid var(--border-light);
  padding-top: 18px;
}
.tech-group h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
/* ---------- Contact ---------- */
.contact-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  color: var(--text-on-dark);
  line-height: 1.15;
  margin-bottom: 24px;
}
.contact-body { color: var(--text-on-dark-muted); max-width: 56ch; margin-bottom: 36px; font-size: 1rem; }
.contact-links { display: flex; flex-wrap: wrap; gap: 32px; margin-bottom: 56px; }
.contact-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-on-dark);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s ease;
}
.contact-link:hover { opacity: 0.75; }
.contact-footer { font-size: 0.75rem; color: var(--text-on-dark-muted); letter-spacing: 0.4px; }

/* ---------- CV download ---------- */
.cv-download { position: relative; }

.cv-download-hero { align-self: center; }
.cv-download-toggle-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--emerald-900);
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(200, 169, 106, 0.35);
  transition: opacity 0.2s ease;
}
.cv-download-toggle-hero:hover { opacity: 0.88; }
.cv-download-toggle-hero span { transition: transform 0.2s ease; display: inline-block; }
.cv-download-toggle-hero[aria-expanded="true"] span { transform: rotate(180deg); }
.cv-download-hero .cv-menu { left: auto; right: 0; }

.cv-download-toggle {
  background: none;
  border: none;
  border-bottom: 1px solid var(--accent);
  cursor: pointer;
  font-family: inherit;
}
.cv-download-toggle span { transition: transform 0.2s ease; display: inline-block; }
.cv-download-toggle[aria-expanded="true"] span { transform: rotate(180deg); }

.cv-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 14px);
  width: 260px;
  background: var(--surface-main);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  overflow-y: auto;
  z-index: 20;
}
.cv-menu-wide { width: 300px; max-height: min(430px, calc(100vh - 120px)); }
.cv-menu-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 12px 18px 8px;
}
.cv-menu-divider { display: block; height: 1px; background: var(--border-light); margin: 2px 0; }
.cv-option {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-light);
}
.cv-option:last-child { border-bottom: none; }
.cv-option:hover, .cv-option:focus-visible { background: var(--surface-subtle); }
.cv-option-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0rem;
  color: var(--text-primary);
}
.cv-option-badge {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 1px 6px;
}
.cv-option-desc { font-size: 0.76rem; color: var(--text-secondary); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .site-shell { display: block; }

  .drawer-toggle { display: flex; }

  .sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    bottom: 0;
    left: auto;
    width: min(70vw, 300px);
    height: 100vh;
    z-index: 70;
    transition: right 0.3s var(--ease-premium);
  }
  .sidebar.open { right: 0; }
  .drawer-scrim.open { opacity: 1; pointer-events: auto; }

  /* Drawer shows full labels always — hover flyouts don't apply on touch */
  .sidebar-logo { text-align: left; padding: 0 30px; }
  .lang-switch { margin: 0 30px 24px; text-align: left; }
  .nav-item { justify-content: flex-start; gap: 10px; padding: 13px 28px; }
  .nav-flyout {
    position: static;
    display: flex;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
  .sidebar-socials { justify-content: flex-start; padding: 0 30px; }

  .portrait-panel {
    position: relative;
    height: 280px;
  }
  .portrait-img { object-position: center 12%; }

  .page-section { padding: 60px 24px; }
  .section-inner { max-width: none; }

  .project-secondary-grid { grid-template-columns: 1fr; gap: 28px; }
  .project-featured { padding: 30px 26px; }
  .project-domains { grid-template-columns: 1fr; gap: 24px; }
  .capability-grid { grid-template-columns: 1fr; gap: 24px; }
  .tech-groups { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 1180px) and (min-width: 981px) {
  .tech-groups { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .portrait-panel { height: 220px; }
  .portrait-name { font-size: 1.4rem; }
  .portrait-role { font-size: 0.7rem; }
  .portrait-location { display: none; }
  .stat-row { gap: 18px; }
  .stat-num { font-size: 1.5rem; }
  .contact-links { flex-direction: column; gap: 18px; }
  .cv-menu, .cv-menu-wide { width: min(300px, calc(100vw - 72px)); }
}
