/* Karnisha themes. Dark is the original look: every themable color in the other stylesheets is written as
   var(--L-name, <dark value>), so dark needs no tokens here. Light mode defines the --L-* tokens below plus a few
   targeted overrides. Script: assets/theme.js (the inline <head> snippet sets html[data-theme] before paint). */
html { color-scheme: dark; }
html[data-theme="light"] {
  color-scheme: light;
  --L-bg: #f3f5fb;          --L-bg-rgb: 243 245 251;
  --L-surface: #ffffff;     --L-surface-rgb: 255 255 255;
  --L-raised: #e9edf9;      --L-raised-rgb: 233 237 249;
  --L-ink: #0d1429;         --L-ink-rgb: 13 20 41;      /* text, and the hairlines/fills that were white-alpha */
  --L-snow-rgb: 13 20 41;
  --L-mist: #435072;        --L-mist-rgb: 67 80 114;
  --L-dim: #5f6a8a;
  --L-soft: #323c5a;
  --L-indigo: #3446f0;
  --L-indigo-soft: #2a39cf;
  --L-on-ink: #f6f7fc;
  --L-gold-ink: #8a5000;
  --L-green-ink: #047857;
  --L-shade-rgb: 32 42 110; --L-shade-k: .26;         /* soft cobalt-tinted shadows instead of black */
}

/* ---------- Toggle buttons ---------- */
.theme-toggle {
  position: relative; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; flex: none; border-radius: 99px;
  color: var(--L-ink, #f8fafc); background: var(--L-surface, #111827); border: 1px solid rgb(var(--L-ink-rgb, 255 255 255) / .1);
  transition: background .2s, transform .2s, box-shadow .3s;
}
.theme-toggle:hover { background: var(--L-raised, #182236); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle:focus-visible, .theme-toggle-row:focus-visible { outline: 2px solid #ffbe0b; outline-offset: 2px; }
.theme-toggle .theme-ico { grid-area: 1 / 1; transition: transform .5s cubic-bezier(.2, .75, .2, 1), opacity .3s; }
.theme-ico-sun { color: #ffbe0b; }
html[data-theme="light"] .theme-ico-sun { color: var(--L-gold-ink); }
/* Show the theme you switch to: sun in dark mode, moon in light mode. */
html:not([data-theme="light"]) .theme-ico-moon,
html[data-theme="light"] .theme-ico-sun { opacity: 0; transform: rotate(-90deg) scale(.4); }
.theme-toggle-row .theme-ico { display: none; }
html:not([data-theme="light"]) .theme-toggle-row .theme-ico-sun,
html[data-theme="light"] .theme-toggle-row .theme-ico-moon { display: block; opacity: 1; transform: none; }
.theme-toggle-row { display: none; }
@media (max-width: 63.999rem) {
  .theme-toggle { display: none; }
  #mobileMenu .theme-toggle-row {
    display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 2.75rem; padding: .65rem 1rem; margin-top: .35rem;
    border-top: 1px solid rgb(var(--L-ink-rgb, 255 255 255) / .086); color: var(--L-ink, #f8fafc); font-size: .875rem;
  }
  #mobileMenu .theme-toggle-row + #mobileLangToggle { margin-top: 0; }
}

/* Circular reveal when switching (View Transitions API). */
html.theme-anim::view-transition-old(root), html.theme-anim::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.theme-anim::view-transition-new(root) { animation: theme-reveal .65s cubic-bezier(.4, 0, .2, 1); }
@keyframes theme-reveal {
  from { clip-path: circle(0 at var(--theme-x, 50%) var(--theme-y, 0)); }
  to { clip-path: circle(150vmax at var(--theme-x, 50%) var(--theme-y, 0)); }
}

/* ================= Light mode overrides ================= */
html[data-theme="light"] body { color: var(--L-ink); }
html[data-theme="light"] ::selection { background: rgb(45 64 240 / .18); color: var(--L-ink); }

/* Gradient words in headings: cobalt to amber, readable on a light background. */
html[data-theme="light"] :is(.orbit-hero h1 em, .wk-hero h1 em, .wk-cta h2 em, .ab-hero h1 em, .ab-cta h2 em, .ct-hero h1 em, .bl-hero h1 em) {
  background-image: linear-gradient(100deg, #2337e6 10%, #d98a00 95%);
  background-image: linear-gradient(100deg in oklch, #2337e6 10%, #d98a00 95%);
}
html[data-theme="light"] .orbit-hero.no-gl::before { background: radial-gradient(38rem 26rem at 28% 50%, rgb(59 77 255 / .16), transparent 70%); }
html[data-theme="light"] .orbit-magnet { box-shadow: 0 18px 40px -14px rgb(214 150 0 / .55); }

/* ---------- Home: featured work carousel ---------- */
html[data-theme="light"] .home-slide {
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--glow, #3b4dff) 22%, transparent) 0%, rgb(255 255 255 / .9) 55%, #fff 100%) !important;
  border-color: rgb(13 20 41 / .08);
  box-shadow: 0 30px 70px -30px rgb(32 42 110 / .3), inset 0 1px 0 #fff;
}
html[data-theme="light"] .home-slide-title { color: var(--L-ink); }
html[data-theme="light"] .home-slide-btn { background: var(--L-ink); color: #fff; }
html[data-theme="light"] .home-slide-btn:hover { background: #ffbe0b; color: #120f02; }
html[data-theme="light"] .home-slide-live { color: var(--L-ink); }
html[data-theme="light"] .bg-black\/45 { background-color: rgb(13 20 41 / .06); }
html[data-theme="light"] .bg-neutral-950 { background-color: #e9edf9; }
html[data-theme="light"] .from-black\/60 { --tw-gradient-from: rgb(13 20 41 / .28) var(--tw-gradient-from-position); }
html[data-theme="light"] .carousel-dot-track { background: rgb(13 20 41 / .22); }
html[data-theme="light"] .carousel-dot-fill { background: var(--L-ink); }
html[data-theme="light"] :is(#previousProject, #nextProject, #carouselPlayPauseBtn, #appleCarouselDots) {
  background-color: rgb(255 255 255 / .92); border-color: rgb(13 20 41 / .1);
  box-shadow: 0 10px 30px -12px rgb(32 42 110 / .35);
}
html[data-theme="light"] :is(#previousProject, #nextProject, #carouselPlayPauseBtn):hover { background-color: #e9edf9; }

/* ---------- Dialog backdrops ---------- */
html[data-theme="light"] .bg-black\/85 { background-color: rgb(20 28 60 / .45); }
html[data-theme="light"] #projectModal::backdrop { background: rgb(20 28 60 / .42); }
html[data-theme="light"] .shadow-2xl { --tw-shadow: 0 30px 70px -20px rgb(32 42 110 / .3); }
html[data-theme="light"] .shadow-lg { --tw-shadow: 0 10px 24px -8px rgb(32 42 110 / .25); }
html[data-theme="light"] .ambient-orb.bg-cobalt\/25 { background-color: rgb(45 64 240 / .12); }
html[data-theme="light"] .ambient-orb.bg-cobaltBright\/15 { background-color: rgb(53 69 232 / .08); }
html[data-theme="light"] .ambient-orb.bg-amberGold\/\[0\.08\] { background-color: rgb(255 190 11 / .14); }
html[data-theme="light"] { --L-keydepth: #cdd4ea; }

/* ---------- Shared bits ---------- */
html[data-theme="light"] .header-brand-mark { background: #eef1fb; border-color: rgb(45 64 240 / .14); }
html[data-theme="light"] .wk-url { background: rgb(13 20 41 / .06); color: var(--L-mist); }
html[data-theme="light"] .faq-item.is-open .faq-num { color: color-mix(in srgb, var(--accent) 80%, #0d1429); }
html[data-theme="light"] .wk-viewer::backdrop { background: rgb(20 28 60 / .5); }
html[data-theme="light"] .wk-viewer-info { background: linear-gradient(165deg, #eef1fb, #fff); }
html[data-theme="light"] .text-mist\/80 { color: var(--L-mist); }

/* ---------- Blog ---------- */
html[data-theme="light"] .bl-ring { border-color: rgb(45 64 240 / .22); box-shadow: none; }
html[data-theme="light"] .bl-ring--2 { border-color: rgb(217 138 0 / .28); }
html[data-theme="light"] .bl-card:hover { box-shadow: 0 30px 60px -36px rgb(32 42 110 / .45); }
html[data-theme="light"] .bl-card-media > .bl-chip { background: rgb(255 255 255 / .85); }
html[data-theme="light"] .bl-cover-word { color: rgb(13 20 41 / .06); }
html[data-theme="light"] .bl-prose blockquote { background: linear-gradient(90deg, rgb(255 190 11 / .14), transparent 80%); }
html[data-theme="light"][dir="rtl"] .bl-prose blockquote { background: linear-gradient(-90deg, rgb(255 190 11 / .14), transparent 80%); }
html[data-theme="light"] .bl-prose ul > li::before { box-shadow: none; background: #d99a00; }
