/* ============================================================
   BÉTON — Issue 07: Concrete Utopias
   Light concrete grey / absolute black / one signal red.
   Zero radius. Zero soft shadows. Everything on the grid.
   ============================================================ */

:root {
  --bg: #d9d7d2;
  --ink: #000000;
  --red: #e33;
  --line: 2px;
  --mono: "IBM Plex Mono", "Courier New", monospace;
  --grot: "Space Grotesk", "Helvetica Neue", sans-serif;
  --disp: "Archivo Black", "Arial Black", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Anchor jumps are instant — motion here is crude by principle. */
[id] { scroll-margin-top: 3.4rem; }

body {
  background: var(--ink);
  color: var(--ink);
  font-family: var(--grot);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--red); color: var(--ink); }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: -3px;
}

img, svg { display: block; max-width: 100%; }

/* ---------- frame: black gaps between grey cells = gridlines */
#frame {
  border: var(--line) solid var(--ink);
  background: var(--ink);
  display: flex;
  flex-direction: column;
  gap: var(--line);
  min-height: 100vh;
}

.cell { background: var(--bg); }

.mono {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.disp {
  font-family: var(--disp);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: -0.01em;
}

.red { color: var(--red); }

/* ---------- block inversion ------------------------------- */
.inv { transition: none; }
.inv:hover, .inv:focus-within {
  background: var(--ink);
  color: var(--bg);
}
.inv:hover .keep-red, .inv:focus-within .keep-red { color: var(--red); }
.inv:hover .swatch, .inv:focus-within .swatch { filter: invert(1); }

/* ---------- header ----------------------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto;
  gap: var(--line);
  background: var(--ink);
  border-bottom: var(--line) solid var(--ink);
}
header .cell {
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.h-logo { font-family: var(--disp); font-size: 1.15rem; letter-spacing: 0.02em; }
.h-logo .keep-red { margin-left: 0.35rem; }
.h-issue { justify-content: flex-start; overflow: hidden; }
.h-nav a { padding: 0.65rem 1rem; margin: -0.65rem -1rem; }
.h-nav:hover, .h-nav:focus-within,
.h-nav.active { background: var(--ink); color: var(--bg); }
.h-nav.active a { box-shadow: inset 0 calc(-1 * var(--line) - 1px) 0 var(--red); }
#scroll-readout { min-width: 9.5ch; justify-content: flex-end; font-variant-numeric: tabular-nums; }

/* scroll progress — the odometer, made physical. Quantised, no easing. */
#scroll-progress {
  position: absolute;
  left: 0;
  bottom: calc(-1 * var(--line));
  width: 100%;
  height: var(--line);
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 61;
  pointer-events: none;
}

/* ---------- cover ------------------------------------------ */
.cover {
  display: grid;
  grid-template-columns: 1fr clamp(220px, 24vw, 320px);
  gap: var(--line);
  background: var(--ink);
}
.cover-main {
  padding: clamp(1.5rem, 4vw, 4rem);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: min(78vh, 760px);
}
.cover-kicker {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1.5rem, 4vw, 3.5rem);
  flex-wrap: wrap;
}
.cover-title {
  font-size: clamp(2.9rem, 10.2vw, 10rem);
  white-space: nowrap;
}
.cover-title .line2 { display: block; }
.cover-title .slash { color: var(--red); }
.cover-deck {
  max-width: 46ch;
  margin-top: auto;
  padding-top: clamp(1.5rem, 3vw, 3rem);
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  line-height: 1.45;
  font-weight: 500;
}
.cover-foot {
  margin-top: clamp(1.25rem, 2.5vw, 2.25rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.cover-foot .chip { display: inline-flex; align-items: center; gap: 0.5rem; }
.cover-foot .sq { width: 0.7em; height: 0.7em; background: var(--red); display: inline-block; }
.cover-side {
  display: flex;
  flex-direction: column;
  gap: var(--line);
  background: var(--ink);
}
.cover-side .cell { padding: 1rem 1.25rem; }
.side-issue-no {
  font-family: var(--disp);
  font-size: clamp(5rem, 8vw, 8.5rem);
  line-height: 0.85;
  color: var(--red);
  padding-top: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.side-issue-no .lbl { color: var(--ink); margin-top: 1rem; line-height: 1.5; }
.barcode {
  height: 64px;
  background: repeating-linear-gradient(
    90deg,
    var(--ink) 0 3px, transparent 3px 6px,
    var(--ink) 6px 8px, transparent 8px 14px,
    var(--ink) 14px 20px, transparent 20px 23px,
    var(--ink) 23px 25px, transparent 25px 31px
  );
  margin-bottom: 0.5rem;
}
.meta-list { display: grid; gap: 0.35rem; }
.meta-list div { display: flex; justify-content: space-between; gap: 1rem; }

/* grain overlay */
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}

/* ---------- marquee ---------------------------------------- */
.marquee {
  overflow: hidden;
  padding: 0.7rem 0;
  user-select: none;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee--dark { background: var(--ink); color: var(--bg); }
.marquee--red { background: var(--red); color: var(--ink); }
.marquee-track {
  display: flex;
  width: max-content;
  gap: 2.5rem;
  animation: marq 32s linear infinite;
  will-change: transform;
}
.marquee-track span {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.marquee--dark .sep { color: var(--red); }
.marquee--red .sep { color: var(--bg); }
@keyframes marq { to { transform: translateX(-50%); } }

/* ---------- editorial -------------------------------------- */
.editorial {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 2fr;
  gap: var(--line);
  background: var(--ink);
}
.editorial .cell { padding: clamp(1.5rem, 3vw, 2.5rem); }
.edit-label { display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; }
.edit-label h2 { font-family: var(--disp); font-size: clamp(1.6rem, 3vw, 2.6rem); text-transform: uppercase; line-height: 0.95; }
.edit-body p { max-width: 62ch; margin-bottom: 1rem; font-size: 1.02rem; }
.edit-body p:last-of-type { margin-bottom: 0; }
.edit-sig { margin-top: 1.5rem; }

/* ---------- section heading bars ---------------------------- */
.section-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--line);
  background: var(--ink);
}
.section-bar .cell { padding: 0.9rem 1.25rem; display: flex; align-items: center; }
.section-bar h2 { font-family: var(--disp); font-size: clamp(1.3rem, 2.6vw, 2.2rem); text-transform: uppercase; line-height: 1; }
.section-bar .bar-red { background: var(--red); min-width: 64px; }

/* ---------- articles ---------------------------------------- */
.dossier {
  display: grid;
  grid-template-columns: 56px minmax(280px, 5fr) 7fr;
  gap: var(--line);
  background: var(--ink);
}
.dossier.flip { grid-template-columns: 56px 7fr minmax(280px, 5fr); }

.rail {
  position: relative;
}
.rail-inner {
  position: sticky;
  top: 64px;
  padding: 1.25rem 0;
  display: flex;
  justify-content: center;
}
.rail-inner span {
  writing-mode: vertical-rl;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
}

.folio-col {
  display: flex;
  flex-direction: column;
  gap: var(--line);
  background: var(--ink);
}
.folio {
  padding: 1rem 1.25rem 0.5rem;
  font-family: var(--disp);
  font-size: clamp(6rem, 13vw, 13rem);
  line-height: 0.82;
  color: transparent;
  -webkit-text-stroke: 3px var(--ink);
  flex: 0 0 auto;
}
.folio b { font-weight: 400; color: var(--ink); -webkit-text-stroke: 0 var(--ink); }
.folio.inv:hover, .folio.inv:focus-within { -webkit-text-stroke-color: var(--bg); }
.folio.inv:hover b, .folio.inv:focus-within b { color: var(--red); }
.drawing {
  flex: 1;
  padding: 2.75rem 1.25rem 1.25rem;
  display: flex;
  align-items: flex-end;
  position: relative;
  cursor: crosshair;
}
.drawing .scale {
  position: absolute;
  top: 0.85rem;
  left: 1.25rem;
  letter-spacing: 0.2em;
  opacity: 0.66;
}
.drawing svg { width: 100%; height: auto; }
.drawing-caption { padding: 0.6rem 1.25rem; border-top: var(--line) solid var(--ink); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.drawing-caption.inv:hover, .drawing-caption.inv:focus-within { border-top-color: var(--bg); }
/* surveyor's readout — plots the cursor in drawing-sheet coordinates */
.drawing .coords {
  position: absolute;
  top: 0.85rem;
  right: 1.25rem;
  letter-spacing: 0.2em;
  color: var(--red);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.body-col {
  display: flex;
  flex-direction: column;
  gap: var(--line);
  background: var(--ink);
}
.fact-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--line);
  background: var(--ink);
}
.fact-row .cell { padding: 0.7rem 1rem; }
.fact-row .k { display: block; opacity: 0.62; margin-bottom: 0.15rem; }
.fact-row .v { font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }

.art-main { padding: clamp(1.5rem, 3vw, 2.75rem); flex: 1; }
.art-title {
  font-family: var(--disp);
  font-size: clamp(2rem, 4.5vw, 4.2rem);
  text-transform: uppercase;
  line-height: 0.95;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}
.art-abstract { max-width: 64ch; font-size: 1.02rem; margin-bottom: 1rem; }
.art-abstract + .art-abstract { margin-bottom: 0; }
.art-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--line);
  background: var(--ink);
}
.art-foot .cell { padding: 0.8rem 1.25rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.tag { border: var(--line) solid currentColor; padding: 0.15rem 0.55rem; }
.read-link {
  font-family: var(--disp);
  text-transform: uppercase;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.read-link .arrow { color: var(--red); transition: transform 0.15s steps(3, end); }
.inv:hover .read-link .arrow, .inv:focus-within .read-link .arrow { transform: translateX(0.5ch); }

/* ---------- pull quote -------------------------------------- */
.pull {
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 5vw, 5rem);
  background: var(--ink);
  color: var(--bg);
  position: relative;
  overflow: hidden;
}
.pull blockquote {
  font-family: var(--disp);
  font-size: clamp(1.7rem, 4.6vw, 4rem);
  text-transform: uppercase;
  line-height: 1.02;
  max-width: 24ch;
  position: relative;
  text-wrap: balance;
  text-indent: -0.48ch; /* hang the opening quote — hard optical left edge */
}
.pull blockquote em { font-style: normal; color: var(--red); }
.pull figcaption { margin-top: 1.75rem; color: var(--bg); opacity: 0.75; }
.pull-mark {
  position: absolute;
  top: -0.08em;
  right: clamp(1rem, 4vw, 4rem);
  font-size: clamp(10rem, 26vw, 24rem);
  line-height: 1;
  color: var(--red);
  pointer-events: none;
}

/* ---------- specimens --------------------------------------- */
.specimens {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--line);
  background: var(--ink);
}
.specimen { padding: 0; }
.swatch { height: 150px; border-bottom: var(--line) solid var(--ink); }
.specimen figcaption { padding: 0.7rem 0.9rem 0.9rem; }
.specimen figcaption .n { color: var(--red); }
.inv:hover .keep-red.n, .inv:focus-within .keep-red.n { color: var(--red); }

.sw-board {
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.16) 0 2px, transparent 2px 18px, rgba(0,0,0,0.07) 18px 20px, transparent 20px 34px),
    linear-gradient(0deg, #c9c7c1, #d9d7d2);
}
.sw-bush {
  background-image: radial-gradient(circle at 30% 40%, rgba(0,0,0,0.22) 1px, transparent 1.6px), radial-gradient(circle at 70% 60%, rgba(0,0,0,0.16) 1px, transparent 1.8px);
  background-size: 9px 9px, 13px 13px;
  background-color: #cfcdc7;
}
.sw-pick {
  background-image: repeating-linear-gradient(63deg, rgba(0,0,0,0.2) 0 1px, transparent 1px 6px), repeating-linear-gradient(-63deg, rgba(0,0,0,0.14) 0 1px, transparent 1px 7px);
  background-color: #d2d0ca;
}
.sw-precast {
  background: linear-gradient(180deg, #e0ded9 0 40%, #d3d1cb 40% 41%, #dcdad5 41% 100%);
}
.sw-agg {
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0,0,0,0.34) 2px, transparent 3px),
    radial-gradient(circle at 60% 70%, rgba(0,0,0,0.26) 2.4px, transparent 3.6px),
    radial-gradient(circle at 85% 25%, rgba(0,0,0,0.3) 1.6px, transparent 2.6px),
    radial-gradient(circle at 40% 85%, rgba(0,0,0,0.22) 2px, transparent 3px);
  background-size: 26px 26px, 34px 34px, 22px 22px, 30px 30px;
  background-color: #d6d4ce;
}

/* ---------- index table -------------------------------------- */
.index-table { display: flex; flex-direction: column; gap: var(--line); background: var(--ink); }
.index-row {
  display: grid;
  grid-template-columns: 90px 1fr auto auto;
  gap: var(--line);
  background: var(--ink);
  cursor: pointer;
}
.index-row > div { background: var(--bg); padding: 0.85rem 1.25rem; display: flex; align-items: center; }
.index-row:hover > div, .index-row:focus-visible > div { background: var(--ink); color: var(--bg); }
.index-row:hover .keep-red, .index-row:focus-visible .keep-red { color: var(--red); }
.index-no { font-family: var(--mono); font-size: 0.78rem; }
.index-name { font-family: var(--disp); text-transform: uppercase; font-size: clamp(0.95rem, 1.8vw, 1.35rem); line-height: 1.05; }
.index-arch { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; justify-content: flex-end; text-align: right; }
.index-page { font-family: var(--mono); font-size: 0.78rem; min-width: 8ch; justify-content: flex-end; font-variant-numeric: tabular-nums; }

/* ---------- colophon ------------------------------------------ */
.colophon {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--line);
  background: var(--ink);
}
.colophon .cell { padding: 1.5rem 1.25rem; }
.colophon h3 { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 0.9rem; color: var(--red); }
.inv:hover h3, .inv:focus-within h3 { color: var(--red); }
.colophon p, .colophon li { font-size: 0.88rem; line-height: 1.55; }
.colophon ul { list-style: none; }
.colophon li { display: flex; justify-content: space-between; gap: 0.75rem; }
.colophon li span:last-child { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; align-self: center; text-align: right; }
.colo-big {
  grid-column: span 4;
  padding: clamp(1.5rem, 4vw, 3rem);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.colo-big .beton {
  font-family: var(--disp);
  font-size: clamp(4rem, 16vw, 15rem);
  line-height: 0.8;
  letter-spacing: -0.02em;
}
.colo-big .num { font-family: var(--disp); font-size: clamp(3rem, 9vw, 8rem); line-height: 0.8; color: var(--red); }

/* ---------- footer -------------------------------------------- */
footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--line);
  background: var(--ink);
}
footer .cell { padding: 0.9rem 1.25rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
footer a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- reveals (hard, steps) ------------------------------
   Pre-hidden ONLY when the behaviour layer has announced itself
   (html.js) — with scripts blocked, everything stays visible. */
.js .rv { opacity: 0; transform: translateY(42px); }
.rv.on { animation: hardin 0.5s steps(4, end) forwards; }
@keyframes hardin { to { opacity: 1; transform: none; } }

.js .rv-wipe { clip-path: inset(0 100% 0 0); }
.rv-wipe.on { animation: wipe 0.65s steps(6, end) forwards; }
@keyframes wipe { to { clip-path: inset(0 0 0 0); } }

.js .rv-stamp { opacity: 0; transform: scale(1.4); }
.rv-stamp.on { animation: stamp 0.4s steps(3, end) forwards; }
@keyframes stamp { to { opacity: 1; transform: scale(1); } }

/* ---------- guide page ----------------------------------------- */
.guide-hero { padding: clamp(2rem, 5vw, 4rem); }
.guide-hero h1 { font-family: var(--disp); font-size: clamp(2.4rem, 8vw, 6.5rem); text-transform: uppercase; line-height: 0.9; }
.guide-hero p.mono { margin-top: 1.25rem; }
.guide-body {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 2.4fr;
  gap: var(--line);
  background: var(--ink);
}
.guide-body .cell { padding: clamp(1.5rem, 3vw, 2.5rem); }
.guide-body h2 { font-family: var(--disp); text-transform: uppercase; font-size: clamp(1.2rem, 2.4vw, 1.9rem); line-height: 1; }
.guide-body p { max-width: 62ch; margin-bottom: 1rem; }
.guide-body p:last-child { margin-bottom: 0; }
.guide-body code { font-family: var(--mono); font-size: 0.82em; background: rgba(0,0,0,0.09); padding: 0.05em 0.35em; }
.inv:hover code, .inv:focus-within code { background: rgba(217,215,210,0.18); }
.guide-shots { display: grid; grid-template-columns: 1fr 1fr; gap: var(--line); background: var(--ink); }
.guide-shots figure { background: var(--bg); }
.guide-shots img { width: 100%; height: auto; border-bottom: var(--line) solid var(--ink); }
.guide-shots figcaption { padding: 0.7rem 1rem; }

/* ---------- reduced motion -------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv, .rv-wipe, .rv-stamp { opacity: 1; transform: none; clip-path: none; animation: none !important; }
  .marquee-track { animation: none; }
}

/* ---------- responsive ------------------------------------------ */
@media (max-width: 1100px) {
  .fact-row { grid-template-columns: repeat(2, 1fr); }
  .specimens { grid-template-columns: repeat(2, 1fr); }
  .specimens .specimen:last-child { grid-column: span 2; }
  .colophon { grid-template-columns: repeat(2, 1fr); }
  .colo-big { grid-column: span 2; }
}

@media (max-width: 900px) {
  .pull-mark { display: none; }
  .cover { grid-template-columns: 1fr; }
  .cover-side { flex-direction: row; flex-wrap: wrap; }
  .cover-side .cell { flex: 1 1 200px; }
  .dossier, .dossier.flip { grid-template-columns: 1fr; }
  .rail { display: none; }
  .editorial, .guide-body { grid-template-columns: 1fr; }
  .index-arch { display: none; }
  .index-row { grid-template-columns: 64px 1fr auto; }
  header .h-issue, header .h-hide { display: none; }
  header { grid-template-columns: 1fr auto auto auto; }
  .cover-main { min-height: 0; }
  .cover-deck { margin-top: 0; padding-top: clamp(2rem, 8vw, 3.5rem); }
}

@media (max-width: 360px) {
  .cover-title { font-size: 2.5rem; }
}

@media (max-width: 480px) {
  .fact-row { grid-template-columns: 1fr 1fr; }
  .specimens { grid-template-columns: 1fr; }
  .specimens .specimen:last-child { grid-column: auto; }
  .colophon { grid-template-columns: 1fr; }
  .colo-big { grid-column: auto; }
  .guide-shots { grid-template-columns: 1fr; }
  header #scroll-readout { display: none; }
  header { grid-template-columns: 1fr auto auto; }
  .folio { font-size: 5.5rem; }
}
