:root {
  --silt: #2f4a3c;
  --silt-deep: #1c2e26;
  --gauge: #3f6a52;
  --concrete: #c9c4b8;
  --slab: #b7b1a4;
  --paper: #ece7dc;
  --ink: #1a221e;
  --mute: #5a665e;
  --foam: #f4f1ea;
  --alert: #8a3a2a;
  --ok: #2c5a40;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body.river-body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  background: var(--paper);
  color: var(--ink);
  font-family: Newsreader, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2, h3 {
  font-family: Newsreader, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.7rem;
}

h1 { font-size: clamp(2.1rem, 4.4vw, 3.6rem); }

p { margin: 0 0 1rem; }

.skip-gauge {
  position: absolute;
  left: 16px;
  top: -48px;
  background: var(--silt);
  color: var(--foam);
  padding: 8px 12px;
  z-index: 80;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  text-decoration: none;
}

.skip-gauge:focus { top: 12px; }

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

.gauge-col {
  grid-row: 1 / -1;
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    linear-gradient(180deg, var(--silt-deep), var(--silt) 55%, #24382e);
  color: var(--foam);
  padding: 22px 18px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid #8a867a;
}

.gauge-mark {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #c5d4ca;
}

.gauge-word {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 15px;
  font-weight: 500;
  color: var(--foam);
  text-decoration: none;
  border-bottom: 1px solid #6f8a78;
  padding-bottom: 8px;
}

.staff {
  flex: 1;
  position: relative;
  border: 1px solid #6f8a78;
  background: #13241c;
  min-height: 220px;
  overflow: hidden;
}

.staff-water {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46%;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(99, 158, 122, 0.35) 0 6px,
      rgba(63, 106, 82, 0.55) 6px 12px
    );
}

.staff-ticks {
  position: absolute;
  inset: 10px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  color: #d5e4d8;
}

.staff-read {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.staff-read strong {
  display: block;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.lab-top {
  grid-column: 2;
  background: var(--concrete);
  border-bottom: 1px solid var(--slab);
}

.lab-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  max-width: 980px;
}

.lab-burger {
  display: none;
  width: 44px;
  height: 36px;
  border: 1px solid var(--silt);
  background: var(--foam);
  padding: 8px;
  cursor: pointer;
}

.lab-burger span {
  display: block;
  height: 2px;
  background: var(--silt);
  margin: 4px 0;
}

.lab-nav {
  display: flex;
  gap: 18px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lab-nav a { text-decoration: none; color: var(--silt-deep); }
.lab-nav a[aria-current="page"] { border-bottom: 2px solid var(--gauge); }

.article-col {
  grid-column: 2;
  max-width: 920px;
  padding: 42px 36px 72px;
}

.lede {
  font-size: 1.2rem;
  font-style: italic;
  color: var(--mute);
}

.plate {
  margin: 28px 0 36px;
  background: var(--concrete);
  padding: 10px;
}

.plate figcaption {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--mute);
  padding: 8px 4px 2px;
}

.two-read {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 28px;
  margin: 36px 0;
}

.pull-silt {
  margin: 0;
  padding: 20px;
  background: var(--silt);
  color: var(--foam);
  font-size: 1.25rem;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
  margin: 24px 0 8px;
}

.log-table th,
.log-table td {
  text-align: left;
  border-bottom: 1px solid #c2bbae;
  padding: 8px 6px;
}

.weir-link {
  display: inline-block;
  margin-top: 8px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--silt);
}

.silt-foot {
  grid-column: 2;
  background: var(--concrete);
  border-top: 1px solid var(--slab);
  padding: 28px 36px;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 24px;
  font-size: 15px;
}

.silt-foot h3 {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--silt);
}

.silt-foot a { color: var(--silt-deep); }

.page-head { margin-bottom: 28px; }

.stack-copy { max-width: 68ch; }

.desk-form {
  display: grid;
  gap: 14px;
  margin-top: 12px;
  max-width: 480px;
  background: var(--foam);
  border: 1px solid var(--slab);
  padding: 20px;
}

.desk-form label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.desk-form input,
.desk-form textarea {
  width: 100%;
  border: 1px solid var(--slab);
  background: #fff;
  padding: 10px 12px;
  font: 16px/1.4 Newsreader, serif;
}

.desk-form textarea { min-height: 120px; resize: vertical; }

.agree-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15px;
  text-transform: none;
  letter-spacing: 0;
  font-family: Newsreader, serif;
}

.agree-row input { width: auto; margin-top: 4px; }

.hint { display: none; color: var(--alert); font-size: 14px; margin: 0; }
.is-bad .hint { display: block; }
.is-bad input,
.is-bad textarea { border-color: var(--alert); }

.send-silt {
  justify-self: start;
  background: var(--silt);
  color: var(--foam);
  border: 0;
  padding: 12px 18px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.ok-box {
  background: var(--ok);
  color: var(--foam);
  padding: 22px;
  max-width: 520px;
}

.cookie-silt {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  max-width: 360px;
  background: var(--silt-deep);
  color: var(--foam);
  padding: 16px;
  font-size: 15px;
}

.cookie-silt p { margin: 0 0 12px; }
.cookie-silt a { color: #cfe0d4; }

.cookie-silt button {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 8px;
  border: 1px solid #8aa490;
  background: transparent;
  color: var(--foam);
  padding: 8px 10px;
  cursor: pointer;
}

.cookie-silt [data-cookie="accepted"] { background: var(--gauge); border-color: var(--gauge); }

body.nav-lock { overflow: hidden; }

@media (max-width: 880px) {
  body.river-body {
    display: block;
  }

  .gauge-col {
    position: relative;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 14px 16px;
  }

  .staff { display: none; }

  .lab-burger { display: block; }

  .lab-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--concrete);
    flex-direction: column;
    padding: 16px 20px 24px;
    z-index: 20;
  }

  .lab-nav.is-open { display: flex; }

  .lab-top { position: relative; }

  .article-col,
  .silt-foot { padding: 28px 18px; }

  .two-read,
  .silt-foot { grid-template-columns: 1fr; }
}

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