/* ==========================================================================
   327Labs Design Tokens
   Adaptive Light & Dark Studio Palette via CSS light-dark() + color-scheme
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* Core Studio Palette */
  --bg-canvas: light-dark(#fafafa, #0d0d0d);
  --bg-surface: light-dark(#ffffff, #151515);
  --bg-subtle: light-dark(#f2f2f2, #1d1d1d);
  --header-bg: light-dark(rgba(250, 250, 250, 0.94), rgba(13, 13, 13, 0.92));
  --dot-grid: light-dark(#d8d8d8, #242424);

  /* High-contrast structural dark surfaces (Terminal, Manifesto, Process) */
  --bg-dark: light-dark(#111111, #141414);
  --bg-dark-surface: light-dark(#171717, #1b1b1b);
  --border-dark: light-dark(#2a2a2a, #2c2c2c);
  --text-on-dark: #fafafa;
  --text-on-dark-muted: #a3a3a3;

  --text-primary: light-dark(#111111, #f5f5f5);
  --text-secondary: light-dark(#555555, #a3a3a3);
  --border-subtle: light-dark(#e2e2e2, #262626);
  --border-strong: light-dark(#111111, #f5f5f5);
  --frame-mark-color: light-dark(#9a9a9a, #555555);

  /* Accent: Strictly reserved for primary CTAs & active status indicators */
  --accent: #c85a32;
  --accent-hover: light-dark(#a94825, #db6940);
  --accent-text: #ffffff;

  /* Form Validation States */
  --error-text: light-dark(#b42318, #f97066);
  --error-border: light-dark(#b42318, #f97066);
  --error-bg: light-dark(#fef3f2, rgba(249, 112, 102, 0.1));
  --valid-border: light-dark(#111111, #f5f5f5);

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-serif: 'Literata', Georgia, Cambria, 'Times New Roman', serif;

  /* Layout & Rhythm */
  --container-max: 1120px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-pad: clamp(4rem, 8vw, 6.5rem);
  --header-height: 72px;

  /* Crisp Minimalist Radii (1px structural aesthetic) */
  --radius-none: 0px;
  --radius-sm: 2px;
  --radius-pill: 9999px;

  /* Transitions */
  --ease-fast: 150ms cubic-bezier(0.2, 0, 0, 1);
}

/* Reflect explicit <meta name="color-scheme"> override in CSS */
:root:has(> head > meta[name='color-scheme'][content='dark']) {
  color-scheme: dark;
}

:root:has(> head > meta[name='color-scheme'][content='light']) {
  color-scheme: light;
}

/* ==========================================================================
   Colophon Brand Tokens (Scoped exclusively to the browser-frame mockup)
   ========================================================================== */

.colophon-app[data-theme='dark'] {
  --col-bg: #12100e;
  --col-surface: #1c1815;
  --col-subtle: #27221d;
  --col-border: #2e2822;
  --col-text: #f4eee6;
  --col-muted: #b2a699;
  --col-accent: #e59a4c;
  --col-accent-soft: rgba(229, 154, 76, 0.14);
}

.colophon-app[data-theme='light'] {
  --col-bg: #f4efe6;
  --col-surface: #fffdf9;
  --col-subtle: #ebe3d5;
  --col-border: #e4dac9;
  --col-text: #221c18;
  --col-muted: #61564c;
  --col-accent: #b85d19;
  --col-accent-soft: rgba(184, 93, 25, 0.1);
}

.colophon-app[data-theme='sepia'] {
  --col-bg: #efe3cc;
  --col-surface: #f7eedc;
  --col-subtle: #e5d5b7;
  --col-border: #d7c3a0;
  --col-text: #2d2217;
  --col-muted: #6b5844;
  --col-accent: #9f4c12;
  --col-accent-soft: rgba(159, 76, 18, 0.13);
}
