:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --ink: #1e2528;
  --muted: #5f6a6e;
  --line: #d8d1c8;
  --panel: #fffaf2;
  --accent: #c43f2f;
  --accent-dark: #842d2a;
  --blue: #315d73;
  --green: #557b52;
  --shadow: 0 18px 60px rgba(30, 37, 40, 0.12);
}

* {
  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.5;
}

body.modal-open {
  overflow: hidden;
  padding-right: var(--modal-scrollbar-offset, 0px);
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 16px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(30, 37, 40, 0.1);
  background: rgba(247, 244, 239, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  font-weight: 800;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 0.94rem;
}

.nav a {
  text-decoration: none;
}

.nav a:hover,
.nav a:focus-visible,
.brand:hover,
.brand:focus-visible {
  color: var(--accent-dark);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.8fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  min-height: 560px;
  padding: clamp(36px, 6vw, 72px) clamp(18px, 4vw, 56px) clamp(28px, 5vw, 48px);
}

.intro-copy {
  max-width: 760px;
}

.eyebrow,
.project-kicker {
  margin: 0 0 10px;
  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: 680px;
  margin-bottom: 16px;
  font-size: clamp(1.6rem, 2.35vw, 2.35rem);
  font-weight: 730;
  line-height: 1.22;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.intro-text {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(1.04rem, 2vw, 1.25rem);
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  font-weight: 750;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button.secondary {
  background: transparent;
}

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

.featured-shot,
.project-media {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(30, 37, 40, 0.15);
  background:
    linear-gradient(135deg, rgba(196, 63, 47, 0.2), transparent 42%),
    linear-gradient(315deg, rgba(49, 93, 115, 0.2), transparent 48%),
    #e7ded2;
  box-shadow: var(--shadow);
}

.featured-shot img,
.project-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-media.contain img {
  object-fit: contain;
}

.featured-shot {
  min-height: 300px;
  border-radius: 8px;
  aspect-ratio: 16 / 10;
}

.shot-label {
  max-width: 260px;
  padding: 20px;
  text-align: center;
}

.shot-label span,
.project-media span {
  display: block;
  font-weight: 850;
}

.shot-label small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.section {
  padding: clamp(56px, 8vw, 104px) clamp(18px, 4vw, 56px);
  border-top: 1px solid rgba(30, 37, 40, 0.1);
}

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

.section-heading p:not(.eyebrow),
.contact p,
.project-body p {
  color: var(--muted);
}

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

.project-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 32px rgba(30, 37, 40, 0.08);
}

.project-media {
  min-height: 220px;
  aspect-ratio: 16 / 10;
  box-shadow: none;
}

.project-body {
  padding: 22px;
}

.project-body ul {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding-left: 20px;
  color: var(--ink);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.project-links a,
.project-links button,
.project-unavailable,
.contact-links a,
.contact-links button,
.email-panel a,
.email-panel input {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid rgba(30, 37, 40, 0.18);
  border-radius: 6px;
  background: #fff;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 750;
  text-decoration: none;
}

.project-links a:hover,
.project-links a:focus-visible,
.project-links button:hover,
.project-links button:focus-visible,
.contact-links a:hover,
.contact-links a:focus-visible,
.contact-links button:hover,
.contact-links button:focus-visible,
.email-panel a:hover,
.email-panel a:focus-visible,
.email-panel input:hover,
.email-panel input:focus-visible {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.project-unavailable {
  cursor: default;
  color: var(--muted);
  font-weight: 700;
}

.compact.other-work {
  grid-template-columns: minmax(0, 0.82fr) minmax(260px, 0.42fr);
}

.other-work-heading {
  display: grid;
  max-width: none;
  gap: 22px;
  margin-bottom: 0;
}

.other-work-heading > p:not(.eyebrow) {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.7vw, 1.16rem);
}

.other-work-copy {
  display: grid;
  justify-items: end;
}

.other-work-feature {
  display: grid;
  max-width: 420px;
  gap: 12px;
}

.other-work-feature img {
  display: block;
  width: 100%;
  border: 1px solid rgba(30, 37, 40, 0.15);
  border-radius: 8px;
  background: #e7ded2;
  box-shadow: 0 12px 38px rgba(30, 37, 40, 0.1);
}

.media-modal-trigger {
  justify-self: start;
  background: transparent;
}

.other-work-list {
  border-top: 1px solid rgba(30, 37, 40, 0.12);
}

.other-work-item {
  display: grid;
  grid-template-columns: minmax(150px, 0.32fr) minmax(0, 1fr);
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(30, 37, 40, 0.12);
}

.other-work-item h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.02rem, 1.45vw, 1.2rem);
  line-height: 1.2;
}

.other-work-item p {
  margin: 0;
  color: var(--muted);
}

.compact {
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 52px);
  align-items: start;
}

.skill-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.skill-group {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

#skills .skill-group h3 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
}

.skill-chips {
  display: grid;
  grid-template-rows: repeat(5, minmax(36px, auto));
  gap: 10px;
}

.skill-row {
  display: flex;
  min-width: 0;
  min-height: 36px;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  align-items: flex-start;
}

#skills .skill-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid rgba(30, 37, 40, 0.14);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 720;
  line-height: 1.15;
}

#skills .skill-chip.primary {
  border-color: rgba(196, 63, 47, 0.45);
  background: #fff1eb;
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px rgba(196, 63, 47, 0.12);
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  background: #e9efe8;
  transition: padding-bottom 220ms ease;
}

.contact.email-open {
  padding-bottom: clamp(140px, 12vw, 176px);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-self: center;
  justify-content: flex-end;
  gap: 10px;
}

.contact-actions {
  display: grid;
  position: relative;
  justify-items: end;
  gap: 10px;
}

.email-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 2;
  display: grid;
  width: min(100vw - 36px, 290px);
  grid-template-columns: 1fr;
  gap: 10px;
  justify-items: stretch;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition:
    opacity 180ms ease,
    transform 220ms ease;
}

.email-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.email-address {
  width: 100%;
  overflow-wrap: anywhere;
}

.email-status {
  min-height: 36px;
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 36px;
}

.media-modal {
  --modal-padding: clamp(16px, 3vw, 32px);
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: var(--modal-padding);
  padding-right: calc(var(--modal-padding) + var(--modal-scrollbar-offset, 0px));
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.media-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.media-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 37, 40, 0.58);
}

.media-modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 980px);
  max-height: min(90vh, 920px);
  overflow: auto;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(30, 37, 40, 0.16);
  border-radius: 8px;
  background: var(--bg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
  transform: translateY(8px);
  transition: transform 220ms ease;
}

.media-modal.is-open .media-modal-panel {
  transform: translateY(0);
}

.media-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.media-modal-header h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  line-height: 1.05;
}

.project-info-modal .media-modal-panel {
  width: min(100%, 1040px);
}

.play-choice-modal .media-modal-panel {
  width: min(100%, 560px);
}

.play-options {
  display: grid;
  gap: 12px;
}

.download-option {
  display: grid;
}

.play-choice {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid rgba(30, 37, 40, 0.18);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  text-align: left;
  transition:
    border-color 180ms ease,
    color 180ms ease,
    margin-top 220ms ease;
}

.play-choice span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.play-choice:not(.unavailable):hover,
.play-choice:not(.unavailable):focus-visible {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.play-choice.unavailable {
  color: var(--muted);
  cursor: default;
}

.download-details {
  display: grid;
  gap: 12px;
  max-height: 0;
  overflow: hidden;
  padding: 0 14px;
  border: 1px solid transparent;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: rgba(255, 255, 255, 0.72);
  opacity: 0;
  transform: translateY(-4px);
  transition:
    max-height 260ms ease,
    padding 260ms ease,
    border-color 260ms ease,
    opacity 180ms ease,
    transform 260ms ease;
}

.download-option.is-open .download-toggle {
  border-color: var(--accent);
  border-radius: 8px 8px 0 0;
  color: var(--accent-dark);
}

.download-option.is-open .download-details {
  max-height: 260px;
  padding: 14px;
  border-color: rgba(30, 37, 40, 0.14);
  opacity: 1;
  transform: translateY(0);
}

.download-option.is-open + .itch-choice {
  margin-top: 8px;
}

.download-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.download-meta div {
  display: grid;
  gap: 2px;
}

.download-meta dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.download-meta dd,
.download-details p {
  margin: 0;
}

.download-meta dd {
  color: var(--ink);
  font-weight: 800;
}

.download-details p {
  color: var(--muted);
  font-size: 0.94rem;
}

.confirm-download {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.confirm-download:hover,
.confirm-download:focus-visible {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.project-detail {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.8fr);
  gap: clamp(18px, 3vw, 30px);
  align-items: start;
}

.project-detail-media {
  overflow: hidden;
  border: 1px solid rgba(30, 37, 40, 0.14);
  border-radius: 8px;
  background: #101417;
}

.project-detail-media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.project-detail-media.contain img {
  object-fit: contain;
  background: #f4efe9;
}

.project-detail-copy {
  display: grid;
  gap: 14px;
}

.project-detail-copy p,
.build-note {
  margin: 0;
  color: var(--muted);
}

.project-detail-copy h3 {
  margin: 4px 0 -4px;
  font-size: 1.05rem;
  line-height: 1.2;
}

.project-detail-copy ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.modal-actions {
  margin-top: 2px;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid rgba(30, 37, 40, 0.18);
  border-radius: 6px;
  background: #fff;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 750;
}

.modal-close:hover,
.modal-close:focus-visible {
  border-color: var(--accent);
  color: var(--accent-dark);
}

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

.video-card {
  display: grid;
  gap: 10px;
  margin: 0;
}

.video-card video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border: 1px solid rgba(30, 37, 40, 0.14);
  border-radius: 8px;
  background: #101417;
  object-fit: contain;
}

.video-card figcaption {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(18px, 4vw, 56px);
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 980px) {
  .intro,
  .compact,
  .contact {
    grid-template-columns: 1fr;
  }

  .compact.other-work {
    grid-template-columns: 1fr;
  }

  .intro {
    min-height: auto;
  }

  .featured-shot {
    min-height: 360px;
    aspect-ratio: 16 / 10;
  }

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

  .skill-groups {
    grid-template-columns: 1fr;
  }

  .other-work-copy {
    justify-items: start;
  }

  .other-work-feature {
    max-width: 520px;
  }

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

  .project-detail {
    grid-template-columns: 1fr;
  }

  .contact-actions {
    justify-items: start;
  }

  .email-panel {
    right: auto;
    left: 0;
  }

  .contact-links,
  .email-panel {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .intro {
    padding-top: 34px;
  }

  h1 {
    font-size: clamp(1.55rem, 6.6vw, 2.05rem);
  }

  .featured-shot {
    width: 100%;
    height: 220px;
    min-height: 0;
    aspect-ratio: auto;
  }

  .project-body {
    padding: 18px;
  }

  .media-modal {
    padding: 12px;
  }

  .media-modal-header {
    align-items: stretch;
    flex-direction: column;
  }

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

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