/* Rivulet site: DESIGN.md rev 4 palette (butter cream canvas, forest ink, ember touch), Alexandria + IBM Plex.
   Static, script-free; fonts are self-hosted (OFL, see licences/). Light = cream, dark = forest. */

@font-face { font-family: "Alexandria"; src: url("fonts/alexandria.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm_plex_sans_regular.ttf") format("truetype"); font-weight: 400; font-display: swap; unicode-range: U+0000-05FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm_plex_sans_semibold.ttf") format("truetype"); font-weight: 600; font-display: swap; unicode-range: U+0000-05FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm_plex_sans_arabic_regular.ttf") format("truetype"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm_plex_sans_arabic_semibold.ttf") format("truetype"); font-weight: 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }

:root {
  color-scheme: light dark;
  --bg: #EFE7D4;        /* Swiss Cream */
  --surface1: #F6F0E2;
  --surface2: #EAE1CB;
  --hairline: #D5CAAD;
  --edge: #CBBFA0;
  --text: #0F3038;      /* Petrol Ink */
  --muted: #4A5E62;
  --ember: #B03C11;     /* links and focus on cream */
  --ember-fill: #E04E18;
  --forest: #1E3B2F;    /* brand band, both themes */
  --forest-deep: #132820;
  --cream: #F3ECDA;
  --cream-muted: #ACBAAF;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #132820;
    --surface1: #1E3B2F;
    --surface2: #28493B;
    --hairline: #355746;
    --edge: #355746;
    --text: #F3ECDA;
    --muted: #ACBAAF;
    --ember: #F79B4D;
    --ember-fill: #F28C38;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1rem/1.65 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-wrap: anywhere;
}
h1, h2, h3, .brand { font-family: "Alexandria", "IBM Plex Sans", system-ui, sans-serif; line-height: 1.25; }
h1 { font-weight: 700; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); margin: 0 0 0.75rem; }
h2 { font-weight: 600; font-size: 1.3rem; margin: 2.25rem 0 0.75rem; }
h3 { font-weight: 600; font-size: 1.05rem; margin: 1.5rem 0 0.4rem; }
p, ul, ol { margin: 0 0 1rem; }
a { color: var(--ember); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--ember-fill); outline-offset: 3px; border-radius: 3px; }
strong { font-weight: 600; }

/* Header and footer, every page */
.site-header { background: var(--forest); color: var(--cream); }
.site-header nav {
  max-width: 64rem; margin: 0 auto; padding: 0.85rem 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1.25rem;
}
.site-header a { color: var(--cream); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.site-header a:hover { text-decoration: underline; }
.site-header a:focus-visible { outline-color: #F28C38; }
.site-header .brand { font-weight: 500; font-size: 1.35rem; letter-spacing: 0.01em; margin-inline-end: auto; }
.site-footer { border-top: 1px solid var(--hairline); color: var(--muted); font-size: 0.9rem; margin-top: 3rem; }
.site-footer div { max-width: 64rem; margin: 0 auto; padding: 1.25rem 16px 2rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer a { color: var(--muted); }

/* Document pages (privacy, licences, releases) */
main { display: block; max-width: 46rem; margin: 0 auto; padding: 2rem 16px 0; }
main.home { max-width: none; padding: 0; }
pre, code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface2); border: 1px solid var(--hairline); border-radius: 8px; padding: 0.85rem; }
table { border-collapse: collapse; width: 100%; margin: 0 0 1rem; font-size: 0.92rem; }
td, th { border: 1px solid var(--hairline); padding: 0.45rem 0.55rem; text-align: start; vertical-align: top; overflow-wrap: anywhere; }
th { background: var(--surface2); font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--hairline); margin: 2rem 0; }

/* Home */
.hero { background: var(--forest); color: var(--cream); }
.hero .inner { max-width: 64rem; margin: 0 auto; padding: 3rem 16px 3.5rem; }
.lockup { display: block; width: min(22rem, 100%); height: auto; color: var(--cream); margin: 0 0 2rem; }
.hero h1 { color: var(--cream); max-width: 34rem; }
.hero p { color: var(--cream-muted); font-size: 1.08rem; max-width: 38rem; }
.hero .note { display: inline-block; margin-top: 0.5rem; padding: 0.35rem 0.8rem; border: 1px solid #355746; border-radius: 999px; color: var(--cream); font-size: 0.9rem; }

.band { max-width: 64rem; margin: 0 auto; padding: 0 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.cards li { background: var(--surface1); border: 1px solid var(--edge); border-radius: 12px; padding: 1.1rem 1.2rem; }
.cards h3 { margin-top: 0; }
.cards p { margin: 0; color: var(--muted); }
.rule { width: 3rem; height: 3px; border: 0; border-radius: 2px; background: var(--ember-fill); margin: 0 0 1rem; }
.facts { padding-inline-start: 1.2rem; }
.facts li { margin-bottom: 0.4rem; }
.links { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
.contact { background: var(--surface1); border: 1px solid var(--edge); border-radius: 12px; padding: 1.25rem; }
.contact a { font-weight: 600; font-size: 1.1rem; }
.ar { font-size: 1.04rem; }
.ar h2, .ar h3 { letter-spacing: 0; }
.muted { color: var(--muted); }

@media (max-width: 30rem) {
  .hero .inner { padding: 2.25rem 16px 2.5rem; }
  .site-header .brand { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
@media print { .site-header, .site-footer { display: none; } body { background: #fff; color: #000; } }
