/* Struck Cathode Gauze — the world.
 *
 * The rule that shapes every choice below: this world has no rules, boxes or
 * dividers. Grouping is gauze density and depth. Wherever a border would be
 * the obvious answer, the answer here is a change in mesh density or a change
 * in how far back a thing sits.
 */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--gauze-dense) var(--ground-deep);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--bone);
  font-family: var(--face-body);
  font-size: var(--step-0);
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

/* ---- the gauze -----------------------------------------------------------
 * A fine bronze mesh laid over the whole plane, running past every edge and
 * never framed. It is one repeating SVG, so it costs one tiny data URI and no
 * request, and it scales without ever going soft. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Cpath d='M0 0h6v1H0zM0 0v6h1V0z' fill='%237a6a4f' fill-opacity='0.16'/%3E%3C/svg%3E");
  /* The mesh fades toward the foot so a long prose page does not read as
   * printed on wire all the way down. */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, rgba(0,0,0,0.35) 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 55%, rgba(0,0,0,0.35) 100%);
}

/* Everything real sits above the mesh. */
body > * { position: relative; z-index: 1; }

/* ---- browser surfaces ----------------------------------------------------
 * The parts nobody draws still belong to the world. */
::selection { background: var(--cathode); color: var(--ground-deep); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ground-deep); }
::-webkit-scrollbar-thumb { background: var(--gauze-dense); }
::-webkit-scrollbar-thumb:hover { background: var(--gauze); }

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

input { caret-color: var(--cathode); }

/* ---- skip link ---------------------------------------------------------- */
.skip {
  position: absolute;
  left: -9999px;
  top: var(--sp-3);
  z-index: 10;
  padding: var(--sp-2) var(--sp-4);
  background: var(--ground-deep);
  color: var(--cathode);
  font-family: var(--face-display);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}
.skip:focus { left: var(--sp-4); }

/* ---- shell -------------------------------------------------------------- */
.shell {
  width: min(100% - 2.5rem, 68rem);
  margin-inline: auto;
}

/* ---- header --------------------------------------------------------------
 * No bar, no border under it. The header is denser gauze, and that density is
 * what separates it from the page. */
.masthead {
  background:
    linear-gradient(to bottom, rgba(122,106,79,0.10), rgba(122,106,79,0) 100%),
    var(--ground-deep);
  padding-block: var(--sp-4);
}

.masthead__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-4) var(--sp-6);
}

.wordmark {
  font-family: var(--face-display);
  font-weight: 600;
  font-size: var(--step-1);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--cathode);
  text-decoration: none;
  text-shadow: var(--halo-soft);
}
.wordmark:hover, .wordmark:focus-visible { color: var(--cathode-soft); }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-5);
  margin-inline-start: auto;
}

.nav__link {
  font-family: var(--face-display);
  font-size: var(--step--1);
  font-weight: 400;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ghost-quiet);
  text-decoration: none;
  padding-block: var(--sp-1);
}
.nav__link:hover { color: var(--bone); }
/* The current page is struck, exactly like a chosen value. One grammar. */
.nav__link[aria-current='page'] {
  color: var(--cathode);
  text-shadow: var(--halo-soft);
}

/* ---- the decorative ghost numerals ---------------------------------------
 * Every possible value present at once, hanging unlit behind the working
 * plane. This layer is decoration and nothing here is read, which is the one
 * place the contrast floor does not apply — it is set below legibility on
 * purpose so it can never be mistaken for content. */
.tube {
  position: relative;
  padding-block: var(--sp-8) var(--sp-7);
  overflow: hidden;
}

.tube__ghosts {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  /* Bounded to the head of the tube on purpose. It spanned the whole section
   * once, which hung decorative numerals behind the quality rows — the one
   * place in this world where a ghost has to mean something. */
  height: clamp(9rem, 26vw, 15rem);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.06em;
  font-family: var(--face-display);
  font-weight: 500;
  font-size: clamp(5rem, 17vw, 12rem);
  line-height: 1;
  color: var(--ghost-decor);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
/* Staggered depth: the further back a numeral hangs, the softer and fainter
 * it is. Width adds depth to the stack, never a new column. */
.tube__ghosts span:nth-child(2n) { opacity: 0.55; filter: blur(1px); }
.tube__ghosts span:nth-child(3n) { opacity: 0.35; filter: blur(2px); }

.tube__body { position: relative; }

/* ---- headings ----------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--face-display);
  font-weight: 500;
  letter-spacing: var(--track-display);
  line-height: 1.08;
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: var(--step-3);
  color: var(--bone);
  text-transform: uppercase;
}
h1 em {
  font-style: normal;
  color: var(--cathode);
  text-shadow: var(--halo);
}

h2 { font-size: var(--step-2); margin-block-start: var(--sp-8); text-transform: uppercase; }
h3 { font-size: var(--step-1); margin-block-start: var(--sp-6); }

/* More space above a heading than below it. */
h2 + *, h3 + * { margin-block-start: var(--sp-3); }

.lede {
  max-width: var(--measure);
  margin-block-start: var(--sp-4);
  font-size: var(--step-1);
  color: var(--ghost);
}

/* ---- the tool ----------------------------------------------------------- */
.tool { margin-block-start: var(--sp-6); }

.paste {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: stretch;
}

.paste__label {
  flex: 1 0 100%;
  font-family: var(--face-display);
  font-size: var(--step--1);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ghost-quiet);
}

/* An input with no box. It is a lit line on the plane: the mesh thickens
 * beneath it, and striking it brightens that line rather than drawing a
 * border. */
.paste__input {
  flex: 1 1 22rem;
  min-width: 0;
  padding: var(--sp-3) 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--gauze-dense);
  color: var(--bone);
  font-family: var(--face-body);
  font-size: var(--step-1);
  transition: border-color var(--beat) var(--ease-out);
}
.paste__input::placeholder { color: var(--ghost-quiet); }
.paste__input:hover { border-bottom-color: var(--gauze); }
.paste__input:focus {
  outline: none;
  border-bottom-color: var(--cathode);
  box-shadow: 0 1px 0 0 var(--cathode), var(--halo-soft);
}

.strike {
  flex: 0 0 auto;
  padding: var(--sp-3) var(--sp-6);
  background: transparent;
  border: 1px solid var(--cathode-deep);
  color: var(--cathode);
  font-family: var(--face-display);
  font-size: var(--step-0);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--beat) var(--ease-out), border-color var(--beat) var(--ease-out);
}
.strike:hover:not(:disabled) { border-color: var(--cathode); text-shadow: var(--halo-soft); }
.strike:active:not(:disabled) { color: var(--cathode-soft); }
.strike:disabled { color: var(--refused); border-color: var(--gauze-mid); cursor: not-allowed; }

.hint {
  margin-block-start: var(--sp-3);
  font-size: var(--step--1);
  color: var(--ghost-quiet);
  max-width: var(--measure);
}

/* ---- the record ---------------------------------------------------------- */
.record { margin-block-start: var(--sp-7); }
.record[hidden] { display: none; }

.record__head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  align-items: flex-start;
}

/* An imported photo stays untinted; the gauze veils it instead of colouring
 * it, which is how this world carries an image it did not make. */
.plate {
  position: relative;
  flex: 0 0 auto;
  width: min(15rem, 42vw);
  margin: 0;
  line-height: 0;
}
.plate::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Cpath d='M0 0h4v1H0z' fill='%230a0e14' fill-opacity='0.5'/%3E%3C/svg%3E");
}
.plate img { width: 100%; height: auto; display: block; }

.record__facts { flex: 1 1 18rem; min-width: 0; }

.record__title {
  font-family: var(--face-display);
  font-size: var(--step-2);
  font-weight: 500;
  line-height: 1.12;
  color: var(--bone);
  margin: 0;
  overflow-wrap: anywhere;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-5);
  margin-block-start: var(--sp-3);
  padding: 0;
  list-style: none;
}
.meta__k {
  font-family: var(--face-display);
  font-size: var(--step--1);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ghost-quiet);
  margin-inline-end: var(--sp-2);
}
.meta__v {
  font-family: var(--face-display);
  font-size: var(--step-0);
  font-variant-numeric: tabular-nums;
  color: var(--bone);
}

/* ---- the stack: every quality present at once ---------------------------- */
.stack {
  margin-block-start: var(--sp-6);
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--sp-1);
}

.stack__legend {
  font-family: var(--face-display);
  font-size: var(--step--1);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ghost-quiet);
  margin-block-end: var(--sp-3);
}

.value {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: transparent;
  border: 0;
  color: var(--ghost);
  font-family: var(--face-display);
  font-size: var(--step-1);
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--beat) var(--ease-out), background-color var(--beat) var(--ease-out);
}

/* Density, not a border, is what separates one value from the next. */
.value::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Cpath d='M0 0h6v1H0z' fill='%237a6a4f' fill-opacity='0.22'/%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}

.value:hover { color: var(--bone); background-color: rgba(122, 106, 79, 0.07); }

/* Struck: crisp, haloed, forward. */
.value[data-state='struck'] {
  color: var(--cathode);
  text-shadow: var(--halo);
}
.value[data-state='struck']::before { opacity: 0.9; }

/* Refused: a quality this video never had. Drawn and labelled, never dropped. */
.value[data-state='refused'] {
  color: var(--refused);
  background-color: var(--refused-ground);
  cursor: not-allowed;
}
.value[data-state='refused']::before { opacity: 0.15; }

.value__q {
  flex: 0 0 4.5rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Mass drawn, not stated: the bar is proportional to the real byte size, so
 * the largest file looks like the largest file. */
.value__mass {
  flex: 1 1 auto;
  height: 0.5rem;
  min-width: 2rem;
  background-image: linear-gradient(to right, currentColor 0 var(--mass, 0%), transparent var(--mass, 0%) 100%);
  opacity: 0.55;
}

.value__size {
  flex: 0 0 auto;
  font-size: var(--step-0);
  font-variant-numeric: tabular-nums;
  color: inherit;
}

/* The action, named. A row has always been a button; without this it read as
 * a line in a table, which is exactly how the first build was described back. */
.value__take {
  flex: 0 0 auto;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ghost-quiet);
  transition: color var(--beat) var(--ease-out);
}
.value:hover .value__take,
.value:focus-visible .value__take {
  color: var(--cathode);
  text-shadow: var(--halo-soft);
}
.value[data-state='struck'] .value__take { color: var(--cathode); }
.value[data-state='refused'] .value__take { display: none; }

.value__note {
  flex: 0 0 auto;
  font-family: var(--face-body);
  font-size: var(--step--1);
  letter-spacing: 0;
  text-transform: none;
  color: var(--refused);
}

/* ---- status and the patch clock ------------------------------------------ */
.status {
  margin-block-start: var(--sp-5);
  min-height: 1.6em;
  font-size: var(--step-0);
  color: var(--ghost);
}
.status[data-tone='error'] { color: var(--cathode-soft); }
.status[data-tone='working'] { color: var(--cathode); }

/* A link on its way out keeps an afterglow rather than turning a warning
 * colour, because this world has no third hue to warn in. */
.patch {
  margin-block-start: var(--sp-3);
  font-family: var(--face-display);
  font-size: var(--step--1);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ghost-quiet);
}
.patch[data-decayed='true'] { color: var(--decayed); }

/* ---- prose ---------------------------------------------------------------
 * Prose columns clear the mesh entirely. The world says so, and a legal page
 * set on wire is a legal page nobody finishes. */
.prose {
  position: relative;
  max-width: calc(var(--measure) + 3rem);
  margin-block-start: var(--sp-6);
  padding: var(--sp-5) var(--sp-5) var(--sp-6);
  background: var(--ground);
}
.prose p, .prose li { color: var(--ghost); }
.prose a { color: var(--cathode); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--cathode-soft); }
.prose ul, .prose ol { padding-inline-start: 1.25rem; }
.prose li + li { margin-block-start: var(--sp-2); }
.prose code {
  font-family: var(--face-display);
  font-size: 0.95em;
  color: var(--cathode-soft);
  overflow-wrap: anywhere;
}

/* ---- steps --------------------------------------------------------------- */
.steps { counter-reset: step; padding: 0; list-style: none; margin-block-start: var(--sp-5); }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: var(--sp-4);
  padding-block: var(--sp-4);
  color: var(--ghost);
}
.steps li::before {
  content: counter(step);
  font-family: var(--face-display);
  font-size: var(--step-2);
  font-weight: 500;
  line-height: 1;
  color: var(--cathode);
  text-shadow: var(--halo-soft);
  font-variant-numeric: tabular-nums;
}

/* ---- footer -------------------------------------------------------------- */
.colophon {
  margin-block-start: var(--sp-9);
  padding-block: var(--sp-7) var(--sp-8);
  background: var(--ground-deep);
  color: var(--ghost-quiet);
  font-size: var(--step--1);
}
.colophon__row { display: flex; flex-wrap: wrap; gap: var(--sp-4) var(--sp-6); }
.colophon a { color: var(--ghost); text-decoration: none; }
.colophon a:hover { color: var(--cathode); }
.colophon__note { max-width: var(--measure); margin-block-start: var(--sp-5); }
.colophon__age {
  font-family: var(--face-display);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ghost);
}

/* ---- motion --------------------------------------------------------------
 * Values snap, never tween. The only thing allowed to take time is the decay
 * of a glow that is being replaced. */
@keyframes decay {
  from { color: var(--cathode); text-shadow: var(--halo); }
  to { color: var(--ghost); text-shadow: none; }
}
.value[data-decaying='true'] { animation: decay var(--beat) var(--ease-out) forwards; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

/* ---- narrow -------------------------------------------------------------- */
@media (max-width: 34rem) {
  .value { flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); }
  .value__mass { order: 3; flex-basis: 100%; }
  .tube { padding-block: var(--sp-6) var(--sp-5); }
  .nav { margin-inline-start: 0; }
}

/* ---- captures ------------------------------------------------------------
 * A shot of this interface sits on the same ground as the page around it, so
 * it needs separation that is not a border. Depth does it: a real offset and
 * blur, which is what this world allows where something genuinely sits above
 * the plane. */
.shot {
  margin: var(--sp-7) 0 0;
  max-width: calc(var(--measure) + 8rem);
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: var(--lift);
}
.shot figcaption {
  margin-block-start: var(--sp-3);
  font-family: var(--face-display);
  font-size: var(--step--1);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ghost-quiet);
}

/* ---- the notes list ------------------------------------------------------- */
.notes {
  margin-block-start: var(--sp-6);
  padding: 0;
  list-style: none;
  max-width: calc(var(--measure) + 3rem);
}
.note {
  padding: var(--sp-5) 0;
  background: var(--ground);
}
.note + .note { margin-block-start: var(--sp-2); }
.note__title {
  font-family: var(--face-display);
  font-size: var(--step-2);
  font-weight: 500;
  line-height: 1.12;
  margin: 0;
  text-transform: none;
}
.note__title a {
  color: var(--bone);
  text-decoration: none;
}
.note__title a:hover,
.note__title a:focus-visible {
  color: var(--cathode);
  text-shadow: var(--halo-soft);
}
.note__date {
  margin-block: var(--sp-2) var(--sp-3);
  font-family: var(--face-display);
  font-size: var(--step--1);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ghost-quiet);
}
.note p:last-child { color: var(--ghost); margin-block-end: 0; }

/* ---- tables in prose ------------------------------------------------------
 * No rules and no zebra fill: the head is set in the display face and the body
 * rows are separated by air, which is the same grouping logic the quality list
 * uses. Figures are tabular so a column of sizes lines up. */
.prose table {
  width: 100%;
  margin-block-start: var(--sp-5);
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.prose thead th {
  font-family: var(--face-display);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ghost-quiet);
  text-align: start;
  padding: 0 var(--sp-4) var(--sp-3) 0;
}
.prose tbody td {
  padding: var(--sp-2) var(--sp-4) var(--sp-2) 0;
  color: var(--ghost);
}
.prose tbody tr td:first-child {
  font-family: var(--face-display);
  font-size: var(--step-0);
  color: var(--bone);
}

/* A table is the one thing here that may genuinely outgrow a narrow screen, so
 * it scrolls inside its own box rather than pushing the page sideways. */
.prose .table-scroll { overflow-x: auto; }
