/* ==========================================================================
   Design tokens — shyleshs.com
   Load before every other stylesheet. Components use tokens, never raw hex.

   1. Primitives: the fixed palette. Values never change between themes.
   2. Semantic tokens: roles (background, text, surface, brand…), set per theme.
   3. Aliases: older variable names kept so existing rules keep working.

   Themes
     Old Light        :root (default)
     Old Dark         html[data-theme=dark]
     Suggested Light  html[data-cards=gradient]
     Suggested Dark   html[data-cards=gradient][data-theme=dark]

   Illustration artwork (sky, stickers, mock screens, the balloon game) keeps
   its own colours inside those components; it is artwork, not UI.
   ========================================================================== */

/* 1. Primitives ------------------------------------------------------------ */
:root{
  /* Base */
  --c-white:#ffffff;
  --c-black:#000000;

  /* Ink and stone (text) */
  --c-ink-900:#282a27;
  --c-ink-800:#343631;
  --c-ink-600:#61655c;
  --c-stone-600:#70736c;
  --c-stone-300:#bcbab5;

  /* Paper and sand (light surfaces) */
  --c-paper-0:#faf9f6;
  --c-paper-25:#fffefa;
  --c-paper-50:#faf9f5;
  --c-paper-100:#fffdf6;
  --c-sand-90:#eeeee5;
  --c-sand-100:#eeece3;
  --c-sand-150:#e9e5dc;
  --c-sand-200:#e7e4d8;
  --c-sand-300:#d8d5c8;
  --c-line-200:#dedfd6;
  --c-line-210:#deddd5;
  --c-line-300:#c8c9be;
  --c-sage-500:#8d9b95;

  /* Cream (text on dark) */
  --c-cream-50:#f1eee6;
  --c-cream-100:#e7e5df;

  /* Night (dark surfaces) */
  --c-night-1000:#080808;
  --c-night-950:#121212;
  --c-night-920:#141413;
  --c-night-900:#161615;
  --c-night-890:#161616;
  --c-night-880:#181918;
  --c-night-850:#1d1d1b;
  --c-night-830:#202020;
  --c-night-760:#262624;
  --c-night-700:#333333;
  --c-night-690:#33332f;

  /* Neutral grey (Suggested theme) */
  --c-grey-25:#fbfbfa;
  --c-grey-35:#f7f7f6;
  --c-grey-40:#f6f6f5;
  --c-grey-50:#f2f2f1;
  --c-grey-75:#ececeb;
  --c-grey-100:#e9e9e7;
  --c-grey-110:#e7e7e5;
  --c-grey-150:#e2e2e0;
  --c-grey-175:#dcdcda;
  --c-grey-450:#999999;
  --c-grey-600:#555555;

  /* Coal (Suggested dark surfaces) */
  --c-coal-650:#323231;
  --c-coal-700:#2a2a29;
  --c-coal-750:#272726;
  --c-coal-760:#262625;
  --c-coal-780:#232322;
  --c-coal-800:#1e1e1d;
  --c-coal-850:#181817;
  --c-coal-860:#1c1c1b;
  --c-coal-900:#131312;

  /* Orange (brand) */
  --c-orange-300:#f1a07d;
  --c-orange-500:#f0551e;
  --c-orange-550:#d8461a;
  --c-orange-580:#c2562d;
  --c-orange-590:#c14c28;
  --c-orange-600:#bd4a25;
  --c-orange-620:#b64e2a;
  --c-orange-630:#ad512e;
  --c-orange-640:#b45c32;
  --c-orange-650:#a13f1f;
  --c-orange-660:#b25b36;
  --c-orange-700:#9b3d1f;

  /* Green (Surge case study accent) */
  --c-green-300:#7ad98a;
  --c-green-400:#4cc25e;
  --c-green-600:#2f9e44;
  --c-green-700:#1f7a33;

  /* Transparent variants (name = primitive + alpha byte) */
  --c-black-05:#00000005;
  --c-black-06:#00000006;
  --c-black-08:#00000008;
  --c-black-0a:#0000000a;
  --c-black-0d:#0000000d;
  --c-black-0f:#0000000f;
  --c-black-10:#00000010;
  --c-black-12:#00000012;
  --c-black-16:#00000016;
  --c-black-18:#00000018;
  --c-black-1a:#0000001a;
  --c-black-1f:#0000001f;
  --c-black-20:#00000020;
  --c-black-26:#00000026;
  --c-black-2e:#0000002e;
  --c-black-33:#00000033;
  --c-black-4d:#0000004d;
  --c-black-59:#00000059;
  --c-black-66:#00000066;
  --c-black-80:#00000080;
  --c-black-8c:#0000008c;
  --c-ink-800-20:#34363120;
  --c-ink-800-25:#34363125;
  --c-ink-900-05:#282a2705;
  --c-ink-900-0f:#282a270f;
  --c-ink-900-10:#282a2710;
  --c-ink-900-14:#282a2714;
  --c-ink-900-17:#282a2717;
  --c-ink-900-1f:#282a271f;
  --c-ink-900-20:#282a2720;
  --c-ink-900-26:#282a2726;
  --c-ink-900-28:#282a2728;
  --c-ink-900-2e:#282a272e;
  --c-ink-900-30:#282a2730;
  --c-ink-900-40:#282a2740;
  --c-night-1000-60:#08080860;
  --c-night-890-ed:#161616ed;
  --c-orange-300-1a:#f1a07d1a;
  --c-orange-300-4d:#f1a07d4d;
  --c-orange-300-55:#f1a07d55;
  --c-orange-500-aa:#f0551eaa;
  --c-paper-50-60:#faf9f560;
  --c-paper-50-80:#faf9f580;
  --c-paper-50-ed:#faf9f5ed;
  --c-sage-500-60:#8d9b9560;
  --c-white-05:#ffffff05;
  --c-white-08:#ffffff08;
  --c-white-0c:#ffffff0c;
  --c-white-0d:#ffffff0d;
  --c-white-0f:#ffffff0f;
  --c-white-12:#ffffff12;
  --c-white-14:#ffffff14;
  --c-white-15:#ffffff15;
  --c-white-1a:#ffffff1a;
  --c-white-1f:#ffffff1f;
  --c-white-22:#ffffff22;
  --c-white-26:#ffffff26;
  --c-white-2e:#ffffff2e;
  --c-white-30:#ffffff30;
  --c-white-33:#ffffff33;
  --c-white-35:#ffffff35;
  --c-white-55:#ffffff55;
  --c-white-60:#ffffff60;
  --c-white-61:#ffffff61;
  --c-white-70:#ffffff70;
  --c-white-74:#ffffff74;
  --c-white-80:#ffffff80;
  --c-white-95:#ffffff95;
  --c-white-cc:#ffffffcc;
  --c-white-f0:#fffffff0;
  --c-white-f2:#fffffff2;
}

/* 2. Semantic tokens ------------------------------------------------------- */

/* Old Light */
:root{
  --color-bg:var(--c-paper-50);
  --color-text:var(--c-ink-900);
  --color-text-muted:var(--c-stone-600);
  --color-border:var(--c-line-210);

  --color-brand:var(--c-orange-600);
  --color-brand-strong:var(--c-orange-700);
  --color-brand-hand:var(--c-orange-620);
  --color-brand-serif:var(--c-orange-630);
  --color-brand-tag:var(--c-orange-590);
  --color-brand-note:var(--c-orange-640);
  --color-brand-scribble:var(--c-orange-660);
  --color-brand-mark:var(--c-orange-580);
  --color-accent:var(--color-brand);

  --color-cta-bg:var(--c-ink-900);
  --color-cta-fg:var(--c-paper-50);
  --color-cta-hover-bg:var(--color-brand);
  --color-cta-hover-fg:var(--c-white);

  --color-surface:var(--c-sand-100);
  --color-surface-hover:var(--c-sand-200);
  --surface-card:var(--color-surface);
  --surface-card-hover:var(--color-surface-hover);
  --border-card:transparent;
  --shadow-card:none;

  --color-chip-bg:var(--color-bg);
  --color-chip-fg:var(--color-text);
  --shadow-chip:none;

  --color-callout-bg:var(--c-grey-50);
  --color-callout-border:var(--c-grey-175);

  /* Type */

  --font-sans:'Geist',sans-serif;
  --font-serif:'EB Garamond',Georgia,serif;
  --font-hand:'Caveat',cursive;

  /* Shape */
  --radius-sm:10px;
  --radius-md:14px;
  --radius-lg:18px;
  --radius-xl:24px;
  --radius-pill:999px;
}

/* Old Dark */
html[data-theme=dark]{
  --color-bg:var(--c-night-1000);
  --color-text:var(--c-cream-50);
  --color-text-muted:var(--c-stone-300);
  --color-border:var(--c-night-690);

  --color-accent:var(--c-orange-300);

  --color-cta-bg:var(--c-sand-150);
  --color-cta-fg:var(--c-ink-900);
  --color-cta-hover-bg:var(--c-orange-300);
  --color-cta-hover-fg:var(--c-ink-900);

  --color-surface:var(--c-night-900);
  --color-surface-hover:var(--c-night-850);

  --color-chip-bg:var(--c-night-760);
  --color-chip-fg:var(--c-cream-100);

  --color-callout-bg:var(--c-coal-850);
  --color-callout-border:var(--c-coal-700);
}

/* Suggested Light: neutral grey gradient surfaces, brighter brand orange */
html[data-cards=gradient]{
  --color-brand:var(--c-orange-500);
  --color-brand-strong:var(--c-orange-550);
  --color-brand-hand:var(--c-orange-500);
  --color-brand-serif:var(--c-orange-500);
  --color-brand-tag:var(--c-orange-500);
  --color-brand-note:var(--c-orange-500);
  --color-brand-scribble:var(--c-orange-500);
  --color-brand-mark:var(--c-orange-500);

  --color-surface:var(--c-grey-50);
  --color-surface-hover:var(--c-grey-75);
  --surface-card:linear-gradient(135deg,var(--c-grey-25) 0%,var(--c-grey-50) 50%,var(--c-grey-100) 100%);
  --surface-card-hover:linear-gradient(135deg,var(--c-grey-35) 0%,var(--c-grey-75) 50%,var(--c-grey-150) 100%);
  --border-card:var(--c-grey-110);
  --shadow-card:0 1px 0 var(--c-white-cc) inset,0 14px 34px -24px var(--c-black-26);

  --color-chip-bg:var(--c-white);
  --color-chip-fg:var(--c-ink-900);
  --shadow-chip:0 1px 2px var(--c-black-12);
}

/* Suggested Dark */
html[data-cards=gradient][data-theme=dark]{
  --color-surface:var(--c-coal-850);
  --color-surface-hover:var(--c-coal-860);
  --surface-card:linear-gradient(135deg,var(--c-coal-800) 0%,var(--c-coal-850) 55%,var(--c-coal-900) 100%);
  --surface-card-hover:linear-gradient(135deg,var(--c-coal-780) 0%,var(--c-coal-860) 55%,var(--c-night-900) 100%);
  --border-card:var(--c-coal-700);
  --shadow-card:none;

  --color-chip-bg:var(--c-coal-750);
  --color-chip-fg:var(--c-cream-100);
  --shadow-chip:none;
}

/* 3. Aliases (older names) -------------------------------------------------- */
:root{
  --paper:var(--color-bg);
  --ink:var(--color-text);
  --muted:var(--color-text-muted);
  --line:var(--color-border);
  --accent:var(--color-accent);
  --orange:var(--color-brand);
  --cta-bg:var(--color-cta-bg);
  --cta-fg:var(--color-cta-fg);
  --cta-hover-bg:var(--color-cta-hover-bg);
  --cta-hover-fg:var(--color-cta-hover-fg);
}
