/* LINE project page. Palette and type follow the paper's overview figure:
   black step boxes, a teal accent, a Palatino-style serif and monospace concepts. */
:root {
  --surface: #ffffff;
  --panel: #f4f7f8;
  --ink: #111417;
  --text: #2a3036;
  --muted: #5b656e;
  --rule: #e2e7ea;
  --teal: #2aa6aa;        /* fills and accents */
  --teal-ink: #16777b;    /* teal text and links, 5.3:1 on white */
  --teal-soft: #e1f2f3;
  --bar: #c9d2d8;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", P052, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font: 17px/1.65 var(--sans);
}

.wrap { width: min(960px, 100% - 32px); margin-inline: auto; }

a { color: var(--teal-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--panel);
  border-radius: 4px;
  padding: 0.05em 0.3em;
}

.name { font-weight: 700; letter-spacing: 0.03em; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 8px; text-align: center; }

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 4.2vw, 2.7rem);
  line-height: 1.18;
  color: var(--ink);
  margin: 0 auto 22px;
  max-width: 20em;
  text-wrap: balance;
}

.hero h1 .name { color: var(--ink); }

.venue {
  margin: -6px 0 20px;
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  letter-spacing: 0.02em;
  color: var(--teal-ink);
}

.contact {
  margin: -16px 0 26px;
  font-size: 0.93rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.authors {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px;
  margin: 0 0 8px;
  font-size: 1.08rem;
  color: var(--ink);
}

.affils {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 20px;
  margin: 0 0 26px;
  font-size: 0.93rem;
  color: var(--muted);
}

sup { font-size: 0.68em; line-height: 0; margin-left: 1px; }

.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px 9px 15px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.btn:hover, .btn:focus-visible { background: var(--teal-ink); color: #fff; transform: translateY(-1px); }
.btn svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.btn-quiet {
  font: inherit; font-size: 0.9rem; font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}
.btn-quiet:hover { border-color: var(--teal); color: var(--teal-ink); }

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

/* ---------- sections ---------- */
main { padding-bottom: 32px; }

.section { margin-top: 72px; }

.section h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  color: var(--ink);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

.section p { margin: 0 0 14px; }

.abstract { text-align: justify; hyphens: auto; }

.note { font-size: 0.9rem; color: var(--muted); }

/* ---------- figures ---------- */
.figure { margin: 28px 0; }
.figure img { display: block; width: 100%; height: auto; margin-inline: auto; }
.teaser { margin-top: 44px; }
.teaser img { max-width: 900px; }
figcaption {
  margin: 14px auto 0;
  max-width: 900px;
  font-size: 0.92rem;
  color: var(--muted);
}
figcaption strong { color: var(--ink); }

/* ---------- stat tiles ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}
.stat {
  border-top: 3px solid var(--teal);
  background: var(--panel);
  border-radius: 0 0 10px 10px;
  padding: 14px 18px 16px;
}
.stat-value {
  font-family: var(--sans);
  font-weight: 650;
  font-size: 2.1rem;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-label { margin-top: 6px; font-size: 0.9rem; color: var(--muted); line-height: 1.45; }

/* ---------- method steps ---------- */
.steps {
  list-style: none;
  padding: 0;
  margin: 8px 0 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.steps li {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 14px 16px 12px;
}
.step-n {
  display: inline-block;
  font-family: var(--serif);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: var(--ink);
  border-radius: 4px;
  padding: 2px 8px;
}
.steps h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--ink);
  margin: 10px 0 6px;
}
.steps p { font-size: 0.92rem; margin: 0; color: var(--text); }

/* ---------- results table ---------- */
.table-wrap { overflow-x: auto; margin: 22px 0 10px; -webkit-overflow-scrolling: touch; }

.results {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}
.results caption {
  caption-side: bottom;
  text-align: left;
  font-size: 0.88rem;
  color: var(--muted);
  padding-top: 10px;
}
.results th, .results td { padding: 7px 12px; text-align: right; white-space: nowrap; }
.results thead th {
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1.5px solid var(--ink);
}
.results thead th:nth-child(-n+3), .results tbody th, .results td.ds, .results td.metric { text-align: left; }
.results tbody { border-bottom: 1px solid var(--rule); }
.results tbody th { font-weight: 600; color: var(--ink); vertical-align: top; }
.results td.ds { color: var(--muted); vertical-align: top; }
.results tbody.overall { border-top: 2px solid var(--rule); }
.results tbody.overall th { font-weight: 700; }
.results td.metric { color: var(--muted); font-size: 0.86rem; }
.results .line { background: var(--teal-soft); }
.results thead th.line { color: var(--ink); }
.results .best { font-weight: 700; color: var(--ink); }
.results .second { text-decoration: underline; text-underline-offset: 3px; }
.results .sd { font-size: 0.78em; color: var(--muted); font-weight: 400; margin-left: 3px; }

/* ---------- explorer ---------- */
.controls {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  margin: 22px 0 6px;
}
.controls label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.8rem; font-weight: 600; color: var(--muted);
  letter-spacing: 0.02em;
}
.controls label.grow { flex: 1 1 260px; min-width: 0; }
.controls select {
  font: inherit; font-size: 0.93rem; font-weight: 400;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 8px 10px;
  max-width: 100%;
  min-width: 0;
}
.controls select:disabled { color: var(--muted); }

.status { font-size: 0.9rem; color: var(--muted); min-height: 0; margin: 4px 0; }
.status:empty { display: none; }
.status.error { color: #9b2c1f; }

.layer-summary { font-size: 0.88rem; color: var(--muted); margin: 6px 0 14px; }
.layer-summary:empty { display: none; }
.layer-summary b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.ex-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.card {
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 16px 18px;
  min-width: 0;
}
.card:empty { display: none; }
.card h3 {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
}
.card .sub { font-size: 0.85rem; color: var(--muted); margin: -4px 0 12px; }

.concept {
  font-family: var(--mono);
  font-size: 0.84em;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1px 7px;
  overflow-wrap: anywhere;
}
.concept.final { background: var(--ink); border-color: var(--ink); color: #fff; }

.mtable { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.mtable th, .mtable td { padding: 8px 6px; border-bottom: 1px solid var(--rule); vertical-align: top; text-align: left; }
.mtable thead th { font-size: 0.78rem; color: var(--muted); font-weight: 600; border-bottom-color: var(--ink); }
.mtable tbody tr:last-child td, .mtable tbody tr:last-child th { border-bottom: 0; }
.mtable th[scope="row"] { font-weight: 600; color: var(--ink); white-space: nowrap; }
.mtable .num { text-align: right; white-space: nowrap; }
.mtable .best { font-weight: 700; color: var(--ink); }
.mtable tr.is-line { background: var(--teal-soft); }

.card .provenance { font-size: 0.88rem; color: var(--muted); margin: 12px 0 0; }
.provenance strong { color: var(--ink); font-weight: 600; }

.card .trace-group {
  font-family: var(--serif);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 14px 0 4px;
}
.card .trace-group:first-of-type { margin-top: 0; }
.trace { list-style: none; margin: 0; padding: 0; }
.trace li {
  display: grid;
  grid-template-columns: 1.9rem minmax(0, 1fr) minmax(56px, 32%) 2.9rem;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 0.88rem;
}
.trace .i { color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.trace .c { font-family: var(--mono); font-size: 0.82rem; color: var(--text); overflow-wrap: anywhere; }
.trace .bar { height: 8px; border-left: 1px solid var(--bar); }
.trace .bar i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--bar); }
.trace .v { text-align: right; color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.trace li.is-final .c { color: var(--ink); font-weight: 700; }
.trace li.is-final .bar i { background: var(--teal); }
.trace li.is-final .v { color: var(--ink); font-weight: 600; }
.card .trace-key { font-size: 0.82rem; color: var(--muted); margin: 12px 0 0; }
.swatch { display: inline-block; width: 18px; height: 8px; border-radius: 0 4px 4px 0; background: var(--teal); vertical-align: middle; margin-right: 4px; }

/* ---------- search player ---------- */
.sp-tabs { margin: 22px 0 12px; }
.sp {
  --mark: #a9b3bb;            /* context dots: deliberately gray */
  --mark-best: var(--teal-ink);
  --ghost: #d3dade;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 16px 18px 18px;
}
.sp-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 4px 16px;
  font-size: 0.92rem; color: var(--muted);
}
.sp-head strong { font-family: var(--serif); font-size: 1.05rem; color: var(--ink); margin-right: 6px; }
.sp-head a { font-size: 0.86rem; }
.sp-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px;
  margin: 10px 0 2px;
  font-size: 0.8rem; color: var(--muted);
}
.sp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sp-legend .sp-axis-note { margin-left: auto; }
.key-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mark); }
.key-dot.best { background: var(--mark-best); }
.key-dot.ghost { background: none; box-shadow: inset 0 0 0 1.5px var(--ghost); }
.key-line { width: 18px; height: 2px; border-radius: 1px; background: var(--mark-best); }

.sp-chart { position: relative; height: 236px; margin-top: 4px; }
.sp-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.sp-chart .grid { stroke: var(--rule); stroke-width: 1; }
.sp-chart .tick { font: 11px var(--sans); fill: var(--muted); font-variant-numeric: tabular-nums; }
.sp-chart .tick.is-current { fill: var(--ink); font-weight: 700; }
.sp-chart .band { fill: var(--teal-soft); }
.sp-chart .best-line { fill: none; stroke: var(--mark-best); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sp-chart .dot { fill: var(--mark); stroke: var(--surface); stroke-width: 2; }
.sp-chart .dot.is-best { fill: var(--mark-best); }
.sp-chart .dot.ghost { fill: var(--surface); stroke: var(--ghost); stroke-width: 1.5; }
.sp-chart .final-ring { fill: none; stroke: var(--mark-best); stroke-width: 1.5; }
.sp-chart .label {
  font: 600 12px var(--mono); fill: var(--ink);
  paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round;
}
.sp-chart .dot.pop { transform-box: fill-box; transform-origin: center; animation: sp-pop 0.45s cubic-bezier(.2,.7,.2,1); }
@keyframes sp-pop { from { transform: scale(0.2); opacity: 0; } }
.sp-chart .hit { fill: transparent; cursor: pointer; }
.sp-chart .col { fill: transparent; cursor: pointer; }
.sp-tip {
  position: absolute; z-index: 2; pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
  background: var(--ink); color: #fff;
  border-radius: 6px; padding: 5px 9px;
  font-size: 0.78rem; line-height: 1.35; white-space: nowrap;
}
.sp-tip b { font-size: 0.9rem; font-variant-numeric: tabular-nums; margin-right: 6px; }
.sp-tip .c { font-family: var(--mono); }
.sp-tip .s { display: block; color: #c9d2d8; }

.sp-scrub { position: relative; height: 36px; margin: 2px 0 10px; }
.sp-play {
  position: absolute; left: 0; top: 0;
  width: 36px; height: 36px; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--ink); color: #fff;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.sp-play:hover { background: var(--teal-ink); }
.sp-play svg { width: 18px; height: 18px; fill: currentColor; }
.sp-play .i-pause, .sp-play .i-replay { display: none; }
.sp-play[data-state="playing"] .i-play, .sp-play[data-state="ended"] .i-play { display: none; }
.sp-play[data-state="playing"] .i-pause { display: inline; }
.sp-play[data-state="ended"] .i-replay { display: inline; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sp-scrub input[type="range"] {
  position: absolute; top: 9px; left: 52px; width: calc(100% - 64px);
  height: 18px; margin: 0;
  accent-color: var(--teal-ink);
  cursor: pointer;
}

.sp-body {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  border-top: 1px solid var(--rule);
  padding-top: 16px;
}
.sp-kicker {
  font-family: var(--serif);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px !important;
}
.sp-step h3, .sp-board h3 {
  font-family: var(--serif); font-size: 1.05rem; font-weight: 700; color: var(--ink);
  margin: 0 0 10px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
}
.sp-step h3 .concept { font-size: 0.86rem; font-weight: 600; }
.sp-score { font-family: var(--sans); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.sp-badge {
  font-family: var(--sans); font-size: 0.76rem; font-weight: 600;
  border-radius: 999px; padding: 2px 9px;
  color: var(--muted); background: var(--panel);
}
.sp-badge.is-best { color: #fff; background: var(--mark-best); }
.sp-step .sp-sub { font-size: 0.88rem; color: var(--muted); margin: -2px 0 10px; }
.sp-images { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.sp-images figure { margin: 0; min-width: 0; }
.sp-images img {
  display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover;
  border-radius: 6px; background: var(--panel);
}
.sp-images figcaption {
  margin: 3px 0 4px; font-size: 0.72rem; line-height: 1.3; color: var(--muted); text-align: center;
  font-variant-numeric: tabular-nums;
}
.sp-images figcaption .c { display: block; font-family: var(--mono); color: var(--text); overflow-wrap: anywhere; }
.sp-why {
  margin: 12px 0 0;
  border-left: 3px solid var(--rule);
  padding: 2px 0 2px 12px;
  font-size: 0.88rem; color: var(--text);
}
.sp-why span { display: block; font-size: 0.74rem; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.sp-final { margin: 12px 0 0 !important; font-size: 0.9rem; }
.sp-final .concept { font-weight: 600; }
.sp-board h3 .sub { font-family: var(--sans); font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.sp-board .trace li { border-radius: 6px; padding-inline: 4px; }
.sp-board .trace li.is-new { background: var(--teal-soft); }
.sp-board .trace li.gap { display: block; padding: 0 0 0 6px; color: var(--muted); font-size: 0.8rem; line-height: 1; }
.sp-board .trace-key { font-size: 0.82rem; color: var(--muted); margin: 10px 0 0; }

/* ---------- activation-maximization comparison ---------- */
.am-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin: 22px 0 16px;
}
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab {
  font: inherit; font-size: 0.88rem; font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}
.tab:hover { border-color: var(--teal); color: var(--teal-ink); }
.tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--muted); cursor: pointer; }
.toggle input { accent-color: var(--teal-ink); width: 16px; height: 16px; margin: 0; }

.am-grid {
  display: grid;
  grid-template-columns: 7.2rem repeat(5, minmax(0, 1fr));
  gap: 6px 10px;
  align-items: start;
}
.am-colhead { font-size: 0.8rem; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.am-rowlabel {
  align-self: center;
  font-family: var(--serif);
  font-weight: 700;
  color: var(--ink);
  font-size: 0.98rem;
  padding-bottom: 22px;
}
.am-cell { margin: 0 0 6px; min-width: 0; }
.am-cell img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  background: var(--panel);
}
.am-cell figcaption {
  margin: 4px 0 0;
  font-size: 0.8rem;
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.am-cell figcaption.best { color: var(--ink); font-weight: 700; }
.am-cell .concept { display: inline-block; margin-top: 4px; font-size: 0.74rem; font-weight: 400; }
.am-rowlabel.is-line { color: var(--teal-ink); }

/* ---------- citation ---------- */
.bib { position: relative; }
.bib pre {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.6;
}
.bib code { background: none; padding: 0; font-size: inherit; }
.bib .copy { position: absolute; top: 10px; right: 10px; font-size: 0.8rem; padding: 5px 12px; }

/* ---------- footer ---------- */
.footer {
  margin-top: 56px;
  border-top: 1px solid var(--rule);
  padding: 22px 0 36px;
  font-size: 0.86rem;
  color: var(--muted);
  text-align: center;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ex-grid { grid-template-columns: minmax(0, 1fr); }
  .sp-body { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding-top: 40px; }
  .section { margin-top: 56px; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .abstract { text-align: left; }
  .controls label { flex: 1 1 140px; }
  .controls select { width: 100%; }
  .am-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px 6px; }
  .am-grid .am-corner { display: none; }
  .am-rowlabel { grid-column: 1 / -1; padding: 8px 0 0; font-size: 0.92rem; }
  .am-cell figcaption { font-size: 0.7rem; }
  .am-cell .concept {
    font-size: 0.66rem; padding: 0; background: none; border: 0;
    overflow-wrap: break-word; hyphens: auto;
  }
  .card { padding: 14px; }
  .sp { padding: 14px 12px 14px; }
  .sp-legend .sp-axis-note { margin-left: 0; }
  .sp-chart { height: 200px; }
  .sp-images { gap: 4px; }
  .sp-images figcaption { font-size: 0.66rem; }
  .sp-images figcaption .c { font-family: var(--sans); overflow-wrap: break-word; hyphens: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .btn:hover, .btn:focus-visible { transform: none; }
  .sp-play { transition: none; }
  .sp-chart .dot.pop { animation: none; }
}

.emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif; font-weight: 400; }
