:root {
  color-scheme: light;
  --ink: #14241d;
  --muted: #617069;
  --paper: #f5f6f1;
  --surface: #ffffff;
  --line: #dce2dd;
  --green: #0f7650;
  --green-dark: #0a5138;
  --mint: #dff3e9;
  --gold: #b2752b;
  --violet: #6556a6;
  --shadow: 0 18px 55px rgba(18, 42, 31, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select { font: inherit; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 20; top: 10px; left: 10px; padding: 10px 14px; transform: translateY(-150%); background: white; border-radius: 8px; }
.skip-link:focus { transform: none; }

.hero {
  overflow: hidden;
  color: #eef8f2;
  background:
    radial-gradient(circle at 86% 22%, rgba(58, 173, 121, .25), transparent 27%),
    radial-gradient(circle at 9% 88%, rgba(193, 150, 72, .13), transparent 26%),
    #10231b;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .07;
  background-image: linear-gradient(rgba(255,255,255,.55) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.55) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}
.hero { position: relative; }
.hero > * { position: relative; z-index: 1; }
.nav { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand { display: inline-flex; gap: 11px; align-items: center; text-decoration: none; font-weight: 720; letter-spacing: -.02em; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; color: #10231b; background: #75dda8; border-radius: 9px; font-family: Georgia, serif; font-weight: 800; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: #cddbd4; text-decoration: none; font-size: 14px; font-weight: 600; }
.nav-links a:hover { color: white; }
.nav-links .nav-cta { padding: 10px 16px; color: #10231b; background: #eff9f3; border-radius: 999px; }
.hero-content { padding: 86px 0 52px; }
.eyebrow, .section-kicker { margin: 0 0 16px; color: #7fe0ae; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { max-width: 890px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(45px, 7.2vw, 83px); font-weight: 500; line-height: .99; letter-spacing: -.047em; }
h1 span { color: #78dba8; font-style: italic; }
.hero-copy { max-width: 650px; margin: 28px 0 0; color: #b9cbc2; font-size: 18px; line-height: 1.65; }
.hero-actions { display: flex; gap: 12px; margin-top: 31px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 19px; border-radius: 9px; text-decoration: none; font-size: 14px; font-weight: 750; }
.primary-button { color: #10231b; background: #78dba8; }
.primary-button:hover { background: #95e8ba; }
.secondary-button { color: #e9f3ed; border: 1px solid rgba(255,255,255,.21); background: rgba(255,255,255,.05); }
.secondary-button:hover { background: rgba(255,255,255,.1); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 68px 0 0; padding: 28px 0 0; border-top: 1px solid rgba(255,255,255,.12); }
.stats div { padding: 0 28px; border-right: 1px solid rgba(255,255,255,.1); }
.stats div:first-child { padding-left: 0; }
.stats div:last-child { border-right: 0; }
.stats dt { font-family: Georgia, serif; font-size: 30px; color: #f6faf7; }
.stats dd { margin: 5px 0 0; color: #91a69b; font-size: 12px; line-height: 1.4; }

.catalog { padding-top: 74px; padding-bottom: 90px; }
.catalog-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.section-kicker { margin-bottom: 10px; color: var(--green); }
h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(34px, 5vw, 52px); font-weight: 500; letter-spacing: -.035em; }
.download-menu { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.download-menu span { margin-right: 3px; font-weight: 700; }
.download-menu a { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.6); text-decoration: none; font-weight: 700; }
.download-menu a:hover { color: var(--green); border-color: #a8c8b8; }

.controls { margin-top: 34px; }
.search-box { display: flex; align-items: center; gap: 12px; height: 59px; padding: 0 17px; border: 1px solid #cad3ce; border-radius: 12px; background: var(--surface); box-shadow: 0 8px 35px rgba(20,36,29,.04); }
.search-box:focus-within { border-color: #65aa89; box-shadow: 0 0 0 3px rgba(30,132,87,.11); }
.search-box svg { width: 20px; fill: none; stroke: #6c7a73; stroke-linecap: round; stroke-width: 1.8; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 16px; }
.search-box input::placeholder { color: #8b9690; }
kbd { padding: 3px 7px; color: #7d8b84; border: 1px solid #d9dfdc; border-bottom-width: 2px; border-radius: 5px; background: #f8faf8; font-size: 11px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 13px; }
.segmented { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: #ecefe9; }
.segmented button { padding: 8px 13px; color: #65726c; border: 0; border-radius: 6px; background: transparent; cursor: pointer; font-size: 13px; font-weight: 700; }
.segmented button.active { color: var(--green-dark); background: white; box-shadow: 0 2px 7px rgba(25,47,37,.08); }
select { height: 40px; padding: 0 32px 0 12px; color: #53615a; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: #fff; font-size: 13px; font-weight: 650; }
select:focus { border-color: #65aa89; }

.result-toolbar { display: flex; align-items: center; justify-content: space-between; margin: 29px 0 13px; color: var(--muted); font-size: 13px; }
.result-toolbar p { margin: 0; }
.result-toolbar strong { color: var(--ink); }
.result-toolbar label { display: flex; align-items: center; gap: 8px; }
.result-toolbar select { height: 34px; }
.paper-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.paper-card { display: flex; min-height: 270px; flex-direction: column; padding: 24px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.paper-card:hover { transform: translateY(-2px); border-color: #b6c9bf; box-shadow: var(--shadow); }
.paper-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stage-badge { padding: 5px 8px; border-radius: 5px; color: var(--green-dark); background: var(--mint); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.stage-badge[data-stage="Prefilling"] { color: #80520e; background: #f7ead1; }
.stage-badge[data-stage="Decoding"] { color: #51438e; background: #e8e4f6; }
.venue { color: #6f7b75; font-size: 12px; font-weight: 700; }
.paper-card h3 { margin: 18px 0 10px; font-size: 18px; line-height: 1.36; letter-spacing: -.015em; }
.paper-title { text-decoration: none; }
.paper-title:hover { color: var(--green); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.contribution { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.taxonomy { margin: 15px 0 0; color: #839089; font-size: 11px; line-height: 1.45; }
.paper-actions { display: flex; gap: 17px; margin-top: auto; padding-top: 20px; }
.paper-actions a { color: var(--green); text-decoration: none; font-size: 12px; font-weight: 800; }
.paper-actions a:hover { text-decoration: underline; text-underline-offset: 3px; }
.code-link[hidden] { display: none; }
.empty-state { padding: 70px 20px; text-align: center; border: 1px dashed #bfc9c3; border-radius: 13px; background: rgba(255,255,255,.45); }
.empty-state h3 { margin: 0; font-family: Georgia, serif; font-size: 27px; }
.empty-state p { color: var(--muted); }
.empty-state button { padding: 9px 14px; color: white; border: 0; border-radius: 7px; background: var(--green); cursor: pointer; font-weight: 700; }

footer { color: #c4d1ca; background: #10231b; }
.footer-content { display: flex; justify-content: space-between; gap: 30px; padding-top: 44px; padding-bottom: 44px; }
.footer-content strong { color: white; }
.footer-content p { max-width: 550px; margin: 8px 0 0; color: #80978b; font-size: 13px; }
.footer-links { display: flex; align-items: center; gap: 24px; }
.footer-links a { color: #b8c9c0; text-decoration: none; font-size: 13px; font-weight: 650; }
.footer-links a:hover { color: white; }

@media (max-width: 780px) {
  .shell { width: min(100% - 28px, 1180px); }
  .nav { height: 66px; }
  .brand span:last-child { display: none; }
  .nav-links { gap: 15px; }
  .nav-links > a:first-child { display: none; }
  .nav-links .nav-cta { padding: 9px 12px; }
  .hero-content { padding-top: 58px; }
  h1 br { display: none; }
  .hero-copy { font-size: 16px; }
  .stats { grid-template-columns: 1fr 1fr; row-gap: 22px; }
  .stats div { padding: 0 16px; }
  .stats div:nth-child(2) { border-right: 0; }
  .stats div:nth-child(3) { padding-left: 0; }
  .catalog { padding-top: 55px; }
  .catalog-heading { align-items: flex-start; flex-direction: column; }
  .download-menu { flex-wrap: wrap; }
  .segmented { width: 100%; overflow-x: auto; }
  .segmented button { flex: 1 0 auto; }
  .paper-grid { grid-template-columns: 1fr; }
  .paper-card { min-height: 245px; }
  .footer-content { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* Guided discovery and paper references */
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #5aab88; outline-offset: 3px; }
.bottlenecks { margin-bottom: 30px; }
.bottlenecks h2 { font-size: clamp(29px, 4vw, 39px); }
.bottleneck-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.bottleneck-grid button { display: flex; align-items: flex-start; flex-direction: column; gap: 10px; padding: 20px 18px; color: var(--ink); text-align: left; border: 1px solid var(--line); border-radius: 12px; background: white; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.bottleneck-grid button:hover, .bottleneck-grid button[aria-pressed="true"] { border-color: #7caf98; box-shadow: 0 5px 20px rgba(18,42,31,.07); }
.bottleneck-grid button[aria-pressed="true"] { background: #edf8f1; }
.shortcut-icon { display: grid; place-items: center; width: 30px; height: 30px; color: var(--green); background: var(--mint); border-radius: 8px; font-size: 11px; font-weight: 700; }
.bottleneck-grid [data-preset="prefilling"] .shortcut-icon { color: #80520e; background: #f7ead1; }
.bottleneck-grid [data-preset="memory"] .shortcut-icon, .bottleneck-grid [data-preset="generation"] .shortcut-icon { color: #51438e; background: #e8e4f6; }
.bottleneck-grid strong { font-size: 14px; line-height: 1.4; }
.bottleneck-grid button > span:last-child { color: var(--muted); font-size: 12px; line-height: 1.6; }
.taxonomy-browser { padding: 18px 21px; margin-bottom: 45px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.65); }
.taxonomy-browser summary { color: var(--green-dark); cursor: pointer; font-size: 14px; font-weight: 700; }
.taxonomy-browser summary span { margin-left: 10px; color: var(--muted); font-size: 12px; font-weight: 400; }
.helper-text { color: var(--muted); font-size: 12px; line-height: 1.7; }
.taxonomy-tree { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }
.taxonomy-tree section { padding: 0 16px 5px 0; border-right: 1px solid var(--line); }
.taxonomy-tree section:last-child { border-right: 0; }
.taxonomy-tree h3 { margin: 0 0 16px; }
.taxonomy-link, .tree-category, .tree-subcategory { padding: 0; color: inherit; border: 0; background: none; text-align: left; cursor: pointer; font-size: inherit; line-height: inherit; }
.taxonomy-link:hover, .tree-category:hover, .tree-subcategory:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.tree-category, .tree-subcategory { display: block; margin: 10px 0; }
.tree-category { font-size: 13px; font-weight: 600; }
.tree-subcategory { margin-left: 14px; color: var(--muted); font-size: 12px; }
.taxonomy-tree [data-stage="Prefilling"] h3 { color: #80520e; }
.taxonomy-tree [data-stage="Decoding"] h3 { color: #51438e; }
#project-count { display: block; margin-top: 4px; color: #aac2b5; }
.controls { scroll-margin-top: 24px; }
.filter-row select { max-width: 100%; }
.toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 16px; }
.text-button { padding: 0; color: var(--green); border: 0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 650; text-decoration: none; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.result-toolbar { gap: 16px; margin-bottom: 8px; }
.sort-note { margin: 0 0 20px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.taxonomy { color: #65776d; }
.taxonomy-path + .taxonomy-path { margin-top: 7px; }
.added-date { margin: 12px 0 0; color: #79867f; font-size: 11px; }
.added-date a { text-decoration: none; }
.added-date a:hover { text-decoration: underline; }
.paper-actions { flex-wrap: wrap; column-gap: 17px; row-gap: 12px; }
.paper-actions button { padding: 0; color: var(--green); border: 0; background: none; cursor: pointer; font-size: 12px; font-weight: 800; }
.paper-actions button:hover { text-decoration: underline; text-underline-offset: 3px; }
dialog { width: min(720px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 28px; color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10,28,20,.5); backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialog-heading .section-kicker { margin: 0; }
dialog h2 { margin: 20px 0 12px; font-family: inherit; font-size: 22px; line-height: 1.4; letter-spacing: -.02em; }
.citation-label { display: block; margin: 18px 0 8px; font-size: 12px; font-weight: 600; }
#citation-text { width: 100%; min-height: 230px; padding: 15px; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; background: #f5f7f4; font: 12px/1.6 ui-monospace, monospace; resize: vertical; }
.dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 20px; }
.dialog-actions .primary-button { border: 0; cursor: pointer; }
.dialog-actions a { font-size: 12px; }
#citation-status { min-height: 18px; margin: 12px 0 0; color: var(--green-dark); font-size: 12px; }
.action-status { display: none; position: fixed; bottom: 20px; left: 50%; z-index: 50; width: max-content; max-width: calc(100% - 32px); margin: 0; padding: 13px 18px; transform: translateX(-50%); color: white; border-radius: 10px; background: #173c2b; box-shadow: var(--shadow); font-size: 13px; }
.action-status.visible { display: block; }
.action-status input { display: block; width: min(600px, 70vw); margin-top: 10px; padding: 8px; font-size: 12px; }
@media (max-width: 900px) { .bottleneck-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 780px) {
  .catalog { padding-top: 40px; }
  .taxonomy-tree { grid-template-columns: 1fr; gap: 15px; }
  .taxonomy-tree section { padding-bottom: 15px; border-right: 0; border-bottom: 1px solid var(--line); }
  .taxonomy-tree section:last-child { border-bottom: 0; }
  .taxonomy-browser summary span { display: block; margin: 6px 0 0 17px; }
  .toolbar-actions { gap: 12px; }
  .result-toolbar { align-items: flex-start; }
  .result-toolbar p { padding-top: 8px; white-space: nowrap; }
  .filter-row select { flex: 1; min-width: 140px; }
  dialog { padding: 22px; }
}
@media (max-width: 400px) {
  .bottleneck-grid { gap: 8px; }
  .bottleneck-grid button { padding: 16px 12px; }
  .bottleneck-grid strong { font-size: 13px; }
  .toolbar-actions { max-width: 240px; }
}

/* Keep the first useful navigation within reach of the opening screen. */
.hero-content { padding-top: 58px; padding-bottom: 38px; }
h1 { max-width: 1080px; font-size: clamp(40px, 4.8vw, 68px); line-height: 1.05; }
.hero-copy { margin-top: 22px; font-size: 17px; }
.stats { margin-top: 40px; }
@media (max-width: 780px) {
  .hero-content { padding-top: 40px; }
  .hero-copy { font-size: 15px; }
}
