/* Korea Kontext: Judgment Ribbon.
   Flexoki palette (https://stephango.com/flexoki). One red, used only for the
   thread, its knots and flags, focus and selection. */

:root {
  --paper: #FFFCF0;
  --paper-2: #F2F0E5;   /* base-50 */
  --rule: #DAD8CE;      /* base-150 */
  --rule-strong: #878580; /* base-500, form edges (3.5:1) */
  --ink: #100F0F;
  --ink-2: #403E3C;     /* base-800 */
  --muted: #6F6E69;     /* base-600 (5:1 on paper) */
  --red: #AF3029;       /* red-600 */
  --red-text: #AF3029;  /* red for small text */
  --red-wash: rgb(175 48 41 / 0.14);
  --scroll-cue: rgb(16 15 15 / 0.18);

  --font-frame: "Hahmlet", "Apple SD Gothic Neo", "Noto Serif KR", Georgia, serif;
  --font-read: "Source Serif 4", "Hahmlet", Georgia, "Noto Serif KR", serif;

  --rail: 16.5rem;
  --gap: 4rem;
  --line-inset: 1.25rem;   /* the thread's distance from the rail's right edge */
  --line-w: 3px;
  --col: 42.5rem;          /* 680px reading column */
  --page-pad: clamp(1rem, 4vw, 3rem);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #100F0F;
  --paper-2: #1C1B1A;   /* base-950 */
  --rule: #343331;      /* base-850 */
  --rule-strong: #6F6E69; /* base-600 (3.7:1 on black) */
  --ink: #CECDC3;       /* base-200 */
  --ink-2: #B7B5AC;     /* base-300 */
  --muted: #878580;     /* base-500 (5.2:1) */
  --red: #D14D41;       /* red-400 */
  --red-text: #E8705F;  /* red-300, small text on black (5.8:1) */
  --red-wash: rgb(209 77 65 / 0.22);
  --scroll-cue: rgb(206 205 195 / 0.2);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #100F0F;
    --paper-2: #1C1B1A;
    --rule: #343331;
    --rule-strong: #6F6E69;
    --ink: #CECDC3;
    --ink-2: #B7B5AC;
    --muted: #878580;
    --red: #D14D41;
    --red-text: #E8705F;
    --red-wash: rgb(209 77 65 / 0.22);
    --scroll-cue: rgb(206 205 195 / 0.2);
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--rule-strong) var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-read);
  font-size: 1.125rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

@media (min-width: 64rem) {
  body { font-size: 1.25rem; }
}

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

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-color: var(--red-text); text-decoration-thickness: 2px; }

img, svg, video, iframe { max-width: 100%; }
img { height: auto; }

.skip-link {
  position: absolute;
  left: var(--page-pad);
  top: -4rem;
  z-index: 2;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-frame);
}
.skip-link:focus { top: 0.5rem; }

main:focus { outline: none; }

/* ---------- Masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-frame);
}
.masthead__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  max-width: calc(var(--rail) + var(--gap) + var(--col) + 2 * var(--page-pad) + 14rem);
  margin: 0 auto;
  padding: 0.85rem var(--page-pad);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
  line-height: 1;
}
.wordmark__flag { width: 0.75rem; height: 1.2rem; fill: var(--red); flex: none; }
.wordmark { order: 1; }
.masthead__nav { order: 2; margin-left: auto; }
.masthead__search { order: 3; }
.masthead__nav ul {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.masthead__nav a,
.masthead__search {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.masthead__nav a,
.masthead__search,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: none;
  color: var(--ink);
}
.masthead__nav a:hover,
.masthead__search:hover { text-decoration: underline; text-decoration-color: var(--red-text); }
.masthead__nav a[aria-current="page"],
.masthead__search[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--red-text);
  text-decoration-thickness: 2px;
}
.theme-toggle {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); }

@media (max-width: 52rem) {
  .masthead__inner { padding-block: 0.6rem 0; }
  .masthead__search { order: 2; margin-left: auto; }
  .masthead__nav { order: 3; flex-basis: 100%; margin-left: 0; }
  .masthead__nav ul { gap: 0 1.1rem; }
}
@media (max-width: 25rem) {
  .masthead__nav ul { flex-wrap: wrap; gap: 0 0.6rem; }   /* one row at 360px and up; wraps rather than clips below */
  .masthead__nav a, .masthead__search { font-size: 0.6875rem; letter-spacing: 0.03em; }
}

/* ---------- Article grid ---------- */

.article {
  display: grid;
  grid-template-columns: var(--rail) var(--col);
  column-gap: var(--gap);
  justify-content: center;
  padding: clamp(2rem, 5vw, 3.5rem) var(--page-pad) 0;
  /* rows: header, body, end of the piece, after */
  grid-template-rows: auto auto auto auto;
}
.article__header { grid-column: 2; grid-row: 1; }
.article__body   { grid-column: 2; grid-row: 2; min-width: 0; }
.article__after  { grid-column: 2; grid-row: 4; }
.thread          { grid-column: 1; grid-row: 1 / 3; align-self: start; }
.thread--after   { grid-column: 1; grid-row: 3 / 5; }
.thread__line    { grid-column: 1; grid-row: 1 / 3; }

.article--page .article__header,
.article--page .article__body { grid-column: 2; }

/* ---------- Header ---------- */

.page__title {
  margin: 0;
  font-family: var(--font-frame);
  font-size: clamp(2rem, 1.35rem + 2.2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.byline {
  margin: 1rem 0 0;
  font-family: var(--font-frame);
  font-size: 1rem;
  font-weight: 600;
}
.byline a { text-decoration: none; }
.byline a:hover { text-decoration: underline; text-decoration-color: var(--red-text); }
.page__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  margin: 0.15rem 0 0;
  font-family: var(--font-frame);
  font-size: 0.9375rem;
  color: var(--muted);
}
.page__meta-sep { display: none; }

/* ---------- Thread rail ---------- */

.thread {
  position: relative;
  z-index: 1;
  font-family: var(--font-frame);
  text-align: right;
  padding-right: calc(var(--line-inset) + 1.25rem);
}
.thread__name,
.thread__label {
  margin: 0 0 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
}
.thread__key { margin: -0.95rem 0 1.25rem; font-size: 0.8125rem; color: var(--muted); }
.knots { margin: 0; padding: 0; list-style: none; }
.knot { position: relative; display: block; margin: 0 0 1.4rem; }
.knot a { display: block; text-decoration: none; }
.knot a:hover .knot__title { text-decoration: underline; text-decoration-color: var(--red-text); }
.knot__date {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.knot__title {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.9375rem;
  line-height: 1.35;
  color: var(--ink);
  text-wrap: pretty;
}
/* The knot itself: an open ring on the line. */
.knot::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  right: calc(-1 * (var(--line-inset) + 1.25rem) + var(--line-inset) - 0.5rem + var(--line-w) / 2);
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--paper);
  border: var(--line-w) solid var(--red);
}
.knot--current { margin-bottom: 0; }
.knot--current .knot__title { font-weight: 700; font-size: 1rem; }
.knot--current::after { background: var(--red); width: 1.25rem; height: 1.25rem; right: calc(-1 * (var(--line-inset) + 1.25rem) + var(--line-inset) - 0.625rem + var(--line-w) / 2); }

.knots__more { margin: 0 0 1.4rem; }
.knots__more summary {
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--muted);
  list-style: none;
}
.knots__more summary::-webkit-details-marker { display: none; }
.knots__more { position: relative; }
.knots__more summary { text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 0.2em; }
/* The folded readings: a dashed ring on the line, solid once opened. */
.knots__more::after {
  content: "";
  position: absolute;
  top: 0.1rem;
  right: calc(var(--line-w) / 2 - 0.5rem - 1.25rem);
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--paper);
  border: var(--line-w) dashed var(--red);
}
.knots__more:has(details[open])::after { border-style: solid; }
.knots__more details[open] .knots { margin-top: 1.25rem; }
.knots__more summary:hover { color: var(--ink); }

.sections {
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  line-height: 1.35;
}
.sections li { margin: 0 0 0.5rem; }
.sections a { text-decoration: none; color: var(--ink-2); }
.sections a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--red-text); }

/* The red line itself, running from the rail's top to the end of the piece. */
.thread__line {
  position: relative;
  pointer-events: none;
}
.thread__line::before {
  content: "";
  position: absolute;
  top: 2.4rem;
  bottom: 0;
  right: var(--line-inset);
  width: var(--line-w);
  background: var(--red);
}
.article:not(.article--threaded) .thread__line::before { top: 0.6rem; }

/* After the piece: an end knot, later readings, then the dashed continuation. */
.thread--after { padding-top: 0; }
.thread--after::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 2.25rem;
  right: var(--line-inset);
  width: var(--line-w);
  background: var(--red);
}
.thread--after:not(:has(.knots))::before { display: none; }
@media (min-width: 64rem) { .thread--after:not(:has(.knots--later))::before { display: none; } }
.knot--end {
  position: absolute;
  top: -0.5rem;
  right: calc(var(--line-inset) - 0.5rem + var(--line-w) / 2);
  width: 1rem;
  height: 1rem;
  margin: 0;
  border-radius: 50%;
  background: var(--red);
}
.knot--end::after { display: none; }
.thread--after .thread__label { margin-top: 2.25rem; }
.thread__continues {
  position: relative;
  margin: 0.25rem 0 0;
  padding-top: 2.75rem;
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--muted);
}
.thread__continues::before {
  content: "";
  position: absolute;
  top: 0.25rem;
  right: calc(-1 * (var(--line-inset) + 1.25rem) + var(--line-inset));
  height: 2.25rem;
  width: 0;
  border-left: var(--line-w) dashed var(--red);
}
.thread--after:not(:has(.knots--later)) .thread__continues { padding-top: 2.75rem; }

.thread__summary,
.thread__recap { display: none; }

/* ---------- Body ---------- */

.page__content > .notice:first-child {
  position: relative;
  margin: 2rem 0 0;
  padding: 1.1rem 1.35rem 1.2rem;
  background: var(--paper-2);
  border: 0;
  font-size: 1.0625rem;
  line-height: 1.55;
}
@media (min-width: 64rem) { .page__content > .notice:first-child { font-size: 1.125rem; } }
.page__content > .notice:first-child p { margin: 0; }
.page__content > .notice:first-child strong:first-child {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--font-frame);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
}
/* The tie from the thread to the notice. */
.article:not(.article--page) .page__content > .notice:first-child::before {
  content: "";
  position: absolute;
  top: 1.45rem;
  left: calc(-1 * (var(--gap) + var(--line-inset) + var(--line-w)));
  width: calc(var(--gap) + var(--line-inset) + var(--line-w));
  height: var(--line-w);
  background: var(--red);
}

/* The body is one flex column so the notice (inside the content, where the
   email generator expects it) can sit before the illustration. */
.article__body { display: flex; flex-direction: column; }
.page__content { display: contents; }
.page__content > * { order: 3; }
.page__content > .notice:first-child { order: 1; }
.page__hero { order: 2; margin: 2rem 0 1.75rem; }
.page__hero img { display: block; width: 100%; background: var(--paper-2); }
.article__body:not(:has(.page__hero)) .page__content > .notice:first-child { margin-bottom: 1.75rem; }
.article--page .page__content > :first-child { margin-top: 1.75rem; }
.page__content p,
.page__content ul,
.page__content ol { margin: 0 0 1.1em; }
.page__content li { margin-bottom: 0.35em; }
.page__content h2,
.page__content h3,
.page__content h4 {
  font-family: var(--font-frame);
  line-height: 1.25;
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.page__content h2 {
  position: relative;
  margin: 1.4em 0 0.7em;
  font-size: 1.5rem;
  font-weight: 700;
}
.page__content h3 { margin: 1.1em 0 0.5em; font-size: 1.2rem; font-weight: 700; }
.page__content h4 { margin: 0.9em 0 0.4em; font-size: 1.05rem; font-weight: 700; }

/* Bookmark flags: each section heading is marked on the thread. */
.article--threaded .page__content h2::before,
.article:not(.article--page) .page__content h2::before {
  content: "";
  position: absolute;
  top: 0.2em;
  left: calc(-1 * (var(--gap) + var(--line-inset)) - 0.4rem - var(--line-w) / 2);
  width: 0.8rem;
  height: 1.15rem;
  background: var(--red);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
}

/* Crosshead permalinks: a small bookmark flag after the heading, shown on
   hover or focus with a pointer, always visible (quietly) on touch screens. */
.heading-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-left: 0.2rem;
  vertical-align: middle;
  color: var(--muted);
  text-decoration: none;
  opacity: 0;
}
.heading-link svg { width: 0.55rem; height: 0.85rem; fill: currentColor; }
.page__content :is(h2, h3, h4):hover .heading-link,
.heading-link:focus-visible { opacity: 1; }
.heading-link:hover { color: var(--red); }
@media (hover: none) { .heading-link { opacity: 0.55; } }
@media (prefers-reduced-motion: no-preference) { .heading-link { transition: opacity 150ms ease-out; } }

.page__content sub[lang="ko"],
.page__content sub {
  margin-left: 0.15em;
  font-family: var(--font-frame);
  font-size: 0.68em;
  vertical-align: baseline;
  color: var(--muted);
}

.page__content blockquote:not(.notice) {
  margin: 1.5em 0;
  padding: 0 0 0 1.25rem;
  border-left: 1px solid var(--rule-strong);
  color: var(--ink-2);
}
.page__content figure { margin: 2em 0; }
.page__content figcaption,
.page__content .caption {
  margin-top: 0.5rem;
  font-family: var(--font-frame);
  font-size: 0.875rem;
  color: var(--muted);
}
.page__content img { display: block; margin: 1.5em auto; }
.page__content iframe { display: block; margin: 1.5em auto; border: 0; }
.page__content hr { margin: 2.5em 0; border: 0; border-top: 1px solid var(--rule); }
.page__content del { color: var(--muted); }

.page__content table {
  width: 100%;
  margin: 1.75em 0;
  border-collapse: collapse;
  font-family: var(--font-frame);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.page__content th,
.page__content td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.page__content th { border-bottom-color: var(--ink); font-weight: 700; }
.page__content td:first-child { white-space: nowrap; }
.page__content > .table-scroll { order: 3; margin: 1.75em 0; }
.table-scroll > table { margin: 0; }
.page__content td[style*="right"], .page__content th[style*="right"] { text-align: right; }

.page__content .footnotes { margin-top: 3rem; font-size: 0.875em; color: var(--ink-2); }
.page__content .footnotes ol { padding-left: 1.25rem; }

/* The mid-article subscribe form, framed (see _pages/newsletter-signup.html). */
.email-signup-inline { margin: 2em 0 2.2em; }
.email-signup-inline iframe { display: block; width: 100%; margin: 0; border: 0; }
.signup.signup--inline {
  padding: 1.25rem 0 1.35rem;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}
.signup.signup--inline .signup__title { font-size: 1.125rem; }
.signup.signup--inline .signup__text { margin-bottom: 0.9rem; font-size: 0.9375rem; }

/* ---------- End of piece ---------- */

.article__after { padding-top: 2.5rem; }
.also-on {
  margin: 0 0 2.5rem;
  font-family: var(--font-frame);
  font-size: 0.9375rem;
  color: var(--muted);
}
.also-on__thread { color: var(--ink); font-weight: 600; }

/* ---------- Signup ---------- */

.signup {
  padding: 1.75rem 0 0;
  border-top: 2px solid var(--ink);
  font-family: var(--font-frame);
}
.signup__title { margin: 0; font-size: 1.25rem; font-weight: 700; line-height: 1.3; }
.signup__text { margin: 0.3rem 0 1.1rem; font-size: 1rem; color: var(--ink-2); }

.signup [data-form] .inline-container,
.signup [data-form] .form-container,
.signup [data-form] .emailoctopus-form-wrapper,
.signup [data-form] .emailoctopus-form,
.signup [data-form] .main-form,
.signup [data-form] [eo-form-fields-container] { width: 100%; }
.signup [data-form] .form-container,
.signup [data-form] .emailoctopus-form-wrapper,
.signup [data-form] .emailoctopus-form {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
.signup [data-form] .main-form {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-end;
  justify-content: flex-start !important;
  gap: 0.75rem;
}
.signup [data-form] [eo-form-fields-container] { flex: 1 1 16rem; min-width: 0; }
.signup [data-form] .emailoctopus-form-row { margin: 0 !important; padding: 0 !important; min-width: 0 !important; }
.signup [data-form] .form-control {
  display: block !important;
  width: 100% !important;
  height: 2.75rem !important;
  margin: 0 !important;
  padding: 0.5rem 0.75rem !important;
  color: var(--ink) !important;
  font-family: var(--font-frame) !important;
  font-size: 1rem !important;
  background: var(--paper) !important;
  border: 1px solid var(--rule-strong) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.signup [data-form] .form-control::placeholder { color: var(--muted); opacity: 1; }
.signup [data-form] .form-control:focus { border-color: var(--ink) !important; outline: 2px solid var(--red); outline-offset: 2px; }
.signup [data-form] input[type="submit"] {
  flex: 0 0 auto !important;
  width: auto !important;
  height: 2.75rem !important;
  margin: 0 !important;
  padding: 0 1.25rem !important;
  color: var(--paper) !important;
  font-family: var(--font-frame) !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  background: var(--ink) !important;
  border: 1px solid var(--ink) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
}
.signup [data-form] input[type="submit"]:hover { background: var(--red) !important; border-color: var(--red) !important; }
.signup [data-form] .emailoctopus-success-message,
.signup [data-form] .emailoctopus-error-message {
  margin: 0.75rem 0 0;
  font-family: var(--font-frame);
  font-size: 0.9375rem;
  color: var(--ink);
}
.signup [data-form] .emailoctopus-error-message { color: var(--red-text); }
/* EmailOctopus's "Powered by" line: keep it, but at a readable size and contrast. */
.signup [data-form] .mastfoot,
.signup [data-form] .mastfoot .inner,
.signup [data-form] .mastfoot p { margin-top: 0.6rem !important; text-align: left !important; justify-content: flex-start !important; }
.signup [data-form] .mastfoot p,
.signup [data-form] .mastfoot a {
  margin: 0 !important;
  font-family: var(--font-frame) !important;
  font-size: 0.75rem !important;
  color: var(--muted) !important;
  opacity: 1 !important;
}
.signup [data-form] .mastfoot img { display: none !important; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: clamp(3.5rem, 8vw, 6rem);
  padding: 0 var(--page-pad) 2.5rem;
  font-family: var(--font-frame);
}
.site-footer__inner {
  display: grid;
  grid-template-columns: var(--rail) var(--col);
  column-gap: var(--gap);
  justify-content: center;
}
.site-footer__inner > * { grid-column: 2; }
.site-footer .signup { margin-bottom: 3rem; }
.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.site-footer__nav a { text-decoration: none; min-height: 2.75rem; display: inline-flex; align-items: center; }
.site-footer__nav a:hover { text-decoration: underline; text-decoration-color: var(--red-text); }
.site-footer__mark { font-weight: 800; margin-right: auto; }
.site-footer__copy { margin: 0.25rem 0 0; font-size: 0.8125rem; color: var(--muted); }

/* ---------- Narrow screens: the thread unrolls above the title ---------- */

@media (max-width: 63.99rem) {
  :root { --gap: 0rem; }
  .article,
  .site-footer__inner {
    grid-template-columns: minmax(0, var(--col));
    grid-template-rows: none;
  }
  .article > *,
  .site-footer__inner > * { grid-column: 1 !important; grid-row: auto !important; }
  .thread__line { display: none; }

  .thread {
    order: -1;
    margin-bottom: 1.75rem;
    padding: 0 0 0 1.75rem;
    text-align: left;
  }
  .thread::before {
    content: "";
    position: absolute;
    left: 0.4rem;
    top: 1.9rem;
    bottom: 0.4rem;
    width: var(--line-w);
    background: var(--red);
  }
  .thread__name { margin-bottom: 0.2rem; }
  .thread:not(.thread--after) { padding-left: 0; margin-bottom: 1.25rem; }
  .thread:not(.thread--after)::before,
  .thread:not(.thread--after) .knots,
  .thread:not(.thread--after) > .knot--current { display: none; }
  .thread:not(.thread--after) .thread__name,
  .thread:not(.thread--after) .thread__key { display: none; }
  .thread__summary {
    position: relative;
    display: block;
    margin: 0;
    padding-left: 1.75rem;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--muted);
  }
  .thread__summary::before {   /* a short length of the thread */
    content: "";
    position: absolute;
    left: 0.4rem;
    top: -0.35rem;
    bottom: -0.35rem;
    width: var(--line-w);
    background: var(--red);
  }
  .thread__summary::after {    /* with an open knot */
    content: "";
    position: absolute;
    left: calc(0.4rem + var(--line-w) / 2 - 0.45rem);
    top: 0.2rem;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    border: var(--line-w) solid var(--red);
    background: var(--paper);
    box-sizing: border-box;
  }
  .thread__summary a { color: var(--ink); font-weight: 600; }
  .thread__recap { display: block; }
  .thread__recap .thread__label { margin: 1.5rem 0 1rem; }
  .thread--after:has(.thread__recap)::before { top: 3.4rem; }
  .thread--after:has(.thread__recap) .knot--end { display: none; }
  .knot { margin-bottom: 0.9rem; }
  .knot::after,
  .knot--current::after {
    right: auto;
    left: calc(-1.75rem + 0.4rem + var(--line-w) / 2 - 0.5rem);
  }
  .knot--current::after { left: calc(-1.75rem + 0.4rem + var(--line-w) / 2 - 0.625rem); }
  .knot__title { font-size: 0.9375rem; }
  .sections { display: none; }

  .page__content > .notice:first-child::before,
  .page__content h2::before { display: none; }

  .article__header { order: 0; }
  .article__body { order: 1; }
  .thread--after {
    order: 3;
    margin-top: 1.5rem;
    padding: 0 0 0 1.75rem;
    text-align: left;
  }
  .thread--after::before { right: auto; left: 0.4rem; bottom: 2.6rem; }
  .knot--end { right: auto; left: calc(0.4rem + var(--line-w) / 2 - 0.5rem); top: 0; }
  .thread--after .thread__label { margin-top: 1.5rem; }
  .thread__continues::before { right: auto; left: calc(-1.75rem + 0.4rem); }
  .article__after { order: 4; }
  /* Wide tables scroll inside the column; edge shadows show there is more. */
  .table-scroll {
    overflow-x: auto;
    background:
      linear-gradient(to right, var(--paper) 30%, transparent) left / 2rem 100% no-repeat local,
      linear-gradient(to left, var(--paper) 30%, transparent) right / 2rem 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, var(--scroll-cue), transparent) left / 0.75rem 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, var(--scroll-cue), transparent) right / 0.75rem 100% no-repeat scroll;
  }
  .table-scroll table { min-width: 36rem; margin: 0; }
  .page__content table:not(.table-scroll table) { display: block; max-width: 100%; overflow-x: auto; }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .knot--current::after {
    animation: knot-settle 600ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  @keyframes knot-settle {
    from { transform: scale(0.4); }
    to { transform: scale(1); }
  }
  html { scroll-behavior: smooth; }
}

/* ---------- Search page ---------- */

.search-form { margin: 1.5rem 0 0; font-family: var(--font-frame); }
.search-form label { display: block; margin-bottom: 0.4rem; font-weight: 700; font-size: 0.9375rem; }
.search-form input {
  width: 100%;
  height: 3rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1.125rem;
}
.search-form input:focus { border-color: var(--ink); outline: 2px solid var(--red); outline-offset: 2px; }
.results__found { margin: 1.25rem 0 0.5rem; font-family: var(--font-frame); font-size: 0.9375rem; color: var(--muted); }
#results .archive__item { padding: 1rem 0; border-bottom: 1px solid var(--rule); }
#results .archive__item-title { margin: 0; font-family: var(--font-frame); font-size: 1.125rem; font-weight: 700; line-height: 1.3; }
#results .archive__item-title a { text-decoration: none; }
#results .archive__item-title a:hover { text-decoration: underline; text-decoration-color: var(--red-text); }
#results .archive__item-date { margin: 0.2rem 0 0; font-family: var(--font-frame); font-size: 0.8125rem; color: var(--muted); }
#results .archive__item-excerpt { margin: 0.35rem 0 0; font-size: 1rem; color: var(--ink-2); }

/* ---------- Approval tracker embeds ---------- */

.presidential-approval-embed { display: block; margin: 2rem 0; }
.presidential-approval-embed__interactive iframe { display: block; width: 100%; margin: 0; border: 0; }
.presidential-approval-embed__fallback { display: none; }

/* ---------- Thread name link ---------- */

.thread__name a { color: inherit; text-decoration: none; }
.thread__name a:hover { text-decoration: underline; text-decoration-color: currentColor; }

/* ---------- Front page: the site's own thread ---------- */

.front,
.archive {
  display: grid;
  grid-template-columns: var(--rail) var(--col);
  column-gap: var(--gap);
  justify-content: center;
  padding: clamp(2rem, 5vw, 3.5rem) var(--page-pad) 0;
}
.front > *,
.archive > * { grid-column: 2; min-width: 0; }

.front__statement {
  margin: 0;
  font-family: var(--font-frame);
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.15rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.front__statement--small { font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem); }
.front__standfirst { margin: 0.6rem 0 0; font-family: var(--font-frame); font-size: 1rem; color: var(--ink-2); }
.front__intro .signup { margin-top: 2rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.front__readings { margin-top: 3.5rem; }
.front__heading {
  margin: 4rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--ink);
  font-family: var(--font-frame);
  font-size: 1.375rem;
  font-weight: 700;
}

.readings { margin: 0; padding: 0; list-style: none; grid-column: 1 / -1; }
.front__readings { grid-column: 1 / -1; }

.reading {
  position: relative;
  display: grid;
  grid-template-columns: var(--rail) var(--col);
  column-gap: var(--gap);
  justify-content: center;
  padding-bottom: 2.75rem;
}
.reading::before {   /* the line, running through every reading */
  content: "";
  position: absolute;
  top: 0.55rem;
  bottom: -0.55rem;
  left: calc(50% - (var(--rail) + var(--gap) + var(--col)) / 2 + var(--rail) - var(--line-inset) - var(--line-w));
  width: var(--line-w);
  background: var(--red);
}
.reading:last-child::before { bottom: 2.25rem; }
.reading:last-child::after {
  content: "";
  position: absolute;
  bottom: 0;
  height: 2.25rem;
  left: calc(50% - (var(--rail) + var(--gap) + var(--col)) / 2 + var(--rail) - var(--line-inset) - var(--line-w));
  border-left: var(--line-w) dashed var(--red);
}
.reading__date {
  position: relative;
  padding-right: calc(var(--line-inset) + 1.25rem);
  text-align: right;
  font-family: var(--font-frame);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.6;
}
.reading__date::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  right: calc(var(--line-inset) + var(--line-w) / 2 - 0.5rem);
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--paper);
  border: var(--line-w) solid var(--red);
  box-sizing: border-box;
}
.reading--lead .reading__date::after { background: var(--red); }
.reading__body { min-width: 0; }
.reading__title {
  margin: 0;
  font-family: var(--font-frame);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.25;
  text-wrap: balance;
}
.reading--lead .reading__title { font-size: clamp(1.7rem, 1.25rem + 1.5vw, 2.25rem); line-height: 1.15; letter-spacing: -0.012em; }
.reading__title a { text-decoration: none; }
.reading__title a:hover { text-decoration: underline; text-decoration-color: var(--red-text); text-decoration-thickness: 2px; }
.reading__thread { margin: 0.35rem 0 0; font-family: var(--font-frame); font-size: 0.875rem; color: var(--muted); }
.reading__thread a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.reading__thread a:hover { text-decoration: underline; text-decoration-color: var(--red-text); }
.reading__excerpt { max-width: 36rem; margin: 0.6rem 0 0; font-size: 1rem; line-height: 1.55; color: var(--ink-2); }
.reading--lead .reading__excerpt { max-width: 38rem; font-size: 1.125rem; color: var(--ink); }
.reading__image { display: block; margin-top: 1.25rem; }
.reading__image img {
  display: block;
  width: 100%;
  background: var(--paper-2);
  filter: grayscale(1) contrast(1.02);
}
@media (prefers-reduced-motion: no-preference) {
  .reading__image img { transition: filter 450ms cubic-bezier(0.16, 1, 0.3, 1); }
}
.reading--lead:hover .reading__image img,
.reading--lead:focus-within .reading__image img { filter: none; }

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
  padding-top: 0.5rem;
  font-family: var(--font-frame);
  font-size: 1rem;
  font-weight: 600;
}
.pager a { display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; }
.pager a:hover { text-decoration: underline; text-decoration-color: var(--red-text); }
.pager__archive { margin-left: auto; color: var(--ink-2); }

.front__threads-intro { margin: 0 0 0.5rem; font-family: var(--font-frame); font-size: 0.9375rem; color: var(--muted); }
.thread-list { margin: 0; padding: 0; list-style: none; font-family: var(--font-frame); }
.thread-list__item { display: grid; gap: 0.15rem; padding: 0.9rem 0; border-top: 1px solid var(--rule); }
.thread-list__name { font-size: 1.125rem; font-weight: 700; text-decoration: none; }
.thread-list__name:hover { text-decoration: underline; text-decoration-color: var(--red-text); }
.thread-list__meta { font-size: 0.8125rem; color: var(--muted); }
.thread-list__latest { font-size: 0.9375rem; color: var(--ink-2); }
.thread-list__latest a { color: var(--ink); }
.front > .signup { margin-top: 3rem; }

/* ---------- Archive ---------- */

.archive__standfirst { margin: 0.6rem 0 0; font-family: var(--font-frame); color: var(--ink-2); }
.archive__jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin-top: 1.25rem;
  font-family: var(--font-frame);
  font-size: 0.9375rem;
  font-weight: 600;
}
.archive__jump a { display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; }
.archive__jump a:hover { text-decoration: underline; text-decoration-color: var(--red-text); }
.archive__section { margin-top: 3rem; scroll-margin-top: 1rem; }
.archive__heading {
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--ink);
  font-family: var(--font-frame);
  font-size: 1.375rem;
  font-weight: 700;
}
.archive-list { margin: 0; padding: 0; list-style: none; }
.archive-list__item {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 1rem;
  line-height: 1.4;
}
.archive-list__item time { font-family: var(--font-frame); font-size: 0.8125rem; color: var(--muted); padding-top: 0.15rem; font-variant-numeric: tabular-nums; }
.archive-list__item a { text-decoration: none; }
.archive-list__item a:hover { text-decoration: underline; text-decoration-color: var(--red-text); }

.archive-thread { border-bottom: 1px solid var(--rule); scroll-margin-top: 1rem; }
.archive-thread summary {
  display: grid;
  gap: 0.1rem;
  padding: 0.85rem 2rem 0.85rem 0;
  position: relative;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-frame);
}
.archive-thread summary::-webkit-details-marker { display: none; }
.archive-thread summary::after {
  content: "";
  position: absolute;
  right: 0.35rem;
  top: 1.05rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: var(--line-w) solid var(--red);
  background: var(--paper);
}
.archive-thread[open] summary::after { background: var(--red); }
.archive-thread__name { font-size: 1.125rem; font-weight: 700; }
.archive-thread summary:hover .archive-thread__name { text-decoration: underline; text-decoration-color: var(--red-text); }
.archive-thread__meta { font-size: 0.8125rem; color: var(--muted); }
.archive-thread__latest { font-size: 0.9375rem; color: var(--ink-2); }
.archive-thread__knots {
  position: relative;
  margin: 0.5rem 0 1.5rem;
  padding: 0 0 0 1.75rem;
  list-style: none;
  font-family: var(--font-frame);
}
.archive-thread__knots::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  top: 0.55rem;
  bottom: 1.6rem;
  width: var(--line-w);
  background: var(--red);
}
.archive-thread__knots .knot { margin-bottom: 0.9rem; }
.archive-thread__knots .knot::after { right: auto; left: calc(-1.75rem + 0.4rem + var(--line-w) / 2 - 0.5rem); }

/* ---------- Front page and archive on narrow screens ---------- */

@media (max-width: 63.99rem) {
  .front,
  .archive { grid-template-columns: minmax(0, var(--col)); }
  .front > *,
  .archive > *,
  .front__readings { grid-column: 1; }
  .reading {
    grid-template-columns: minmax(0, var(--col));
    padding: 0 0 2.25rem 1.75rem;
  }
  .reading::before,
  .reading:last-child::after { left: 0.4rem; }
  .reading__date { padding-right: 0; text-align: left; margin-bottom: 0.2rem; }
  .reading__date::after { right: auto; left: calc(-1.75rem + 0.4rem + var(--line-w) / 2 - 0.5rem); }
  .archive-list__item { grid-template-columns: 1fr; gap: 0.1rem; }
}

/* ---------- Approval tracker page ---------- */

.tracker {
  display: grid;
  grid-template-columns: var(--rail) var(--col);
  column-gap: var(--gap);
  justify-content: center;
  padding: clamp(2rem, 5vw, 3.5rem) var(--page-pad) 0;
}
.tracker__header { grid-column: 2; grid-row: 1; min-width: 0; }
.tracker__rail {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  padding-right: calc(var(--line-inset) + 1.25rem);
  font-family: var(--font-frame);
  text-align: right;
}
.tracker__charts { grid-column: 1 / -1; grid-row: 2; min-width: 0; margin-top: 2.5rem; }

.tracker-reading {
  margin: 1.25rem 0 0;
  font-family: var(--font-read);
  font-size: 1.25rem;
  line-height: 1.5;
  text-wrap: pretty;
}
.tracker__intro { margin: 1rem 0 0; font-size: 1.0625rem; color: var(--ink-2); }

.tracker__rail-title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.tracker__rail-key { margin: 0.2rem 0 1.25rem; font-size: 0.8125rem; color: var(--muted); }

/* The incumbent's recent readings: ink knots on an ink line (red stays for Korea Kontext marks). */
.tracker-readings { position: relative; margin: 0; padding: 0; list-style: none; }
.tracker-readings::before {
  content: "";
  position: absolute;
  top: 0.6rem;
  bottom: 0.6rem;
  right: calc(-1 * (var(--line-inset) + 1.25rem) + var(--line-inset));
  width: 2px;
  background: var(--ink-2);
}
.tracker-readings li {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
}
.tracker-readings li::after {
  content: "";
  position: absolute;
  top: 0.3rem;
  right: calc(1px - 0.4rem - 1.25rem);
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  border: 2px solid var(--ink-2);
  background: var(--paper);
}
.tracker-readings li.is-latest::after { background: var(--ink); border-color: var(--ink); }
.tracker-readings__date {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.tracker-readings__value { min-width: 2.6em; font-size: 1.0625rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tracker-readings li.is-latest .tracker-readings__value { font-size: 1.375rem; }

.tracker-language {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
  font-size: 0.875rem;
}
.tracker-language__label { width: 100%; color: var(--muted); }
.tracker-language button {
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.tracker-language button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tracker-language button:hover:not([aria-pressed="true"]) { border-color: var(--ink); }

.tracker__charts .presidential-approval-embed { margin: 0 0 3.5rem; }
.tracker-data {
  margin: 0 0 0 calc(var(--rail) + var(--gap));
  max-width: var(--col);
  font-family: var(--font-frame);
  font-size: 0.9375rem;
  color: var(--ink-2);
}

@media (max-width: 63.99rem) {
  .tracker { grid-template-columns: minmax(0, var(--col)); }
  .tracker > * { grid-column: 1 !important; grid-row: auto !important; }
  .tracker__rail { order: 1; padding-right: 0; text-align: left; }
  .tracker__rail-title, .tracker__rail-key, .tracker-readings { display: none; }
  .tracker-language { justify-content: flex-start; margin-top: 1.5rem; }
  .tracker-language__label { width: auto; margin-right: 0.25rem; }
  .tracker__charts { order: 2; margin-top: 2rem; }
  .tracker-data { margin-left: 0; }
}
