/* ---------------------------------------------------------------
   Field Guide — tokens
   --------------------------------------------------------------- */
:root {
  --paper: #ede9dd;
  --paper-raised: #f4f1e6;
  --ink: #22261f;
  --contour: #6f766a;
  --survey-blue: #2b4570;
  --pencil-red: #a63d2f;
  --grid-line: #c9c2ae;

  --display: "Fraunces", ui-serif, Georgia, serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 40rem;
  --page-max: 60rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* subtle paper grain via layered gradients, no image request */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(
      circle at 20% 30%,
      rgba(34, 38, 31, 0.025),
      transparent 60%
    ),
    radial-gradient(circle at 80% 70%, rgba(34, 38, 31, 0.02), transparent 55%);
}

main,
header,
footer {
  position: relative;
  z-index: 1;
}

a {
  color: var(--survey-blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--pencil-red);
}

:focus-visible {
  outline: 2px solid var(--pencil-red);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------------------------------------------------------------
   Hero
   --------------------------------------------------------------- */
.hero {
  padding: 4.5rem 0 2.5rem;
  border-bottom: 1px solid var(--grid-line);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--contour);
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 1.4em;
  height: 1px;
  background: var(--contour);
}

h1 {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin: 0.5em 0 0.4em;
  max-width: 16ch;
}

.hero p.lede {
  max-width: var(--measure);
  font-size: 1.1rem;
  color: var(--ink);
  opacity: 0.86;
  margin: 0 0 2.6rem;
}

.hero p.lede a {
  white-space: nowrap;
}

/* ---------------------------------------------------------------
   Transect diagram
   --------------------------------------------------------------- */
.transect {
  margin: 0 0 0.75rem;
}

.transect svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.transect-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw-line 1.4s ease-out forwards;
}

.transect-divider {
  stroke: var(--grid-line);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.transect-stem {
  stroke-width: 1.2;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: draw-stem 0.5s ease-out forwards;
  animation-delay: 1.1s;
}

.transect-stem.pre {
  stroke: var(--survey-blue);
}
.transect-stem.during {
  stroke: var(--survey-blue);
}
.transect-stem.post {
  stroke: var(--pencil-red);
}

.transect-node {
  opacity: 0;
  animation: fade-in 0.4s ease-out forwards;
  animation-delay: 1.5s;
}

.transect-node circle {
  fill: var(--paper);
  stroke-width: 1.4;
}
.transect-node.pre circle {
  stroke: var(--survey-blue);
}
.transect-node.during circle {
  stroke: var(--survey-blue);
}
.transect-node.post circle {
  stroke: var(--pencil-red);
}

.transect-label {
  font-family: var(--mono);
  font-size: 11.5px;
  fill: var(--ink);
}

.transect-zone {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  fill: var(--contour);
}

@keyframes draw-line {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes draw-stem {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes fade-in {
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .transect-line,
  .transect-stem {
    animation: none;
    stroke-dashoffset: 0;
  }
  .transect-node {
    animation: none;
    opacity: 1;
  }
}

.compass {
  position: absolute;
  right: 0;
  top: -0.5rem;
  width: 46px;
  height: 46px;
  opacity: 0.55;
}

.transect-wrap {
  position: relative;
  margin-top: 2.5rem;
}

/* ---------------------------------------------------------------
   Install-all command
   --------------------------------------------------------------- */
.install-all {
  margin: 2.2rem 0 0;
}

.install-all .caption {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--contour);
  margin: 0 0 0.5rem;
}

/* ---------------------------------------------------------------
   Command block ("ink stamp")
   --------------------------------------------------------------- */
.cmd {
  background: var(--ink);
  color: var(--paper-raised);
  border-radius: 3px;
  padding: 0.6rem 0.7rem 1rem;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.55;
}

.cmd-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.3rem;
}

.cmd pre {
  margin: 0;
  overflow-x: auto;
}

.cmd code {
  display: block;
  width: fit-content;
  min-width: 100%;
  white-space: pre;
  padding: 0 0.4rem 0 0.4rem;
}

.cmd-copy {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  background: transparent;
  border: 1px solid rgba(237, 233, 221, 0.35);
  border-radius: 2px;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.cmd-copy:hover {
  border-color: var(--paper);
}

.cmd-copy.copied {
  color: var(--paper);
  border-color: #6f9d6a;
  border-style: solid;
}

.cmd-copy.copied::before {
  content: "\2713  ";
}

/* ---------------------------------------------------------------
   Field-guide entries
   --------------------------------------------------------------- */
.entries {
  padding: 3rem 0 4rem;
}

.entry {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1.75rem;
  padding: 2.4rem 0;
  border-bottom: 1px solid var(--grid-line);
}

.entry:first-child {
  padding-top: 0;
}

.entry:last-child {
  border-bottom: none;
}

.entry-zone {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--contour);
  padding-top: 0.35rem;
}

.entry-zone .rule {
  color: var(--survey-blue);
}

.entry-zone.zone-post .rule {
  color: var(--pencil-red);
}

.entry h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.55rem;
  margin: 0 0 0.55rem;
  letter-spacing: -0.005em;
}

.entry p.desc {
  max-width: var(--measure);
  margin: 0 0 1rem;
}

.triggers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.1rem;
  padding: 0;
  list-style: none;
}

.triggers li {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  padding: 0.22rem 0.5rem;
}

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
footer {
  border-top: 1px solid var(--grid-line);
  padding: 2rem 0 3rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--contour);
}

footer p {
  margin: 0.4rem 0;
}

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */
@media (max-width: 640px) {
  .hero {
    padding: 3rem 0 2rem;
  }

  .entry {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.6rem;
  }

  .entry-zone {
    padding-top: 0;
  }

  .cmd {
    font-size: 0.76rem;
    padding: 0.9rem 2.6rem 0.9rem 0.9rem;
  }

  .compass {
    display: none;
  }
}
