/* ==========================================================================
   Project page for "Near-Zero Forgetting Is Not Enough"
   Plain CSS, mobile-first, system fonts only (nothing is loaded from a CDN).
   Palette: one accent (deep blue, matches the figure heatmaps), plus the
   paper's own red for "out-of-distribution" in a few highlights.
   ========================================================================== */

:root {
  --ink: #101d33;
  --text: #28364d;
  --muted: #586880;
  --faint: #8592a6;
  --line: #dde5ef;
  --soft: #f4f7fb;
  --soft-2: #eaf0f8;
  --bg: #ffffff;

  --accent: #1d4f9f;          /* links, focus, accents */
  --accent-ink: #173b6b;      /* ID blue, same family as the figures */
  --accent-soft: #e8effa;
  --ood: #b8372a;             /* OOD red, same family as the figures */
  --ood-soft: #fbeceb;
  --ok: #3f8a3c;              /* OOD-CV green in Figure 4 */

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 29, 51, .06), 0 8px 24px -12px rgba(16, 29, 51, .18);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 1040px;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

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

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap--narrow { max-width: 780px; }

h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.eyebrow {
  font-size: .8125rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 10px;
}

/* ---------- Hero ------------------------------------------------------------ */
.hero {
  padding: 40px 0 36px;
  text-align: center;
  background:
    radial-gradient(900px 340px at 50% -80px, var(--accent-soft), transparent 70%),
    var(--bg);
}
.venue {
  display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px;
  margin: 0 0 22px; padding: 7px 16px;
  font-size: .875rem; font-weight: 650; letter-spacing: .02em;
  color: var(--accent-ink); background: var(--accent-soft);
  border: 1px solid #cfdcf1; border-radius: 999px;
}
.hero h1 { font-size: clamp(1.85rem, 6.2vw, 3.3rem); font-weight: 800; letter-spacing: -.02em; }
.hero h1 .title-main { display: block; }
.hero h1 .title-sub {
  display: block; margin-top: 12px;
  font-size: clamp(1.08rem, 3.1vw, 1.65rem); font-weight: 500; color: var(--muted); letter-spacing: -.005em; line-height: 1.3;
}
.authors {
  list-style: none; margin: 28px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px;
  font-size: 1.125rem; font-weight: 600; color: var(--ink);
}
.authors li { white-space: nowrap; }
.authors sup, .affils sup { font-size: .68em; font-weight: 700; color: var(--accent); margin-left: 1px; }
.affils {
  list-style: none; margin: 10px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 20px;
  font-size: .9375rem; color: var(--muted);
}
.affils sup { margin: 0 4px 0 0; }
.event-note { margin: 14px 0 0; font-size: .875rem; color: var(--faint); }

/* ---------- Buttons --------------------------------------------------------- */
.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; min-height: 48px;
  font: inherit; font-size: .9875rem; font-weight: 650; line-height: 1.2; text-decoration: none;
  color: #fff; background: var(--ink); border: 1.5px solid var(--ink); border-radius: 999px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
.btn.is-disabled {
  color: #6b778a; background: #f6f8fb; border: 1.5px dashed #b9c4d3;
  cursor: not-allowed; box-shadow: none; transform: none;
}
.btn.is-disabled:hover { background: #f6f8fb; border-color: #b9c4d3; transform: none; box-shadow: none; }

/* ---------- Sections -------------------------------------------------------- */
section { padding: 44px 0; }
.section-alt { background: var(--soft); border-block: 1px solid var(--line); }
.section-title { font-size: clamp(1.45rem, 3.8vw, 2rem); font-weight: 750; margin-bottom: 18px; }
.lede { font-size: 1.1875rem; line-height: 1.6; color: var(--ink); }
.lede strong { font-weight: 700; }



/* ---------- Figures --------------------------------------------------------- */
figure.figure { margin: 0; }
.fig-frame {
  position: relative; display: block; padding: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  cursor: zoom-in;
}
.fig-frame img { width: 100%; border-radius: 6px; }
.zoom-hint {
  position: static; margin: 8px 2px 0 auto; width: max-content;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 8px; font-size: .75rem; font-weight: 650; color: var(--ink);
  background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: 999px;
  pointer-events: none; box-shadow: 0 2px 8px rgba(16, 29, 51, .1);
}
.zoom-hint svg { width: 14px; height: 14px; }
figcaption { margin-top: 14px; font-size: .95rem; line-height: 1.55; color: var(--muted); }
figcaption b { color: var(--ink); }

.teaser .fig-frame { padding: 12px; }


/* ---------- Abstract -------------------------------------------------------- */
.abstract p { font-size: 1.0625rem; line-height: 1.7; text-align: left; }

/* ---------- Setup ----------------------------------------------------------- */
.setup { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; }
.setup > li {
  display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start;
  padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.setup .ico {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-ink);
}
.setup .ico svg { width: 22px; height: 22px; }
.setup h3 { font-size: .8125rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin-bottom: 3px; }
.setup p { margin: 0; font-size: 1rem; line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.chips li {
  display: block; padding: 3px 10px; font-size: .84rem; font-weight: 600; color: var(--ood);
  background: var(--ood-soft); border: 1px solid #f0cfcb; border-radius: 999px; grid-template-columns: none;
}

/* ---------- Finding sections ------------------------------------------------ */
.finding-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.finding-head .num {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px;
  font-weight: 800; color: #fff; background: var(--accent); border-radius: 50%;
}
.finding-head .section-title { margin: 0; }
.prose { max-width: 820px; }
.prose p { margin-bottom: 1em; }
.prose strong { color: var(--ink); }
.block { margin-top: 26px; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
.table-fig { margin: 0; }
.table-fig figcaption { margin: 0 0 10px; }
th, td { padding: 10px 16px; text-align: center; border-top: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { white-space: normal; vertical-align: bottom; font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--soft); border-top: 0; }
tbody th { font-weight: 650; color: var(--ink); }
td.na { color: var(--faint); font-size: .85em; }
tbody td { color: var(--ink); font-weight: 600; }
tbody td.na { color: var(--faint); font-weight: 500; }



/* ---------- Takeaway -------------------------------------------------------- */
.takeaway { text-align: center; background: var(--ink); color: #dfe7f3; border: 0; }
.takeaway .section-title { color: #fff; }
.takeaway p { font-size: 1.1875rem; line-height: 1.6; color: #e3eaf5; }
.takeaway p.big { font-size: clamp(1.3rem, 3.6vw, 1.75rem); font-weight: 700; line-height: 1.35; color: #fff; }

/* ---------- BibTeX ---------------------------------------------------------- */
.bib-wrap { position: relative; }
pre.bibtex {
  margin: 0; padding: 20px 18px; overflow-x: auto;
  font-family: var(--mono); font-size: .86rem; line-height: 1.6; color: #e6edf7;
  background: #0f1b30; border-radius: var(--radius-sm); tab-size: 2;
}
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 7px 14px;
  font: inherit; font-size: .875rem; font-weight: 650; color: #fff; cursor: pointer;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px;
}
.copy-btn svg { width: 16px; height: 16px; }
.copy-btn:hover { background: rgba(255, 255, 255, .22); }
.copy-btn.is-copied { background: #2f7a3b; border-color: #2f7a3b; }
.bib-wrap pre.bibtex { padding-top: 58px; }

/* ---------- Ack + footer ---------------------------------------------------- */
.ack p { font-size: .975rem; color: var(--muted); }
footer { padding: 34px 0 44px; background: var(--soft); border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); text-align: center; }
footer p { margin: 0 0 6px; line-height: 1.55; }

/* ---------- Lightbox -------------------------------------------------------- */
.lb {
  position: fixed; inset: 0; z-index: 1000; overflow: auto;
  background: rgba(10, 18, 32, .92); display: none; cursor: zoom-out;
  -webkit-overflow-scrolling: touch;
}
.lb.is-open { display: block; }
.lb-inner { min-width: 100%; min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 56px 12px 28px; }
.lb img {
  background: #fff; border-radius: 6px; box-shadow: 0 10px 50px rgba(0, 0, 0, .5);
  width: 240vw; max-width: none; height: auto;
}
.lb-close {
  position: fixed; top: 10px; right: 12px; z-index: 1001;
  width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer;
  color: #fff; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%;
  font-size: 26px; line-height: 1;
}
.lb-close:hover { background: rgba(255, 255, 255, .28); }
.lb-hint {
  position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 1001;
  padding: 5px 12px; font-size: .78rem; color: #dfe7f3; background: rgba(0, 0, 0, .55); border-radius: 999px; pointer-events: none;
}
body.lb-open { overflow: hidden; }

/* ---------- Larger screens -------------------------------------------------- */
@media (min-width: 640px) {
  .wrap { padding: 0 28px; }
  .hero { padding: 56px 0 48px; }
  section { padding: 60px 0; }
  .setup { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lb img { width: min(94vw, 2000px); }
}
@media (min-width: 900px) {
  section { padding: 72px 0; }
  .fig-frame { padding: 16px; }
}

@media (max-width: 480px) {
  body { font-size: 1rem; }
  .authors { font-size: 1.0625rem; gap: 4px 16px; }
  th, td { padding: 9px 5px; }
  th:first-child, td:first-child { padding-left: 10px; }
  table { font-size: .88rem; }
  thead th { font-size: .64rem; letter-spacing: 0; }
  tbody th { white-space: normal; min-width: 92px; }
  td.na { font-size: .78em; }
  .copy-btn span.txt { display: none; }
  .copy-btn { padding: 7px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

.swatch { display: inline-block; width: .85em; height: .85em; border-radius: 2px; vertical-align: -1px; margin-right: 2px; border: 1px solid rgba(16, 29, 51, .25); }
.swatch.dark { background: #1b4f94; }
.swatch.pale { background: #f4f8fd; }
