:root {
  color-scheme: light dark;
  --background: #f0f3f7;
  --surface: #ffffff;
  --ink: #111d2c;
  --muted: #506176;
  --accent: #005fc5;
  --line: #d6dfe9;
  --soft: #e7f1fd;
  --shadow: 0 12px 38px rgba(18, 36, 58, .075);
  --page-width: 980px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0c121b;
    --surface: #151f2d;
    --ink: #f0f5fa;
    --muted: #b3c0d1;
    --accent: #65d9ff;
    --line: #304155;
    --soft: #1c3449;
    --shadow: 0 16px 42px rgba(0, 0, 0, .19);
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 7.75rem;
  background: var(--background);
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.65;
}

body, button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button, a { touch-action: manipulation; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  z-index: 10;
  top: .5rem;
  left: .75rem;
  padding: .65rem 1rem;
  transform: translateY(-160%);
  border-radius: .75rem;
  background: var(--surface);
  color: var(--ink);
}
.skip-link:focus { transform: translateY(0); }

.masthead {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  min-height: 4rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .45rem max(1rem, calc((100vw - var(--page-width)) / 2 + 1rem));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--background) 90%, transparent);
  backdrop-filter: blur(18px);
}

.wordmark {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: .7rem;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-decoration: none;
}

.wordmark img { border-radius: 50%; object-fit: cover; }
.wordmark [aria-hidden] { padding: 0 .18rem; color: var(--muted); }

.install-callout {
  width: min(92vw, 32rem);
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}
.install-callout[open] {
  display: grid;
  place-items: center;
}
.install-callout::backdrop {
  background: rgba(12, 18, 27, .56);
  backdrop-filter: blur(16px) saturate(.78);
  -webkit-backdrop-filter: blur(16px) saturate(.78);
}
.install-callout-card {
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: clamp(1.4rem, 6vw, 2.1rem);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 1.4rem;
  background: linear-gradient(145deg, color-mix(in srgb, var(--soft) 55%, var(--surface)), var(--surface) 72%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .34), 0 0 0 1px color-mix(in srgb, var(--accent) 15%, transparent);
  text-align: center;
  animation: install-callout-enter 220ms ease-out both;
}
.install-callout-card .eyebrow {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  margin: 0;
  padding: .2rem .55rem;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .07em;
  line-height: 1.4;
}
.install-callout-title {
  margin: .55rem 0 .75rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 6vw, 2.15rem);
  font-weight: 500;
  letter-spacing: -.025em;
  line-height: 1.12;
}
.install-callout-detail {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.55;
}
.install-callout-timeout {
  margin: 1rem 0 1.25rem;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.4;
}
.install-callout-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}
.install-callout-actions .button {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: .7rem .5rem;
}
@keyframes install-callout-enter {
  from { opacity: 0; transform: translateY(.5rem) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 400px) and (max-height: 760px) {
  body .hero { padding-top: .45rem; }
  body .hero-card { padding: .85rem; }
  body .hero-card > .eyebrow { font-size: .57rem; line-height: 1.35; }
  body .identity { gap: .65rem; margin-top: .35rem; }
  body .portrait { width: 4rem; height: 4rem; flex-basis: 4rem; }
  body h1 { font-size: clamp(1.65rem, 7vw, 2rem); }
  body .role { margin-top: .18rem; font-size: .82rem; line-height: 1.35; }
  body .hero-statement { margin: .42rem 0 .3rem; font-size: clamp(1.45rem, 6vw, 1.75rem); line-height: 1.08; }
  body .hero-context { margin: .3rem 0 .5rem; font-size: .82rem; line-height: 1.4; }
  body .hero-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
  body .hero-actions .button { min-height: 44px; padding: .5rem .35rem; font-size: .78rem; gap: .3rem; }
}

.section-nav {
  position: sticky;
  z-index: 4;
  top: 4rem;
  display: flex;
  max-width: var(--page-width);
  gap: .45rem;
  overflow-x: auto;
  margin: 0 auto;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--background) 95%, transparent);
  scrollbar-width: none;
  backdrop-filter: blur(16px);
}
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a {
  display: inline-flex;
  min-height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: .45rem .9rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 650;
  text-decoration: none;
}
.section-nav a[aria-current="location"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }

main, .site-footer {
  width: min(100%, var(--page-width));
  margin-inline: auto;
}

.section { padding: 2rem 1.1rem; }
.hero { padding-top: 1rem; }
.hero-card {
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .12em;
  line-height: 1.55;
}
.hero .eyebrow { font-size: .65rem; letter-spacing: .095em; }

.identity {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-top: .65rem;
}
.portrait {
  display: block;
  width: 5.25rem;
  height: 5.25rem;
  flex: 0 0 5.25rem;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--soft);
  object-fit: cover;
}

h1, h2, h3, p { overflow-wrap: anywhere; }
h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 8vw, 3.1rem);
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: .99;
}
.role { margin: .28rem 0 0; color: var(--muted); font-size: .9rem; font-weight: 550; }

.hero-statement {
  margin: .8rem 0 .42rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 6.8vw, 2.35rem);
  letter-spacing: -.032em;
  line-height: 1.12;
}

.hero-context { margin: .55rem 0 1rem; color: var(--muted); font-size: .89rem; line-height: 1.55; }
.hero-actions, .contact-actions { display: grid; gap: .55rem; }
.hero-actions.hero-actions-single { grid-template-columns: minmax(0, 1fr); }

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .73rem 1rem;
  border: 1px solid transparent;
  border-radius: .85rem;
  font: inherit;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 130ms ease, background-color 130ms ease, border-color 130ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .button-primary { color: #07121d; } }
.button-secondary { border-color: var(--line); background: var(--surface); color: var(--accent); }
.button-quiet { background: transparent; color: var(--accent); }
.privacy-note, .builder-note { margin: .9rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }

.section-heading { max-width: 42rem; margin-bottom: 1rem; }
.section-heading h2, .builder-section h2 {
  margin: .35rem 0 .3rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 7.2vw, 2.65rem);
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: 1.1;
}
.section-intro { margin: .45rem 0 0; color: var(--muted); }

.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.metric {
  min-height: 7rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}
.metric-value { display: block; color: var(--accent); font-family: ui-monospace, monospace; font-size: 1.75rem; font-weight: 800; line-height: 1.2; }
.metric-label { display: block; margin-top: .38rem; color: var(--muted); font-size: .82rem; line-height: 1.4; }

.career-list, .expertise-grid { display: grid; gap: .8rem; }
.career-card, .expertise-card, .contact-card, .education-list li {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 0 6px 22px rgba(18, 36, 58, .035);
}
.career-card { overflow: hidden; }
.career-card summary {
  display: grid;
  min-height: 6rem;
  gap: .15rem .8rem;
  padding: 1rem;
  cursor: pointer;
  list-style: none;
}
.career-card summary::-webkit-details-marker { display: none; }
.career-card summary::after {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  justify-self: end;
  color: var(--accent);
  content: "+";
  font-size: 1.4rem;
}
.career-card[open] summary::after { content: "−"; }
.career-period { color: var(--accent); font-family: ui-monospace, monospace; font-size: .74rem; font-weight: 700; }
.career-company { font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; line-height: 1.25; }
.career-role, .career-location { color: var(--muted); font-size: .85rem; line-height: 1.45; }
.career-body { padding: 0 1rem 1.05rem; }
.career-body ul { display: grid; gap: .55rem; margin: 0; padding-left: 1.2rem; color: var(--ink); font-size: .9rem; }
.career-body li::marker { color: var(--accent); }
.tech-stack {
  margin-top: .9rem;
  padding: .7rem .8rem;
  border-radius: .75rem;
  background: var(--background);
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: .75rem;
  line-height: 1.55;
}

.expertise-grid { grid-template-columns: 1fr; }
.expertise-card { padding: 1rem; }
.expertise-card h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.28rem; font-weight: 500; }
.skill-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .8rem 0 0; padding: 0; list-style: none; }
.skill-chips li { padding: .35rem .62rem; border: 1px solid var(--line); border-radius: 999px; background: var(--background); color: var(--muted); font-size: .77rem; line-height: 1.35; }
.education-list { display: grid; gap: .7rem; margin: 0; padding: 0; list-style: none; }
.education-list li { padding: 1rem; font-family: Georgia, "Times New Roman", serif; font-size: 1rem; }

.contact-card { padding: 1rem; }
.contact-email { margin: 0; font-size: clamp(1rem, 4.4vw, 1.2rem); font-weight: 750; }
.contact-detail { margin: .2rem 0 1rem; color: var(--muted); font-size: .9rem; }
.contact-actions { gap: .5rem; }

.builder-section {
  margin: 1rem 1.1rem 2rem;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--soft);
}
.builder-section > p:not(.eyebrow):not(.builder-note) { color: var(--muted); }
.builder-section .button { width: 100%; }

.site-footer {
  padding: .5rem 1.1rem calc(1.5rem + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: .78rem;
}
.site-footer p { margin: .35rem 0; }
.site-footer > p:first-child { color: var(--accent); font-family: ui-monospace, monospace; font-size: .69rem; font-weight: 750; letter-spacing: .08em; }
.footer-links { display: flex; gap: 1rem; margin-top: .55rem; }
.connection-status:not([hidden]) { margin-top: .75rem; padding: .65rem .8rem; border-radius: .7rem; background: var(--surface); }

dialog {
  width: min(92vw, 26rem);
  max-height: min(82vh, 38rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 26px 90px rgba(0, 0, 0, .28);
}
dialog::backdrop { background: rgba(2, 9, 18, .55); backdrop-filter: blur(4px); }
dialog form { position: relative; padding: 1.35rem; }
dialog h2 { margin: .35rem 2.25rem .5rem 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.8rem; font-weight: 500; line-height: 1.15; }
dialog p:not(.eyebrow) { color: var(--muted); }
.dialog-close { position: absolute; top: .65rem; right: .75rem; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--background); color: var(--ink); font-size: 1.55rem; cursor: pointer; }
.dialog-done { width: 100%; margin-top: .5rem; border: 0; }

@media (min-width: 600px) {
  .section { padding: 2.6rem 1.5rem; }
  .hero { padding-top: 1.5rem; }
  .hero-card { padding: 1.6rem; }
  .identity { gap: 1.25rem; margin-top: .9rem; }
  .portrait { width: 6rem; height: 6rem; flex-basis: 6rem; }
  h1 { font-size: 3.2rem; }
  .hero-statement { margin-top: 1rem; font-size: 2.5rem; }
  .hero-actions, .contact-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .expertise-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-card { padding: 1.4rem; }
  .builder-section { margin-inline: 1.5rem; padding: 1.6rem; }
  .site-footer { padding-inline: 1.5rem; }
}

@media (min-width: 820px) {
  .section-nav { border: 0; border-radius: 999px; }
  .hero-card { padding: 2rem; }
  .identity { gap: 1.5rem; }
  .portrait { width: 7rem; height: 7rem; flex-basis: 7rem; }
  h1 { font-size: 3.5rem; }
  .hero-statement { font-size: 2.8rem; }
  .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .career-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .career-card:first-child { grid-column: 1 / -1; }
  .expertise-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .contact-section { display: grid; grid-template-columns: .85fr 1.15fr; align-items: start; gap: 1.5rem; }
  .contact-section > .section-heading { position: sticky; top: 9rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
