/*
 * projectDigo design tokens for the Twig surface.
 *
 * Ported from the PWA (../ai-generator-pwa/src/assets/theme.css) so the Twig
 * creator/admin surface, the PWA and the Drupal landing share one visual
 * language. Dark-only by decision: no [data-theme=light], no runtime accent —
 * the rose-gold accent-derived values are hard-coded.
 *
 * Load order: bootstrap.min.css -> theme.css -> bootstrap-bridge.css -> app.css -> rp.css
 * This file holds fonts + tokens + page-level base styles only, no components.
 */

/* ---- Fonts (self-hosted woff2, mirrored from the PWA) ---- */
@font-face {
  font-family: 'Fraunces';
  src: url("fonts/fraunces-500-latin-ext-L0jlwr4.woff2") format('woff2');
  font-weight: 500;
  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+1E00-1E9F, U+20A0-20C0;
}
@font-face {
  font-family: 'Fraunces';
  src: url("fonts/fraunces-500-latin-cHejlgP.woff2") format('woff2');
  font-weight: 500;
  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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  src: url("fonts/fraunces-500-italic-latin-ext-UNIfFiq.woff2") format('woff2');
  font-weight: 500;
  font-style: italic;
  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+1E00-1E9F, U+20A0-20C0;
}
@font-face {
  font-family: 'Fraunces';
  src: url("fonts/fraunces-500-italic-latin-5N4KWSo.woff2") format('woff2');
  font-weight: 500;
  font-style: italic;
  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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  src: url("fonts/fraunces-600-latin-ext-L0jlwr4.woff2") format('woff2');
  font-weight: 600;
  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+1E00-1E9F, U+20A0-20C0;
}
@font-face {
  font-family: 'Fraunces';
  src: url("fonts/fraunces-600-latin-cHejlgP.woff2") format('woff2');
  font-weight: 600;
  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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  src: url("fonts/manrope-regular-qRWdtyu.woff2") format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url("fonts/manrope-500-O1u2-BY.woff2") format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url("fonts/manrope-700-yjxN1Pu.woff2") format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Space Mono';
  src: url("fonts/space-mono-regular-WgYyCMp.woff2") format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Space Mono';
  src: url("fonts/space-mono-700-NBeRrdU.woff2") format('woff2');
  font-weight: 700;
  font-display: swap;
}

/* ---- Tokens ---- */
:root {
  /* Surfaces (warm plum-black stack) */
  --bg: #140d12;
  --bg-2: #10090e;
  --surface-1: #1b1116; /* panels */
  --surface-2: #24171d; /* cards */
  --surface-3: #2d1d25; /* raised / hover */
  --surface-4: #38252e; /* active */

  /* Lines */
  --border: rgba(236, 208, 180, 0.09);
  --border-2: rgba(236, 208, 180, 0.16);
  --border-strong: rgba(236, 208, 180, 0.26);
  --hair: #463039;

  /* Text */
  --text: #f6ece7;
  --text-1: var(--text);
  --text-2: #c2a3ab;
  --text-3: #92747d;
  --text-4: #674f58;

  /* Accent — rose gold, fixed (no runtime accent switching on this surface) */
  --accent: #e2a18c;
  --accent-2: #ecc0b0;
  --accent-soft: rgba(226, 161, 140, 0.13);
  --accent-line: rgba(226, 161, 140, 0.36);
  --accent-glow: rgba(226, 161, 140, 0.28);
  --accent-ink: #241217;
  --accent-deep: #a05a56;
  --champagne: #ecd0b4;

  /* Status */
  --ok: #8fc8a3;
  --warn: #d6ad68;
  --pending: #cf8a4c;
  --danger: #e27872;

  /* Type */
  --ui: 'Manrope', system-ui, -apple-system, sans-serif;
  --story: 'Fraunces', Georgia, 'Times New Roman', serif;
  --meta: 'Space Mono', ui-monospace, SFMono-Regular, Consolas, monospace;

  /* Radius */
  --r-sm: 4px;
  --r: 6px;
  --r-lg: 8px;
  --r-xl: 12px;
  --r-pill: 999px;

  /* Shadow */
  --sh-1: 0 1px 2px rgba(6, 2, 5, 0.45);
  --sh-2: 0 12px 34px -18px rgba(4, 1, 3, 0.88);
  --sh-3: 0 28px 72px -28px rgba(4, 1, 3, 0.94);
  --sh-glow: 0 0 0 1px var(--accent-line), 0 16px 38px -22px var(--accent-glow);

  /* Story text (chat narration / dialogue) */
  --narr-color: #d8c7c7;
  --say-color: #f6ece7;

  /* Legacy aliases — the pre-redesign variable names still referenced by
     rp.css and stray rules. Pointing them at the new tokens reskins those
     consumers without touching their files. */
  --app-bg: var(--bg);
  --ink: var(--text);
  --muted: var(--text-3);
  --line: var(--border-2);
  --panel: var(--surface-1);
  --brand: var(--accent);

  color-scheme: dark;
}

/* ---- Page-level base ---- */
body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--ui);
  font-size: 15px;
  letter-spacing: -0.006em;
  color: var(--text);
  /* Layered "lit stage" background: faint accent bloom top-right over the plum gradient. */
  background:
    radial-gradient(ellipse at 76% -18%, rgba(226, 161, 140, 0.08), transparent 42%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 190px);
  background-color: var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-2);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-4) transparent;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--surface-4);
  border-radius: var(--r-pill);
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ---- Ambient fx layers (from the landing's global.css; zero-asset) ---- */
.fx-grain {
  position: fixed;
  inset: -60px;
  z-index: 2000;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  animation: fx-grain-jitter 1.2s steps(4) infinite;
}
@keyframes fx-grain-jitter {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-18px, 12px); }
  50% { transform: translate(14px, -16px); }
  75% { transform: translate(-10px, -8px); }
  100% { transform: translate(0, 0); }
}
.fx-ember {
  position: fixed;
  left: 50%;
  bottom: -30vh;
  width: 130vw;
  height: 70vh;
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, var(--accent-glow), transparent 62%);
  opacity: 0.35;
}
.no-fx .fx-grain,
.no-fx .fx-ember {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .fx-grain {
    animation: none;
  }
}
