/* ==========================================================================
   site.css — the survey chrome.

   Header, footer, panels, buttons, and the four devices that make this site
   look like a cave survey rather than a landing page:

     .station   a monospace station label with a leader rule
     .spec      a spec list with dotted leaders, the way a survey sheet lists
                instrument, grade, date and closure error
     .grade     the survey grade beside a number — the whole honesty
                mechanism, and the reason /survey exists
     .hair      a hairline with tick marks at the ends, like a tape run
   ========================================================================== */

/* ---- header ------------------------------------------------------------- */
.bar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklab, var(--ground) 88%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: var(--rule) solid var(--plate);
}
.bar .wrap { display: flex; align-items: center; gap: 22px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand svg { width: 26px; height: 26px; display: block; }
.brand .name {
  font-family: var(--font-display); font-weight: 700; font-size: 19px;
  letter-spacing: .16em; text-transform: uppercase;
}
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a {
  color: var(--ink3); font-size: 14.5px; padding: 8px 11px; border-radius: var(--r);
  letter-spacing: .01em;
}
.nav a:hover { color: var(--ink); background: var(--plate); text-decoration: none; }
.nav a[aria-current='page'] { color: var(--ink); }
.nav a[aria-current='page']::after {
  content: ''; display: block; height: 2px; margin-top: 5px;
  background: var(--accent); border-radius: 2px;
}
.xlink {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin-left: 4px; flex: 0 0 auto;
  color: var(--ink3); border: var(--rule) solid var(--plate2); border-radius: var(--r);
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.xlink svg { width: 15px; height: 15px; display: block; }
.xlink:hover { color: var(--ink); border-color: var(--accent); text-decoration: none; }
@media (max-width: 940px) { .xlink { margin-left: auto; } }

.navtoggle {
  display: none; margin-left: 8px; background: none; border: var(--rule) solid var(--plate2);
  color: var(--ink); border-radius: var(--r); padding: 7px 12px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; cursor: pointer;
}
@media (max-width: 940px) {
  .xlink {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin-left: 4px; flex: 0 0 auto;
  color: var(--ink3); border: var(--rule) solid var(--plate2); border-radius: var(--r);
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.xlink svg { width: 15px; height: 15px; display: block; }
.xlink:hover { color: var(--ink); border-color: var(--accent); text-decoration: none; }
@media (max-width: 940px) { .xlink { margin-left: auto; } }

.navtoggle { display: block; }
  .nav {
    position: absolute; inset: 66px 0 auto; flex-direction: column; align-items: stretch;
    gap: 0; background: var(--ground2); border-bottom: var(--rule) solid var(--plate);
    padding: 8px var(--gut) 18px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 4px; border-bottom: var(--rule) solid var(--plate); border-radius: 0; }
  .nav a[aria-current='page']::after { display: none; }
}

/* ---- buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 20px; border-radius: var(--r);
  font-family: var(--font-text); font-weight: 700; font-size: 15px;
  border: var(--rule) solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-1 { background: var(--accent-mark); color: var(--deep); }
.btn-2 { border-color: var(--plate2); color: var(--ink); background: var(--plate); }
.btn-2:hover { border-color: var(--accent); }
.btn-3 { color: var(--ink2); padding-inline: 4px; }
.btn-3:hover { color: var(--accent); }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---- plates ------------------------------------------------------------- */
.plate {
  background: var(--plate); border: var(--rule) solid var(--plate2);
  border-radius: var(--r-lg); padding: clamp(20px, 2.6vw, 30px);
}
.plate.tight { padding: 18px 20px; }
.plate.sunk { background: var(--ground2); }

/* ---- the survey devices ------------------------------------------------- */
/* A station label that follows prose needs air above it: it is a section
   marker, and one sitting flush under the previous paragraph reads as part
   of it. */
.prose > .station:not(:first-child), .wrap > .station:not(:first-child) {
  margin-top: clamp(52px, 6.5vw, 92px);
}
.station {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .17em;
  text-transform: uppercase; color: var(--faint);
  margin-bottom: 20px;
}
.station::after {
  content: ''; flex: 1 1 auto; height: var(--rule); background: var(--plate2);
}
.station .tag { color: var(--accent); }

.hair {
  position: relative; height: var(--rule); background: var(--plate2);
  margin-block: var(--step);
}
.hair::before, .hair::after {
  content: ''; position: absolute; top: -4px; width: var(--rule); height: 9px;
  background: var(--plate2);
}
.hair::before { left: 0; }
.hair::after { right: 0; }

.spec { margin: 0; font-size: 15px; }
.spec div {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 9px 0; border-bottom: var(--rule) dotted var(--plate2);
}
.spec dt { color: var(--ink3); flex: 0 1 auto; min-width: 0; }
.spec .lead { flex: 1 1 40px; border-bottom: var(--rule) dotted var(--plate2); transform: translateY(-4px); }
.spec dd {
  margin: 0; flex: 0 1 auto; min-width: 0; color: var(--ink); text-align: right;
  font-family: var(--font-mono); font-size: 13.5px; font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
@media (max-width: 560px) {
  .spec .lead { display: none; }
  .spec div { justify-content: space-between; }
}

.grade {
  display: inline-block; vertical-align: 2px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em;
  padding: 2px 6px; border-radius: 999px; margin-left: 7px;
  border: var(--rule) solid var(--plate2); color: var(--faint);
  text-transform: uppercase; white-space: nowrap;
}
.grade.g5 { color: var(--spring); border-color: color-mix(in oklab, var(--spring) 45%, transparent); }
.grade.g4 { color: var(--sump); border-color: color-mix(in oklab, var(--sump) 40%, transparent); }
.grade.g3 { color: var(--rossa); border-color: color-mix(in oklab, var(--rossa) 40%, transparent); }
.grade.g2, .grade.g1 { color: var(--faint); }

/* ---- figures ------------------------------------------------------------ */
figure { margin: 0 0 var(--step); }
figcaption {
  font-size: 14px; color: var(--faint); margin-top: 14px; max-width: 62ch;
  border-left: 2px solid var(--plate2); padding-left: 14px;
}
figcaption b { color: var(--ink2); }

/* ---- tables ------------------------------------------------------------- */
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td {
  text-align: left; padding: 10px 14px 10px 0;
  border-bottom: var(--rule) solid var(--plate2); vertical-align: top;
}
th {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--faint); font-weight: 400;
  white-space: nowrap;
}
td.num, th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; padding-right: 0; }
tbody tr:hover td { background: color-mix(in oklab, var(--plate) 55%, transparent); }

/* ---- pills and badges --------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink3);
  border: var(--rule) solid var(--plate2); border-radius: 999px; padding: 6px 13px;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.pill.live .dot { animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .28; } }

.demo {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--rossa); border: var(--rule) solid color-mix(in oklab, var(--rossa) 40%, transparent);
  /* A rounded rectangle, not a pill: in a narrow footer column the label
     wraps, and a two-line pill has ends that no longer belong to it. */
  border-radius: var(--r); padding: 6px 11px; line-height: 1.7;
}

/* ---- lists -------------------------------------------------------------- */
/* Markers are absolute and items are BLOCKS. A flex or grid container splits
   its own inline markup into anonymous items: a sibling site rendered every
   list item containing <b> and <code> as three overlapping columns, on the
   page whose argument depends on being read. */
.bullets { list-style: none; margin: 0 0 1.2em; padding: 0; }
.bullets li { position: relative; padding-left: 26px; margin-bottom: .7em; display: block; }
.bullets li::before {
  content: ''; position: absolute; left: 4px; top: .62em;
  width: 9px; height: var(--rule); background: var(--accent);
}
.bullets.dots li::before {
  width: 5px; height: 5px; border-radius: 50%; top: .58em; left: 6px;
}

/* ---- footer ------------------------------------------------------------- */
.foot {
  border-top: var(--rule) solid var(--plate); background: var(--ground2);
  padding-block: clamp(40px, 6vw, 72px) 40px; margin-top: var(--step);
}
.foot .cols { display: grid; gap: 34px; grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .foot .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .foot .cols { grid-template-columns: minmax(0, 1fr); } }
.foot h4 {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .15em;
  text-transform: uppercase; color: var(--faint); font-weight: 400; margin-bottom: 14px;
}
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 9px; }
.foot a { color: var(--ink3); font-size: 15px; }
.foot a:hover { color: var(--accent); }
.foot .fine {
  margin-top: 40px; padding-top: 22px; border-top: var(--rule) solid var(--plate);
  display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: center;
  font-size: 13px; color: var(--faint);
}
.foot .fine p { margin: 0; max-width: 58ch; }
