/* ==========================================================================
   THE PLATE HERO (2026-09-30). Replaces the red poster hero (.sw-mast--poster).
   Load after swiss.css. TIER 2, ours: art direction, counted in nothing.

   Two halves on the page's own twelve columns. Columns 1–6 carry the record:
   aliases and dates in a ruled band, the name, the summary, the three key
   facts. Columns 7–12 are a poster plate that bleeds to the edge of the main
   column: two flat red fields, a disc, hairlines, and a cut-out photograph.

   The plate is drawn in one unit, --u, which is 1/765 of the plate's width,
   capped so the hero never runs taller than the screen. Everything tied to
   the photograph is anchored to the bottom; the disc and the band to the top.
   The band and foot lines are shared with the text half, so their heights
   are registered lengths computed once against the hero.
   ========================================================================== */

@property --swh-band { syntax: "<length>"; inherits: true; initial-value: 0px; }
@property --swh-foot { syntax: "<length>"; inherits: true; initial-value: 0px; }

#main:has(.swh) { overflow-x: clip; }

.swh {
  /* From the wrap's content edge out to the main column's edge. */
  --bleed: calc(var(--s6) + var(--pad) + max(0px, (100vw - 15.5rem - 2 * var(--s6) - 86rem) / 2));
  --swh-line: rgba(14, 15, 16, 0.38);
  --swh-in: 1.125rem;

  position: relative;
  container-type: inline-size;
  margin: calc(-3rem - var(--s2)) calc(-1 * var(--bleed)) 0;
  padding: 0 var(--bleed);
  background: var(--sw-paper);
  color: var(--sw-ink);
  font-family: var(--sw-grot);
  row-gap: 0;
  align-items: stretch;
}
.swh > * {
  --swh-band: clamp(8.5rem, 12.3cqi, 11rem);
  --swh-foot: clamp(5.75rem, 8.7cqi, 7.5rem);
  min-width: 0;
}

/* --- the text half -------------------------------------------------------- */

.swh__text {
  grid-column: 1 / 7; grid-row: 1;
  display: grid;
  grid-template-rows: var(--swh-band) minmax(0, 1fr) var(--swh-foot);
  margin-left: calc(-1 * var(--swh-in));
  margin-right: calc(-1 * var(--gut));   /* the rules run on to the plate */
  border-left: 1px solid var(--swh-line);
}

.swh__band {
  display: grid;
  grid-template-columns: minmax(0, 73.5fr) minmax(0, 26.5fr);
  align-items: start;
  border-bottom: 1px solid var(--swh-line);
}
.swh__aka, .swh__dates {
  margin: 0;
  font: 400 clamp(0.9375rem, 1.3cqi, 1.125rem)/1.28 var(--sw-grot);
  letter-spacing: 0.045em;
  text-transform: uppercase;
}
.swh__aka { padding: 1.75rem var(--swh-in) 0; }
.swh__dates {
  margin: 1.75rem 0 0.75rem;
  padding: 0 var(--swh-in);
  border-left: 1px solid var(--swh-line);
}

.swh__main {
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.5rem, 3.4cqi, 3rem) var(--swh-in) clamp(1.25rem, 1.8cqi, 1.75rem);
}
.swh__title {
  margin: 0 0 0 -0.035em;
  font: 700 min(17.6cqi, 15rem)/0.8 var(--sw-grot);
  letter-spacing: -0.055em;
  color: var(--sw-ink);
}
.swh__title > span { display: block; }
/* The full stop, as a square of the accent sitting on the baseline. */
.swh__dot {
  display: inline-block;
  width: 0.17em; height: 0.17em;
  margin-left: 0.035em;
  background: var(--sw-red);
}
.swh__sum {
  margin: 0;
  max-width: 21em;
  font: 400 clamp(1.125rem, 1.9cqi, 1.625rem)/1.2 var(--sw-grot);
  letter-spacing: -0.005em;
}

.swh__key {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 29.5fr) minmax(0, 37.6fr) minmax(0, 32.9fr);
  align-content: start;
  padding-top: 1.75rem;
  border-top: 1px solid var(--swh-line);
}
.swh__key > div { padding: 0 var(--swh-in); border-left: 1px solid var(--swh-line); }
.swh__key > div:first-child { border-left: 0; padding-left: 1.5rem; }
.swh__key dt { font: 700 0.8125rem/1.3 var(--sw-grot); }
.swh__key dd { margin: 0.35rem 0 0; font: 400 0.8125rem/1.35 var(--sw-grot); }

/* --- the plate ------------------------------------------------------------ */

.swh__plate {
  grid-column: 7 / -1; grid-row: 1;
  position: relative;
  overflow: hidden;
  container-type: inline-size;
  margin-right: calc(-1 * var(--bleed));
  /* Resolved on each child, so 100cqi is the plate's own width. */
  --u: min(calc(100cqi / 765), calc(100svh / 910));
}
.swh__plate > * { position: absolute; }
.swh__plate > .swh__sizer { position: static; display: block; height: calc(910 * var(--u)); }

.swh__red { background: var(--sw-red); }
.swh__red--a { left: 0; top: 0; width: calc(248 * var(--u)); bottom: calc(470 * var(--u)); }
.swh__red--b { left: 0; bottom: calc(138 * var(--u)); width: calc(226 * var(--u)); height: calc(175 * var(--u)); }
.swh__disc {
  right: calc(-35 * var(--u));
  top: calc(var(--swh-band) - 17 * var(--u));
  width: calc(344 * var(--u)); aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sw-red);
}

.swh__v { top: 0; bottom: 0; width: 1px; background: var(--swh-line); }
.swh__v--a { left: calc(360 * var(--u)); }                                     /* passes behind the building */
.swh__v--b { left: calc(613 * var(--u)); top: calc(var(--swh-band) + 347 * var(--u)); }
.swh__v--c { right: calc(24 * var(--u)); }
.swh__h { height: 1px; background: var(--swh-line); }
.swh__h--band { left: 0; right: 0; top: calc(var(--swh-band) - 1px); }
.swh__h--foot { left: calc(613 * var(--u)); right: 0; bottom: calc(var(--swh-foot) - 1px); }

.swh__photo {
  left: 0; bottom: 0;
  display: block;
  width: calc(613 * var(--u)); max-width: none; height: auto;
}

.swh__tags {
  left: calc(385 * var(--u));
  top: max(calc(57 * var(--u)), 5.25rem);   /* under the action bar, which sits under the nav (2026-10-01) */
  margin: 0;
  font: 400 clamp(0.8125rem, calc(15 * var(--u)), 0.9375rem)/1.17 var(--sw-grot);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.swh__motto {
  left: calc(635 * var(--u));
  bottom: calc(var(--swh-foot) + 118 * var(--u));
  margin: 0;
  font: 400 clamp(0.875rem, calc(17 * var(--u)), 1.0625rem)/1.28 var(--sw-grot);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.swh__motto::after {
  content: ""; display: block;
  width: 1.25rem; height: 1px; margin-top: 0.8rem;
  background: currentColor;
}
.swh__cross {
  left: calc(613 * var(--u)); right: calc(24 * var(--u));
  bottom: 0; height: var(--swh-foot);
  display: grid; place-items: center;
}
.swh__cross::before {
  content: "";
  width: clamp(2.5rem, calc(62 * var(--u)), 4rem); aspect-ratio: 1;
  background:
    linear-gradient(var(--sw-ink), var(--sw-ink)) center / 100% 1px no-repeat,
    linear-gradient(var(--sw-ink), var(--sw-ink)) center / 1px 100% no-repeat;
}

/* The photograph is generated, and says so on its own dark ramp. Placed on
   the plate's grid cell from outside it, so it is read aloud. */
.swh__gen {
  grid-column: 7 / -1; grid-row: 1;
  align-self: end; justify-self: start;
  position: relative; z-index: 1;
  max-width: 17rem;
  margin: 0 0 0.875rem 0.875rem;
  font: 400 0.6875rem/1.35 var(--sw-grot);
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.82);
}

/* The motto needs its column wide enough to hold a word. */
@container (max-width: 30rem) { .swh__motto { display: none; } }

/* ------------------------------------------------------------- narrow ----- */

@media (max-width: 60rem) {
  .swh { --bleed: calc(var(--s4) + var(--pad)); }
}

/* The halves stack: text, then the plate across the full main column. */
@media (max-width: 52rem) {
  .swh__text {
    grid-column: 1 / -1;
    margin-right: 0;
    grid-template-rows: var(--swh-band) auto var(--swh-foot);
  }
  .swh__main { gap: 1.5rem; padding-block: 1.75rem 1.5rem; }
  .swh__title { font-size: min(30cqi, 11rem); }
  .swh__plate {
    grid-column: 1 / -1; grid-row: 2;
    margin-left: calc(-1 * var(--bleed));
  }
  .swh__gen { grid-column: 1 / -1; grid-row: 2; margin-left: calc(0.875rem - var(--bleed)); }
  .swh__key { padding-bottom: 1.25rem; }
}

/* On a phone the action cluster sits along the bottom edge. */
@media (max-width: 48rem) {
  .swh__tags { top: calc(40 * var(--u)); }
  .swh__key > div { padding-inline: 0.75rem; }
  .swh__key > div:first-child { padding-left: var(--swh-in); }
}

/* --- the mock nav (founder, 2026-09-30: every redesigned hero reads as a home
       page). A line across the top of the text half; the band grows by the same
       amount, so the plate's disc and hairlines stay registered to it. -------- */
.swh > * { --swh-navh: 2.75rem; --swh-band: calc(clamp(8.5rem, 12.3cqi, 11rem) + var(--swh-navh)); }
.swh__text { position: relative; }
.swh__nav {
  position: absolute; left: 0; right: var(--gut); top: 0; height: var(--swh-navh);
  display: flex; align-items: center; gap: 1.5rem; padding: 0 var(--swh-in);
  border-bottom: 1px solid var(--swh-line);
  font: 500 0.8125rem/1 var(--sw-grot); letter-spacing: 0.045em; text-transform: uppercase;
}
.swh__nav a { color: var(--sw-ink); text-decoration: none; }
.swh__nav a:hover, .swh__nav a:focus-visible { color: var(--sw-red); }
.swh__logo { margin-right: auto; }
.swh__logo img { display: block; height: 0.8rem; width: auto; }
.swh__band { padding-top: var(--swh-navh); }
@media (max-width: 52rem) { .swh__nav { right: 0; } }
.swh__nav { gap: clamp(0.7rem, 1.5cqi, 1.1rem); white-space: nowrap; }
/* Five links since Rules joined (audit 2026-10-01). The text half is ~450px
   at 1280 and narrower beside the rail, so the row tightens with the hero
   and, as a last resort, scrolls rather than hiding Mix it under the plate. */
.swh__nav { font-size: clamp(0.6875rem, 1.15cqi, 0.8125rem); letter-spacing: 0.035em; overflow-x: auto; scrollbar-width: none; }
.swh__nav::-webkit-scrollbar { display: none; }
.swh__nav > * { flex: none; }
.swh__logo img { height: clamp(0.65rem, 1.1cqi, 0.8rem); }

/* Below 1280 (audit 2026-10-01): the text half is too narrow for the wordmark
   and five links on one line, and beside the rail the cluster covered Build,
   Sources and Mix it. Two lines: the wordmark on top (left of the cluster),
   the links on the row's floor. --swh-band grows with --swh-navh, so the
   plate stays registered. */
@media (max-width: 1279.98px) {
  .swh > * { --swh-navh: 5.75rem; }
  .swh__nav { flex-wrap: wrap; align-content: space-between; row-gap: 0; padding-block: 0.7rem 0.95rem; overflow: visible; }
  .swh__logo { margin-right: 100%; }   /* alone on its line, box only as wide as the mark */
}
/* The two-line nav puts the action bar lower; the tags start under it (2026-10-01). */
@media (min-width: 60.0625rem) and (max-width: 1279.98px) { .swh__tags { top: 8rem; } }
