/* =====================================================================
   Dark / light mode. Dark is the default (tokens in base.css).
   Light = new tokens + overrides for the few hard-coded dark colours.
   Video / caption previews (canvases, players, thumbnails) stay dark on purpose.
   ===================================================================== */

/* ---- cursor animation (js/cursor.js) ---- */
.cx-ring, .cx-glow, .cx-ripple { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 9999; opacity: 0; transition: opacity .3s ease; }
.cx-on .cx-ring, .cx-on .cx-glow { opacity: 1; }
.cx-off .cx-ring, .cx-off .cx-glow { opacity: 0 !important; }
.cx-ring { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255, 196, 122, .95); background: rgba(255, 153, 28, 0);
  box-shadow: 0 0 2px rgba(255, 153, 28, .12); will-change: transform; transition: opacity .2s ease, background .2s ease, border-color .2s ease, border-width .2s ease; }
.cx-ring.hot { background: rgba(255, 153, 28, .08); border-color: rgba(255, 196, 122, .95); }
.cx-ring.typing { border-width: 2px; }
.cx-ring.press { background: rgba(255, 153, 28, .22); }
.cx-glow { width: 64px; height: 64px; border-radius: 50%; z-index: 9998;
  background: radial-gradient(circle, rgba(255, 153, 28, .045) 0%, rgba(255, 94, 58, .015) 38%, transparent 68%); }
.cx-on .cx-glow { opacity: .4; }
.cx-ripple { width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 1.5px solid rgba(255, 153, 28, .8); opacity: 1; animation: cxRipple .55s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes cxRipple { to { transform: scale(5.5); opacity: 0; } }
[data-theme="light"] .cx-glow { background: radial-gradient(circle, rgba(255, 153, 28, .04) 0%, rgba(255, 94, 58, .012) 38%, transparent 68%); }
[data-theme="light"] .cx-ring { border-color: rgba(230, 126, 0, .95); box-shadow: 0 0 2px rgba(255, 153, 28, .1); }
@media (pointer: coarse), (prefers-reduced-motion: reduce) { .cx-ring, .cx-glow, .cx-ripple { display: none !important; } }

/* ---- theme toggle button (shared) ---- */
.theme-toggle { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; min-width: 38px; padding: 0 10px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); cursor: pointer; font: 600 13px var(--font); transition: background .2s, border-color .2s, transform .15s; flex: none; }
.theme-toggle:hover { background: var(--surface-3); border-color: var(--accent); }
.theme-toggle:active { transform: scale(.94); }
.tt-ic { display: grid; place-items: center; animation: ttSpin .5s cubic-bezier(.34, 1.56, .64, 1); }
.tt-ic.sun { color: #f59e0b; }
.tt-ic.moon { color: #ffb352; }
@keyframes ttSpin { from { transform: rotate(-120deg) scale(.4); opacity: 0; } }
.nav-theme { height: 40px; width: 40px; padding: 0; border-radius: 12px; background: rgba(255, 255, 255, .05); }
@media (max-width: 980px) { .nav-theme { margin-left: auto; } .nav .nav-cta { margin-left: 0; } }
.auth-theme { position: fixed; top: 18px; right: 18px; z-index: 5; }
.ed-theme { height: 32px; min-width: 32px; padding: 0 7px; border-radius: 9px; }
.side-bottom { flex: none; display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; margin: 0 -2px; }
.side-bottom .side-me { flex: 1; min-width: 0; border-top: 0 !important; padding: 2px 4px !important; margin: 0; }
.side-theme { height: 36px; width: 36px; padding: 0; }
@media (max-width: 860px) { .side-bottom { display: none; } }

/* smooth colour change when View Transitions are not available */
.theme-fade, .theme-fade * { transition: background-color .35s ease, color .35s ease, border-color .35s ease, fill .35s ease !important; }
/* circle reveal (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }

/* labels that sit on top of (always dark) video / caption previews keep white text in both themes */
.tg-tag, .dur, .st-badge, .thumb-hover span, .ftag, .lang-hud span, .ep-status i + *, .pl-chip { color: #fff; }
.st-badge.ok { color: #8ff0b8; } .st-badge.busy { color: #ffe2bf; } .st-badge.err { color: #ffb3c0; } .st-badge.needs-media { color: #d4ff3a; }
.thumb-hover span { color: #111; }

/* ================= light tokens ================= */
:root[data-theme="light"] {
  --bg: #f8f6f3;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f3ef;
  --surface-3: #eee8e0;
  --line: #ebe5dd;
  --line-2: #ddd4c8;
  --text: #1c1712;
  --muted: #6d655b;
  --accent: #ff991c;
  --accent-2: #d97706;
  --lime: #6a9a00;
  --ok: #17a05a;
  --warn: #d08400;
  --danger: #e0324d;
  --shadow: 0 12px 34px rgba(60, 35, 10, .12);
  color-scheme: light;
}

/* ---- base ---- */
[data-theme="light"] .btn:hover, [data-theme="light"] select:hover { border-color: #d9c6ad; }
[data-theme="light"] .spinner { border-color: rgba(0, 0, 0, .1); border-top-color: var(--accent); }
[data-theme="light"] .bar { background: rgba(60, 40, 20, .08); }
[data-theme="light"] .toast.error { background: #fff0f3; }
[data-theme="light"] .modal-back { background: rgba(50, 30, 10, .35); }
[data-theme="light"] .input:focus { box-shadow: 0 0 0 3px rgba(255, 153, 28, .18); }
/* logo artwork is black-on-white → show it as-is on light backgrounds */
[data-theme="light"] .brand img { filter: hue-rotate(130deg) saturate(1.8); mix-blend-mode: multiply; }

/* ---- app shell ---- */
[data-theme="light"] .side { background: linear-gradient(180deg, #fff3e6 0%, #ffffff 42%); }
[data-theme="light"] .nav-ic, [data-theme="light"] .plan-link { background: rgba(60, 40, 20, .035); }
[data-theme="light"] .pbar { background: rgba(60, 40, 20, .08); }
[data-theme="light"] .plan-card { background: linear-gradient(180deg, rgba(255, 153, 28, .09), #fff) !important; }
[data-theme="light"] .plan-apps span:not(.on) { background: #fff; }
[data-theme="light"] .plan-badge { color: #4f7600; border-color: rgba(106, 154, 0, .4); background: rgba(106, 154, 0, .1); }
[data-theme="light"] .main::before { opacity: .7; }
[data-theme="light"] .card, [data-theme="light"] .tg-card, [data-theme="light"] .tut-card, [data-theme="light"] .plug { background: #fff; }
[data-theme="light"] .card:hover, [data-theme="light"] .tg-card:hover, [data-theme="light"] .tut-card:hover { box-shadow: 0 18px 44px rgba(70, 40, 10, .14), 0 0 0 1px rgba(255, 153, 28, .18); }
[data-theme="light"] .dstat, [data-theme="light"] .glow-card { background: #fff; }
[data-theme="light"] .drop-hero { background: radial-gradient(500px 160px at 15% 0%, rgba(255, 153, 28, .1), transparent 70%), #fff; }
[data-theme="light"] .seg-tabs, [data-theme="light"] .tg-chips { background: #fff; }
[data-theme="light"] .tg-chips button span { background: rgba(60, 40, 20, .06); }
[data-theme="light"] .tg-chips button.on span { background: rgba(255, 153, 28, .18); color: #b45f00; }
[data-theme="light"] .tg-bar { background: linear-gradient(var(--bg) 70%, transparent); }
[data-theme="light"] .tg-card.is-default { border-color: rgba(106, 154, 0, .45); }
[data-theme="light"] .lang-tag { background: rgba(255, 153, 28, .1); }
[data-theme="light"] .usage { background: #fff; }
[data-theme="light"] .ep-top { background: rgba(255, 255, 255, .75); }
[data-theme="light"] .ep-drop { background: radial-gradient(500px 240px at 50% 0%, rgba(255, 153, 28, .1), transparent 70%), #fff; }
[data-theme="light"] .ep-phone { background: linear-gradient(160deg, #ffffff, #f1ebe3); border-color: var(--line-2); box-shadow: 0 24px 60px rgba(70, 40, 10, .15); }
[data-theme="light"] .ep-overlay { background: rgba(245, 245, 250, .8); }
[data-theme="light"] .pf-cover { background: linear-gradient(120deg, #ffd9a8 0%, #ffc58a 45%, #ffb3a0 100%); }
[data-theme="light"] .pf-cover i { opacity: .45; }
[data-theme="light"] .pf-avatar { border-color: #fff; }
[data-theme="light"] .pf-danger { background: linear-gradient(180deg, rgba(224, 50, 77, .05), #fff); }
[data-theme="light"] .tut-hero, [data-theme="light"] .refer-hero, [data-theme="light"] .plan-hero { background-color: #fff; }
[data-theme="light"] .auth { background: radial-gradient(900px 500px at 70% -10%, rgba(255, 153, 28, .18), transparent 60%), radial-gradient(700px 400px at 0% 110%, rgba(255, 94, 58, .1), transparent 60%), var(--bg); }
[data-theme="light"] .auth-google { background: #fff; }
[data-theme="light"] .auth-google:hover { background: var(--surface-2); }
[data-theme="light"] .ph { background: #fff; }
[data-theme="light"] .prep-tg, [data-theme="light"] .prep-card { background: #fff; }

/* ---- editor ---- */
[data-theme="light"] .crow-main:hover, [data-theme="light"] .rsec header:hover { background: rgba(60, 40, 20, .035); }
[data-theme="light"] .stage-area { background-image: radial-gradient(rgba(60, 40, 20, .08) 1px, transparent 1px); }
[data-theme="light"] .sel-dot { box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .15) inset; }
[data-theme="light"] .exp-vid.checker { background: repeating-conic-gradient(#ece6dd 0 25%, #faf7f3 0 50%) 0 0 / 18px 18px; }

/* ---- landing page ---- */
[data-theme="light"] .lead { color: #5e554b; }
[data-theme="light"] .nav { background: rgba(255, 255, 255, .7); border-color: rgba(60, 40, 20, .08); }
[data-theme="light"] .nav.scrolled { background: rgba(255, 255, 255, .92); box-shadow: 0 10px 34px rgba(70, 40, 10, .12); }
[data-theme="light"] .nav-theme { background: #fff; }
[data-theme="light"] .aurora { opacity: .4; }
[data-theme="light"] .aurora i { mix-blend-mode: normal; }
[data-theme="light"] .grid-bg { background-image: linear-gradient(rgba(60, 40, 20, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(60, 40, 20, .05) 1px, transparent 1px); }
[data-theme="light"] .stars { opacity: .45; }
[data-theme="light"] .pill { color: #c26a00; background: rgba(255, 153, 28, .1); }
[data-theme="light"] .phone-tag { background: rgba(255, 255, 255, .95); color: #c26a00; }
[data-theme="light"] .float-chip { background: rgba(255, 255, 255, .9); border-color: rgba(60, 40, 20, .08); box-shadow: 0 14px 36px rgba(70, 40, 10, .14); color: var(--text); }
[data-theme="light"] .float-chip b { color: #4f7600; }
[data-theme="light"] .scroll-cue { border-color: rgba(60, 40, 20, .25); }
[data-theme="light"] .scroll-cue i { background: #333; }
[data-theme="light"] .mq { background: #fff; color: #463d33; }
[data-theme="light"] .glow-card { background: #fff; }
[data-theme="light"] .lchip { background: #fff; color: #3b3229; }
[data-theme="light"] .lchip.on { color: var(--text); }
[data-theme="light"] .flow-btn, [data-theme="light"] .flow-info { background: #fff; }
[data-theme="light"] .stats > div { background: #fff; }
[data-theme="light"] .bcard:hover { border-color: #e0cdb3; }
[data-theme="light"] .bvis { background: radial-gradient(circle at 50% 0%, rgba(255, 153, 28, .14), transparent 70%), #f8f3ec; }
[data-theme="light"] .karaoke span { color: rgba(60, 40, 20, .28); }
[data-theme="light"] .karaoke span.done { color: var(--text); }
[data-theme="light"] .karaoke span.on { color: #6a9a00; text-shadow: none; }
[data-theme="light"] .typo span { color: var(--text); }
[data-theme="light"] .h-rom { color: #4f7600; }
[data-theme="light"] .mask .m-person, [data-theme="light"] .mask .m-person::before { background: #e6d3bb; box-shadow: none; }
[data-theme="light"] .xflow { background: #fff; }
[data-theme="light"] .xnode { background: var(--surface-2); }
[data-theme="light"] .xnode b { background: linear-gradient(135deg, #fff0de, #fff8ef); border-color: #ffd9a8; color: #c26a00; }
[data-theme="light"] .xnode.out b { color: #4f7600; background: linear-gradient(135deg, rgba(106, 154, 0, .12), rgba(23, 160, 90, .06)); border-color: rgba(106, 154, 0, .3); }
[data-theme="light"] .xwire i { background-color: rgba(60, 40, 20, .07); }
[data-theme="light"] .xcore { background: #fff; }
[data-theme="light"] .xcore::after { background: radial-gradient(circle at 50% 30%, #fff4e8, #ffffff); }
[data-theme="light"] .step b { box-shadow: 0 0 0 8px var(--bg); }
[data-theme="light"] .price-card { background: linear-gradient(160deg, rgba(255, 153, 28, .12), rgba(255, 94, 58, .06) 50%, #fff); }
[data-theme="light"] .price-list li { color: var(--text); }
[data-theme="light"] .qa { background: #fff; }
[data-theme="light"] .cta { background: #fff; }
[data-theme="light"] .cta-glow { opacity: .6; }
[data-theme="light"] .foot-grid a { color: #5e554b; }
[data-theme="light"] .foot-grid a:hover { color: var(--text); }
@media (max-width: 980px) { [data-theme="light"] .nav-links { background: rgba(255, 255, 255, .98); } }
