/* Minimal research page — content-first, no decoration */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: #222;
  background: #fff;
}

a { color: #1a4f7a; }
img { max-width: 100%; display: block; }

/* Nav */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #eee;
  display: flex; justify-content: flex-end; gap: .25rem;
  padding: .5rem 2rem;
}
nav a {
  font-size: .85rem; font-weight: 500;
  color: #444; text-decoration: none;
  padding: .3rem .6rem; border-radius: 4px;
}
nav a:hover { background: #f5f5f5; color: #111; }

/* Centered column */
.col {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.col-wide {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Hero */
.hero-section {
  padding: 4rem 0 2.5rem;
  border-bottom: 1px solid #eee;
}
.hero-section h1 {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1.2rem;
  letter-spacing: -.02em;
}
.hero-section .subtitle {
  font-size: 1.1rem;
  color: #555;
  line-height: 1.65;
  margin-bottom: 2rem;
}
.authors {
  font-size: .95rem;
  color: #666;
  margin-bottom: .3rem;
}
.authors a { color: #333; }
.affils {
  font-size: .82rem;
  color: #999;
  margin-bottom: 1.5rem;
}
.links {
  display: flex; gap: .6rem; flex-wrap: wrap;
}
.links a {
  font-size: .85rem; font-weight: 500;
  color: #333; text-decoration: none;
  padding: .45rem 1rem;
  border: 1px solid #ddd;
  border-radius: 5px;
}
.links a:hover { border-color: #999; }

.headline-fig {
  margin: 2rem auto 0;
  text-align: center;
}
.headline-fig img {
  border: 1px solid #eee;
  border-radius: 6px;
  margin: 0 auto;
}
.headline-fig .caption {
  font-size: .82rem;
  color: #888;
  margin-top: .6rem;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* Sections */
section { padding: 3rem 0; }
section + section { border-top: 1px solid #eee; }
h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -.01em;
}
h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 .6rem;
}
p + p { margin-top: .8rem; }
.muted { color: #666; }
.small { font-size: .9rem; }

/* Takeaway list */
ul.takeaways {
  list-style: none;
  padding: 0;
  margin: 0;
}
ul.takeaways li {
  padding: .8rem 0 .8rem 1.4rem;
  border-bottom: 1px solid #eee;
  position: relative;
  font-size: .95rem;
  line-height: 1.6;
}
ul.takeaways li:last-child { border-bottom: none; }
ul.takeaways li::before {
  content: '';
  position: absolute;
  left: 0; top: 1.15rem;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #1a4f7a;
}

/* Pipeline diagram */
.pipeline {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 2rem 0;
  font-size: .88rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}
.pipeline .step {
  flex: 1;
  padding: 1.2rem 1rem;
  position: relative;
}
.pipeline .step + .step { border-left: 1px solid #e0e0e0; }
.pipeline .step-num {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #999;
  margin-bottom: .4rem;
}
.pipeline .step-title {
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: .3rem;
  color: #111;
}
.pipeline .step-desc {
  font-size: .82rem;
  color: #666;
  line-height: 1.5;
}
.pipeline .step.highlight {
  background: #eaf2f8;
}
.pipeline .arrow {
  display: flex; align-items: center; justify-content: center;
  width: 28px; min-width: 28px;
  color: #bbb; font-size: 1.1rem;
  background: #fafafa;
  border-left: 1px solid #e0e0e0;
  border-right: 1px solid #e0e0e0;
}

/* Key numbers */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}
.result-num {
  text-align: center;
  padding: 1.2rem .8rem;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fafbfc;
}
.result-num .big {
  font-size: 2.1rem;
  font-weight: 700;
  color: #1a4f7a;
  line-height: 1.1;
}
.result-num .desc {
  font-size: .82rem;
  color: #666;
  margin-top: .4rem;
  line-height: 1.45;
}

/* Figure grid */
.fig-row {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}
.fig-row.two { grid-template-columns: 1fr 1fr; }
.fig-row.three { grid-template-columns: 1fr 1fr 1fr; }
.fig-row img {
  border: 1px solid #eee;
  border-radius: 4px;
  background: #fff;
}
.fig-row .caption {
  font-size: .78rem;
  color: #888;
  margin-top: .3rem;
  text-align: center;
}

/* Inline figure inside details */
.fig-row-inner {
  margin: .8rem auto 1.2rem;
  max-width: 520px;
  text-align: center;
}
.fig-row-inner img {
  border: 1px solid #eee;
  border-radius: 4px;
  width: 100%;
}
.fig-row-inner .caption {
  font-size: .72rem;
  color: #888;
  margin-top: .3rem;
  text-align: center;
}

/* Details for optional depth */
details {
  margin: 1.5rem 0;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
}
details summary {
  padding: .7rem 1rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  color: #444;
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: '▸';
  display: inline-block;
  margin-right: .5rem;
  color: #aaa;
  transition: transform .15s ease;
}
details[open] summary::before {
  transform: rotate(90deg);
}
details summary:hover { color: #111; }
details .inner {
  padding: .5rem 1rem 1rem;
  font-size: .9rem;
  color: #555;
  line-height: 1.65;
}
details .inner p { margin-bottom: .5rem; }

/* Eq box */
.eq-box {
  background: #f7f7f7;
  border-left: 3px solid #ccc;
  padding: .6rem 1rem;
  margin: .6rem 0;
  overflow-x: auto;
  font-size: .95rem;
}

/* Tables */
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table {
  border-collapse: collapse; width: 100%;
  font-size: .85rem;
}
th {
  text-align: center; padding: .5rem .8rem;
  border-bottom: 2px solid #ddd;
  font-size: .78rem; font-weight: 600;
  color: #666; text-transform: uppercase;
  letter-spacing: .04em;
}
td {
  text-align: center; padding: .45rem .8rem;
  border-bottom: 1px solid #eee;
  color: #444;
}
td:first-child { text-align: left; font-weight: 500; color: #222; }
td.better { color: #1a4f7a; font-weight: 700; }
td.base { color: #888; font-style: italic; }
td.switch {
  font-size: .72rem; color: #aaa; padding-top: 0; padding-bottom: .55rem;
  border-bottom: 1px solid #eee;
}
tr.switch-row td { border-bottom: 1px solid #eee; }
.tag {
  display: inline-block;
  font-size: .7rem;
  padding: .1rem .45rem;
  border-radius: 4px;
  background: #eef3f8;
  color: #1a4f7a;
  font-weight: 600;
  margin-left: .4rem;
}

/* Bibtex */
pre.bib {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 6px;
  font-size: .78rem;
  line-height: 1.6;
  overflow-x: auto;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  color: #555;
  white-space: pre-wrap;
}

/* Footer */
footer {
  border-top: 1px solid #eee;
  padding: 2rem;
  text-align: center;
  font-size: .82rem;
  color: #aaa;
}

/* Comparison panels */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
.compare .panel {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: .85rem 0 0;
  border-top: 3px solid #ccc;
}
.compare .panel.before { border-top-color: #d65a3a; }
.compare .panel.after  { border-top-color: #1a4f7a; }
.compare .panel h4 {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .4rem;
  color: #555;
}
.compare .panel.before h4 { color: #b54d2c; }
.compare .panel.after  h4 { color: #1a4f7a; }
.compare .panel .num {
  font-size: 1.6rem;
  font-weight: 700;
  color: #222;
  line-height: 1.1;
}

/* ============================
   How-it-works visual aids
   ============================ */

/* Option lifecycle: stretches of tokens during which a mask is fixed */
.lifecycle {
  margin: 1rem 0 1.4rem;
  padding: .9rem 1rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fafbfc;
}
.lifecycle-tag,
.ctrl-tag {
  font-size: .68rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #888;
  margin-bottom: .5rem;
}
.lifecycle-track {
  display: flex; align-items: stretch; gap: 4px;
  height: 36px;
}
.lc-block {
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  color: #fff;
  font-size: .82rem; font-weight: 600;
  text-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.lc-a { background: #1a4f7a; }
.lc-b { background: #2c6f9d; }
.lc-c { background: #4188b4; }
.lc-switch {
  display: flex; align-items: center; justify-content: center;
  width: 22px; min-width: 22px;
  color: #d65a3a; font-size: 1rem; font-weight: 700;
}
.lifecycle-axis {
  display: flex; justify-content: space-between;
  font-size: .68rem; color: #999; margin-top: .3rem;
}
.lifecycle-foot {
  font-size: .8rem; color: #555;
  margin-top: .55rem; line-height: 1.55;
}
.lifecycle-foot .sw { color: #d65a3a; font-weight: 700; }

/* Per-layer controller schematic */
.ctrl-diagram {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto minmax(0, 2.5fr) auto minmax(130px, 1fr);
  align-items: stretch;
  gap: .55rem;
  margin: 1.1rem 0 1.3rem;
  padding: .85rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fafbfc;
}
.ctrl-col, .ctrl-controller { display: flex; flex-direction: column; }
.ctrl-controller .ctrl-tag { color: #1a4f7a; }
.ctrl-pill {
  background: #fff; border: 1px solid #d4d4d4; border-radius: 4px;
  padding: .4rem .55rem; text-align: center;
  font-size: .8rem; line-height: 1.3;
  margin-bottom: .35rem;
}
.ctrl-pill.out {
  background: #eaf2f8; border-color: #1a4f7a;
  color: #1a4f7a; font-weight: 600;
}
.ctrl-foot {
  font-size: .7rem; color: #666; text-align: center;
  margin-top: .25rem; line-height: 1.45;
}
.ctrl-arrow {
  display: flex; align-items: center; justify-content: center;
  color: #bbb; font-size: 1.15rem;
}
.ctrl-controller {
  border: 1px solid #c8d8e6; border-radius: 6px;
  background: #f3f8fc;
  padding: .55rem;
}
.ctrl-heads {
  display: grid; grid-template-columns: 1fr 1fr; gap: .35rem;
}
.ctrl-head {
  background: #fff; border: 1px solid #dde7ef; border-radius: 4px;
  padding: .42rem .5rem;
}
.ctrl-head-name {
  font-size: .8rem; font-weight: 600; color: #1a4f7a;
  line-height: 1.3;
}
.ctrl-head-desc {
  font-size: .7rem; color: #777; margin-top: .15rem; line-height: 1.4;
}

/* Pseudocode (KaTeX-rendered) */
.algo {
  margin: .4rem 0 .2rem;
  background: #fff;
  border: 1px solid #d6e1eb;
  border-radius: 6px;
  overflow: hidden;
  font-size: .85rem;
  line-height: 1.75;
  color: #2c2c2c;
}
.algo-header {
  background: #f3f8fc;
  border-bottom: 1px solid #d6e1eb;
  padding: .45rem .95rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #1a4f7a;
}
.algo-body {
  padding: .7rem 1rem .85rem;
  overflow-x: auto;
}
.algo-line {
  white-space: nowrap;
  padding: .03rem 0;
}
.algo-section {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #1a4f7a;
  margin: .85rem 0 .3rem;
  white-space: nowrap;
}
.algo-section:first-child { margin-top: 0; }
.algo-kw {
  color: #b04a30;
  font-weight: 600;
}
.algo-comment {
  color: #999;
  font-style: italic;
  margin-left: .5rem;
  font-size: .82rem;
}
.algo .indent-1 { padding-left: 1.5em; }
.algo .indent-2 { padding-left: 3em; }
.algo .indent-3 { padding-left: 4.5em; }
.algo .katex { font-size: 1em; }

/* Method-section figures */
.method-fig {
  margin: 1.4rem 0 1.6rem;
}
.method-fig img {
  width: 100%;
  border: 1px solid #eee;
  border-radius: 6px;
  background: #fff;
}
.method-fig figcaption {
  font-size: .82rem;
  color: #888;
  margin-top: .5rem;
  text-align: center;
  line-height: 1.55;
}

/* Side-by-side scrolling animation panels (reuses .compare) */
.compare .panel canvas {
  display: block;
  width: 100%;
  height: 192px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 3px;
}

/* Responsive */
@media (max-width: 720px) {
  .hero-section h1 { font-size: 1.6rem; }
  .pipeline { flex-direction: column; }
  .pipeline .arrow { width: auto; height: 24px; border: none; border-top: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0; }
  .pipeline .step + .step { border-left: none; border-top: none; }
  .results-grid { grid-template-columns: 1fr; }
  .fig-row.two, .fig-row.three { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .ctrl-diagram {
    grid-template-columns: 1fr;
  }
  .ctrl-arrow { transform: rotate(90deg); padding: .15rem 0; }
  .ctrl-heads { grid-template-columns: 1fr; }
}
