/* =========================================================
   mbrd - the privacy page

   External (CSP hash). Loads tokens.css only. pv- prefix, whimsy 1 always.
   ========================================================= */

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.62;
  text-wrap: pretty;
  /* Containing block for the grain; min-height covers short pages. */
  position: relative;
  min-height: 100vh;
  background-attachment: scroll;
}

/* Paper grain. Absolute so the texture scrolls with the page. */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("../img/paper-grain.webp");
  background-repeat: repeat;
  background-size: 512px 512px;
  mix-blend-mode: multiply;
  opacity: calc(0.8 * var(--grain));
}

/* Stacking context above the grain. */
.pv {
  position: relative;
  z-index: 1;
}

/* The measure, matching the changelog's 880. */
.pv-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(48px, 9vw, 96px) clamp(18px, 5vw, 40px) 96px;
}

/* ---------------------------------------------------------
   The way back
   --------------------------------------------------------- */

/* Sticky pill. Opaque to prevent content scrolling through it.
   Larger than /patch's pill: this is the only control on the page. */
.pv-back {
  position: sticky;
  top: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0 0 clamp(26px, 4vw, 40px);
  padding: 10px 18px 10px 14px;
  border: var(--hairline) solid var(--rule-2);
  border-radius: var(--radius-pill);
  background: var(--paper-card);
  box-shadow: var(--shadow-1);
  color: var(--ink-2);
  font-family: var(--font-display);
  font-size: var(--t-body);
  font-style: var(--display-italic);
  letter-spacing: calc(0.04em * var(--ls-scale));
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              translate var(--dur-fast) var(--ease);
}
.pv-back:hover {
  color: var(--accent-deep);
  border-color: var(--accent-text);
  /* Towards the board. */
  translate: -2px 0;
}
/* Body face: the display italic leans the arrow the wrong way. */
.pv-arrow {
  font-family: var(--font-body);
  font-style: normal;
}

/* ---------------------------------------------------------
   The head
   --------------------------------------------------------- */

.pv-head { margin-bottom: clamp(38px, 7vw, 70px); }

/* Matches the changelog's title height. */
.pv-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(var(--t-display), 8vw, calc(var(--t-display) * 2.1));
  font-weight: var(--display-weight);
  /* Tracking that follows the clamp; must match .pn-title in patch.css. */
  letter-spacing: calc(clamp(-0.02em, 0.03em - 0.09vw, 0.01em) * var(--ls-scale));
  line-height: 1.04;
  color: var(--ink);
}

.pv-lede {
  margin: 14px 0 0;
  max-width: 48ch;
  font-size: calc(var(--t-body) * 1.06);
  color: var(--ink-2);
}

/* Three absences and a date, divided by hairlines like the sidebar. */
.pv-tally {
  display: flex;
  flex-wrap: wrap;
  gap: 0 12px;
  margin: 22px 0 0;
  font-family: var(--font-display);
  font-size: var(--t-tiny);
  font-style: var(--display-italic);
  letter-spacing: calc(0.2em * var(--ls-scale));
  text-transform: uppercase;
  color: var(--ink-3);
}
.pv-tally span + span {
  padding-left: 14px;
  border-left: var(--hairline) solid var(--rule);
}

/* ---------------------------------------------------------
   The spine — one continuous border-right across touching margin cells
   --------------------------------------------------------- */

.pv-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pv-sec {
  display: grid;
  /* Wider than the changelog's 74px: subjects, not version numbers. */
  grid-template-columns: 116px minmax(0, 1fr);
  column-gap: clamp(18px, 3vw, 34px);
}

.pv-margin {
  position: relative;
  padding: 0 14px 0 0;
  border-right: var(--hairline) solid var(--rule);
  text-align: right;
}

/* Sits on the spine line via the negative right offset. */
.pv-mark {
  position: absolute;
  top: 0.72em;
  right: -4px;
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--accent);
}

/* Margin label: reads as a note beside the plate, not a heading above it. */
.pv-count {
  display: block;
  padding-top: 0.34em;
  font-family: var(--font-display);
  font-size: var(--t-tiny);
  font-style: var(--display-italic);
  letter-spacing: calc(0.08em * var(--ls-scale));
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------------------------------------------------------
   The plates
   --------------------------------------------------------- */

.pv-plate {
  margin: 0 0 clamp(20px, 3.4vw, 34px);
  padding: clamp(22px, 3.6vw, 34px) clamp(22px, 3.6vw, 36px);
  border: var(--hairline) solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-card);
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--dur-base) var(--ease),
              translate var(--dur-base) var(--ease-back);
}

/* Hover lift via --lift-hover; no-ops at Harsh where the token is 0. */
@media (hover: hover) {
  .pv-plate:hover {
    translate: 0 var(--lift-hover);
    box-shadow: var(--shadow-2);
  }
}

.pv-plate p { margin: 0; }

/* Prevents the spine from dangling below the last plate. */
.pv-sec:last-child .pv-plate { margin-bottom: 0; }

/* ---------------------------------------------------------
   Links, code and the foot
   --------------------------------------------------------- */

/* Scoped to containers, not `.pv a`, to avoid overriding .pv-back's colour. */
.pv-plate a, .pv-foot a {
  color: var(--accent-text);
  text-decoration-color: color-mix(in srgb, var(--accent-text) 45%, transparent);
  text-underline-offset: 2px;
}
.pv-plate a:hover, .pv-foot a:hover { color: var(--accent-deep); }
.pv-plate a:focus-visible, .pv-foot a:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}
/* Keeps the pill's own border-radius. */
.pv-back:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
}

.pv-plate code {
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--ink);
}

.pv-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: clamp(34px, 6vw, 60px);
  padding-top: 20px;
  border-top: var(--hairline) solid var(--rule);
  font-family: var(--font-display);
  font-size: var(--t-tiny);
  font-style: var(--display-italic);
  letter-spacing: calc(0.1em * var(--ls-scale));
  color: var(--ink-3);
}

/* ---------------------------------------------------------
   Narrow — margin and label hidden on phones
   --------------------------------------------------------- */

@media (max-width: 640px) {
  .pv-sec { grid-template-columns: minmax(0, 1fr); }
  .pv-margin { display: none; }
  .pv-plate { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .pv-plate, .pv-back { transition: none; }
  @media (hover: hover) {
    .pv-plate:hover { translate: none; }
    .pv-back:hover { translate: none; }
  }
}

/* Fallback for WebKit below 16.2, which lacks color-mix(). */
@supports not (color: color-mix(in srgb, red, blue)) {
  .pv-plate a, .pv-foot a { text-decoration-color: rgb(var(--accent-c) / 45%); }
}
