/* SHIFROM Engineering: the write-ups index (writeups/index.html) and the long-read article pages.
   Loads after base.css; uses its tokens, type and .prose. Never restyles .nav, .foot, .btn or tokens.
   One signature system, borrowed from the homepage status track: glossy blue nodes on a dashed rail
   (the contents rail, the numbered hypotheses, the notes timeline). */

.wu-page, .art-page { position: relative; isolation: isolate; }
/* the soft coloured light of the light pages (as in the homepage Support section), behind the header only */
.wu-page::before, .art-page::before {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: min(1100px, 130vh);
  pointer-events: none;
  background:
    radial-gradient(38% 46% at 8% 30%, rgba(242, 196, 255, 0.5), rgba(242, 196, 255, 0) 100%),
    radial-gradient(44% 52% at 92% 18%, rgba(196, 206, 255, 0.62), rgba(196, 206, 255, 0) 100%);
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
}

html { scroll-padding-top: calc(var(--nav-h) + var(--safe-t, 0px) + 28px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

@keyframes wu-rise { from { opacity: 0; transform: translateY(0.35em); filter: blur(8px); } }
@keyframes wu-fade { from { opacity: 0; } }
@keyframes wu-dock { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
@keyframes wu-sheet { from { opacity: 0; transform: translateY(8px); } }


/* ======================================================================
   INDEX: header band, the feature entry, the timeline to the next note
   ====================================================================== */
.eng-head {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(460px, 66vh, 660px);
  display: grid; align-content: end;
  padding: clamp(72px, 12vh, 140px) var(--gutter) clamp(56px, 9vh, 104px);
}
.eng-gl {
  position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%;
  opacity: 0; transition: opacity 1.6s var(--ease-out);
}
.eng-gl.is-live { opacity: 1; }
.eng-head-in { width: 100%; max-width: 1320px; margin: 0 auto; }
.eng-title { color: var(--ink); }
.eng-intro { margin-top: clamp(22px, 3vh, 32px); max-width: 44ch; color: var(--ink-2); }
.js .eng-title, .js .eng-intro { animation: wu-rise 1.1s var(--ease-out) both; }
.js .eng-intro { animation-delay: 90ms; }

.notes {
  --rail-x: 7px;
  position: relative;
  max-width: 1320px; margin: 0 auto; box-sizing: content-box;
  padding: 0 var(--gutter) var(--section-y);
}
.entry {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr); column-gap: clamp(32px, 5vw, 88px);
  padding: clamp(40px, 6vh, 64px) 0 0;
  border-top: 1px solid var(--line);
}
.entry-meta {
  position: relative; padding-left: 30px;
  display: grid; align-content: start; gap: 4px;
  font-size: 14px; line-height: 1.4; color: var(--ink-3);
}
.entry-meta time { font: 600 17px/1.3 var(--display); letter-spacing: -0.005em; color: var(--blue); }
.entry-meta::before {    /* the "now" node, as on the homepage status track */
  content: ""; position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #b9c2ff 0, #5466ff 38%, #2a36c8 100%);
  box-shadow: 0 0 0 5px rgba(53, 73, 242, 0.12), 0 4px 10px -2px rgba(53, 73, 242, 0.6);
}
.entry-title {
  font-weight: var(--w-light);
  font-size: clamp(2.1rem, 4.6vw, 4.5rem); line-height: 1.0; letter-spacing: -0.042em;
  max-width: 13em; color: var(--ink);
}
.entry-title a { text-decoration: none; color: inherit; transition: color 200ms ease; }
.entry-title a::after { content: ""; position: absolute; inset: 0; border-radius: 4px; }   /* the whole entry is the link */
@supports selector(:has(*)) {    /* the ring moves to the whole entry; without :has() the link keeps its own */
  .entry-title a:focus-visible { outline: none; }
  .entry:has(.entry-title a:focus-visible) { outline: 2px solid var(--blue); outline-offset: 12px; border-radius: 12px; }
}
.entry-sum { margin-top: clamp(20px, 3vh, 30px); font-size: clamp(18px, 1.45vw, 21px); line-height: 1.5; color: var(--ink-2); max-width: 50ch; text-wrap: pretty; }
.entry-cta {
  margin-top: clamp(28px, 4vh, 40px);
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 22px 0 26px; border-radius: 999px;
  font: 600 16px/1 var(--text); color: #fff; background: var(--blue);
  box-shadow: 0 10px 24px -10px rgba(53, 73, 242, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: background-color 180ms ease, transform 140ms var(--ease-out);
}
.entry-cta svg { transition: transform 220ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .entry:hover .entry-title a { color: var(--blue); }
  .entry:hover .entry-cta { background: var(--blue-press); }
  .entry:hover .entry-cta svg { transform: translateX(3px); }
}
.entry:active .entry-cta { transform: scale(0.97); }

/* the dashed rail from this note to the next one */
.notes-next {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr); column-gap: clamp(32px, 5vw, 88px);
  margin-top: clamp(72px, 11vh, 120px);
}
.notes-next::before {     /* the open node: a note not yet written */
  content: ""; position: absolute; left: 0; top: 0.42em; width: 14px; height: 14px; border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(22, 20, 43, 0.28);
  font-size: clamp(18px, 1.45vw, 21px);
}
.notes-next p { grid-column: 2; font-size: clamp(18px, 1.45vw, 21px); line-height: 1.5; color: var(--ink-3); }
.notes::before {
  content: ""; position: absolute; left: calc(var(--gutter) + var(--rail-x) - 1px);
  top: calc(clamp(40px, 6vh, 64px) + 30px); bottom: calc(var(--section-y) + 1.2em);
  width: 2px; border-radius: 2px;
  background: repeating-linear-gradient(180deg, rgba(22, 20, 43, 0.22) 0 6px, transparent 6px 12px);
}
@media (min-width: 1321px) {
  .notes::before { left: calc((100% - 1320px) / 2 + var(--rail-x) - 1px); }
}


/* ======================================================================
   ARTICLE: header, contents rail, the reading column
   ====================================================================== */
.read-progress { position: fixed; left: 0; right: 0; top: calc(var(--nav-h) + var(--safe-t, 0px)); z-index: 61; height: 2px; pointer-events: none; }
.read-progress span {
  display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, #c850f0 0%, #6d4cff 45%, var(--blue) 100%);
}
html:not(.js) .read-progress { display: none; }

.art {
  /* the measure: Onest's "0" is wide, so 68ch would set ~95 characters a line; 35em sets ~72 */
  --col: 35em;
  --rail: 232px;
  --gap: clamp(40px, 5vw, 84px);
  font-size: 19px;
  max-width: 1320px; margin: 0 auto; box-sizing: content-box;
  padding: clamp(48px, 8vh, 96px) var(--gutter) 0;
  display: grid;
  /* the reading column sits on the page's centre line; contents on the left, open margin on the right */
  grid-template-columns: minmax(var(--rail), 1fr) minmax(0, var(--col)) minmax(0, 1fr);
  column-gap: var(--gap);
}

/* header */
.art-head { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: start; }
.back {
  grid-column: 1; justify-self: start; margin-top: 0.7rem;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 16px 0 12px; border-radius: 999px;
  font: 500 15px/1 var(--text); color: var(--ink-2); text-decoration: none;
  background: var(--paper);
  box-shadow: 0 6px 18px -12px rgba(22, 20, 43, 0.4), inset 0 0 0 1px var(--line);
  transition: color 160ms ease, box-shadow 200ms ease, transform 140ms var(--ease-out);
}
.back svg { transition: transform 220ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .back:hover { color: var(--ink); box-shadow: 0 8px 20px -12px rgba(22, 20, 43, 0.45), inset 0 0 0 1px rgba(22, 20, 43, 0.22); }
  .back:hover svg { transform: translateX(-3px); }
}
.back:active { transform: scale(0.97); }

.art-titles { grid-column: 2 / 4; }
.art-title {
  font-weight: var(--w-light);
  font-size: clamp(2.2rem, 4.4vw, 4.25rem); line-height: 1.02; letter-spacing: -0.04em;
  color: var(--ink); max-width: 16.5em;
}
.art-title-main, .art-title-sub { display: block; }
.art-title-sub {
  margin-top: 0.34em; max-width: 24em;
  font-size: 0.56em; line-height: 1.12; letter-spacing: -0.028em; font-weight: 480;
  color: var(--ink-3);
}
.art-byline { margin-top: clamp(26px, 3.6vh, 38px); font-size: 18px; line-height: 1.5; color: var(--ink-2); }
.art-byline em { font-style: normal; }
.art-meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 14.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.js .art-title-main, .js .art-title-sub, .js .art-byline, .js .art-meta { animation: wu-rise 1s var(--ease-out) both; }
.js .art-title-sub { animation-delay: 70ms; }
.js .art-byline { animation-delay: 140ms; }
.js .art-meta { animation-delay: 180ms; }
.js .art-head .back { animation: wu-fade 700ms ease both 200ms; }

/* contents rail (desktop) */
.toc {
  grid-column: 1; grid-row: 2; align-self: start;
  position: sticky; top: calc(var(--nav-h) + var(--safe-t, 0px) + 40px);
  margin-top: clamp(64px, 9vh, 96px);
  max-height: calc(var(--vh) - var(--nav-h) - 64px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  padding: 2px 0 8px;
  font-size: 14px; line-height: 1.38;
}
.toc::-webkit-scrollbar { display: none; }
.toc-label { padding-left: 26px; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.toc-list { position: relative; list-style: none; margin: 0; padding: 0 0 0 26px; display: grid; gap: 2px; }
.toc-list::before {
  content: ""; position: absolute; left: 6px; top: 12px; bottom: 12px; width: 2px; border-radius: 2px;
  background: repeating-linear-gradient(180deg, rgba(22, 20, 43, 0.2) 0 5px, transparent 5px 10px);
}
.toc-list > li > a {
  display: block; padding: 6px 0; text-decoration: none; color: var(--ink-3);
  transition: color 160ms ease;
}
.toc-list > li > a[aria-current], .toc-list > li > a.is-on { color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .toc-list > li > a:hover { color: var(--ink); } }
.toc-nodes { list-style: none; margin: 2px 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.toc-nodes a {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  font: 600 12px/1 var(--display); color: var(--ink-3); text-decoration: none;
  background: var(--paper); box-shadow: inset 0 0 0 1px var(--line);
  transition: color 160ms ease, box-shadow 200ms ease, background-color 200ms ease;
}
@media (hover: hover) and (pointer: fine) { .toc-nodes a:hover { color: var(--ink); box-shadow: inset 0 0 0 1px rgba(22, 20, 43, 0.3); } }
.toc-nodes a[aria-current] {
  color: #fff;
  background: radial-gradient(circle at 32% 30%, #b9c2ff 0, #5466ff 38%, #2a36c8 100%);
  box-shadow: 0 4px 10px -3px rgba(53, 73, 242, 0.6);
}
.toc-dot {
  position: absolute; left: 1px; top: 0; width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #b9c2ff 0, #5466ff 38%, #2a36c8 100%);
  box-shadow: 0 0 0 4px rgba(53, 73, 242, 0.13), 0 3px 8px -2px rgba(53, 73, 242, 0.6);
  opacity: 0; transform: translateY(var(--dot-y, 0px));
  transition: transform 420ms var(--ease-out), opacity 240ms ease;
}
.toc.has-dot .toc-dot { opacity: 1; }
.toc-dot.no-anim { transition: none; }

/* contents (phone and tablet) */
.toc-m-slot { display: none; }
.toc-scrim { display: none; }

/* ---------- the reading column ---------- */
.art-body {
  grid-column: 2; grid-row: 2;
  margin-top: clamp(64px, 9vh, 96px);
  max-width: none; font-size: 19px; line-height: 1.7; color: var(--ink-2);
  font-variant-numeric: proportional-nums;
}
.art-body > * + * { margin-top: 1.05em; }
.art-body .art-lede { font-size: clamp(20px, 1.55vw, 22.5px); line-height: 1.58; color: var(--ink); letter-spacing: -0.003em; text-wrap: pretty; }
.art-body p { text-wrap: pretty; hanging-punctuation: first; }
.art-body em { font-synthesis: style; }
.art-body code {
  font: 500 0.84em/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  padding: 0.18em 0.42em; border-radius: 7px; white-space: nowrap;
  background: rgba(22, 20, 43, 0.055); box-shadow: inset 0 0 0 1px rgba(22, 20, 43, 0.06); color: var(--ink);
}
.art-body a code { color: inherit; }
.art-body h2 {
  margin-top: 2.7em; padding-top: 1.3em; border-top: 1px solid var(--line);
  margin-right: calc(-1 * var(--over-h, 0px));    /* section openers run into the open margin (wide screens) */
  font-size: clamp(1.8rem, 2.7vw, 2.6rem); line-height: 1.06; letter-spacing: -0.036em;
}
.art-body h3 { margin-top: 2.3em; font-size: clamp(1.18rem, 1.45vw, 1.38rem); line-height: 1.28; letter-spacing: -0.018em; }
.art-body h2 + *, .art-body h3 + * { margin-top: 0.75em; }
.art-body h2 + h3 { margin-top: 1.5em; }

/* scope: the prominent callout */
.scope {
  --pad: clamp(22px, 2.6vw, 38px);
  position: relative; isolation: isolate; overflow: hidden;
  margin: 2.2em calc(-1 * var(--pad)) 0;
  padding: calc(var(--pad) * 0.95) var(--pad) var(--pad);
  border-radius: 26px; background: var(--paper);
  box-shadow: 0 26px 60px -34px rgba(43, 30, 115, 0.38), 0 2px 6px -2px rgba(22, 20, 43, 0.06), inset 0 0 0 1px rgba(22, 20, 43, 0.07);
}
.scope::before {
  content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 70% at 100% 0%, rgba(196, 206, 255, 0.5), rgba(196, 206, 255, 0) 100%),
    radial-gradient(50% 60% at 0% 100%, rgba(242, 196, 255, 0.3), rgba(242, 196, 255, 0) 100%);
}
.scope p { font-size: 17.5px; line-height: 1.66; color: var(--ink-2); }
.scope p + p { margin-top: 1em; }
.scope .scope-lead {
  display: block; margin-bottom: 0.75em; max-width: 30em;
  font: 600 clamp(1.1rem, 1.35vw, 1.28rem)/1.28 var(--display); letter-spacing: -0.02em; color: var(--ink);
}

/* lists with run-in leads */
.art-body ul { padding-left: 0; list-style: none; }
.art-body .leads > li { position: relative; padding-left: 1.5em; }
.art-body .leads > li::before {
  content: ""; position: absolute; left: 0.2em; top: 0.68em; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #b9c2ff 0, #5466ff 40%, #2a36c8 100%);
}
.art-body .leads > li + li { margin-top: 0.75em; }
.art-body .transports > li + li { margin-top: 1em; }
.art-body .lessons { margin-top: 1.4em; }
.art-body .lessons > li { padding: 1.05em 0 1.1em 0; border-top: 1px solid var(--line); }
.art-body .lessons > li + li { margin-top: 0; }
.art-body .lessons > li:last-child { border-bottom: 1px solid var(--line); }
.art-body .lessons > li::before { display: none; }
.art-body .lessons > li > strong:first-child {
  display: block; margin-bottom: 0.4em;
  font: 600 clamp(1.06rem, 1.25vw, 1.18rem)/1.3 var(--display); letter-spacing: -0.016em; color: var(--ink);
}

/* the five hypotheses: a real ordered list, numbered with the status-track node */
.art-body .causes { list-style: none; padding: 0; margin-top: 2em; }
.cause + .cause { margin-top: 2.7em; }
.cause > * + * { margin-top: 1.05em; }
.art-body .cause h3 {
  margin-top: 0; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 18px; align-items: start;
  margin-left: -58px;
  font-size: clamp(1.25rem, 1.65vw, 1.5rem); line-height: 1.24; letter-spacing: -0.022em;
}
.art-body .cause h3 + p { margin-top: 0.85em; }
.hyp-n {
  width: 40px; height: 40px; border-radius: 50%; margin-top: -0.2em;
  display: grid; place-items: center;
  font: 600 17px/1 var(--display); color: #fff; letter-spacing: 0;
  background: radial-gradient(circle at 32% 30%, #b9c2ff 0, #5466ff 38%, #2a36c8 100%);
  box-shadow: 0 0 0 5px rgba(53, 73, 242, 0.1), 0 6px 14px -4px rgba(53, 73, 242, 0.55);
}
.hyp-q { padding-top: 0.12em; }
.art-body .reframe, .art-body .keyidea { font-size: 1.08em; line-height: 1.6; color: var(--ink); }
.art-body .reframe { margin-top: 2.4em; }

/* the field-measurements table */
.tbl {
  margin-top: 1.5em; margin-right: calc(-1 * var(--over-t, 0px));
  overflow-x: auto; border-radius: 20px; background: var(--paper);
  box-shadow: 0 22px 48px -32px rgba(43, 30, 115, 0.34), inset 0 0 0 1px rgba(22, 20, 43, 0.08);
}
.tbl table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.45; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 17px 22px; }
.tbl thead th { padding-top: 18px; padding-bottom: 13px; font: 600 13.5px/1.3 var(--text); color: var(--ink-3); border-bottom: 1px solid var(--line); }
.tbl tbody th { font-weight: 600; color: var(--ink); width: 26%; }
.tbl tbody tr + tr > * { border-top: 1px solid var(--line); }
.tbl td.dir { white-space: nowrap; color: var(--ink-3); width: 19%; }
.tbl td, .tbl th { text-wrap: pretty; }
.tbl strong { color: var(--ink); font-weight: 600; }
.tbl code { font-size: 0.86em; }

/* close */
.art-body .closing { margin-top: 2em; }
.outro {
  margin-top: 3em !important;
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 20px; align-items: start;
  padding: 26px 30px 28px; border-radius: 24px; background: var(--paper);
  box-shadow: 0 18px 44px -30px rgba(43, 30, 115, 0.35), inset 0 0 0 1px rgba(22, 20, 43, 0.07);
}
.outro-mark { width: 48px; height: 48px; filter: drop-shadow(0 8px 12px rgba(70, 40, 190, 0.22)); }
.outro p { font-size: 16.5px; line-height: 1.6; color: var(--ink-2); }

.art-end { grid-column: 2 / 4; grid-row: 3; padding: clamp(48px, 7vh, 72px) 0 var(--section-y); }
.back-end {
  min-height: 0; padding: 8px 0; margin: 0; background: none; box-shadow: none; border-radius: 0;
  gap: 12px; font: 560 clamp(1.15rem, 1.8vw, 1.6rem)/1.2 var(--display); letter-spacing: -0.02em; color: var(--ink);
}
.back-end svg { color: var(--blue); }
@media (hover: hover) and (pointer: fine) {
  .back-end:hover { color: var(--blue); box-shadow: none; }
}


@media (min-width: 1240px) {
  .art { --over-h: min(240px, 14vw); --over-t: min(150px, 9vw); }
}

/* ======================================================================
   TABLET: one column, contents in a disclosure
   ====================================================================== */
@media (max-width: 1100px) {
  .art { grid-template-columns: minmax(0, 1fr); max-width: 36em; padding-top: clamp(40px, 6vh, 64px); }
  .art-head { grid-template-columns: minmax(0, 1fr); }
  .back, .art-titles { grid-column: 1; }
  .back { margin: 0 0 clamp(24px, 4vh, 36px); }
  .toc { display: none; }
  /* the contents panel: inline under the header; once scrolled past it docks as a pill (writeups-article.js) */
  .toc-m-slot { display: block; grid-row: 2; margin-top: clamp(32px, 5vh, 48px); min-height: 52px; }
  .toc-m { border-radius: 18px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); -webkit-tap-highlight-color: transparent; }
  .toc-m summary {
    list-style: none; cursor: pointer; min-height: 52px; padding: 0 16px 0 20px;
    display: flex; align-items: center; gap: 10px;
    font: 600 15px/1 var(--text); color: var(--ink); border-radius: 18px;
    touch-action: manipulation; -webkit-user-select: none; user-select: none;
    transition: background-color 120ms ease;
  }
  .toc-m summary:active { background: rgba(22, 20, 43, 0.04); }
  .toc-m summary::-webkit-details-marker { display: none; }
  .toc-m-label { flex: none; }
  .toc-m-now { display: none; }
  .toc-m summary svg { flex: none; margin-left: auto; color: var(--ink-3); transition: transform 200ms var(--ease-out); }
  .toc-m[open] summary svg { transform: rotate(180deg); }
  .toc-m nav { padding: 0 12px 12px 20px; }
  .toc-m ol { list-style: none; margin: 0; padding: 0; display: grid; }
  .toc-m ol ol { padding: 0 0 4px 14px; }
  .toc-m a {
    display: flex; align-items: center; min-height: 44px; padding: 8px 8px 8px 0;
    font-size: 15.5px; line-height: 1.35; color: var(--ink-2); text-decoration: none;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent; border-radius: 10px;
  }
  .toc-m ol ol a { font-size: 14.5px; color: var(--ink-3); }
  .toc-m a[aria-current] { color: var(--blue); font-weight: 600; }
  .toc-m a:active { background: rgba(53, 73, 242, 0.06); }

  /* docked: a floating pill in thumb reach, bottom right, clear of the home indicator */
  .toc-m.is-docked {
    position: fixed; z-index: 58;
    right: max(16px, calc(env(safe-area-inset-right) + 10px));
    bottom: calc(16px + env(safe-area-inset-bottom));
    max-width: min(78vw, 360px); border-radius: 999px;
    box-shadow: 0 16px 36px -14px rgba(22, 20, 43, 0.42), 0 2px 6px rgba(22, 20, 43, 0.08), inset 0 0 0 1px rgba(22, 20, 43, 0.06);
    animation: wu-dock 220ms var(--ease-out);
    transition: opacity 180ms ease, transform 220ms var(--ease-out), visibility 0s;
  }
  /* at the end of the article it steps aside for the footer */
  .toc-m.is-docked.is-away:not([open]) { opacity: 0; transform: translateY(14px); visibility: hidden; pointer-events: none; transition: opacity 160ms ease, transform 200ms var(--ease-out), visibility 0s 200ms; }
  .toc-m.is-docked summary { min-height: 48px; padding: 0 14px 0 18px; border-radius: 999px; font-size: 14.5px; }
  .toc-m.is-docked .toc-m-now {
    display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-weight: 500; color: var(--ink-3); padding-left: 10px; border-left: 1px solid var(--line);
  }
  .toc-m.is-docked summary svg { transform: rotate(180deg); }
  /* open while docked: a bottom sheet */
  .toc-m.is-docked[open] {
    left: max(12px, calc(env(safe-area-inset-left) + 8px)); right: max(12px, calc(env(safe-area-inset-right) + 8px));
    max-width: none; border-radius: 24px;
  }
  .toc-m.is-docked[open] summary { border-radius: 24px 24px 0 0; min-height: 56px; }
  .toc-m.is-docked[open] .toc-m-now { display: none; }
  .toc-m.is-docked[open] summary svg { transform: none; }
  .toc-m.is-docked[open] nav {
    max-height: min(calc(var(--vh) * 0.62), 560px); overflow-y: auto; overscroll-behavior: contain;
    padding-bottom: 14px; animation: wu-sheet 240ms var(--ease-out);
    -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent); mask-image: linear-gradient(#000 calc(100% - 28px), transparent);
  }
  .toc-scrim {
    display: block; position: fixed; inset: 0; z-index: 57; background: rgba(22, 20, 43, 0.26);
    opacity: 0; visibility: hidden; transition: opacity 200ms ease, visibility 0s 200ms;
  }
  .toc-scrim.is-on { opacity: 1; visibility: visible; transition: opacity 200ms ease; }
  .art-body { grid-column: 1; grid-row: 3; margin-top: clamp(40px, 6vh, 56px); }
  .art-end { grid-column: 1; grid-row: 4; }
  .art { --over-h: 0px; --over-t: 0px; }
  .art-body .cause h3 { margin-left: 0; }

  .entry, .notes-next { grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); }
}

/* ======================================================================
   PHONE (390)
   ====================================================================== */
@media (max-width: 700px) {
  .art { font-size: 17px; }
  .art-title { font-size: clamp(1.9rem, 8.4vw, 2.6rem); line-height: 1.04; }
  .art-title-sub { font-size: 0.62em; }
  .art-byline { font-size: 16.5px; }
  .art-body { font-size: 17.5px; line-height: 1.62; overflow-wrap: break-word; }
  .art-body > * + * { margin-top: 1.15em; }
  .art-body .art-lede { font-size: 19px; }
  .art-body h2 { margin-top: 2.4em; padding-top: 1.15em; font-size: 1.62rem; }
  .art-body .cause h3 { grid-template-columns: 34px minmax(0, 1fr); column-gap: 14px; font-size: 1.16rem; }
  .hyp-n { width: 34px; height: 34px; font-size: 15px; margin-top: -0.15em; }
  .scope { --pad: 20px; margin-inline: 0; border-radius: 22px; }
  .scope p { font-size: 16.5px; }
  .outro { grid-template-columns: 1fr; gap: 14px; padding: 22px 20px 24px; }
  .outro-mark { width: 40px; height: 40px; }
  .art-body code { white-space: normal; overflow-wrap: anywhere; }
  .outro p { overflow-wrap: break-word; }

  /* the table becomes one block per event */
  .tbl { border-radius: 18px; }
  .tbl table, .tbl thead, .tbl tbody, .tbl tr, .tbl th, .tbl td { display: block; width: auto; }
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tbl tbody tr { padding: 16px 18px 18px; }
  .tbl tbody tr + tr { border-top: 1px solid var(--line); }
  .tbl tbody tr + tr > * { border-top: 0; }
  .tbl th, .tbl td { padding: 0; }
  .tbl tbody th { font-size: 16px; margin-bottom: 8px; }
  .tbl td { font-size: 15.5px; }
  .tbl td + td { margin-top: 6px; }
  .tbl td::before { content: attr(data-label); display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-3); margin-bottom: 1px; }
  .tbl td.dir { white-space: normal; color: var(--ink-2); }
  .tbl tbody th, .tbl td.dir { width: auto; }

  .eng-head { min-height: clamp(420px, 54vh, 480px); padding-bottom: 44px; }
  .eng-intro { font-size: 18px; }
  .entry { grid-template-columns: minmax(0, 1fr); row-gap: 18px; padding-top: 32px; }
  .entry-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
  .entry-meta::before { top: 3px; }
  .entry-title { font-size: clamp(1.9rem, 8.2vw, 2.4rem); line-height: 1.04; }
  .entry-sum { font-size: 17px; }
  .entry-cta { min-height: 50px; font-size: 15.5px; }
  .notes::before { display: none; }   /* single column: the nodes stay, the rail would cross the type */
  .notes-next { grid-template-columns: minmax(0, 1fr); margin-top: 56px; padding-left: 30px; }
  .notes-next p { grid-column: 1; font-size: 17px; }
  .notes-next::before { top: 0.3em; }
}

/* touch: no grey tap flash on the custom controls (each has its own :active), 44px targets,
   and content kept clear of the notch in landscape */
.entry, .back, .toc-nodes a, .toc-list a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
@media (pointer: coarse) {
  .back { min-height: 44px; }
}
.art, .notes, .eng-head {
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* Russian on phones: long words in a ~40-character line; body text only, headings keep manual breaks */
@media (max-width: 700px) {
  :lang(ru) .art-body p, :lang(ru) .art-body li, :lang(ru) .tbl td, :lang(ru) .entry-sum, :lang(ru) .eng-intro { -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 8 4 3; }
  /* Unbounded's Cyrillic is wider than its Latin: one step down for the long display lines */
  :lang(ru) .art-title { font-size: clamp(1.65rem, 7.3vw, 2.25rem); }
  :lang(ru) .art-title-sub { font-size: 0.66em; }
  :lang(ru) .entry-title { font-size: clamp(1.7rem, 7.4vw, 2.15rem); }
  :lang(ru) .art-body .cause h3 { font-size: 1.04rem; }
  :lang(ru) .art-body h2 { font-size: 1.45rem; }
}

@media (prefers-reduced-motion: reduce) {
  .js .eng-title, .js .eng-intro, .js .art-title-main, .js .art-title-sub, .js .art-byline, .js .art-meta, .js .art-head .back { animation: none; }
  .eng-gl { transition: none; }
  .toc-dot, .entry-cta, .entry-cta svg, .back, .back svg, .toc-m summary svg, .toc-scrim { transition: none; }
  .toc-m.is-docked, .toc-m.is-docked[open] nav { animation: none; transition: none; }
  .entry:active .entry-cta, .back:active { transform: none; }
}
