/*
 * CHIMZEE BRAND TOKENS — CANONICAL EXECUTABLE SOURCE
 * Version: 1.7.0
 * Governance and usage: ../docs/CHIMZEE_BRAND_SYSTEM.md
 * Do not introduce new visual constants in product CSS when a token exists here.
 */

:root,
.cz-theme {
  color-scheme: light;

  /* Core color primitives */
  --cz-color-white: #ffffff;
  --cz-color-peach-field: #fffaf6;
  --cz-color-cool-field: #f8fbff;
  --cz-color-ink: #263f57;
  --cz-color-navy: #10294b;
  --cz-color-body: #5f7282;
  --cz-color-body-muted: #687c8b;
  --cz-color-blue-deep: #3f739d;
  --cz-color-sky: #76b8dc;
  --cz-color-peach: #f4a67c;
  --cz-color-orange: #d85f32;
  --cz-color-green: #70b7a6;
  --cz-color-lilac: #a793d7;
  --cz-color-sand: #d8ad70;
  --cz-color-line: #d7e0e6;
  --cz-color-positive: #4f8b72;
  --cz-color-warning: #a66d28;
  --cz-color-critical: #b74c3f;

  /* The three above are FILL colours. As small text on the page ground they measure
     3.88:1 and 4.22:1, under the system's own 4.5:1 floor, which the brand audit catches
     as a contrast failure every time somebody colours a delta or a status word with them.
     These are the same hues walked toward brand ink until they clear it, so a positive
     number reads as the same green and can actually be read. */
  --cz-text-positive: #487d6d;   /* 4.62:1 on the card ground */
  --cz-text-warning:  #99682d;   /* 4.68:1 */
  --cz-text-critical: #b74c3f;   /* 4.96:1, the fill already passes */

  /* Approved logo-only heritage colors. Never recolor individual mark nodes. */
  --cz-logo-forest: #2f5d50;
  --cz-logo-leaf: #9cc49f;
  --cz-logo-slate: #3e5578;
  --cz-logo-rust: #9c4a2f;

  /* Candidate geometric logo — black-and-white approval stage */
  --cz-logo-concept-color: #08090a;
  --cz-logo-jaw-taper-ratio: .38;
  --cz-logo-line-small-essential: 7px;
  --cz-logo-line-small-detailed: 5.8px;
  --cz-logo-line-standard: 4.8px;
  --cz-logo-line-large-full: 2.8px;
  --cz-logo-line-large-simple: 2.2px;
  --cz-logo-dot-small-essential-min: 22px;
  --cz-logo-dot-small-essential-max: 29px;
  --cz-logo-dot-small-detailed-min: 18px;
  --cz-logo-dot-small-detailed-max: 24px;
  --cz-logo-dot-standard-min: 15px;
  --cz-logo-dot-standard-max: 22px;
  --cz-logo-dot-large-full-min: 9px;
  --cz-logo-dot-large-full-max: 24px;
  --cz-logo-dot-large-simple-min: 12px;
  --cz-logo-dot-large-simple-max: 20px;
  --cz-logo-min-digital: 24px;
  --cz-logo-min-print: 7.5mm;
  --cz-logo-motion-x-min: .94;
  --cz-logo-motion-x-max: 1.06;
  --cz-logo-motion-y-min: .97;
  --cz-logo-motion-y-max: 1.03;
  --cz-font-wordmark-study: "Snell Roundhand", "Segoe Script", "URW Chancery L", cursive;

  /* Canvas RGB triplets for alpha-composed neural and glass effects */
  --cz-rgb-sky: 118 184 220;
  --cz-rgb-peach: 244 166 124;
  --cz-rgb-orange: 216 95 50;
  --cz-rgb-green: 112 183 166;
  --cz-rgb-lilac: 167 147 215;
  --cz-rgb-sand: 216 173 112;

  /* Semantic color roles */
  --cz-surface-page: var(--cz-color-white);
  --cz-surface-tint: var(--cz-color-peach-field);
  --cz-surface-cool: var(--cz-color-cool-field);
  --cz-text-heading: var(--cz-color-ink);
  --cz-text-body: var(--cz-color-body);
  --cz-text-inverse: var(--cz-color-white);
  --cz-action-primary: var(--cz-color-ink);
  --cz-action-accent: var(--cz-color-orange);
  --cz-border-subtle: color-mix(in srgb, var(--cz-color-ink) 12%, transparent);
  --cz-border-control: color-mix(in srgb, var(--cz-color-ink) 20%, transparent);
  --cz-focus-ring: color-mix(in srgb, var(--cz-color-sky) 70%, var(--cz-color-ink));

  /* Typography */
  --cz-font-display: var(--font-cormorant, "Cormorant Garamond", Georgia, serif);
  --cz-font-body: var(--font-space-grotesk, "Space Grotesk", Arial, sans-serif);
  --cz-font-data: var(--font-geist-mono, "Geist Mono", ui-monospace, monospace);
  --cz-weight-regular: 400;
  --cz-weight-medium: 500;
  --cz-weight-semibold: 600;
  --cz-weight-bold: 700;
  --cz-text-xs: .75rem;
  --cz-text-sm: .875rem;
  --cz-text-md: 1rem;
  --cz-text-lg: 1.125rem;
  --cz-text-xl: 1.375rem;
  --cz-display-sm: clamp(2.5rem, 6vw, 4.5rem);
  --cz-display-md: clamp(3.5rem, 8vw, 7rem);
  --cz-display-lg: clamp(4rem, 9vw, 8.25rem);
  --cz-leading-display: .92;
  --cz-leading-heading: 1.05;
  --cz-leading-body: 1.5;
  --cz-tracking-display: -.05em;
  --cz-tracking-label: .14em;

  /* Four-pixel spacing system */
  --cz-space-1: .25rem;
  --cz-space-2: .5rem;
  --cz-space-3: .75rem;
  --cz-space-4: 1rem;
  --cz-space-5: 1.25rem;
  --cz-space-6: 1.5rem;
  --cz-space-8: 2rem;
  --cz-space-10: 2.5rem;
  --cz-space-12: 3rem;
  --cz-space-16: 4rem;
  --cz-space-20: 5rem;
  --cz-space-24: 6rem;
  --cz-space-32: 8rem;

  /* Shape and layout */
  /* Measured off chimzee.com rather than chosen. Its cards render 13 to 15px, its larger
     elements 24px and its biggest 38px. The previous scale (12/18/26/40) contained no value
     the reference uses for a card, so every admin panel came out at 26px: exactly twice the
     site it is meant to match. That is the mismatch Chris kept seeing and could not name. */
  --cz-radius-sm: .75rem;     /* 12px, the reference's tightest */
  --cz-radius-md: .875rem;    /* 14px, the reference's CARD radius. cards use this */
  --cz-radius-lg: 1.5rem;     /* 24px, the reference's larger containers */
  --cz-radius-xl: 2.375rem;   /* 38px, its biggest */
  --cz-radius-pill: 999px;
  --cz-border-hairline: 1px;
  --cz-content-reading: 42rem;
  --cz-content-wide: 76rem;
  --cz-page-gutter: clamp(1.25rem, 5vw, 4.5rem);

  /* Glass and depth */
  --cz-glass-faint: rgba(255,255,255,.18);
  --cz-glass-card: rgba(255,255,255,.34);
  --cz-glass-control: rgba(255,255,255,.52);
  --cz-glass-dialog: rgba(255,255,255,.9);
  --cz-glass-highlight: rgba(255,255,255,.96);
  --cz-glass-blur: 22px;
  --cz-glass-saturation: 1.16;
  --cz-shadow-1: 0 8px 22px rgba(38,63,87,.055);
  --cz-shadow-2: 0 22px 56px rgba(38,63,87,.09);
  --cz-shadow-3: 0 48px 124px rgba(38,63,87,.14);
  --cz-shadow-inset: inset 1px 1px 0 rgba(255,255,255,.96);

  /* Neural field */
  --cz-node-size: 2px;
  --cz-node-color: rgb(var(--cz-rgb-sky) / .34);
  --cz-node-signal: rgb(var(--cz-rgb-orange) / .62);
  --cz-link-color: rgb(var(--cz-rgb-sky) / .14);
  --cz-lattice-grid: 72px;
  --cz-lattice-opacity: .46;

  /* Motion */
  --cz-duration-fast: 160ms;
  --cz-duration-standard: 280ms;
  --cz-duration-slow: 520ms;
  --cz-duration-ambient: 8s;
  --cz-ease-standard: cubic-bezier(.2,.7,.2,1);
  --cz-ease-enter: cubic-bezier(.16,.78,.18,1);
  --cz-ease-exit: cubic-bezier(.4,0,1,1);
}

/* Candidate logo primitives. Geometry is authored in SVG; these classes only
   apply approved color and derivative weights. */
.cz-logo-geometry { color: var(--cz-logo-concept-color); display: block; overflow: visible; }
.cz-logo-node { fill: currentColor; }
.cz-logo-link { fill: none; stroke: currentColor; stroke-linecap: round; }
.cz-logo-link-taper { fill: currentColor; stroke: none; }
.cz-logo-small-essential .cz-logo-link { stroke-width: var(--cz-logo-line-small-essential); }
.cz-logo-small-detailed .cz-logo-link { stroke-width: var(--cz-logo-line-small-detailed); }
.cz-logo-standard .cz-logo-link { stroke-width: var(--cz-logo-line-standard); }
.cz-logo-large-full .cz-logo-link { stroke-width: var(--cz-logo-line-large-full); }
.cz-logo-large-simple .cz-logo-link { stroke-width: var(--cz-logo-line-large-simple); }
.cz-wordmark-study-chim { font-family: var(--cz-font-display); font-style: italic; }
.cz-wordmark-study-zee { font-family: var(--cz-font-wordmark-study); }

.cz-page {
  background: var(--cz-surface-page);
  color: var(--cz-text-heading);
  font-family: var(--cz-font-body);
}

.cz-display {
  color: var(--cz-text-heading);
  font-family: var(--cz-font-display);
  font-size: var(--cz-display-md);
  font-weight: var(--cz-weight-semibold);
  letter-spacing: var(--cz-tracking-display);
  line-height: var(--cz-leading-display);
  text-wrap: balance;
}

.cz-kicker {
  color: var(--cz-action-accent);
  font: var(--cz-weight-bold) var(--cz-text-xs)/1.2 var(--cz-font-body);
  letter-spacing: var(--cz-tracking-label);
  text-transform: uppercase;
}

.cz-body {
  color: var(--cz-text-body);
  font: var(--cz-weight-regular) var(--cz-text-md)/var(--cz-leading-body) var(--cz-font-body);
}

.cz-section {
  margin-inline: auto;
  max-width: var(--cz-content-wide);
  padding: var(--cz-space-20) var(--cz-page-gutter);
  position: relative;
  z-index: 1;
}

.cz-stack { display: grid; gap: var(--cz-space-6); }
.cz-stack-compact { display: grid; gap: var(--cz-space-3); }
.cz-card-grid { display: grid; gap: var(--cz-space-6); grid-template-columns: repeat(3, minmax(0, 1fr)); }

.cz-glass-card,
.cz-glass-panel,
.cz-glass-control {
  -webkit-backdrop-filter: blur(var(--cz-glass-blur)) saturate(var(--cz-glass-saturation));
  backdrop-filter: blur(var(--cz-glass-blur)) saturate(var(--cz-glass-saturation));
  border: var(--cz-border-hairline) solid var(--cz-border-subtle);
  box-shadow: var(--cz-shadow-inset), var(--cz-shadow-2);
}

.cz-glass-card { background: var(--cz-glass-card); border-radius: var(--cz-radius-lg); }
.cz-glass-panel { background: var(--cz-glass-dialog); border-radius: var(--cz-radius-xl); box-shadow: var(--cz-shadow-inset), var(--cz-shadow-3); }
.cz-glass-control { background: var(--cz-glass-control); border-radius: var(--cz-radius-pill); }

.cz-lattice-page {
  background:
    radial-gradient(ellipse at 18% 42%, rgb(var(--cz-rgb-sky) / .12), transparent 48%),
    radial-gradient(ellipse at 82% 58%, rgb(var(--cz-rgb-peach) / .11), transparent 50%),
    var(--cz-surface-page);
  isolation: isolate;
  overflow: hidden;
  position: relative;
}

.cz-lattice-page::before {
  background-image:
    linear-gradient(31deg, transparent 49.85%, var(--cz-link-color) 50%, transparent 50.15%),
    linear-gradient(149deg, transparent 49.85%, var(--cz-link-color) 50%, transparent 50.15%),
    radial-gradient(circle, var(--cz-node-color) 0 var(--cz-node-size), transparent calc(var(--cz-node-size) + .5px));
  background-size: var(--cz-lattice-grid) calc(var(--cz-lattice-grid) * .82), var(--cz-lattice-grid) calc(var(--cz-lattice-grid) * .82), calc(var(--cz-lattice-grid) / 2) calc(var(--cz-lattice-grid) / 2);
  content: "";
  inset: -8%;
  mask-image: radial-gradient(ellipse at center, #000 0 66%, transparent 100%);
  opacity: var(--cz-lattice-opacity);
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

.cz-button-primary,
.cz-button-secondary {
  align-items: center;
  border-radius: var(--cz-radius-pill);
  display: inline-flex;
  font: var(--cz-weight-medium) var(--cz-text-sm)/1 var(--cz-font-body);
  justify-content: center;
  min-height: 44px;
  padding: var(--cz-space-3) var(--cz-space-5);
  transition: background var(--cz-duration-standard) var(--cz-ease-standard), box-shadow var(--cz-duration-standard) var(--cz-ease-standard), transform var(--cz-duration-standard) var(--cz-ease-standard);
}

.cz-button-primary { background: var(--cz-action-primary); border: 1px solid var(--cz-action-primary); color: var(--cz-text-inverse); }
.cz-button-secondary { background: var(--cz-glass-control); border: 1px solid var(--cz-border-control); color: var(--cz-text-heading); }
.cz-button-primary:hover,
.cz-button-secondary:hover { transform: translateY(-1px); }

.cz-button-primary:disabled,
.cz-button-secondary:disabled,
.cz-button-primary[aria-disabled="true"],
.cz-button-secondary[aria-disabled="true"] {
  background: color-mix(in srgb, var(--cz-action-primary) 58%, white);
  border-color: var(--cz-border-control);
  color: var(--cz-text-inverse);
  cursor: not-allowed;
  transform: none;
}

.cz-button-primary:focus-visible,
.cz-button-secondary:focus-visible,
.cz-focusable:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--cz-focus-ring) 38%, transparent);
  outline-offset: 3px;
}

.cz-field {
  display: grid;
  gap: var(--cz-space-2);
}

.cz-field label,
.cz-field legend {
  color: var(--cz-text-heading);
  font: var(--cz-weight-medium) var(--cz-text-sm)/1.3 var(--cz-font-body);
}

.cz-field input,
.cz-field select,
.cz-field textarea {
  background: var(--cz-glass-dialog);
  border: 1px solid var(--cz-border-control);
  border-radius: var(--cz-radius-md);
  color: var(--cz-text-heading);
  font: var(--cz-weight-regular) var(--cz-text-md)/1.4 var(--cz-font-body);
  min-height: 44px;
  padding: var(--cz-space-3) var(--cz-space-4);
}

.cz-field textarea { min-height: 8rem; resize: vertical; }

.cz-field input:focus-visible,
.cz-field select:focus-visible,
.cz-field textarea:focus-visible {
  border-color: var(--cz-focus-ring);
  outline: 3px solid color-mix(in srgb, var(--cz-focus-ring) 30%, transparent);
  outline-offset: 1px;
}

.cz-field-hint,
.cz-field-error {
  font: var(--cz-weight-regular) var(--cz-text-sm)/1.4 var(--cz-font-body);
}

.cz-field-hint { color: var(--cz-text-body); }
.cz-field-error { color: var(--cz-color-critical); }

.cz-alert {
  --cz-alert-accent: var(--cz-color-blue-deep);
  align-items: start;
  background: var(--cz-glass-control);
  border: 1px solid var(--cz-border-subtle);
  border-left: 3px solid var(--cz-alert-accent);
  border-radius: var(--cz-radius-md);
  box-shadow: var(--cz-shadow-1);
  color: var(--cz-text-body);
  display: grid;
  gap: var(--cz-space-2);
  padding: var(--cz-space-4) var(--cz-space-5);
}

.cz-admin-shell {
  display: grid;
  gap: var(--cz-space-6);
  grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr);
  min-height: 100dvh;
  padding: var(--cz-space-6);
}

.cz-admin-nav { border-radius: var(--cz-radius-lg); padding: var(--cz-space-5); }
.cz-admin-main { min-width: 0; }

.cz-process-marketing { --cz-process-rgb: var(--cz-rgb-peach); }
.cz-process-operations { --cz-process-rgb: var(--cz-rgb-sky); }
.cz-process-customer-growth { --cz-process-rgb: var(--cz-rgb-green); }
.cz-process-automation { --cz-process-rgb: var(--cz-rgb-lilac); }
.cz-process-analytics { --cz-process-rgb: var(--cz-rgb-sky); }
.cz-process-business-core { --cz-process-rgb: var(--cz-rgb-sand); }

.cz-process-hub {
  background: rgb(var(--cz-process-rgb, var(--cz-rgb-sky)) / .12);
  border-color: rgb(var(--cz-process-rgb, var(--cz-rgb-sky)) / .34);
}

@media (max-width: 900px) {
  .cz-admin-shell { grid-template-columns: 1fr; padding: var(--cz-space-4); }
  .cz-card-grid { grid-template-columns: 1fr; }
  .cz-section { padding-block: var(--cz-space-16); }
}

@media (prefers-reduced-motion: reduce) {
  :root { --cz-duration-fast: 1ms; --cz-duration-standard: 1ms; --cz-duration-slow: 1ms; --cz-duration-ambient: 1ms; }
}

@media print {
  :root {
    --cz-surface-page: #ffffff;
    --cz-text-heading: #263f57;
    --cz-text-body: #4d5f6d;
    --cz-border-subtle: #cfd8de;
  }
  .cz-glass-card,
  .cz-glass-panel,
  .cz-glass-control { -webkit-backdrop-filter: none; backdrop-filter: none; background: #ffffff; box-shadow: none; }
  .cz-lattice-page::before { display: none; }
}

/* Chris selected rework3's reading face for this public candidate. */
@font-face {
  font-family: 'Chimzee Manrope';
  src: url('/fonts/manrope-latin-bcbadccc.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
/* Chris 2026-10-20: reading text matches /plank (Figtree). */
@font-face {
  font-family: 'Chimzee Figtree';
  src: url('/fonts/figtree-latin-57fd1acf.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Chimzee Figtree';
  src: url('/fonts/figtree-latin-ext-a310474d.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root { --cz-font-reading: 'Chimzee Figtree', 'Chimzee Manrope', Arial, sans-serif; }
html body :is(p, li, dt, dd):not(.rework-case-kicker, .updated, .post-category, .post-meta, .desk-meta, .post-byline):not(nav *, footer *),
html body main .rework-close-note,
html body main .rework-close-transition,
html body main.concept .immersive-story .story-copy-2 p {
  font-family: var(--cz-font-reading) !important;
}

html body :is(h1,h2,h3,h4,h5,h6) { font-family: var(--cz-font-display) !important; }
html body :is(p,li,dt,dd,h1,h2,h3,h4,h5,h6) :is(a,b,strong,em,span):not(nav *,footer *) { font-family: inherit !important; }

/* Main copy, footer, article details and controls share one public body face. */
:root, .cz-theme {
  --cz-font-body: var(--cz-font-reading) !important;
}
