:root {
  color-scheme: light;
  --ink: #162018;
  --muted: #5f695d;
  --paper: #f7f0df;
  --paper-soft: #fbf7ed;
  --surface: #fffdf7;
  --surface-strong: #ffffff;
  --line: #d8cdb5;
  --forest: #173f2a;
  --forest-2: #245c3d;
  --forest-3: #dfe9da;
  --gold: #8b7b55;
  --gold-soft: #e9e2cf;
  --header-bg: rgba(247, 240, 223, 0.92);
  --shadow: 0 20px 60px rgba(22, 32, 24, 0.14);
  --max: 1160px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --ink: #f2efe5;
    --muted: #b8c1b2;
    --paper: #111a14;
    --paper-soft: #162219;
    --surface: #1a281e;
    --surface-strong: #213226;
    --line: #344536;
    --forest: #a9d4af;
    --forest-2: #7fb58c;
    --forest-3: #253726;
    --gold: #b8ad89;
    --gold-soft: #303528;
    --header-bg: rgba(17, 26, 20, 0.92);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f2efe5;
  --muted: #b8c1b2;
  --paper: #111a14;
  --paper-soft: #162219;
  --surface: #1a281e;
  --surface-strong: #213226;
  --line: #344536;
  --forest: #a9d4af;
  --forest-2: #7fb58c;
  --forest-3: #253726;
  --gold: #b8ad89;
  --gold-soft: #303528;
  --header-bg: rgba(17, 26, 20, 0.92);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

:root[data-theme="light"] {
  color-scheme: light;
  --ink: #162018;
  --muted: #5f695d;
  --paper: #f7f0df;
  --paper-soft: #fbf7ed;
  --surface: #fffdf7;
  --surface-strong: #ffffff;
  --line: #d8cdb5;
  --forest: #173f2a;
  --forest-2: #245c3d;
  --forest-3: #dfe9da;
  --gold: #8b7b55;
  --gold-soft: #e9e2cf;
  --header-bg: rgba(247, 240, 223, 0.92);
  --shadow: 0 20px 60px rgba(22, 32, 24, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
}

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 3rem);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  color: var(--paper);
  text-decoration: none;
  font-weight: 850;
  background: var(--forest);
  border-radius: 6px;
  box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.12);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.75rem, 2vw, 1.25rem);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: clamp(0.65rem, 1.8vw, 1.35rem);
  font-size: 0.9rem;
  font-weight: 760;
}

.nav-links a {
  color: var(--ink);
  text-decoration: none;
  opacity: 0.78;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  opacity: 1;
  color: var(--forest);
}

.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.theme-switch input {
  position: absolute;
  opacity: 0;
}

.theme-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 7.6rem;
  height: 2.35rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  overflow: hidden;
}

.theme-option {
  position: relative;
  z-index: 2;
  text-align: center;
}

.theme-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 1;
  width: calc(50% - 5px);
  height: calc(100% - 8px);
  border-radius: 4px;
  background: var(--forest);
  transition: transform 180ms ease;
}

.theme-switch input:checked + .theme-track .theme-thumb {
  transform: translateX(calc(100% + 2px));
}

.theme-switch input:not(:checked) + .theme-track .theme-option:first-child,
.theme-switch input:checked + .theme-track .theme-option:nth-child(2) {
  color: var(--paper);
}

.theme-switch input:focus-visible + .theme-track {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.hero {
  min-height: 74svh;
  display: grid;
  align-items: center;
  padding: 7.2rem clamp(1rem, 4vw, 3rem) 4rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 420px);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  width: min(100%, var(--max));
  margin: 0 auto;
}

.hero-text {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 12ch;
  margin: 0;
  color: var(--ink);
  font-size: clamp(3rem, 6.4vw, 5.1rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 5vw, 4.05rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 0.7rem;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1.2;
}

.hero-copy {
  max-width: 720px;
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.profile-frame {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.profile-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 8px solid rgba(247, 240, 223, 0.28);
  border-radius: 8px;
  pointer-events: none;
}

.profile-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.6rem;
}

.button {
  display: inline-flex;
  min-height: 2.8rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.76rem 1rem;
  border: 1px solid transparent;
  border-radius: 5px;
  font: inherit;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

.button-primary {
  color: var(--paper);
  background: var(--forest);
  box-shadow: 0 10px 24px rgba(23, 63, 42, 0.24);
}

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

.button-secondary {
  color: var(--forest);
  background: var(--surface);
  border-color: var(--line);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: var(--forest);
}

.proof-band {
  padding: 1rem clamp(1rem, 4vw, 3rem) 0;
  background: var(--paper-soft);
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  width: min(100%, var(--max));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.proof-grid article {
  min-height: 9rem;
  padding: 1.15rem;
  background: var(--surface);
}

.proof-grid strong {
  display: block;
  margin-bottom: 0.65rem;
  color: var(--forest);
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  line-height: 1;
}

.proof-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.section {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: clamp(4.25rem, 9vw, 7.5rem) clamp(1rem, 4vw, 3rem);
}

.section-tinted {
  width: 100%;
  max-width: none;
  background: var(--forest-3);
}

.section-tinted > * {
  width: min(100%, var(--max));
  margin-left: auto;
  margin-right: auto;
}

.section-header {
  max-width: 830px;
  margin-bottom: 2rem;
}

.section-header > p:not(.eyebrow) {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.05rem;
}

.section-with-media {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

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

.story-image {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.story-image-sticky {
  position: sticky;
  top: 6rem;
}

.story-image img {
  display: block;
  width: 100%;
  height: auto;
}

.story-image figcaption {
  padding: 0.85rem 1rem 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  gap: 1rem;
  align-items: stretch;
}

.timeline-date {
  padding: 1.1rem 0;
  color: var(--forest);
  font-weight: 900;
}

.timeline-panel,
.project-card,
.skill-block {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.timeline-panel {
  padding: 1.35rem;
}

.company {
  margin: -0.35rem 0 0.65rem;
  color: var(--muted);
  font-weight: 760;
}

.timeline-panel p:last-child,
.project-card p:last-child,
.skill-block p:last-child {
  margin-bottom: 0;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.2rem;
}

.filter-button {
  min-height: 2.35rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 850;
  cursor: pointer;
}

.filter-button:hover,
.filter-button:focus-visible,
.filter-button.is-active {
  color: var(--paper);
  background: var(--forest);
  border-color: var(--forest);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.project-card {
  min-height: 20rem;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(22, 32, 24, 0.08);
}

.project-card-featured {
  padding-top: 0;
  overflow: hidden;
}

.project-card-featured img {
  display: block;
  width: calc(100% + 2.5rem);
  max-width: none;
  height: 13rem;
  margin: 0 -1.25rem 1.1rem;
  object-fit: cover;
  object-position: center 35%;
  border-bottom: 1px solid var(--line);
}

.project-card.is-hidden {
  display: none;
}

.project-kicker {
  margin: 0 0 0.7rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.tag-list,
.credential-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0;
  margin: auto 0 0;
  list-style: none;
}

.tag-list li,
.credential-list span {
  display: inline-flex;
  min-height: 1.8rem;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(185, 133, 69, 0.28);
  border-radius: 5px;
  color: var(--forest);
  background: var(--gold-soft);
  font-size: 0.82rem;
  font-weight: 780;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.skill-block {
  padding: 1.2rem;
}

.credential-list {
  margin: 1.2rem 0 1.5rem;
}

.background-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(320px, 1.14fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.wide-story-image img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
}

.contact-band {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto clamp(3rem, 7vw, 5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: clamp(1.5rem, 5vw, 3rem);
  align-items: center;
  padding: clamp(1.5rem, 4vw, 2.4rem);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.contact-band .eyebrow {
  color: var(--gold);
}

.contact-band h2 {
  max-width: 760px;
  color: var(--ink);
  font-size: clamp(1.8rem, 4vw, 3.1rem);
}

.contact-copy p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.02rem;
}

.contact-panel {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-soft);
}

.contact-panel .contact-actions {
  flex-direction: column;
  margin-top: 0;
}

.contact-panel .button {
  width: 100%;
}

.copy-status {
  min-height: 1.6rem;
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-weight: 720;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem 1.2rem;
  padding: 1.5rem clamp(1rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper-soft);
  font-size: 0.92rem;
}

@media (max-width: 980px) {
  .hero-content {
    grid-template-columns: minmax(0, 1fr) minmax(230px, 320px);
    gap: 2rem;
  }

  .section-with-media,
  .background-grid,
  .contact-band {
    grid-template-columns: 1fr;
  }

  .story-image-sticky {
    position: static;
  }

  .proof-grid,
  .project-grid,
  .skill-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .header-actions {
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 0.55rem;
  }

  .nav-links {
    max-width: 78vw;
    gap: 0.5rem 0.8rem;
    font-size: 0.82rem;
  }

  .theme-track {
    width: 6.8rem;
    height: 2.15rem;
    font-size: 0.68rem;
  }

  .hero {
    min-height: 0;
    padding-top: 7.3rem;
    padding-bottom: 1.8rem;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .profile-frame {
    width: min(58vw, 220px);
    aspect-ratio: 1 / 1.12;
    justify-self: start;
    order: -1;
  }

  h1 {
    font-size: clamp(2.65rem, 12vw, 4rem);
  }

  .proof-grid,
  .project-grid,
  .skill-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .timeline-date {
    padding: 0.4rem 0 0;
  }

  .project-card {
    min-height: 0;
  }
}

@media (max-width: 460px) {
  .brand {
    width: 2.25rem;
    height: 2.25rem;
  }

  .nav-links a {
    padding: 0.1rem 0;
  }

  .button,
  .filter-button {
    width: 100%;
  }

  .hero-actions,
  .contact-actions,
  .filter-bar {
    align-items: stretch;
  }
}
