:root {
  color-scheme: light;
  --ink: #17201c;
  --muted: #5c6862;
  --paper: #f5f2e9;
  --panel: #fffdf7;
  --accent: #176b4d;
  --line: #d8d4c8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.65;
}

a { color: var(--accent); text-underline-offset: 0.18em; }

.site-header,
main,
footer {
  width: min(760px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  color: var(--ink);
  font-weight: 750;
  letter-spacing: -0.03em;
  text-decoration: none;
}

nav { display: flex; gap: 1rem; font-size: 0.9rem; }

main { padding: clamp(2rem, 7vw, 5rem) 0; min-height: 65vh; }

h1, h2, h3 {
  line-height: 1.12;
  letter-spacing: -0.035em;
}

h1 { font-size: clamp(2.6rem, 9vw, 5.2rem); margin: 0 0 2rem; }
h2 { margin-top: 2.8rem; }

blockquote {
  margin: 2.5rem 0;
  padding: 0.5rem 0 0.5rem 1.5rem;
  border-left: 4px solid var(--accent);
  font-size: 1.2rem;
}

pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: var(--panel);
}

code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.88em; }

.content-list { padding: 0; list-style: none; }
.content-list li { padding: 1rem 0; border-top: 1px solid var(--line); }
.content-list a { font-weight: 700; }
.eyebrow, .meta { color: var(--muted); font-size: 0.88rem; }

.button-link {
  display: inline-block;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--accent);
  font-weight: 750;
  text-decoration: none;
}

.fold-intro { max-width: 38rem; font-size: 1.12rem; }

.fold-form {
  margin: 2.5rem 0 3rem;
  padding: clamp(1rem, 4vw, 1.5rem);
  border: 1px solid var(--ink);
  background: var(--panel);
  box-shadow: 6px 6px 0 var(--ink);
}

.fold-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fold-form label span { color: var(--muted); font-weight: 400; }

.fold-form textarea,
.fold-form input {
  width: 100%;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.fold-form textarea { min-height: 6rem; padding: 0.8rem; resize: vertical; }
.fold-form input { padding: 0.65rem; }

.fold-form textarea:focus,
.fold-form input:focus,
.fold-form button:focus,
.button-link:focus {
  outline: 3px solid #d79b2b;
  outline-offset: 2px;
}

.fold-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 0.75rem;
  align-items: end;
  margin-top: 1rem;
}

.fold-form-row label { grid-column: 1; }

.fold-form button {
  grid-column: 2;
  grid-row: 1 / 3;
  min-height: 2.9rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 800;
}

.form-note {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.form-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.fold-terminal {
  overflow: hidden;
  margin: 3rem 0 1rem;
  border: 1px solid #8b6f32;
  background: #161811;
  color: #e4c56f;
  box-shadow: 0 18px 45px rgb(30 28 18 / 18%);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.terminal-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid #69582d;
  background: #252318;
  color: #bba25d;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.fold-log { margin: 0; padding: 0; list-style: none; }

.fold-entry,
.fold-empty { padding: 1rem; border-bottom: 1px dashed #554924; }

.fold-entry:last-child { border-bottom: 0; }
.fold-meta { margin: 0 0 0.35rem; color: #a99151; font-size: 0.72rem; }
.fold-text { margin: 0; color: #f1d987; font-size: 0.94rem; line-height: 1.5; }
.fold-empty { color: #bba25d; font-size: 0.86rem; }

.terminal-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 0.35em;
  background: currentColor;
  vertical-align: -0.12em;
  animation: cursor-blink 1.1s steps(1) infinite;
}

@keyframes cursor-blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .terminal-cursor { animation: none; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.draft-banner {
  padding: 0.55rem 1rem;
  background: #f3ca52;
  color: #2a240f;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
}

footer {
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 520px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 2.7rem; }
  nav { flex-wrap: wrap; }
  .fold-form-row { grid-template-columns: 1fr; }
  .fold-form-row label,
  .fold-form button { grid-column: 1; grid-row: auto; }
  .fold-form button { margin-top: 0.5rem; }
}

/* The landing page is a self-contained transmission from the deep desert. */
.home-page {
  --void: #090704;
  --night: #120b06;
  --sand: #d89b4a;
  --sand-bright: #ffd287;
  --sand-dim: #75502d;
  --ember: #b85c28;
  color-scheme: dark;
  overflow-x: hidden;
  background: var(--void);
  color: #ead9ba;
}

.home-page a { color: inherit; }

.home-page .site-header {
  position: relative;
  z-index: 20;
  width: min(1600px, calc(100% - clamp(2rem, 7vw, 8rem)));
  min-height: 5.25rem;
  margin-inline: auto;
  padding: 1.35rem 0;
  border-color: rgb(216 155 74 / 32%);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  text-transform: uppercase;
}

.home-page .wordmark {
  position: relative;
  padding-left: 1.2rem;
  color: var(--sand-bright);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.home-page .wordmark::before {
  position: absolute;
  left: 0;
  content: "//";
  color: var(--ember);
}

.home-page nav { gap: clamp(0.8rem, 2.2vw, 2.4rem); font-size: 0.65rem; letter-spacing: 0.12em; }
.home-page nav a { color: #b9a17d; text-decoration: none; transition: color 180ms ease; }
.home-page nav a:hover { color: var(--sand-bright); }

.home-page main {
  width: 100%;
  min-height: 0;
  padding: 0;
}

.home-page footer {
  width: min(1600px, calc(100% - clamp(2rem, 7vw, 8rem)));
  padding: 2rem 0 3rem;
  border-color: rgb(216 155 74 / 20%);
  color: #756b5b;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.desert-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: max(650px, calc(100svh - 5.25rem));
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 56%, rgb(190 82 30 / 22%) 0, transparent 25%),
    radial-gradient(ellipse at 50% 108%, #4c2714 0, #1b1008 38%, transparent 67%),
    linear-gradient(180deg, #080604 0%, #110a06 53%, #2b160c 100%);
}

.desert-hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background:
    repeating-linear-gradient(90deg, transparent 0 8.3vw, rgb(255 190 105 / 3%) 8.3vw calc(8.3vw + 1px)),
    repeating-linear-gradient(0deg, transparent 0 5.5rem, rgb(255 190 105 / 2.5%) 5.5rem calc(5.5rem + 1px));
  mask-image: linear-gradient(to bottom, black, transparent 62%);
}

.desert-hero::after {
  position: absolute;
  z-index: 10;
  inset: 0;
  pointer-events: none;
  content: "";
  border: 1px solid rgb(255 204 127 / 7%);
  background: repeating-linear-gradient(180deg, transparent 0 3px, rgb(255 210 145 / 1.8%) 3px 4px);
  mix-blend-mode: screen;
}

.hero-grain {
  position: absolute;
  z-index: -1;
  inset: -20%;
  opacity: 0.34;
  background-image:
    radial-gradient(circle, rgb(255 210 145 / 20%) 0 0.7px, transparent 0.9px),
    radial-gradient(circle, rgb(255 210 145 / 10%) 0 0.6px, transparent 0.8px);
  background-position: 0 0, 7px 11px;
  background-size: 19px 23px, 29px 31px;
  animation: sand-drift 22s linear infinite;
}

.hero-hud {
  position: absolute;
  z-index: 5;
  top: 1rem;
  left: clamp(1.2rem, 4vw, 4rem);
  right: clamp(1.2rem, 4vw, 4rem);
  display: flex;
  justify-content: space-between;
  color: rgb(216 155 74 / 58%);
  font: 0.58rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-signal {
  position: absolute;
  z-index: 6;
  top: 3rem;
  right: clamp(1.2rem, 4vw, 4rem);
  display: flex;
  align-items: end;
  gap: 3px;
  height: 1.1rem;
}

.hero-signal span { width: 2px; background: var(--sand); animation: signal 1.6s ease-in-out infinite alternate; }
.hero-signal span:nth-child(1) { height: 25%; animation-delay: -0.4s; }
.hero-signal span:nth-child(2) { height: 65%; animation-delay: -1.1s; }
.hero-signal span:nth-child(3) { height: 100%; animation-delay: -0.8s; }
.hero-signal span:nth-child(4) { height: 55%; animation-delay: -1.4s; }
.hero-signal span:nth-child(5) { height: 20%; animation-delay: -0.2s; }

.hero-title-wrap {
  position: relative;
  z-index: 4;
  align-self: start;
  width: min(100% - 2rem, 78rem);
  margin: 0 auto;
  padding-top: clamp(5rem, 10vh, 8rem);
  text-align: center;
}

.hero-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0 0 1.7rem;
  color: #b6874f;
  font: 0.62rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-kicker::before,
.hero-kicker::after { width: clamp(2rem, 8vw, 8rem); height: 1px; content: ""; background: rgb(216 155 74 / 40%); }
.hero-kicker span + span::before { margin-right: 1rem; content: "["; color: var(--ember); }
.hero-kicker span + span::after { content: "]"; color: var(--ember); }

.ascii-title {
  width: max-content;
  max-width: none;
  overflow: visible;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sand-bright);
  font: 700 clamp(0.56rem, 1.02vw, 1rem)/1.06 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0;
  text-align: left;
  text-shadow: 0 0 10px rgb(255 179 82 / 36%), 0 0 44px rgb(200 91 32 / 26%);
  filter: drop-shadow(0 1rem 1rem rgb(0 0 0 / 55%));
}

.hero-declaration {
  margin: clamp(1.5rem, 3vh, 2.4rem) auto 0;
  color: #d2b98f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.88rem, 1.4vw, 1.15rem);
  font-style: italic;
  line-height: 1.55;
  letter-spacing: 0.06em;
}

.hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  width: min(32rem, calc(100% - 2rem));
  margin: clamp(1.4rem, 3vh, 2.1rem) auto 0;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.2rem;
  min-width: 14rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgb(216 155 74 / 45%);
  color: #ba9c72;
  font: 0.62rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease, transform 180ms ease;
}

.hero-cta:hover { transform: translateY(-2px); border-color: var(--sand-bright); color: var(--sand-bright); }
.hero-cta-primary { border-color: var(--sand); background: var(--sand); color: #160c05; font-weight: 800; }
.hero-cta-primary:hover { background: var(--sand-bright); color: #160c05; }
.hero-cta-disabled { opacity: 0.55; }

.ascii-landscape {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: end;
  justify-content: center;
  min-height: 68%;
  overflow: hidden;
  pointer-events: none;
  color: #9b6137;
  mask-image: linear-gradient(to bottom, transparent 0%, black 13%, black 100%);
}

.ascii-landscape::after {
  position: absolute;
  right: -10%;
  bottom: -14%;
  left: -10%;
  height: 45%;
  content: "";
  background: radial-gradient(ellipse, rgb(185 92 38 / 31%), transparent 67%);
  filter: blur(16px);
}

.ascii-scene {
  width: max-content;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: 500 clamp(0.37rem, 0.73vw, 0.7rem)/0.94 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0;
  text-shadow: 0 0 7px rgb(225 139 69 / 34%);
  transform: scaleX(1.08);
  transform-origin: bottom center;
  animation: heat-shimmer 7s ease-in-out infinite;
}

.ascii-scene-mobile { display: none; }

.hero-footerline {
  position: absolute;
  z-index: 7;
  right: clamp(1.2rem, 4vw, 4rem);
  bottom: 1.25rem;
  left: clamp(1.2rem, 4vw, 4rem);
  display: flex;
  justify-content: space-between;
  color: rgb(255 205 134 / 50%);
  font: 0.56rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.11em;
}

.hero-scroll {
  position: absolute;
  z-index: 8;
  bottom: 3.2rem;
  left: 50%;
  display: grid;
  place-items: center;
  gap: 0.1rem;
  color: rgb(255 210 145 / 68%);
  font: 0.55rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.15em;
  text-decoration: none;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.hero-scroll span:last-child { font-size: 1rem; animation: descend 1.8s ease-in-out infinite; }

.field-notes {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.8fr);
  gap: clamp(3rem, 10vw, 10rem);
  width: min(1200px, calc(100% - clamp(2rem, 10vw, 10rem)));
  margin: 0 auto;
  padding: clamp(6rem, 12vw, 11rem) 0;
}

.section-index {
  margin: 0 0 2.5rem;
  color: var(--ember);
  font: 0.65rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.field-notes h2 {
  margin: 0;
  color: #f1dfbf;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 5.4vw, 5.3rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.field-notes h2 em { color: #8e6035; font-weight: 400; }

.field-notes-copy {
  align-self: end;
  padding-top: 3rem;
  border-top: 1px solid rgb(216 155 74 / 28%);
  color: #a99a83;
  font-size: clamp(0.94rem, 1.3vw, 1.06rem);
}

.field-rule { padding-left: 1rem; border-left: 2px solid var(--ember); }
.field-rule span { color: #e5c99e; }

.text-link {
  display: inline-flex;
  gap: 1.4rem;
  margin-top: 1.4rem;
  color: var(--sand-bright);
  font: 0.65rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.13em;
  text-decoration: none;
  text-transform: uppercase;
}

.text-link span { transition: transform 180ms ease; }
.text-link:hover span { transform: translateX(0.35rem); }

@keyframes sand-drift {
  to { transform: translate3d(4%, 2%, 0); }
}

@keyframes signal {
  to { opacity: 0.35; transform: scaleY(0.45); }
}

@keyframes heat-shimmer {
  0%, 100% { opacity: 0.82; transform: scaleX(1.08) translateY(0); }
  50% { opacity: 1; transform: scaleX(1.081) translateY(-2px); }
}

@keyframes descend {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(0.35rem); }
}

@media (max-width: 760px) {
  .home-page .site-header {
    align-items: center;
    flex-direction: row;
    width: calc(100% - 2rem);
  }

  .home-page .wordmark { font-size: 0.64rem; }
  .home-page nav { gap: 0.72rem; font-size: 0.54rem; letter-spacing: 0.04em; }
  .hero-hud span:nth-child(2), .hero-hud span:nth-child(3), .hero-signal { display: none; }

  .desert-hero { min-height: max(620px, calc(100svh - 5.25rem)); }
  .hero-title-wrap { padding-top: clamp(4.2rem, 10vh, 6.2rem); }
  .hero-kicker { gap: 0.55rem; margin-bottom: 1.4rem; font-size: 0.5rem; letter-spacing: 0.08em; }
  .hero-kicker span + span { display: none; }
  .ascii-title { font-size: clamp(0.28rem, 1.36vw, 0.52rem); line-height: 1.04; }
  .hero-declaration { font-size: 0.86rem; }
  .hero-actions { display: flex; align-items: stretch; flex-direction: column; width: min(18rem, calc(100% - 2rem)); margin-inline: auto; }
  .hero-cta { min-width: 0; }

  .ascii-scene-wide { display: none; }
  .ascii-scene-mobile { display: block; font-size: clamp(0.44rem, 2vw, 0.64rem); }
  .hero-footerline span:nth-child(2) { display: none; }
  .hero-scroll { bottom: 3.5rem; }

  .field-notes { grid-template-columns: 1fr; gap: 3.5rem; width: calc(100% - 2.5rem); padding: 6rem 0; }
  .field-notes-copy { padding-top: 2rem; }
}

@media (max-width: 430px) {
  .home-page .site-header { min-height: 4.5rem; }
  .home-page nav a:first-child { display: none; }
  .desert-hero { min-height: max(600px, calc(100svh - 4.5rem)); }
  .hero-title-wrap { padding-top: 3.8rem; }
  .hero-footerline { font-size: 0.48rem; }
  .hero-scroll { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-grain,
  .hero-signal span,
  .ascii-scene,
  .hero-scroll span:last-child { animation: none; }
}
