:root {
  --bg: #0a0a0a;
  --fg: #f6f6f2;
  --muted: #a8a8a1;
  --line: rgba(246, 246, 242, .24);
  --soft: #171717;
  --button-bg: #f6f6f2;
  --button-fg: #0a0a0a;
}

:root[data-theme="light"] {
  --bg: #fafaf8;
  --fg: #101010;
  --muted: #65655f;
  --line: rgba(16, 16, 16, .22);
  --soft: #eeeeea;
  --button-bg: #101010;
  --button-fg: #fafaf8;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  color: var(--fg);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  transition: color .2s ease, background .2s ease;
}
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.container { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 20; top: -100px; left: 18px; padding: 10px 14px; background: var(--fg); color: var(--bg); font-weight: 800; text-decoration: none; }
.skip-link:focus { top: 18px; }

/* Section 1: shared menu bar */
.site-header { position: relative; z-index: 10; border-bottom: 1px solid var(--line); }
.nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 76px; }
.menu-toggle {
  width: 42px;
  height: 42px;
  display: inline-grid;
  gap: 5px;
  align-content: center;
  justify-items: start;
  padding: 10px;
  border: 0;
  color: var(--fg);
  background: transparent;
  cursor: pointer;
}
.menu-toggle span { width: 22px; height: 1px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.wordmark { color: var(--fg); font-size: .72rem; font-weight: 850; letter-spacing: .15em; text-align: center; text-decoration: none; text-transform: uppercase; }
.wordmark span { opacity: .55; }
.nav-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.contact-link, .theme-toggle {
  min-height: 40px;
  border: 1px solid var(--fg);
  border-radius: 0;
  color: var(--fg);
  background: transparent;
  font: inherit;
  font-size: .8rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, color .2s ease, background .2s ease;
}
.contact-link { display: inline-flex; align-items: center; padding: 0 14px; }
.contact-link:hover, .contact-link:focus-visible, .theme-toggle:hover, .theme-toggle:focus-visible { color: var(--bg); background: var(--fg); transform: translateY(-2px); }
.theme-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; }
.toggle-track { position: relative; width: 27px; height: 14px; border: 1px solid currentColor; border-radius: 10px; }
.toggle-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 8px; height: 8px; border-radius: 50%; background: currentColor; transition: transform .2s ease; }
:root[data-theme="light"] .toggle-track::after { transform: translateX(12px); }

.menu-panel { position: fixed; z-index: 9; inset: 0 auto 0 0; width: min(390px, 88vw); display: flex; flex-direction: column; justify-content: space-between; padding: 112px 38px 35px; color: var(--fg); background: var(--bg); border-right: 1px solid var(--line); transform: translateX(-102%); transition: transform .25s ease; }
.menu-panel.is-open { transform: translateX(0); }
.menu-panel nav { display: grid; gap: 4px; }
.menu-panel nav a { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: clamp(1.35rem, 5vw, 2rem); font-weight: 720; letter-spacing: -.045em; text-decoration: none; }
.menu-panel nav a[aria-current="page"]::after { content: "— here"; display: block; margin-top: 3px; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.menu-panel p { margin: 0; color: var(--muted); font-size: .82rem; }

/* Section 2: shared introduction */
.profile-intro { padding: clamp(66px, 11vw, 125px) 0 clamp(62px, 10vw, 110px); text-align: center; }
.portrait { position: relative; width: clamp(122px, 15vw, 180px); aspect-ratio: 1; display: grid; place-items: center; margin: 0 auto 23px; overflow: hidden; border: 1px solid var(--fg); border-radius: 50%; background: var(--soft); font-size: clamp(2.1rem, 4vw, 3.5rem); font-weight: 850; letter-spacing: -.1em; }
.portrait-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portrait-photo[hidden] { display: none; }
.time-location { margin: 0 0 18px; color: var(--muted); font-size: .9rem; font-weight: 700; }
.page-heading { max-width: 970px; margin: 0 auto; font-size: clamp(1.7rem, 3.6vw, 3.35rem); line-height: 1.1; letter-spacing: -.06em; font-weight: 760; }
.page-heading span { display: block; margin-top: 9px; color: var(--muted); font-weight: 600; }
.page-banner { min-height: clamp(300px, 46vh, 500px); display: grid; place-items: center; border-bottom: 1px solid var(--line); text-align: center; }
.page-banner .section-label { margin-bottom: 16px; }
.page-banner h1 { max-width: 820px; margin: 0; font-size: clamp(2.4rem, 6vw, 5.5rem); line-height: .96; letter-spacing: -.075em; }
.down-arrow { width: 42px; height: 42px; display: grid; place-items: center; margin: 30px auto 0; border: 1px solid var(--line); border-radius: 50%; color: var(--fg); font-size: 1.2rem; text-decoration: none; transition: transform .2s ease, color .2s ease, background .2s ease; }
.down-arrow:hover, .down-arrow:focus-visible { color: var(--bg); background: var(--fg); transform: translateY(4px); }

/* Section 3: page-specific details */
.details { border-top: 1px solid var(--line); padding: 104px 0; }
.section-label { margin: 0 0 12px; color: var(--muted); font-size: .75rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
h2 { max-width: 790px; margin: 0; font-size: clamp(2.35rem, 5vw, 5.1rem); line-height: .96; letter-spacing: -.075em; }
.lead { max-width: 650px; margin: 22px 0 0; color: var(--muted); font-size: 1.05rem; }
.detail-split { display: grid; grid-template-columns: 1fr 1fr; margin-top: 60px; border: 1px solid var(--line); }
.detail-card { min-width: 0; min-height: 310px; padding: 30px; }
.detail-card + .detail-card { border-left: 1px solid var(--line); }
.detail-card .card-number { color: var(--muted); font-size: .75rem; font-weight: 850; letter-spacing: .12em; }
.detail-card h3 { max-width: 390px; margin: 74px 0 12px; font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1; letter-spacing: -.055em; }
.detail-card p { max-width: 400px; margin: 0 0 23px; color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: space-between; min-width: 222px; min-height: 48px; padding: 0 15px 0 17px; border: 1px solid var(--fg); color: var(--button-fg); background: var(--button-bg); font-size: .9rem; font-weight: 850; text-decoration: none; transition: transform .2s ease, color .2s ease, background .2s ease; }
.button:hover, .button:focus-visible { color: var(--fg); background: transparent; transform: translateY(-3px); }
.button .arrow { font-size: 1.2rem; }

.resume-top { display: grid; grid-template-columns: 1.15fr .85fr; gap: 62px; align-items: end; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.fact { min-height: 105px; padding: 17px; background: var(--bg); }
.fact strong { display: block; font-size: 1.3rem; letter-spacing: -.055em; }
.fact span { color: var(--muted); font-size: .78rem; }
.expertise { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 58px; border: 1px solid var(--line); background: var(--line); }
.expertise article { min-width: 0; min-height: 188px; padding: 22px; background: var(--bg); }
.expertise-label { color: var(--muted); font-size: .74rem; font-weight: 850; letter-spacing: .11em; }
.expertise h3 { margin: 51px 0 7px; font-size: 1.12rem; letter-spacing: -.035em; }
.expertise p { margin: 0; color: var(--muted); font-size: .9rem; }
.section-subtitle { margin: 72px 0 18px; font-size: 1.05rem; letter-spacing: -.025em; }
.timeline, .education { border-top: 1px solid var(--line); }
.role, .education-row { display: grid; grid-template-columns: 160px 1fr; gap: 25px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.role time, .role-company, .role-detail, .education-row time, .education-row p { color: var(--muted); font-size: .89rem; }
.role time { font-weight: 760; }
.role h3, .education-row h3 { margin: 0; font-size: 1.15rem; letter-spacing: -.035em; }
.role-company { margin: 5px 0 0; }
.role-detail { margin: 0; }
.education-row { grid-template-columns: 160px minmax(0, 1fr) minmax(220px, .8fr); }
.education-row p { margin: 0; }
.education-row div > p { margin-top: 5px; }
.profile-links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 28px; }
.pdf-link, .linkedin-link { display: inline-flex; align-items: center; gap: 9px; color: var(--fg); font-size: .88rem; font-weight: 800; text-decoration: none; }
.pdf-link { border-bottom: 1px solid var(--fg); }
.linkedin-link { width: 33px; height: 33px; justify-content: center; border: 1px solid var(--fg); }
.linkedin-link svg { width: 15px; height: 15px; fill: currentColor; }
.edit-note { margin: 18px 0 0; color: var(--muted); font-size: .82rem; font-style: italic; }

.interests { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-top: 60px; border: 1px solid var(--line); background: var(--line); }
.interest { min-width: 0; min-height: 250px; display: flex; flex-direction: column; justify-content: space-between; padding: 25px; background: var(--bg); }
.interest-symbol { color: var(--muted); font-size: 1.8rem; line-height: 1; }
.interest h3 { margin: 45px 0 7px; font-size: 1.46rem; letter-spacing: -.045em; }
.interest p { margin: 0; color: var(--muted); font-size: .91rem; }
.planned-button { align-self: flex-start; min-height: 36px; padding: 0 11px; border: 1px solid var(--line); color: var(--muted); background: transparent; font: inherit; font-size: .77rem; font-weight: 800; cursor: not-allowed; }

/* Section 4: shared contact area */
.contact { border-top: 1px solid var(--line); padding: 100px 0; text-align: center; }
.contact h2, .contact .lead { margin-inline: auto; }
.contact .button { margin-top: 27px; text-align: left; }
footer { border-top: 1px solid var(--line); padding: 21px 0; color: var(--muted); font-size: .8rem; }
.footer-content { display: flex; justify-content: space-between; gap: 20px; }
.footer-content p { margin: 0; }
.footer-content a { color: var(--fg); text-decoration: none; }

@media (max-width: 800px) {
  .container { width: min(100% - 32px, 1160px); }
  .profile-intro { padding: 73px 0; }
  .page-banner { min-height: 310px; }
  .details { padding: 78px 0; }
  .detail-split, .resume-top { grid-template-columns: 1fr; }
  .detail-card { min-height: 0; padding: 27px 20px 30px; }
  .detail-card + .detail-card { border-top: 1px solid var(--line); border-left: 0; }
  .detail-card h3 { margin-top: 40px; }
  .facts { max-width: 490px; }
  .expertise, .interests { grid-template-columns: 1fr; }
  .expertise article, .interest { min-height: 160px; }
  .expertise h3, .interest h3 { margin-top: 33px; }
  .role { grid-template-columns: 125px 1fr; }
  .education-row { grid-template-columns: 125px 1fr; }
  .education-row > p { grid-column: 2; }
  .role-detail { grid-column: 2; }
  .contact { padding: 78px 0; }
}

@media (max-width: 520px) {
  .nav { min-height: 66px; }
  .wordmark { font-size: .59rem; letter-spacing: .11em; }
  .nav-actions { gap: 6px; }
  .contact-link { padding: 0 10px; font-size: .74rem; }
  .theme-toggle { width: 42px; justify-content: center; padding: 0; }
  .theme-toggle .toggle-label { display: none; }
  .profile-intro { padding: 58px 0 62px; }
  .portrait { width: 122px; }
  .page-heading { font-size: clamp(1.65rem, 8vw, 2.3rem); }
  .button { width: 100%; }
  .role, .education-row { grid-template-columns: 1fr; gap: 6px; }
  .role-detail { grid-column: auto; margin-top: 5px; }
  .education-row > p { grid-column: auto; margin-top: 5px; }
  .footer-content { display: block; }
  .footer-content p { margin-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
