:root {
  color-scheme: light;
  --bg: #f5efe2;
  --sand: #efe3c8;
  --forest: #21372a;
  --forest-deep: #142219;
  --moss: #5e7b56;
  --gold: #b08a4a;
  --clay: #9b6644;
  --text: #1e2119;
  --muted: #5e5b4e;
  --panel: rgba(255, 250, 240, 0.76);
  --panel-strong: rgba(255, 248, 234, 0.92);
  --line: rgba(33, 55, 42, 0.12);
  --shadow: 0 20px 50px rgba(48, 41, 29, 0.12);
  --page-bg:
    radial-gradient(circle at top left, rgba(176, 138, 74, 0.2), transparent 32%),
    radial-gradient(circle at 85% 12%, rgba(94, 123, 86, 0.16), transparent 28%),
    linear-gradient(180deg, #f7f1e6 0%, #eee2c9 100%);
  --grid-line: rgba(33, 55, 42, 0.02);
  --glow-a: rgba(176, 138, 74, 0.2);
  --glow-b: rgba(94, 123, 86, 0.15);
  --header-bg: rgba(255, 249, 237, 0.78);
  --soft-bg: rgba(255, 255, 255, 0.44);
  --soft-bg-strong: rgba(255, 255, 255, 0.58);
  --hero-bg: linear-gradient(135deg, rgba(255, 249, 238, 0.94), rgba(246, 238, 219, 0.92));
  --trail-bg: linear-gradient(180deg, rgba(255, 250, 241, 0.94), rgba(246, 236, 214, 0.92));
  --trail-card-bg: rgba(255, 252, 246, 0.78);
  --story-glow: rgba(176, 138, 74, 0.12);
  --accent-bg: linear-gradient(180deg, rgba(94, 123, 86, 0.08), rgba(176, 138, 74, 0.06));
  --warm-bg: linear-gradient(180deg, rgba(176, 138, 74, 0.08), rgba(255, 248, 236, 0.9));
  --wide-glow: rgba(94, 123, 86, 0.1);
  --quote-bg: linear-gradient(135deg, var(--forest), #2d4937);
  --quote-text: #f5ecd8;
  --nav-active-text: #fff7ea;
  --button-primary-text: #fff8ec;
  --field-option-bg: #fffaf0;
  --field-option-text: #1e2119;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151a15;
  --sand: #263024;
  --forest: #8ca27d;
  --forest-deep: #eef2df;
  --moss: #a9bd92;
  --gold: #d4b36f;
  --clay: #d19b70;
  --text: #ece8d8;
  --muted: #c5bdac;
  --panel: rgba(30, 38, 30, 0.76);
  --panel-strong: rgba(28, 36, 28, 0.92);
  --line: rgba(231, 222, 196, 0.14);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.32);
  --page-bg:
    radial-gradient(circle at top left, rgba(177, 139, 76, 0.16), transparent 32%),
    radial-gradient(circle at 85% 12%, rgba(118, 147, 100, 0.14), transparent 28%),
    linear-gradient(180deg, #151a15 0%, #202417 100%);
  --grid-line: rgba(246, 235, 205, 0.035);
  --glow-a: rgba(176, 138, 74, 0.14);
  --glow-b: rgba(126, 156, 103, 0.13);
  --header-bg: rgba(26, 34, 27, 0.82);
  --soft-bg: rgba(255, 246, 220, 0.08);
  --soft-bg-strong: rgba(255, 246, 220, 0.1);
  --hero-bg: linear-gradient(135deg, rgba(31, 39, 31, 0.95), rgba(43, 44, 28, 0.9));
  --trail-bg: linear-gradient(180deg, rgba(30, 38, 30, 0.94), rgba(40, 43, 29, 0.9));
  --trail-card-bg: rgba(31, 39, 31, 0.82);
  --story-glow: rgba(176, 138, 74, 0.1);
  --accent-bg: linear-gradient(180deg, rgba(142, 170, 111, 0.08), rgba(214, 175, 102, 0.07));
  --warm-bg: linear-gradient(180deg, rgba(190, 147, 76, 0.08), rgba(41, 43, 30, 0.9));
  --wide-glow: rgba(142, 170, 111, 0.09);
  --quote-bg: linear-gradient(135deg, #253425, #3a4327);
  --quote-text: #f4ead2;
  --nav-active-text: #141a14;
  --button-primary-text: #11180f;
  --field-option-bg: #1f271f;
  --field-option-text: #ece8d8;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #151a15;
    --sand: #263024;
    --forest: #8ca27d;
    --forest-deep: #eef2df;
    --moss: #a9bd92;
    --gold: #d4b36f;
    --clay: #d19b70;
    --text: #ece8d8;
    --muted: #c5bdac;
    --panel: rgba(30, 38, 30, 0.76);
    --panel-strong: rgba(28, 36, 28, 0.92);
    --line: rgba(231, 222, 196, 0.14);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.32);
    --page-bg:
      radial-gradient(circle at top left, rgba(177, 139, 76, 0.16), transparent 32%),
      radial-gradient(circle at 85% 12%, rgba(118, 147, 100, 0.14), transparent 28%),
      linear-gradient(180deg, #151a15 0%, #202417 100%);
    --grid-line: rgba(246, 235, 205, 0.035);
    --glow-a: rgba(176, 138, 74, 0.14);
    --glow-b: rgba(126, 156, 103, 0.13);
    --header-bg: rgba(26, 34, 27, 0.82);
    --soft-bg: rgba(255, 246, 220, 0.08);
    --soft-bg-strong: rgba(255, 246, 220, 0.1);
    --hero-bg: linear-gradient(135deg, rgba(31, 39, 31, 0.95), rgba(43, 44, 28, 0.9));
    --trail-bg: linear-gradient(180deg, rgba(30, 38, 30, 0.94), rgba(40, 43, 29, 0.9));
    --trail-card-bg: rgba(31, 39, 31, 0.82);
    --story-glow: rgba(176, 138, 74, 0.1);
    --accent-bg: linear-gradient(180deg, rgba(142, 170, 111, 0.08), rgba(214, 175, 102, 0.07));
    --warm-bg: linear-gradient(180deg, rgba(190, 147, 76, 0.08), rgba(41, 43, 30, 0.9));
    --wide-glow: rgba(142, 170, 111, 0.09);
    --quote-bg: linear-gradient(135deg, #253425, #3a4327);
    --quote-text: #f4ead2;
    --nav-active-text: #141a14;
    --button-primary-text: #11180f;
    --field-option-bg: #1f271f;
    --field-option-text: #ece8d8;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  background: transparent;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}

.page-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  opacity: 0.7;
}

.page-glow-a {
  width: 320px;
  height: 320px;
  top: -40px;
  left: -60px;
  background: var(--glow-a);
}

.page-glow-b {
  width: 360px;
  height: 360px;
  right: -80px;
  top: 120px;
  background: var(--glow-b);
}

.wrap {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 64px;
  position: relative;
  z-index: 1;
}

.site-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  flex: none;
}

.brand img {
  width: 420px;
  height: auto;
  display: block;
}

.header-preset {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 270px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--gold), transparent 84%), transparent),
    var(--soft-bg);
  color: var(--muted);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 0.76rem;
  line-height: 1.2;
}

.header-preset strong {
  width: 100%;
  color: var(--forest-deep);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.header-preset span {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--soft-bg-strong);
  white-space: nowrap;
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-kicker,
.eyebrow,
.section-tag,
.stat-label,
.trail-index {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-kicker {
  color: var(--moss);
  font-size: 0.72rem;
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  max-width: 100%;
}

.theme-toggle {
  width: 52px;
  height: 39px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 0;
  flex: none;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft-bg);
  color: var(--forest);
  cursor: pointer;
  position: relative;
}

.theme-toggle::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  top: 7px;
  left: 3px;
  border-radius: 50%;
  background: var(--panel-strong);
  box-shadow: 0 4px 12px rgba(33, 55, 42, 0.16);
  transition: transform 0.2s ease;
}

.theme-toggle[aria-pressed="true"]::before {
  transform: translateX(23px);
}

.theme-toggle span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  line-height: 1;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.nav a,
.nav-action,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--forest);
  border-radius: 999px;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.nav a,
.nav-action {
  padding: 10px 16px;
  background: var(--soft-bg);
  white-space: nowrap;
}

.nav-form {
  display: inline-flex;
  margin: 0;
}

.nav-auth {
  display: contents;
}

.nav-action {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.nav a.active,
.nav a:hover,
.nav-action:hover {
  background: var(--forest);
  color: var(--nav-active-text);
  transform: translateY(-1px);
}

.hero,
.subpage-hero,
.stats-band,
.feature-layout,
.trail-section,
.quote-banner,
.wide-note,
.mosaic-card,
.story-panel,
.trail-card,
.error-page {
  box-shadow: var(--shadow);
}

main > .story-panel {
  margin-top: 24px;
}

.hero {
  margin-top: 24px;
  padding: 34px;
  border-radius: 40px;
  background:
    var(--hero-bg),
    var(--panel);
  border: 1px solid var(--line);
}

.eyebrow {
  color: var(--clay);
  font-size: 0.74rem;
  margin: 0 0 12px;
}

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

h1,
h2,
h3 {
  font-weight: 700;
  color: var(--forest-deep);
}

h1 {
  font-size: clamp(2.2rem, 4.1vw, 3.8rem);
  line-height: 0.98;
  max-width: none;
  margin-bottom: 16px;
  text-wrap: balance;
}

.hero-copy h1 {
  white-space: nowrap;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.08;
}

h3 {
  font-size: 1.32rem;
  margin-bottom: 10px;
}

.lead,
p,
li {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.68;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.button {
  padding: 13px 20px;
  font-size: 0.95rem;
}

.button-primary {
  color: var(--button-primary-text);
  background: linear-gradient(135deg, var(--forest), #35543f);
}

.button-secondary {
  background: var(--soft-bg-strong);
  border: 1px solid var(--line);
}

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

.hero-art img {
  width: 100%;
  height: auto;
  display: block;
}

.stats-band {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 22px;
  border-radius: 30px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.stats-band article {
  padding: 14px 8px;
}

.stat-label {
  display: block;
  margin-bottom: 6px;
  color: var(--clay);
  font-size: 0.72rem;
}

.stats-band strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.3rem;
  color: var(--forest-deep);
}

.feature-layout {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.story-panel,
.mosaic-card,
.trail-card,
.wide-note,
.quote-banner {
  padding: 26px;
  border-radius: 30px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.story-panel-large {
  background:
    radial-gradient(circle at right bottom, var(--story-glow), transparent 30%),
    var(--panel-strong);
}

.accent-panel {
  background:
    var(--accent-bg),
    var(--panel-strong);
}

.section-tag {
  color: var(--clay);
  font-size: 0.72rem;
  margin-bottom: 14px;
}

.soft-list {
  padding-left: 1.1rem;
  margin-bottom: 0;
}

.soft-list li::marker {
  color: var(--gold);
}

.trail-section {
  margin-top: 24px;
  padding: 28px;
  border-radius: 36px;
  background: var(--trail-bg);
  border: 1px solid var(--line);
}

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

.trail-grid,
.mosaic-grid {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

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

.trail-card {
  background: var(--trail-card-bg);
}

.trail-card.soft {
  min-height: 280px;
}

.trail-index {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--gold);
  font-size: 0.88rem;
}

.quote-banner {
  margin-top: 24px;
  background: var(--quote-bg);
  color: var(--quote-text);
}

.quote-banner p {
  margin: 0;
  max-width: 900px;
  color: inherit;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.55;
}

.subpage-hero {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.8fr);
  gap: 20px;
  align-items: end;
  padding: 30px;
  border-radius: 34px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

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

.mosaic-card.warm {
  background:
    var(--warm-bg),
    var(--panel-strong);
}

.mosaic-card.tall {
  grid-row: span 2;
}

.wide-note {
  margin-top: 22px;
  background:
    radial-gradient(circle at right top, var(--wide-glow), transparent 24%),
    var(--panel-strong);
}

.error-page {
  margin-top: 64px;
  padding: 48px 28px;
  text-align: center;
  border-radius: 36px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.error-mark {
  width: 72px;
  height: 72px;
  margin-bottom: 20px;
}

.preset-block {
  margin: 18px 0 6px;
  padding: 16px 20px;
  background: #0a1a0e;
  border-radius: 12px;
  border: 1px solid rgba(77, 255, 145, 0.2);
  font-family: "Courier New", monospace;
}

.preset-block strong {
  display: block;
  color: #c8ffe0;
  font-size: 0.88rem;
  margin-bottom: 10px;
}

.preset-block code {
  display: block;
  color: #4dff91;
  font-size: 0.83rem;
  line-height: 1.85;
  font-style: normal;
}

.inline-code {
  background: none;
  color: inherit;
  font-size: 0.82rem;
}

.step-list {
  padding-left: 1.2rem;
  margin: 10px 0 0;
}

.step-list li {
  margin-bottom: 6px;
}

.step-list li::marker {
  color: var(--gold);
}

.join-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: start;
  margin-top: 24px;
}

.join-grid > .story-panel {
  margin-top: 0;
}

.join-panel {
  padding-top: 34px;
}

.contact-panel {
  padding-top: 34px;
}

.contact-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

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

.form-field {
  display: grid;
  gap: 7px;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--forest-deep);
}

.form-field span {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  background: var(--soft-bg);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-field textarea {
  min-height: 150px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: color-mix(in srgb, var(--moss), var(--line) 35%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--moss), transparent 82%);
  background: var(--soft-bg-strong);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: color-mix(in srgb, var(--muted), transparent 28%);
}

.form-field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--moss) 50%),
    linear-gradient(135deg, var(--moss) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 50%,
    calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.form-field select option {
  background: var(--field-option-bg);
  color: var(--field-option-text);
}

.form-field-full {
  grid-column: 1 / -1;
}

.form-note {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--soft-bg);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
}

.turnstile-box {
  min-height: 65px;
}

.form-status {
  display: none;
  margin: 0;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 0.92rem;
  line-height: 1.55;
}

.form-status:not(:empty) {
  display: block;
}

.form-status[data-state="pending"] {
  background: var(--soft-bg);
  color: var(--muted);
}

.form-status[data-state="success"] {
  background: color-mix(in srgb, var(--moss), transparent 84%);
  color: var(--forest-deep);
}

.form-status[data-state="error"] {
  background: color-mix(in srgb, var(--clay), transparent 84%);
  color: var(--forest-deep);
}

.form-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.form-consent input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: none;
  accent-color: var(--moss);
}

.contact-form .button[disabled] {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 900px) {
  .wrap {
    width: min(100% - 24px, 1160px);
    padding-top: 18px;
  }

  .subpage-hero,
  .feature-layout,
  .trail-grid,
  .mosaic-grid,
  .stats-band,
  .join-grid {
    grid-template-columns: 1fr;
  }

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

  .form-field-full {
    grid-column: auto;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .header-preset {
    justify-content: flex-start;
    max-width: none;
    width: 100%;
  }

  .header-preset strong {
    width: auto;
    margin-right: 4px;
    text-align: left;
  }

  .brand img {
    width: 300px;
  }

  .nav a,
  .nav-action {
    padding: 8px 11px;
    font-size: 0.84rem;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero,
  .trail-section,
  .subpage-hero,
  .story-panel,
  .mosaic-card,
  .wide-note,
  .quote-banner,
  .stats-band {
    padding: 22px;
    border-radius: 26px;
  }

  h1 {
    font-size: 2.4rem;
  }

  .hero-copy h1 {
    white-space: normal;
  }

}
