/* ============================================================
   A COPY. The original lives in the CandyWrapDLS folder, which
   is the design system shared across CandyWrap properties, and
   it was loaded from /CandyWrapDLS/css/ until that folder
   became unreadable on the server: an .htaccess inside it that
   Apache could not read, which made Apache deny the whole
   branch and left every design token on the site undefined.

   Serving it from the site's own css/ folder removes a
   cross-folder dependency that the site cannot repair by
   itself. One file, 15 KB, and no hosting problem can take the
   colours away.

   KEEPING IT IN STEP: when a token changes in the DLS, copy
   this file again. That is the cost of the trade, and it is
   worth it — a shared file that 403s is worse than a copied
   one that works.
   ============================================================ */

/* ============================================================
   CANDYWRAP DESIGN LANGUAGE SYSTEM, TOKENS
   v1.1 · single source of truth for every brand and product colour

   ****  THIS IS THE ONLY FILE YOU EDIT TO CHANGE A COLOUR.  ****

   Nothing else in the CandyWrap codebase may declare a brand hex.
   Not candywrapai, not berry, not the admin panel. They all link
   this file and read the variables.

   To change a product colour: edit its .theme-* block below, save,
   and every property updates. Nothing else needs touching.

   BEFORE YOU CHANGE A COLOUR, check these four ratios (WCAG AA):
     --primary-ink   >= 4.5:1 against #FFFFFF  and against --bg
     --primary-deep  >= 4.5:1 against --primary-tint
     --primary-light >= 4.5:1 against --deep (#1E1226)
     --grad          >= 4.5:1 with white text end to end,
                     or add a --scrim
   Three of the four surfaces needed adjusting to meet these.
   They are constraints, not preferences.

   Served from: /CandyWrapDLS/css/candywrap-tokens.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=DM+Serif+Display:ital@0;1&family=Sora:wght@400;500;600;700&display=swap');

/* ------------------------------------------------------------
   1. GLOBAL TOKENS (surface-independent)
   ------------------------------------------------------------ */
:root {
  /* --- Surfaces. Say the name, use the token. ---
     Canvas   #FDFAFA  the one shared page background, everywhere
     Snow     #FFFFFF  cards, panels
     Shell    #F6F2F3  wells, inputs, table stripes, code blocks    */
  --bg:            #FDFAFA;
  --surface:       #FFFFFF;
  --surface-sunk:  #F6F2F3;

  /* --- Neutrals ---
     Ink      #2D2A33  body text                      13.6:1 on Canvas
     Plum     #2B1B33  headings                       15.5:1 on Canvas
     Slate    #6E6878  captions, labels, muted copy    5.2:1 on Canvas
     Mist     #E7E1E6  hairlines and dividers. Never text
     Midnight #1E1226  footer and reverse bands                     */
  --ink:    #2D2A33;
  --plum:   #2B1B33;
  --slate:  #6E6878;
  --mist:   #E7E1E6;
  --deep:   #1E1226;

  /* --- Shared accents (same on all four surfaces) --- */
  --teal:       #00796B;  /* success, links in body copy  5.3:1 */
  --teal-tint:  #E8F3F1;
  --amber:      #E8A33D;  /* badges, warmth, DARK TEXT ONLY */
  --amber-ink:  #8A6A12;  /* the AA-safe amber for text   5.1:1 */
  --amber-tint: #FDF3E2;

  /* --- Semantic ---
     Each has a tint for soft badges and flash messages. Every pair is
     AA on its own tint. Berry's app shipped #0F9D74 / #C77700 for
     success/warning; both fail at ~3.45:1, so these replace them.
     --info is a blue, NOT --primary, Berry's brand colour is indigo,
     and an indigo "info" state would vanish on a Berry surface. */
  --success:      #00796B;  --success-tint: #E8F3F1;
  --warning:      #8A6A12;  --warning-tint: #FDF3E2;
  --danger:       #C0392B;  --danger-tint:  #FBECEA;
  --info:         #3567C9;  --info-tint:    #EAF0FC;

  /* --- Type --- */
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-tech:    'Sora', var(--font-body);
  --font-mono:    ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Type scale, 1.25 major third, clamped for fluid resize */
  --t-display: clamp(40px, 6vw, 68px);
  --t-h1:      clamp(32px, 4.4vw, 48px);
  --t-h2:      clamp(26px, 3vw, 34px);
  --t-h3:      22px;
  --t-h4:      18px;
  --t-body-lg: 17px;
  --t-body:    15.5px;
  --t-small:   13.5px;
  --t-micro:   11.5px;

  --lh-tight: 1.12;
  --lh-head:  1.24;
  --lh-body:  1.62;
  --ls-tight: -0.02em;
  --ls-caps:   0.13em;

  /* --- Spacing: 4px base --- */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 24px;  --s-6: 32px;  --s-7: 48px;  --s-8: 64px;
  --s-9: 96px;  --s-10: 128px;
  --section-y: clamp(64px, 9vw, 128px);
  --gutter:    clamp(20px, 5vw, 48px);
  --maxw:      1180px;
  --maxw-text: 68ch;

  /* --- Radii --- */
  --r-xs: 6px;  --r-sm: 10px;  --r-md: 14px;
  --r-lg: 20px; --r-xl: 28px;  --r-pill: 999px;
  --r-app: 16px;  /* application panels, between md and lg */

  /* --- Control heights ---
     EVERY inline control reads one of these: buttons, inputs, selects,
     icon buttons, chips. That is the only way a button, a bell icon and
     a filter chip sitting in the same row end up the same height.
     Never set a control's height with padding alone. */
  --ctl-h:    46px;
  --ctl-h-sm: 38px;
  --ctl-h-lg: 54px;

  /* --- Motion --- */
  --ease:      cubic-bezier(.32, .72, 0, 1);
  --ease-out:  cubic-bezier(.16, 1, .3, 1);
  --dur-fast:  140ms;
  --dur:       220ms;
  --dur-slow:  600ms;

  /* --- Neutral elevation (non-branded UI: modals, dropdowns) ---
     Shadows are tinted with Plum ink, never pure black. --ink-rgb
     exposes those channels so a product can compose its own step
     without re-declaring the hex. */
  --ink-rgb:  43, 27, 51;
  --shadow-1: 0 1px 2px rgba(var(--ink-rgb), .06);
  --shadow-2: 0 4px 16px rgba(var(--ink-rgb), .08);
  --shadow-3: 0 18px 44px rgba(var(--ink-rgb), .14);

  /* --- Focus ring (accessibility, never remove) --- */
  --focus: 0 0 0 3px var(--bg), 0 0 0 5.5px var(--primary);
}

/* ------------------------------------------------------------
   2. THE PALETTE, two brand colours, that is all
   ------------------------------------------------------------

   Simplified 6 Aug 2026. Berry and Melon no longer have their own
   colours: every AI product is Candy Magenta. Fewer colours, one
   gradient, and a team can hold the whole thing in their head.

   Say the NAME in conversation, use the TOKEN in CSS.

   CORAL, CandyWrap Design
     Coral Tint   #FFECEC   washes, soft badges, icon plates
     Coral        #FF5555   THE brand colour. Fills and graphics only
     Coral Ink    #D63636   buttons, links, small text        4.73:1
     Coral Deep   #9E1F28   pressed states, text on a tint    7.83:1

   CANDY, CandyWrap.ai and every AI product
     Candy Tint   #FBEEF4   washes, soft badges, icon plates
     Candy Rose   #FF7FA6   links and accents on Midnight     7.56:1
     Candy        #C22058   THE brand colour, and safe as text 5.77:1
     Candy Deep   #7E1240   pressed states, text on a tint   10.26:1

   Coral cannot carry white text (3.14:1), so Design uses Coral Ink for
   anything with text on it. Candy can (5.77:1), so it needs no separate
   ink shade. That asymmetry is the only thing to remember.
   ------------------------------------------------------------ */

:root {
  /* Named palette. Available everywhere, on every surface. */
  --coral-tint: #FFECEC;
  --coral:      #FF5555;
  --coral-ink:  #D63636;
  --coral-deep: #9E1F28;

  --candy-tint: #FBEEF4;
  --candy-rose: #FF7FA6;
  --candy:      #C22058;
  --candy-deep: #7E1240;

  /* THE gradient. There is exactly one, it runs Coral into Candy, and
     it belongs to the company rather than to either half of it.
     USE IT ONLY ON IMPORTANT BANNERS AND CTA BANDS. Not on cards, not
     on buttons, not on section backgrounds. Its scarcity is the point.
     White text on the Coral end is 3.14:1, so .cta adds a text shadow. */
  --grad: linear-gradient(150deg, #FF5555 0%, #C22058 100%);

  /* Scrim: kept as a no-op so older markup does not break. */
  --scrim: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0));

  /* Text shadow for white type on The Wrap.
     Three layers, all at ZERO offset. An offset reads as a drop shadow
     stuck behind the letter; zero offset with a wide blur reads as the
     glyph sitting IN the surface, gently darkening the gradient around
     itself. The colour is a deepened Candy (#5E0C28) rather than black,
     so it stays in family and never looks like grey dirt on the fill.
       24px  the wide halo, does the legibility work
        8px  mid falloff, stops the halo looking like a ring
        2px  a whisper on the edge, keeps the letterform crisp     */
  --text-on-grad:
      0 0 24px rgba(94, 12, 40, .34),
      0 0  8px rgba(94, 12, 40, .20),
      0 0  2px rgba(94, 12, 40, .14);
  /* Same shape, a little denser, for body-size text on the gradient. */
  --text-on-grad-sm:
      0 0 18px rgba(94, 12, 40, .40),
      0 0  6px rgba(94, 12, 40, .26),
      0 0  2px rgba(94, 12, 40, .18);
}

/* ------------------------------------------------------------
   SURFACES
   Two, and only two. A surface class on <body> points the role
   tokens (--primary*) at one of the two palettes. Components read
   the role tokens, never the named ones, which is what lets one
   component serve both brands.
   ------------------------------------------------------------ */

/* CandyWrap Design */
.theme-design {
  --primary:      var(--coral);
  --primary-ink:  var(--coral-ink);
  --primary-deep: var(--coral-deep);
  --primary-light:var(--coral);      /* 5.71:1 on Midnight */
  --primary-tint: var(--coral-tint);
  --primary-rgb:  255, 85, 85;
}

/* CandyWrap.ai, and every AI product: Berry, Labs, all of them */
.theme-ai {
  --primary:      var(--candy);
  --primary-ink:  var(--candy);      /* 5.77:1, no separate ink needed */
  --primary-deep: var(--candy-deep);
  --primary-light:var(--candy-rose); /* 7.56:1 on Midnight */
  --primary-tint: var(--candy-tint);
  --primary-rgb:  194, 32, 88;
}

/* Retired surfaces.
   Berry and Labs no longer have their own colours. These aliases exist
   so existing markup keeps working: berry/includes/head.php still says
   class="theme-berry" and will now simply render as Candy Magenta.
   Prefer .theme-ai in new markup. */

/* Default when no surface class is present: CandyWrap.ai. */
:root,
.theme-berry, .theme-labs, .theme-melon {
  --primary:      var(--candy);
  --primary-ink:  var(--candy);
  --primary-deep: var(--candy-deep);
  --primary-light:var(--candy-rose);
  --primary-tint: var(--candy-tint);
  --primary-rgb:  194, 32, 88;
}

/* ------------------------------------------------------------
   3. BRANDED ELEVATION
   Shadows are tinted with the active primary, never grey.

   WHY THIS SELECTOR LIST AND NOT :root
   A custom property resolves its inner var() at the element where it
   is DECLARED. If these lived only on :root they would resolve with
   :root's --primary-rgb, so a .theme-design body would still get a
   magenta shadow. Declaring them alongside every theme means each one
   recomputes with its own primary.

   It also fails safe. The fallback in each rgba() means that if
   --primary-rgb ever goes missing the shadow degrades to Candy rather
   than vanishing. Losing the comma out of this selector once already
   deleted every shadow on every site, silently, because an invalid
   custom property is simply dropped.
   ------------------------------------------------------------ */
:root,
.theme-design, .theme-ai,
.theme-berry, .theme-labs, .theme-melon {
  /* Taken from the .ai site. The signature is a LARGE negative spread
     with a HIGH alpha: the shadow is pulled in tight under the card and
     pushed down, so it reads as weight rather than haze. A low-alpha
     positive-spread shadow looks washed out beside it. Do not
     "simplify" these into a normal blur. */
  --lift-rest:  0 20px 44px -28px rgba(var(--primary-rgb, 194, 32, 88), .60);
  --lift-hover: 0 30px 56px -28px rgba(var(--primary-rgb, 194, 32, 88), .75);
  --lift-flat:  0 16px 34px -26px rgba(var(--primary-rgb, 194, 32, 88), .55);

  /* Product cards are already saturated. A coloured shadow under an
     already-saturated card reads as a bug, so these stay neutral ink. */
  --lift-product:   0 24px 46px -22px rgba(43,27,51,.40);
  --lift-product-h: 0 34px 60px -22px rgba(43,27,51,.50);

  --lift-btn:   0 8px 22px -8px rgba(var(--primary-rgb, 194, 32, 88), .60);
  --lift-btn-h: 0 14px 30px -8px rgba(var(--primary-rgb, 194, 32, 88), .65);
}

/* ============================================================
   DATA COLOUR
   ============================================================

   Two different jobs. Picking the wrong one is the usual reason a
   dashboard looks noisy.

   1. CATEGORICAL, for unrelated things: Cat, Dog, Mouse. Distinct
      hues, assigned in the fixed order below so a given metric keeps
      its colour across every screen and every deck.

   2. SEQUENTIAL, "The Wrap ramp", for ordered or related data:
      stacked areas, heatmaps, magnitude, one team's members. Shades
      of the brand, so a chart with eight bands still looks like us.

   THE RULE: more than six series is not categorical. Use the ramp.
   Six distinct hues is roughly the limit of what a person can hold
   in a legend, and well past the limit of what stays separable for
   colour-blind viewers.

   Every categorical fill carries a --series-N-line stroke at 1.5px.
   That is not decoration. An amber light enough to read as amber
   cannot also clear 3:1 against Canvas, so the stroke carries the
   contrast and the fill carries the colour. Every stroke below is
   verified at 3:1 or better.

   Verified with CIELAB dE across normal vision, deuteranopia and
   protanopia. Worst pair: 27.3 normal, 17.0 deuteranopia, 15.2
   protanopia, all comfortably separable. Tritanopia is not fully
   separable (worst 3.2) and is accepted: it affects well under
   0.01% of people, and designing around it would cost the palette
   its brand relationship. Charts must carry direct labels or a
   legend regardless, so colour is never the only channel.
   ------------------------------------------------------------ */
:root {
  /* --- Categorical. Fixed order, never re-shuffle. --- */
  --series-1: #C22058;  --series-1-line: #880D38;  /* Candy, the brand leads */
  --series-2: #3A46B0;  --series-2-line: #222B7B;  /* Indigo */
  --series-3: #1E8F86;  --series-3-line: #0F645D;  /* Teal   */
  --series-4: #E0A02A;  --series-4-line: #9D6C13;  /* Amber  */
  --series-5: #9C6BC4;  --series-5-line: #6B4689;  /* Violet */
  --series-6: #6FA24A;  --series-6-line: #4B712F;  /* Moss   */

  /* --- Sequential. The Wrap ramp, light to dark, 8 steps. ---
     Luminance falls evenly and every neighbour is at least dE 11
     apart, so adjacent bands in a stacked area stay readable.
     Steps 1 to 3 are too light to sit on Canvas unaided: inside a
     stack they are fine because they neighbour other bands, but on
     their own give them a --ramp-8 stroke. */
  --ramp-1: #FFE4E6;
  --ramp-2: #FFC2C6;
  --ramp-3: #FF9AA0;
  --ramp-4: #FF7078;
  --ramp-5: #F84D63;
  --ramp-6: #DE2F5C;
  --ramp-7: #C22058;   /* Candy sits here, the ramp passes through the brand */
  --ramp-8: #8E1642;

  /* --- Chart chrome --- */
  --grid-line:  #ECE6EB;   /* lighter than Mist: gridlines must recede */
  --axis-line:  #D8D0D8;
  --axis-text:  #6E6878;   /* Slate, 5.2:1 on Canvas */
  --chart-label:#2D2A33;   /* Ink, for value labels */
}
/* ============================================================
   END OF TOKENS.
   Components live in candywrap-components.css and read only from
   the variables above. If you are changing how something LOOKS
   rather than what colour it IS, you are in the wrong file.
   ============================================================ */
