
:root {
  --deep-teal: #064b4f;
  --living-green: #2e7d73;
  --ocean-blue: #0c5a7a;
  --red-ochre: #b84a2f;
  --solar-gold: #dfa429;
  --sand: #f6f2ea;
  --sand-2: #efe4d2;
  --surface: #fffdf8;
  --graphite: #1f1f1f;
  --muted: #60706c;
  --border: #d9d3c3;
  --shadow: 0 18px 45px rgba(31, 31, 31, 0.12);
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body.menu-open {
  overflow: hidden;
}

a {
  color: inherit;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 20;
  background: var(--solar-gold);
  color: var(--graphite);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(6, 75, 79, 0.97);
  color: #fffdf8;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12);
}

.nav-shell {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
}

.brand {
  font-family: "Merriweather", Georgia, serif;
  font-weight: 900;
  font-size: 1.15rem;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.7rem 0.65rem;
  border-radius: 6px;
  color: rgba(255, 253, 248, 0.86);
}

.site-nav a:hover,
.site-nav a.active {
  color: #fff;
  background: rgba(255, 253, 248, 0.12);
}

.menu-toggle {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  border-radius: 6px;
  min-width: 42px;
  min-height: 42px;
  font-size: 1.25rem;
}

.home-hero {
  min-height: calc(100vh - 190px);
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(420px, 1.28fr);
  align-items: stretch;
  max-width: 1440px;
  margin: 0 auto;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.home-hero-copy,
.page-hero-split .hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.25rem 1.85rem 1.75rem max(2rem, calc((100vw - var(--max)) / 2));
}

.home-hero h1,
.page-hero h1 {
  font-family: "Merriweather", Georgia, serif;
  margin: 0;
  line-height: 1.04;
  color: var(--deep-teal);
}

.home-hero h1 {
  font-size: 3.35rem;
  max-width: 9ch;
}

.home-hero p,
.page-hero p {
  font-size: 1rem;
  max-width: 60ch;
  color: #344541;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.64rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--deep-teal);
  font-weight: 800;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

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

.button.primary {
  background: var(--deep-teal);
  color: #fffdf8;
}

.button.secondary,
.button.subtle {
  background: transparent;
  color: var(--deep-teal);
}

.button.subtle {
  border-color: var(--border);
}

.micro-note {
  margin-top: 1.1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.hero-art {
  min-height: 100%;
  margin: 0;
  position: relative;
  overflow: hidden;
}

.hero-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--surface) 0%, rgba(255, 253, 248, 0.6) 8%, rgba(255, 253, 248, 0) 20%);
  pointer-events: none;
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section {
  padding: 4.5rem 1.25rem;
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
}

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

.section-heading.centred {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

h2 {
  font-family: "Merriweather", Georgia, serif;
  font-size: 2rem;
  line-height: 1.15;
  margin: 0 0 0.75rem;
  color: var(--deep-teal);
}

h3 {
  margin: 0 0 0.55rem;
  color: var(--deep-teal);
  font-size: 1.05rem;
}

p {
  margin: 0 0 1rem;
}

.doorway-grid,
.card-grid,
.builder-directory {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.doorway-card,
.info-card,
.builder-tile,
.hero-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 8px 28px rgba(31, 31, 31, 0.06);
}

.doorway-card {
  min-height: 220px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.doorway-card span {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 900;
}

.doorway-card.teal {
  color: var(--deep-teal);
}

.doorway-card.ochre {
  color: var(--red-ochre);
}

.doorway-card.gold {
  color: #9b6a00;
}

.doorway-card.blue {
  color: var(--ocean-blue);
}

.page-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.85fr);
  gap: 2rem;
  align-items: center;
}

.page-hero h1 {
  font-size: 3.2rem;
  max-width: 12ch;
}

.hero-note {
  background: linear-gradient(135deg, #fffdf8, #edf4ef);
}

.hero-note strong {
  color: var(--deep-teal);
}

.page-hero-art {
  margin: 0;
  position: relative;
  min-height: 260px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #d9c6a0;
  box-shadow: 0 18px 46px rgba(31, 31, 31, 0.13);
}

.page-hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.08), rgba(8, 83, 87, 0.16));
  pointer-events: none;
}

.page-hero-split {
  min-height: calc(100vh - 190px);
  max-width: 1440px;
  padding: 0;
  grid-template-columns: minmax(280px, 0.72fr) minmax(420px, 1.28fr);
  gap: 0;
  align-items: stretch;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.page-hero-split .page-hero-art {
  min-height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.page-hero-split .page-hero-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, var(--surface) 0%, rgba(255, 253, 248, 0.68) 8%, rgba(255, 253, 248, 0) 23%);
  pointer-events: none;
}

.page-hero-split .page-hero-art::after {
  z-index: 2;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.02), rgba(8, 83, 87, 0.08));
}

.plain-list {
  display: grid;
  gap: 0.7rem;
  padding-left: 1.2rem;
  max-width: 760px;
}

.plain-list li::marker {
  color: var(--red-ochre);
}

.text-link {
  color: var(--deep-teal);
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.accent-band {
  background: linear-gradient(135deg, #e4f0eb, #f7edda);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.split-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--deep-teal);
  width: 30%;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.timeline li {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.timeline span {
  color: var(--red-ochre);
  font-weight: 900;
}

.sequence-nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.sequence-nav a {
  flex: 1;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--surface);
  color: var(--deep-teal);
  font-weight: 800;
}

.sequence-nav a:last-child {
  text-align: right;
}

.builder-directory {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.builder-tile {
  display: block;
  text-decoration: none;
}

.builder-tile h2 {
  font-size: 1.28rem;
}

.builder-main {
  padding-bottom: 4rem;
}

.builder-workbench {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(320px, 1.05fr);
  gap: 1rem;
  align-items: start;
}

.builder-form,
.markdown-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 8px 28px rgba(31, 31, 31, 0.06);
}

.form-head h2,
.preview-head h2 {
  font-size: 1.45rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

label {
  font-weight: 800;
  color: var(--deep-teal);
  font-size: 0.92rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #bfb8a8;
  border-radius: 6px;
  background: #fffefa;
  color: var(--graphite);
  padding: 0.75rem;
  font: inherit;
  min-height: 44px;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

.field-help {
  color: var(--muted);
  font-size: 0.84rem;
}

.builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.status-line,
.preview-head span {
  color: var(--muted);
  font-size: 0.88rem;
}

.preview-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

pre[data-markdown-preview] {
  min-height: 540px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f7f3eb;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

.site-footer {
  background: #063f43;
  color: #fffdf8;
  padding: 3rem 1.25rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(280px, 0.9fr);
  gap: 2rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
}

.footer-links a {
  color: #fffdf8;
}

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--deep-teal);
  background: var(--surface);
  color: var(--deep-teal);
  font-weight: 900;
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 980px) {
  .home-hero,
  .page-hero,
  .builder-workbench {
    grid-template-columns: 1fr;
  }

  .home-hero-copy,
  .page-hero-split .hero-copy {
    padding: 3.5rem 1.25rem 2rem;
  }

  .hero-art,
  .page-hero-split .page-hero-art {
    min-height: 320px;
  }

  .page-hero-art {
    min-height: 300px;
  }

  .doorway-grid,
  .card-grid,
  .builder-directory,
  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    position: fixed;
    left: 0;
    right: 0;
    top: 62px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    background: var(--deep-teal);
    padding: 0.75rem 1.25rem 1.25rem;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 0.9rem;
  }
}

@media (max-width: 680px) {
  .home-hero h1,
  .page-hero h1 {
    font-size: 2.35rem;
  }

  .home-hero-copy,
  .page-hero-split .hero-copy {
    padding: 1.45rem 1rem 1rem;
  }

  .home-hero h1 {
    font-size: 2.15rem;
  }

  .home-hero p {
    font-size: 0.94rem;
    line-height: 1.48;
  }

  .home-hero .hero-actions {
    gap: 0.55rem;
    margin-top: 0.8rem;
  }

  .home-hero .button {
    min-height: 40px;
    padding: 0.55rem 0.78rem;
  }

  .home-hero .micro-note {
    font-size: 0.84rem;
    margin-top: 0.75rem;
  }

  .hero-art,
  .page-hero-split .page-hero-art {
    min-height: 220px;
  }

  .first-steps {
    padding-top: 2.2rem;
  }

  .section {
    padding: 3rem 1rem;
  }

  .page-hero {
    padding: 3rem 1rem 2rem;
    gap: 1.35rem;
  }

  .page-hero-split {
    padding: 0;
    gap: 0;
  }

  .page-hero-art {
    min-height: 210px;
  }

  .page-hero-split .page-hero-art {
    min-height: 220px;
  }

  .doorway-grid,
  .card-grid,
  .builder-directory,
  .timeline {
    grid-template-columns: 1fr;
  }

  .split-panel,
  .sequence-nav,
  .footer-inner {
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .sequence-nav {
    display: grid;
  }

  .sequence-nav a:last-child {
    text-align: left;
  }

  .preview-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
