/* ============================================================================
   INCLUSIVELY WIRED — design tokens for inclusivelywired.eu
   Gris / Buinho · 31 July 2026
   Derived from: D5.2 Project Visuals (identity manual, Studio Junctuur) and the
   applied covers of D2.5 / D2.6 / D3.3.
   Every contrast value below was computed, not estimated. WCAG 2.1.
   ============================================================================ */

:root {

  /* ---- SURFACES (colour is a room you walk into) ------------------------- */
  --iw-paper:       #FBF6F1;  /* warm off-white. Default page. Never pure white. */
  --iw-paper-2:     #F3EBE3;  /* one step deeper. Section separation without rules. */
  --iw-vermilion:   #F04623;  /* the manual's dominant field */
  --iw-peach:       #F6AB78;
  --iw-salmon:      #F89868;
  --iw-lavender:    #ACA3DA;
  --iw-amber:       #F68714;
  --iw-blue:        #224493;  /* the toolkit covers. Deep room. */
  --iw-pale-peach:  #FBD9C2;  /* only ever used ON blue */

  /* ---- INK --------------------------------------------------------------- */
  --iw-ink:         #1A1A1A;  /* near-black. The only body ink on warm fields. */
  --iw-ink-soft:    #3D3A38;  /* light fields only */
  --iw-ink-muted:   #5A5450;  /* meta / captions, light fields only */
  --iw-ink-invert:  #FFFFFF;  /* on blue */

  /* ---- LINK / ACCENT INK (text-safe darks) ------------------------------- */
  --iw-link:        #224493;  /* 9.07:1 on white, 8.44:1 on paper — AAA */
  --iw-link-warm:   #9A3B12;  /* 6.98:1 on white — the warm family, made legible */

  /* ---- FOCUS ------------------------------------------------------------- */
  /* Two concentric rings. On every surface in this palette at least one ring
     clears 3:1, so keyboard focus is never invisible. Do not simplify to one. */
  --iw-focus-inner: #1A1A1A;
  --iw-focus-outer: #FBF6F1;

  /* ---- TYPE -------------------------------------------------------------- */
  --iw-font-display: "Josefin Sans", "Josefin Sans Variable", system-ui, sans-serif;
  --iw-font-text:    "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;

  --iw-step--1: clamp(0.9375rem, 0.90rem + 0.18vw, 1rem);      /* meta      15–16px */
  --iw-step-0:  clamp(1.0625rem, 1.01rem + 0.28vw, 1.1875rem); /* body      17–19px */
  --iw-step-1:  clamp(1.25rem,  1.16rem + 0.45vw, 1.5rem);     /* lede      20–24px */
  --iw-step-2:  clamp(1.5rem,   1.34rem + 0.80vw, 2rem);       /* h3        24–32px */
  --iw-step-3:  clamp(1.875rem, 1.55rem + 1.60vw, 2.75rem);    /* h2        30–44px */
  --iw-step-4:  clamp(2.25rem,  1.60rem + 3.25vw, 4rem);       /* h1        36–64px */
  --iw-step-5:  clamp(2.75rem,  1.40rem + 6.75vw, 6.5rem);     /* display   44–104px */

  --iw-lh-tight: 1.05;   /* display only */
  --iw-lh-head:  1.15;
  --iw-lh-body:  1.65;   /* never below 1.5 for body */
  --iw-measure:  62ch;   /* hard ceiling on line length */
  --iw-track-brand: 0.28em; /* the letterspacing of the logo wordmark */

  /* ---- SPACE (4px base) --------------------------------------------------- */
  --iw-s1: 0.25rem; --iw-s2: 0.5rem;  --iw-s3: 0.75rem; --iw-s4: 1rem;
  --iw-s5: 1.5rem;  --iw-s6: 2rem;    --iw-s7: 3rem;    --iw-s8: 4rem;
  --iw-s9: 6rem;    --iw-s10: 8rem;

  /* ---- SHAPE ------------------------------------------------------------- */
  /* The mark is circles and a coil. So: hard rectangle, or full circle.
     Nothing in between — no 8px "friendly" corners. */
  --iw-radius-field: 0;
  --iw-radius-pill:  999px;
  --iw-hairline:     1px;
}

/* ---- SELF-HOSTED FONTS (no external requests, ever) ---------------------- */
@font-face {
  font-family: "Josefin Sans";
  src: url("fonts/JosefinSans-Variable.woff2") format("woff2-variations");
  font-weight: 100 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/AtkinsonHyperlegibleNext-Variable.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: normal; font-display: swap;
}

/* ---- BASELINE ------------------------------------------------------------ */
svg { max-width: 100%; height: auto; display: block; }  /* sem isto, um SVG inline sem
   width/height assume a largura intrínseca e cria deslize horizontal no telemóvel */
html { font-size: 100%; }            /* never fix px on root — 200% zoom must work */
body {
  background: var(--iw-paper);
  color: var(--iw-ink-soft);
  font-family: var(--iw-font-text);
  font-size: var(--iw-step-0);
  line-height: var(--iw-lh-body);
  text-rendering: optimizeLegibility;
}
h1, h2, h3, .display {
  font-family: var(--iw-font-display);
  font-weight: 600;
  line-height: var(--iw-lh-head);
  text-wrap: balance;
}
p, li { max-width: var(--iw-measure); }

a { color: var(--iw-link); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.16em; }

/* Sandwich: a light ring hugging the element, a dark ring outside it. Works on a
   dark button sitting on paper AND on a light button sitting on a colour field —
   one of the two rings always has something to contrast against. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  box-shadow: 0 0 0 3px var(--iw-focus-outer);   /* inner, hugs the element */
  outline: 3px solid var(--iw-focus-inner);      /* outer */
  outline-offset: 3px;
}

/* ---- ROOMS --------------------------------------------------------------- */
/* A section adopts a field colour AND the ink that is proven legible on it.
   Never mix: no white body text on vermilion, no peach text on paper. */
.room-paper     { background: var(--iw-paper);     color: var(--iw-ink-soft); }
.room-paper-2   { background: var(--iw-paper-2);   color: var(--iw-ink-soft); }
.room-vermilion { background: var(--iw-vermilion); color: var(--iw-ink); }  /* 4.65:1 */
.room-peach     { background: var(--iw-peach);     color: var(--iw-ink); }  /* 9.13:1 */
.room-salmon    { background: var(--iw-salmon);    color: var(--iw-ink); }  /* 8.02:1 */
.room-lavender  { background: var(--iw-lavender);  color: var(--iw-ink); }  /* 7.46:1 */
.room-amber     { background: var(--iw-amber);     color: var(--iw-ink); }  /* 6.96:1 */
.room-blue      { background: var(--iw-blue);      color: var(--iw-ink-invert); } /* 9.07:1 */

.room-vermilion a, .room-peach a, .room-salmon a,
.room-lavender a, .room-amber a { color: var(--iw-ink); text-decoration: underline; }
.room-blue a    { color: var(--iw-pale-peach); }               /* 6.82:1 */
.room-blue .display { color: var(--iw-peach); }                /* 4.76:1 — the toolkit covers */

/* Inside the two darkest rooms the sandwich flips, so the outer ring is the one
   that reads against the field. */
.room-vermilion :focus-visible, .room-blue :focus-visible {
  box-shadow: 0 0 0 3px var(--iw-focus-inner);
  outline-color: var(--iw-focus-outer);
}

/* ---- MOTION -------------------------------------------------------------- */
/* Movement only as a direct response to a user action. Nothing on load,
   nothing on scroll, nothing automatic. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}

/* ============================================================================
   MEASURED CONTRAST — copy into the build notes, a project officer may ask.
   ---------------------------------------------------------------------------
   #224493 on #FFFFFF ......... 9.07  AAA
   #224493 on #FBF6F1 ......... 8.44  AAA
   #9A3B12 on #FFFFFF ......... 6.98  AA
   #1A1A1A on #FBF6F1 ......... 16.21 AAA
   #3D3A38 on #FBF6F1 ......... 10.51 AAA
   #5A5450 on #FBF6F1 .........  6.94 AA   (meta only)
   #1A1A1A on #F6AB78 .........  9.13 AAA
   #1A1A1A on #F89868 .........  8.02 AAA
   #1A1A1A on #ACA3DA .........  7.46 AAA
   #1A1A1A on #F68714 .........  6.96 AA
   #1A1A1A on #F04623 .........  4.65 AA   (body ink on vermilion MUST be #1A1A1A)
   #FFFFFF on #224493 .........  9.07 AAA
   #FBD9C2 on #224493 .........  6.82 AA
   #F6AB78 on #224493 .........  4.76 AA   (display type, as on the toolkit covers)
   ---------------------------------------------------------------------------
   FAILS — never use as ink on a light background:
   #F6AB78 on white 1.91 · #F89868 2.17 · #ACA3DA 2.33 · #F68714 2.50 · #F04623 3.75
   ============================================================================ */
