:root {
  --font-serif: "Iowan Old Style", "Charter", "Palatino Linotype", Georgia, Cambria, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --bg: #faf9f6;
  --surface: #ffffff;
  --surface-subtle: #f3f1ec;
  --ink: #17191c;
  --ink-secondary: #3f4650;
  --ink-muted: #646c78;
  --accent: #0f5c5c;
  --accent-hover: #0a4444;
  --accent-soft: #e6f1f0;
  --border: #e5e1d8;
  --border-strong: #cfc9bc;
  --shadow-subtle: 0 1px 2px rgba(23, 25, 28, 0.04);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116;
    --surface: #151a22;
    --surface-subtle: #1b222c;
    --ink: #f1f4f8;
    --ink-secondary: #bcc5d3;
    --ink-muted: #8b96a8;
    --accent: #4fd1c5;
    --accent-hover: #81e6d9;
    --accent-soft: rgba(79, 209, 197, 0.12);
    --border: #242c38;
    --border-strong: #344052;
    --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.3);

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1116;
  --surface: #151a22;
  --surface-subtle: #1b222c;
  --ink: #f1f4f8;
  --ink-secondary: #bcc5d3;
  --ink-muted: #8b96a8;
  --accent: #4fd1c5;
  --accent-hover: #81e6d9;
  --accent-soft: rgba(79, 209, 197, 0.12);
  --border: #242c38;
  --border-strong: #344052;
  --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.3);

  color-scheme: dark;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.96875rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

a:hover {
  color: var(--accent-hover);
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  z-index: 100;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Navigation */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}

.nav-brand:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.875rem;
}

.nav-links a {
  color: var(--ink-muted);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.375rem 0.675rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
  transition: border-color 140ms ease, color 140ms ease, background-color 140ms ease;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  color: var(--ink);
  background: var(--surface-subtle);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.theme-toggle {
  padding: 0.375rem 0.5rem;
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
  }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
}

/* Main layout */
.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.hero {
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--border);
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.avatar {
  display: block;
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
}

.hero-identity {
  min-width: 0;
}

.hero-eyebrow {
  margin: 0 0 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.hero-name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.hero-subtitle {
  margin: 0.4rem 0 0;
  font-size: 1.05rem;
  color: var(--ink-secondary);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin: 1.25rem 0 0;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.425rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-subtle);
}

.contact-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.contact-pill--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.contact-pill--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--bg);
}

.contact-pill svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.summary-block {
  margin: 1.85rem 0 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--accent);
  max-width: 72ch;
}

.summary-block p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.72;
  color: var(--ink-secondary);
}

/* Sections */
.section {
  padding-top: 2.75rem;
}

.section-header {
  padding-bottom: 0.65rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.section-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* Experience */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.role-entry {
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr);
  gap: 1.75rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--border);
}

.role-entry:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.role-meta {
  padding-top: 0.2rem;
}

.role-period {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.role-entry:first-child .role-period {
  color: var(--accent);
}

.role-location {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.role-header {
  margin-bottom: 0.85rem;
}

.role-company {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.role-title {
  margin: 0.15rem 0 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--accent);
}

.role-bullets {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.role-bullets li {
  position: relative;
  padding-left: 1.05rem;
  color: var(--ink-secondary);
  font-size: 0.94rem;
  line-height: 1.62;
}

.role-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-strong);
}

.bullet-label {
  font-weight: 600;
  color: var(--ink);
}

/* Skills */
.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.skill-group {
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr);
  gap: 1.75rem;
  align-items: baseline;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-subtle);
}

.skill-category {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skill-tag {
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 500;
}

/* Education */
.education-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.edu-card {
  padding: 1.4rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-subtle);
}

.edu-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  margin-bottom: 0.95rem;
  border-bottom: 1px solid var(--border);
}

.edu-institution {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
}

.edu-location {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.degree-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.degree-item {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.degree-name {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.38;
}

.degree-period {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-muted);
}

/* Footer */
.site-footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem;
}

.footer-links a {
  color: var(--ink-muted);
}

.footer-links a:hover {
  color: var(--accent);
}

.print-contact {
  display: none;
}

@media (max-width: 760px) {
  .nav-links {
    display: none;
  }

  .page {
    padding: 2rem 1.15rem 3rem;
  }

  .hero-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .avatar {
    width: 76px;
    height: 76px;
  }

  .role-entry {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .role-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.85rem;
    padding-top: 0;
  }

  .role-location {
    margin-top: 0;
  }

  .skill-group {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .education-grid {
    grid-template-columns: 1fr;
  }
}

/* Print */
@page {
  size: letter;
  margin: 0.5in 0.55in;
}

@media print {
  :root,
  :root[data-theme="dark"] {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-subtle: #f5f5f5;
    --ink: #111111;
    --ink-secondary: #222222;
    --ink-muted: #555555;
    --accent: #0f5c5c;
    --border: #d4d4d4;
    --border-strong: #999999;
    color-scheme: light;
  }

  body {
    background: #ffffff;
    color: #111111;
    font-size: 9.2pt;
    line-height: 1.42;
  }

  .site-nav,
  .hero-links,
  .site-footer,
  .skip-link {
    display: none !important;
  }

  .page {
    max-width: none;
    padding: 0;
  }

  .hero {
    padding-bottom: 0.85rem;
    border-bottom: 1.5px solid #111111;
  }

  .hero-top {
    gap: 0.85rem;
    margin-bottom: 0.65rem;
  }

  .avatar {
    width: 60px;
    height: 60px;
    border: 1px solid #cccccc;
  }

  .hero-eyebrow {
    display: none;
  }

  .hero-name {
    font-size: 20pt;
  }

  .hero-subtitle {
    margin-top: 0.15rem;
    font-size: 10pt;
  }

  .print-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 1rem;
    margin-top: 0.35rem;
    font-size: 8.6pt;
    color: #333333;
  }

  .print-contact a {
    color: #111111;
  }

  .summary-block {
    margin-top: 0.7rem;
    padding-left: 0.65rem;
    border-left: 2px solid #0f5c5c;
    max-width: none;
  }

  .summary-block p {
    font-size: 9pt;
    line-height: 1.42;
  }

  .section {
    padding-top: 1rem;
  }

  .section-header {
    padding-bottom: 0.25rem;
    margin-bottom: 0.65rem;
    border-bottom: 1px solid #111111;
    break-after: avoid;
  }

  .section-title {
    font-size: 12pt;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .experience-list {
    gap: 0.85rem;
  }

  .role-entry {
    display: block;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
  }

  .role-meta {
    float: right;
    text-align: right;
    padding-top: 0;
  }

  .role-period,
  .role-location {
    font-size: 8.4pt;
    color: #333333 !important;
  }

  .role-header {
    margin-bottom: 0.35rem;
    break-after: avoid;
  }

  .role-company {
    font-size: 10.5pt;
  }

  .role-title {
    font-size: 9.2pt;
    font-style: italic;
    color: #222222;
  }

  .role-bullets {
    gap: 0.24rem;
    clear: both;
  }

  .role-bullets li {
    font-size: 8.8pt;
    line-height: 1.38;
    padding-left: 0.8rem;
  }

  .role-bullets li::before {
    width: 3.5px;
    height: 3.5px;
    background: #444444;
  }

  .skills-grid {
    gap: 0.45rem;
  }

  .skill-group {
    grid-template-columns: 110px 1fr;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    break-inside: avoid;
  }

  .skill-tag {
    padding: 0.1rem 0.45rem;
    font-size: 8.5pt;
    border: 1px solid #cccccc;
    background: none;
  }

  .education-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .edu-card {
    padding: 0.65rem 0.75rem;
    border: 1px solid #cccccc;
    box-shadow: none;
    break-inside: avoid;
  }

  .edu-card-header {
    padding-bottom: 0.35rem;
    margin-bottom: 0.45rem;
  }

  .edu-institution {
    font-size: 10pt;
  }

  .degree-list {
    gap: 0.35rem;
  }

  .degree-name {
    font-size: 8.7pt;
  }

  .degree-period {
    font-size: 8pt;
  }
}
