:root {
  --ink: #15201b;
  --muted: #62706a;
  --paper: #f8faf7;
  --panel: #ffffff;
  --line: #dfe7df;
  --green: #2f8f46;
  --gold: #aa8422;
  --blue: #0c66b4;
  --coral: #df4e4e;
  --shadow: 0 16px 48px rgba(20, 32, 27, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto minmax(220px, auto);
  gap: 20px;
  align-items: center;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(223, 231, 223, 0.82);
  background: rgba(248, 250, 247, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  min-width: 0;
}

.brand img {
  width: 52px;
  height: 42px;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
}

.brand span {
  min-width: 0;
}

.brand strong {
  font-size: clamp(0.92rem, 1.25vw, 1.08rem);
  line-height: 1.15;
}

.brand small {
  font-size: 0.78rem;
  line-height: 1.2;
}

nav {
  display: flex;
  gap: 8px;
}

nav a {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.partner-brand {
  display: inline-flex;
  justify-self: end;
  gap: 10px;
  align-items: center;
  max-width: 280px;
}

.partner-brand img {
  width: 46px;
  height: 42px;
  object-fit: contain;
}

.partner-brand span {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: left;
}

main {
  outline: none;
}

section {
  padding: clamp(44px, 6vw, 88px) clamp(18px, 5vw, 72px);
}

.home-hero {
  min-height: calc(92vh - 73px);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: end;
  background:
    linear-gradient(125deg, rgba(248, 250, 247, 0.94), rgba(248, 250, 247, 0.78)),
    url("../public/challenges/challenge-4/images/optimized/001-070fc537-e349-4b92-895e-884daab04108-thumb.jpg") center / cover;
}

.home-hero h1,
.challenge-hero h1 {
  max-width: 980px;
  margin: 0;
  font-size: clamp(3rem, 8vw, 7.5rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.7vw, 1.5rem);
}

.home-hero aside {
  display: grid;
  gap: 10px;
  padding: 22px;
  border-left: 4px solid var(--green);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
}

.home-hero aside strong {
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}

.home-hero aside span {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 18px;
  padding-top: 24px;
}

.challenge-card {
  overflow: hidden;
  min-height: 440px;
  display: grid;
  grid-template-rows: 1fr auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(20, 32, 27, 0.08);
}

.challenge-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
}

.challenge-card div {
  padding: 18px;
}

.challenge-card p {
  margin: 0 0 8px;
  color: var(--gold);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.challenge-card h2 {
  margin: 0;
  font-size: 1.5rem;
}

.challenge-card h3 {
  min-height: 58px;
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 500;
}

.challenge-card a,
.challenge-hero a,
.resources a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.challenge-page {
  background: var(--paper);
}

.challenge-hero {
  min-height: calc(88vh - 73px);
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.challenge-hero > img {
  width: 100%;
  height: min(70vh, 680px);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.challenge-hero h2 {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1.25rem, 2vw, 2rem);
  font-weight: 500;
}

.question-band {
  padding-top: 40px;
  padding-bottom: 40px;
  background: var(--ink);
  color: #fff;
}

.question-band span {
  color: #9fe0ad;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.question-band p {
  max-width: 1100px;
  margin: 12px 0 0;
  font-size: clamp(1.35rem, 3vw, 3rem);
  line-height: 1.1;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.85fr);
  gap: clamp(24px, 5vw, 64px);
}

.two-column h2,
.section-heading h2 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1;
}

.two-column p,
.brief-card p {
  color: var(--muted);
  font-size: 1.05rem;
}

.brief-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.brief-card h3 {
  margin-top: 0;
}

.meta-list {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
}

.meta-list div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.meta-list dt {
  color: var(--gold);
  font-weight: 900;
}

.meta-list dd {
  margin: 0;
  color: var(--muted);
}

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

.plan-viewer {
  display: grid;
  gap: 14px;
}

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

.tab {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.tab.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.plan-image {
  display: grid;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--panel);
  cursor: zoom-in;
  overflow: hidden;
  text-align: left;
  box-shadow: var(--shadow);
}

.plan-image img {
  width: 100%;
  max-height: 760px;
  object-fit: contain;
  background: #fff;
}

.plan-image span,
.plan-image small {
  padding: 0 18px 18px;
}

.plan-image span {
  padding-top: 16px;
  font-weight: 900;
}

.plan-image small {
  color: var(--muted);
}

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

.evidence-groups article,
.observation-grid article {
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.evidence-groups h3 {
  margin: 0 0 10px;
}

.evidence-groups p,
.observation-grid p {
  color: var(--muted);
}

.observation-grid span {
  color: var(--gold);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.journey {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
}

.journey div {
  position: relative;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.journey div::after {
  content: "→";
  position: absolute;
  right: -16px;
  top: 50%;
  color: var(--green);
  font-size: 1.8rem;
  font-weight: 900;
}

.journey div:last-child::after {
  display: none;
}

.journey span {
  display: block;
  color: var(--gold);
  font-weight: 900;
}

.journey strong {
  display: block;
  margin-top: 28px;
  font-size: 1.25rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
}

.evidence-card {
  min-height: 220px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: zoom-in;
  overflow: hidden;
  text-align: left;
}

.evidence-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.evidence-card span,
.evidence-card small {
  display: block;
  padding: 10px 12px 0;
}

.evidence-card span {
  font-weight: 800;
}

.evidence-card small {
  padding-bottom: 12px;
  color: var(--muted);
}

.prompt-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.prompt-list li {
  padding: 16px;
  border-left: 4px solid var(--green);
  background: var(--panel);
  color: var(--muted);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-list span {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-weight: 800;
}

.resources {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.resources a {
  justify-content: center;
  background: var(--green);
}

.empty {
  color: var(--muted);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  padding: 24px;
  background: rgba(9, 15, 12, 0.82);
}

.lightbox[aria-hidden="false"] {
  display: grid;
  place-items: center;
}

.lightbox-panel {
  width: min(1280px, 100%);
  height: min(88vh, 900px);
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.lightbox-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.lightbox-actions p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.lightbox-actions button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  cursor: pointer;
  font-size: 1.3rem;
  font-weight: 900;
}

.lightbox-stage {
  overflow: auto;
  display: grid;
  place-items: center;
  background: #111;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.15s ease;
}

.no-scroll {
  overflow: hidden;
}

@media (max-width: 1180px) {
  .cards-grid,
  .gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 820px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  nav {
    grid-column: 1 / -1;
    order: 3;
    overflow-x: auto;
  }

  .partner-brand {
    max-width: 170px;
  }

  .partner-brand img {
    width: 38px;
    height: 34px;
  }

  .partner-brand span {
    font-size: 0.68rem;
  }

  .home-hero,
  .challenge-hero,
  .two-column {
    grid-template-columns: 1fr;
  }

  .home-hero {
    min-height: auto;
  }

  .challenge-hero {
    min-height: auto;
  }

  .challenge-hero > img {
    height: 46vh;
  }

  .cards-grid,
  .evidence-groups,
  .observation-grid,
  .journey,
  .gallery,
  .resources {
    grid-template-columns: 1fr;
  }

  .journey div::after {
    right: 18px;
    top: auto;
    bottom: -22px;
    transform: rotate(90deg);
  }

  .meta-list div {
    grid-template-columns: 1fr;
  }
}
