/* ==========================================================================
   EK design tokens — the single source of truth.

   One :root. No other file may declare :root, and no template may declare
   colour or type values of its own. theme.json mirrors these so the block
   editor matches the front end.

   Contrast (measured against --ek-sand #F9F7F2):
     --ek-gold-ink  #8A6A1F  4.76:1  text-safe gold
     --ek-veld-gold #C29B38  2.42:1  DECORATIVE ONLY — rules, borders, dividers
     --ek-muted     #6B655F  5.43:1
     --ek-sage-ink  #4A5A48  6.97:1
   On --ek-earth-dark #2B2621:
     --ek-veld-gold #C29B38  5.73:1  text-safe on dark
     --ek-on-dark-muted #A8A098  5.81:1
   ========================================================================== */

:root {
	/* --- Free State veld palette ------------------------------------------ */
	--ek-earth-dark:    #2B2621;
	--ek-earth-mid:     #3E3832;
	--ek-sand:          #F9F7F2;
	--ek-sand-deep:     #F2EFE7;
	--ek-white:         #FFFFFF;
	--ek-border:        #E2DBD0;
	--ek-border-soft:   #EDE8DF;
	--ek-veld-gold:     #C29B38;  /* decorative only */
	--ek-gold-ink:      #8A6A1F;  /* gold for text */
	--ek-sage:          #5C6B5A;
	--ek-sage-ink:      #4A5A48;
	--ek-muted:         #6B655F;
	--ek-on-dark:       #F9F7F2;
	--ek-on-dark-muted: #A8A098;
	--ek-brick:         #8C3A2B;  /* errors, destructive */
	--ek-veld-deep:     #2F3A2E;  /* deep sage: the placeholder book cloth */
	--ek-veld-deeper:   #232C22;
	--ek-gold-light:    #D9B45B;  /* gold text on deep sage or earth-dark: 6.0:1 */
	--ek-gold-ink-deep: #7A5E1B;  /* gold text on sage tint: 4.9:1 */

	/* Muted, warm sage: olive-leaning so it sits with sand, earth and gold. */
	--ek-sage-tint:     #ECE9DC;  /* sage folded into sand */
	--ek-sage-soft:     #C9C7B0;
	--ek-sage-muted:    #8C8E74;  /* decorative */
	--ek-sage-deep:     #4A5141;  /* text-safe: 7.8:1 with sand */
	--ek-sage-deeper:   #3B4034;
	--ek-nature:        #45443A;  /* earthy olive-brown; cream text 8.4:1 */
	--ek-nurture:       #EFE5D2;  /* gold-warmed sand */

	/* --- Skye's page colours (20 Oct 2026) ---------------------------------
	   Exact values from her page stylesheets (pages/skye-*.css, section-nav.css,
	   footer.css), which now read these tokens instead of hex codes. Never round
	   or merge them with the palette above: nearby values are different on purpose
	   (or by history), and merging would change pixels. One change here = every
	   place that uses that colour. */
	/* Grounds */
	--ek-linen:              #F6F3EC;  /* page ground: author, community, contact, shop, simple pages */
	--ek-linen-book:         #F5F2EB;  /* page ground: About the book */
	--ek-linen-home:         #F8F6F0;  /* page ground: Home */
	--ek-linen-deep:         #F2EDE2;  /* Continue reading band, footer sign-up band */
	--ek-linen-fade:         #F1ECE2;  /* Home: end of the book section fade */
	--ek-linen-shade:        #E8E2D5;  /* Reading community: hub image ground */
	--ek-paper:              #FAF8F4;  /* paper cards, Books bar */
	--ek-paper-book:         #FAF8F3;  /* About the book: paper */
	/* Ink and muted text */
	--ek-ink:                #1F1D1A;  /* body text on the Skye pages, Books bar, footer sign-up band */
	--ek-ink-book:           #221F1D;  /* About the book: text */
	--ek-ink-home:           #211D1A;  /* Home: text, dark buttons, Order band */
	--ek-ink-soft:           #3E3A35;  /* About the book: nature/nurture paragraph */
	--ek-earth-hover:        #3A332C;  /* Home: dark button hover */
	--ek-earth-hover-warm:   #4A4038;  /* footer sign-up button hover */
	--ek-muted-strong:       #4F4A44;  /* muted text 8:1 on sand: Home, Books bar, footer sign-up */
	--ek-muted-warm:         #59544D;  /* muted text: author, community, contact, shop, simple */
	--ek-muted-book:         #605B54;  /* About the book: muted text */
	--ek-muted-books:        #5C564F;  /* Books page: muted fallback */
	--ek-muted-light:        #8A8175;  /* Writing process: contents line without a date */
	/* Lines */
	--ek-line:               #E1DAD0;  /* hairlines: Skye pages, Books bar, footer sign-up */
	--ek-line-dark:          #C8BEB0;  /* darker hairline: author, community */
	--ek-border-home:        #E5DFD5;  /* Home: borders */
	--ek-border-book:        #E0DAD0;  /* About the book: borders */
	--ek-dot-leader:         #A39782;  /* Writing process: contents dot leaders */
	--ek-field-border:       #857C70;  /* footer sign-up field border (3.5:1 on linen) */
	/* Gold */
	--ek-gold-accent:        #A37E3E;  /* Skye's gold accent: author, community, contact, shop, simple */
	--ek-gold-soft:          #D1BA8E;  /* Skye's soft gold */
	--ek-gold-numeral:       #A78544;  /* About the author: essay numbers (3.1:1, large text) */
	--ek-gold-book:          #C09835;  /* About the book: gold */
	--ek-gold-text:          #86672A;  /* gold text AA: Home, Books bar numbers, Writing process */
	--ek-gold-link:          #7F6220;  /* gold links AA (5.2:1): community, book, search focus */
	--ek-gold-pale:          #E8D8A8;  /* pale gold on dark: Home, trilogy band, Books covers */
	--ek-gold-pale-focus:    #E8D9AE;  /* footer link focus */
	--ek-gold-hover:         #D8B65A;  /* Home: gold button hover */
	/* Sage */
	--ek-sage-accent:        #536150;  /* Skye's sage accent; Editor's perspective sage */
	--ek-sage-book:          #586B56;  /* About the book: sage */
	--ek-sage-dark:          #3B4639;  /* Editor's perspective: dark sage */
	--ek-sage-ink-home:      #3F4A3D;  /* Home: nature/nurture paragraphs */
	--ek-sage-wash:          #E9ECE4;  /* Home + Editor's perspective: sage wash */
	--ek-sage-wash-light:    #F3F5F0;  /* About the book: nurture column */
	--ek-sage-line:          #F0F2EC;  /* Editor's perspective: notebook lines */
	--ek-sage-rule:          #DCE1D6;  /* Editor's perspective: rules */
	/* On dark */
	--ek-on-dark-warm:       #F4EFE5;  /* Home: Order band text */
	--ek-on-dark-soft:       #D6CFC4;  /* footer: about line, bottom bar, legal links */
	--ek-on-dark-note:       #CFC6B8;  /* Home: Order band notes */
	--ek-on-dark-link:       #E6E0D6;  /* footer: column links */
	--ek-on-dark-legal:      #BDB5A9;  /* footer: copyright line (6.6:1) */
	/* About the author: veld drawing */
	--ek-veld-sky:           #EFE7D8;  /* ground */
	--ek-veld-sky-top:       #F6F2EA;  /* sky, top */
	--ek-veld-haze:          #EEE5D4;  /* sky at the horizon */
	--ek-veld-grass-light:   #DCCAA2;  /* grass at the horizon */
	--ek-veld-grass:         #C8B184;  /* grass, bottom */
	/* Transparent tints (exact rgba values; change them together with their base colour) */
	--ek-black-a04:          rgba(0, 0, 0, 0.04);  /* shadows */
	--ek-black-a05:          rgba(0, 0, 0, 0.05);  /* shadows */
	--ek-black-a06:          rgba(0, 0, 0, 0.06);  /* shadows */
	--ek-black-a50:          rgba(0, 0, 0, 0.5);  /* Home: cover title text shadow */
	--ek-earth-dark-a035:    rgba(43, 38, 33, 0.035);  /* About the author: veld drawing lines */
	--ek-earth-dark-a06:     rgba(43, 38, 33, 0.06);  /* Writing process: shadow */
	--ek-ink-a08:            rgba(31, 29, 26, 0.08);  /* Continue reading card hover shadow */
	--ek-ink-book-a05:       rgba(34, 31, 29, 0.05);  /* About the book: theme card hover shadow */
	--ek-ink-home-a06:       rgba(33, 29, 26, 0.06);  /* Home */
	--ek-ink-home-a12:       rgba(33, 29, 26, 0.12);  /* Home */
	--ek-ink-home-a18:       rgba(33, 29, 26, 0.18);  /* Home */
	--ek-ink-home-a22:       rgba(33, 29, 26, 0.22);  /* Home */
	--ek-ink-home-a50:       rgba(33, 29, 26, 0.5);  /* Home: photo overlay */
	--ek-ink-home-a64:       rgba(33, 29, 26, 0.64);  /* Home: photo overlay */
	--ek-ink-home-a76:       rgba(33, 29, 26, 0.76);  /* Home: photo overlay */
	--ek-ink-home-a78:       rgba(33, 29, 26, 0.78);  /* Home: photo overlay */
	--ek-linen-book-a00:     rgba(245, 242, 235, 0);  /* About the book: fade start */
	--ek-linen-book-a94:     rgba(245, 242, 235, 0.94);  /* About the book: frosted bar */
	--ek-veld-gold-a70:      rgba(194, 155, 56, 0.7);  /* About the author: horizon line */
	--ek-gold-book-a08:      rgba(192, 152, 53, 0.08);  /* About the book: card shadow */
	--ek-gold-pale-a22:      rgba(232, 216, 168, 0.22);  /* Home: Order band rules */
	--ek-gold-pale-a25:      rgba(232, 216, 168, 0.25);  /* Home: Order band rules */
	--ek-gold-pale-a35:      rgba(232, 216, 168, 0.35);  /* Books: cover frame */
	--ek-gold-pale-a45:      rgba(232, 216, 168, 0.45);  /* Home: cover frame */
	--ek-sage-a35:           rgba(92, 107, 90, 0.35);  /* Home: nature/nurture divider */
	--ek-border-a15:         rgba(226, 219, 208, 0.15);  /* footer: bottom bar rules */

	/* --- Shared components and the book drawings (20 Oct 2026) -------------
	   Exact values from base.css, skye.css, header.css, book.css, readability.css
	   and mobile.css, which now read tokens only. Same rule as above: never round
	   or merge. */
	/* Placeholder frame, quote box, Coming soon cards (base.css, skye.css) */
	--ek-frame-ground:       #EFE9DC;  /* placeholder frame ground */
	--ek-frame-line:         #D9CDB4;  /* placeholder frame inner line */
	--ek-paper-warm:         #FFFDF9;  /* quote box */
	--ek-muted-soon:         #6B645B;  /* Coming soon channel handle */
	/* Book drawings (components/book.css) */
	--ek-page-edge-light:    #F4EFE4;  /* page block, light stripe */
	--ek-page-edge-dark:     #DDD5C5;  /* page block, dark stripe */
	--ek-cloth-light:        #3A4838;  /* hardcover cloth highlight */
	--ek-cloth-gold:         #D9C48F;  /* hardcover title foil */
	--ek-softcover:          #EFE7D6;  /* softcover ground */
	--ek-softcover-light:    #F6F0E3;  /* softcover highlight */
	--ek-softcover-mid:      #EAE0CC;  /* softcover */
	--ek-softcover-edge:     #DFD3BA;  /* softcover edge */
	--ek-bezel:              #1E1B18;  /* digital edition: tablet bezel */
	/* Transparent tints (exact rgba values; change them together with their base colour) */
	--ek-white-a00:          rgba(255, 255, 255, 0);  /* sheen end */
	--ek-white-a025:         rgba(255, 255, 255, 0.025);  /* cloth weave */
	--ek-white-a06:          rgba(255, 255, 255, 0.06);  /* bezel inner line */
	--ek-white-a10:          rgba(255, 255, 255, 0.10);  /* cover sheen */
	--ek-white-a12:          rgba(255, 255, 255, 0.12);  /* screen sheen */
	--ek-white-a55:          rgba(255, 255, 255, 0.55);  /* placeholder frame sheen */
	--ek-black-a00:          rgba(0, 0, 0, 0);  /* cover spine shade end */
	--ek-black-a08:          rgba(0, 0, 0, 0.08);  /* header: menu + sticky shadows */
	--ek-black-a16:          rgba(0, 0, 0, 0.16);  /* cover spine shade */
	--ek-black-a18:          rgba(0, 0, 0, 0.18);  /* cover shade */
	--ek-black-a38:          rgba(0, 0, 0, 0.38);  /* cover spine shade */
	--ek-earth-dark-a00:     rgba(43, 38, 33, 0);  /* placeholder frame shade end */
	--ek-earth-dark-a02:     rgba(43, 38, 33, 0.02);  /* softcover lines */
	--ek-ink-home-a05:       rgba(33, 29, 26, 0.05);  /* card hover shadow (base.css) */
	--ek-veld-gold-a07:      rgba(194, 155, 56, 0.07);  /* Coming soon wash */
	--ek-veld-gold-a08:      rgba(194, 155, 56, 0.08);  /* badge wash */
	--ek-veld-gold-a15:      rgba(194, 155, 56, 0.15);  /* number picker: free-number hover on the dark band (prototype, 10 Nov) */
	--ek-veld-gold-a25:      rgba(194, 155, 56, 0.25);  /* badge border */
	--ek-gold-text-a45:      rgba(134, 103, 42, 0.45);  /* Coming soon border */
	--ek-book-shadow-a00:    rgba(15, 12, 9, 0);  /* book shadow end */
	--ek-book-shadow-a25:    rgba(15, 12, 9, 0.25);  /* book shadow */
	--ek-book-shadow-a45:    rgba(15, 12, 9, 0.45);  /* book shadow */
	--ek-book-shadow-a50:    rgba(15, 12, 9, 0.5);  /* tablet shadow */
	--ek-book-shadow-a55:    rgba(15, 12, 9, 0.55);  /* book shadow */

	/* --- Number picker (local prototype, 10 Nov 2026) ----------------------
	   Picker-only text colours (Skye: darker, same warm family). Aliases of
	   existing tokens, so no site-wide colour changes. */
	--ek-picker-muted:      var(--ek-muted-strong);   /* 7.9:1 on linen, 7.3:1 on sage wash */
	--ek-picker-muted-dark: var(--ek-on-dark-legal);  /* 7.4:1 on earth dark; 5.7:1 on earth mid (taken) */
	--ek-picker-alert:      var(--ek-brick);          /* the 30-minute line: 6.9:1 on linen */

	/* --- Semantic roles --------------------------------------------------- */
	--ek-bg:            var(--ek-sand);
	--ek-bg-sunken:     var(--ek-sand-deep);
	--ek-surface:       var(--ek-white);
	--ek-text:          var(--ek-earth-dark);
	--ek-text-muted:    var(--ek-muted);
	--ek-text-accent:   var(--ek-gold-ink);
	--ek-rule:          var(--ek-border);
	--ek-rule-soft:     var(--ek-border-soft);
	--ek-rule-accent:   var(--ek-veld-gold);
	--ek-link:          var(--ek-gold-ink);
	--ek-link-hover:    var(--ek-earth-dark);
	--ek-focus:         var(--ek-gold-ink);

	/* --- Type ------------------------------------------------------------- */
	--ek-font-serif: "Cormorant Garamond", Georgia, "Iowan Old Style", "Times New Roman", serif;
	--ek-font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	/* Skye's own font lists, exactly as her stylesheets had them before 20 Oct (#35):
	   same first font, different fallbacks. Her pages, the Books bar and .ek-af use these;
	   everything else uses the two above. Change the site font = change all six. */
	--ek-font-serif-skye: 'Cormorant Garamond', Georgia, serif;
	--ek-font-sans-skye:  'Inter', system-ui, -apple-system, sans-serif;
	--ek-font-serif-home: 'Cormorant Garamond', 'Georgia', serif;  /* Home */
	--ek-font-sans-home:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;  /* Home */

	/* Floor is 0.75rem / 12px. The reference theme used 10–11px labels,
	   which the audit flagged — nothing here goes below 12px. */
	--ek-text-xs:   0.75rem;
	--ek-text-sm:   0.875rem;
	--ek-text-base: 1rem;
	--ek-text-md:   1.0625rem;
	--ek-text-lg:   1.1875rem;
	--ek-text-xl:   clamp(1.3rem,  1rem + 1.2vw, 1.6rem);
	--ek-text-2xl:  clamp(1.6rem,  1.2rem + 2vw, 2.2rem);
	--ek-text-3xl:  clamp(2.1rem,  1.4rem + 3.4vw, 3.2rem);
	--ek-text-4xl:  clamp(2.6rem,  1.5rem + 6vw,  4.6rem);
	--ek-text-5xl:  clamp(4.5rem,  2rem + 12vw,  10rem);  /* the book title */

	--ek-leading-display: 0.9;
	--ek-leading-tight:  1.1;
	--ek-leading-snug:   1.35;
	--ek-leading-normal: 1.6;
	--ek-leading-loose:  1.8;

	--ek-tracking-tight: -0.015em;
	--ek-tracking-wide:  0.08em;
	--ek-tracking-label: 0.14em;

	--ek-weight-regular:  400;
	--ek-weight-medium:   500;
	--ek-weight-semibold: 600;
	--ek-weight-bold:     700;

	/* --- Space (0.25rem base) --------------------------------------------- */
	--ek-space-1:  0.25rem;
	--ek-space-2:  0.5rem;
	--ek-space-3:  0.75rem;
	--ek-space-4:  1rem;
	--ek-space-5:  1.5rem;
	--ek-space-6:  2rem;
	--ek-space-7:  2.5rem;
	--ek-space-8:  3rem;
	--ek-space-9:  4rem;
	--ek-space-10: 5rem;
	--ek-space-section: clamp(3rem, 8vw, 6rem);

	/* --- Layout ----------------------------------------------------------- */
	--ek-container:        75rem;   /* 1200px */
	--ek-container-narrow: 45rem;   /* 720px  */
	--ek-measure:          68ch;
	/* Fluid so it never eats a 375px screen — the audit's 40px fixed
	   padding cost 80px of a 375px viewport. */
	--ek-gutter: clamp(1.25rem, 5vw, 2.5rem);
	/* One shared edge for header, page content, sign-up band and footer (3 Nov):
	   a 1200px grid with 40px side margins, 20px up to 850px wide. */
	--ek-grid: 75rem;   /* 1200px */
	--ek-edge: 2.5rem;  /* 40px */

	/* --- Surface detail --------------------------------------------------- */
	--ek-radius:    2px;
	--ek-hairline:  1px;
	--ek-shadow-sm: 0 1px 2px rgba(43, 38, 33, 0.06);
	--ek-shadow-md: 0 4px 16px rgba(43, 38, 33, 0.08);

	/* Cards (JD, 24 Nov: one style for every card you can hover or click).
	   White paper on the linen grounds, a hairline, square corners like
	   Skye's buttons, a soft resting shadow; on hover it lifts 3px, the
	   shadow deepens and the hairline turns gold. Panels that only hold a
	   form get the resting shadow without the hover. polish.css applies them. */
	--ek-card-bg:           var(--ek-white);
	--ek-card-line:         var(--ek-line);
	--ek-card-line-hover:   var(--ek-veld-gold);
	--ek-card-radius:       0;
	--ek-card-shadow:       0 1px 2px rgba(43, 38, 33, 0.05), 0 12px 28px -14px rgba(43, 38, 33, 0.16);
	--ek-card-shadow-hover: 0 2px 4px rgba(43, 38, 33, 0.05), 0 24px 44px -18px rgba(43, 38, 33, 0.26);
	--ek-card-lift:         -3px;
	--ek-popover-shadow:    0 2px 6px rgba(43, 38, 33, 0.08), 0 22px 48px -12px rgba(43, 38, 33, 0.32);

	--ek-ease:        cubic-bezier(0.16, 1, 0.3, 1);
	--ek-duration:    240ms;
	--ek-duration-sm: 140ms;

	--ek-header-height: 4.5rem;

	/* --- Section grounds (overridden per design direction) -------------- */
	--ek-hero-bg:       var(--ek-earth-dark);
	--ek-nn-bg:         var(--ek-sand-deep);
	--ek-nn-text:       var(--ek-earth-dark);
	--ek-nn-muted:      var(--ek-muted);
	--ek-nn-accent:     var(--ek-gold-ink-deep);
	--ek-nn-rule:       rgba(122, 94, 27, 0.28);
	--ek-story-bg:      var(--ek-sand-deep);
	--ek-order-bg:      #EFE5D2;  /* sand warmed toward gold */
	--ek-footer-bg:     var(--ek-earth-dark);
	--ek-footer-text:   var(--ek-on-dark);
	--ek-footer-muted:  var(--ek-on-dark-muted);
	--ek-footer-accent: var(--ek-veld-gold);
	--ek-btn-bg:        var(--ek-earth-dark);
	--ek-btn-text:      var(--ek-on-dark);
}

/* The shared edge on tablets and phones (header.css's 850px breakpoint). */
@media (max-width: 850px) {
	:root { --ek-edge: 1.25rem; } /* 20px */
}
