:root {
  --bg: #f4f1ea;
  --paper: #fffdf8;
  --ink: #111111;
  --muted: #61645f;
  --line: #d7d0c3;
  --line-strong: #bdb4a6;
  --teal: #0f5f66;
  --brick: #a34232;
  --mustard: #c59b42;
  --sage: #dfe5d8;
  --charcoal: #1a1c1b;
  --max: 1180px;
  --radius: 6px;
  --shadow: 0 20px 60px rgba(17, 17, 17, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
  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;
}

img {
  display: block;
  max-width: 100%;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-140%);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 16px clamp(18px, 4vw, 48px);
  background: rgba(244, 241, 234, 0.9);
  border-bottom: 1px solid rgba(17, 17, 17, 0.1);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  gap: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 30px);
  color: var(--muted);
  font-size: 0.95rem;
}

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

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink);
}

main {
  overflow: clip;
}

.hero,
.proof-strip,
.section,
.contact-section,
.site-footer {
  width: min(var(--max), calc(100% - 36px));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: clamp(28px, 6vw, 70px);
  align-items: center;
  min-height: min(820px, calc(100vh - 62px));
  padding: clamp(30px, 5vw, 56px) 0 28px;
}

.hero-copy {
  max-width: 830px;
}

.eyebrow,
.project-meta,
.proof-item span,
.gallery-item span {
  margin: 0 0 14px;
  color: var(--teal);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 22px;
  font-size: clamp(3.4rem, 6.4vw, 6.2rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

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

.hero-lede {
  max-width: 680px;
  color: #2e322e;
  font-size: clamp(1.08rem, 1.8vw, 1.42rem);
}

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

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

.button,
.card-action,
.case-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.button.primary {
  background: var(--ink);
  color: var(--paper);
}

.button.secondary.light {
  border-color: rgba(255, 253, 248, 0.72);
  color: var(--paper);
}

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

.identity-panel {
  display: grid;
  gap: 18px;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.portrait-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sage);
}

.portrait-shell img,
.portrait-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.portrait-placeholder {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(15, 95, 102, 0.1), rgba(163, 66, 50, 0.12)),
    var(--sage);
}

.portrait-placeholder span {
  display: grid;
  place-items: center;
  width: 42%;
  aspect-ratio: 1;
  border: 1px solid rgba(17, 17, 17, 0.22);
  border-radius: 50%;
  color: var(--teal);
  font-size: clamp(3rem, 7vw, 5.4rem);
  font-weight: 900;
}

.identity-copy {
  padding: 0 4px;
}

.identity-copy p {
  margin-bottom: 0;
  color: var(--muted);
}

.identity-name {
  color: var(--ink) !important;
  font-weight: 850;
}

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

.focus-list span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #31352f;
  font-size: 0.82rem;
  font-weight: 720;
}

.proof-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: clamp(72px, 10vw, 130px);
  border: 1px solid var(--line-strong);
  background: var(--paper);
}

.proof-item {
  min-height: 130px;
  padding: clamp(18px, 3vw, 26px);
  border-right: 1px solid var(--line);
}

.proof-item:last-child {
  border-right: 0;
}

.proof-item strong {
  display: block;
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.95;
}

.proof-item span {
  display: block;
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.section {
  padding-bottom: clamp(76px, 10vw, 132px);
}

#projects,
#stack,
#about,
#contact {
  scroll-margin-top: 130px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(260px, 0.58fr);
  gap: clamp(20px, 5vw, 62px);
  align-items: end;
  margin-bottom: clamp(28px, 5vw, 52px);
}

.project-heading {
  display: block;
  max-width: 960px;
}

.section-heading.compact {
  display: block;
  max-width: 870px;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.08rem;
}

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

.project-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.project-card:hover,
.project-card:focus-within {
  border-color: var(--ink);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.project-media {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 16px;
  background: #ece7dc;
  border-bottom: 1px solid var(--line);
}

.project-media img,
.visual-placeholder {
  width: 100%;
  height: 100%;
  min-height: 330px;
  object-fit: contain;
}

.visual-placeholder {
  display: grid;
  place-items: center;
  color: var(--teal);
  font-size: clamp(3.8rem, 9vw, 7rem);
  font-weight: 900;
}

.project-card-body {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: clamp(18px, 3vw, 28px);
}

.project-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
  color: var(--brick);
}

.project-subtitle {
  color: var(--teal);
  font-weight: 800;
}

.project-card-body > p:not(.project-subtitle) {
  color: #333630;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-action {
  justify-self: start;
  margin-top: 6px;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.card-action.external {
  border-color: var(--line-strong);
  color: var(--teal);
}

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

.capability-item {
  padding: clamp(20px, 3vw, 30px);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
}

.capability-item p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.gallery-item {
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #ece7dc;
}

.gallery-item figcaption {
  min-height: 86px;
  padding: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.gallery-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--brick);
}

.about-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1fr);
  gap: clamp(24px, 6vw, 86px);
}

.about-copy {
  color: #30332f;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: clamp(28px, 5vw, 44px);
  margin-bottom: 36px;
  background: var(--charcoal);
  border-radius: var(--radius);
  color: var(--paper);
}

.contact-section .eyebrow {
  color: var(--mustard);
}

.contact-section h2 {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 3.7rem);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0 36px;
  color: var(--muted);
  font-size: 0.94rem;
}

.site-footer a {
  text-decoration: none;
}

.case-dialog {
  width: min(1040px, calc(100% - 28px));
  max-height: min(900px, calc(100vh - 28px));
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.case-dialog::backdrop {
  background: rgba(17, 17, 17, 0.64);
}

.case-dialog-inner {
  position: relative;
  max-height: min(900px, calc(100vh - 28px));
  overflow: auto;
}

.case-close {
  position: sticky;
  top: 14px;
  left: calc(100% - 104px);
  z-index: 2;
  min-height: 38px;
  margin: 14px 14px 0 auto;
  background: var(--paper);
}

.case-study {
  padding: 0 clamp(18px, 4vw, 42px) clamp(24px, 5vw, 46px);
}

.case-header {
  padding: clamp(24px, 4vw, 40px) 0 18px;
}

.case-title-block {
  max-width: 820px;
}

.case-title-block h2 {
  font-size: clamp(2.6rem, 7vw, 6.2rem);
}

.case-feature {
  margin: 0;
  background: #ece7dc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.case-feature img,
.case-feature .visual-placeholder {
  width: 100%;
  max-height: min(62vh, 620px);
  min-height: 300px;
  object-fit: contain;
}

.case-feature figcaption,
.case-image-grid figcaption {
  padding: 12px 14px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.case-story {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.case-subtitle {
  color: var(--teal);
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  font-weight: 820;
}

.case-link {
  margin-top: 12px;
}

.case-story-card {
  padding: clamp(18px, 3vw, 24px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.case-story-card.outcome {
  border-color: var(--teal);
}

.case-story-card p {
  margin-bottom: 0;
}

.case-story-card span,
.case-details span {
  display: block;
  margin-bottom: 10px;
  color: var(--teal);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.case-image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.case-image-grid figure {
  margin: 0;
  background: #ece7dc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.case-image-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

.case-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.case-details > div {
  padding: clamp(18px, 3vw, 24px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.case-details p {
  margin-bottom: 0;
}

.case-details ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
  color: #333630;
}

@media (max-width: 980px) {
  .hero,
  .section-heading,
  .about-section,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: start;
    min-height: auto;
  }

  .identity-panel {
    max-width: 540px;
  }

  .proof-strip,
  .project-grid,
  .capability-grid,
  .gallery-rail,
  .case-story,
  .case-image-grid,
  .case-details {
    grid-template-columns: 1fr;
  }

  .proof-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

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

  .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.9rem;
  }

  .hero,
  .proof-strip,
  .section,
  .contact-section,
  .site-footer {
    width: min(100% - 24px, var(--max));
  }

  h1 {
    font-size: clamp(3.4rem, 17vw, 5rem);
  }

  h2 {
    font-size: clamp(2rem, 12vw, 3.4rem);
  }

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

  .project-meta {
    display: grid;
  }

  .case-dialog {
    width: calc(100% - 14px);
    max-height: calc(100vh - 14px);
  }

  .case-dialog-inner {
    max-height: calc(100vh - 14px);
  }

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