:root {
  --paper: #f7f4ee;
  --ink: #172222;
  --muted: #52605f;
  --forest: #173e38;
  --forest-deep: #0c2825;
  --leaf: #bdde8c;
  --clay: #d9774a;
  --sun: #f6cf67;
  --sky: #c9e5e5;
  --line: #ced5ce;
  --card: #fffdf9;
  --shadow: 0 14px 38px rgb(23 34 34 / 10%);
  --round: 1.1rem;
  --max-width: 76rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--clay);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  transform: translateY(-180%);
  padding: 0.65rem 0.9rem;
  border-radius: 0.35rem;
  background: var(--sun);
  color: var(--forest-deep);
  font-weight: 800;
  text-decoration: none;
}

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

.masthead {
  overflow: hidden;
  color: #f9f8f2;
  background:
    radial-gradient(circle at 92% 11%, rgb(189 222 140 / 45%) 0, rgb(189 222 140 / 0%) 23rem),
    radial-gradient(circle at 75% 78%, rgb(246 207 103 / 22%) 0, rgb(246 207 103 / 0%) 27rem),
    var(--forest-deep);
}

.site-nav,
.hero,
.section-wrap {
  width: min(calc(100% - 2.5rem), var(--max-width));
  margin-inline: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5rem;
}

.wordmark {
  color: #fffdf6;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.1rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.nav-links a {
  color: #e8f0e9;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--leaf);
}

.hero {
  padding-block: clamp(3.7rem, 10vw, 8rem) 3.2rem;
}

.kicker {
  margin: 0 0 0.75rem;
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero .kicker,
.section-heading-on-dark .kicker {
  color: var(--sun);
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.06;
}

h1 {
  max-width: 11ch;
  margin-bottom: 1.15rem;
  font-size: clamp(3rem, 7vw, 6.2rem);
  font-weight: 700;
  letter-spacing: -0.055em;
}

h2 {
  max-width: 20ch;
  margin-bottom: 0.8rem;
  font-size: clamp(2.1rem, 4vw, 3.7rem);
  letter-spacing: -0.045em;
}

h3 {
  margin-bottom: 0.55rem;
  font-size: 1.5rem;
  letter-spacing: -0.025em;
}

.hero-intro {
  max-width: 44rem;
  margin: 0;
  color: #deebe3;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

.hero-actions,
.card-actions,
.neighbour-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.hero-actions {
  margin-top: 1.8rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.65rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

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

.button-primary {
  background: var(--leaf);
  color: var(--forest-deep);
}

.button-primary:hover {
  background: #d1eaa8;
}

.button-secondary {
  border-color: rgb(255 255 255 / 65%);
  background: transparent;
  color: #fffdf6;
}

.button-secondary:hover {
  background: rgb(255 255 255 / 12%);
}

.button-quiet {
  border-color: currentColor;
  background: transparent;
  color: inherit;
}

.site-nav .button-quiet {
  min-height: 2.15rem;
  padding: 0.4rem 0.68rem;
  color: #e8f0e9;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  max-width: 48rem;
  margin: clamp(3rem, 7vw, 5.8rem) 0 0;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: var(--round);
  background: rgb(255 255 255 / 12%);
}

.hero-stats div {
  min-width: 0;
  padding: 1.05rem 1.1rem;
  background: rgb(10 38 34 / 62%);
}

.hero-stats dt {
  color: var(--leaf);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.hero-stats dd {
  margin: 0.16rem 0 0;
  color: #d9e7df;
  font-size: 0.85rem;
}

.section-wrap {
  padding-block: clamp(4.2rem, 9vw, 7.5rem);
}

.section-heading {
  max-width: 45rem;
}

.section-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.section-heading-wide {
  max-width: 53rem;
}

.orientation {
  padding-top: clamp(4.5rem, 10vw, 8rem);
}

.orientation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.4rem;
}

.orientation-card {
  min-height: 15rem;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--round);
  background: var(--card);
  box-shadow: 0 6px 20px rgb(23 34 34 / 4%);
}

.orientation-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.step-number {
  display: block;
  margin-bottom: 2.2rem;
  color: var(--clay);
  font-size: 0.84rem;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.fresh-section {
  color: #fffdf6;
  background: var(--forest);
}

.section-heading-on-dark p:last-child {
  color: #d5e2da;
}

.fresh-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}

.fresh-card {
  display: flex;
  flex-direction: column;
  min-height: 16rem;
  padding: 1.25rem;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: var(--round);
  background: rgb(255 255 255 / 7%);
}

.card-heading {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
}

.project-icon {
  display: grid;
  width: 4.2rem;
  height: 4.2rem;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 0.85rem;
  background: #e8f0e9;
  box-shadow: inset 0 0 0 1px rgb(12 40 37 / 8%);
}

.project-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-icon.is-fallback {
  border-color: rgb(12 40 37 / 28%);
  background: var(--project-icon-fallback, #3f625b);
}

.fresh-card-heading {
  margin-bottom: 0.75rem;
}

.fresh-card h3 {
  margin: 0;
  font-size: 1.55rem;
}

.fresh-card p {
  margin: 0 0 1rem;
  color: #d7e3dc;
}

.fresh-card .fresh-rebuild {
  color: var(--sun);
  font-size: 0.82rem;
  font-weight: 750;
}

.fresh-card .button {
  align-self: flex-start;
  margin-top: auto;
}

.date-stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  margin-bottom: 1.15rem;
  padding: 0.34rem 0.55rem;
  border-radius: 0.35rem;
  background: var(--sun);
  color: var(--forest-deep);
  font-size: 0.78rem;
  font-weight: 850;
}

.date-stamp::before {
  width: 0.44rem;
  height: 0.44rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  content: "";
}

.explore-section {
  padding-bottom: 3rem;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  align-items: end;
  margin-top: 2.3rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--round);
  background: #eceae2;
}

.filters label {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  color: var(--forest-deep);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.03em;
}

.filters .search-field {
  grid-column: span 2;
}

.filters input,
.filters select {
  width: 100%;
  min-height: 2.65rem;
  padding: 0.55rem 0.63rem;
  border: 1px solid #acb5ab;
  border-radius: 0.45rem;
  background: #fffefa;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
}

.filters .filter-reset {
  min-height: 2.65rem;
  padding-inline: 0.72rem;
  border-color: #86938b;
  color: var(--forest-deep);
  white-space: nowrap;
}

.results-status {
  margin: 1.2rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

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

.project-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--round);
  background: var(--card);
  box-shadow: 0 7px 22px rgb(23 34 34 / 5%);
}

.project-card .card-heading {
  margin-bottom: 0.55rem;
}

.project-card h3 {
  margin: 0;
  font-size: 1.45rem;
}

.project-card h3 a {
  text-decoration-color: rgb(23 62 56 / 34%);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.project-card h3 a:hover {
  color: var(--forest);
  text-decoration-color: currentColor;
}

.project-description {
  margin: 0 0 1.15rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.card-meta,
.family-list,
.relationship-list {
  list-style: none;
  padding: 0;
}

.card-meta {
  display: grid;
  gap: 0.4rem;
  margin: 0 0 0.9rem;
}

.card-meta li {
  color: #3d4e4b;
  font-size: 0.78rem;
}

.card-meta strong {
  color: var(--forest-deep);
}

.family-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1rem;
}

.family-list li {
  padding: 0.24rem 0.5rem;
  border: 1px solid #b6cfbd;
  border-radius: 999px;
  background: #edf6e8;
  color: #235344;
  font-size: 0.73rem;
  font-weight: 750;
}

.card-actions {
  margin-top: auto;
}

.card-actions .button,
.neighbour-actions .button {
  min-height: 2.3rem;
  padding: 0.48rem 0.65rem;
  border-color: var(--forest);
  color: var(--forest);
  font-size: 0.8rem;
}

.card-actions .button:first-child {
  background: var(--forest);
  color: #fffdf6;
}

.relationships {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
}

.relationships summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.85rem 0 0.2rem;
  cursor: pointer;
  color: var(--forest);
  font-size: 0.86rem;
  font-weight: 850;
  list-style: none;
}

.relationships summary::-webkit-details-marker {
  display: none;
}

.relationships summary::after {
  width: 0.5rem;
  height: 0.5rem;
  transform: rotate(45deg);
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transition: transform 150ms ease;
}

.relationships[open] summary::after {
  transform: rotate(225deg) translate(-0.14rem, -0.14rem);
}

.relationship-list {
  display: grid;
  gap: 0.65rem;
  margin: 0.72rem 0 0;
}

.relationship-item {
  padding: 0.72rem;
  border-left: 3px solid var(--clay);
  background: #f5f2ea;
}

.relationship-title {
  display: block;
  color: var(--forest-deep);
  font-size: 0.85rem;
  font-weight: 850;
}

.relationship-reason {
  display: block;
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.neighbour-actions {
  margin-top: 0.48rem;
}

.neighbour-actions .button {
  min-height: 1.85rem;
  padding: 0.34rem 0.5rem;
  border-color: #83948b;
  color: #355a4e;
  font-size: 0.7rem;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 2rem;
  border: 1px dashed #aebaae;
  border-radius: var(--round);
  color: var(--muted);
  text-align: center;
}

.lineage-section {
  color: #fffdf6;
  background: #20343a;
}

.lineage-section .section-heading p:last-child {
  color: #d2dfe1;
}

.lineage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.3rem;
}

.lineage-card {
  padding: 1.3rem;
  border: 1px solid rgb(255 255 255 / 19%);
  border-radius: var(--round);
  background: rgb(0 0 0 / 12%);
}

.lineage-card h3 {
  font-size: 1.45rem;
}

.lineage-card > p {
  margin: 0;
  color: #d4e0e1;
  font-size: 0.91rem;
}

.lineage-stages {
  display: grid;
  gap: 0.6rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.lineage-stage {
  display: grid;
  grid-template-columns: 2.15rem 1fr;
  gap: 0.68rem;
  align-items: start;
}

.stage-number {
  display: grid;
  width: 2.15rem;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: var(--sun);
  color: var(--forest-deep);
  font-size: 0.77rem;
  font-weight: 850;
}

.stage-project {
  color: #fffdf6;
  font-size: 0.86rem;
  font-weight: 850;
}

.stage-project:hover {
  color: var(--leaf);
}

.stage-role {
  display: block;
  color: #c8d6d7;
  font-size: 0.76rem;
}

.print-section {
  background: #e9e5dc;
}

.print-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.print-heading-row .button {
  flex: none;
  margin-bottom: 0.35rem;
}

.print-note {
  margin: 1.75rem 0 1.15rem;
  padding: 0.8rem 0.9rem;
  border-left: 4px solid var(--clay);
  background: #f8f6f0;
  color: #475450;
}

.print-directory-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.print-project {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid #c4c7bf;
  background: #fffefa;
}

.qr-slot {
  display: grid;
  width: 4.5rem;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 2px solid #304843;
  background: #ffffff;
}

.qr-slot img {
  display: block;
  width: 100%;
  height: 100%;
  background: #ffffff;
}

.print-project h3 {
  margin: 0;
  font-size: 1rem;
}

.print-project h3 a {
  color: var(--forest-deep);
}

.print-project p {
  margin: 0.12rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.print-project .print-url {
  display: block;
  margin-top: 0.3rem;
  color: #285449;
  font-size: 0.67rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.method-section {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 7vw, 6rem);
}

.method-copy p:last-child,
.method-facts p {
  color: var(--muted);
}

.method-facts {
  display: grid;
  gap: 0.25rem;
  align-content: center;
}

.method-facts p {
  margin: 0;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.method-facts strong {
  color: var(--forest-deep);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.4rem max(1.25rem, calc((100% - var(--max-width)) / 2));
  background: var(--forest-deep);
  color: #d5e1da;
  font-size: 0.8rem;
}

.site-footer p {
  margin: 0;
}

.noscript {
  margin: 0;
  padding: 0.9rem;
  background: var(--sun);
  color: var(--forest-deep);
  text-align: center;
}

@media (max-width: 72rem) {
  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filters .search-field {
    grid-column: span 3;
  }

  .filters .filter-reset {
    justify-self: start;
  }

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

@media (max-width: 48rem) {
  .site-nav {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 1rem;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.6rem 0.9rem;
  }

  .hero-stats,
  .orientation-grid,
  .fresh-grid,
  .project-grid,
  .lineage-grid,
  .print-directory-list,
  .method-section {
    grid-template-columns: 1fr;
  }

  .hero-stats div + div {
    border-top: 1px solid rgb(255 255 255 / 14%);
  }

  .filters,
  .filters .search-field {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .print-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .print-heading-row .button {
    margin-bottom: 0;
  }

  .card-heading {
    grid-template-columns: 3.7rem minmax(0, 1fr);
  }

  .project-icon {
    width: 3.7rem;
    height: 3.7rem;
  }

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

@media print {
  @page {
    margin: 10mm;
    size: A4;
  }

  :root {
    --paper: #fff;
    --ink: #111;
    --muted: #333;
    --forest: #143f39;
    --forest-deep: #111;
    --line: #a7aaa5;
    --card: #fff;
  }

  body {
    background: #fff;
    font-size: 9.5pt;
  }

  .skip-link,
  .site-nav,
  .orientation,
  .fresh-section,
  .explore-section,
  .lineage-section,
  .method-section,
  .site-footer,
  .print-heading-row .button {
    display: none !important;
  }

  .masthead {
    color: #111;
    background: #fff;
  }

  .hero {
    width: 100%;
    padding: 0 0 7mm;
    border-bottom: 1.5pt solid #143f39;
  }

  .hero .kicker,
  .hero-intro,
  .hero-actions,
  .hero-stats {
    display: none;
  }

  h1 {
    max-width: none;
    margin: 0;
    font-size: 28pt;
  }

  .print-section {
    background: #fff;
  }

  .section-wrap {
    width: 100%;
    padding: 6mm 0 0;
  }

  .section-heading .kicker {
    margin-bottom: 1.5mm;
    color: #8a3e20;
    font-size: 8pt;
  }

  .section-heading h2 {
    margin-bottom: 2mm;
    font-size: 20pt;
  }

  .section-heading p:last-child {
    max-width: 85mm;
    font-size: 9pt;
  }

  .print-note {
    margin: 4mm 0 3mm;
    padding: 2mm 3mm;
    border-left-width: 2pt;
    font-size: 8.3pt;
  }

  .print-directory-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5mm;
  }

  .print-project {
    grid-template-columns: 20mm minmax(0, 1fr);
    gap: 2.5mm;
    min-height: 27mm;
    padding: 2.5mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .qr-slot {
    width: 20mm;
    color: #111;
  }

  .print-project h3 {
    font-size: 9.3pt;
  }

  .print-project p {
    font-size: 7.4pt;
  }

  .print-project .print-url {
    font-size: 6.8pt;
  }
}
