:root {
  --navy: #16253a;
  --navy-deep: #0d1a2b;
  --blue: #2b5f8a;
  --blue-light: #e8f0f6;
  --ink: #243244;
  --muted: #5f6c7b;
  --line: #d9e0e7;
  --surface: #f5f7f9;
  --white: #ffffff;
  --container: 1120px;
  --font: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration-thickness: .08em; text-underline-offset: .2em; }
a:hover { color: var(--navy-deep); }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #b25518; outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--navy-deep); line-height: 1.18; }
h1, h2 { letter-spacing: -.025em; }
ul { margin: 0; padding: 0; }
.container { width: min(calc(100% - 3rem), var(--container)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 1rem;
  left: 1rem;
  padding: .7rem 1rem;
  transform: translateY(-180%);
  background: var(--navy-deep);
  color: var(--white);
  font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; z-index: 20; top: 0; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); }
.nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.site-name { color: var(--navy-deep); font-size: 1.05rem; font-weight: 700; text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 1.35rem; list-style: none; }
.nav-links a { color: var(--muted); font-size: .86rem; font-weight: 600; text-decoration: none; }
.nav-links a:hover { color: var(--navy-deep); }
.nav-toggle { display: none; min-width: 44px; min-height: 44px; padding: .5rem; border: 0; background: transparent; }
.nav-toggle span[aria-hidden] { display: block; width: 23px; height: 2px; margin: 5px auto; background: var(--navy-deep); }

.hero { padding-block: clamp(5rem, 10vw, 8.5rem); background: linear-gradient(110deg, #f3f6f9 0%, #fff 72%); border-bottom: 1px solid var(--line); }
.hero-inner { max-width: var(--container); display: grid; grid-template-columns: minmax(0, 1fr) clamp(250px, 28vw, 360px); gap: clamp(2.5rem, 6vw, 5rem); align-items: center; }
.hero-copy { min-width: 0; }
.hero-portrait { width: 100%; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 50%; background: #d8d8d8; box-shadow: 0 18px 45px rgba(17,35,57,.12); }
.hero-portrait img { width: 100%; height: auto; display: block; }
.section-label { margin-bottom: 1rem; color: var(--blue); font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.hero h1 { margin-bottom: .8rem; font-size: clamp(3.2rem, 8vw, 6.5rem); font-weight: 650; }
.hero-summary { max-width: 760px; margin-bottom: 2.4rem; color: #47576a; font-size: clamp(1.15rem, 2.1vw, 1.4rem); line-height: 1.55; }
.hero-details { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
.hero-details p { min-height: 95px; margin: 0; padding: 1.2rem 1.4rem 1.2rem 0; }
.hero-details p + p { padding-left: 1.4rem; border-left: 1px solid var(--line); }
.hero-details strong, .hero-details span { display: block; }
.hero-details strong { margin-bottom: .25rem; color: var(--navy-deep); font-size: .82rem; }
.hero-details span { color: var(--muted); font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: .7rem; padding: .7rem 1.15rem; border: 1px solid transparent; font-weight: 700; text-decoration: none; }
.button-primary { background: var(--navy); color: var(--white); }
.button-primary:hover { background: var(--navy-deep); color: var(--white); }
.button-secondary { border-color: var(--navy); color: var(--navy); }
.button-secondary:hover { background: var(--blue-light); color: var(--navy-deep); }
.text-action { min-height: 44px; display: inline-flex; align-items: center; gap: .7rem; padding: .5rem; font-weight: 700; }

.section { padding-block: clamp(4.5rem, 8vw, 7rem); }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-intro { max-width: 720px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-intro h2, .contact-layout h2 { margin-bottom: 1rem; font-size: clamp(2rem, 4vw, 3.25rem); font-weight: 650; }
.section-intro > p:last-child:not(.section-label) { color: var(--muted); }
.content-columns { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(3rem, 8vw, 7rem); }
.lead { color: var(--navy); font-size: clamp(1.3rem, 2.5vw, 1.8rem); line-height: 1.45; }
.prose { color: var(--muted); }
.prose p + p { margin-top: 1.5rem; }

.experience { border-top: 3px solid var(--navy); background: var(--white); box-shadow: 0 12px 32px rgba(17,35,57,.06); }
.experience-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; padding: 2rem; border-bottom: 1px solid var(--line); }
.experience-heading h3 { margin-bottom: .35rem; font-size: 1.6rem; }
.experience-heading div p { margin: 0; color: var(--muted); }
.experience-body { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 6vw, 5rem); padding: 2rem; }
.experience-body > p { color: #3c4d60; font-size: 1.08rem; }
.experience-list { padding-left: 1.2rem; color: var(--muted); }
.experience-list li + li { margin-top: .7rem; }
.skills-list { border-top: 1px solid var(--line); }
.skills-list article { display: grid; grid-template-columns: .55fr 1.45fr; gap: 2rem; padding: 1.55rem 0; border-bottom: 1px solid var(--line); }
.skills-list h3 { margin: 0; font-size: 1.05rem; }
.skills-list ul { display: flex; flex-wrap: wrap; gap: .55rem 1.5rem; color: var(--muted); list-style: none; }
.skills-list li::before { margin-right: .5rem; color: var(--blue); content: "•"; }

.credential-layout { display: grid; grid-template-columns: .7fr 1.3fr; gap: clamp(3rem, 8vw, 8rem); }
.credential-list { border-top: 1px solid var(--line); list-style: none; }
.credential-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 2rem; padding: 1.35rem 0; border-bottom: 1px solid var(--line); }
.credential-list strong { color: var(--navy-deep); }
.credential-list span { color: var(--muted); font-size: .82rem; text-align: right; }
.education-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.education-list article { padding: 2rem; border: 1px solid var(--line); }
.education-list h3 { margin-bottom: .6rem; font-size: 1.35rem; }
.education-list p { margin: 0; color: var(--muted); }

.project-list { border-top: 1px solid #c9d2dc; }
.project { padding: 2rem 0; border-bottom: 1px solid #c9d2dc; }
.project-type { margin-bottom: .35rem; color: var(--blue); font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.project h3 { margin: 0; font-size: 1.35rem; }

.contact-section { background: var(--navy); color: #dce5ee; }
.contact-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(3rem, 8vw, 8rem); }
.contact-layout h2 { color: var(--white); }
.contact-layout .section-label { color: #a7c8e2; }
.contact-layout > div:last-child > p { max-width: 620px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.5rem; }
.button-light { background: var(--white); color: var(--navy-deep); }
.button-light:hover { background: var(--blue-light); color: var(--navy-deep); }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 120px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.footer-inner p { margin: 0; }
.footer-inner strong, .footer-inner span { display: block; }
.footer-inner span { color: var(--muted); font-size: .82rem; }
.footer-inner a { font-size: .9rem; font-weight: 600; }

.error-page { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.error-header, .error-footer { padding-block: 1.4rem; border-bottom: 1px solid var(--line); }
.error-footer { border-top: 1px solid var(--line); border-bottom: 0; color: var(--muted); font-size: .85rem; }
.error-main { display: grid; align-items: center; padding-block: 5rem; }
.error-content { max-width: 680px; }
.error-code { margin-bottom: 1rem; color: var(--blue); font-size: .82rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.error-content h1 { margin-bottom: 1rem; font-size: clamp(3rem, 8vw, 5.5rem); }
.error-content > p { max-width: 560px; color: var(--muted); font-size: 1.1rem; }
.error-content .button { margin-top: 1.4rem; }

@media (max-width: 940px) {
  .nav-toggle { display: block; }
  .nav-links { position: absolute; top: 100%; left: 0; width: 100%; display: none; flex-direction: column; align-items: stretch; gap: 0; padding: .6rem 1.5rem 1.2rem; background: var(--white); border-bottom: 1px solid var(--line); box-shadow: 0 10px 20px rgba(17,35,57,.08); }
  .nav-links.is-open { display: flex; }
  .nav-links a { min-height: 44px; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
}

@media (max-width: 720px) {
  .container { width: min(calc(100% - 2rem), var(--container)); }
  .hero { padding-block: clamp(3rem, 10vw, 4.5rem); }
  .hero-inner { grid-template-columns: 1fr; gap: 1.75rem; }
  .hero-portrait { width: min(62vw, 230px); justify-self: center; }
  .hero-details, .content-columns, .experience-body, .credential-layout, .education-list, .contact-layout { grid-template-columns: 1fr; }
  .hero-details p { min-height: auto; padding: 1rem 0; }
  .hero-details p + p { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .experience-heading { flex-direction: column; }
  .skills-list article { grid-template-columns: 1fr; gap: .8rem; }
  .credential-layout { gap: 1rem; }
  .project { grid-template-columns: 1fr; gap: .8rem; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 2rem; }
}

@media (max-width: 430px) {
  .hero h1 { font-size: 3rem; }
  .hero-summary { margin-bottom: 1.5rem; font-size: 1.08rem; }
  .hero-portrait { width: min(58vw, 190px); }
  .actions { align-items: stretch; flex-direction: column; }
  .actions .button { width: 100%; }
  .actions .text-action { justify-content: center; }
  .contact-actions { flex-direction: column; }
  .credential-list li { align-items: flex-start; flex-direction: column; gap: .3rem; }
  .credential-list span { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
