/* ─────────────────────────────────────────────────────────────
   Executive theme: deep navy, warm neutrals, muted gold accents.
   ───────────────────────────────────────────────────────────── */
:root {
  --bg: #fbfaf7;
  --bg-alt: #f3f1ec;
  --surface: #ffffff;
  --text: #1f2a3c;
  --ink: #0f1f38;
  --muted: #5a6475;
  --border: #e2ded5;
  --rule: #d6d0c4;
  --accent: #1d3d6b;
  --gold: #b8955a;
  --gold-text: #86672f;
  --hero-bg: #0f1f38;
  --hero-bg-2: #16294a;
  --hero-text: #f3efe6;
  --hero-muted: #aeb8c9;
  --btn-bg: #0f1f38;
  --btn-text: #ffffff;
  --ok: #1f7a4d;
  --err: #b3261e;
  --shadow: 0 1px 2px rgba(15, 31, 56, 0.05), 0 12px 32px rgba(15, 31, 56, 0.08);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1526;
    --bg-alt: #0f1b30;
    --surface: #13213a;
    --text: #dcdfe5;
    --ink: #f3efe6;
    --muted: #9aa4b5;
    --border: #22314b;
    --rule: #2c3d5c;
    --accent: #d4b47c;
    --gold: #cfad72;
    --gold-text: #d4b47c;
    --hero-bg: #070f1d;
    --hero-bg-2: #0d1a31;
    --btn-bg: #d4b47c;
    --btn-text: #0b1526;
    --ok: #6fcf97;
    --err: #ff8a80;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1526;
  --bg-alt: #0f1b30;
  --surface: #13213a;
  --text: #dcdfe5;
  --ink: #f3efe6;
  --muted: #9aa4b5;
  --border: #22314b;
  --rule: #2c3d5c;
  --accent: #d4b47c;
  --gold: #cfad72;
  --gold-text: #d4b47c;
  --hero-bg: #070f1d;
  --hero-bg-2: #0d1a31;
  --btn-bg: #d4b47c;
  --btn-text: #0b1526;
  --ok: #6fcf97;
  --err: #ff8a80;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-color: currentColor;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
  line-height: 1.2;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  background: var(--surface);
  padding: 8px 12px;
}

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

/* ── Navigation ──────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--hero-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}
.brand {
  margin-right: auto;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--hero-text);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--hero-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav-links a:hover {
  color: var(--hero-text);
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: transparent;
  color: var(--hero-text);
  cursor: pointer;
}
.icon-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ── Hero ────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 104px 0 96px;
  background:
    radial-gradient(1200px 500px at 85% 0%, var(--hero-bg-2), transparent 70%),
    var(--hero-bg);
  color: var(--hero-text);
  overflow: hidden;
}
.hero::after {
  /* faint architectural grid */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(90deg, transparent, #000 60%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 64px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.badge::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--gold);
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6.2vw, 4.4rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--hero-text);
}
.role {
  margin: 14px 0 0;
  color: var(--hero-muted);
  font-size: 1.15rem;
  font-weight: 500;
}
.nowrap {
  white-space: nowrap;
}
.location {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  color: var(--hero-text);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.location svg {
  color: var(--gold);
}
.tagline {
  max-width: 600px;
  margin: 28px 0 0;
  padding-left: 20px;
  border-left: 2px solid var(--gold);
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.55;
  color: var(--hero-text);
}
.creds {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
}
.creds li {
  color: var(--hero-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.creds li + li::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 14px;
  border-radius: 50%;
  background: var(--gold);
  vertical-align: middle;
}

.avatar {
  position: relative;
  width: 260px;
  height: 320px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #1c3358, #0b172b);
  color: var(--gold);
  font-family: var(--serif);
  font-size: 4.5rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.avatar::before {
  /* offset gold frame */
  content: "";
  position: absolute;
  inset: 0;
  transform: translate(14px, 14px);
  border: 1px solid var(--gold);
  z-index: -1;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92);
}

/* ── Buttons ─────────────────────────────────────── */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  border: 1px solid var(--btn-bg);
  border-radius: 2px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover {
  background: transparent;
  color: var(--ink);
}
.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}
.hero .btn.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #0b1526;
}
.hero .btn.primary:hover {
  background: transparent;
  color: var(--gold);
}
.btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--hero-text);
}
.btn.ghost:hover {
  border-color: var(--hero-text);
  color: var(--hero-text);
}
.btn.ghost-dark {
  background: transparent;
  border-color: var(--rule);
  color: var(--ink);
}
.btn.ghost-dark:hover {
  border-color: var(--ink);
}

.actions .resume-note {
  align-self: center;
  margin: 0 0 0 8px;
  color: var(--hero-muted);
  font-size: 0.9rem;
  font-style: italic;
}
.social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  font-size: 0.92rem;
}
.social a {
  color: var(--hero-muted);
}
.social a:hover {
  color: var(--hero-text);
}

/* ── Stat band ───────────────────────────────────── */
.stat-band {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 auto;
}
.stat {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  padding: 36px 28px;
  border-left: 1px solid var(--border);
}
.stat:first-child {
  border-left: 0;
  padding-left: 0;
}
.stat dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 2.6rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
}
.stat dt {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

/* ── Sections ────────────────────────────────────── */
.section {
  padding: 112px 0;
}
.section.alt {
  background: var(--bg-alt);
}
.split {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.section-head {
  position: sticky;
  top: 104px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  color: var(--gold-text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}
.eyebrow::after {
  content: "";
  width: 40px;
  height: 1px;
  background: var(--gold);
}
.section h2 {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h3.sub {
  margin: 72px 0 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
}
.meta {
  color: var(--muted);
  font-size: 0.88rem;
}

/* About */
.prose p {
  margin: 0 0 22px;
  font-size: 1.1rem;
  line-height: 1.8;
}
.prose p:first-child {
  font-family: var(--serif);
  font-size: 1.4rem;
  line-height: 1.6;
  color: var(--ink);
}

/* Key results: numbered editorial list */
.results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 48px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: result;
}
.result {
  position: relative;
  padding: 28px 0 28px 56px;
  border-top: 1px solid var(--rule);
  counter-increment: result;
}
.result::before {
  content: counter(result, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 30px;
  color: var(--gold-text);
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
}
.result h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
}
.result p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.97rem;
}

/* Hands-on engineering */
.eng-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.eng-card {
  padding: 24px 24px 22px;
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  background: var(--surface);
}
.eng-card h3 {
  margin-bottom: 12px;
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 600;
}
.eng-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.eng-card li {
  position: relative;
  padding-left: 16px;
  font-size: 0.93rem;
  line-height: 1.5;
}
.eng-card li + li {
  margin-top: 7px;
}
.eng-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  background: var(--gold);
  transform: rotate(45deg);
}

/* Experience timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.job {
  position: relative;
  padding: 0 0 44px 32px;
  border-left: 1px solid var(--rule);
}
.job:last-child {
  padding-bottom: 0;
}
.job::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 8px;
  width: 9px;
  height: 9px;
  background: var(--gold);
  transform: rotate(45deg);
}
.job-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 20px;
}
.job h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
}
.job .meta {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.company {
  margin: 4px 0 0;
  font-size: 0.97rem;
}
.company strong {
  color: var(--accent);
  font-weight: 600;
}
.company .context {
  color: var(--muted);
}
.company strong + .context::before {
  content: " — ";
}
.summary {
  margin: 14px 0 0;
}
.job ul {
  margin: 12px 0 0;
  padding-left: 18px;
}
.job li + li {
  margin-top: 6px;
}
.job li::marker {
  color: var(--gold);
}
.job .tags {
  margin-top: 16px;
}
.more {
  margin-top: 18px;
}
.more summary {
  width: fit-content;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.detail-group {
  margin-top: 22px;
}
.detail-group h4 {
  font-size: 0.98rem;
  font-weight: 600;
}
.detail-group ul {
  margin-top: 8px;
}

/* Expertise */
.section-intro {
  max-width: 720px;
  margin: 0 0 40px;
  padding-left: 18px;
  border-left: 2px solid var(--gold);
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--ink);
}
h3.sub + .section-intro {
  margin-top: -8px;
  font-size: 1.05rem;
}
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 36px 40px;
}
.skill-group h3 {
  margin-bottom: 12px;
  color: var(--gold-text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tags li {
  padding: 3px 10px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--text);
  font-size: 0.84rem;
}
.skills .tags {
  gap: 4px 18px;
}
.skills .tags li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
}
.skills .tags li::before {
  content: "";
  flex: none;
  width: 4px;
  height: 4px;
  background: var(--gold);
  transform: rotate(45deg);
}
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0 48px;
}
.plain {
  list-style: none;
  margin: 0;
  padding: 0;
}
.plain li {
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.plain li:first-child {
  border-top: 0;
  padding-top: 0;
}
.plain strong {
  color: var(--ink);
  font-weight: 600;
}

/* Contact */
.contact {
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.lead {
  margin: 0 0 32px;
  font-family: var(--serif);
  font-size: 1.4rem;
  line-height: 1.55;
  color: var(--ink);
}
.contact-form {
  display: grid;
  gap: 18px;
  max-width: 640px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.contact-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.optional {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
}
.contact-form textarea {
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent);
}
.hp {
  position: absolute;
  left: -9999px;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.form-status {
  margin: 0;
  font-size: 0.95rem;
}
.form-status.ok {
  color: var(--ok);
}
.form-status.err {
  color: var(--err);
}
.or {
  margin: 48px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.email-actions .actions {
  margin-top: 16px;
}
.copied {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer {
  padding: 36px 0;
  background: var(--hero-bg);
  color: var(--hero-muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.footer p {
  margin: 0;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 960px) {
  .split {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .section-head {
    position: static;
  }
  .results {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 820px) {
  .nav-links {
    display: none;
  }
  .hero {
    padding: 64px 0 64px;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .avatar {
    order: -1;
    width: 132px;
    height: 160px;
    font-size: 2.6rem;
  }
  .avatar::before {
    transform: translate(8px, 8px);
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat {
    padding: 24px 20px;
    border-top: 1px solid var(--border);
  }
  .stat:nth-child(odd) {
    border-left: 0;
    padding-left: 0;
  }
  .stat:nth-child(-n + 2) {
    border-top: 0;
  }
  .stat dd {
    font-size: 2.1rem;
  }
  .section {
    padding: 72px 0;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .actions .resume-note {
    margin-left: 0;
    flex-basis: 100%;
  }
}
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  .tagline {
    font-size: 1.15rem;
  }
  .creds {
    gap: 8px 18px;
  }
  .creds li + li::before {
    display: none;
  }
  .prose p:first-child,
  .lead {
    font-size: 1.2rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ── Print: a clean résumé ───────────────────────── */
@media print {
  .nav,
  .actions,
  .avatar,
  .contact,
  .skip,
  .badge,
  .more summary,
  .eyebrow,
  .hero::after {
    display: none !important;
  }
  :root {
    --text: #000;
    --ink: #000;
    --muted: #444;
  }
  body {
    background: #fff;
    font-size: 10.5pt;
  }
  .hero {
    padding: 0 0 12px;
    background: none;
    color: #000;
  }
  .hero h1,
  .tagline,
  .role,
  .location,
  .creds li,
  .social a {
    color: #000;
  }
  .hero h1 {
    font-size: 24pt;
  }
  .tagline {
    font-size: 12pt;
  }
  .stat-band {
    border: 0;
  }
  .stat {
    padding: 8px 12px;
  }
  .stat dd {
    font-size: 16pt;
  }
  .section {
    padding: 14px 0;
    background: none !important;
  }
  .split {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .section-head {
    position: static;
  }
  .section h2 {
    font-size: 16pt;
  }
  h3.sub {
    margin-top: 18px;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .result,
  .job,
  .eng-card {
    break-inside: avoid;
  }
  .eng-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .eng-card {
    padding: 8px 10px;
  }
  .social a[href^="http"]::after {
    content: " (" attr(href) ")";
  }
  .footer {
    display: none;
  }
}
