:root {
  --bg: #faf9f7;
  --bg-warm: #f5f0ea;
  --bg-dark: #0c0a09;
  --text: #1c1917;
  --text-mid: #57534e;
  --text-light: #a8a29e;
  --accent: #2485d6;
  --accent-hover: #1e6bad;
  /* Scrollbar rails follow the 2026-08 Lagoon rebrand. The pair is the
     lagoon ladder's own mapping of --accent/--accent-hover (functions.php
     M2_LAGOON_VIBE: #2485d6→#2485d6, #1e6bad→#1e6bad) — kept as separate
     tokens so the bars can track the brand without dragging every other
     --accent rider along. */
  --sb-accent: #2485d6;
  --sb-accent-hover: #1e6bad;
  --purple: #2485d6;
  --gold: #d4a853;
  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

/* Accent-inked scrollbar (M2OS look), on the plugin suite's Guard
   law (see the Neon Rails block in m2-os assets/os.css — three
   production sightings of the same bug): the standard
   scrollbar-width/scrollbar-color pair may live ONLY inside the
   Firefox-shaped @supports guard. Declared bare, Safari 18.2+ and
   Chrome 121+ flip onto standard bars and every ::-webkit rule
   below goes dark — and Safari's "standard" bar is the OS-drawn
   overlay one, which scrollbar-color cannot recolor, so the earlier
   scrollbar-color-first cut of this block read as "never works in
   Safari". The guard probes (-moz-appearance: none), not
   selector(::-webkit-scrollbar): engines parse unknown -webkit-
   pseudo-elements as valid for web compat, so a selector() probe
   fires everywhere.

   WebKit/Blink take the ::-webkit path — an always-visible 11px
   rail (matching the m2-os dress) drawn as a floating accent pill
   on a transparent track. Every 100vw element sits in a ≤768px
   media query or carries calc() slack, so the gutter shifts
   nothing; iOS ignores all of this and keeps its overlay slivers.

   The dress is pinned to html — the ROOT scroller — never the
   bare universal selector. core.css rides wp_head() sitewide, and a
   universal ::-webkit-scrollbar flips EVERY inner scroller on every
   plugin surface from auto-hiding overlay to a permanently painted
   rail: smart-forum-builder's content column (its own fixed-height
   scroller beside the page bar) grew a second always-on bar in
   Chromium — the 2026-08-14 prod double-bar sighting. Inner panes
   that want the rail must opt in with their own scoped rules.

   html alone, never html+body: body wore the dress too until the
   2026-08-17 Safari sighting — intermittent twin rails at the window
   edge, present or absent per reload. body { overflow-x: hidden }
   computes body's overflow-y to auto, and Safari's body→viewport
   overflow propagation is flaky across layout passes, so some loads
   leave body a scroll container of its own; with body:: dressed that
   painted a second full-height rail beside the viewport's. Two locks
   now: only html carries the dress (standards-mode WebKit/Blink read
   the viewport bar from html, so the body:: copy added nothing), and
   body's overflow-x is clip with a hidden fallback — clip never
   creates a scroll container and never coerces overflow-y, so the
   page can only ever scroll on the viewport.

   Colors ride var(--sb-accent)/var(--sb-accent-hover), not literals:
   the pair is pinned in :root to the Lagoon brand (2026-08 rebrand —
   the bars had stayed violet after everything else went lagoon), so
   forum, login, and every other wp_head() surface wears a rail that
   matches its lagoon skin with no PHP wiring. The landing is exempt
   the same way it always was: its inline styles print after this
   sheet, and the S-TIER html:: dress there outranks this one, with
   the vibe maps recoloring its literals per Original/Aurora/Lagoon.
   The color-mix rung is the macOS-style translucent thumb; engines
   without it fall back to the solid line above. Hover/active set
   only the background-color longhand so the padding-box clip
   survives. */
@supports (-moz-appearance: none) {
  html {
    scrollbar-width: thin;
    scrollbar-color: var(--sb-accent) transparent;
    scrollbar-color: color-mix(in srgb, var(--sb-accent) 78%, transparent) transparent;
  }
}
html::-webkit-scrollbar { width: 11px; height: 11px; background: transparent; }
html::-webkit-scrollbar-track, html::-webkit-scrollbar-corner { background: transparent; }
html::-webkit-scrollbar-button { width: 0; height: 0; display: none; }
html::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 99px;
  background: var(--sb-accent);
  background: color-mix(in srgb, var(--sb-accent) 78%, transparent);
  background-clip: padding-box;
}
html::-webkit-scrollbar-thumb:vertical { min-height: 32px; }
html::-webkit-scrollbar-thumb:horizontal { min-width: 32px; }
html::-webkit-scrollbar-thumb:hover, html::-webkit-scrollbar-thumb:active { background-color: var(--sb-accent-hover); }
@media (pointer: coarse) {
  html::-webkit-scrollbar { width: 5px; height: 5px; }
  html::-webkit-scrollbar-thumb { border-width: 1px; }
}

body {
  margin: 0;
  font-family: var(--sans);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  /* clip, not hidden: hidden computes overflow-y to auto and lets
     Safari flakily keep body as its own scroller — the twin-rail bug
     (see the scrollbar block above). hidden is the pre-clip-engine
     fallback. */
  overflow-x: hidden;
  overflow-x: clip;
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-loader {
  position: fixed;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  z-index: 3000;
  pointer-events: none;
  opacity: 1;
}

.page-loader-bar {
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(36,133,214,0.95), rgba(212,168,83,0.9) 55%, rgba(61,220,132,0.9));
  box-shadow: 0 0 12px rgba(36,133,214,0.4), 0 0 18px rgba(61,220,132,0.25);
  transition: transform 0.25s ease, opacity 0.35s ease;
}

.page-aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2.5s ease;
  background: var(--bg);
  /* Gentle CSS fallback in case WebGL fails to load */
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(36, 133, 214, 0.08), transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(212, 168, 83, 0.08), transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(61, 220, 132, 0.06), transparent 45%);
}

.page-aurora.is-active {
  opacity: 1;
}

.page-aurora canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Dark Mode (Eclipse aurora): core.js stamps this class when the dark
   shader is chosen, so the WebGL-failure fallback lands dark too */
.page-aurora--dark {
  background: var(--bg-dark);
  background-image:
    radial-gradient(circle at 15% 15%, rgba(36, 133, 214, 0.12), transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(212, 168, 83, 0.09), transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(61, 220, 132, 0.07), transparent 45%);
}

/* ── Visitor dark mode toggle: a sun eclipsed into a crescent ──
   Chrome (size, glass, per-header-style tinting) is inherited from
   .header-cart-btn; everything here is the celestial morph. State is
   html.m2-theme-dark, stamped pre-paint by the boot script, so the
   button wears the right face from the first frame. The bite circle
   slides in from off-canvas to eclipse the grown sun disc — geometry
   (r/cx/cy) animates as CSS properties; browsers without that support
   simply snap between states. */
.m2-dark-toggle .m2-dt-icon {
  display: block;
  overflow: visible;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.m2-dt-core {
  transition: r 0.42s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.m2-dt-bite {
  transition:
    cx 0.42s cubic-bezier(0.34, 1.3, 0.64, 1),
    cy 0.42s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.m2-dt-rays {
  transform-origin: 12px 12px;
  transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.26s ease;
}

html.m2-theme-dark .m2-dark-toggle .m2-dt-icon {
  transform: rotate(-14deg);
}

html.m2-theme-dark .m2-dark-toggle .m2-dt-core {
  r: 7.4px;
}

html.m2-theme-dark .m2-dark-toggle .m2-dt-bite {
  cx: 16.6px;
  cy: 7.4px;
}

html.m2-theme-dark .m2-dark-toggle .m2-dt-rays {
  opacity: 0;
  transform: rotate(-42deg) scale(0.38);
}

/* Press: the whole sky dips, then springs back */
.m2-dark-toggle:active .m2-dt-icon {
  transform: scale(0.85);
  transition-duration: 0.15s;
}

html.m2-theme-dark .m2-dark-toggle:active .m2-dt-icon {
  transform: rotate(-14deg) scale(0.85);
}

/* Sun warms to gold, moon cools to lavender — on intent only. Styled on
   the icon, not the button: the per-header-style .header-cart-btn
   variants (pastel/inkwell/smoke, higher specificity, later in file)
   own the button's color/background and would override anything set
   there, but none of them reach inside the SVG. */
.m2-dark-toggle:hover .m2-dt-icon {
  color: var(--gold);
  filter: drop-shadow(0 0 6px rgba(212, 168, 83, 0.45));
}

html.m2-theme-dark .m2-dark-toggle:hover .m2-dt-icon {
  color: #c7ddf0;
  filter: drop-shadow(0 0 6px rgba(36, 133, 214, 0.5));
}

.m2-dark-toggle:focus-visible {
  outline: 2px solid rgba(36, 133, 214, 0.6);
  outline-offset: 2px;
}

/* Desktop instance lives in .header-nav (hidden ≤1024px); this one
   takes over in .header-actions alongside the menu toggle. Doubled-up
   class beats the plain .header-cart-btn { display: flex } that sits
   LATER in this file — with a single class this rule loses on source
   order and both instances render at desktop widths. */
.header-cart-btn.m2-dark-toggle--mobile {
  display: none;
}

@media (max-width: 1024px) {
  .header-cart-btn.m2-dark-toggle--mobile {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .m2-dark-toggle .m2-dt-icon,
  .m2-dt-core,
  .m2-dt-bite,
  .m2-dt-rays {
    transition-duration: 0.01ms !important;
  }
}

/* Internal page transparency to let aurora breathe */
body:not(.home):not(.front-page).m2-internal-header-pastel {
  background: transparent !important;
}

/* Ensure common internal content blocks are semi-transparent or allow the back to show */
body.m2-internal-header-pastel:not(.home):not(.front-page) .academy-content,
body.m2-internal-header-pastel:not(.home):not(.front-page) .theme-content:not(.theme-page .theme-content) {
  background-color: transparent !important;
}

/* Let aurora show through key Academy LMS shells only (without touching other plugins) */
body.m2-internal-header-pastel:not(.home):not(.front-page) .academy-courses,
body.m2-internal-header-pastel:not(.home):not(.front-page) .academy-single-course {
  background-color: transparent !important;
}

/* Glassy effect for content cards on light pages.
   `.theme-page` is a class on <main>, never on <body>, so the exclusion has
   to be on the descendant (same pattern as the transparency rule above) —
   otherwise this white glass hits every dark internal template and
   out-specifies product.css's dark product card. */
body:not(.home):not(.front-page) .theme-content:not(.theme-page .theme-content),
body:not(.home):not(.front-page):not(.theme-page) .course-card {
  background: rgba(255, 255, 255, 0.5) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Fallback for the html underlay */
html {
  background: var(--bg);
}

.site-header {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  padding: 10px 12px 10px 16px;
  border-radius: 999px;
  background: rgba(31,31,31,0.55);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.site-header.scrolled {
  background: rgba(250,249,247,0.92);
  border-color: rgba(0,0,0,0.06);
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

/* Use isolation on the header, and no overflow hidden, so dropdowns can spill out */
body.m2-internal-header-pastel:not(.home):not(.front-page) .site-header.scrolled {
  isolation: isolate;
  border-color: rgba(255,255,255,0.78);
  box-shadow:
    0 14px 34px rgba(12,10,9,0.08),
    inset 0 1px 0 rgba(255,255,255,0.76);
  background: transparent;
}

/* Contain the background and its blur within the rounded pill */
.site-header .header-bg {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.4s ease, background 0.4s ease;
}

body.m2-internal-header-pastel:not(.home):not(.front-page) .site-header.scrolled .header-bg {
  opacity: 1;
  background:
    linear-gradient(180deg, rgba(250,252,255,0.92), rgba(244,247,251,0.97));
}

body.m2-internal-header-pastel:not(.home):not(.front-page) .site-header.scrolled .header-bg::before,
body.m2-internal-header-pastel:not(.home):not(.front-page) .site-header.scrolled .header-bg::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 0;
  filter: blur(18px);
}

body.m2-internal-header-pastel:not(.home):not(.front-page) .site-header.scrolled .header-bg::before {
  top: -26px;
  left: 50%;
  width: 132%;
  height: 80px;
  background:
    linear-gradient(108deg, rgba(255,173,214,0.26) 0%, rgba(245,178,229,0.2) 22%, rgba(189,204,255,0.18) 48%, rgba(160,220,255,0.24) 72%, rgba(255,197,225,0.18) 100%);
  border-radius: 50% 50% 56% 44% / 60% 48% 52% 40%;
  opacity: 0.9;
  transform: translateX(-50%) rotate(-1.75deg);
}

body.m2-internal-header-pastel:not(.home):not(.front-page) .site-header.scrolled .header-bg::after {
  bottom: -30px;
  left: 50%;
  width: 108%;
  height: 68px;
  background:
    linear-gradient(100deg, rgba(162,216,255,0.18) 0%, rgba(205,228,255,0.16) 28%, rgba(255,201,228,0.19) 58%, rgba(255,180,217,0.17) 100%);
  border-radius: 52% 48% 46% 54% / 52% 58% 42% 48%;
  opacity: 0.74;
  transform: translateX(-50%) rotate(2.8deg);
}

body.m2-internal-header-pastel:not(.home):not(.front-page) .site-header.scrolled .header-inner {
  position: relative;
  z-index: 1;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-logo img,
.header-logo .custom-logo {
  height: 32px;
  width: 32px;
  border-radius: 50%;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

/* ─── WP menu list-items as invisible flex wrappers ─── */
.header-nav > li {
  list-style: none;
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

.header-nav a {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  transition: color 0.25s ease, background 0.25s ease;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ─── Dropdown indicator (Chevron) ─── */
.header-nav > li.menu-item-has-children > a {
  padding-right: 20px !important;
  position: relative;
}

.header-nav > li.menu-item-has-children > a::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  width: 8px;
  height: 8px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
  transform: translateY(-50%) rotate(0deg);
  opacity: 0.45;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, color 0.2s ease;
}

.header-nav > li.menu-item-has-children:hover > a::after,
.header-nav > li.menu-item-has-children.m2-dropdown-open > a::after {
  transform: translateY(-50%) rotate(180deg);
  opacity: 0.9;
  color: #fff;
}

.site-header.scrolled .header-nav > li.menu-item-has-children:hover > a::after,
.site-header.scrolled .header-nav > li.menu-item-has-children.m2-dropdown-open > a::after {
  color: var(--text);
}

body.m2-internal-header-pastel:not(.home):not(.front-page) .site-header.scrolled .header-nav > li.menu-item-has-children:hover > a::after,
body.m2-internal-header-pastel:not(.home):not(.front-page) .site-header.scrolled .header-nav > li.menu-item-has-children.m2-dropdown-open > a::after {
  color: var(--purple);
}

.header-nav a:not(.nav-cta):hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

/* ─── Dropdown panel: dark mode (home/default) ─── */
.header-nav .sub-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) scale(0.98);
  transform-origin: top center;
  min-width: 200px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: rgba(24, 24, 27, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow:
    0 16px 48px rgba(0,0,0,0.28),
    0 4px 12px rgba(0,0,0,0.14),
    inset 0 1px 0 rgba(255,255,255,0.05);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 0.18s;
  z-index: 100;
}

/* Hover bridge: a transparent strip that spans the full submenu width above the panel,
   keeping the cursor inside the submenu's hit area while crossing the visual gap.
   Sized via ::before so it scales with the actual submenu width (not the narrow trigger li). */
.header-nav .sub-menu::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 14px;
  background: transparent;
}

.header-nav li.menu-item-has-children:hover > .sub-menu,
.header-nav li.menu-item-has-children:focus-within > .sub-menu,
.header-nav li.menu-item-has-children.m2-dropdown-open > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) scale(1);
  transition:
    opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 0s;
}

/* Nested submenus open to the side of their parent item, not below */
.header-nav .sub-menu .sub-menu {
  top: -6px;
  left: 100%;
  transform: translateX(8px) scale(0.98);
  transform-origin: top left;
  margin-left: 4px;
}
.header-nav .sub-menu .sub-menu::before {
  /* Side bridge for nested menus — covers the horizontal gap to the parent item */
  top: 0;
  bottom: 0;
  left: auto;
  right: 100%;
  width: 12px;
  height: auto;
}
.header-nav .sub-menu li.menu-item-has-children:hover > .sub-menu,
.header-nav .sub-menu li.menu-item-has-children:focus-within > .sub-menu,
.header-nav .sub-menu li.menu-item-has-children.m2-dropdown-open > .sub-menu {
  transform: translateX(0) scale(1);
}

/* Dropdown items */
.header-nav .sub-menu li {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.header-nav .sub-menu li a {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  border-radius: 8px;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    transform 0.18s ease;
}

.header-nav .sub-menu li a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  transform: translateX(2px);
}

/* Hover highlight track */
.header-nav .sub-menu li + li {
  margin-top: 2px;
}

/* Current/active submenu item */
.header-nav .sub-menu li.current-menu-item a {
  color: #fff;
  background: rgba(36,133,214,0.12);
}

/* ─── Dropdown panel: scrolled / light mode ─── */
.site-header.scrolled .header-nav a {
  color: var(--text-mid);
}

.site-header.scrolled .header-nav a:not(.nav-cta):hover {
  color: var(--text);
  background: rgba(0,0,0,0.04);
}

.site-header.scrolled .header-nav .sub-menu {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(0,0,0,0.06);
  box-shadow:
    0 16px 48px rgba(0,0,0,0.10),
    0 4px 12px rgba(0,0,0,0.06),
    inset 0 1px 0 rgba(255,255,255,0.8);
}

.site-header.scrolled .header-nav .sub-menu li a {
  color: var(--text-mid);
}

.site-header.scrolled .header-nav .sub-menu li a:hover {
  color: var(--text);
  background: rgba(0,0,0,0.04);
}

.site-header.scrolled .header-nav .sub-menu li.current-menu-item a {
  color: var(--text);
  background: rgba(36,133,214,0.08);
}

/* ─── Dropdown panel: internal-pastel mode ─── */
body.m2-internal-header-pastel:not(.home):not(.front-page) .site-header.scrolled .header-nav a:not(.nav-cta):hover {
  background: rgba(36,133,214,0.08);
}

body.m2-internal-header-pastel:not(.home):not(.front-page) .site-header.scrolled .header-nav .sub-menu {
  background:
    linear-gradient(180deg, rgba(250,252,255,0.96), rgba(246,248,253,0.98));
  border-color: rgba(255,255,255,0.72);
  box-shadow:
    0 16px 48px rgba(12,10,9,0.10),
    0 4px 12px rgba(0,0,0,0.05),
    inset 0 1px 0 rgba(255,255,255,0.7);
}

body.m2-internal-header-pastel:not(.home):not(.front-page) .site-header.scrolled .header-nav .sub-menu li a {
  color: var(--text-mid);
}

body.m2-internal-header-pastel:not(.home):not(.front-page) .site-header.scrolled .header-nav .sub-menu li a:hover {
  color: var(--text);
  background: rgba(36,133,214,0.08);
}

body.m2-internal-header-pastel:not(.home):not(.front-page) .site-header.scrolled .header-nav .sub-menu li.current-menu-item a {
  color: var(--accent);
  background: rgba(36,133,214,0.10);
}

.header-cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  transition: var(--transition);
}

.header-cart-btn:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

.site-header.scrolled .header-cart-btn {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.06);
  color: var(--text-mid);
}

body.m2-internal-header-pastel:not(.home):not(.front-page) .site-header.scrolled .header-cart-btn {
  background: rgba(255,255,255,0.48);
  border-color: rgba(36,133,214,0.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.56);
}

.site-header.scrolled .header-cart-btn:hover {
  background: rgba(0,0,0,0.08);
  color: var(--text);
}

body.m2-internal-header-pastel:not(.home):not(.front-page) .site-header.scrolled .header-cart-btn:hover {
  background: rgba(255,255,255,0.72);
  border-color: rgba(212,168,83,0.16);
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2fd4e6, #4fb8ff 45%, #8b64ff); box-shadow: 0 0 10px -2px rgba(47,212,230,.55), inset 0 1px 0 rgba(255,255,255,.28);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cart-count.has-items {
  opacity: 1;
  transform: scale(1);
}

.nav-cta {
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(220,220,220,0.95));
  color: #111 !important;
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.34);
  transition: transform 0.28s ease, box-shadow 0.28s ease, background-color 0.28s ease, color 0.28s ease;
}

.nav-cta:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(220,220,220,0.95));
  color: #111 !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255,255,255,0.16), inset 0 1px 0 rgba(255,255,255,0.42);
}

.site-header.scrolled .nav-cta {
  background: var(--text);
  color: #fff !important;
  box-shadow: none;
}

body.m2-internal-header-pastel:not(.home):not(.front-page) .site-header.scrolled .nav-cta {
  background: linear-gradient(135deg, rgba(28,25,23,0.96), rgba(54,43,39,0.94));
  box-shadow:
    0 10px 22px rgba(28,25,23,0.12),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

/* ═══════════════════════════════════════════════════════
   INKWELL HEADER — on-brand: royal blue · violet · gold
   ═══════════════════════════════════════════════════════ */

body:not(.home):not(.front-page).m2-internal-header-inkwell {
  background: transparent !important;
}

body.m2-internal-header-inkwell:not(.home):not(.front-page) .academy-content,
body.m2-internal-header-inkwell:not(.home):not(.front-page) .theme-content:not(.theme-page .theme-content) {
  background-color: transparent !important;
}

body.m2-internal-header-inkwell:not(.home):not(.front-page) .academy-courses,
body.m2-internal-header-inkwell:not(.home):not(.front-page) .academy-single-course,
body.m2-internal-header-inkwell:not(.home):not(.front-page) .academy-single-bundle {
  background-color: transparent !important;
}

body.m2-internal-header-inkwell:not(.home):not(.front-page) .site-header.scrolled {
  isolation: isolate;
  border-color: rgba(200,190,255,0.55);
  box-shadow:
    0 14px 34px rgba(20,10,60,0.10),
    inset 0 1px 0 rgba(220,210,255,0.70);
  background: transparent;
}

body.m2-internal-header-inkwell:not(.home):not(.front-page) .site-header.scrolled .header-bg {
  opacity: 1;
  background:
    linear-gradient(160deg, rgba(235,242,255,0.93) 0%, rgba(236,232,255,0.96) 50%, rgba(248,242,255,0.95) 100%);
}

body.m2-internal-header-inkwell:not(.home):not(.front-page) .site-header.scrolled .header-bg::before,
body.m2-internal-header-inkwell:not(.home):not(.front-page) .site-header.scrolled .header-bg::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 0;
  filter: blur(18px);
}

/* Top halo: royal blue → violet → gold (echoes IMV + BTM thumbnails) */
body.m2-internal-header-inkwell:not(.home):not(.front-page) .site-header.scrolled .header-bg::before {
  top: -26px;
  left: 50%;
  width: 132%;
  height: 80px;
  background:
    linear-gradient(108deg,
      rgba(60,110,230,0.34) 0%,
      rgba(100,70,210,0.28) 28%,
      rgba(150,100,240,0.26) 55%,
      rgba(210,170,60,0.24) 80%,
      rgba(180,130,250,0.20) 100%
    );
  border-radius: 50% 50% 56% 44% / 60% 48% 52% 40%;
  opacity: 0.9;
  transform: translateX(-50%) rotate(-1.75deg);
}

/* Bottom halo: deep blue → violet blush */
body.m2-internal-header-inkwell:not(.home):not(.front-page) .site-header.scrolled .header-bg::after {
  bottom: -30px;
  left: 50%;
  width: 108%;
  height: 68px;
  background:
    linear-gradient(100deg,
      rgba(40,80,210,0.20) 0%,
      rgba(120,90,220,0.22) 35%,
      rgba(180,140,255,0.20) 65%,
      rgba(230,185,70,0.16) 100%
    );
  border-radius: 52% 48% 46% 54% / 52% 58% 42% 48%;
  opacity: 0.78;
  transform: translateX(-50%) rotate(2.8deg);
}

body.m2-internal-header-inkwell:not(.home):not(.front-page) .site-header.scrolled .header-inner {
  position: relative;
  z-index: 1;
}

/* Nav link text — indigo toned */
body.m2-internal-header-inkwell:not(.home):not(.front-page) .site-header.scrolled .header-nav a {
  color: #3d2f7a;
}

body.m2-internal-header-inkwell:not(.home):not(.front-page) .site-header.scrolled .header-nav a:not(.nav-cta):hover {
  color: #1a1040;
  background: rgba(80,50,180,0.07);
}

body.m2-internal-header-inkwell:not(.home):not(.front-page) .site-header.scrolled .header-nav > li.menu-item-has-children:hover > a::after,
body.m2-internal-header-inkwell:not(.home):not(.front-page) .site-header.scrolled .header-nav > li.menu-item-has-children.m2-dropdown-open > a::after {
  opacity: 0.5;
  color: #3d2f7a;
}

body.m2-internal-header-inkwell:not(.home):not(.front-page) .site-header.scrolled .header-nav .sub-menu {
  background: rgba(238,234,255,0.97);
  border-color: rgba(160,140,230,0.18);
  box-shadow: 0 8px 28px rgba(40,20,100,0.12);
}

body.m2-internal-header-inkwell:not(.home):not(.front-page) .site-header.scrolled .header-nav .sub-menu li a {
  color: #3d2f7a;
}

body.m2-internal-header-inkwell:not(.home):not(.front-page) .site-header.scrolled .header-nav .sub-menu li a:hover {
  color: #1a1040;
  background: rgba(80,50,180,0.07);
}

body.m2-internal-header-inkwell:not(.home):not(.front-page) .site-header.scrolled .header-nav .sub-menu li.current-menu-item a {
  color: #4a35a0;
  font-weight: 600;
}

/* Cart icon */
body.m2-internal-header-inkwell:not(.home):not(.front-page) .site-header.scrolled .header-cart-btn {
  color: #3d2f7a;
  border-color: rgba(120,90,200,0.20);
  background: rgba(120,90,200,0.06);
}

body.m2-internal-header-inkwell:not(.home):not(.front-page) .site-header.scrolled .header-cart-btn:hover {
  background: rgba(100,70,200,0.12);
  border-color: rgba(120,90,200,0.32);
  color: #1a1040;
}

/* CTA button — deep navy-violet with subtle gold shimmer */
body.m2-internal-header-inkwell:not(.home):not(.front-page) .site-header.scrolled .nav-cta {
  background: linear-gradient(135deg, rgba(22,14,58,0.96), rgba(48,32,108,0.94));
  box-shadow:
    0 10px 22px rgba(30,15,80,0.16),
    inset 0 1px 0 rgba(180,160,255,0.14);
}

.site-header.scrolled .nav-cta:hover {
  background: #333;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.menu-toggle {
  display: none;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: rgba(255,255,255,0.7);
  border-radius: 50%;
  transition: color 0.3s ease, background 0.3s ease;
}

.menu-toggle:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

.site-header.scrolled .menu-toggle {
  color: var(--text-mid);
}

.site-header.scrolled .menu-toggle:hover {
  color: var(--text);
  background: rgba(0,0,0,0.04);
}

.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-sidebar {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 2001;
  width: 420px;
  max-width: 92vw;
  background: #fff;
  box-shadow: -20px 0 60px rgba(0,0,0,0.12);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
}

.cart-sidebar.open {
  transform: translateX(0);
}

.cart-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
}

.cart-sidebar-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-item-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--purple);
  background: rgba(32,121,196,0.08);
  padding: 2px 10px;
  border-radius: 999px;
}

.cart-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.04);
  transition: var(--transition);
  font-size: 16px;
  color: var(--text-mid);
}

.cart-close-btn:hover {
  background: rgba(0,0,0,0.08);
  color: var(--text);
}

.cart-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 20px;
  gap: 16px;
}

.cart-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(32,121,196,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text-light);
}

.cart-empty h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.cart-empty p {
  margin: 0;
  font-size: 14px;
  color: var(--text-mid);
  max-width: 260px;
}

.cart-empty-cta,
.cart-checkout-btn {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--text);
  color: #fff;
  transition: var(--transition);
}

.cart-item {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.cart-item-img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--bg-warm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cart-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 14px;
  color: var(--text-mid);
  font-weight: 500;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.cart-item-qty button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.06);
  font-size: 13px;
  color: var(--text);
}

.cart-item-qty span {
  font-size: 14px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.cart-item-remove {
  align-self: flex-start;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 12px;
  flex-shrink: 0;
}

.cart-item-remove:hover {
  color: #ef4444;
  background: rgba(239,68,68,0.06);
}

.cart-sidebar-footer {
  border-top: 1px solid rgba(0,0,0,0.06);
  padding: 20px 28px 28px;
  flex-shrink: 0;
  background: #fff;
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.cart-subtotal-label {
  font-size: 14px;
  color: var(--text-mid);
  font-weight: 500;
}

.cart-subtotal-amount {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.cart-checkout-btn {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-md);
}

.cart-view-link {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-mid);
  font-weight: 500;
}

.cart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  gap: 12px;
  color: var(--text-mid);
  font-size: 14px;
}

.cart-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0,0,0,0.06);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: m2-cart-spin 0.7s linear infinite;
}

@keyframes m2-cart-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Audio Quick-Buy (cart sidebar) ───────────────────────────────────── */

.cart-audio-quickbuy {
  border-top: 1px solid rgba(0,0,0,0.06);
  padding: 18px 24px 6px;
  background: linear-gradient(180deg, rgba(32,121,196,0.04) 0%, rgba(255,255,255,0) 100%);
  flex-shrink: 0;
}

.cart-audio-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mid);
  margin-bottom: 10px;
}
.cart-audio-head .fas {
  color: var(--gold);
  font-size: 11px;
}

.cart-audio-pack {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}
.cart-audio-pack-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.cart-audio-pack-text strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.cart-audio-pack-sub {
  font-size: 12px;
  color: var(--text-light);
}

.cart-audio-buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--purple) 0%, #2f9af5 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 1px 3px rgba(32,121,196,0.25);
  text-decoration: none;
}
.cart-audio-buy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(32,121,196,0.35);
}
.cart-audio-buy-btn:disabled,
.cart-audio-buy-btn.is-loading {
  opacity: 0.7;
  cursor: progress;
  transform: none;
}
.cart-audio-buy-btn--login {
  background: rgba(0,0,0,0.06);
  color: var(--text);
  box-shadow: none;
}
.cart-audio-buy-btn--login:hover {
  background: rgba(0,0,0,0.1);
  box-shadow: none;
}

.cart-audio-balance {
  padding: 12px 14px 14px;
  background: rgba(0,0,0,0.02);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}
.cart-audio-balance-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.cart-audio-balance-label {
  font-size: 12px;
  color: var(--text-mid);
  font-weight: 500;
}
.cart-audio-balance-total {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}
.cart-audio-balance-total.is-bumping {
  color: var(--purple);
}
.cart-audio-balance-meter {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(0,0,0,0.05);
  margin-bottom: 8px;
}
.cart-audio-balance-meter .m {
  display: block;
  height: 100%;
  transition: flex 0.4s ease;
}
.cart-audio-balance-meter .m.b[data-bucket="baseline"] { background: linear-gradient(135deg, #ff6b9d, #fbb6ce); }
.cart-audio-balance-meter .m.m[data-bucket="monthly"]  { background: var(--purple); }
.cart-audio-balance-meter .m.l[data-bucket="lifetime"] { background: var(--gold); }
.cart-audio-balance-meter .m.t[data-bucket="topup"]    { background: #3ddc84; }

.cart-audio-balance-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--text-mid);
}
.cart-audio-balance-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.cart-audio-balance-legend .dot-b { background: linear-gradient(135deg, #ff6b9d, #fbb6ce); }
.cart-audio-balance-legend .dot-m { background: var(--purple); }
.cart-audio-balance-legend .dot-l { background: var(--gold); }
.cart-audio-balance-legend .dot-t { background: #3ddc84; }

.cart-audio-toast {
  position: fixed;
  top: 90px;
  right: 24px;
  z-index: 100000;
  padding: 14px 20px;
  background: linear-gradient(135deg, #3ddc84 0%, #2db96a 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(61,220,132,0.35);
  animation: m2-audio-toast-in 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
.cart-audio-toast.is-leaving {
  animation: m2-audio-toast-out 0.25s ease-out both;
}
@keyframes m2-audio-toast-in {
  0%   { transform: translateY(-20px) scale(0.92); opacity: 0; }
  100% { transform: translateY(0)     scale(1);    opacity: 1; }
}
@keyframes m2-audio-toast-out {
  to { transform: translateY(-12px); opacity: 0; }
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 80px;
  left: 16px;
  right: 16px;
  background: rgba(31,31,31,0.92);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 28px 24px;
  z-index: 999;
  border-radius: var(--radius-xl);
}

.mobile-nav.active {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* WP list items as invisible wrappers in mobile */
.mobile-nav > li {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.mobile-nav a {
  font-size: 17px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
}

.mobile-nav a:hover {
  color: #fff;
}

/* Mobile parent item with chevron */
.mobile-nav > li.menu-item-has-children > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-nav > li.menu-item-has-children > a::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.5;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  margin-left: 8px;
}

.mobile-nav > li.menu-item-has-children.m2-dropdown-open > a::after {
  transform: rotate(225deg);
  opacity: 0.9;
}

/* Mobile sub-menu: accordion style */
.mobile-nav .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s ease,
    padding 0.3s ease;
}

.mobile-nav > li.m2-dropdown-open > .sub-menu {
  max-height: 500px;
  opacity: 1;
  padding: 12px 0 4px 16px;
}

.mobile-nav .sub-menu li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav .sub-menu li a {
  font-size: 15px;
  padding: 8px 0;
  display: block;
  color: rgba(255,255,255,0.5);
  transition: color 0.2s ease, transform 0.18s ease;
}

.mobile-nav .sub-menu li a:hover {
  color: #fff;
  transform: translateX(4px);
}

.mobile-nav .sub-menu li.current-menu-item a {
  color: var(--purple);
}

.theme-page {
  min-height: 100vh;
  background: var(--bg-dark);
  color: #fff;
  padding-top: 50px;
  padding-bottom: 96px;
}

body:not(.home):not(.front-page) {
  --m2-internal-page-clearance: 109px;
}

body:not(.home):not(.front-page) .cart-sidebar + .academy-courses,
body:not(.home):not(.front-page) .cart-sidebar + .academy-canvas,
body:not(.home):not(.front-page) .cart-sidebar + .academy-single-course,
body:not(.home):not(.front-page) .cart-sidebar + .academy-single-bundle {
  padding-top: var(--m2-internal-page-clearance) !important;
}

body:not(.home):not(.front-page) .cart-sidebar + .academy-courses--archive {
  padding-top: max(calc(var(--m2-internal-page-clearance) - 58px), 44px) !important;
}

.theme-page-hero {
  padding: 160px 0 56px;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 45% at 30% 0%, rgba(36,133,214,0.18), transparent 70%),
    radial-gradient(ellipse 45% 40% at 75% 10%, rgba(212,168,83,0.12), transparent 70%),
    var(--bg-dark);
}

.theme-page-hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.theme-eyebrow {
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 700;
  color: var(--purple);
}

.theme-content {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 28px;
  padding: 36px;
  color: rgba(255,255,255,0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.theme-prose a {
  color: #fff;
  text-decoration: underline;
}

.theme-article + .theme-article {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.theme-article h2 {
  margin-top: 0;
  color: #fff;
}

.theme-footer {
  background: #090706;
  color: rgba(255,255,255,0.42);
  text-align: center;
  padding: 28px 0 40px;
}

.theme-footer a {
  color: rgba(255,255,255,0.8);
}

@media (max-width: 1024px) {
  .site-header {
    display: flex;              /* override inline-flex — flex + fit-content is more predictable on iOS */
    width: fit-content;
    padding: 8px 10px 8px 14px;
    top: 14px;
    max-width: calc(100% - 32px);
  }

  .header-inner {
    min-width: 0;               /* allow flex children to shrink below content size */
  }

  .header-nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
    flex-shrink: 0;
  }

  .mobile-cart-btn {
    display: flex !important;
    flex-shrink: 0;
  }
}

@media (max-width: 768px) {
  .cart-sidebar {
    width: 100vw;
    max-width: 100vw;
  }

  .theme-page-hero {
    padding-top: 132px;
  }

  body:not(.home):not(.front-page) {
    --m2-internal-page-clearance: 75px;
  }

  .theme-content {
    padding: 24px;
    border-radius: 22px;
  }
}

.mobile-complete-purchase {
  display: none;
}

@media (max-width: 1024px) {
  body.has-cart-items .mobile-complete-purchase {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--text);
    color: #fff !important;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: opacity 0.2s ease;
    min-width: 0;             /* allow shrinking inside flex container */
    overflow: hidden;
  }

  body.has-cart-items .mobile-complete-purchase i {
    flex-shrink: 0;
  }

  /* text-overflow is a no-op on the flex container itself — the label
     needs its own block box for the ellipsis to render */
  body.has-cart-items .mobile-complete-purchase span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.has-cart-items .mobile-complete-purchase:hover {
    opacity: 0.82;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 1;           /* allow actions group to shrink so hamburger stays inside the pill */
    min-width: 0;
  }
}

/* Admin Bar Fix */
body.admin-bar .site-header { margin-top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { margin-top: 46px; } }

/* ═══════════════════════════════════════════════════════
   SMOKE HEADER — dark smoked glass · gold & blue haloes
   Stays in the dark register of the home pill header
   but lets brand colour bleed through on internal pages
   ═══════════════════════════════════════════════════════ */

body:not(.home):not(.front-page).m2-internal-header-smoke {
  background: transparent !important;
}

body.m2-internal-header-smoke:not(.home):not(.front-page) .academy-content,
body.m2-internal-header-smoke:not(.home):not(.front-page) .theme-content:not(.theme-page .theme-content) {
  background-color: transparent !important;
}

body.m2-internal-header-smoke:not(.home):not(.front-page) .academy-courses,
body.m2-internal-header-smoke:not(.home):not(.front-page) .academy-single-course,
body.m2-internal-header-smoke:not(.home):not(.front-page) .academy-single-bundle {
  background-color: transparent !important;
}

/* Scrolled pill — dark smoked glass, stays dark like the home header */
body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled {
  isolation: isolate;
  background: transparent;
  border-color: rgba(255,255,255,0.10);
  box-shadow:
    0 14px 34px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-bg {
  opacity: 1;
  background: rgba(18,14,30,0.72);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
}

body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-bg::before,
body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-bg::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 0;
  filter: blur(20px);
}

/* Top halo: warm gold → rose (course card energy) */
body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-bg::before {
  top: -28px;
  left: 50%;
  width: 130%;
  height: 78px;
  background: linear-gradient(108deg,
    rgba(212,168,83,0.42) 0%,
    rgba(240,140,80,0.30) 32%,
    rgba(180,100,240,0.22) 62%,
    rgba(100,140,255,0.26) 100%
  );
  border-radius: 50% 50% 56% 44% / 60% 48% 52% 40%;
  opacity: 0.85;
  transform: translateX(-50%) rotate(-1.5deg);
}

/* Bottom halo: deep royal blue → violet */
body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-bg::after {
  bottom: -32px;
  left: 50%;
  width: 110%;
  height: 70px;
  background: linear-gradient(100deg,
    rgba(30,70,200,0.28) 0%,
    rgba(80,50,180,0.24) 40%,
    rgba(140,90,220,0.20) 72%,
    rgba(212,168,83,0.16) 100%
  );
  border-radius: 52% 48% 46% 54% / 52% 58% 42% 48%;
  opacity: 0.72;
  transform: translateX(-50%) rotate(2.4deg);
}

body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-inner {
  position: relative;
  z-index: 1;
}

/* Nav links — white on dark, same as home */
body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-nav a {
  color: rgba(255,255,255,0.72);
}

body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-nav a:not(.nav-cta):hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-nav > li.menu-item-has-children:hover > a::after,
body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-nav > li.menu-item-has-children.m2-dropdown-open > a::after {
  color: rgba(255,255,255,0.5);
}

/* Dropdown — dark, same feel as homepage dropdown */
body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-nav .sub-menu {
  background: rgba(18,14,30,0.92);
  border-color: rgba(255,255,255,0.08);
  box-shadow:
    0 16px 48px rgba(0,0,0,0.36),
    0 4px 12px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-nav .sub-menu li a {
  color: rgba(255,255,255,0.65);
}

body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-nav .sub-menu li a:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-nav .sub-menu li.current-menu-item a {
  color: var(--gold);
  background: rgba(212,168,83,0.08);
}

/* Cart button — matches dark pill */
body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-cart-btn {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.7);
}

body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-cart-btn:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.16);
  color: #fff;
}

/* CTA — gold gradient, the one brand pop on the dark pill */
body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .nav-cta {
  background: linear-gradient(135deg, rgba(212,168,83,0.95), rgba(190,138,50,0.98));
  color: #1a1206 !important;
  box-shadow:
    0 8px 20px rgba(180,130,40,0.28),
    inset 0 1px 0 rgba(255,240,180,0.22);
}

body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .nav-cta:hover {
  background: linear-gradient(135deg, rgba(230,185,90,0.98), rgba(210,155,60,1.0));
  color: #1a1206 !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(180,130,40,0.36);
}

/* ── Smoke at night — OBSIDIAN pill (full dark-mode re-skin) ──
   The light-smoke haloes are tuned against a LIGHT page; over the dark
   aurora they grey into a milky film. So when the canvas is dark
   (html.m2-theme-dark — stamped pre-paint in both master-only and
   visitor-toggle modes) every surface is re-authored rather than
   dimmed: near-black glass with a baked-in specular sheen, a gradient
   hairline ring instead of a flat border, ember pools of brand colour
   pressed UNDER the glass, glass-bead icon buttons, and a champagne-
   metal CTA. Light-mode smoke is untouched. */
html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled {
  border-color: rgba(255,255,255,0.12);
  box-shadow:
    0 2px 6px rgba(0,0,0,0.35),
    0 18px 40px -8px rgba(0,0,0,0.60),
    0 30px 70px -12px rgba(93,63,211,0.32),
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 -1px 0 rgba(0,0,0,0.45);
}

/* Glass: deep ink with a vertical catch-light so it reads as a curved
   surface, not a flat tint. Slightly clearer than the old 86% so the
   aurora blooms through the heavier blur without washing out. */
html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-bg {
  background:
    linear-gradient(180deg,
      rgba(255,255,255,0.055) 0%,
      rgba(255,255,255,0.015) 42%,
      rgba(0,0,0,0.06) 100%),
    rgba(10,9,17,0.80);
  backdrop-filter: blur(30px) saturate(1.55);
  -webkit-backdrop-filter: blur(30px) saturate(1.55);
}

/* Neutralise the light-mode halo geometry on both pseudos: full-bleed,
   unrotated, unblurred. ::after becomes the ember layer; ::before is
   parked invisible and only comes back as the hairline ring where
   mask-composite support lets us draw one safely. */
html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-bg::before,
html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-bg::after {
  inset: 0;
  width: auto;
  height: auto;
  transform: none;
  filter: none;
  border-radius: inherit;
}

html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-bg::before {
  opacity: 0;
}

/* Embers under the glass: violet pooling bottom-left, gold breathing
   top-right, a cool blue floor — sized in %, so they scale with the
   pill. Dim enough to never lift the ink into milk. */
html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-bg::after {
  opacity: 1;
  background:
    radial-gradient(140% 130% at 8% 115%, rgba(124,90,240,0.17), transparent 44%),
    radial-gradient(120% 140% at 92% -25%, rgba(212,168,83,0.15), transparent 42%),
    radial-gradient(100% 110% at 52% 135%, rgba(59,113,246,0.10), transparent 46%);
}

/* Hairline ring: lit at the top, fading down the sides, a violet kiss
   at the base — the single detail that makes the glass read as glass.
   Gated: without mask-composite the pseudo would flood the pill, so
   unsupported browsers keep the plain border above. */
@supports (mask-composite: exclude) or (-webkit-mask-composite: xor) {
  html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled {
    border-color: transparent;
  }

  html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-bg::before {
    opacity: 1;
    padding: 1px;
    background: linear-gradient(180deg,
      rgba(255,255,255,0.30) 0%,
      rgba(255,255,255,0.07) 28%,
      rgba(255,255,255,0.03) 58%,
      rgba(36,133,214,0.22) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
  }
}

/* ── Orbit: the course cards' travelling border, restrained for a
   persistent surface. One comet (violet tail → warm head → gold fade)
   rides the hairline on an 11s lap instead of the cards' 3s rainbow;
   hovering the pill brightens it and wakes a blurred halo twin outside
   the rim. Both pseudos sit on .site-header itself — crisp arc above
   the glass (content is z:1), halo behind the header-bg child so only
   its outward bleed shows. Browsers without @property paint the comet
   parked instead of orbiting; same mask gate as the ring. */
@property --m2-pill-orbit {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes m2-pill-orbit-lap {
  from { --m2-pill-orbit: 0deg; }
  to   { --m2-pill-orbit: 360deg; }
}

@supports (mask-composite: exclude) or (-webkit-mask-composite: xor) {
  html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled::after,
  html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled::before {
    content: '';
    position: absolute;
    border-radius: inherit;
    pointer-events: none;
    animation: m2-pill-orbit-lap 11s linear infinite;
    background: conic-gradient(from var(--m2-pill-orbit),
      transparent 0deg,
      transparent 286deg,
      rgba(167,139,250,0) 290deg,
      rgba(167,139,250,0.50) 314deg,
      rgba(244,114,182,0.38) 327deg,
      rgba(255,238,204,0.95) 340deg,
      rgba(212,168,83,0.55) 352deg,
      transparent 360deg);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    transition: opacity 0.45s ease;
  }

  html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled::after {
    inset: 0;
    padding: 1px;
    z-index: 0;
    opacity: 0.75;
  }

  html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled::before {
    inset: -3px;
    padding: 4px;
    z-index: -1;
    filter: blur(6px);
    opacity: 0;
  }

  html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled:hover::after {
    opacity: 1;
  }

  html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled:hover::before {
    opacity: 0.5;
  }

  @media (prefers-reduced-motion: reduce) {
    html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled::after,
    html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled::before {
      animation: none;
    }
  }
}

/* Ink: brighter than light-smoke's .72 so the deeper glass keeps its
   contrast; hover is violet glass instead of flat white. */
html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-nav a {
  color: rgba(238,235,248,0.82);
}

html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-nav a:not(.nav-cta):hover {
  color: #fff;
  background: linear-gradient(180deg, rgba(167,139,250,0.17), rgba(167,139,250,0.07));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.09);
}

/* Current page glows gold, matching the logo mark */
html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-nav > li.current-menu-item > a:not(.nav-cta),
html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-nav > li.current-menu-ancestor > a:not(.nav-cta) {
  color: #ecc87e;
  background: rgba(212,168,83,0.10);
  box-shadow: inset 0 1px 0 rgba(255,235,190,0.10);
}

/* Logo mark gets a faint gold breath so it sits IN the glass */
html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-logo img,
html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-logo .custom-logo {
  filter: drop-shadow(0 0 12px rgba(212,168,83,0.30));
}

/* Icon buttons (moon toggle + bag share .header-cart-btn): glass beads
   with a vertical light falloff instead of flat grey discs. Hover blooms
   a soft violet halo. */
html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-cart-btn {
  background: linear-gradient(180deg,
    rgba(255,255,255,0.13) 0%,
    rgba(255,255,255,0.035) 55%,
    rgba(255,255,255,0.02) 100%);
  border-color: rgba(255,255,255,0.15);
  color: rgba(240,238,250,0.88);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.15),
    inset 0 -1px 0 rgba(0,0,0,0.25),
    0 2px 6px rgba(0,0,0,0.30);
}

html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-cart-btn:hover {
  background: linear-gradient(180deg,
    rgba(255,255,255,0.18) 0%,
    rgba(255,255,255,0.07) 100%);
  border-color: rgba(198,180,255,0.30);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.20),
    0 0 0 4px rgba(139,105,240,0.13),
    0 3px 10px rgba(0,0,0,0.35);
}

/* Badge sits on the glass with a dark keyline instead of bleeding into it */
html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-cart-btn .cart-count {
  box-shadow: 0 0 0 2px rgba(13,12,20,0.92);
}

/* CTA: champagne metal — vertical gradient (reads as machined metal,
   not mustard), crisp specular top edge, grounded base, gold bloom
   into the dark, and a single-ride sheen on hover. */
html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .nav-cta {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg,
    #f7dd94 0%,
    #eec367 38%,
    #d9a844 74%,
    #c8933a 100%);
  color: #2a1c04 !important;
  text-shadow: 0 1px 0 rgba(255,244,205,0.45);
  box-shadow:
    inset 0 1px 0 rgba(255,250,225,0.85),
    inset 0 -1px 1px rgba(122,80,10,0.35),
    0 1px 2px rgba(0,0,0,0.35),
    0 6px 16px -2px rgba(216,166,66,0.34),
    0 14px 32px -6px rgba(216,166,66,0.22);
}

html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .nav-cta::before {
  content: '';
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: -30%;
  width: 42%;
  background: linear-gradient(105deg,
    transparent 0%,
    rgba(255,255,255,0.55) 50%,
    transparent 100%);
  transform: translateX(-80%) skewX(-18deg);
  opacity: 0;
  pointer-events: none;
  transition: none;
}

html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .nav-cta:hover {
  background: linear-gradient(180deg,
    #ffe9a8 0%,
    #f5cf74 40%,
    #e3b24f 76%,
    #d29d40 100%);
  color: #2a1c04 !important;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,252,235,0.95),
    inset 0 -1px 1px rgba(122,80,10,0.30),
    0 2px 4px rgba(0,0,0,0.35),
    0 8px 22px -2px rgba(226,178,78,0.48),
    0 18px 40px -6px rgba(226,178,78,0.30);
}

/* Sheen rides once per hover: animated in, snapped back on leave
   (the un-hovered state has transition: none) */
html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .nav-cta:hover::before {
  opacity: 1;
  transform: translateX(320%) skewX(-18deg);
  transition: transform 0.65s cubic-bezier(0.25, 0.6, 0.3, 1), opacity 0.2s ease;
}

/* Dropdown joins the obsidian system: near-black glass, violet
   under-bloom, tinted hovers */
html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-nav .sub-menu {
  background: rgba(13,12,20,0.96);
  border-color: rgba(255,255,255,0.10);
  box-shadow:
    0 24px 60px rgba(0,0,0,0.55),
    0 6px 16px rgba(0,0,0,0.35),
    0 18px 44px -10px rgba(93,63,211,0.28),
    inset 0 1px 0 rgba(255,255,255,0.07);
}

html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-nav .sub-menu li a {
  color: rgba(238,235,248,0.70);
}

html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-nav .sub-menu li a:hover {
  color: #fff;
  background: linear-gradient(180deg, rgba(167,139,250,0.15), rgba(167,139,250,0.06));
}

/* Restated for dark: the generic item rule above (0,8,4) out-specifies
   light-smoke's gold current-item (0,8,3), which would strip the gold */
html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .header-nav .sub-menu li.current-menu-item a {
  color: #ecc87e;
  background: rgba(212,168,83,0.10);
}

/* Mobile chrome on the dark pill: hamburger brightens (base scrolled
   rule paints it var(--text-mid) — near-invisible on ink), and the
   complete-purchase chip swaps its near-black fill for the CTA gold */
html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .menu-toggle {
  color: rgba(240,238,250,0.85);
}

html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .menu-toggle:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .mobile-complete-purchase {
  background: linear-gradient(180deg, #f0cc74 0%, #d9a844 100%);
  color: #2a1c04 !important;
  box-shadow:
    inset 0 1px 0 rgba(255,250,225,0.7),
    0 4px 12px -2px rgba(216,166,66,0.30);
}

@media (prefers-reduced-motion: reduce) {
  html.m2-theme-dark body.m2-internal-header-smoke:not(.home):not(.front-page) .site-header.scrolled .nav-cta::before {
    display: none;
  }
}

/* Home hero: tighten top spacing on mobile */
@media (max-width: 1024px) {
  body.home .hero-content,
  body.front-page .hero-content {
    padding-top: 100px;
  }
}

/* ═══════════════════════════════════════════════════════
   ADD-TO-CART TOAST
   ═══════════════════════════════════════════════════════ */

.m2-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 40px));
  z-index: 2500;
  pointer-events: none;
  opacity: 0;
  transition:
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.4s ease;
}

.m2-toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.m2-toast.is-leaving {
  transform: translateX(-50%) translateY(calc(100% + 40px));
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.4, 0, 1, 1),
    opacity 0.3s ease;
}

.m2-toast-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.10),
    0 4px 12px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

/* ── checkmark icon ── */
.m2-toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #1e6bad);
  color: #fff;
  font-size: 12px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(36, 133, 214, 0.30);
  animation: m2-toast-check-pop 0.45s 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes m2-toast-check-pop {
  0%   { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

/* ── text body ── */
.m2-toast-body {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
}

.m2-toast-title {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.m2-toast-sep {
  color: var(--text-light);
  font-weight: 400;
}

.m2-toast-msg {
  color: var(--text-mid);
}

/* ── checkout CTA ── */
.m2-toast-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--text);
  color: #fff !important;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  flex-shrink: 0;
  transition:
    background 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.m2-toast-cta:hover {
  background: #333;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.m2-toast-cta i {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.m2-toast-cta:hover i {
  transform: translateX(2px);
}

/* ── close button ── */
.m2-toast-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s ease, background 0.2s ease;
  padding: 0;
}

.m2-toast-close:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.05);
}

/* ── progress bar (auto-dismiss timer) ── */
.m2-toast-progress {
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transform-origin: left center;
  transform: scaleX(1);
  opacity: 0.55;
}

.m2-toast.is-visible .m2-toast-progress {
  animation: m2-toast-countdown 5.5s 0.3s linear forwards;
}

@keyframes m2-toast-countdown {
  to { transform: scaleX(0); opacity: 0.2; }
}

/* ── hover pauses the progress (visual cue) ── */
.m2-toast-inner:hover ~ .m2-toast-progress,
.m2-toast:hover .m2-toast-progress {
  animation-play-state: paused;
}

/* ── responsive ── */
@media (max-width: 640px) {
  .m2-toast {
    bottom: 20px;
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(calc(100% + 40px));
    width: auto;
    max-width: calc(100% - 32px);
  }

  .m2-toast.is-visible {
    transform: translateX(-50%) translateY(0);
  }

  .m2-toast.is-leaving {
    transform: translateX(-50%) translateY(calc(100% + 40px));
  }

  .m2-toast-inner {
    gap: 8px;
    padding: 10px 10px 10px 12px;
  }

  .m2-toast-body {
    font-size: 12.5px;
    min-width: 0;
  }

  .m2-toast-cta {
    padding: 6px 12px;
    font-size: 11.5px;
  }

  .m2-toast-icon {
    width: 26px;
    height: 26px;
    font-size: 10px;
  }

  .m2-toast-close {
    width: 22px;
    height: 22px;
    font-size: 10px;
    margin-right: -2px;
  }
}

/* ─── CUSTOM ANIMATIONS & BUBBLES ─── */

@keyframes m2CartJump {
  0% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.4) translateY(-6px); }
  100% { transform: scale(1) translateY(0); }
}

.m2-free-bubble {
  position: absolute;
  transform: translate(-50%, -100%) translateY(10px);
  background: var(--bg-dark, #0c0a09);
  color: #fff;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  white-space: nowrap;
}

.m2-free-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--bg-dark, #0c0a09);
}

.m2-free-bubble.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -100%) translateY(0);
}

/* ═══════════════════════════════════════════════════════════════
   INTERNAL PAGES — FABLE PASS (2026-07-07)
   Design layer for the theme's own templates: 404, blog index,
   archives, single posts, static pages, and the WooCommerce shell.
   Everything below is scoped under .theme-page (a <main> class the
   Academy LMS, landing page, and other plugins never use), so it
   cannot bleed into embedded apps or plugin screens.
   Rollback: _legacy-pre-prettify/assets/css/core.css
   ═══════════════════════════════════════════════════════════════ */

/* ── Page canvas: deep ink with brand glows ─────────────────── */
.theme-page {
  position: relative;
  background:
    radial-gradient(ellipse 68% 50% at 16% -6%, rgba(36, 133, 214, 0.17), transparent 62%),
    radial-gradient(ellipse 50% 42% at 84% 2%, rgba(212, 168, 83, 0.11), transparent 65%),
    radial-gradient(ellipse 90% 55% at 50% 110%, rgba(90, 110, 240, 0.08), transparent 62%),
    var(--bg-dark);
}

.theme-page ::selection {
  background: rgba(36, 133, 214, 0.42);
  color: #fff;
}

/* WP-standard a11y class the pagination markup relies on */
.theme-page .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Hero ───────────────────────────────────────────────────── */
.theme-page-hero {
  position: relative;
  overflow: hidden;
  padding: 168px 0 64px;
  background: none; /* glows now live on .theme-page itself */
}

/* Slow-drifting light orbs behind the headline */
.theme-page-hero::before,
.theme-page-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
}

.theme-page-hero::before {
  width: 420px;
  height: 420px;
  top: -140px;
  left: calc(50% - 480px);
  background: radial-gradient(circle, rgba(36, 133, 214, 0.22), transparent 70%);
  animation: m2ThemeOrb 16s ease-in-out infinite alternate;
}

.theme-page-hero::after {
  width: 360px;
  height: 360px;
  top: -80px;
  right: calc(50% - 460px);
  background: radial-gradient(circle, rgba(212, 168, 83, 0.16), transparent 70%);
  animation: m2ThemeOrb 19s ease-in-out infinite alternate-reverse;
}

@keyframes m2ThemeOrb {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(46px, 26px, 0) scale(1.12); }
}

.theme-page-hero .container {
  position: relative;
  z-index: 1;
}

/* Eyebrow: gold, framed by gradient hairlines */
.theme-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--gold);
}

.theme-eyebrow::before,
.theme-eyebrow::after {
  content: '';
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 168, 83, 0.65));
}

.theme-eyebrow::after {
  background: linear-gradient(90deg, rgba(212, 168, 83, 0.65), transparent);
}

/* Headline: serif ink with a soft luminance fade */
.theme-page-hero h1 {
  text-wrap: balance;
  color: #fff;
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
  .theme-page-hero h1 {
    background: linear-gradient(180deg, #fff 52%, rgba(255, 255, 255, 0.6));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

/* Optional standfirst + meta row under the headline */
.theme-page-sub {
  margin: 18px auto 0;
  max-width: 560px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-light);
  text-wrap: balance;
}

.theme-page-sub p {
  margin: 0;
}

.theme-post-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 22px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-light);
}

.theme-post-meta i {
  color: var(--gold);
  font-size: 11px;
  margin-right: 7px;
}

/* Staggered entrance */
.theme-page-hero .container > * {
  animation: m2ThemeRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.theme-page-hero .container > *:nth-child(2) { animation-delay: 0.08s; }
.theme-page-hero .container > *:nth-child(3) { animation-delay: 0.16s; }
.theme-page-hero .container > *:nth-child(4) { animation-delay: 0.24s; }
.theme-page-hero .container > *:nth-child(5) { animation-delay: 0.32s; }

@keyframes m2ThemeRise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Content card: dark glass, no backdrop-filter ───────────────
   The canvas behind the card is opaque, so blur has nothing to
   sample — skipping it avoids the mobile compositing stalls seen
   on the landing page while looking identical. */
.theme-page .theme-content {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025) 120px),
    rgba(12, 10, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 28px;
  padding: clamp(26px, 5vw, 56px);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ── Prose typography ───────────────────────────────────────────
   Measure is applied to direct children only, so shortcode/app
   wrappers dropped into a page keep their full width. */
.theme-prose {
  font-size: 16px;
  line-height: 1.78;
  color: rgba(255, 255, 255, 0.74);
}

.theme-prose > p,
.theme-prose > h1,
.theme-prose > h2,
.theme-prose > h3,
.theme-prose > h4,
.theme-prose > h5,
.theme-prose > h6,
.theme-prose > ul,
.theme-prose > ol,
.theme-prose > blockquote,
.theme-prose > figure.wp-block-image,
.theme-prose > pre {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.theme-prose h1,
.theme-prose h2,
.theme-prose h3,
.theme-prose h4 {
  font-family: var(--serif);
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 2em auto 0.6em;
}

.theme-prose h2 { font-size: 28px; }
.theme-prose h3 { font-size: 22px; }
.theme-prose h4 { font-size: 18px; }

.theme-prose > h2:first-child,
.theme-prose > h3:first-child,
.theme-prose > p:first-child {
  margin-top: 0;
}

.theme-prose p {
  margin: 0 auto 1.25em;
}

.theme-prose a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(36, 133, 214, 0.55);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

.theme-prose a:hover {
  text-decoration-color: var(--gold);
}

.theme-prose strong {
  color: #fff;
  font-weight: 600;
}

.theme-prose ul,
.theme-prose ol {
  padding-left: 1.3em;
  margin-bottom: 1.25em;
}

.theme-prose li {
  margin-bottom: 0.45em;
}

.theme-prose ul li::marker { color: var(--gold); }
.theme-prose ol li::marker {
  color: var(--purple);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.theme-prose blockquote {
  position: relative;
  margin: 1.8em auto;
  padding: 20px 26px;
  border-left: 3px solid var(--purple);
  border-radius: 6px 16px 16px 6px;
  background: rgba(36, 133, 214, 0.07);
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.85);
}

.theme-prose blockquote p:last-child {
  margin-bottom: 0;
}

.theme-prose code {
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 87%;
  color: #efe9ff;
}

.theme-prose pre {
  padding: 20px 24px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.65;
}

.theme-prose pre code {
  padding: 0;
  border: 0;
  background: none;
}

.theme-prose hr {
  max-width: 720px;
  margin: 2.6em auto;
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}

.theme-prose > p > img,
.theme-prose figure.wp-block-image img,
.theme-prose .wp-caption img {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.theme-prose figcaption,
.theme-prose .wp-caption-text {
  margin-top: 10px;
  font-size: 13px;
  text-align: center;
  color: var(--text-light);
}

.theme-prose table {
  width: 100%;
  max-width: 720px;
  margin: 1.8em auto;
  border-collapse: collapse;
  font-size: 14.5px;
}

.theme-prose th,
.theme-prose td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-prose th {
  color: #fff;
  font-weight: 600;
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.theme-prose tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

/* ── Blog index / archive: article cards ────────────────────── */
.theme-article-list {
  display: grid;
  gap: 16px;
}

.theme-page .theme-article + .theme-article {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.theme-article-link {
  display: block;
  position: relative;
  padding: 26px 30px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.3s ease,
    background 0.3s ease,
    box-shadow 0.3s ease;
}

.theme-article-link:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(36, 133, 214, 0.35);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(36, 133, 214, 0.12);
}

.theme-article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 10px;
}

.theme-article-meta .theme-article-dot {
  color: rgba(255, 255, 255, 0.25);
}

.theme-article-title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: #fff;
  transition: color 0.25s ease;
}

.theme-article-link:hover .theme-article-title {
  color: #c8e6ff;
}

.theme-article-excerpt {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.62);
}

.theme-article-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--purple);
}

.theme-article-cta i {
  font-size: 11px;
  transition: transform 0.25s ease;
}

.theme-article-link:hover .theme-article-cta i {
  transform: translateX(4px);
}

/* Empty state */
.theme-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 56px 20px;
  text-align: center;
}

.theme-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(36, 133, 214, 0.1);
  border: 1px solid rgba(36, 133, 214, 0.22);
  color: var(--purple);
  font-size: 22px;
}

.theme-empty h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  color: #fff;
}

.theme-empty p {
  margin: 0;
  max-width: 340px;
  font-size: 14.5px;
  color: var(--text-light);
}

/* Pagination pills */
.theme-page .navigation.pagination {
  margin-top: 36px;
}

.theme-page .nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-page .nav-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.theme-page .nav-links a.page-numbers:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
}

.theme-page .nav-links .page-numbers.current {
  color: #fff;
  background: linear-gradient(135deg, var(--purple), #1e6bad);
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(36, 133, 214, 0.35);
}

.theme-page .nav-links .page-numbers.dots {
  background: none;
  border: none;
}

/* ── Buttons (hero CTAs, 404) ───────────────────────────────── */
.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 28px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease,
    background 0.28s ease,
    border-color 0.28s ease;
}

.theme-btn i {
  font-size: 12px;
}

.theme-btn--primary {
  background: linear-gradient(135deg, var(--purple), #1e6bad);
  color: #fff;
  box-shadow: 0 10px 28px rgba(36, 133, 214, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.theme-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(36, 133, 214, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.theme-btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.85);
}

.theme-btn--ghost:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

/* ── 404 ────────────────────────────────────────────────────── */
.theme-page--404 {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding-top: 0;
  padding-bottom: 0;
  /* clip the orb glow at the page edge, not the hero edge — the hero
     sits mid-viewport here, so its own overflow:hidden would print a
     hard horizontal seam through the glow */
  overflow: hidden;
}

.theme-page--404 .theme-page-hero {
  width: 100%;
  padding: 140px 0 96px;
  overflow: visible;
}

.theme-404-code {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 3vw, 26px);
  margin-bottom: 18px;
  font-family: var(--serif);
  font-size: clamp(92px, 17vw, 168px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.theme-404-code > span:first-child,
.theme-404-code > span:last-child {
  color: #fff;
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
  .theme-404-code > span:first-child,
  .theme-404-code > span:last-child {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.35));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

/* The "0": a spinning record with a music note */
.theme-404-note {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(76px, 13vw, 132px);
  height: clamp(76px, 13vw, 132px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(12, 10, 18, 0.9) 26%, transparent 27%),
    conic-gradient(from 160deg, rgba(36, 133, 214, 0.85), rgba(212, 168, 83, 0.8), rgba(36, 133, 214, 0.85));
  box-shadow:
    0 18px 50px rgba(36, 133, 214, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  animation: m2Theme404Spin 14s linear infinite;
}

.theme-404-note i {
  font-size: clamp(26px, 4.5vw, 44px);
  color: #fff;
  text-shadow: 0 4px 18px rgba(36, 133, 214, 0.6);
  animation: m2Theme404CounterSpin 14s linear infinite;
}

@keyframes m2Theme404Spin        { to { transform: rotate(360deg); } }
@keyframes m2Theme404CounterSpin { to { transform: rotate(-360deg); } }

.theme-404-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

/* ── WooCommerce shell on the dark card ─────────────────────── */
.theme-page--shop .theme-prose .woocommerce a.button,
.theme-page--shop .theme-prose .woocommerce button.button,
.theme-page--shop .theme-prose .woocommerce input.button,
.theme-page--shop .theme-prose a.button,
.theme-page--shop .theme-prose button.button {
  background: linear-gradient(135deg, var(--purple), #1e6bad) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 999px !important;
  padding: 11px 24px !important;
  font-weight: 600 !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.theme-page--shop .theme-prose a.button:hover,
.theme-page--shop .theme-prose button.button:hover,
.theme-page--shop .theme-prose input.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(36, 133, 214, 0.4);
}

.theme-page--shop .theme-prose table.shop_table {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 14px !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  overflow: hidden;
}

.theme-page--shop .theme-prose table.shop_table th,
.theme-page--shop .theme-prose table.shop_table td {
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: none !important;
  color: rgba(255, 255, 255, 0.78) !important;
}

.theme-page--shop .theme-prose table.shop_table th {
  color: #fff !important;
}

.theme-page--shop .theme-prose .woocommerce-message,
.theme-page--shop .theme-prose .woocommerce-info,
.theme-page--shop .theme-prose .woocommerce-error {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-top: 2px solid var(--purple) !important;
  border-radius: 12px !important;
  color: rgba(255, 255, 255, 0.82) !important;
}

.theme-page--shop .theme-prose .woocommerce-error {
  border-top-color: #ef4444 !important;
}

/* ── Motion & small screens ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .theme-page-hero::before,
  .theme-page-hero::after,
  .theme-page-hero .container > *,
  .theme-404-note,
  .theme-404-note i {
    animation: none;
  }
}

@media (max-width: 768px) {
  .theme-page-hero {
    /* re-assert the mobile top clearance — the earlier 768px block is
       now out-specified by this section's base hero rule */
    padding: 132px 0 44px;
  }

  .theme-page-hero::before,
  .theme-page-hero::after {
    /* fixed-position blur orbs are cheap, but keep them off phone
       compositors entirely — same policy as the landing page */
    display: none;
  }

  .theme-article-link {
    padding: 22px 20px;
  }

  .theme-article-title {
    font-size: 20px;
  }

  .theme-page .theme-content {
    border-radius: 20px;
  }
}

/* ═══════════════════════════════════════════════════════
   VISITOR DARK MODE — surface coverage
   html.m2-theme-dark is stamped pre-paint by the wp_head
   boot script; before this section it only styled the
   toggle icon + smoke-header trim, so every surface below
   stayed light and misfired at the seams.
   ═══════════════════════════════════════════════════════ */

/* Underlay: the html fallback stays #faf9f7 by default, so transparent-body
   pages (pastel/inkwell/smoke internals) flashed a light backdrop for the
   aurora's whole 2.5s fade — and kept it forever when WebGL was unavailable
   (.page-aurora--dark only paints the aurora element). Paint the base dark
   pre-paint. color-scheme rides along so scrollbars/native widgets match. */
html.m2-theme-dark {
  background: var(--bg-dark);
  color-scheme: dark;
}
/* Readability guard, mirroring core.js darkWanted(): an Academy surface that
   resolved LIGHT (html.m2-dark absent) keeps dark ink over transparency —
   the light aurora needs a light base under it while it fades in. Same
   surface list as core.js ACADEMY_SURFACES. (Pre-:has() browsers skip this
   exception and briefly darken the backdrop in that rare mixed state.) */
html.m2-theme-dark:not(.m2-dark):has(.academy-content, .academy-courses, .academy-single-course, .academy-single-bundle) {
  background: var(--bg);
  color-scheme: light;
}

/* Always-dark internal templates host WooCommerce forms (cart/checkout/
   account) — without a dark color-scheme their native selects, autofill
   and scrollbars render in light UA chrome on the dark card. */
.theme-page { color-scheme: dark; }

/* ── Cart sidebar — was a hardcoded white panel with var(--text) ink ── */
html.m2-theme-dark .cart-sidebar {
  background: #16131b;
  color: #ece9f4;
  box-shadow: -20px 0 60px rgba(0,0,0,0.55);
}
html.m2-theme-dark .cart-sidebar-header { border-bottom-color: rgba(255,255,255,0.08); }
html.m2-theme-dark .cart-item-count {
  color: #a8d7ff;
  background: rgba(32,121,196,0.18);
}
html.m2-theme-dark .cart-close-btn {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.70);
}
html.m2-theme-dark .cart-close-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
html.m2-theme-dark .cart-empty-icon {
  background: rgba(32,121,196,0.14);
  color: rgba(255,255,255,0.55);
}
html.m2-theme-dark .cart-empty p { color: rgba(255,255,255,0.62); }
html.m2-theme-dark .cart-empty-cta,
html.m2-theme-dark .cart-checkout-btn {
  background: #f5f3ef;
  color: #17141b;
}
html.m2-theme-dark .cart-empty-cta:hover,
html.m2-theme-dark .cart-checkout-btn:hover { background: #fff; }
html.m2-theme-dark .cart-item { border-bottom-color: rgba(255,255,255,0.07); }
html.m2-theme-dark .cart-item-img { background: rgba(255,255,255,0.06); }
html.m2-theme-dark .cart-item-name { color: #ece9f4; }
html.m2-theme-dark .cart-item-price { color: rgba(255,255,255,0.60); }
html.m2-theme-dark .cart-item-qty button {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.12);
  color: #ece9f4;
}
html.m2-theme-dark .cart-item-remove { color: rgba(255,255,255,0.45); }
html.m2-theme-dark .cart-sidebar-footer {
  border-top-color: rgba(255,255,255,0.08);
  background: #16131b;
}
html.m2-theme-dark .cart-subtotal-label { color: rgba(255,255,255,0.60); }
html.m2-theme-dark .cart-subtotal-amount { color: #f2eee6; }

/* ── Add-to-cart toast — was frosted white glass ── */
html.m2-theme-dark .m2-toast-inner {
  background: rgba(24, 21, 30, 0.90);
  border-color: rgba(255,255,255,0.10);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 4px 12px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
html.m2-theme-dark .m2-toast-body { color: #ece9f4; }
html.m2-theme-dark .m2-toast-sep { color: rgba(255,255,255,0.35); }
html.m2-theme-dark .m2-toast-msg { color: rgba(255,255,255,0.65); }

/* ── "Original White" internal header — the one style with no header-bg
   paint: over the always-dark .theme-page/product templates its scrolled
   chrome (nav links + toggle, var(--text-mid) on a transparent pill) was
   near-invisible. Give it the white pill its name promises. ── */
body.m2-internal-header-original:not(.home):not(.front-page) .site-header.scrolled .header-bg {
  opacity: 1;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(250,250,250,0.97));
}
body.m2-internal-header-original:not(.home):not(.front-page) .site-header.scrolled {
  border-color: rgba(255,255,255,0.85);
  box-shadow: 0 14px 34px rgba(12,10,9,0.10), inset 0 1px 0 rgba(255,255,255,0.80);
}
