/* Justified Systems — site styles
   No build step. Edit directly. Bump ?v= in page <link> tags after changes. */

/* ---------- Fonts (self-hosted, SIL OFL 1.1 — see /assets/fonts/LICENSES.txt) ---------- */
@font-face { font-family: "Comfortaa"; src: url("../fonts/comfortaa-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Comfortaa"; src: url("../fonts/comfortaa-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --bg: #E2E1EF;          /* soft lavender */
  --surface: #F3F2F9;     /* card */
  --text: #2D2C4C;        /* navy */
  --muted: #5F5A7A;       /* secondary text (darkened from #726D8C for WCAG AA) */
  --line: rgba(45, 44, 76, .14);
  --coral: #E98D78;       /* action colour — use sparingly */
  --purple: #946F92;
  --blue: #9598C6;
  --on-accent: #1E1D35;
  --lab-bg: #1E1D35;      /* The Lab: always deep navy */
  --lab-surface: #2D2C4C;
  --lab-text: #E2E1EF;
  --lab-muted: #B4B0CC;

  --radius-card: 1.25rem;
  --radius-pill: 999px;
  --space: clamp(3.5rem, 8vw, 6rem);
  --wrap: 72rem;
  --font-head: "Comfortaa", ui-rounded, system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1E1D35;
    --surface: #2A2946;
    --text: #E2E1EF;
    --muted: #B4B0CC;
    --line: rgba(226, 225, 239, .14);
    --lab-bg: #15142A;
    --lab-surface: #2A2946;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font-body);
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; margin: 0 0 .75rem; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h3, .h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
ul { padding-left: 1.2rem; }
li { margin-bottom: .35rem; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; border-radius: .4rem; }
::selection { background: var(--coral); color: var(--on-accent); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: var(--space) 0; }
.section--tight { padding-top: 0; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 40rem; }
.muted { color: var(--muted); }
.eyebrow { font-family: var(--font-head); font-weight: 700; color: var(--muted); font-size: .95rem; margin-bottom: .75rem; }
.measure { max-width: 42rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: absolute; left: 1rem; top: -4rem; background: var(--coral); color: var(--on-accent); padding: .6rem 1rem; border-radius: var(--radius-pill); font-weight: 600; z-index: 10; }
.skip:focus { top: 1rem; }

/* ---------- Signature colour bar ---------- */
.bar { display: flex; gap: .35rem; height: .5rem; width: 100%; max-width: 12rem; }
.bar span { border-radius: var(--radius-pill); }
.bar span:nth-child(1) { background: var(--coral); flex: 5; }
.bar span:nth-child(2) { background: var(--purple); flex: 2.5; }
.bar span:nth-child(3) { background: var(--blue); flex: 2.5; }
.bar--wide { max-width: none; height: .375rem; }
.divider { margin: 0 auto; padding: 0 1.25rem; max-width: var(--wrap); }

/* ---------- Wordmark ---------- */
.brand { display: inline-flex; flex-direction: column; gap: .3rem; text-decoration: none; padding: .25rem 0; }
.brand__name { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; line-height: 1; }
.brand .bar { max-width: 100%; height: .3rem; gap: .2rem; }
.brand__sub { font-family: var(--font-head); font-weight: 500; font-size: .62rem; letter-spacing: .42em; line-height: 1; color: var(--muted); }

/* ---------- Header / nav (no JavaScript) ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; padding-top: 1rem; padding-bottom: 1rem; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.nav li { margin: 0; }
.nav a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1rem; border-radius: var(--radius-pill); text-decoration: none; font-weight: 600; font-size: .98rem; }
.nav a:hover { background: var(--surface); }
.nav a[aria-current="page"] { background: var(--surface); box-shadow: inset 0 -3px 0 var(--coral); }
@media (max-width: 40rem) {
  .nav { width: 100%; }
  .nav ul { margin: 0 -.5rem; }
  .nav a { padding: 0 .75rem; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3rem; padding: 0 1.5rem; border-radius: var(--radius-pill); font-weight: 600; text-decoration: none; border: 2px solid transparent; }
.btn--primary { background: var(--coral); color: var(--on-accent); }
.btn--primary:hover { filter: brightness(1.05); text-decoration: underline; }
.btn--ghost { border-color: currentColor; }
.btn--ghost:hover { background: var(--surface); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

/* ---------- Hero ---------- */
.hero { padding: clamp(3.5rem, 10vw, 7rem) 0 var(--space); }
.hero h1 { max-width: 18ch; }
.hero .bar { margin-bottom: 1.75rem; }
.page-head { padding: clamp(3rem, 8vw, 5rem) 0 2.5rem; }
.page-head .bar { margin-bottom: 1.5rem; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); }
.card { background: var(--surface); border-radius: var(--radius-card); padding: 1.75rem; display: flex; flex-direction: column; }
.card > :last-child { margin-bottom: 0; }
.card p { color: var(--muted); }
.card__link { margin-top: auto; padding-top: .5rem; font-weight: 600; }
.card--linked { position: relative; }
.card--linked .card__link a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-card); }
.card--linked:hover { box-shadow: inset 0 0 0 2px var(--line); }
.card__num { font-family: var(--font-head); font-weight: 700; color: var(--purple); margin-bottom: .5rem; }

/* Image placeholder: replace <div class="media"> with <img> when you have imagery */
.media { aspect-ratio: 16 / 9; border-radius: calc(var(--radius-card) - .5rem); background: var(--bg); border: 1px dashed var(--line); display: grid; place-items: center; color: var(--muted); font-size: .9rem; margin-bottom: 1.25rem; }
img.media { object-fit: cover; border: 0; width: 100%; }

/* ---------- Tags / status pills ---------- */
.tags { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.tags li { margin: 0; }
.pill { display: inline-block; padding: .2rem .75rem; border-radius: var(--radius-pill); font-size: .85rem; font-weight: 600; background: var(--bg); border: 1px solid var(--line); }
.pill--prototype { background: var(--blue); color: var(--on-accent); border-color: transparent; }
.pill--progress { background: #7A5A78; color: #fff; border-color: transparent; }
.pill--available { background: var(--coral); color: var(--on-accent); border-color: transparent; }

/* ---------- Detail pages ---------- */
.facts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); margin: 0 0 2.5rem; padding: 0; }
.facts div { background: var(--surface); border-radius: 1rem; padding: 1rem 1.25rem; }
.facts dt { font-size: .85rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.prose { max-width: 42rem; }
.prose h2 { font-size: 1.5rem; margin-top: 2.5rem; }
.back { display: inline-block; margin-bottom: 1.5rem; font-weight: 600; }

/* ---------- Contact ---------- */
.contact-card { background: var(--surface); border-radius: var(--radius-card); padding: clamp(1.75rem, 5vw, 3rem); max-width: 42rem; }
.email { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.1rem, 4vw, 1.6rem); word-break: break-word; }

/* ---------- CTA band ---------- */
.cta { background: var(--surface); border-radius: var(--radius-card); padding: clamp(2rem, 6vw, 3.5rem); text-align: center; }
.cta .bar { margin: 0 auto 1.5rem; }
.cta .lede { margin: 0 auto; }
.cta .actions { justify-content: center; }

/* ---------- The Lab: distinct but related ---------- */
.lab { background: var(--lab-bg); color: var(--lab-text); }
.lab .card, .lab .facts div, .lab .cta { background: var(--lab-surface); }
.lab .card p, .lab .lede, .lab .muted, .lab .eyebrow, .lab .facts dt { color: var(--lab-muted); }
.lab .media { background: var(--lab-bg); border-color: rgba(226, 225, 239, .2); color: var(--lab-muted); }
.lab .pill:not(.pill--prototype):not(.pill--progress):not(.pill--available) { background: transparent; border-color: rgba(226, 225, 239, .3); }
.lab .pill--prototype, .lab .pill--progress, .lab .pill--available { border-color: transparent; }
.lab .btn--ghost:hover { background: var(--lab-surface); }
.lab .card--linked:hover { box-shadow: inset 0 0 0 2px var(--blue); }
.lab-band { border-radius: var(--radius-card); padding: clamp(2rem, 6vw, 3.5rem); }
.lab-band .lede { margin-bottom: 0; }
.lab-mark { font-family: var(--font-head); color: var(--blue); font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; font-size: .95rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.site-footer a { display: inline-block; padding: .35rem 0; }
.lab + .site-footer, body.is-lab .site-footer { background: var(--lab-bg); color: var(--lab-muted); border-color: rgba(226, 225, 239, .12); }
body.is-lab .site-header { background: var(--lab-bg); color: var(--lab-text); border-color: rgba(226, 225, 239, .12); }
body.is-lab .site-header .brand__sub { color: var(--lab-muted); }
body.is-lab .nav a:hover, body.is-lab .nav a[aria-current="page"] { background: var(--lab-surface); }
body.is-lab { background: var(--lab-bg); }

@media (prefers-reduced-motion: no-preference) {
  .btn, .nav a, .card--linked { transition: background-color .15s ease, box-shadow .15s ease; }
}
@media print {
  .site-header nav, .site-footer, .actions, .skip { display: none; }
  body { background: #fff; color: #000; }
}
