/* Arthur Yakymenko — personal site, v4
   Idea: the page is his declaration. A preamble and a few numbered articles,
   set like a founding document in black print; blue is reserved for his hand:
   links, the button, focus.

   Type: the high-contrast Libre Caslon Display is for titles only;
   sentences are set in the sturdier Libre Caslon Text; the interface in Schibsted Grotesk.

   Blocks stand on vertical lines of a 12-column grid:
   A = column 1 (margin), B = column 4 (text), C = column 7 (the hero's right hand). */

/* ---------- Tokens ---------- */

:root {
  color-scheme: light dark;

  --paper: #FBFBF8;
  --ink: #16181D;
  --ink-2: #545864;
  --ink-3: #8A8E98;
  --rule: #E3E3DD;
  --rule-strong: #CDCDC6;

  --blue: #2B36A9;          /* his hand: links, focus */
  --blue-deep: #1E2780;
  --blue-line: rgba(43, 54, 169, .32);
  --button: #2B36A9;
  --button-hover: #222C93;
  --on-button: #FFFFFF;

  --display: "Libre Caslon Display", "Libre Caslon Text", "Big Caslon", Georgia, serif;
  --serif: "Libre Caslon Text", "Big Caslon", Georgia, serif;
  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 72px);
  --col-gap: 24px;
  --head-h: 72px;
  --margin-w: 200px;        /* label column of the rows */
  --label-gap: 40px;        /* gutter after it: text starts 240px in (x 360 at 1440) */
  --measure: 780px;         /* longest line of row text */

  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 72px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F1114;
    --ink: #ECECE8;
    --ink-2: #A6AAB2;
    --ink-3: #737782;
    --rule: rgba(236, 236, 232, .10);
    --rule-strong: rgba(236, 236, 232, .22);

    --blue: #A9B1FF;
    --blue-deep: #C9CEFF;
    --blue-line: rgba(169, 177, 255, .38);
    --button: #4855D8;
    --button-hover: #5462E6;
    --on-button: #FFFFFF;
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--head-h) + 24px);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg { display: block; }

::selection { background: var(--blue); color: var(--paper); }

a { color: inherit; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
  border-radius: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
}

/* Skip link */
.skip {
  position: absolute;
  left: var(--gutter);
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  text-decoration: none;
  border-radius: 4px;
  transition: top .2s var(--ease);
}
.skip:focus-visible { top: 12px; }

/* Keycaps (only inside the Keys panel) */
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--rule-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  font: 500 12px/1 var(--sans);
  color: var(--ink-2);
  background: transparent;
}

.icon {
  display: inline-block;
  flex: none;
  width: .75em;
  height: .75em;
  vertical-align: baseline;
}

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

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);        /* fallback */
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.masthead.is-scrolled { border-bottom-color: var(--rule); }

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s5);
  height: var(--head-h);
}

.wordmark {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: -.005em;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
  padding: 6px 0;
  transition: opacity .45s var(--ease), transform .45s var(--ease), visibility 0s;
}

/* Home: the name is already on the page in full size.
   The small one arrives in the masthead only after the big one has left. */
.js [data-page="about"] .masthead:not(.show-mark) .wordmark {
  opacity: 0;
  transform: translateY(6px);
  visibility: hidden;
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s .3s;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 34px);
  font-size: 15px;
}

.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  color: var(--ink-2);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.nav__link:hover { color: var(--ink); }
.nav__link[aria-current="page"] { color: var(--ink); }
.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: currentColor;
}
.nav__link .icon { width: 11px; height: 11px; margin-left: -3px; }

/* ---------- Buttons and links ---------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 18px 0 22px;
  background: var(--button);
  color: var(--on-button);
  font: 500 16px/1 var(--sans);
  letter-spacing: .005em;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.button:hover { background: var(--button-hover); }
.button:active { transform: translateY(1px); }
.button .arrow { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.button:hover .arrow { transform: translateX(3px); }

.textlink {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  font: 500 15px/1.2 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  padding: 5px 0;
  border-bottom: 1px solid var(--blue-line);
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
/* A larger, invisible hit area for fingers. */
.textlink::after {
  content: "";
  position: absolute;
  inset: -10px -6px;
}
.textlink:hover { border-bottom-color: currentColor; color: var(--blue-deep); }
.textlink .arrow { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.textlink:hover .arrow { transform: translateX(3px); }
.textlink .icon { width: 10px; height: 10px; transition: transform .25s var(--ease); }
.textlink:hover .icon { transform: translate(2px, -2px); }

/* ---------- Preamble (home hero) ---------- */

/* The name and what he does form one sentence: the preamble.
   The introduction stands on line C beside the surname, lifted 40px above its baseline. */
.preamble {
  --name: min(120px, 9.1vw);
  --col: calc((100% - 11 * var(--col-gap)) / 12);
  --lift: 40px;
  --mark-w: calc(var(--name) * 2.1 * 402 / 480);   /* width of the mark: its height times the picture's ratio */
  position: relative;
  padding-top: 56px;
}

.preamble__mark {
  position: absolute;
  top: 72px;
  right: 0;
  display: block;
  height: calc(var(--name) * 2.1);
}

.preamble__mark img {
  width: auto;
  height: 100%;
}

@media (max-width: 1200px) {
  .preamble { --mark-w: calc(var(--name) * 1.8 * 402 / 480); }
  .preamble__mark { top: 88px; height: calc(var(--name) * 1.8); }
}

.preamble__title {
  font-weight: 400;
  font-size: var(--name);
  line-height: .95;
}

.preamble__name {
  display: block;
  font-family: var(--display);
  font-size: var(--name);
  line-height: .95;
  letter-spacing: -.026em;
  margin-left: -.045em;            /* optical alignment of the A and the Y */
  white-space: nowrap;
}

.preamble__line {
  display: flex;
  align-items: flex-end;           /* fallback */
  align-items: last baseline;
  justify-content: space-between;
  gap: var(--col-gap);
}

.preamble__lede {
  position: relative;
  top: calc(var(--lift) * -1);
  display: block;
  flex: none;
  /* The introduction keeps its left edge on line C and stops one gap before the mark, so it never runs under it. */
  width: calc(var(--col) * 6 + var(--col-gap) * 5 - var(--mark-w) - var(--col-gap));
  margin-right: calc(var(--mark-w) + var(--col-gap));
  margin-top: -12em;               /* a taller introduction grows upward and does not push the surname down */
  font-family: var(--serif);
  font-size: clamp(21px, 1.85vw, 26px);
  line-height: 1.4;
  letter-spacing: 0;
  text-wrap: balance;
}

.preamble__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s5) var(--s6);
  margin-top: calc(28px - var(--lift));
  margin-left: calc(var(--col) * 6 + var(--col-gap) * 6);   /* line C */
}

/* ---------- Articles ---------- */

/* Each article is one row: its label in a 200px column, the statement after a 40px gutter,
   on one baseline; a reference link follows its statement. One stronger divider opens the list. */
.articles { margin-top: 72px; }

.article {
  position: relative;
  display: grid;
  grid-template-columns: var(--margin-w) minmax(0, 1fr);
  column-gap: var(--label-gap);
  align-items: baseline;
  padding: 48px 0 52px;
  border-top: 1px solid var(--rule);
  scroll-margin-top: calc(var(--head-h) + 8px);
}
.article:first-child { border-top-color: var(--rule-strong); }
.article:last-child { padding-bottom: 64px; }   /* then the footer */

/* A thin blue mark on the rule of the article reached with J / K. */
.article::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: var(--margin-w);
  height: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .6s var(--ease-out);
}
.article.is-current::before, .article:focus::before { transform: none; }

.article__margin { grid-column: 1; }

.article__title {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
}

.article__body { grid-column: 2; }

.article__text {
  font-family: var(--serif);
  font-size: clamp(22px, 1.9vw, 27px);
  line-height: 1.4;
  letter-spacing: 0;
  max-width: var(--measure);
  text-wrap: pretty;
}

.article__ref { display: flex; margin-top: 12px; }   /* directly under its sentence */

/* Stops reached with J / K are shown by the blue mark, not a box. */
[data-stop]:focus, [data-stop]:focus-visible, main:focus { outline: none; }

/* ---------- Research page ---------- */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  font-size: 15px;
  color: var(--ink-2);
}
.crumbs a { color: var(--ink-2); text-decoration: none; transition: color .2s var(--ease); }
.crumbs a:hover { color: var(--ink); }
.crumbs__sep { color: var(--ink-3); }
.crumbs h1 { font: inherit; color: var(--ink); }

.record-head {
  padding-top: 40px;
}

/* Papers: the research is told in six papers, listed under one hairline.
   The paper on screen carries the blue mark on the rule, as the article reached with J / K does. */
.papers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  row-gap: 24px;
  column-gap: var(--s8);
  margin-top: var(--s6);
  border-top: 1px solid var(--rule);
}

.papers__item {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;   /* name and date; the line below spans both */
  column-gap: 10px;
  align-items: baseline;
  padding-top: 12px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.papers__item:hover, .papers__item[aria-current="page"] { color: var(--ink); }
.papers__item[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 2px;
  background: var(--blue);
}

.papers__name { font-size: 15px; font-weight: 500; line-height: 22px; }
.papers__date {
  font-size: 14px;
  line-height: 22px;
  color: var(--ink-2);
  white-space: nowrap;
  font-variant-numeric: lining-nums tabular-nums;
}
.papers__line { grid-column: 1 / -1; font-size: 15px; line-height: 22px; }

.record__head {
  --name: min(112px, 8.5vw);
  padding-top: 48px;
}

.record__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--name);
  line-height: 1.05;
  letter-spacing: -.022em;
  margin-left: -.04em;
  text-wrap: balance;
}

.record__subtitle {
  margin-top: 24px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(22px, 1.95vw, 28px);
  line-height: 1.3;
  color: var(--ink-2);
  max-width: 32em;
  text-wrap: pretty;
}

/* Status and version: one band between one pair of rules; the version stands on the text line.
   A status longer than the label column moves the version on instead of running into it. */
.record__meta {
  display: grid;
  grid-template-columns: minmax(var(--margin-w), max-content) minmax(0, 1fr);
  column-gap: var(--label-gap);
  align-items: center;
  margin-top: 48px;
  padding: 12px 0;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
}

.meta {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  line-height: 22px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: lining-nums;   /* tabular figures would also widen the comma of the status */
}
.meta + .meta { grid-column: 2; color: var(--ink-2); font-variant-numeric: lining-nums tabular-nums; }
.meta .textlink { display: inline; font: inherit; padding: 0; }   /* a link inside the status keeps its line */

.status-ring {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--blue);
  flex: none;
}

.record__section {
  position: relative;
  display: grid;
  grid-template-columns: var(--margin-w) minmax(0, 1fr);
  column-gap: var(--label-gap);
  align-items: baseline;
  padding: 48px 0 56px;
  border-top: 1px solid var(--rule);
  scroll-margin-top: calc(var(--head-h) + 8px);
}
.record__section:first-child { border-top: 0; padding-top: 56px; }

.record__section .article__body { grid-column: 2; grid-row: auto; }

.summary {
  font-family: var(--serif);
  font-size: clamp(22px, 1.95vw, 28px);
  line-height: 1.4;
  letter-spacing: 0;
  max-width: 27em;
  text-wrap: pretty;
}

.log { border-top: 1px solid var(--rule-strong); max-width: var(--measure); }
.log li {
  display: grid;
  grid-template-columns: 172px 1fr;
  gap: var(--s5);
  align-items: baseline;
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--rule);
}
.log time {
  font-size: 14px;
  color: var(--ink-2);
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}
.log p {
  max-width: 36em;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
  text-wrap: pretty;
}

.record__back {
  padding: 40px 0 var(--s8);
  border-top: 1px solid var(--rule);
}
.textlink--back .arrow { order: -1; }
.textlink--back:hover .arrow { transform: translateX(-3px); }

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

.footer {
  border-top: 1px solid var(--rule);
  padding: 28px 0 40px;
  font-size: 14px;
  color: var(--ink-2);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4) var(--s6);
}
.footer__name { font-family: var(--serif); font-size: 16px; color: var(--ink); }
.footer__nav { display: flex; flex-wrap: wrap; gap: var(--s5); }
.footer__nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.footer__nav a:hover, .footer__nav a[aria-current="page"] { color: var(--ink); }
.footer__nav .icon { width: 10px; height: 10px; }
.footer__end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4) var(--s6); }

/* Keys: one quiet control; the shortcuts are listed only when asked for. */
.keys-toggle {
  appearance: none;
  background: none;
  border: 0;
  padding: 4px 0;
  font: inherit;
  color: var(--ink-2);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: .3em;
  transition: color .2s var(--ease), text-decoration-color .2s var(--ease);
}
.keys-toggle:hover, .keys-toggle[aria-expanded="true"] { color: var(--ink); text-decoration-color: currentColor; }

.keys {
  position: fixed;
  right: max(var(--gutter), calc((100vw - var(--wrap)) / 2));   /* on the right edge of the page column */
  bottom: 88px;
  z-index: 30;
  width: 288px;
  padding: 14px 18px 10px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(22, 24, 29, .10), 0 2px 8px rgba(22, 24, 29, .06);
  font-size: 14px;
  color: var(--ink);
}
.keys[hidden] { display: none; }
.keys__title { font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.keys__list > div {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--rule);
}
.keys__list > div:first-child { border-top: 0; }
.keys__list dt { display: flex; gap: 4px; }
.keys__list dd { margin: 0; }

@media (prefers-color-scheme: dark) {
  .keys { box-shadow: 0 14px 40px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3); }
}

@media (prefers-reduced-motion: no-preference) {
  .keys:not([hidden]) { animation: keys-in .22s var(--ease-out); }
  @keyframes keys-in { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
}

/* No keyboard, no keys. */
@media (hover: none), (pointer: coarse), (max-width: 760px) {
  .keys-toggle, .keys { display: none !important; }
}

@media print {
  .js [data-reveal], .js .rise { opacity: 1 !important; transform: none !important; animation: none !important; }
  .masthead { position: static; }
  .keys-toggle, .keys, .skip { display: none !important; }
}

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

@media (prefers-reduced-motion: no-preference) {
  .js .rise {
    /* backwards: hidden during the delay, then the element's own style takes over */
    animation: rise 1s var(--ease-out) backwards;
    animation-delay: calc(var(--i, 0) * 110ms + 80ms);
  }
  @keyframes rise {
    from { opacity: 0; translate: 0 18px; }
    to   { opacity: 1; translate: 0 0; }
  }

  .js [data-reveal] {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .papers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root { --margin-w: 168px; --label-gap: 32px; }
  .record__meta { grid-template-columns: 1fr; row-gap: 2px; }
  .meta, .meta + .meta { grid-column: 1; }
}

/* Below this width the introduction moves under the name. */
@media (max-width: 980px) {
  .preamble { --name: min(112px, 14vw); --lift: 0px; }
  .preamble__mark {
    position: static;
    width: fit-content;
    height: 96px;
    margin-bottom: 24px;
  }
  .preamble__line { display: block; }
  .preamble__lede {
    width: auto;
    margin-right: 0;
    max-width: 30em;
    margin-top: .8em;
    font-size: clamp(20px, 2.6vw, 24px);
  }
  .preamble__actions { margin-left: 0; margin-top: 32px; }
  .articles { margin-top: 56px; }
  .record__head { --name: min(96px, 11.5vw); }
}

@media (max-width: 760px) {
  :root { --head-h: 60px; --col-gap: 16px; }

  .wordmark { font-size: 17px; }
  .nav { gap: 22px; font-size: 15px; }
  .nav__link--about { display: none; }

  /* Phone scale and rhythm: name 56/56, body copy 20/28,
     40px from the masthead to the title, sections 28px top and bottom. */
  .preamble { --name: 56px; padding-top: 40px; }
  .preamble__name, .preamble__title { line-height: 56px; }
  .preamble__name { letter-spacing: -.022em; }
  .preamble__lede { font-size: 20px; line-height: 28px; margin-top: 16px; }
  .preamble__actions { margin-top: 24px; }
  .button { min-height: 48px; }

  .articles { margin-top: 36px; padding-bottom: 36px; }   /* divider 36px under the button; 28 + 36 = 64 before the footer */

  .article { grid-template-columns: 1fr; row-gap: 16px; padding: 28px 0; }
  .article:last-child { padding-bottom: 28px; }
  .article::before { width: 72px; }
  .article__margin, .article__body { grid-column: 1 / -1; }
  .article__title { font-weight: 600; }
  .article__text { font-size: 20px; line-height: 28px; }

  /* The masthead already names the person and the section: the breadcrumb is
     kept only for screen readers (it holds the page heading). */
  .record-head { padding-top: 0; }
  .crumbs {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
  }
  /* So the papers come first, 40px under the masthead; name, date and line stack in each half. */
  .papers { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; margin-top: 40px; }
  .papers__item { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .papers__date { white-space: normal; }
  .record__head { --name: 44px; padding-top: 40px; }
  .record__title { line-height: 46px; letter-spacing: -.018em; }
  .record__subtitle { margin-top: 12px; font-size: 21px; line-height: 1.3; }
  .record__meta { margin-top: 28px; }
  .record__section { grid-template-columns: 1fr; row-gap: 16px; padding: 28px 0; }
  .record__section:first-child { padding-top: 28px; }
  .record__section .article__body { grid-column: 1 / -1; }
  .summary { font-size: 20px; line-height: 28px; }
  .log li { grid-template-columns: 1fr; gap: 4px; padding: 14px 0 16px; }
  .log p { font-size: 17px; }
  .record__back { padding: 28px 0 var(--s8); }

  .footer__inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 360px) {
  .nav { gap: 16px; font-size: 14px; }
  .wordmark { font-size: 16px; }
}

/* ---------- Paper (research page) ---------- */

.record__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 28px;
}
.record__note { font-size: 14px; color: var(--ink-2); }

.paper {
  max-width: var(--measure);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  text-wrap: pretty;
}
.paper p { margin: 0 0 14px; }
.paper .keywords { font-size: 16px; color: var(--ink-2); }
.paper .paper-h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.2;
  margin: 52px 0 14px;
  scroll-margin-top: calc(var(--head-h) + 8px);
}
.paper .paper-h2:first-child { margin-top: 0; }
.paper .paper-h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.3;
  margin: 30px 0 10px;
}
.paper ul { list-style: disc; padding-left: 1.3em; margin: 0 0 14px; }
.paper ol { list-style: decimal; padding-left: 1.6em; margin: 0 0 14px; }
.paper li { margin-bottom: 6px; }
.paper .prop { padding-left: 1.6em; text-indent: -1.6em; }
.paper .question { font-style: italic; font-size: 22px; line-height: 1.4; text-align: center; margin: 20px 0 24px; }
.paper code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .84em; }
.paper .table-wrap { overflow-x: auto; margin: 12px 0 20px; }
.paper table {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
}
.paper caption {
  caption-side: top;
  text-align: left;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  padding-bottom: 8px;
}
.paper th, .paper td { border: 1px solid var(--rule-strong); padding: 6px 8px; vertical-align: top; }
.paper th { background: var(--rule); font-weight: 600; }
.paper .refs { font-size: 15px; line-height: 1.45; padding-left: 2.2em; }
.paper .refs li { margin-bottom: 8px; }
.paper .refs a { color: inherit; word-break: break-all; }

@media (max-width: 720px) {
  .paper { font-size: 17px; }
  .paper .paper-h2 { font-size: 24px; }
  .paper .question { font-size: 19px; }
}
.record__section .article__body { min-width: 0; }
.paper .table-wrap { max-width: 100%; }

/* Narrow screens: a long status line wraps instead of widening the page; the marker stays on the first line. */
@media (max-width: 720px) {
  .meta { white-space: normal; align-items: flex-start; }
  .meta .status-ring { margin-top: 6px; }
}
/* A long address inside a list item breaks instead of running past the edge. */
.paper li a { overflow-wrap: anywhere; }
