/* ──────────────────────────────────────────────────────────────
   PRIMORA portal: design tokens, type and base rules
   Loaded first on every page; nav.css and ui.css build on it.

   The look: a night-blue masthead and hero that carry the living atlas, and porcelain
   paper for everything that is read or filled in. The colours are those of the PRIMORA
   mark (the "Cell / Time" blues) with one warm accent, the colour the atlas gives to age.
   ────────────────────────────────────────────────────────────── */

/* Fonts are served from this site (SIL Open Font License; the licences are in assets/fonts/).
   Nothing is fetched from another host: fonts.googleapis.com cannot be reached from mainland
   China, and the page policy allows this origin only. */
@font-face {
  font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/instrument-serif-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/instrument-serif-latin-ext-400-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../assets/fonts/inter-greek-wght-normal.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/ibm-plex-mono-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../assets/fonts/ibm-plex-mono-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../assets/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Paper: what is read and filled in */
  --paper:    #F5F6F2;   /* porcelain: the light of the PRIMORA mark */
  --paper-2:  #ECEFEB;
  --paper-3:  #E1E6E2;
  --card:     #FFFFFF;
  --ink:      #14222E;
  --ink-2:    #384957;
  --muted:    #66757F;   /* 4.6:1 on paper */
  --rule:     #D8DEDC;
  --rule-2:   #E5E9E6;

  /* Brand: the blues of the mark */
  --blue-9:   #1F3B55;
  --blue-7:   #3C698F;
  --blue-5:   #709DBC;
  --blue-3:   #BBD8E6;
  --blue-1:   #E5F2F8;
  --signal:    #3C698F;
  --signal-fg: #2D587B;  /* text on paper: 6.9:1 */
  --signal-bg: #E5F2F8;

  /* The one warm accent: the colour the atlas gives to age */
  --coral:     #C8563B;
  --coral-fg:  #A34329;  /* text on paper: 6.0:1 */
  --coral-bg:  #F7E6DF;
  --warm:      #E8B278;  /* on night only */

  /* Night: masthead, hero, footer, bands */
  --night:      #0A151F;
  --night-2:    #101F2C;
  --night-3:    #1A2F40;
  --on-night:   #E9EEF2;
  --on-night-2: #A9B8C4;
  --on-night-3: #7C8E9C;

  /* Type */
  --f-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", serif;
  --f-serif:   "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", serif;
  --f-sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans", "Noto Sans CJK SC", sans-serif;
  --f-mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Layout */
  --col: 1240px;
  --gutter: 32px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(20, 34, 46, 0.04), 0 8px 24px rgba(20, 34, 46, 0.05);
  --shadow-2: 0 2px 4px rgba(20, 34, 46, 0.05), 0 18px 44px rgba(20, 34, 46, 0.10);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: "cv05", "cv08", "ss03";   /* Inter: the plainer l, the upright quotes */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Buttons and inputs inherit the page font, alike in Safari, Firefox and Chrome. */
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { appearance: none; -webkit-appearance: none; background: none; border: 0; padding: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

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

/* ── Typography ───────────────────────────────────────────── */
.serif { font-family: var(--f-serif); font-weight: 400; }
.mono  { font-family: var(--f-mono); }
.tnum  { font-variant-numeric: tabular-nums; }

/* The display face has one weight. Headings never ask for a bold it does not have. */
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 400; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(38px, 5vw, 68px); line-height: 1.04; }
h2 { font-size: clamp(26px, 3vw, 40px); line-height: 1.1; }
h3 { font-size: 24px; line-height: 1.2; }
h4 { font-family: var(--f-sans); font-size: 15px; line-height: 1.35; font-weight: 600; letter-spacing: 0; }

p { margin: 0 0 1em 0; text-wrap: pretty; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: text-decoration-color .15s, color .15s; }
a:hover { text-decoration-color: var(--signal); }

hr { border: 0; border-top: 1px solid var(--rule); margin: 0; }
pre, code { font-family: var(--f-mono); }

/* ── Layout helpers ───────────────────────────────────────── */
.wrap { max-width: var(--col); margin: 0 auto; padding: 0 var(--gutter); }

/* ── Content pages (about, resources, Q&A): the opener they share ── */
.shell { position: relative; max-width: 1080px; margin: 0 auto; padding: 56px var(--gutter) 88px; }
.shell--wide { max-width: var(--col); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--f-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--signal-fg);
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--signal); flex: none; }
h1.title {
  font-size: clamp(40px, 5.4vw, 72px); line-height: 1.03; letter-spacing: -0.012em;
  margin: 18px 0 0; color: var(--ink); max-width: 860px; text-wrap: balance;
}
h1.title em { font-style: italic; color: var(--coral-fg); }
.lede { font-size: clamp(16px, 1.35vw, 18.5px); line-height: 1.6; color: var(--ink-2); margin: 22px 0 0; max-width: 640px; }

/* A section of a content page: a mono label in the margin, the matter beside it */
.band { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; padding: 30px 0; border-top: 1px solid var(--rule); }
.band:first-of-type { margin-top: 52px; border-top-color: var(--ink); }
.band > .label { font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); padding-top: 6px; }
.band h2 { font-size: 30px; line-height: 1.12; }
.band h3 { font-size: 22px; line-height: 1.2; margin-bottom: 8px; }
.band p { font-size: 14px; line-height: 1.6; color: var(--ink-2); margin: 0; }
.band p + p { margin-top: 10px; }

.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 44px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 36px; }

/* Numbers that the atlas is made of */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px 0; margin: 0; }
.figures > div { padding: 2px 16px 2px 0; }
.figures dt { font-family: var(--f-mono); font-size: 9.5px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.figures dd { margin: 4px 0 0; font-family: var(--f-display); font-size: 34px; line-height: 1; letter-spacing: -0.01em; color: var(--ink); font-variant-numeric: lining-nums; }
.figures dd small { font-size: 0.56em; margin-left: 2px; color: var(--ink-2); }

@media (max-width: 900px) {
  :root { --gutter: 20px; }
  .shell { padding: 36px var(--gutter) 64px; }
  .band { grid-template-columns: 1fr; gap: 12px; padding: 24px 0; }
  .band:first-of-type { margin-top: 36px; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; gap: 22px; }
}
