/* CoBPE project page. Figure colors follow the COLM 2026 poster:
   pink = CoBPE / base token, grey = BPE, one fill + ink pair per modifier group. */
:root {
    --ink: #1f2328;
    --muted: #5b6470;
    --line: #dfe2e6;
    --accent: #c0247a;
    --accent-bar: #e23f93;
    --bpe-bar: #b7bdc3;

    --bpe-fill: #eef0f2;   --bpe-edge: #9aa3ac;   --bpe-text: #2f343a;
    --base-fill: #ffe3f0;  --base-edge: #e23f93;  --base-text: #780044;
    --det-fill: #dcf3e1;   --det-edge: #3fae5f;   --det-text: #184a21;
    --prep-fill: #fcefc4;  --prep-edge: #e0b020;  --prep-text: #433101;
    --punct-fill: #fde6d3; --punct-edge: #e08a3c; --punct-text: #5a2508;
    --cap-fill: #ebe5fd;   --cap-edge: #8b6cf0;   --cap-text: #3a1f8f;
    --space-fill: #dfeafb; --space-edge: #3d7fd6; --space-text: #15396b;

    --sans: "Noto Sans", Helvetica, Arial, sans-serif;
    --serif: "Source Serif 4", Georgia, serif;
    --mono: "Noto Sans Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #fff;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
}

a { color: var(--accent); }

main, header, footer { max-width: 880px; margin: 0 auto; padding: 0 16px; }

/* header */
header { text-align: center; padding-top: 48px; }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.5rem); line-height: 1.2; margin: 0 0 16px; }
.authors { font-size: 1.15rem; margin: 0; }
.authors span { margin: 0 0.4em; white-space: nowrap; }
.affil { margin: 2px 0 0; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 22px 0 0; }
.button {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 16px; border-radius: 20px;
    background: #363636; color: #fff; text-decoration: none; font-size: 0.95rem;
}
.button:hover { background: #4a4a4a; }
.button.disabled { background: #e6e7e9; color: var(--muted); cursor: default; }

/* text */
.tldr { margin: 36px 0 0; font-size: 1.1rem; }
h2 { font-size: 1.6rem; margin: 52px 0 14px; }
p { margin: 0 0 14px; }
code { font-family: var(--mono); font-size: 0.88em; }

figure { margin: 24px 0; }
figure img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 10px; }
.scroll-x { overflow-x: auto; }

/* token chips */
.chip {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.9rem;
    line-height: 1.3;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--bpe-edge);
    background: var(--bpe-fill);
    color: var(--bpe-text);
    white-space: pre;
}
.chip.base  { background: var(--base-fill);  border-color: var(--base-edge);  color: var(--base-text); font-weight: 700; }
.chip.det   { background: var(--det-fill);   border-color: var(--det-edge);   color: var(--det-text); }
.chip.prep  { background: var(--prep-fill);  border-color: var(--prep-edge);  color: var(--prep-text); }
.chip.punct { background: var(--punct-fill); border-color: var(--punct-edge); color: var(--punct-text); }
.chip.cap   { background: var(--cap-fill);   border-color: var(--cap-edge);   color: var(--cap-text); }
.chip.space { background: var(--space-fill); border-color: var(--space-edge); color: var(--space-text); }
.chip.tag   { font-size: 0.76rem; padding: 0 5px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* hobbit sentence */
.quote { font-family: var(--serif); font-style: italic; font-size: 1.15rem; text-align: center; margin: 0 0 16px; }
.row-label { font-weight: 700; margin: 14px 0 6px; }
.row-label span { font-weight: 400; color: var(--muted); }
.compounds { display: flex; flex-wrap: wrap; gap: 12px 8px; align-items: flex-start; }
.compound { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 48px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; font-size: 0.85rem; }

/* ground table */
table.ladder { border-collapse: collapse; font-size: 0.92rem; margin: 0 auto; }
.ladder th { text-align: left; font-weight: 600; color: var(--muted); padding: 0 14px 6px 0; border-bottom: 1px solid var(--line); }
.ladder td { padding: 6px 14px 6px 0; border-bottom: 1px solid var(--line); }
.ladder td.text { font-family: var(--mono); white-space: pre; }
.ladder td.n { text-align: right; font-weight: 600; }

/* method stages */
ol.stages { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1.1fr 0.7fr 1.35fr; gap: 10px; }
.stage { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; }
.stage-head { font-weight: 700; font-size: 0.92rem; }
.stage-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 12px 0 4px; text-align: center; }
.small-label { font-size: 0.75rem; color: var(--muted); }
.compound-mini { display: inline-flex; flex-direction: column; gap: 3px; padding: 4px; border: 1px solid var(--base-edge); border-radius: 6px; }
.sum-row { display: flex; align-items: flex-end; gap: 4px; }
.sum-row b { color: var(--muted); font-weight: 400; }
.emb { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.vec { display: block; width: 32px; height: 9px; border-radius: 2px; }
.vec.base  { background: linear-gradient(90deg, #f7c6de, #e23f93, #f59ab4, #b00667); }
.vec.prep  { background: linear-gradient(90deg, #fcefc4, #e0b020, #f3d77a); }
.vec.det   { background: linear-gradient(90deg, #9ad6a8, #dcf3e1, #3fae5f); }
.vec.punct { background: linear-gradient(90deg, #e08a3c, #fde6d3, #f2b884); }
.vec.mix   { width: 140px; height: 12px; background: linear-gradient(90deg, #f7c6de, #e0b020, #e23f93, #9ad6a8, #f2b884, #b00667); }
.heads { display: flex; gap: 14px; align-items: flex-end; justify-content: center; }
.head-label { font-size: 0.72rem; font-weight: 600; margin-bottom: 5px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 44px; justify-content: center; border-bottom: 1px solid #c9ccd1; }
.bars span { width: 18px; background: #c9ccd1; }
.bars i, .bar-labels i { width: 8px; }
.bar-labels { display: flex; gap: 3px; justify-content: center; font-family: var(--mono); font-size: 0.58rem; color: var(--muted); margin-top: 3px; }
.bar-labels span { width: 18px; text-align: center; white-space: nowrap; }
.head.base .bars span, .head.base .bar-labels span { width: 28px; }

/* charts */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.charts figure { margin: 0; }
.chart-title { font-weight: 700; margin: 0 0 6px; }
svg.chart { width: 100%; height: auto; display: block; font-family: var(--sans); }
svg.chart text { fill: var(--ink); }
svg.chart .muted { fill: var(--muted); }
svg.chart .co { fill: var(--accent); }
svg.chart .axis { stroke: #c9ccd1; }
svg.chart .grid { stroke: #eceef1; }

pre {
    background: #f5f6f7;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 14px 16px;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0 0 14px;
}

footer { margin-top: 56px; padding-top: 20px; padding-bottom: 40px; border-top: 1px solid var(--line); text-align: center; font-size: 0.85rem; color: var(--muted); }

@media (max-width: 760px) {
    body { font-size: 16px; }
    ol.stages { grid-template-columns: 1fr 1fr; }
    .charts { grid-template-columns: 1fr; }
}
@media (max-width: 440px) {
    ol.stages { grid-template-columns: 1fr; }
}
