/* ============================================================
   THe BIGSPEARs™ — design tokens
   Typography and contrast, per the restructure spec, Change 7.
   Palette matches the printed curriculum so site and print read
   as one system. Contrast ratios measured against #FFFFFF.
   ============================================================ */

:root {
  /* Ink — body text. ~15:1 on white. Clears WCAG AAA comfortably. */
  --ink:        #1B2430;
  /* Slate — secondary text only, never below 18px. ~6.8:1. Passes AA. */
  --slate:      #44536B;
  /* Gold — display and labels ONLY. ~4.4:1, which FAILS AA for body text. */
  --gold:       #8A6D1F;
  /* Movement accents, from the curriculum */
  --grow:       #2F6B4F;
  --care:       #9C4F2E;
  --connect:    #27567F;
  --share:      #63437A;

  --paper:      #FFFFFF;
  --tint:       #F2F5F8;
  --rule:       #C9D2DE;

  /* Never use a grey lighter than this for text of any size. */
  --text-min-contrast: #595959;

  --font-display: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-body:    system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --size-body:      1.125rem;  /* 18px */
  --size-body-sm:   1.0625rem; /* 17px — mobile floor, do NOT go below */
  --size-lead:      1.3125rem; /* 21px */
  --size-small:     0.875rem;  /* 14px — absolute floor, site-wide */
  --leading-body:   1.65;
  --measure:        34rem;     /* ~60–75 characters */
}

html { font-size: 100%; }           /* respect the browser's own setting */
body {
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--leading-body);
  color: var(--ink);                /* never a mid-grey */
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

@media (max-width: 40rem) {
  body { font-size: var(--size-body-sm); }   /* shrink, but never below 17px */
}

p, li { max-width: var(--measure); font-weight: 400; }  /* no light weights for body */
.lead { font-size: var(--size-lead); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.25;
  font-weight: 700;
}
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
h3 { font-size: 1.25rem; }

/* Gold is display-only. Guard it so it can never land on body copy. */
.eyebrow, .label, .kicker { color: var(--gold); font-size: 1.125rem; font-weight: 700; }
.eyebrow, .label, .kicker { /* if you need gold below 18px, use --ink instead */ }

small, .caption, figcaption, footer .fine {
  font-size: var(--size-small);
  color: var(--slate);              /* 6.8:1 — passes AA even at 14px */
}

/* Links: underlined in body copy. Colour alone is not an accessible signal. */
a { color: var(--connect); text-decoration: underline; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

/* Visible focus on every interactive element, 3:1 against its background. */
:focus-visible {
  outline: 3px solid var(--connect);
  outline-offset: 2px;
}

/* Touch targets */
button, .btn, [role="tab"], a.btn {
  min-height: 44px; min-width: 44px;
  font-size: var(--size-body);
}

/* Toggles on lesson and cohort pages — keyboard operable, ARIA state styled */
[role="tab"][aria-selected="true"] {
  background: var(--ink); color: var(--paper); font-weight: 700;
}
[role="tab"][aria-selected="false"] {
  background: var(--tint); color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   Layout
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
.wrap { width: min(72rem, 100% - 3rem); margin-inline: auto; }
.prose { width: min(var(--measure), 100%); }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1rem 0; flex-wrap: wrap; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.375rem; color: var(--ink); text-decoration: none; }
.brand span { color: var(--gold); }
nav.primary ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
nav.primary a { color: var(--ink); text-decoration: none; font-weight: 600; padding: .35rem 0; border-bottom: 2px solid transparent; }
nav.primary a:hover, nav.primary a[aria-current="page"] { border-bottom-color: var(--gold); }

/* Hero */
.hero { padding: 4rem 0 3rem; }
.hero h1 { margin: 0 0 1rem; max-width: 22ch; }
.hero .lead { color: var(--ink); max-width: 46ch; }
.cta-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: .75rem 1.25rem;
       border-radius: 4px; text-decoration: none; font-weight: 700; border: 2px solid var(--ink); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-secondary { background: var(--paper); color: var(--ink); }
.btn:hover { text-decoration: none; opacity: .9; }

/* Sections */
section { padding: 3rem 0; }
section.tinted { background: var(--tint); }
.section-head { margin-bottom: 1.5rem; }
.eyebrow { display: block; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .5rem; }

/* Boundary band */
.boundary { background: var(--ink); color: var(--paper); padding: 2.5rem 0; }
.boundary h2 { color: var(--paper); font-size: 1.5rem; margin: 0 0 .75rem; }
.boundary p { color: #DCE4EE; max-width: 60ch; margin: 0; }
.boundary a { color: #FFF; }

/* Cards */
.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.card { border: 1px solid var(--rule); border-radius: 6px; padding: 1.5rem; background: var(--paper); }
.card h3 { margin: 0 0 .5rem; }
.card p { margin: 0 0 1rem; max-width: none; }

/* The twelve */
.frames { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); list-style: none; padding: 0; }
.frames li { border-left: 4px solid var(--gold); padding: .5rem 0 .5rem .875rem; max-width: none; }
.frames .ltr { font-family: var(--font-display); font-weight: 700; color: var(--gold); font-size: 1.375rem; margin-right: .4rem; }
.frames .nm { font-weight: 700; }
.frames .df { display: block; color: var(--slate); font-size: 1rem; }

/* Tables */
table { border-collapse: collapse; width: 100%; margin: 1.25rem 0; }
th, td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--rule); }
thead th { background: var(--ink); color: var(--paper); font-size: 1rem; }

/* Toggles */
.toggles { display: flex; gap: 2rem; flex-wrap: wrap; margin: 1.5rem 0; padding: 1rem; background: var(--tint); border-radius: 6px; }
.toggle-group { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.toggle-group .lbl { font-weight: 700; font-size: 1rem; color: var(--slate); margin-right: .25rem; }
[role="tablist"] { display: flex; gap: .25rem; flex-wrap: wrap; }
[role="tab"] { border: 2px solid var(--ink); border-radius: 4px; padding: .5rem .9rem; cursor: pointer; font-weight: 600; }

/* Movements */
.movement { border-left: 6px solid var(--slate); background: var(--tint); padding: .85rem 1rem; margin: 2rem 0 1rem; }
.movement h3 { margin: 0; font-family: var(--font-body); font-size: 1.25rem; }
.movement .mins { font-weight: 400; color: var(--slate); font-size: 1rem; margin-left: .5rem; }
.movement .q { display: block; font-style: italic; color: var(--slate); font-size: 1rem; margin-top: .2rem; }
.m-grow    { border-left-color: var(--grow); }    .m-grow h3    { color: var(--grow); }
.m-care    { border-left-color: var(--care); }    .m-care h3    { color: var(--care); }
.m-connect { border-left-color: var(--connect); } .m-connect h3 { color: var(--connect); }
.m-share   { border-left-color: var(--share); }   .m-share h3   { color: var(--share); }

.el-lead { font-weight: 700; }
.el-script { font-family: var(--font-display); font-style: italic; padding-left: 1.25rem; border-left: 2px solid var(--rule); }
.el-q::before { content: "?"; font-weight: 700; color: var(--connect); margin-right: .5rem; }
.el-q { padding-left: .5rem; }
.el-stem { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; padding-left: 1.25rem; }
.el-frame .ltr { font-weight: 700; color: var(--connect); }
.callout { border: 1px solid var(--slate); border-radius: 6px; padding: 1.25rem; margin: 1.5rem 0; }
.callout h4 { margin: 0 0 .5rem; font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; color: var(--slate); }
.callout p { max-width: none; }
[hidden] { display: none !important; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); margin-top: 4rem; padding: 2.5rem 0; background: var(--tint); }
.site-footer .cols { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.site-footer h4 { font-family: var(--font-body); font-size: 1rem; margin: 0 0 .6rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .35rem; }
.fine { color: var(--slate); font-size: var(--size-small); margin-top: 2rem; }
.fine p { max-width: none; margin: .4rem 0; }
.meta { max-width: none !important; color: var(--slate); }
.meta strong { color: var(--ink); }

/* ---------- worked example ---------- */
.wf { border-left: 4px solid var(--gold); padding: .25rem 0 .25rem 1.125rem; margin: 2.5rem 0 1.5rem; }
.wf h2 { margin: 0; font-size: 1.5rem; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.wf h2 .ltr { font-family: var(--font-display); font-weight: 700; color: var(--gold); font-size: 2rem; line-height: 1; }
.wf h2 .nm { font-family: var(--font-body); font-weight: 700; font-size: 1.375rem; }
.ask { margin: .35rem 0; padding-left: 1.75rem; text-indent: -1.75rem; color: var(--ink); }
.ask::before { content: "?"; font-family: var(--font-display); font-weight: 700; color: var(--connect);
  display: inline-block; width: 1.75rem; text-indent: 0; }
.say { font-family: var(--font-display); font-style: italic; font-size: 1.25rem; line-height: 1.5;
  border-left: 3px solid var(--connect); padding: .25rem 0 .25rem 1.25rem; margin: 1.25rem 0; color: var(--ink); }
.figure-note { color: var(--slate); font-size: 1rem; }
.turn { background: var(--tint); border-radius: 6px; padding: 1.5rem; margin: 2rem 0; }
.turn h2 { margin-top: 0; }
.turn p, .turn li { max-width: none; }
.steps { list-style: none; padding: 0; }
.steps li { counter-increment: s; padding-left: 2rem; text-indent: -2rem; margin: .5rem 0; }
.steps li::before { content: counter(s) "."; font-weight: 700; color: var(--gold);
  display: inline-block; width: 2rem; text-indent: 0; }
.steps { counter-reset: s; }
