/* ==========================================================================
   00-tokens.css — the design tokens. The ONLY place raw values live.

   How it works
   - Colours, fonts, font sizes and spacing are DEFINED in theme.json, so the
     Gutenberg editor and the website always match. WordPress turns them into
     --wp--preset--* variables.
   - This file gives those variables short, meaningful names (--dba-*) and adds
     the tokens theme.json has no slot for (radius, shadow, motion, layers).
   - Components and pages use ONLY --dba-* names. Never hard-code a value.
   - Dark mode = overriding the same variables under [data-theme="dark"].

   Values come from the approved section designs (design asset/*.png).
   Fonts: Gloock (display, one weight) + Inter (text), self-hosted in assets/fonts and
   declared in theme.json; the fallback stacks there are used until they load.
   ========================================================================== */

:root {
	color-scheme: light;

	/* Colour (from theme.json) */
	--dba-ink:        var(--wp--preset--color--ink);
	--dba-ink-soft:   var(--wp--preset--color--ink-soft);
	--dba-muted:      var(--wp--preset--color--muted);
	--dba-canvas:     var(--wp--preset--color--canvas);
	--dba-surface:    var(--wp--preset--color--surface);
	--dba-line:       var(--wp--preset--color--line);
	--dba-line-strong: var(--wp--preset--color--line);
	--dba-field-line: #8a92a3;  /* the edge of a text field: 3:1 against the page, so the field can be found */
	--dba-surface-2:  var(--wp--preset--color--surface);
	--dba-surface-3:  var(--wp--preset--color--canvas);
	--dba-accent:     var(--wp--preset--color--accent);
	--dba-accent-ink: var(--wp--preset--color--accent-ink);
	--dba-accent-soft:var(--wp--preset--color--accent-soft);
	--dba-green:      var(--wp--preset--color--green);
	--dba-tint-blue:  var(--wp--preset--color--tint-blue);
	--dba-tint-green: var(--wp--preset--color--tint-green);
	--dba-tint-beige: var(--wp--preset--color--tint-beige);
	--dba-tint-lilac: var(--wp--preset--color--tint-lilac);

	/* Per-page / per-project tint. Case studies override this inline from the "dba_accent" field. */
	--accent: var(--dba-accent);
	/* How strongly a per-project pastel tint shows: full in the light theme, a hint in the dark theme */
	--dba-tint-k: 1;

	/* Type (from theme.json) */
	--dba-font-body:    var(--wp--preset--font-family--body);
	--dba-font-display: var(--wp--preset--font-family--display);
	--dba-font-mono:    var(--wp--preset--font-family--mono);

	--dba-text-sm:      var(--wp--preset--font-size--sm);
	--dba-text-base:    var(--wp--preset--font-size--base);
	--dba-text-md:      var(--wp--preset--font-size--md);
	--dba-text-lg:      var(--wp--preset--font-size--lg);
	--dba-text-xl:      var(--wp--preset--font-size--xl);
	--dba-text-xxl:     var(--wp--preset--font-size--xxl);
	--dba-text-xxxl:    var(--wp--preset--font-size--xxxl);
	--dba-text-display: var(--wp--preset--font-size--display);

	/* Spacing (from theme.json) */
	--dba-space-xs:   var(--wp--preset--spacing--xs);
	--dba-space-s:    var(--wp--preset--spacing--s);
	--dba-space-m:    var(--wp--preset--spacing--m);
	--dba-space-l:    var(--wp--preset--spacing--l);
	--dba-space-xl:   var(--wp--preset--spacing--xl);
	--dba-space-xxl:  var(--wp--preset--spacing--xxl);
	--dba-space-xxxl: var(--wp--preset--spacing--xxxl);

	/* Layout (content / wide widths come from theme.json "layout") */
	--dba-content: var(--wp--style--global--content-size, 46rem);
	--dba-wide:    var(--wp--style--global--wide-size, 78rem);
	--dba-pad:     clamp(1.25rem, 4vw, 4rem);
	--dba-bar-h:   3.625rem;   /* top bar height (58px) */
	--dba-panel-w: 13.25rem;   /* Layers panel width (212px) */
	--dba-panel-live: var(--dba-panel-w); /* the width the panel takes right now (0 when it is hidden) */
	--dba-frame-max: 120rem;   /* a section frame grows with the screen (everything inside scales with it) up to 1920px */

	/* Shape */
	--dba-radius-s:    0.5rem;
	--dba-radius-m:    0.875rem;
	--dba-radius-l:    1.25rem;
	--dba-radius-pill: 999px;

	/* Depth */
	--dba-shadow-s: 0 1px 2px rgba(20, 24, 31, 0.06), 0 2px 8px rgba(20, 24, 31, 0.05);
	--dba-shadow-m: 0 12px 32px -12px rgba(20, 24, 31, 0.22);

	/* Small arrow drawn on the white tile of a linked card (dark ink; the dark theme swaps it) */
	--dba-arrow-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111318' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");

	/* Motion */
	--dba-ease:  cubic-bezier(0.2, 0.8, 0.2, 1);
	--dba-dur-s: 150ms;
	--dba-dur-m: 300ms;

	/* Stacking order */
	--dba-z-header: 50;
	--dba-z-panel:  40;
	--dba-z-toast:  90;

	/* Space the sticky top bar must clear when the WordPress admin bar is showing */
	--dba-adminbar: 0px;
}

/* ==========================================================================
   Dark theme: the same variables with dark values. The switch in the top bar sets
   data-theme="dark" on <html> (and remembers the choice).

   How the palette is built (so it stays consistent):
   - One cool neutral scale, four steps, each about 5 lightness points apart:
       canvas #0b0c10  <  board #14161c  <  card #1b1e26  <  raised #232731
     Depth comes from these steps and thin borders, not from heavy shadows.
   - Text has three levels: ink 16:1, ink-soft 9:1, muted 5:1 (all AA on every step).
   - ONE accent (a clear blue). Hue shows up as small accents (links, active states, the
     project's own mockup), never as large coloured panels: the card "tints" are the same
     neutral with only a trace of hue, so cards do not turn into a rainbow of muddy colours.
   - Status colours (green, amber, red) are lifted for dark and used only for meaning.
   ========================================================================== */
:root[data-theme="dark"] {
	color-scheme: dark;

	--wp--preset--color--ink:         #edeff4;
	--wp--preset--color--ink-soft:    #b7bdc9;
	--wp--preset--color--muted:       #8d95a4;
	--wp--preset--color--canvas:      #0b0c10;
	--wp--preset--color--surface:     #14161c;
	--wp--preset--color--line:        #272b36;
	--wp--preset--color--accent:      #6d98ff;
	--wp--preset--color--accent-ink:  #07101f;
	--wp--preset--color--accent-soft: #1a2542;
	--wp--preset--color--green:       #84d6a8;

	/* Card tints: the card step with a trace of hue (lightness .235, chroma .018 to .022) */
	--wp--preset--color--tint-blue:   #1a1f2b;
	--wp--preset--color--tint-green:  #17211f;
	--wp--preset--color--tint-beige:  #211f1b;
	--wp--preset--color--tint-lilac:  #1f1e2b;

	--dba-surface-2:  #1b1e26;  /* cards */
	--dba-surface-3:  #232731;  /* raised / hovered */
	--dba-line-strong: #353a48;
	--dba-field-line: #6b7385;

	--dba-arrow-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23edeff4' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");

	--dba-tint-k: 0.2;

	--dba-shadow-s: 0 1px 2px rgba(0, 0, 0, 0.4);
	--dba-shadow-m: 0 14px 28px -16px rgba(0, 0, 0, 0.6);
}
