/* Caeliai lab pages. Set like a research paper: one reading column,
   notes in the margin, color only inside figures. */

@font-face { font-display: swap; font-family: 'Libertinus Serif'; src: url('/public/fonts/LibertinusSerif-Regular-latin.woff2') format('woff2'); font-weight: 400; font-style: normal; }
@font-face { font-display: swap; font-family: 'Libertinus Serif'; src: url('/public/fonts/LibertinusSerif-Italic-latin.woff2') format('woff2'); font-weight: 400; font-style: italic; }
@font-face { font-display: swap; font-family: 'Libertinus Serif'; src: url('/public/fonts/LibertinusSerif-SemiBold-latin.woff2') format('woff2'); font-weight: 600; font-style: normal; }

:root {
  /* Original Caeliai palette */
  --paper: #f8f6f1;
  --ink: #0a0a0b;
  --ink-2: #2a2a2c;
  --muted: #5f5e5a;
  --rule: rgba(42, 42, 44, .18);
  --sage: #b5d6c0;
  --sage-wash: rgba(181, 214, 192, .28);
  --red: #ff3e3e;      /* the instrument underline only */
  --owns: #5e8f6e;     /* figure series: deep sage, then charcoal */
  --leaks: #2a2a2c;
  --none: #d9d6cd;
  --rest: #c9c6bd;
  --serif: 'Libertinus Serif', 'Iowan Old Style', Palatino, Georgia, serif;
  --col: 36rem;
  --margin: 13rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 20px; -webkit-text-size-adjust: 100%; }
@media (max-width: 640px) { html { font-size: 18px; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); line-height: 1.5; font-kerning: normal; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; text-decoration-color: #b9b7ad; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--owns); outline-offset: 2px; }

.page { max-width: calc(var(--col) + var(--margin) + 5.5rem); margin: 0 auto; padding: 0 1.5rem 4rem; }

/* Masthead */
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap; padding: 1.5rem 0 1.1rem; border-bottom: 1px solid var(--rule); margin-bottom: 4rem; font-size: .9rem; }
.masthead .name { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; font-size: 1.05rem; }
.masthead .name img { width: 22px; height: 22px; }
.masthead nav { display: flex; flex-wrap: wrap; gap: 1.3rem; }
.masthead nav a { text-decoration: none; color: var(--ink-2); }
.masthead nav a:hover, .masthead nav a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink); }

/* Title block */
h1 { margin: 0; font-weight: 400; font-size: 2.5rem; line-height: 1.12; letter-spacing: -.01em; max-width: var(--col); text-wrap: balance; }
.subtitle { margin: .7rem 0 0; font-style: italic; font-size: 1.25rem; line-height: 1.4; color: var(--ink-2); max-width: var(--col); }
.byline { margin: 1.1rem 0 0; font-size: .85rem; color: var(--muted); }

/* Body text */
section { margin-top: 3.4rem; }
h2 { margin: 0 0 .9rem; font-weight: 400; font-style: italic; font-size: 1.5rem; line-height: 1.25; }
h3 { margin: 1.8rem 0 .4rem; font-weight: 600; font-size: 1rem; }
p { margin: 0 0 1rem; max-width: var(--col); }
.lead { font-size: 1.1rem; }
.small { font-size: .85rem; color: var(--muted); }
strong { font-weight: 600; }

/* Margin notes: right margin on wide screens, inline under the paragraph otherwise */
.with-note { position: relative; max-width: var(--col); }
.note { display: block; font-size: .78rem; line-height: 1.4; color: var(--ink-2); margin: -.3rem 0 1.2rem; padding-left: .8rem; border-left: 1px solid var(--rule); }
@media (min-width: 1000px) {
  .note { position: absolute; left: calc(100% + 2.5rem); top: .2rem; width: var(--margin); margin: 0; padding: 0; border: 0; }
}

/* Figures */
figure { margin: 2rem 0 2.4rem; max-width: var(--col); }
figcaption { margin-top: .8rem; font-size: .82rem; line-height: 1.45; color: var(--ink-2); }
figcaption b { font-weight: 600; color: var(--ink); }
.stack { display: flex; gap: 2px; height: 1.3rem; }
.stack span { display: block; height: 100%; }
.stack span:first-child { border-radius: 3px 0 0 3px; }
.stack span:last-child { border-radius: 0 3px 3px 0; }
.owns { background: var(--owns); }
.leaks { background: var(--leaks); }
.none { background: repeating-linear-gradient(135deg, var(--none) 0 3px, #ebe8e0 3px 6px); }
.key { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; margin: .7rem 0 0; padding: 0; list-style: none; font-size: .85rem; color: var(--ink-2); }
.key li { display: inline-flex; align-items: center; gap: .45rem; }
.key i { width: .7rem; height: .7rem; border-radius: 2px; display: inline-block; }
.key b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

.bars { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.bars li { display: grid; grid-template-columns: 8.5rem 1fr 3rem; align-items: center; gap: .7rem; padding: .16rem 0; }
.bars .t { height: .55rem; }
.bars .f { display: block; height: 100%; background: var(--rest); border-radius: 0 3px 3px 0; }
.bars li.hl .f { background: var(--owns); }
.bars li.hl span:first-child { font-weight: 600; }
.bars .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* Publication list, set like a reference list */
.refs { list-style: none; margin: 0; padding: 0; max-width: var(--col); }
.refs li { padding: .85rem 0; border-top: 1px solid var(--rule); }
.refs li:last-child { border-bottom: 1px solid var(--rule); }
.refs .when { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .1rem; }
.refs .title { font-size: 1.05rem; }
.refs .title a { text-decoration-color: transparent; }
.refs .title a:hover { text-decoration-color: var(--ink); }
.refs .desc { display: block; margin-top: .2rem; font-size: .9rem; color: var(--ink-2); }
.refs .files { display: block; margin-top: .25rem; font-size: .8rem; color: var(--muted); }
.refs .files a { margin-right: .8rem; }

/* Plain data table */
table.data { width: 100%; max-width: var(--col); border-collapse: collapse; font-size: .86rem; margin: 1.2rem 0 1.6rem; }
table.data th { text-align: left; font-weight: 600; padding: .4rem .8rem .4rem 0; border-bottom: 1px solid var(--ink); }
table.data td { padding: .55rem .8rem .55rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; color: var(--ink-2); }
table.data td:first-child { color: var(--ink); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wide table.data, .wide p, .wide figure { max-width: none; }

/* Footer */
.colophon { margin-top: 5rem; padding-top: 1.1rem; border-top: 1px solid var(--rule); font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .4rem 1.3rem; }
.colophon a { color: var(--muted); }
.colophon span:first-child { margin-right: auto; }
table.data td:first-child { white-space: nowrap; }

/* The instrument: one key number, red underline */
.instrument { display: inline-block; font-size: 3.4rem; line-height: 1; letter-spacing: -.02em; border-bottom: 3px solid var(--red); padding-bottom: .2rem; margin: .4rem 0 .9rem; }
mark { background: var(--sage-wash); color: inherit; padding: 0 .15em; }
/* Bibliography rows: date in a left column */
.refs li { display: grid; grid-template-columns: 7.5rem 1fr; column-gap: 1rem; padding: .6rem 0; }
.refs .when { grid-row: span 2; margin: .2rem 0 0; }
.refs .files { grid-column: 2; }
@media (max-width: 560px) { .refs li { grid-template-columns: 1fr; } .refs .files { grid-column: 1; } }

/* Builder line under the name in the masthead */
.masthead .name small { display: block; font-size: .72rem; color: var(--muted); margin-top: .05rem; }
.masthead .name span { display: block; line-height: 1.15; }

/* Projects: two columns of plain text between hairlines, no boxes */
.projects { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.5rem; max-width: calc(var(--col) + 8rem); margin: 0; padding: 0; list-style: none; }
.projects li { border-top: 1px solid var(--rule); padding: 1rem 0 1.4rem; }
.projects h3 { margin: 0 0 .25rem; font-size: 1.1rem; font-weight: 600; }
.projects p { margin: 0 0 .7rem; font-size: .92rem; color: var(--ink-2); }
.projects .figure { display: block; font-size: 1.9rem; line-height: 1.1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.projects .figure-note { display: block; font-size: .78rem; color: var(--muted); margin: .15rem 0 .6rem; }
.projects .links { font-size: .82rem; color: var(--muted); }
.projects .links a { margin-right: .8rem; }
@media (max-width: 720px) { .projects { grid-template-columns: 1fr; } }

/* Lab notes: a dated stream */
.notes { list-style: none; margin: 0; padding: 0; max-width: var(--col); }
.notes li { display: grid; grid-template-columns: 6.2rem 6.5rem 1fr; column-gap: .8rem; padding: .55rem 0; border-top: 1px solid var(--rule); font-size: .95rem; }
.notes li:last-child { border-bottom: 1px solid var(--rule); }
.notes time { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: .15rem; }
.notes .kind { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: .22rem; }
.notes a { text-decoration-color: transparent; }
.notes a:hover { text-decoration-color: var(--ink); }
.notes .desc { display: block; font-size: .85rem; color: var(--ink-2); margin-top: .15rem; }
@media (max-width: 560px) { .notes li { grid-template-columns: 1fr; } .notes .kind { padding: 0; } }

/* Result tables on project pages */
table.data td.us { color: var(--ink); font-weight: 600; }

/* Chosen top (Nov 2026): Tufte running line, the name once, set in mono.
   Mono is used only for the name; everything else is Libertinus. */
@font-face { font-display: swap; font-family: 'Share Tech Mono'; src: url('/public/fonts/ShareTechMono-Regular.woff2') format('woff2'); }
:root { --mono: 'Share Tech Mono', ui-monospace, monospace; }
.masthead { border-bottom: 0; margin-bottom: 3.2rem; padding-top: 1.6rem; }
.masthead nav { margin-left: auto; }
.masthead .home { font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; text-decoration: none; color: var(--ink); }
h1.mono-title { font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em; font-size: 2.4rem; }
.colophon .sign { display: inline-flex; align-items: center; gap: .5rem; }
.colophon .sign img { width: 18px; height: 18px; }

/* Chosen home (Nov 2026): Hara layout on soft white, one colored dot per project.
   Soft white and softer ink cut glare while staying far above 4.5:1 (ink 13.8:1, grey 6.5:1). */
:root { --paper: #fdfcf9; --ink: #2b2b2b; --ink-2: #3a3a3a; --muted: #5c5c5c; --rule: #ecebe6;
        --c-aa: #6d52bd; --c-audit: #2f6f5e; --c-gpu: #9a6700; --c-sa: #24496e; }
body { line-height: 1.6; }
a { text-decoration-color: #c9c7c0; }
.aa { --c: var(--c-aa); } .audit { --c: var(--c-audit); } .gpu { --c: var(--c-gpu); } .sa { --c: var(--c-sa); }
.home-hara h1.mono-title { font-size: 1.9rem; margin-top: 4rem; }
.home-hara .subtitle { font-size: 1.2rem; }
.home-hara .intro { font-size: 1.05rem; max-width: 32rem; margin: 3.5rem 0 0; }
.home-hara .stats { margin-top: 1.4rem; max-width: 34rem; color: var(--ink-2); }
.home-hara .stats b { font-weight: 600; }
.home-hara section { margin-top: 0; }
.projects-hara { margin: 4.5rem 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 3rem 4rem; max-width: 48rem; }
.projects-hara h2 { margin: 0; font-style: normal; font-weight: 600; font-size: 1rem; }
.projects-hara p { margin: .2rem 0 0; font-size: .95rem; color: var(--ink-2); }
.projects-hara small { display: block; color: var(--muted); font-size: .78rem; margin-top: .35rem; }
.projects-hara .links { display: block; font-size: .8rem; margin-top: .4rem; }
.projects-hara .links a { margin-right: .8rem; color: var(--muted); }
.dot::before { content: ""; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--c); margin-right: .55rem; vertical-align: .08rem; }
.notes-hara { list-style: none; padding: 0; margin: 4.5rem 0 0; max-width: 34rem; }
.notes-hara li { display: grid; grid-template-columns: 6.5rem 1fr; gap: .8rem; padding: .5rem 0; font-size: .92rem; }
.notes-hara time { color: var(--muted); font-size: .8rem; padding-top: .12rem; font-variant-numeric: tabular-nums; }
.notes-hara a.dot::before { width: .42rem; height: .42rem; }
.notes-hara a { text-decoration-color: #d8d6cf; }
@media (max-width: 720px) { .projects-hara { grid-template-columns: 1fr; } .notes-hara li { grid-template-columns: 1fr; gap: 0; } }

/* Project findings: one sentence and a small chart each (Nov 2026) */
.projects-hara .head { margin: .4rem 0 .75rem; font-size: 1.05rem; line-height: 1.38; color: var(--ink); }
.fbars { list-style: none; margin: 0; padding: 0; font-size: .74rem; color: var(--ink-2); }
.fbars li { display: grid; grid-template-columns: 7.6rem 1fr 2.8rem; gap: .5rem; align-items: center; padding: .12rem 0; }
.fbars i { display: block; height: .5rem; background: #dcdad3; border-radius: 0 2px 2px 0; }
.fbars li.hl i { background: var(--c); }
.fbars li.hl span:first-child { font-weight: 600; color: var(--ink); }
.fbars .v { text-align: right; font-variant-numeric: tabular-nums; }
.fstack { display: flex; gap: 2px; height: .6rem; margin: .25rem 0 .45rem; }
.fstack i { display: block; height: 100%; }
.fkey { font-size: .74rem; color: var(--muted); }

/* One color (Nov 21): no per-project hues. The highlighted bar is ink, the rest grey. */
.aa, .audit, .gpu, .sa { --c: var(--ink); }
.dot::before { display: none; }
.fbars li.hl i { background: var(--ink); }
@media (max-width: 720px) {
  html { font-size: 18px; }
  .page { padding: 0 1.1rem 3rem; }
  .masthead { padding-top: 1.1rem; margin-bottom: 2.2rem; }
  .masthead nav { gap: 1rem; }
  .home-hara h1.mono-title { margin-top: 2rem; font-size: 1.6rem; }
  .projects-hara { gap: 2.4rem; margin-top: 2.6rem; }
  .fbars li { grid-template-columns: 6.4rem 1fr 2.6rem; }
  .notes-hara { margin-top: 3rem; }
  .colophon { gap: .4rem 1rem; }
  .colophon .sign { width: 100%; }
}
@media (max-width: 720px) { table.data { font-size: .76rem; } table.data th, table.data td { padding-right: .45rem; } table.data td:first-child { white-space: normal; } }
.bars li.hl .f { background: var(--ink); }

/* Canon fixes (Nov 21): tap targets of at least 40px for the menu and footer links
   (Rams, Norman; WCAG 2.5.8), and a 34rem column so body lines stay under about 80 characters (Butterick). */
:root { --col: 34rem; }
.masthead a, .masthead nav a, .colophon a { display: inline-flex; align-items: center; min-height: 40px; }

/* Brand green and red on the charts (Nov 21): the result we're reporting is green, the baseline or the failure is red, the rest grey. */
:root { --good: #b5d6c0; --bad: #e5544c; }
.fbars li.hl i, .fstack i.good { background: var(--good); }
.fbars li.lo i, .fstack i.bad { background: var(--bad); }
.bars li.hl .f { background: var(--good); }
.bars li.lo .f { background: var(--bad); }
/* Stacked bars match the ranked bars: same height, same rounded ends */
.fstack { height: .5rem; }
.fstack i:first-child { border-radius: 2px 0 0 2px; } .fstack i:last-child { border-radius: 0 2px 2px 0; }

/* Launch pass (Nov 21): fewer type sizes (15/16/18/20/24 and the title), bigger tap areas. */
.projects-hara h2, .projects-hara .head { font-size: 1rem; }
.projects-hara p { font-size: .9rem; }
.projects-hara small, .projects-hara .links, .fkey { font-size: .8rem; }
.fbars { font-size: .75rem; }
.home-hara .subtitle { font-size: 1.2rem; }
.note a { padding: .4rem 0; }
