/* ============================================================================
   style.css — the landing pages (docs/index.html and docs/ja/index.html).

   The deck's palette, laid out as a document instead of a slide: one column
   about 720px wide for running text, full width for tables and charts, and a
   layout that survives a phone.

   Font files and licences are shared with the deck under assets/vendor/. Paths
   here are relative to this file, so the Japanese page in ja/ resolves them
   through the same stylesheet without a second copy.
   ========================================================================== */

/* ----------------------------------------------------------------------------
   Bundled faces. Outfit is one variable file for the whole 100-900 range;
   PlemolJP is the mono face, in the two weights the pages set. Japanese has no
   bundled face on purpose: --font-ja resolves to a face the reader's own
   system already has, so no character can fall through to a missing glyph.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../vendor/fonts/outfit-var.woff2") format("woff2");
}
@font-face {
  font-family: "PlemolJP";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../vendor/fonts/plemoljp-400.woff2") format("woff2");
}
@font-face {
  font-family: "PlemolJP";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../vendor/fonts/plemoljp-700.woff2") format("woff2");
}

/* ----------------------------------------------------------------------------
   Tokens. The light palette is the whole set; the two dark blocks below
   redefine only what changes. charts.js reads these same custom properties, so
   a colour on the page and a colour in a chart come from one place.
   -------------------------------------------------------------------------- */
:root {
  --peach: #FFD4C4;
  --sky: #C4E0F9;
  --mint: #C4F0DC;
  --lavender: #D8C4F0;
  --lemon: #F5F0C4;

  --ink: #333333;
  --muted: #6B7280;
  --line: #E3E0DA;
  --bg: #FBF9F6;
  --surface: #FFFFFF;
  --accent: #3D6EA5;
  --em: #B25A3C;

  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "PlemolJP", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic",
             "Noto Sans JP", sans-serif;

  /* How much of a pastel a tinted surface carries. The pastels are mixed
     into --surface, so one set of rules covers both themes; dark needs a
     weaker mix, because a pale tint over a dark ground turns muddy. */
  --tint: 30%;
  --tint-soft: 22%;
  --tint-pill: 50%;

  --maxw: 1000px;      /* tables, charts, the header block */
  --measure: 720px;    /* running text */
  --bar-h: 52px;       /* the sticky bar, and every scroll-margin under it */

  color-scheme: light;
}

/* The reader's system setting, unless the page carries an explicit light
   choice. Only the tokens that move are listed. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #E9E6E1;
    --muted: #A2A8B6;
    --line: #333844;
    --bg: #14161C;
    --surface: #1C1F27;
    --accent: #92B8E6;
    --em: #E8A183;
    --tint: 20%;
    --tint-soft: 13%;
    --tint-pill: 30%;
    color-scheme: dark;
  }
}
/* The explicit dark choice, which has to win in a browser set to light. */
:root[data-theme="dark"] {
  --ink: #E9E6E1;
  --muted: #A2A8B6;
  --line: #333844;
  --bg: #14161C;
  --surface: #1C1F27;
  --accent: #92B8E6;
  --em: #E8A183;
  --tint: 20%;
  --tint-soft: 13%;
  --tint-pill: 30%;
  color-scheme: dark;
}

/* ----------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
* { box-sizing: border-box; }

html {
  font-size: 17px;
  scrollbar-gutter: stable;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Any element that carries lang="ja" gets the Japanese stack, which covers the
   single language link on the English page and the whole Japanese page, where
   <html lang="ja"> passes it down. */
[lang="ja"] { font-family: var(--font-ja); }
html[lang="ja"] body { line-height: 1.85; }
html[lang="ja"] code,
html[lang="ja"] pre { font-family: var(--font-mono); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.22;
  color: var(--ink);
}
html[lang="ja"] h1,
html[lang="ja"] h2,
html[lang="ja"] h3,
html[lang="ja"] h4 { font-family: var(--font-ja); }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--em); }

code, kbd, samp, pre { font-family: var(--font-mono); }

strong { font-weight: 700; }

::selection { background: var(--peach); color: #333333; }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 60;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 0 0 10px 0;
  padding: 10px 16px; text-decoration: none;
}
.skip:focus { left: 0; }

/* ----------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

main section {
  padding: 34px 0 6px;
  scroll-margin-top: calc(var(--bar-h) + 14px);
}
main section + section { border-top: 1px solid var(--line); }

section > h2 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  margin: 0 0 6px;
}
section > h2 + .section-lede {
  color: var(--muted);
  max-width: var(--measure);
  margin: 0 0 18px;
}
h3 { font-size: 1.1rem; margin: 30px 0 6px; }

/* Running text keeps to the measure; tables, charts and card grids take the
   full column width. */
section > p,
section > ul,
section > ol,
section > .callout,
section > .footnote,
section > .section-lede { max-width: var(--measure); }

p { margin: 0 0 16px; }

/* ----------------------------------------------------------------------------
   Sticky bar
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--bar-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 22px;
  height: 100%; display: flex; align-items: center; gap: 18px;
}
.topbar__mark {
  font-family: var(--font-display); font-weight: 700; font-size: .84rem;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.topbar__nav { display: flex; gap: 16px; margin-left: 8px; }
.topbar__nav a {
  color: var(--muted); text-decoration: none; font-size: .86rem; white-space: nowrap;
}
.topbar__nav a:hover { color: var(--ink); }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang-switch {
  font-size: .8rem; font-weight: 600; text-decoration: none;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 11px; white-space: nowrap;
}
.lang-switch:hover { color: var(--ink); border-color: var(--accent); }
.theme-toggle {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  width: 36px; height: 36px; font-size: 15px; line-height: 1; cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); }
/* Eight links have to fit between the mark and the theme button. Below the
   full page width they lose a little of their gap and a little of their size;
   below 900px the whole row goes away and the sections are reached by
   scrolling. */
@media (max-width: 1060px) {
  .topbar__inner { gap: 12px; }
  .topbar__nav { gap: 11px; margin-left: 0; }
  .topbar__nav a { font-size: .82rem; }
}
@media (max-width: 900px) { .topbar__nav { display: none; } }

/* ----------------------------------------------------------------------------
   Header block: title, authors, venue, resource links, headline numbers
   -------------------------------------------------------------------------- */
/* The mark in the sticky bar links to #top, so the header is a scroll target
   like the sections are and needs the same clearance under the bar. */
.site-header {
  padding: 44px 0 8px;
  scroll-margin-top: calc(var(--bar-h) + 14px);
}
.eyebrow {
  font-family: var(--font-display); font-weight: 600; font-size: .78rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 12px;
}
.site-header h1 {
  font-size: clamp(1.7rem, 4.2vw, 2.6rem);
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  max-width: 22ch;
}
.byline { font-size: 1.02rem; margin: 0 0 2px; }
.byline strong { font-weight: 600; }
.affiliation, .venue { color: var(--muted); margin: 0 0 4px; font-size: .96rem; }
.venue { margin-bottom: 22px; }

.hero-links { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 30px; }
/* The label takes the page ground rather than a fixed white: --accent is a
   deep blue in light and a pale one in dark, so the readable label flips with
   it and neither theme needs a rule of its own. */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: .95rem;
  text-decoration: none; padding: 10px 18px; border-radius: 12px;
  background: var(--accent); color: var(--bg); border: 1px solid transparent;
}
.btn:hover { background: color-mix(in srgb, var(--accent) 84%, var(--ink)); color: var(--bg); }
.btn.ghost {
  background: transparent; color: var(--accent); border-color: var(--line);
}
.btn.ghost:hover { border-color: var(--accent); background: transparent; color: var(--em); }
.btn[aria-disabled="true"] {
  background: transparent; color: var(--muted); border-color: var(--line);
  border-style: dashed; cursor: default;
}
.btn[aria-disabled="true"]:hover { color: var(--muted); background: transparent; }

/* ----------------------------------------------------------------------------
   Headline numbers
   -------------------------------------------------------------------------- */
.kpi-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin: 0 0 8px;
}
.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px;
}
.kpi[data-tone="em"] { background: color-mix(in srgb, var(--peach) var(--tint), var(--surface)); }
.kpi[data-tone="note"] { background: color-mix(in srgb, var(--sky) var(--tint), var(--surface)); }
.kpi[data-tone="ok"] { background: color-mix(in srgb, var(--mint) var(--tint), var(--surface)); }
.kpi__value {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.3rem, 3.4vw, 1.75rem); line-height: 1.2;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.kpi__label {
  display: block; font-size: .82rem; font-weight: 600; color: var(--ink);
  margin-top: 6px;
}
.kpi__note { display: block; font-size: .78rem; color: var(--muted); margin-top: 2px; }
@media (max-width: 720px) {
  .kpi-row { grid-template-columns: 1fr; }
  .kpi { padding: 13px 15px; }
}

/* ----------------------------------------------------------------------------
   Callouts, pills, footnotes
   -------------------------------------------------------------------------- */
.callout {
  border: 1px solid var(--line); border-left-width: 4px;
  border-radius: 10px; padding: 14px 18px; margin: 0 0 18px;
  background: var(--surface); font-size: .96rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout[data-tone="ok"] {
  background: color-mix(in srgb, var(--mint) var(--tint-soft), var(--surface));
  border-left-color: color-mix(in srgb, var(--mint) 70%, var(--ink));
}
.callout[data-tone="warn"] {
  background: color-mix(in srgb, var(--lemon) var(--tint-soft), var(--surface));
  border-left-color: color-mix(in srgb, var(--lemon) 70%, var(--ink));
}
.callout[data-tone="note"] {
  background: color-mix(in srgb, var(--sky) var(--tint-soft), var(--surface));
  border-left-color: color-mix(in srgb, var(--sky) 70%, var(--ink));
}
.callout[data-tone="em"] {
  background: color-mix(in srgb, var(--peach) var(--tint-soft), var(--surface));
  border-left-color: color-mix(in srgb, var(--peach) 70%, var(--ink));
}

.pill {
  display: inline-block; font-size: .74rem; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase;
  border-radius: 999px; padding: 2px 10px; white-space: nowrap;
  color: var(--ink); background: color-mix(in srgb, var(--sky) var(--tint-pill), var(--surface));
  border: 1px solid var(--line);
}
.pill[data-tone="ok"] { background: color-mix(in srgb, var(--mint) var(--tint-pill), var(--surface)); }
.pill[data-tone="warn"] { background: color-mix(in srgb, var(--lemon) var(--tint-pill), var(--surface)); }
.pill[data-tone="em"] { background: color-mix(in srgb, var(--peach) var(--tint-pill), var(--surface)); }

/* Inline numbers in running text: they should not break across a line, and
   tabular figures keep a column of them from jittering. */
.num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }

/* Visible to a screen reader, not to the eye. Used for the results table's
   caption, which would otherwise repeat the figure caption below it. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.footnote { color: var(--muted); font-size: .84rem; line-height: 1.6; }
.footnote p { margin: 0 0 6px; }

/* ----------------------------------------------------------------------------
   Cards and the verdict scorecard
   -------------------------------------------------------------------------- */
.cards { display: grid; gap: 14px; margin: 0 0 20px; }
.cards[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.cards[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 18px;
}
.card h3 { margin: 0 0 6px; font-size: 1rem; }
.card p { margin: 0; font-size: .93rem; }
@media (max-width: 720px) {
  .cards[data-cols="2"], .cards[data-cols="3"] { grid-template-columns: 1fr; }
}

.verdicts {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
  margin: 4px 0 22px;
}
.verdict {
  background: var(--surface); border: 1px solid var(--line);
  border-top: 4px solid color-mix(in srgb, var(--mint) 80%, var(--ink));
  border-radius: 12px; padding: 15px 18px 17px;
}
.verdict[data-result="reported-negative"] {
  border-top-color: color-mix(in srgb, var(--lemon) 80%, var(--ink));
  background: color-mix(in srgb, var(--lemon) var(--tint-soft), var(--surface));
}
.verdict h3 {
  margin: 0 0 4px; font-size: 1rem;
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.verdict__result {
  font-family: var(--font-display); font-size: .7rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap;
}
.verdict p { margin: 0; font-size: .92rem; }
/* The paper's own name for the check, kept so a reader tracking Table 3 can
   still find it under the plain heading above. */
.verdict .verdict__paper {
  margin: 0 0 7px; font-family: var(--font-display); font-size: .74rem;
  letter-spacing: .02em; color: var(--muted);
}
.verdict .num {
  font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink);
  white-space: nowrap;
}
@media (max-width: 720px) { .verdicts { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------------------
   Tables. Wide content scrolls inside its own box; the page never does.
   -------------------------------------------------------------------------- */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
table.table {
  width: 100%; border-collapse: collapse; font-size: .92rem;
  min-width: 640px;
}
table.table th, table.table td {
  text-align: left; padding: 11px 16px; vertical-align: baseline;
}
table.table thead th {
  font-family: var(--font-display); font-size: .74rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  background: color-mix(in srgb, var(--sky) var(--tint-soft), var(--surface));
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.table tbody th {
  font-weight: 600; color: var(--ink);
}
table.table tbody tr + tr th, table.table tbody tr + tr td {
  border-top: 1px solid var(--line);
}
table.table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.table tr.row-base { background: color-mix(in srgb, var(--lavender) var(--tint-soft), var(--surface)); }
table.table tr.row-key { background: color-mix(in srgb, var(--peach) var(--tint), var(--surface)); }
table.table tr.row-key th, table.table tr.row-key td { font-weight: 700; }
table.table tbody tr.is-placeholder td { color: var(--muted); }

/* ----------------------------------------------------------------------------
   Figures and charts
   -------------------------------------------------------------------------- */
.chart-figure { margin: 22px 0 26px; }
.chart {
  width: 100%; min-width: 0; height: 400px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); padding: 6px 4px;
}
#chart-liftpath { height: 420px; }
#chart-loo { height: 430px; }
#chart-lma { height: 560px; }
@media (max-width: 720px) {
  #chart-liftpath { height: 360px; }
  #chart-loo { height: 400px; }
  #chart-lma { height: 520px; }
}
.chart__fallback { padding: 22px; color: var(--muted); font-size: .9rem; margin: 0; }
figcaption {
  color: var(--muted); font-size: .86rem; line-height: 1.6;
  margin-top: 10px; padding: 0 2px; max-width: 90ch;
}
figcaption b, figcaption strong { color: var(--ink); font-weight: 600; }

/* ----------------------------------------------------------------------------
   Limits list
   -------------------------------------------------------------------------- */
ul.limits { list-style: none; margin: 0 0 18px; padding: 0; }
ul.limits li {
  border-left: 3px solid color-mix(in srgb, var(--lemon) 75%, var(--ink));
  padding: 2px 0 2px 16px; margin: 0 0 16px;
}
ul.limits li b { font-weight: 700; }

/* ----------------------------------------------------------------------------
   Glossary. Each term and its definition are wrapped in a <div> inside the
   <dl>, which is what lets a hairline separate one pair from the next without
   ever cutting between a term and its definition.
   -------------------------------------------------------------------------- */
dl.glossary {
  max-width: var(--measure);
  margin: 0 0 20px;
  padding: 0;
}
dl.glossary > div {
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
dl.glossary > div:first-child { border-top: 0; padding-top: 2px; }
dl.glossary dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .96rem;
  color: var(--ink);
}
html[lang="ja"] dl.glossary dt { font-family: var(--font-ja); }
dl.glossary dd {
  margin: 3px 0 0;
  padding: 0;
  font-size: .93rem;
  color: var(--ink);
}

/* ----------------------------------------------------------------------------
   Citation
   -------------------------------------------------------------------------- */
.bibtex-wrap { position: relative; max-width: var(--maxw); }
pre.bibtex {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; overflow-x: auto; font-size: .84rem; line-height: 1.65;
  margin: 0 0 10px; color: var(--ink);
}
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  font-family: var(--font-display); font-size: .78rem; font-weight: 600;
  background: var(--bg); color: var(--muted);
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 11px; cursor: pointer;
}
.copy-btn:hover { color: var(--ink); border-color: var(--accent); }

/* ----------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: 40px; padding: 28px 0 44px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem;
}
.site-footer p { margin: 0 0 8px; max-width: var(--measure); }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

@media (max-width: 720px) {
  html { font-size: 16px; }
  .site-header { padding-top: 30px; }
  main section { padding-top: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .theme-toggle, .lang-switch { transition: none; }
}
