/* ============================================================
   IEAc design tokens
   Derived from the logo and corrected for WCAG 2.1 AA.

   One surface, light, on every page. No dark variant and no
   toggle: the design is decided once here and every component
   follows, so a page cannot come out light at the top and dark
   below.
   ============================================================ */

:root {
  /* Brand core — sampled from the logo */
  --ieac-forest: #187854;
  --ieac-lime:   #84C03C;   /* decorative only — 2.08:1 on white */
  --ieac-ink:    #162B40;

  /* Forest ramp. 700+ is safe for text on white. */
  --forest-50:#EEFCF6; --forest-100:#D4F6EA; --forest-200:#AAEED5;
  --forest-300:#77E4BB; --forest-400:#40D99F; --forest-500:#25BB83;
  --forest-600:#1E9568; --forest-700:#177350; --forest-800:#105139;
  --forest-900:#0A3324;

  --lime-50:#F5FAEF; --lime-100:#E7F3D8; --lime-200:#CEE7B1;
  --lime-300:#B1D883; --lime-400:#92C850; --lime-500:#76AB35;
  --lime-600:#5E882B; --lime-700:#486921; --lime-800:#334A17;
  --lime-900:#202F0F;

  --ink-50:#F0F5FA; --ink-100:#D9E6F2; --ink-200:#B3CCE5;
  --ink-300:#86ADD5; --ink-400:#548CC4; --ink-500:#3970A7;
  --ink-600:#2E5985; --ink-700:#234566; --ink-800:#193048;
  --ink-900:#101F2E;

  /* ============================================================
     Semantic — light, and only light.

     There is no second palette and no toggle. Two palettes were built and the
     Academy chose one; keeping the other around as a switch means every future
     change has to be made and checked twice, and the half that nobody looks at
     is the half that rots.

     Measured against white, and against the two other grounds separately —
     a value that passes on the page can fail on a tinted band:

                          on white   on opener (#EEF3F1)
       --fg                16.70:1        14.89:1
       --fg-soft            8.09:1         7.21:1
       --fg-muted           5.72:1         5.10:1
       --link               5.83:1         5.20:1

     All AA for body text at any size.
     ============================================================ */
  --bg:            #FFFFFF;
  --bg-sunk:       #F6F8F9;
  --bg-card:       #FFFFFF;
  --bg-opener:     #EEF3F1;   /* the head of every page, one step off white */

  --fg:            #101F2E;
  --fg-soft:       #41525F;
  --fg-muted:      #5B6873;
  --fg-invert:     #FFFFFF;   /* on a filled green button: 5.83:1 */

  --link:          #177350;
  --btn-green:       #50A34C;  /* logo green, for buttons and selected items */
  --btn-green-hover: #3E8640;
  --btn-ink:         #0F1F2D;
  --link-hover:    #0A3324;

  --rule:          #DBE1E5;
  --rule-soft:     #EDF1F3;
  --focus:         #177350;

  --ok:            #177350;
  --warn:          #8A5A00;
  --danger:        #B3200A;

  /* ---------- the footer ----------
     The one dark surface on a light site, so it needs its own text values.
     Inheriting the page's was not a small mistake: --fg-soft on the footer's
     navy is 2.07:1 and --fg-muted is 2.92:1, so every link down there was
     effectively unreadable. */
  --bg-brand:      #101F2E;
  --fg-brand:      #D7E2EA;   /* 12.69:1 */
  --fg-brand-muted:#93A7B6;   /*  6.71:1 */
  --link-brand:    #77E4BB;   /* 10.81:1 */
  --rule-brand:    #24384A;

  /* The field: darker than its ground and held back, because a dark lattice at
     full strength on a pale opener is noise rather than texture. */
  --field-ink:     #105139;
  --field-alpha:   .6;

  /* ---------- the homepage hero ----------
     The photographs are taken to greyscale and laid over a neutral ground.
     They were shot by different people in different rooms, so something has to
     make them read as one page rather than a slideshow; a colour wash did that
     by tinting everything green, and greyscale does it by removing the
     disagreement at the source instead of painting over it.

     Neutral, not the brand green and not black: a green ground would put the
     tint back, and pure black kills the photographs' own mid-tones. */
  --wash:          #1C2124;

  /* ---------- the three kinds of content ----------
     Publications, news and blogs are colour-keyed wherever they appear
     together — the ticker over the hero and the three lists below it. Two sets
     because they appear on both grounds: the light values are for the dark
     hero, the ink values for the page.
       #77E4BB on the washed hero  10.81:1
       #F5C978 on the washed hero   8.94:1
       #A9C9FF on the washed hero   7.68:1
       #0F8A5F, #B5761A and #2E6FB7 on white: 4.54:1, 4.51:1 and 4.90:1 */
  --kind-pub:      #77E4BB;
  --kind-news:     #F5C978;
  --kind-blog:     #A9C9FF;
  --kind-pub-ink:  #0F8A5F;
  --kind-news-ink: #B5761A;
  --kind-blog-ink: #2E6FB7;
  --kind-impact:     #D9C2F2;
  --kind-impact-ink: #7A3EA1;

  /* Type — two families, both already in the brand. Base raised to 17px
     because the articles run 4,000–11,000 characters. */
  /*
   * Both faces are loaded by `assets/css/fonts.css`. They used to be named
   * here and never fetched, so the site ran on Georgia and system-ui by
   * accident rather than by choice.
   *
   * Body copy is set in the serif. The Academy publishes journals, its pages
   * run to thousands of words, and a text serif is what that reads best in —
   * the neutral sans that was nominally the body face is now reserved for the
   * small uppercase work, where neutrality is a virtue.
   */
  --font-head: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-ui:   Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --text-xs:.75rem; --text-sm:.875rem; --text-base:1rem; --text-lg:1.125rem;
  --text-xl:1.375rem; --text-2xl:1.75rem; --text-3xl:2.25rem; --text-4xl:3rem;

  --lh-tight:1.15; --lh-snug:1.32; --lh-normal:1.65; --lh-loose:1.8;
  /* The reading column, in characters rather than pixels — so it grows with the
     type instead of having to be retuned every time the size changes.

     76ch at the new 20px body is about 800px. The reference site runs 700px at
     the same size; this is wider, which is what was asked for, and still inside
     the measure prose can be read at. Pinning it to the container instead would
     put 150 characters on a line at 1536px, which is not a wider column so much
     as a paragraph nobody finishes. */
  --measure:76ch;

  /* Space — 4px base */
  --s1:.25rem; --s2:.5rem; --s3:.75rem; --s4:1rem; --s6:1.5rem;
  --s8:2rem; --s12:3rem; --s16:4rem; --s24:6rem; --s32:8rem;

  --radius-sm:3px; --radius-md:6px; --radius-lg:12px; --radius-full:999px;

  --shadow-sm:0 1px 2px rgba(16,31,46,.06);
  --shadow-md:0 4px 12px rgba(16,31,46,.08);

  /* 96rem = 1536px. At 80rem the site stopped at 1280px on every screen, so a
     1920 monitor showed 320px of margin either side and a 2560 one showed 640.
     96rem fills a 1920 screen at 80% and still holds together wider than that.

     Note the text measure is deliberately NOT tied to this: prose stays at
     --measure, because a 1536px line is around 150 characters and unreadable.
     Wide screens are filled with the rail beside the text, not with longer
     lines. */
  /* The bar's height, named because the landing hero has to reserve it: the bar
     is taken out of the flow there so it can sit over the photograph. Declared
     on :root rather than on the header, because the hero is the header's
     sibling and would never see a value scoped to it. */
  --bar-h:5.25rem;

  --shell:min(96rem, 100% - 3rem);
  --shell-narrow:min(48rem, 100% - 3rem);

  /* The contents rail on article pages. */
  --rail:15rem;

  /* Landing-page type scale. One family per role: the serif carries headings,
     titles and running text; Inter is for labels, tags and chart text only. */
  --size-label:.8125rem;  /* 13px: eyebrows, tags, small uppercase labels */
  --size-meta:.875rem;    /* 14px: dates, table text, chart labels */
  --size-desc:1rem;       /* 16px: descriptions and secondary running text */
  --size-text:1.125rem;   /* 18px: body under the banner, area and box titles */
}

/* The bar loses height with the navigation, and the landing hero has to reserve
   the smaller amount. Kept in step with the nav breakpoint in main.css. */
@media (max-width: 63.9375rem) {
  :root { --bar-h:4.5rem; }
}
