/* ===========================================================================
   siriusly.ai - LIGHT THEME token sheet
   Companion to tokens/colors.css. Imported right after it in design-system.css
   so every semantic alias (--color-primary, --text-body, --surface-page, ...)
   flips for light mode with no changes needed anywhere the alias is already
   used - only the places that hard-code a dark value instead of reading a
   token need an explicit fix below.

   Everything here is scoped to :root[data-theme="light"], so the dark theme
   is byte-for-byte unchanged when the attribute is absent. base.html always
   renders an explicit data-theme (light for a new visitor, dark once the
   'sr_theme' cookie is set - see billing.context_processors.theme and the
   toggle script in _navbar.html), so in practice the attribute is never
   actually absent on a served page.

   The ramps themselves are not redefined - --orange-*, --gold-*, --coal-*
   stay as they are. Signal Orange steps down the ramp on paper: orange-600
   for fills, orange-700 for text, because orange-500 (#D07E45) is only
   2.4:1 on #F6F4EF and fails contrast as type.
   =========================================================================== */

:root[data-theme="light"] {
  /* ---- Brand ---- */
  --color-primary: var(--orange-600);
  --color-primary-hover: var(--orange-700);
  --color-primary-active: var(--orange-800);
  --color-primary-soft: var(--orange-100);
  --color-primary-text: var(--orange-700);
  --color-accent: var(--gold-600);
  --color-accent-hover: var(--gold-700);
  --color-accent-soft: var(--gold-100);

  /* ---- Text ---- */
  --text-strong: var(--coal-950);
  --text-body: var(--coal-700);
  --text-muted: var(--coal-500);
  --text-subtle: var(--coal-400);
  --text-on-brand: var(--white);
  --text-link: var(--orange-700);

  /* ---- Surfaces ----
     Dark lifts the page one stop off the bottom of the ramp; light mirrors
     it, sitting one stop below the top. Cards are pure white so they lift
     off the paper without a heavy shadow. */
  --surface-page: #EDE9E0;
  --surface-card: var(--white);
  --surface-sunken: var(--coal-100);
  --surface-inverse: var(--coal-900);
  --surface-hover: var(--coal-100);

  /* ---- Lines ---- */
  --border-subtle: #E7E3DA;
  --border-default: var(--coal-200);
  --border-strong: var(--coal-300);
  --border-focus: var(--orange-600);

  /* ---- Status ---- */
  --status-success: #2C7A46;
  --status-success-soft: #E2F1E7;
  --status-warning: var(--gold-700);
  --status-warning-soft: var(--gold-100);
  --status-danger: #C0392B;
  --status-danger-soft: #FBE6E2;

  /* ---- Gradients ----
     Same direction, but the light CTA panel carries dark type, so the ramp
     runs a touch brighter to keep --coal-950 legible on top of it. */
  --gradient-signature: linear-gradient(120deg, var(--orange-500) 0%, var(--gold-300) 100%);
  --gradient-night: linear-gradient(180deg, var(--coal-50) 0%, var(--coal-100) 100%);
}

/* ---------------------------------------------------------------------------
   Elevation. The dark theme's near-black shadows turn to mud on paper, so
   the light set is warm-grey, shorter and softer, and leans on the border
   for a card's edge rather than on the shadow.
   --------------------------------------------------------------------------- */
:root[data-theme="light"] {
  --shadow-xs: 0 1px 2px rgba(26, 24, 22, 0.05);
  --shadow-sm: 0 1px 2px rgba(26, 24, 22, 0.06), 0 1px 1px rgba(26, 24, 22, 0.04);
  --shadow-md: 0 4px 12px rgba(26, 24, 22, 0.07), 0 1px 3px rgba(26, 24, 22, 0.05);
  --shadow-lg: 0 12px 28px rgba(26, 24, 22, 0.09), 0 3px 8px rgba(26, 24, 22, 0.05);
  --shadow-xl: 0 24px 56px rgba(26, 24, 22, 0.12), 0 6px 16px rgba(26, 24, 22, 0.06);

  --shadow-brand: 0 6px 18px rgba(180, 101, 47, 0.26);
  --shadow-accent: 0 6px 18px rgba(206, 138, 18, 0.22);

  --ring-focus: 0 0 0 3px rgba(180, 101, 47, 0.28);
  --ring-danger: 0 0 0 3px rgba(192, 57, 43, 0.26);
}

/* ---------------------------------------------------------------------------
   Backdrop. tokens/base.css's "Ember corner" (bloom + Iris star bleeding out
   of a corner) is intentionally NOT overridden here - the star stays in
   light mode exactly as it renders in dark, unscoped, so this is a
   deliberate absence rather than a gap in the checklist below.

   landing.html suppresses body::after itself
   (body.lp-body::after { content: none }) and keeps its own .lp-bg-star -
   unchanged in both themes.
   --------------------------------------------------------------------------- */
:root[data-theme="light"] ::selection { background: var(--orange-200); color: var(--coal-950); }
/* :not(.lp-btn) - same gotcha the comment block below explains: this
   selector outranks a component's own ".lp-btn.primary:hover" color rule,
   so without the guard every <a>-based pill button loses its intended hover
   text color to this one (e.g. near-invisible orange-on-orange). */
:root[data-theme="light"] a:hover:not(.lp-btn) { color: var(--orange-800); }

/* ---------------------------------------------------------------------------
   Per-selector fixes. These are the places the dark CSS hard-codes a value
   instead of reading a token - each needs a light counterpart.

   Gotcha: ":root[data-theme=\"light\"]" is itself worth TWO specificity
   points (:root is a pseudo-class, same tier as the attribute selector next
   to it), not one. So ":root[data-theme=\"light\"] .foo" outranks a dark
   compound state rule like ".foo.on" or ".foo:hover" even though ".foo.on"
   looks more specific at a glance - it isn't, .foo + :root[..] both count as
   2 class-level selectors vs .foo.on's 2. Any override below that shares a
   property with a state variant of the same element carries an explicit
   :not() so the state rule (still living in the original dark stylesheet)
   keeps winning in light mode too.
   --------------------------------------------------------------------------- */

/* navbar.css - the pill is a hard-coded coal-800 at 72% */
:root[data-theme="light"] .sr-nav {
  background: rgba(255, 255, 255, 0.76);
  border-color: var(--border-default);
  box-shadow: 0 8px 24px rgba(26, 24, 22, 0.08);
}
:root[data-theme="light"] .sr-signup:not(:hover) .arw { background: rgba(255, 255, 255, 0.24); }
:root[data-theme="light"] .sr-signup .arw svg { color: var(--white); }
:root[data-theme="light"] .sr-av { color: var(--white); }

/* settings.css - .st-sheet paints --coal-800 directly; the choice tiles tint
   with rgba(255,247,237,.02), a warm white wash that vanishes on paper. */
:root[data-theme="light"] .st-sheet { background: var(--surface-card); }
:root[data-theme="light"] .st-choice:not(.on),
:root[data-theme="light"] .st-design-card:not(.on) { background: var(--surface-card); }
:root[data-theme="light"] .st-choice:hover:not(.on),
:root[data-theme="light"] .st-design-card:hover:not(.on),
:root[data-theme="light"] .st-pill:hover:not(.on) { background: var(--surface-hover); border-color: var(--border-strong); }
:root[data-theme="light"] .st-icon { background: var(--color-primary-soft); color: var(--color-primary-text); }
:root[data-theme="light"] .st-badge { color: var(--white); }
:root[data-theme="light"] .st-credits,
:root[data-theme="light"] .st-level-value { color: var(--color-primary-text); }
:root[data-theme="light"] .st-switch:not([aria-checked="true"]) { background: var(--coal-300); }
:root[data-theme="light"] .st-btn.primary { color: var(--white); }
:root[data-theme="light"] .st-savebar { background: rgba(255, 255, 255, 0.9); }
:root[data-theme="light"] .st-design-swatch { background: var(--surface-sunken); }

/* main.css - a video frame stays black in both themes, only its chrome
   flips; these fix the accents that were hard-coded to dark-mode values. */
:root[data-theme="light"] .progress-halo { border-color: rgba(180, 101, 47, 0.35); }
:root[data-theme="light"] .btn-generate:hover:not(:disabled),
:root[data-theme="light"] .btn-download:hover { box-shadow: 0 8px 24px rgba(180, 101, 47, 0.3); }
:root[data-theme="light"] .language-select:focus { box-shadow: var(--ring-focus); }

/* studio.css - the wizard steps bar is a hard-coded dark "console" panel in
   both themes by default; give it a light counterpart in the same card
   language as the rest of the page. The default-dot/default-label overrides
   exclude .active/.done so the still-correct color-primary/text-strong
   styling those states already read from tokens keeps winning. */
:root[data-theme="light"] .wiz-progress {
  background: var(--surface-card);
  border-color: var(--border-default);
}
:root[data-theme="light"] .wiz-progress-count { color: var(--text-muted); }
:root[data-theme="light"] .wiz-progress-pct { color: var(--color-primary-text); }
:root[data-theme="light"] .wiz-progress-hint { color: var(--text-muted); }
:root[data-theme="light"] .wiz-rail-track { background: var(--border-default); }
:root[data-theme="light"] .wiz-step-dot:not(.active):not(.done) .dot {
  border-color: var(--border-default);
  background: var(--surface-sunken);
  color: var(--text-muted);
}
:root[data-theme="light"] .wiz-step-dot:not(.active):not(.done) .dot-label { color: var(--text-muted); }
:root[data-theme="light"] .wiz-step-dot.done .dot-label { color: var(--text-body); }
:root[data-theme="light"] .wiz-step-dot.done.clickable:hover .dot-label { color: var(--color-primary-text); }
/* .type-card (product-type step) hard-codes coal-600/500 now instead of
   reading --surface-card/--surface-hover, to lift it off the near-black dark
   canvas - restore the plain white-card tokens here, where they were already
   correct. */
:root[data-theme="light"] .type-card { background: var(--surface-card); }
:root[data-theme="light"] .type-card .glyph { background: var(--surface-hover); }
/* the reel-layout diagram mocks a phone/video frame; hard-coded near-black in
   both themes reads too harsh floating in a white card on paper, so it steps
   up the coal ramp instead of black - two steps lighter than the first pass
   at this, which still read too dark next to the card's white background. */
:root[data-theme="light"] .lay-frame { background: var(--coal-200); }
:root[data-theme="light"] .lay-frame-inner { background: linear-gradient(180deg, var(--coal-100), var(--coal-300)); }
:root[data-theme="light"] .lay-panel { background: var(--coal-600); }
/* STATIC/DYNAMIC corner pill: dark mode uses a soft-primary fill, but that
   pairing is a pale peach on white in light mode - keep this one the plain
   white shape it already was there. */
:root[data-theme="light"] .lay-pill { background: var(--white); color: var(--color-primary); box-shadow: var(--shadow-sm); }
/* the voice-preview <audio> element's native panel/icons only follow the
   app's own toggle via color-scheme - its background/border already read
   tokens and flip on their own. */
:root[data-theme="light"] .voice-preview-audio { color-scheme: light; }

/* Orange-filled badge/pill/checkmark text & icon contrast. Two hardcoded
   dark-mode pairings both lose too much contrast once their background
   token flips to a lighter step:
     1. --color-primary-soft (pale peach in light) + --orange-300 text -
        near-invisible (1.5:1). These switch to the solid --color-primary
        fill instead, with white text, matching the solid pills below.
     2. --color-primary (a mid orange in light, not the near-black canvas it
        sits on in dark) + --coal-950 text/icon - drops under the 4.5:1 text
        bar. White reads far better here than another dark shade would. */
:root[data-theme="light"] .type-card .tag,
:root[data-theme="light"] .lg-last-used,
:root[data-theme="light"] .acc-tag {
  background: var(--color-primary);
  color: var(--white);
}
:root[data-theme="light"] .angle-path .chip.on,
:root[data-theme="light"] .angle-recap .chip.on,
:root[data-theme="light"] .angle-path .chip.on:hover,
:root[data-theme="light"] .angle-recap .chip.on:hover,
:root[data-theme="light"] .action-row.on .action-toggle,
:root[data-theme="light"] .action-row.on .action-icon,
:root[data-theme="light"] .action-row .badge.rec,
:root[data-theme="light"] .angle-sec.done > header .num,
:root[data-theme="light"] .angle-sec .ttl .chosen,
:root[data-theme="light"] .angle-tile.on .mark,
:root[data-theme="light"] .angle-tile .badge.rec,
:root[data-theme="light"] .script-card .badge.rec,
:root[data-theme="light"] .lay-card .badge.rec,
:root[data-theme="light"] .seg button .seg-rec,
:root[data-theme="light"] .st-rec,
:root[data-theme="light"] .script-card.on .hd .mark,
:root[data-theme="light"] .desire-group.on .hd .mark,
:root[data-theme="light"] .backdrop-check.on,
:root[data-theme="light"] .wiz-step-dot.done .dot,
:root[data-theme="light"] .wiz-step-dot.active .dot { color: var(--white); }
:root[data-theme="light"] .angle-tile .pick .ic,
:root[data-theme="light"] .aware-tile .pick .ic,
:root[data-theme="light"] .script-card .hd .pick .ic { color: var(--white); }
/* .done's own lighter :hover fill (background flips to --orange-300, a pale
   peach) still wants dark text - reassert it over the white rule above. */
:root[data-theme="light"] .wiz-step-dot.done.clickable:hover .dot { color: var(--coal-950); }

/* .lp-usps has no background of its own - it just shows the page's own
   Ember-corner bloom (tokens/base.css's body::before) straight through,
   which on paper reads as a flat, washed-out peach rather than a deliberate
   surface. A light spotlight over the phone/copy plus a darker vignette at
   the section's own edges gives it some depth without touching the shared
   backdrop other pages rely on. */
:root[data-theme="light"] .lp-usps {
  background:
    radial-gradient(55% 55% at 50% 55%, rgba(255, 255, 255, 0.55) 0%, transparent 65%),
    radial-gradient(85% 75% at 50% 50%, transparent 0%, rgba(20, 16, 12, 0.3) 100%);
}
/* .lp-strip picks up the same bright orange->gold gradient as the CTA
   panel's "Go viral. Siriusly." shape (--gradient-signature) instead of the
   default white card, so it needs that panel's dark-on-bright text
   treatment (--coal-950 heading, translucent-ink body) rather than the
   light-on-dark values a plain dark plate would want. */
:root[data-theme="light"] .lp-strip {
  --surface-card: var(--gradient-signature);
  --border-subtle: rgba(10, 9, 8, 0.18);
  --text-subtle: rgba(10, 9, 8, 0.55);
}
:root[data-theme="light"] .lp-strip .model { color: var(--coal-950); }
:root[data-theme="light"] .lp-btn.on-brand:not(:hover) { background: var(--coal-950); color: var(--white); }
:root[data-theme="light"] .lp-usp-card p { color: var(--text-body); }
:root[data-theme="light"] .lp-badge:not(.accent) { color: var(--color-primary-text); }
:root[data-theme="light"] .lp-reel-lang { background: rgba(10, 9, 8, 0.5); }

/* .lp-footer markup (not a shared include) is duplicated verbatim across
   landing.html, branding.html and support.html - all three want the footer
   to always read as the dark band, regardless of the page's own theme. Same
   scoped-token-reset pattern as .lp-strip just above. */
:root[data-theme="light"] .lp-footer {
  --surface-card: var(--coal-800);
  --border-subtle: var(--coal-700);
  --text-strong: var(--white);
  --text-muted: var(--coal-400);
  --text-subtle: var(--coal-500);
  --color-primary: var(--orange-500);
}

/* billing.css - the pc-pro card is a deliberate dark "spotlight" surface in
   both themes (its own comment: siriusly inverts the featured card to warm
   dark, the opposite of thesisai's light-card pattern), but its --text-*
   usages assume dark mode's light-on-dark values. Light mode flips those
   tokens to dark-on-light, which goes dark-text-on-dark-card here - reset
   the card's own scope back to dark mode's values instead of chasing every
   individual rule inside it. */
:root[data-theme="light"] .pc-card.pc-pro {
  --text-strong: var(--white);
  --text-body: var(--coal-200);
  --text-muted: var(--coal-400);
  --text-subtle: var(--coal-500);
}

/* edit.css - these overlays sit on top of a video frame and hard-code an
   ink-toned tint */
:root[data-theme="light"] .ed-running-overlay,
:root[data-theme="light"] .ed-loading { background: rgba(237, 233, 224, 0.82); color: var(--text-body); }

/* subtitle-editor.css - the editor's own --ed-* scale maps most roles onto the
   semantic aliases above and so already flips for free (--ed-line reads
   --border-default, --ed-ink reads --text-strong, etc.). Only the handful the
   dark CSS hard-codes to a raw coal/white value instead of an alias need a
   light counterpart here: the chrome surfaces (bg/panel/panel-2 hard-coded to
   coal-950/900/800) and the accent tints/shadow/playhead/swatch-ring that are
   plain rgba()/white literals rather than tokens. */
:root[data-theme="light"] {
  --ed-bg: var(--white);
  --ed-panel: var(--white);
  --ed-panel-2: var(--coal-100);
  --ed-accent-soft: rgba(180, 101, 47, 0.14);
  --ed-seg-hover: rgba(180, 101, 47, 0.20);
  --ed-seg-active: rgba(180, 101, 47, 0.28);
  --ed-stage: radial-gradient(120% 120% at 50% 0%, var(--coal-100), var(--coal-200));
  --ed-canvas-shadow: 0 18px 50px rgba(26, 24, 22, 0.18);
  --ed-playhead: var(--coal-950);
  --ed-sw-ring: var(--coal-950);
}
