/* =================================================================
   STILYAGI · site-level chrome (masthead, footer, page intros)
   ================================================================= */

/* ---------- Utilities ----------------------------------------------- */
/* Scripts toggle `hidden` on table rows and tab panels, whose component CSS
   sets an explicit `display`; without this the attribute would be ignored. */
[hidden] {
  display: none !important;
}

/* In-page anchor targets clear the sticky masthead, which runs 74-90px tall
   depending on how the brand imprint wraps. */
.section-anchor {
  scroll-margin-top: 90px;
}

/* Labels that exist for assistive technology only. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Skip link ----------------------------------------------- */
/* Visually hidden until focused, then pinned above the sticky masthead. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus {
  left: calc(var(--unit) * 2);
  top: calc(var(--unit) * 2);
}

/* ---------- Masthead ----------------------------------------------- */
.site-mast {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(239, 228, 206, 0.96);
  border-bottom: var(--rule-weight-2) solid var(--ink);
  backdrop-filter: blur(10px);
}
.site-mast-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px calc(var(--unit) * 4) 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-items: end;
  gap: calc(var(--unit) * 4);
}
.brand-lockup {
  display: grid;
  grid-template-columns: 42px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 18px;
  row-gap: 2px;
  color: var(--ink);
  text-decoration: none;
  justify-self: start;
}
.brand-lockup .brand-stripe {
  grid-row: 1 / span 2;
  width: 42px;
  align-self: stretch;
  border-right: var(--rule-weight) solid var(--ink);
  background: repeating-linear-gradient(
    135deg,
    var(--ink) 0 8px,
    transparent 8px 14px
  );
}
.brand-lockup .brand-word {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 2vw + 1rem, 3.25rem);
  letter-spacing: 0.01em;
  line-height: 0.8;
  text-transform: lowercase;
}
.brand-lockup .brand-imprint {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: var(--fg-muted);
  text-transform: uppercase;
}
/* On the narrowest phones the imprint wraps to two lines and pushes the
   masthead out of shape; dropping the publisher prefix keeps it on one. */
@media (width <= 460px) {
  .brand-lockup .brand-org {
    display: none;
  }
}
.site-mast nav {
  justify-self: end;
}
.nav-toggle {
  display: none;
  border: var(--rule-weight) solid var(--ink);
  background: var(--paper);
  padding: 10px 9px;
  cursor: pointer;
}
.nav-toggle-bars {
  display: block;
  width: 22px;
  height: 13px;
  background: repeating-linear-gradient(
    180deg,
    var(--ink) 0 3px,
    transparent 3px 8px
  );
}
.nav-toggle:hover .nav-toggle-bars {
  background: repeating-linear-gradient(
    180deg,
    var(--press-red) 0 3px,
    transparent 3px 8px
  );
}
.site-mast nav ol {
  list-style: none;
  padding: 0;
  margin: 0;
  /* The list carries the popover attribute for the narrow-width menu, and
     the UA styles a popover as a fixed, inset-0, bordered box even while
     closed; reset all of that so the desktop row lays out in flow. */
  position: static;
  inset: auto;
  width: auto;
  height: auto;
  border: 0;
  overflow: visible;
  background: none;
  color: inherit;
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}
.site-mast nav a {
  position: relative;
  display: inline-flex;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 0 8px;
}
.site-mast nav a span {
  position: relative;
  z-index: 1;
}
.site-mast nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 4px;
  background: var(--press-red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--tempo-fast) var(--ease);
}
.site-mast nav a:hover {
  color: var(--accent-text);
}
/* The way out of the sub-site is not one of its sections, so it sits a shade
   back from the section links and takes a rule of its own to say so. */
.site-mast nav .nav-up {
  margin-right: 4px;
  padding-right: 26px;
  border-right: var(--rule-weight) solid var(--ink-soft);
}
.site-mast nav .nav-up a {
  color: var(--ink-soft);
}
.site-mast nav .nav-up a:hover {
  color: var(--accent-text);
}
.site-mast nav a:hover::after,
.site-mast nav a.active::after {
  transform: scaleX(1);
}

/* At narrow widths the primary nav collapses behind a hamburger; the list
   is a native popover, so opening, closing, Escape, and light dismiss all
   work without script. The unlayered flex rule above would defeat the UA's
   closed-popover hiding, so the closed state is hidden explicitly here. */
@media (width <= 1280px) {
  .nav-toggle {
    display: grid;
  }
  .site-mast nav ol:not(:popover-open) {
    display: none;
  }
  .site-mast nav ol:popover-open {
    position: fixed;
    inset: auto;
    top: 10px;
    right: 10px;
    margin: 0;
    display: grid;
    gap: 4px;
    min-width: 13em;
    padding: 14px 18px;
    border: var(--rule-weight) solid var(--ink);
    background: var(--paper);
    box-shadow: 6px 6px 0 var(--press-red);
  }
  .site-mast nav ol:popover-open a {
    display: block;
    padding: 8px 0;
  }
  /* Stacked in the menu, the divider belongs under the row, not beside it. */
  .site-mast nav ol:popover-open .nav-up {
    margin-right: 0;
    padding-right: 0;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-right: 0;
    border-bottom: var(--rule-weight) solid var(--ink-soft);
  }
  .site-mast nav ol::backdrop {
    background: rgba(15, 15, 15, 0.25);
  }
}

/* ---------- Page intro (non-home pages) ---------------------------- */
.page-intro {
  position: relative;
  border-bottom: var(--rule-weight-2) solid var(--ink);
  padding: calc(var(--unit) * 8) 0 calc(var(--unit) * 6);
  background:
    linear-gradient(135deg, rgba(194, 39, 46, 0.1), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0));
}
.page-intro::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: min(18vw, 220px);
  height: 12px;
  background: repeating-linear-gradient(
    135deg,
    var(--ink) 0 10px,
    var(--press-red) 10px 20px
  );
}
.page-intro .wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 calc(var(--unit) * 4);
  display: grid;
  grid-template-columns: 1fr minmax(0, 520px);
  gap: calc(var(--unit) * 8);
  align-items: end;
  position: relative;
}
.page-intro .wrap::after {
  content: "";
  position: absolute;
  right: 0;
  top: -18px;
  width: clamp(180px, 18vw, 260px);
  height: calc(100% + 36px);
  pointer-events: none;
  background:
    radial-gradient(
      circle at 15% 24%,
      rgba(216, 30, 121, 0.26) 0 8px,
      transparent 9px
    ),
    radial-gradient(
      circle at 82% 72%,
      rgba(41, 180, 196, 0.3) 0 10px,
      transparent 11px
    ),
    radial-gradient(
      circle at 55% 15%,
      rgba(214, 159, 46, 0.28) 0 12px,
      transparent 13px
    ),
    repeating-linear-gradient(
      135deg,
      rgba(15, 15, 15, 0.12) 0 2px,
      transparent 2px 9px
    );
  opacity: 0.55;
}
.page-intro .folio {
  font-family: var(--font-sans);
  font-size: var(--t-caption);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: calc(var(--unit) * 2);
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
}
.page-intro .folio::after {
  content: "";
  display: block;
  height: 2px;
  background: var(--press-red);
  flex: 1;
}
.page-intro h1 {
  font-size: clamp(3.3rem, 5vw + 1rem, 6rem);
  line-height: 0.88;
  margin: 0;
  max-width: 10ch;
}
.page-intro h1 .accent {
  color: var(--accent-text);
}
.page-intro .lede {
  font-size: 1.18rem;
  line-height: 1.55;
  text-indent: 0;
  margin: 0;
  position: relative;
  z-index: 1;
}
.page-intro .lede::first-line {
  font-variant: small-caps;
  letter-spacing: 0.04em;
}
@media (max-width: 900px) {
  .page-intro .wrap {
    grid-template-columns: 1fr;
    gap: calc(var(--unit) * 3);
  }
  .page-intro .wrap::after {
    display: none;
  }
  .page-intro h1 {
    max-width: none;
  }
}

/* ---------- Section rhythm ----------------------------------------- */
.rule-heavy {
  height: 0;
  border-top: var(--rule-weight-2) solid var(--ink);
  margin: 0;
}
.folio-sm {
  font-family: var(--font-sans);
  font-size: var(--t-caption);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-text);
}

/* ---------- Footer / colophon -------------------------------------- */
.colophon-footer {
  margin-top: calc(var(--unit) * 8);
  border-top: var(--rule-weight-3) solid var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0)),
    var(--paper-shade);
}
.colophon-footer .wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: calc(var(--unit) * 5) calc(var(--unit) * 4);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: calc(var(--unit) * 4);
  position: relative;
}
.colophon-footer .colophon-heading {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--accent-text);
  margin-bottom: 14px;
}
.colophon-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.colophon-footer ul li {
  margin-bottom: 6px;
}
.colophon-footer ul a {
  font-family: var(--font-editorial);
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dotted var(--ink-soft);
}
.colophon-footer ul a:hover {
  color: var(--accent-text);
  border-color: var(--press-red);
}
.colophon-footer .imprint {
  font-family: var(--font-editorial);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.colophon-footer .imprint strong {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.2rem, 3vw, 3.6rem);
  letter-spacing: 0.02em;
  color: var(--ink);
  text-transform: lowercase;
  display: block;
  margin-bottom: 6px;
  line-height: 0.82;
}
.colophon-footer .imprint .r {
  color: var(--accent-text);
}
.colophon-footer .imprint .sig {
  margin-top: 14px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}
.colophon-strip {
  border-top: var(--rule-weight) solid var(--ink);
  padding: 14px calc(var(--unit) * 4);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--paper-deep);
  max-width: 1320px;
  margin: 0 auto;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .colophon-footer .wrap {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .brand-lockup {
    grid-template-columns: 26px auto;
    column-gap: 12px;
  }
  .brand-lockup .brand-stripe {
    width: 26px;
  }
  .colophon-footer .wrap {
    grid-template-columns: 1fr;
  }
}

/* ---------- Reusable card grid sections ---------------------------- */
.stack-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: calc(var(--unit) * 8) calc(var(--unit) * 4);
}
.stack-section + .stack-section {
  padding-top: 0;
}

.section-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: calc(var(--unit) * 3);
  align-items: end;
  margin-bottom: calc(var(--unit) * 4);
  padding-bottom: calc(var(--unit) * 2);
  border-bottom: var(--rule-weight) solid var(--ink);
}
.section-head .num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 3.5rem;
  line-height: 0.8;
  color: var(--accent-text);
}
.section-head h2 {
  font-size: 2.25rem;
  margin: 0;
}
.section-head .tag {
  font-family: var(--font-sans);
  font-size: var(--t-caption);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 4px;
}

/* ---------- Manicule ornaments ------------------------------------- */
.bigpoint {
  font-family: var(--font-editorial);
  font-size: 4rem;
  line-height: 0.8;
  color: var(--accent-text);
}

/* ---------- Utility ------------------------------------------------ */
.dek {
  font-family: var(--font-editorial);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 58ch;
}

.ink-panel {
  background: var(--ink);
  color: var(--paper);
  padding: calc(var(--unit) * 3);
  border-left: var(--rule-weight-3) solid var(--press-red);
}
.ink-panel h3 {
  color: var(--paper);
}
.ink-panel .accent {
  color: var(--accent-text);
}
.ink-panel a {
  color: var(--paper);
}

/* inline verdicts */
.verdict {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 2px 8px 1px;
  border: 1px solid currentcolor;
}
.verdict.red {
  color: var(--accent-text);
}
.verdict.ink {
  color: var(--ink);
}
.verdict.ochre {
  color: var(--signal-rust);
}
.verdict.sage {
  color: var(--signal-sage);
}

/* inline refs like [1] */
sup.ref {
  color: var(--press-red-ink);
  font-family: var(--font-sans);
  font-size: 0.7em;
  font-weight: 700;
  margin-left: 2px;
}

/* The nav underline sweeps in from the left; with reduced motion it simply
   appears. See the shared guard in motifs-and-components.css. */
@media (prefers-reduced-motion: reduce) {
  .site-mast nav a::after {
    transition: none;
  }
}
