/* ==========================================================================
   Alceus Bio — writing
   One stylesheet for the index and the article pages.

   Palette      sheet #F9F9F9 · ink #2A2A2A · accent #FF5A00
   Typeface     Geist, Light (300) throughout; Regular (400) / Medium (500)
                for emphasis and small labels. Self-hosted, see site/fonts/ --
                SIL Open Font License 1.1, licence kept beside the files.
   ========================================================================== */

/* --- typeface ------------------------------------------------------------ */

@font-face{
  font-family:"Geist";
  src:url("fonts/Geist-Light.woff2") format("woff2");
  font-weight:300; font-style:normal; font-display:swap;
}
@font-face{
  font-family:"Geist";
  src:url("fonts/Geist-LightItalic.woff2") format("woff2");
  font-weight:300; font-style:italic; font-display:swap;
}
@font-face{
  font-family:"Geist";
  src:url("fonts/Geist-Regular.woff2") format("woff2");
  font-weight:400; font-style:normal; font-display:swap;
}
@font-face{
  font-family:"Geist";
  src:url("fonts/Geist-Medium.woff2") format("woff2");
  font-weight:500; font-style:normal; font-display:swap;
}

/* --- tokens -------------------------------------------------------------- */

:root{
  --sheet:#F9F9F9;
  --ink:#2A2A2A;
  --ink-60:#6e7073;
  --ink-40:#9a9c9e;
  --accent:#FF5A00;
  --accent-wash:rgba(255,90,0,.08);
  --rule:rgba(42,42,42,.14);
  --rule-soft:rgba(42,42,42,.08);

  --font:"Geist",-apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;

  --body:1.045rem;             /* 16.7px */
  --lh:1.62;
  --measure:50rem;             /* ~85 characters at the body size */
  --figure:54rem;              /* figure column — set independently of --measure */
  --rail:max(0rem,calc((var(--figure) - var(--measure)) / 2));

  --gap:clamp(1.25rem,4vw,2rem);
  --block:clamp(2.75rem,7vw,4.5rem);

  color-scheme:light;
}

/* --- reset --------------------------------------------------------------- */

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

html{
  -webkit-text-size-adjust:100%;
  scroll-behavior:smooth;
}
@media (prefers-reduced-motion:reduce){ html{scroll-behavior:auto} }

body{
  margin:0;
  background:var(--sheet);
  color:var(--ink);
  font-family:var(--font);
  font-weight:300;
  font-size:var(--body);
  line-height:var(--lh);
  font-kerning:normal;
  font-variant-numeric:proportional-nums;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
}

img,svg,iframe{max-width:100%}
hr{border:0;border-top:1px solid var(--rule);margin:var(--block) 0}

::selection{background:var(--accent);color:#fff}

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

.skip{
  position:absolute;left:-9999px;top:0;
  background:var(--ink);color:var(--sheet);
  padding:.6rem 1rem;font-size:.85rem;z-index:100;
}
.skip:focus{left:.75rem;top:.75rem}

/* --- masthead ------------------------------------------------------------ */

.masthead{
  position:sticky;top:0;z-index:50;
  background:color-mix(in srgb,var(--sheet) 88%,transparent);
  backdrop-filter:saturate(1.1) blur(10px);
  -webkit-backdrop-filter:saturate(1.1) blur(10px);
  border-bottom:1px solid var(--rule-soft);
}
.masthead-in{
  max-width:76rem;margin:0 auto;
  padding:.95rem var(--gap);
  display:flex;align-items:center;gap:1.5rem;
}

/* The mark alone, top left as on alceus.bio, linking to the homepage — which
   is why the nav carries no Home item.

   assets/alceus-mark.png is the icon cropped out of the site's wordmark
   lockup, rendered twice in one file: black on the top half, #FF5A00 on the
   bottom. Hovering shifts which half is shown rather than swapping files, so
   both states arrive in one request with no flash, and it needs nothing
   beyond a plain <img> — no CSS mask, no filter.

   It is an <img> and not a background-image on purpose. A background-image is
   dropped by anything that suppresses backgrounds — printing with "background
   graphics" off, some reader and email views, forced-colours modes — and when
   it fails it leaves a silent empty box, which on this sheet reads as a white
   gap where the logo should be. An <img> survives all of that and, if it ever
   does fail, shows its alt text instead of nothing.

   The sprite trick is the same as background-position, one layer up: the box
   is one frame tall, object-fit:cover scales the two-frame image to the box
   width so it overflows to exactly twice the height, and object-position
   picks the half. */
.wordmark{display:block;line-height:0;text-decoration:none}
.wordmark .mark{
  display:block;height:24px;width:auto;aspect-ratio:217/159;
  object-fit:cover;object-position:0 0;          /* top half: ink */
}
.wordmark:hover .mark,
.wordmark:focus-visible .mark{object-position:0 100%}   /* bottom half: accent */

.masthead nav{
  margin-left:auto;
  display:flex;gap:1.4rem;align-items:baseline;
  font-size:.75rem;letter-spacing:.14em;text-transform:uppercase;
}

@media (max-width:30rem){
  .masthead-in{gap:1rem}
  .masthead nav{gap:.9rem;font-size:.66rem;letter-spacing:.1em}
  .wordmark .mark{height:20px}
}
.masthead nav a{
  color:var(--ink-60);text-decoration:none;
  padding-bottom:.15rem;border-bottom:1px solid transparent;
}
.masthead nav a:hover{color:var(--accent);border-bottom-color:var(--accent)}
.masthead nav a[aria-current="page"]{color:var(--ink);border-bottom-color:var(--accent)}

/* reading progress — a single hairline, nothing more */
.progress{
  position:fixed;top:0;left:0;height:2px;width:0;
  background:var(--accent);z-index:60;
  transition:width .08s linear;
}
@media (prefers-reduced-motion:reduce){ .progress{transition:none} }

/* --- shared bits --------------------------------------------------------- */

.eyebrow{
  margin:0;
  font-size:.7rem;font-weight:400;letter-spacing:.2em;text-transform:uppercase;
  color:var(--accent);
}
.eyebrow .sep{color:var(--ink-40);margin:0 .5em}

.meta{
  font-size:.78rem;letter-spacing:.1em;text-transform:uppercase;
  color:var(--ink-40);
}

a.quiet{color:inherit;text-decoration:none}

/* --- index page ---------------------------------------------------------- */

.shell{max-width:76rem;margin:0 auto;padding:0 var(--gap)}

.index-hero{padding:clamp(4rem,12vw,8.5rem) 0 clamp(2.5rem,6vw,4rem)}
.index-hero h1{
  margin:1.4rem 0 0;
  font-size:clamp(2.6rem,8vw,5.25rem);
  font-weight:300;line-height:1;letter-spacing:-.035em;
  color:var(--ink);text-wrap:balance;max-width:24ch;
}
.index-hero h1 em{font-style:normal;color:var(--accent)}
.index-hero .lede{
  margin:1.75rem 0 0;max-width:none;   /* spans the full shell, like the post rows */
  font-size:clamp(1.0625rem,2.2vw,1.3125rem);line-height:1.52;color:var(--ink-60);
}

.post-list{list-style:none;margin:0;padding:0;border-top:1px solid var(--rule)}
.post-list li{border-bottom:1px solid var(--rule)}

.post-row{
  display:grid;
  grid-template-columns:9.5rem 1fr 7rem;
  gap:var(--gap);align-items:start;
  padding:clamp(1.9rem,4vw,2.9rem) 0;
  text-decoration:none;color:inherit;
}
.post-row .when{
  font-size:.78rem;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-40);
  padding-top:.5rem;
}
.post-row h2{
  margin:0;font-size:clamp(1.45rem,3.2vw,2.1rem);font-weight:300;line-height:1.14;
  letter-spacing:-.02em;color:var(--ink);text-wrap:balance;
  transition:color .15s ease;
}
.post-row p{margin:.7rem 0 0;max-width:46rem;color:var(--ink-60);font-size:1rem;line-height:1.55}
.post-row .tags{
  margin:1rem 0 0;display:flex;flex-wrap:wrap;gap:.5rem;
  font-size:.7rem;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-40);
}
.post-row .tags span{border:1px solid var(--rule);border-radius:999px;padding:.25rem .6rem}
.post-row .go{
  justify-self:end;padding-top:.45rem;
  font-size:.75rem;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-40);
  white-space:nowrap;
}
.post-row:hover h2,.post-row:focus-visible h2{color:var(--accent)}
.post-row:hover .go,.post-row:focus-visible .go{color:var(--accent)}

.post-row.upcoming{cursor:default}
.post-row.upcoming h2{color:var(--ink-40)}
.post-row.upcoming:hover h2{color:var(--ink-40)}

@media (max-width:52rem){
  .post-row{grid-template-columns:1fr;gap:.35rem}
  .post-row .when{padding-top:0}
  .post-row .go{display:none}
}

/* --- article: layout grid ------------------------------------------------ */
/*
   One grid for the whole article. Prose sits in the `text` column; figures and
   full-bleed callouts span `wide`, so they breathe without breaking alignment.
*/
.article{
  display:grid;
  grid-template-columns:
    [full-start] minmax(var(--gap),1fr)
    [wide-start] minmax(0,var(--rail))
    [text-start] minmax(0,var(--measure)) [text-end]
    minmax(0,var(--rail)) [wide-end]
    minmax(var(--gap),1fr) [full-end];
}
.article > *{grid-column:text}
.article > .wide{grid-column:wide}
.article > .full{grid-column:full}

/* Below the point where the side columns can still earn their keep, drop the
   grid entirely — otherwise they steal width from the measure. */
@media (max-width:60rem){
  .article{display:block;padding-inline:var(--gap)}
  .article > *,
  .article > .wide,
  .article > .full,
  .article-head,
  .endmatter,
  .next{max-width:100%;grid-column:auto}
}

/* --- article: header ----------------------------------------------------- */

.article-head{
  grid-column:wide;
  padding:clamp(3.5rem,9vw,6.5rem) 0 0;
}
.article-head h1{
  margin:1.5rem 0 0;
  font-size:clamp(2.4rem,6.4vw,4.25rem);
  font-weight:300;line-height:1.03;letter-spacing:-.034em;
  color:var(--ink);text-wrap:balance;max-width:26ch;
}
.article-head .deck{
  /* left edge flush with the h1; width matches the body measure */
  margin:1.6rem 0 0;max-width:var(--measure);
  font-size:clamp(1.0625rem,2.4vw,1.375rem);line-height:1.5;
  font-weight:300;color:var(--ink-60);text-wrap:pretty;
}
.byline{
  margin:clamp(2.25rem,5vw,3.25rem) 0 0;
  padding:1rem 0;
  border-top:1px solid var(--rule);border-bottom:1px solid var(--rule);
  display:flex;flex-wrap:wrap;gap:.6rem 2rem;align-items:baseline;
  font-size:.78rem;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-40);
}
.byline strong{font-weight:400;color:var(--ink);letter-spacing:.1em}

/* --- article: prose ------------------------------------------------------ */

.article p,
.article ul,
.article ol,
.article .callout,
.article .pullquote,
.article .note{text-wrap:pretty}

/* Half-margins top and bottom: `.article` is a grid container, so adjacent
   margins do NOT collapse — a symmetric 1.35em read as 2.7em between every
   pair of paragraphs. */
.article > p{margin:.675em 0}

/* Justified body copy. No hyphenation: a word that doesn't fit moves whole to
   the next line, and the line's word spacing takes up the slack. */
.article > p,
.article ul,
.article ol{
  text-align:justify;
  text-justify:inter-word;
  hyphens:none;
  -webkit-hyphens:none;
  overflow-wrap:break-word;   /* only ever for a word longer than the line */
}
/* Without hyphenation a short line justifies badly, so below tablet width the
   text goes ragged-right rather than stretching the word spaces. */
@media (max-width:48rem){
  .article > p,
  .article ul,
  .article ol{text-align:left}
}

/* opening paragraph gets a touch more presence, no drop cap theatrics */
.article > p.lede{
  font-size:1.3125rem;line-height:1.52;color:var(--ink);
}

.article h2{
  margin:calc(var(--block) * .5) 0 0;
  font-size:clamp(1.5rem,3.4vw,2.125rem);
  font-weight:300;line-height:1.14;letter-spacing:-.022em;
  color:var(--accent);text-wrap:balance;
  /* no max-width: the longest heading should sit on one line at full measure */
}
.article h2 + p{margin-top:1.1rem}

.article h3{
  margin:calc(var(--block) * .62) 0 0;
  font-size:1.125rem;font-weight:500;line-height:1.35;letter-spacing:-.005em;
  color:var(--accent);
}
.article h3 + p{margin-top:.6rem}

.article a:not(.quiet){
  color:var(--accent);
  text-decoration:underline;
  text-decoration-thickness:1px;
  text-underline-offset:.18em;
  text-decoration-color:color-mix(in srgb,var(--accent) 45%,transparent);
}
.article a:not(.quiet):hover{
  text-decoration-color:var(--accent);
  background:var(--accent-wash);
}

.article strong{font-weight:500}
.article em{font-style:italic}

.article ul,.article ol{margin:.675em 0;padding-left:1.4em}
.article li{margin:.5em 0}
.article li::marker{color:var(--accent)}
.article ul{list-style:none;padding-left:0}
.article ul > li{position:relative;padding-left:1.4em}
.article ul > li::before{
  content:"";position:absolute;left:.15em;top:.72em;
  width:.42em;height:1px;background:var(--accent);
}

.article code{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:.86em;background:rgba(42,42,42,.055);
  padding:.12em .36em;border-radius:3px;
}

/* --- article: figures ---------------------------------------------------- */

figure.fig{
  /* Half the whitespace a figure used to sit in. The gap a reader sees is this
     margin plus the neighbouring paragraph's own, so .42 of --block is what
     halves the measured gap (83px -> 42px at a desktop width), not .5. Two
     figures in a row sit 61px apart instead of 144px. */
  margin:calc(var(--block) * .42) 0;
}
/* Below 60rem the article is display:block rather than a grid, so margins
   collapse and the gap is the figure's margin alone instead of the sum of
   two. Half of --block is then exactly half the gap. */
@media (max-width:60rem){
  figure.fig{margin:calc(var(--block) * .5) 0}
}
figure.fig .frame{
  position:relative;
  background:var(--sheet);
}
figure.fig iframe{
  display:block;width:100%;border:0;
  min-height:220px;
  /* height is set by the figure itself via postMessage */
}
/* The caption rule spans the full width of the figure it belongs to. */
figure.fig figcaption{
  margin:1.15rem 0 0;
  padding-top:.9rem;
  border-top:1px solid var(--rule);
  font-size:.89rem;line-height:1.5;color:var(--ink-60);
}
figure.fig figcaption .label{
  display:block;margin-bottom:.5rem;
  font-size:.7rem;font-weight:400;letter-spacing:.2em;text-transform:uppercase;
  color:var(--accent);
}

/* Every figure gets the same column, the same margins and the same caption
   rule, whatever it draws inside. Figures 3 and 6 used to be narrowed to 67%
   because they are sparse — two bars, a single waterfall — but that gave them
   different margins from the other four, and a run of figures reads as a
   series. Uniform frame, varying content: the content is allowed to differ,
   the frame is not. */

/* placeholder for a figure that hasn't landed yet */
.fig-pending .frame{
  border:1px dashed var(--rule);
  min-height:16rem;
  display:grid;place-items:center;
  text-align:center;padding:2rem;
}
.fig-pending .frame p{
  margin:0;font-size:.8rem;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-40);
}

/* --- article: emphasis blocks ------------------------------------------- */

.pullquote{
  margin:calc(var(--block) * .5) 0;
  padding-left:clamp(1rem,2.5vw,1.75rem);
  border-left:2px solid var(--accent);
}
.pullquote p{
  margin:0;
  font-size:clamp(1.3125rem,2.9vw,1.75rem);line-height:1.3;letter-spacing:-.018em;
  font-weight:300;color:var(--ink);
}
.pullquote cite{
  display:block;margin-top:.9rem;
  font-style:normal;font-size:.78rem;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-40);
}

/* a row of headline numbers */
.stats{
  margin:var(--block) 0;
  display:grid;grid-template-columns:repeat(auto-fit,minmax(10rem,1fr));
  gap:1px;background:var(--rule);
  border:1px solid var(--rule);
}
.stats div{background:var(--sheet);padding:1.35rem 1.25rem}
.stats dt{
  margin:0 0 .5rem;
  font-size:.68rem;letter-spacing:.16em;text-transform:uppercase;color:var(--ink-40);
}
.stats dd{
  margin:0;
  font-size:clamp(1.75rem,4vw,2.5rem);line-height:1;letter-spacing:-.03em;
  font-weight:300;color:var(--accent);
  font-variant-numeric:lining-nums tabular-nums;
}
.stats dd small{
  display:block;margin-top:.55rem;
  font-size:.8125rem;line-height:1.45;letter-spacing:0;color:var(--ink-60);
  font-variant-numeric:normal;
}

.callout{
  margin:var(--block) 0;
  padding:1.5rem clamp(1.25rem,3vw,1.9rem);
  background:#fff;border:1px solid var(--rule-soft);
}
.callout > :first-child{margin-top:0}
.callout > :last-child{margin-bottom:0}
.callout h3{margin:0 0 .7rem;color:var(--ink);font-size:.72rem;font-weight:400;
  letter-spacing:.18em;text-transform:uppercase}
.callout p{margin:.8em 0;font-size:1rem;line-height:1.58;color:var(--ink-60)}

/* --- article: notes & references ---------------------------------------- */

.footnote-ref{
  font-size:.7em;font-feature-settings:"sups" off;
  vertical-align:super;line-height:0;
  padding-left:.08em;
}

.endmatter{
  grid-column:wide;
  margin:calc(var(--block) * 1.3) 0 0;
  padding:var(--block) 0 0;
  border-top:1px solid var(--rule);
}
.endmatter h2{
  margin:0 0 1.25rem;
  font-size:.72rem;font-weight:400;letter-spacing:.2em;text-transform:uppercase;
  color:var(--ink-40);max-width:none;
}
.endmatter ol{margin:0;padding-left:1.6em;max-width:var(--measure)}
.endmatter li{margin:.65em 0;font-size:.9375rem;line-height:1.55;color:var(--ink-60)}
.endmatter li::marker{color:var(--ink-40)}

.methods dl{margin:0;max-width:52rem}
.methods dt{
  margin:1.4em 0 .35em;font-size:.72rem;letter-spacing:.16em;text-transform:uppercase;
  color:var(--ink);font-weight:400;
}
.methods dt:first-child{margin-top:0}
.methods dd{margin:0;font-size:.9375rem;line-height:1.6;color:var(--ink-60)}

/* --- article: next / footer --------------------------------------------- */

.next{
  grid-column:wide;
  margin:var(--block) 0 0;
  border-top:1px solid var(--rule);
}
/* beats `.article a:not(.quiet)`, which would otherwise underline this card */
.article .next a,
.next a{
  display:grid;grid-template-columns:1fr auto;gap:var(--gap);align-items:center;
  padding:clamp(1.75rem,4vw,2.5rem) 0;
  text-decoration:none;color:inherit;background:none;
}
.article .next a:hover{background:none}
.next .k{
  display:block;margin-bottom:.6rem;
  font-size:.7rem;letter-spacing:.2em;text-transform:uppercase;color:var(--ink-40);
}
.next h2{
  margin:0;font-size:clamp(1.3rem,2.8vw,1.75rem);font-weight:300;line-height:1.16;
  letter-spacing:-.02em;color:var(--ink);max-width:28ch;
}
.next a:hover h2{color:var(--accent)}
.next .arrow{font-size:1.5rem;color:var(--ink-40)}
.next a:hover .arrow{color:var(--accent)}

.site-footer{
  margin-top:clamp(4rem,10vw,7rem);
  border-top:1px solid var(--rule);
}
.site-footer-in{
  max-width:76rem;margin:0 auto;padding:clamp(2.25rem,5vw,3rem) var(--gap);
  display:flex;flex-wrap:wrap;gap:1rem 2.5rem;align-items:baseline;
  font-size:.78rem;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-40);
}
.site-footer-in a{color:var(--ink-60);text-decoration:none}
.site-footer-in a:hover{color:var(--accent)}
.site-footer-in .right{margin-left:auto;display:flex;gap:1.5rem;flex-wrap:wrap}

/* --- draft scaffolding (delete before publishing) ----------------------- */

.draft-banner{
  background:var(--accent);color:#fff;
  font-size:.75rem;letter-spacing:.12em;text-transform:uppercase;
  padding:.65rem var(--gap);text-align:center;
}
.draft-banner b{font-weight:500}
/* Marker sits out in the margin and takes no layout space, so it can't crowd
   the text it marks. */
[data-placeholder]{position:relative}
[data-placeholder]::before{
  content:"";position:absolute;top:0;bottom:0;left:-1.5rem;
  width:2px;background:var(--accent);
}
@media (max-width:60rem){
  [data-placeholder]::before{left:-.85rem}
}

/* --- print --------------------------------------------------------------- */

@media print{
  .masthead,.progress,.next,.site-footer,.draft-banner{display:none}
  body{background:#fff;font-size:10.5pt;line-height:1.5}
  .article{display:block;max-width:none}
  .article > *,.article > .wide,.article > .full{max-width:34rem}
  .article h2,.article h3,.article a:not(.quiet){color:#2A2A2A}
  figure.fig{break-inside:avoid}
  figure.fig iframe{height:auto}
}
