/* Shared brand layer for research.stefanal.com: same type as www.stefanal.com.
   Loaded after each page's own <style>, so these :root values win. */
@font-face { font-family: "Inter Tight"; src: url("/assets/fonts/inter-tight-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url("/assets/fonts/inter-tight-latin-wght-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-latin-wght-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/assets/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/assets/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }

:root {
  --f-display: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --f-serif: "Source Serif 4", Georgia, serif;
}
/* Headings: the main site's headline style (heavier, normal spacing). */
h1, h2 { font-weight: 600 !important; letter-spacing: -0.02em !important; }
h3 { font-weight: 600; }
h1 em, h2 em { font-style: normal; }

/* Paper theme (landing page): white page, dark only inside framed previews. */
body.paper {
  --night: #ffffff; --deep: #0d1424; --rule: #e2e2e2; --bone: #111111;
  --dust: #4f4f4f; --faint: #6b6b6b; --sodium: #a8481a;
  background: #ffffff !important; color: #111111; color-scheme: light;
}
body.paper h1 em { color: inherit; }
body.paper .figure { border-color: #0d1424; }
body.paper .btn { border-color: #111111; color: #111111; border-radius: 0; }
body.paper .btn:hover, body.paper .btn:focus-visible { background: #111111; color: #ffffff; }
body.paper .lede { font-family: var(--f-serif); font-size: 21px; color: #2b2b2b; }

/* ---- Shared header and footer (same as www.stefanal.com) ---- */
body { padding-top: 0 !important; padding-bottom: 0 !important; }
.sa-header, .sa-footer { width: 100vw; margin-inline: calc(50% - 50vw); font-family: "Inter", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
.sa-header { background: #ffffff; color: #111111; border-bottom: 1px solid #e2e2e2; margin-bottom: 28px; }
.sa-nav { max-width: 1360px; margin: 0 auto; padding: 20px clamp(20px, 3vw, 40px); display: flex; flex-wrap: wrap; gap: 14px 40px; justify-content: space-between; align-items: center; }
.sa-nav a { color: #111111; text-decoration: none; }
.sa-nav a:hover { color: #5c5c5c; }
.sa-word { font-family: "Inter Tight", Arial, sans-serif; font-weight: 600; font-size: 20px; letter-spacing: -0.01em; }
.sa-links { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0; padding: 0; list-style: none; font-size: 14px; font-weight: 500; }
.sa-links a[aria-current="page"] { border-bottom: 1.5px solid #111111; }
.sa-footer { background: #111111; color: #ffffff; margin-top: 72px; }
.sa-foot { max-width: 1360px; margin: 0 auto; padding: 64px clamp(20px, 3vw, 40px) 40px; display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.sa-foot a, .sa-base a { color: #ffffff; text-decoration: none; }
.sa-foot a:hover, .sa-base a:hover { color: #bdbdbd; }
.sa-touch { display: flex; flex-direction: column; gap: 10px; }
.sa-touch b { font-family: "Inter Tight", Arial, sans-serif; font-weight: 500; font-size: 30px; letter-spacing: -0.02em; }
.sa-item { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid #333333; font-size: 15px; color: #d6d6d6 !important; }
.sa-item span { font-family: "IBM Plex Mono", monospace; font-size: 11px; color: #a8a8a8; }
.sa-base { max-width: 1360px; margin: 0 auto; padding: 20px clamp(20px, 3vw, 40px) 32px; display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; border-top: 1px solid #333333; font-family: "IBM Plex Mono", monospace; font-size: 12px; color: #a8a8a8; }
.sa-base span { display: flex; gap: 20px; flex-wrap: wrap; }
body.paper .wrap > .top:first-child { display: none; }
.wrap > footer:not(.sa-footer) { display: none; }

/* ---- Finding + How to cite (atlas pages, dark) ---- */
.sa-cite { display: grid; gap: 10px; margin: 18px 0 6px; max-width: 72ch; font-family: "Inter", Arial, sans-serif; }
.sa-cite p { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; font-size: 14px; line-height: 1.5; color: var(--dust, #8f98ab); }
.sa-cite span { font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--sodium, #f4b35e); min-width: 92px; }
.sa-finding { font-size: 17px !important; color: var(--bone, #e9e3d6) !important; padding-left: 0; }
.sa-cite cite { font-style: normal; font-family: "IBM Plex Mono", monospace; font-size: 12.5px; }
.sa-copy { font: 500 11px "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; background: transparent; color: inherit; border: 1px solid currentColor; padding: 4px 10px; cursor: pointer; min-height: 28px; }
.sa-themes a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(143,152,171,.5); }

/* ---- Landing: theme filters, featured rows, grid of cards ---- */
.sa-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 -16px; }
.sa-filters button { min-height: 44px; padding: 0 16px; border: 1.5px solid #c4c4c4; background: #fff; color: #111; font: 500 14px "Inter", Arial, sans-serif; cursor: pointer; }
.sa-filters button[aria-pressed="true"] { background: #111; color: #fff; border-color: #111; }
body.paper .projects { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 48px 28px; border-top: 1px solid #111 !important; padding-top: 40px; }
body.paper .project { display: flex !important; flex-direction: column; gap: 14px; padding: 0 !important; border: 0 !important; align-items: stretch !important; }
body.paper .project > .figure { order: -1; aspect-ratio: 16 / 9 !important; border-radius: 0; }
body.paper .project h2 { font-size: 24px !important; margin: 6px 0 8px !important; line-height: 1.15; }
body.paper .project p { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
body.paper .project .facts { font-size: 11.5px; margin: 10px 0 0; }
body.paper .project .btn { display: none; }
body.paper .project[hidden] { display: none !important; }
body.paper .projects:not(.filtering) .project.featured { grid-column: 1 / -1; display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 20px 48px; align-items: center !important; padding-bottom: 48px !important; border-bottom: 1px solid #e2e2e2 !important; }
body.paper .projects:not(.filtering) .project.featured > .figure { order: 0; aspect-ratio: auto !important; }
body.paper .projects:not(.filtering) .project.featured h2 { font-size: clamp(30px, 3.2vw, 42px) !important; }
body.paper .projects:not(.filtering) .project.featured p { -webkit-line-clamp: unset; font-size: 16px; }
body.paper .projects:not(.filtering) .project.featured .btn { display: inline-flex; margin-top: 16px; }
@media (max-width: 820px) { body.paper .projects:not(.filtering) .project.featured { grid-template-columns: 1fr; } body.paper .projects:not(.filtering) .project.featured > .figure { order: -1; } }
.sa-cite span { flex-basis: 100%; min-width: 0; }
body.paper .sa-sub { margin: -6px 0 4px; font-family: "Inter Tight", Arial, sans-serif; font-weight: 500; font-size: clamp(24px, 3vw, 36px); letter-spacing: -0.02em; color: #4f4f4f; }
