/* ============================================================================
   Standard Group of Education — token layer
   Derived from standard-group-site-v42 (build v135). Generated 2026-11-11.

   HOW THIS IS MEANT TO BE USED
   ----------------------------
   Load it AFTER assets/site.css and before any page CSS:

       <link rel="stylesheet" href="assets/site.css">
       <link rel="stylesheet" href="assets/theme.css">

   This file is purely additive. It does not edit site.css, and on the day you
   add it NOTHING on the site changes colour: the eleven semantic tokens are
   re-pointed at primitives whose values are byte-identical to what site.css
   already resolves them to. Verified for all of them.

   The point of the file is the primitives. site.css currently contains ~98
   distinct hex values where there are only 12 tokens; 58 of those values sit
   within dE76 <= 5.0 of a step below, meaning they are visually
   interchangeable with it. Replacing them with var(--sg-*) is a safe,
   incremental cleanup you can do one rule at a time.

   WHAT IS LOCKED
   --------------
   Nine values come straight from the existing build and are never computed:

       --sg-teal-500     #209C9C   logo teal          (was --brand)
       --sg-teal-700     #136464   deep teal          (was --brand-strong)
       --sg-orange-500   #FC803C   logo orange        (was --accent)
       --sg-orange-700   #A9521F   rust               (was --pending)
       --sg-neutral-0    #FFFFFF   surface
       --sg-neutral-50   #F5FAFA   page background
       --sg-neutral-200  #D5E5E5   border
       --sg-neutral-600  #4B6366   muted text
       --sg-neutral-800  #15292B   body text

   Every other step is interpolated in CIELAB at the locked value's own hue
   (teal h=196.5, orange h=52.9, neutral h=209.6), with chroma tapered toward
   both ends of the ramp and clamped into sRGB gamut. Lightness decreases
   monotonically across each scale, so steps are safe to compare and to pair.
   ========================================================================= */

:root{
  /* ---- Teal: the brand hue. ------------------------------------------- */
  --sg-teal-50:#EFF8F8;
  --sg-teal-100:#DCEFEE;
  --sg-teal-200:#BADEDD;
  --sg-teal-300:#8FC7C6;
  --sg-teal-400:#5DB2B1;
  --sg-teal-500:#209C9C;   /* LOCKED — logo teal */
  --sg-teal-600:#008181;
  --sg-teal-700:#136464;   /* LOCKED — deep teal, the workhorse for text */
  --sg-teal-800:#005354;
  --sg-teal-900:#004243;

  /* ---- Orange: highlights only. Never body text on a light surface. --- */
  --sg-orange-50:#FFF0E9;
  --sg-orange-100:#FFE2D3;
  --sg-orange-200:#FFCAAE;
  --sg-orange-300:#FFB087;
  --sg-orange-400:#FF955D;
  --sg-orange-500:#FC803C;  /* LOCKED — logo orange. 2.53:1 on white: decorative only */
  --sg-orange-600:#D96320;
  --sg-orange-700:#A9521F;  /* LOCKED — rust. 5.37:1 on white: safe for text */
  --sg-orange-800:#983300;
  --sg-orange-900:#7E2700;

  /* ---- Neutral: teal-tinted greys, not pure. -------------------------- */
  --sg-neutral-0:#FFFFFF;    /* LOCKED */
  --sg-neutral-50:#F5FAFA;   /* LOCKED */
  --sg-neutral-100:#EAEFEF;
  --sg-neutral-200:#D5E5E5;  /* LOCKED */
  --sg-neutral-300:#BAC9CB;
  --sg-neutral-400:#90A4A7;
  --sg-neutral-500:#688084;
  --sg-neutral-600:#4B6366;  /* LOCKED — muted */
  --sg-neutral-700:#2E4548;
  --sg-neutral-800:#15292B;  /* LOCKED — body text */
  --sg-neutral-900:#081B1D;

  /* ---- Dark-theme surfaces: the build's exact values, pinned. ---------
     Deliberately NOT taken from the neutral ramp — the existing dark
     surfaces are warmer and closer together than an even ramp would be,
     and that is a design decision worth keeping. */
  --sg-dark-bg:#0C1819;
  --sg-dark-surface:#132324;
  --sg-dark-border:#24393A;
  --sg-dark-muted:#A9C2C2;
  --sg-dark-text:#E6F2F2;

  /* ---- Category accents --------------------------------------------------
     Outside the brand palette. Already in the build, carrying meaning on
     programme category cards (.cat-card.a3/.a4/.a5, .focus-card.f3) as a
     4th/5th/6th distinguishable band after teal and orange. Named here so
     they read as intentional rather than as strays. Borders and fills only;
     none is contrast-safe for small text on white. */
  --sg-cat-blue:#4E7FD1;
  --sg-cat-purple:#7C5CC4;
  --sg-cat-green:#2E8B57;

  /* ---- Elevation ------------------------------------------------------ */
  --sg-shadow-sm:0 2px 10px rgba(21,41,43,.14);
  --sg-shadow-md:0 10px 28px rgba(21,41,43,.08);
  --sg-shadow-lg:0 18px 36px rgba(21,41,43,.12);
  --sg-shadow-xl:0 20px 36px rgba(21,41,43,.18);

  /* ---- Radius: the five values already in use ------------------------- */
  --sg-radius-sm:8px;
  --sg-radius-md:12px;
  --sg-radius-lg:16px;
  --sg-radius-xl:24px;
  --sg-radius-pill:999px;

  /* ---- Type ----------------------------------------------------------- */
  --sg-font-bn:"Hind Siliguri","Noto Sans Bengali",system-ui,sans-serif;
  --sg-font-en-display:"Fraunces",Georgia,serif;
  --sg-font-body:"Hind Siliguri","Noto Sans Bengali",system-ui,sans-serif;
}

/* ============================================================================
   Semantic layer — re-points the existing eleven tokens at the primitives.
   Every computed value is identical to what site.css already produces, so
   adding this file is visually a no-op. Confirmed value by value.
   ========================================================================= */
:root{
  --bg:var(--sg-neutral-50);            /* was #f5fafa */
  --surface:var(--sg-neutral-0);        /* was #ffffff */
  --text:var(--sg-neutral-800);         /* was #15292b */
  --muted:var(--sg-neutral-600);        /* was #4b6366 */
  --border:var(--sg-neutral-200);       /* was #d5e5e5 */
  --brand:var(--sg-teal-500);           /* was #209C9C */
  --brand-strong:var(--sg-teal-700);    /* was #136464 */
  --brand-ink:var(--sg-neutral-0);      /* was #ffffff */
  --accent:var(--sg-orange-500);        /* was #FC803C */
  --focus:var(--sg-teal-700);           /* was #136464 */
  --pending:var(--sg-orange-700);       /* was #a9521f */
}

[data-theme="dark"]{
  --bg:var(--sg-dark-bg);               /* was #0c1819 */
  --surface:var(--sg-dark-surface);     /* was #132324 */
  --text:var(--sg-dark-text);           /* was #e6f2f2 */
  --muted:var(--sg-dark-muted);         /* was #a9c2c2 */
  --border:var(--sg-dark-border);       /* was #24393a */
  --brand:var(--sg-teal-500);           /* was #209C9C */
  --brand-strong:var(--sg-teal-500);    /* was #209c9c — same step in dark */
  --brand-ink:var(--sg-dark-bg);        /* was #0c1819 */
  --accent:var(--sg-orange-500);        /* was #FC803C */
  --focus:var(--sg-teal-500);           /* was #209c9c */
  --pending:#FFD2B5;                    /* kept literal: not on the orange ramp */
}

/* ============================================================================
   ACCESSIBILITY FIX — the one AA failure found in build v135.
   Applied here rather than in site.css, so site.css stays untouched and the
   change is reversible by deleting this one block.

   White on --brand (#209C9C) is 3.33:1, which fails WCAG AA for small text.
   Four badges use it, all of them small and bold (0.72-0.75rem / 700), so
   none qualifies for the 3:1 large-text allowance. Moving them to
   --sg-teal-700 takes white to 6.92:1 and introduces no new colour.

   ENABLED 2026-11-11 at the client's request.
   ========================================================================= */

/* The badge ground is theme-aware on purpose. In light, white on teal-500 is
   only 3.33:1, so the badge drops to teal-700 (white -> 6.92:1). In dark,
   --brand-ink is near-black and teal-500 is already the correct, passing
   ground (5.43:1) — forcing teal-700 there would CUT it to 2.61:1. */
:root{ --sg-badge-ground:var(--sg-teal-700); }
[data-theme="dark"]{ --sg-badge-ground:var(--sg-teal-500); }

.inst-card-title .icode,
.focus-list .icode,
.ad-steps li.on .ad-num,
.ad-steps li.done .ad-num{
  background:var(--sg-badge-ground);
  border-color:var(--sg-badge-ground);
  color:var(--brand-ink);
}

/* In dark mode these already pass (5.43:1) and need no change. */

/* ============================================================================
   CONTRAST REFERENCE — measured, not estimated.

   On #FFFFFF        safe for small text:  teal 600+, orange 700+, neutral 600+
                     large text only:      teal 500, orange 600, neutral 500
                     decorative only:      teal <=400, orange <=500, neutral <=400

   On #0C1819 (dark) safe for small text:  teal <=500, orange <=600, neutral <=400

   Pairs worth memorising:
       white on --sg-teal-700         6.92:1   headings, buttons, bands
       white on --sg-orange-700       5.37:1   the rust dock button
       --sg-teal-700 on white         6.92:1   links and eyebrows
       --sg-neutral-600 on white      6.41:1   muted body copy
       white on --sg-teal-500         3.33:1   FAILS small text — see above
   ========================================================================= */

/* ============================================================================
   BACKGROUND ART — "Delta Braid"
   Added 2026-11-11. Decorative only; every file is aria-hidden and carries no
   information. Layered OVER the existing gradients, never replacing them, so
   removing this block restores the previous appearance exactly.

   Ink in these files is held at <=0.14 opacity on light grounds and <=0.17 on
   the teal band, so every contrast pair measured for the palette still holds.
   ========================================================================= */

/* Cover: the braid gets its own layer underneath everything, so the existing
   gradient on .cover and the radial tints on .cover-mesh are left untouched.
   A diagonal mask fades it out across the headline column — the Bangla
   display face has fine counters and conjuncts, and linework behind it
   costs legibility for nothing. Full strength only on the open right side. */
.cover::before{
  content:"";
  position:absolute; inset:0; z-index:0;
  background:url("art/hero-mesh-7.svg") center/cover no-repeat;
  opacity:.7;
  -webkit-mask-image:linear-gradient(100deg,transparent 0%,rgba(0,0,0,.18) 26%,rgba(0,0,0,.6) 50%,#000 76%);
          mask-image:linear-gradient(100deg,transparent 0%,rgba(0,0,0,.18) 26%,rgba(0,0,0,.6) 50%,#000 76%);
  pointer-events:none;
}
/* Dark keeps its own wash: this art is tuned for light grounds. */
[data-theme="dark"] .cover::before{ display:none; }

/* Stats band: white strands over the fixed deep teal. The colour stays, so
   white text on it is still 6.92:1. */
.band{
  background-image:url("art/band-texture-7.svg");
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
}

/* Partner strip: the seamless tile under the existing animated gradient. */
.partner-sec{
  background-image:url("art/pattern-delta-7.svg");
  background-repeat:repeat;
  background-size:240px 240px;
}
[data-theme="dark"] .partner-sec{ background-image:none; }

/* One braided divider, introducing the programmes section. Pure CSS — no
   markup change — and it collapses to nothing if the section is absent. */
.programs-sec{ position:relative; padding-top:clamp(40px,6vw,64px); }
.programs-sec::before{
  content:"";
  position:absolute; left:0; right:0; top:0;
  height:60px;
  background:url("art/divider-braid-7.svg") center/100% 100% no-repeat;
  opacity:.8;
  pointer-events:none;
}
[data-theme="dark"] .programs-sec::before{ opacity:.55; }
