:root {
  color-scheme: light;
  --ink: #17211f;
  --ink-soft: #3f4d48;
  --muted: #687772;
  --paper: #fbfbf8;
  --paper-strong: #ffffff;
  --mist: #eef3ef;
  --line: #d8e1dc;
  --teal: #176b64;
  --teal-dark: #0f514b;
  --coral: #b94d3f;
  --gold: #b18a2f;
  --deep: #132926;
  --deep-soft: #1d3732;
  --shadow: 0 22px 60px rgba(18, 37, 34, 0.14);
  --max-width: 1120px;
  --header-height: 72px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
}

body.nav-open {
  overflow: hidden;
}

img,
canvas {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-color: rgba(23, 107, 100, 0.36);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--teal-dark);
  text-decoration-color: currentColor;
}

button,
input,
textarea,
select {
  font: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 200;
  transform: translateY(-150%);
  border-radius: 8px;
  background: var(--paper-strong);
  color: var(--ink);
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-height);
  border-bottom: 1px solid rgba(216, 225, 220, 0.82);
  background: rgba(251, 251, 248, 0.9);
  backdrop-filter: blur(18px);
}

.site-header.compact {
  position: sticky;
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(var(--max-width), calc(100% - 40px));
  min-height: var(--header-height);
  margin: 0 auto;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--deep);
  color: #f6f4eb;
  font-size: 0.78rem;
  letter-spacing: 0;
}

.brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 680;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--teal-dark);
}

.nav-toggle {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle-line {
  display: block;
  width: 18px;
  height: 2px;
  margin: 3px 0;
  border-radius: 999px;
  background: currentColor;
}

.hero {
  position: relative;
  display: grid;
  min-height: calc(82vh - var(--header-height));
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(135deg, #122522 0%, #173b35 46%, #23443d 100%);
  color: #f7f5ea;
}

#signal-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.58;
  z-index: -2;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(18, 37, 34, 0.9), rgba(18, 37, 34, 0.68) 46%, rgba(18, 37, 34, 0.28)),
    linear-gradient(0deg, rgba(18, 37, 34, 0.52), transparent 46%);
}

.hero-content {
  align-self: center;
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto;
  padding: 68px 0 56px;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: clamp(34px, 7vw, 78px);
  align-items: center;
}

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

.hero-portrait {
  position: relative;
  width: min(100%, 360px);
  margin: 0;
  justify-self: end;
}

.hero-portrait::before {
  position: absolute;
  inset: -14px;
  border: 1px solid rgba(227, 191, 100, 0.42);
  border-radius: 8px;
  content: "";
}

.hero-portrait img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 790;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #e3bf64;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin-top: 0;
  line-height: 1.08;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 8vw, 6.6rem);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.18rem;
}

.hero-subtitle {
  max-width: 720px;
  margin: 0;
  color: rgba(247, 245, 234, 0.88);
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 780;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--coral);
  color: #fffaf5;
}

.button.primary:hover {
  background: #9f3f34;
  color: #fffaf5;
}

.button.secondary {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.09);
  color: inherit;
}

.button.secondary:hover {
  border-color: rgba(255, 255, 255, 0.52);
  background: rgba(255, 255, 255, 0.15);
  color: inherit;
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 760px;
  margin: 44px 0 0;
  padding: 0;
  gap: 12px;
}

.hero-facts div {
  min-width: 0;
  border-left: 3px solid rgba(227, 191, 100, 0.8);
  padding-left: 14px;
}

.hero-facts dt {
  color: rgba(247, 245, 234, 0.66);
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-facts dd {
  margin: 5px 0 0;
  color: rgba(247, 245, 234, 0.95);
  font-weight: 700;
}

.section {
  padding: 86px 0;
}

.section-inner {
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto;
}

.band-light {
  background: var(--mist);
}

.band-ink {
  background: var(--deep);
  color: #f5f1e7;
}

.band-ink .section-kicker {
  color: #e3bf64;
}

.two-column,
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: clamp(36px, 7vw, 80px);
  align-items: start;
}

.prose p {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 34px;
}

.theme-grid,
.project-grid,
.education-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.project-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.education-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 34px;
}

.theme-card,
.project-card,
.education-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  padding: 22px;
  box-shadow: 0 10px 30px rgba(20, 41, 38, 0.06);
}

.theme-card {
  border-top: 4px solid var(--teal);
}

.theme-card:nth-child(2) {
  border-top-color: var(--coral);
}

.theme-card:nth-child(3) {
  border-top-color: var(--gold);
}

.theme-card:nth-child(4) {
  border-top-color: #516f99;
}

.theme-card p,
.project-card p,
.education-item p {
  margin: 0;
  color: var(--ink-soft);
}

.project-card {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.project-card p {
  color: rgba(245, 241, 231, 0.78);
}

.project-link {
  display: inline-flex;
  margin-top: 16px;
  color: #f0cd70;
  font-weight: 760;
  text-decoration-color: rgba(240, 205, 112, 0.46);
}

.project-link:hover {
  color: #fff1bd;
  text-decoration-color: currentColor;
}

.project-meta {
  margin-bottom: 14px;
  color: #e3bf64;
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.timeline {
  display: grid;
  gap: 18px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.timeline-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.timeline-date {
  color: var(--teal-dark);
  font-weight: 800;
}

.timeline-item p {
  margin: 0;
  color: var(--ink-soft);
}

.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-cloud span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  padding: 6px 11px;
  color: var(--ink-soft);
  font-size: 0.94rem;
  font-weight: 680;
}

.contact-layout {
  align-items: center;
}

.contact-layout p {
  max-width: 640px;
  color: var(--ink-soft);
}

.contact-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  padding: 24px;
  box-shadow: var(--shadow);
}

.contact-panel a {
  overflow-wrap: anywhere;
  color: var(--teal-dark);
  font-weight: 760;
}

.opsec-note {
  padding: 34px 0;
  background: #f6efe7;
  color: #4c332d;
}

.opsec-note .section-inner {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.opsec-note h2 {
  margin: 0;
  font-size: 1.2rem;
}

.opsec-note p {
  margin: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-strong);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 84px;
  color: var(--muted);
}

.footer-inner p {
  margin: 0;
}

.cv-page {
  background: #f4f6f2;
}

.cv-shell {
  width: min(980px, calc(100% - 40px));
  margin: 42px auto 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  padding: clamp(26px, 5vw, 56px);
  box-shadow: var(--shadow);
}

.cv-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 28px;
}

.cv-header h1 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: clamp(2.5rem, 7vw, 4.6rem);
}

.cv-header p {
  max-width: 720px;
  margin: 0;
  color: var(--ink-soft);
}

.cv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.cv-page .button.secondary {
  border-color: var(--line);
  background: var(--paper-strong);
  color: var(--ink);
}

.cv-block {
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
}

.cv-block:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.cv-block h2 {
  margin-bottom: 16px;
  color: var(--teal-dark);
  font-size: 1.35rem;
}

.cv-entry {
  margin-bottom: 22px;
}

.cv-entry:last-child {
  margin-bottom: 0;
}

.cv-entry h3 {
  margin-bottom: 6px;
}

.cv-entry p {
  margin: 4px 0;
  color: var(--ink-soft);
}

.cv-entry-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.cv-entry-heading span {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 760;
}

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.inline-list li {
  overflow-wrap: anywhere;
}

.cv-block ul:not(.plain-list) {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
}

.cv-block li + li {
  margin-top: 7px;
}

.cv-columns {
  columns: 2;
  column-gap: 36px;
}

.cv-skill-groups p {
  margin: 0 0 12px;
  color: var(--ink-soft);
}

.cv-skill-groups p:last-child {
  margin-bottom: 0;
}

@media (max-width: 920px) {
  .theme-grid,
  .project-grid,
  .education-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-column,
  .contact-layout,
  .opsec-note .section-inner {
    grid-template-columns: 1fr;
  }

  .hero-layout {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
    gap: 28px;
  }

  .hero-portrait {
    width: min(100%, 240px);
  }

  .hero-facts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 66px;
  }

  body.nav-open {
    overflow: hidden;
  }

  .nav-shell {
    width: min(100% - 28px, var(--max-width));
  }

  .brand-text {
    max-width: 58vw;
  }

  .nav-toggle {
    display: grid;
  }

  .nav-links {
    position: fixed;
    inset: var(--header-height) 0 auto 0;
    display: grid;
    max-height: calc(100vh - var(--header-height));
    overflow: auto;
    border-bottom: 1px solid var(--line);
    background: rgba(251, 251, 248, 0.98);
    padding: 20px;
    box-shadow: var(--shadow);
    transform: translateY(-120%);
    transition: transform 180ms ease;
  }

  .nav-links.is-open {
    transform: translateY(0);
  }

  .nav-links a {
    min-height: 44px;
    padding: 8px 0;
    font-size: 1.05rem;
  }

  .hero {
    min-height: calc(76vh - var(--header-height));
  }

  .hero-content {
    padding: 38px 0 32px;
  }

  .hero h1 {
    max-width: 10ch;
    font-size: clamp(2.65rem, 10vw, 3rem);
  }

  .hero-subtitle {
    max-width: 34ch;
  }

  .hero-layout {
    grid-template-columns: minmax(0, 1fr) minmax(104px, 136px);
    gap: 18px;
    align-items: start;
  }

  .hero-portrait {
    width: min(28vw, 136px);
    justify-self: end;
    margin-top: 34px;
  }

  .hero-portrait::before {
    inset: -8px;
  }

  .hero-actions {
    margin-top: 24px;
  }

  .hero-facts {
    margin-top: 32px;
  }

  .hero-overlay {
    background:
      linear-gradient(90deg, rgba(18, 37, 34, 0.92), rgba(18, 37, 34, 0.72)),
      linear-gradient(0deg, rgba(18, 37, 34, 0.52), transparent 46%);
  }

  .hero-content,
  .section-inner,
  .cv-shell {
    width: min(100% - 28px, var(--max-width));
  }

  .section {
    padding: 64px 0;
  }

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

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .cv-header,
  .cv-entry-heading {
    display: grid;
  }

  .cv-header h1 {
    max-width: 10ch;
    font-size: clamp(2.2rem, 10vw, 2.8rem);
  }

  .cv-header p {
    max-width: 36ch;
  }

  .cv-actions {
    justify-content: flex-start;
  }

  .cv-columns {
    columns: 1;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

@media (max-width: 460px) {
  .hero-actions,
  .cv-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-text {
    max-width: 50vw;
  }

  .theme-card,
  .project-card,
  .education-item,
  .contact-panel {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  :root {
    --ink: #111;
    --ink-soft: #222;
    --muted: #444;
    --paper: #fff;
    --paper-strong: #fff;
    --line: #aaa;
  }

  body {
    background: #fff;
    font-size: 11pt;
  }

  .site-header,
  .site-footer,
  .cv-actions,
  .skip-link {
    display: none !important;
  }

  .cv-shell {
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }

  .cv-header,
  .cv-block {
    break-inside: avoid;
  }

  .cv-block {
    padding: 14pt 0;
  }

  a {
    color: #111;
    text-decoration: none;
  }
}
