:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --surface: #ffffff;
  --ink: #1b241f;
  --muted: #657168;
  --line: #dfe5dc;
  --accent: #147567;
  --accent-dark: #0b5148;
  --coral: #bb5948;
  --amber: #c58a1f;
  --shadow: 0 18px 50px rgba(27, 36, 31, 0.12);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.55;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 14px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid rgba(223, 229, 220, 0.82);
  background: rgba(247, 248, 245, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-dark);
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(27, 36, 31, 0.07);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.nav-links a,
.nav-button {
  min-height: 36px;
  padding: 8px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-button:hover,
.nav-button:focus-visible {
  background: #e8eee8;
  color: var(--ink);
  outline: none;
}

.hero {
  position: relative;
  min-height: calc(100vh - 68px);
  display: grid;
  align-items: center;
  overflow: hidden;
  padding: clamp(64px, 9vw, 118px) clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 24%;
  background: linear-gradient(180deg, rgba(247, 248, 245, 0), var(--bg));
  pointer-events: none;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.56;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(247, 248, 245, 0.98) 0%, rgba(247, 248, 245, 0.82) 48%, rgba(247, 248, 245, 0.34) 100%),
    linear-gradient(180deg, rgba(247, 248, 245, 0.38) 0%, rgba(247, 248, 245, 0.72) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
  margin: 0 auto 0 max(0px, calc((100vw - var(--max)) / 2));
}

.hero-content {
  width: min(720px, 100%);
}

.hero-identity {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
  margin-bottom: 16px;
}

.hero-identity img {
  flex: 0 0 auto;
  display: block;
  width: clamp(132px, 13vw, 176px);
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid rgba(223, 229, 220, 0.92);
  border-radius: 50%;
  box-shadow: 0 16px 38px rgba(27, 36, 31, 0.17);
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 11ch;
  margin-bottom: 8px;
  font-size: clamp(3.35rem, 7.2vw, 6.2rem);
  line-height: 0.95;
}

.hero-title {
  margin-bottom: 0;
  color: var(--coral);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 760;
}

.hero-copy {
  max-width: 620px;
  margin-bottom: 30px;
  color: #38453d;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-icon {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid #bcc9c0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--accent-dark);
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.contact-icon:hover,
.contact-icon:focus-visible {
  transform: translateY(-1px);
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(27, 36, 31, 0.1);
  outline: none;
}

.contact-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font: inherit;
  font-weight: 760;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.button.primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(20, 117, 103, 0.24);
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--accent-dark);
}

.button.secondary {
  border-color: #bcc9c0;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
}

.button.compact {
  min-height: 38px;
  padding: 8px 12px;
  border-color: #bcc9c0;
  background: var(--surface);
  color: var(--accent-dark);
  font-size: 0.9rem;
  box-shadow: 0 8px 20px rgba(27, 36, 31, 0.07);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  max-width: var(--max);
  margin: -44px auto 0;
  padding: 0 clamp(20px, 4vw, 0px);
  position: relative;
  z-index: 5;
}

.metrics article {
  min-height: 120px;
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 26px rgba(27, 36, 31, 0.08);
}

.metrics article:first-child {
  border-radius: 8px 0 0 8px;
}

.metrics article:last-child {
  border-radius: 0 8px 8px 0;
}

.metrics strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-dark);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1;
}

.metrics span {
  color: var(--muted);
  font-weight: 650;
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(72px, 10vw, 118px) clamp(20px, 4vw, 0px);
}

.intro,
.education {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: start;
}

.intro p:last-child,
.education-list {
  color: #435047;
  font-size: 1.08rem;
}

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

h2 {
  max-width: 780px;
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.05;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.15rem;
  line-height: 1.25;
}

.case-grid,
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.case-card,
.skills-grid article,
.timeline article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(27, 36, 31, 0.06);
}

.case-card {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  padding: 22px;
}

.case-topline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.case-topline span:last-child {
  color: var(--amber);
}

.case-card p,
.skills-grid p,
.timeline p {
  margin-bottom: 0;
  color: #4f5c54;
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 22px;
}

.case-tags span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid #cad6cf;
  border-radius: 999px;
  padding: 5px 10px;
  background: #f5f8f4;
  color: #415048;
  font-size: 0.78rem;
  font-weight: 760;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(30px, 6vw, 76px);
  align-items: start;
}

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

.timeline article {
  padding: 22px;
}

.timeline span {
  display: block;
  margin-bottom: 10px;
  color: var(--coral);
  font-size: 0.85rem;
  font-weight: 800;
}

.timeline-compact {
  background: rgba(255, 255, 255, 0.74);
}

.skills-grid article {
  min-height: 176px;
  padding: 22px;
}

.skills-grid h3 {
  color: var(--accent-dark);
}

.education-list p {
  margin-bottom: 14px;
}

.resume-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  padding: clamp(14px, 3vw, 32px);
}

.resume-modal.is-open {
  display: grid;
  place-items: center;
}

.resume-modal.is-open .resume-backdrop {
  opacity: 1;
}

.resume-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 36, 31, 0.62);
  opacity: 0;
  transition: opacity 160ms ease;
}

.resume-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(1040px, 100%);
  max-height: min(92vh, 980px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(27, 36, 31, 0.28);
}

.resume-dialog:focus {
  outline: none;
}

.resume-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(16px, 3vw, 24px);
  border-bottom: 1px solid var(--line);
}

.resume-dialog-header .section-kicker {
  margin-bottom: 4px;
}

.resume-dialog-header h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
}

.resume-dialog-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #bcc9c0;
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 850;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: #e8eee8;
  outline: none;
}

.resume-viewer {
  flex: 1;
  overflow: hidden;
  background: #eef2ee;
}

.resume-viewer object {
  display: block;
  width: 100%;
  height: min(78vh, 850px);
  min-height: 540px;
  border: 0;
}

.resume-viewer p {
  margin: 0;
  padding: 28px;
  color: #4f5c54;
}

.resume-viewer a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: underline;
}

.contact {
  max-width: var(--max);
  margin: 0 auto clamp(34px, 6vw, 70px);
  padding: clamp(42px, 7vw, 72px) clamp(20px, 5vw, 72px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(20, 117, 103, 0.09), rgba(187, 89, 72, 0.08)),
    var(--surface);
  box-shadow: var(--shadow);
}

.contact h2 {
  margin-bottom: 24px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(20px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 650;
}

.visitor-counter strong {
  color: var(--accent-dark);
}

@media (max-width: 920px) {
  .site-header {
    align-items: flex-start;
  }

  .nav-links {
    max-width: 420px;
  }

  .metrics,
  .case-grid,
  .skills-grid,
  .intro,
  .education,
  .split {
    grid-template-columns: 1fr 1fr;
  }

  .intro,
  .education,
  .split {
    gap: 28px;
  }

  .hero-identity img {
    width: clamp(118px, 16vw, 148px);
  }

  h1 {
    font-size: clamp(3.05rem, 7.4vw, 5.15rem);
  }

}

@media (max-width: 680px) {
  .site-header {
    position: static;
    flex-direction: column;
    gap: 12px;
    min-height: auto;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .hero {
    min-height: auto;
    padding-top: 76px;
    padding-bottom: 92px;
  }

  h1 {
    max-width: none;
    font-size: clamp(2.75rem, 11vw, 4.4rem);
  }

  .hero-identity {
    align-items: center;
    gap: clamp(14px, 4vw, 20px);
  }

  .hero-identity img {
    width: clamp(102px, 20vw, 124px);
  }

  .metrics,
  .case-grid,
  .skills-grid,
  .intro,
  .education,
  .split {
    grid-template-columns: 1fr;
  }

  .metrics {
    margin-top: -36px;
  }

  .metrics article,
  .metrics article:first-child,
  .metrics article:last-child {
    min-height: 104px;
    border-radius: 8px;
  }

  .case-card {
    min-height: auto;
  }

  .resume-dialog-header {
    align-items: start;
    flex-direction: column;
  }

  .resume-viewer object {
    height: 68vh;
    min-height: 430px;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (max-width: 500px) {
  .hero-identity {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .hero-identity img {
    width: clamp(108px, 28vw, 132px);
  }

  h1 {
    max-width: 10ch;
    font-size: clamp(2.7rem, 15vw, 4rem);
  }
}
