/* The logo wordmark, self-hosted so the page stays free of third-party requests.
   Only the latin subset is shipped; the title has no Arabic text to set. */
@font-face {
  font-family: 'Amiri';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/amiri-latin-400.woff2) format('woff2');
}

/* The nav face. Latin subset only, at the single weight the menu uses. */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/lato-latin-400.woff2) format('woff2');
}

:root {
  color-scheme: light;
  --burgundy: #730f24;
  --cardinal: #990000;
  --gold: #e6b649;
  --yellow: #ffcc00;
  --tan: #dfc9a6;
  --ink: #362722;
  --muted: #625044;
  --rule: #aa8e6d;
  --accent: #730f24;
  --panel: #ead7b9;
  --highlight: #dcc09a;
  font-family: Arial, Helvetica, sans-serif;
  --page-background: var(--tan);
  background: var(--page-background);
  color: var(--ink);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page-background: #050914;
  --ink: #fff;
  --muted: #c7c5c8;
  --rule: #364158;
  --accent: #f0c774;
  --panel: #0e1626;
  --highlight: #1e2a3d;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  /* Keep the mosaic width unchanged when a short page needs no scrollbar. */
  scrollbar-gutter: stable;
}
body { margin: 0; }
a { color: inherit; text-underline-offset: 5px; }


/* LessWrong-style marker for links to Project Spica content. */
#main a[href^="/"]::after,
#main a[href^="#"]::after,
#main a[href^="https://projectspica.org"]::after {
  content: "✧";
  display: inline-block;
  margin-left: 0.08em;
  font-size: 0.62em;
  line-height: 1;
  vertical-align: super;
  text-decoration: none;
}
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
[hidden] { display: none !important; }
button { font: inherit; }
::selection { background: var(--yellow); color: var(--burgundy); }

.site-header {
  background: var(--page-background);
}
.mosaic-hero {
  position: relative;
  --hero-height: clamp(220px, 25vw, 320px);
  --mosaic-id: standard;
  --mosaic-ratio: 4;
  height: var(--hero-height);
  overflow: hidden;
}
/* Always show the full height. A wider composition supplies extra sky and
   fields instead of letting a scaled-up 4:1 image fall below the banner. The
   crop anchor is the sun's x coordinate, keeping it in the same screen position. */
.mosaic-scene {
  position: absolute;
  width: calc(var(--hero-height) * var(--mosaic-ratio));
  height: 100%;
  top: 0;
  left: 74.6428571429%;
  transform: translateX(-74.6428571429%);
}
.mosaic-picture { display: contents; }
.mosaic-art {
  position: absolute;
  display: block;
  width: 100%;
  height: 100%;
}
.mosaic-night { visibility: hidden; }
:root[data-theme="dark"] .mosaic-day { opacity: 0; }
:root[data-theme="dark"] .mosaic-night { visibility: visible; }
.theme-toggle {
  position: absolute;
  /* Every composition keeps y=96, r=63, and x=1045/1400 of its width. */
  left: calc(74.6428571429% - var(--hero-height) * 0.18);
  top: 9.428571%;
  width: calc(var(--hero-height) * 0.36);
  height: 36%;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 5px;
}

/* Keep these boundaries in sync with mosaic-layout.js; the server uses that
   manifest for <picture>, exports and the explicit public-asset allowlist. */
@media (width > 1280px) {
  .mosaic-hero { --mosaic-id: wide; --mosaic-ratio: 6; }
}
@media (width > 1920px) {
  .mosaic-hero { --mosaic-id: ultrawide; --mosaic-ratio: 8; }
}
@media (width > 2560px) {
  .mosaic-hero { --mosaic-id: panoramic; --mosaic-ratio: 12; }
}
@media (width > 3840px) {
  .mosaic-hero { --mosaic-id: extreme; --mosaic-ratio: 18; }
}
@media (width > 5760px) {
  /* No finite set of images covers every possible zoom/window combination.
     Cap the main canvas, extending only its edge landscape, not its sun/moon.
     The title remains over the main canvas, so Spica still uses exact tiles. */
  .mosaic-scene { left: 0; transform: none; }
  .mosaic-hero::before, .mosaic-hero::after {
    content: "";
    position: absolute;
    inset: 0 0 0 calc(var(--hero-height) * 18);
    background: url(/images/spica-extension.webp) left top / auto 100% repeat-x;
    pointer-events: none;
  }
  .mosaic-hero::after {
    background-image: url(/images/spica-extension-night.webp);
    visibility: hidden;
  }
  :root[data-theme="dark"] .mosaic-hero::after { visibility: visible; }
}

.title-group {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  /* Keep the title in the sky at every screen size. */
  top: calc(1.35em + 8px);
  left: clamp(20px, 4vw, 64px);
  font-size: clamp(32px, 4vw, 56px);
  /* Nudge the wordmark down off the skyline. The star subtracts this same
     amount, so Spica stays locked to its tile while the text moves. */
  --title-drop: 3px;
}
/* The invisible anchor marks the title's i-dot. The star and halo tiles are
   selected from the mosaic underneath it, keeping Spica aligned when the image
   is cropped. */
.spica-letter { position: relative; display: inline-block; }
/* Offset the anchor against the lowered text so the star stays in place. */
.spica-dot { position: absolute; top: calc(0.3em - var(--title-drop, 0px)); left: calc(50% + 0.5px); }
.mosaic-tile-colors {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* Daylight washes Spica and shadows its halo; night lights both.
   Both are drawn up front, so the toggle costs no relayout. */
.spica-night-mark { visibility: hidden; }
:root[data-theme="dark"] .spica-day-mark { visibility: hidden; }
:root[data-theme="dark"] .spica-night-mark { visibility: visible; }

.site-title {
  position: relative;
  top: var(--title-drop, 0px);
  z-index: 1;
  margin: 0;
  color: #ead4af;
  font: normal clamp(32px, 4vw, 56px)/1.15 'Amiri', Georgia, 'Times New Roman', serif;
  letter-spacing: -1px;
  text-shadow: 0 2px 6px #3d111b, 0 0 20px #3d111b80;
}

:root[data-theme="dark"] .site-title {
  text-shadow: 0 2px 6px #102344, 0 0 20px #10234480;
}

.prose { max-width: 680px; margin-inline: auto; }
.mission {
  width: calc(100% - 40px);
  padding-block: 24px 48px;
  scroll-margin-top: 32px;
}
p { margin: 0 0 1.1em; line-height: 1.7; }
.prose > p { font-size: 17px; }
p:last-child { margin-bottom: 0; }
h2, h3 { font-family: Georgia, 'Times New Roman', serif; font-weight: normal; }
h2 { font-size: clamp(30px, 4vw, 42px); line-height: 1.17; letter-spacing: -0.8px; margin: 0 0 26px; }
h3 { font-size: 25px; line-height: 1.3; margin: 32px 0 16px; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: 2px; font-size: 11px !important; font-weight: bold; margin-bottom: 18px; }
.page-layout {
  width: min(1000px, calc(100% - 40px));
  margin-inline: auto;
}
.section-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 28px;
  padding-block: 16px;
  color: var(--muted);
  font-family: 'Lato', Arial, Helvetica, sans-serif;
  /* Floor the horizontal nav at a legible size. The 13px below is tuned for the
     narrow desktop sidebar; carried onto a phone it reads far too small next to
     16px body copy. */
  font-size: 15px;
  line-height: 20px;
}
.section-nav a {
  position: relative;
  display: block;
  padding-block: 12px;
  white-space: nowrap;
  text-decoration: none;
  transition: color 150ms, opacity 150ms;
}
/* Like the reference's dot, each indicator scales in/out in place. */
.section-nav a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 7px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.section-nav a:hover:not([aria-current="page"]) { opacity: 0.6; }
.section-nav a[aria-current="page"] { color: var(--accent); }
.section-nav a[aria-current="page"]::after { transform: scaleX(1); }
#main { min-width: 0; }
#main > section { width: 100%; }
#main:focus { outline: none; }

/* Leave enough room for the sidebar, gap, and a comfortable reading column. */
@media (min-width: 900px) {
  .page-layout {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    column-gap: 40px;
    padding-top: 40px;
  }
  .section-nav {
    position: sticky;
    top: 32px;
    align-self: start;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0;
    margin-top: -6px;
    font-size: 13px;
  }
  #main > section { padding-top: 0; }
}
/* Both content lists share one rhythm: lines inside an entry pull tight so a
   wrapped item reads as a single block, and the gap between entries does the
   separating. Prose keeps the looser 1.85, which suits running text but makes a
   wrapped list item read as two separate entries. */
.research-links, .roadmap-section ul { margin: 0; font-size: 17px; line-height: 1.7; }
.research-links li + li, .roadmap-section li + li { margin-top: 16px; }
/* Give the thesis title room for its trailing star on desktop. */
#research .prose { max-width: 700px; }
.research-links { list-style: none; padding: 0; }
.mission a, .research-links a, #people a { color: var(--accent); text-decoration: none; }
.mission a:hover, .research-links a:hover, #people a:hover { text-decoration: underline; }
/* A dense text list, the way an academic homepage lists people: one person per
   line, set at body size, with line-height alone doing the separating. */
.people-list { list-style: none; margin: 20px 0 0; padding: 0; font-size: 17px; line-height: 1.7; }
.people-list a { font-size: inherit; }
.people-list .person-role { color: inherit; }
.content-section {
  width: min(960px, calc(100% - 40px));
  margin-inline: auto;
  padding-block: 24px 72px;
  scroll-margin-top: 20px;
}
.results-panel { max-width: 760px; margin: 32px auto; padding: 26px 32px; background: var(--panel); border: 1px solid var(--rule); }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.7; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-family: Georgia, 'Times New Roman', serif; font-size: 22px; margin-bottom: 22px; }
caption span { display: block; margin-top: 6px; font: normal 12px/1.7 Arial, Helvetica, sans-serif; color: var(--muted); }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--rule); text-align: right; }
th:first-child { text-align: left; }
thead th { font-size: 11px; font-weight: normal; color: var(--muted); }
tbody th { font-weight: normal; }
th span { display: block; font-size: 11px; color: var(--muted); }
.highlight-row { background: var(--highlight); }
.highlight-row td { color: var(--accent); font-weight: bold; }
.table-note { margin-top: 20px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.research-note { border-left: 3px solid var(--accent); padding-left: 22px; margin-block: 32px; }
.research-note h3 { font-size: 22px; margin-top: 0; }
.research-note p { font-size: 14px; color: var(--muted); }
.report-link { display: inline-block; color: var(--accent); font-size: 15px; }
.link-detail { display: block; font-size: 11px; color: var(--muted); margin-top: 9px; }
.roadmap-section h2 { font-size: 25px; line-height: 1.3; letter-spacing: normal; margin: 32px 0 16px; }
.roadmap-section h2:first-child { margin-top: 0; }
.roadmap-section ul { padding-left: 22px; }
.site-footer { width: min(960px, calc(100% - 40px)); margin-inline: auto; padding-block: 28px 40px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 20px; font-size: 12px; color: var(--muted); }
.site-footer a { font-family: Georgia, 'Times New Roman', serif; font-size: 16px; text-decoration: none; }
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10;
  padding: 12px 18px;
  background: var(--tan);
  color: var(--burgundy);
}
.skip-link:focus { top: 12px; }

/* Self-hosted OpenType MATH metrics keep hats, fences and underbraces accurate
   even on systems with no installed math font. Loaded only where math is used. */
@font-face {
  font-family: 'STIX Two Math';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/stix-two-math.woff2) format('woff2');
}

/* Long-form research uses the shared shell without the section switcher. */
.section-nav a[aria-current="location"] { color: var(--accent); }
.section-nav a[aria-current="location"]::after { transform: scaleX(1); }
.section-nav a[aria-current="location"]:hover { opacity: 1; }
.research-article {
  --article-baseline: #d6d3ce;
  max-width: 760px;
  margin-inline: auto;
  padding-block: 24px 72px;
  font-size: 17px;
  line-height: 1.7;
}
:root[data-theme="dark"] .research-article { --article-baseline: #30343c; }
.article-header { margin-bottom: 40px; }
.research-article h1 {
  font: normal clamp(30px, 3.5vw, 40px)/1.2 Georgia, 'Times New Roman', serif;
  letter-spacing: -0.6px;
  margin: 20px 0 24px;
}
.article-authors { margin-bottom: 4px; }
.article-date, .article-download { font-size: 14px; color: var(--muted); }
.article-download { margin-top: 18px; }
.research-article h2 { font-size: 27px; line-height: 1.3; letter-spacing: normal; margin: 40px 0 20px; }
.research-article [id] { scroll-margin-top: 24px; }
.research-article a { color: var(--accent); }
/* Citation and equation numbers retain the report's notation, without stars. */
#main .research-article a[href^="#"]::after { content: none; }
.research-article ol { padding-left: 24px; }
.research-article li + li { margin-top: 12px; }
.equation {
  display: flex;
  align-items: center;
  gap: 24px;
  overflow-x: auto;
  padding: 16px 4px;
  margin-block: 20px;
}
.research-article math { font-family: 'STIX Two Math', math; }
.equation math { flex: none; margin-inline: auto; font-size: 1.1em; }
.equation-number { flex: none; font-size: 14px; text-decoration: none; }
.boxed-equation math { border: 1px solid var(--rule); padding: 12px; }
.equation:focus-visible, .table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.article-table { margin: 36px 0; }
.article-table figcaption { font-size: 15px; line-height: 1.7; margin-bottom: 16px; }
.table-scroll { overflow-x: auto; }
.article-table table { font-size: 14px; }
.article-table th, .article-table td { white-space: nowrap; padding: 10px 9px; }
.article-table thead th { font-size: 13px; font-weight: bold; color: var(--ink); }
.article-table th em { display: block; font-weight: normal; }
.article-table th[scope="colgroup"] { text-align: center; }
.article-table .summary-row > *, .article-table .reported-row > * { font-weight: bold; }
.article-table .summary-row > * { border-top: 1px solid var(--rule); }
.article-table .baseline-row > *,
.suppression-table tr > :nth-child(3),
.inference-table tr > :nth-child(5) { background: var(--article-baseline); }
.split-table tbody tr:nth-child(even) { background: var(--panel); }
.article-references ol { padding-left: 40px; }
.article-references li { font-size: 15px; overflow-wrap: anywhere; }
.article-references li::marker { content: "[" counter(list-item) "] "; }
.reference-label { font-variant: small-caps; }
@media (min-width: 900px) {
  .research-article { padding-top: 0; }
}
@media (max-width: 700px) {
  .research-article { font-size: 16px; }
  .research-article h2 { font-size: 24px; }
  .mosaic-hero { --hero-height: 220px; }
  .mission { padding-block: 24px 32px; }
  .prose > p { font-size: 16px; }
  .content-section { padding-block: 24px 48px; }
  .section-nav { gap: 8px 22px; }
  .results-panel { padding: 20px 12px; }
  table { font-size: 13px; }
  th, td { padding: 12px 7px; }
  caption { font-size: 21px; }
  .research-links, .roadmap-section ul { font-size: 16px; }
  .site-footer { flex-direction: column; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .section-nav a, .section-nav a::after { transition: none; }
}
