/* ============================================================
   Purple Liquid Glass — override layer (v3, light)
   Loaded AFTER style.css (app pages) and page.css (static pages).
   Recolors and re-textures the UI only; no layout or logic changes.

   v3: same look, far cheaper to render — smaller blur radii,
   no blur on small elements, static soft glows (no giant blur
   filters), no fixed-attachment backdrop, lighter overlay blurs.
   ============================================================ */

/* ---------- App tokens (style.css pages) ---------- */
:root {
  --lg-blur: 10px;
  --lg-blur-sm: 4px;
  --bg: oklch(0.1 0.04 295);
  --fg: oklch(0.97 0.015 305);
  --card: oklch(0.3 0.09 300 / 0.42);
  --muted: oklch(0.74 0.05 305);
  --border: oklch(0.82 0.06 300 / 0.16);
  --primary: oklch(0.66 0.25 298);
  --accent: oklch(0.72 0.24 318);
  --brand-gradient: linear-gradient(135deg, oklch(0.58 0.24 288), oklch(0.62 0.26 302), oklch(0.66 0.25 318));
  --neon-glow:
    0 0 22px oklch(0.62 0.26 300 / 0.45),
    0 0 52px oklch(0.55 0.24 310 / 0.28);
  --shadow-card:
    inset 0 1px 0 oklch(0.95 0.03 300 / 0.16),
    inset 0 -1px 0 oklch(0.4 0.12 300 / 0.12),
    0 1px 2px oklch(0.05 0.02 300 / 0.45),
    0 24px 60px -24px oklch(0.35 0.18 300 / 0.55);
}

/* ---------- Static page tokens (page.css pages) ---------- */
:root {
  --pg-bg: #0b0416;
  --pg-panel: rgba(103, 60, 176, 0.14);
  --pg-border: rgba(196, 165, 255, 0.22);
  --pg-text: #f1ecff;
  --pg-muted: #b9a8e0;
  --pg-accent: #a78bfa;
  --pg-accent-2: #d8b4fe;
}

@media (max-width: 768px) {
  :root {
    --lg-blur: 6px;
    --lg-blur-sm: 3px;
  }
}

/* ---------- Liquid aurora backdrop (darkened) ----------
   Plain scrolling gradient: "fixed" attachment forces a full-screen
   repaint on every scroll frame and is one of the biggest lag sources. */
body {
  background-image:
    radial-gradient(55% 45% at 50% 0%, oklch(0.34 0.14 300 / 0.32), transparent 70%),
    radial-gradient(45% 40% at 100% 100%, oklch(0.3 0.12 318 / 0.22), transparent 70%),
    radial-gradient(40% 35% at 0% 80%, oklch(0.28 0.11 285 / 0.2), transparent 70%);
  background-attachment: scroll;
}

/* Soft glow orbs. The 70px blur() filters were rasterizing two
   huge layers nonstop; the gradients below are soft on their own
   and drift with transform-only animations (compositor-cheap). */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: none;
  will-change: auto;
}

body::before {
  width: 46vw;
  height: 46vw;
  min-width: 320px;
  min-height: 320px;
  left: -12vw;
  top: -14vw;
  background: radial-gradient(circle at 35% 35%, oklch(0.5 0.22 298 / 0.34), oklch(0.5 0.22 298 / 0.12) 45%, transparent 72%);
  animation: lgDriftA 26s ease-in-out infinite alternate;
}

body::after {
  width: 52vw;
  height: 52vw;
  min-width: 360px;
  min-height: 360px;
  right: -16vw;
  bottom: -18vw;
  background: radial-gradient(circle at 60% 60%, oklch(0.45 0.2 318 / 0.28), oklch(0.45 0.2 318 / 0.1) 45%, transparent 72%);
  animation: lgDriftB 32s ease-in-out infinite alternate;
}

@media (max-width: 768px) {
  body::before,
  body::after {
    opacity: 0.85;
  }
  body::before {
    width: 68vw;
    height: 68vw;
    min-width: 260px;
    min-height: 260px;
  }
  body::after {
    width: 74vw;
    height: 74vw;
    min-width: 280px;
    min-height: 280px;
  }
}

@keyframes lgDriftA {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6vw, 5vh, 0) scale(1.12); }
}

@keyframes lgDriftB {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to   { transform: translate3d(-7vw, -6vh, 0) scale(0.95); }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    animation: none;
  }
}

/* Soften the hero crystal glow so it never outshines the cards
   (gradient falloff replaces the expensive blur filter) */
.crystalGlow {
  background: radial-gradient(circle at 50% 50%, oklch(0.5 0.24 305 / 0.2), oklch(0.5 0.24 305 / 0.07) 55%, transparent 75%);
  filter: none;
}
#crystalCanvas {
  opacity: 0.55;
}
@media (min-width: 640px) {
  #crystalCanvas {
    opacity: 0.65;
  }
}

/* ---------- The liquid glass recipe (shared by every panel) ----------
   Panels in the scroll flow use tint-only glass: over this dark
   backdrop the translucent tint + highlight reads identically, and
   skipping dozens of per-frame blur passes is the single biggest
   speed win. Real blur is kept only for popups and the sticky nav. */
.topbar,
.panel,
.dropdown,
.authCard,
.modalBox,
.appModalBox,
.noticeModalBox,
.legalModal,
.drawerContent,
.editorPanel,
.historyCard,
.howStepCard,
.aboutCard,
.aboutDemoBox,
.faqItem,
.articleCard,
.prSurveyCard,
.prFreeCard,
.prFreeBanner,
.itemInspectorBox,
.enhancePanel,
.noticeWarningCard,
.seoSec,
/* Boxes that previously sat outside the glass layer */
.feat,
.drop,
.reviewChat,
.tryOnModalCard,
.proBox,
.proExpiredNote,
.proRenewNote,
.printEditorModalBox,
.printEditorControls,
.profileCard,
.editRow,
.previewBox,
.dropdown,
.ddItem,
.qtyBtn,
.printSeg,
.printQtyBox,
.presetCard,
.gridSlot,
.statCard,
.aboutList li,
.emptyNotice {
  background:
    linear-gradient(150deg, oklch(0.44 0.12 300 / 0.44), oklch(0.24 0.08 298 / 0.56) 55%, oklch(0.2 0.07 295 / 0.62));
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 1px solid oklch(0.84 0.06 300 / 0.18);
  border-radius: 20px;
  box-shadow:
    inset 0 1px 0 oklch(0.96 0.03 300 / 0.22),
    inset 0 -1px 0 oklch(0.45 0.14 300 / 0.1),
    0 24px 60px -24px oklch(0.35 0.2 300 / 0.55);
}

/* Popups, dialogs and the drawer float above the page and are only
   visible while open — they keep a light, real blur. */
.modalBox,
.appModalBox,
.noticeModalBox,
.legalModal,
.authCard,
.printEditorModalBox,
.tryOnModalCard,
.dropdown,
.drawerContent {
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Small, numerous elements drop the blur entirely — over the dark
   backdrop the translucent tint alone looks identical, and skipping
   dozens of blur passes is the single biggest scroll-speed win. */
.ddItem,
.qtyBtn,
.printSeg,
.printSegBtn,
.gridSlot,
.statCard,
.aboutList li,
.emptyNotice,
.reviewStar {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Keep the upload box's dashed outline */
.drop {
  border: 2px dashed oklch(0.62 0.26 305 / 0.45);
  border-radius: 20px;
}
.drop:hover {
  border-color: oklch(0.66 0.26 305 / 0.6);
}

/* Compact elements get a lighter slice of the same glass (no blur) */
.ddItem,
.qtyBtn,
.printSeg,
.printSegBtn,
.gridSlot,
.statCard,
.aboutList li,
.emptyNotice,
.reviewStar {
  background: linear-gradient(150deg, oklch(0.42 0.11 300 / 0.34), oklch(0.24 0.08 298 / 0.46));
  border: 1px solid oklch(0.84 0.06 300 / 0.16);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 oklch(0.96 0.03 300 / 0.16),
    0 8px 24px -12px oklch(0.35 0.2 300 / 0.45);
}

/* The review box reads as one glass panel */
.reviewChatHead,
.reviewChatBody,
.reviewChatForm {
  background: transparent;
}
.reviewChatHead {
  border-bottom: 1px solid oklch(0.84 0.06 300 / 0.12);
}
.reviewChatForm {
  border-top: 1px solid oklch(0.84 0.06 300 / 0.12);
}
@media (min-width: 800px) {
  .reviewChatForm {
    border-top: 0;
    border-left: 1px solid oklch(0.84 0.06 300 / 0.12);
  }
}

/* Soft interactive lift for main cards (transform/border only —
   animating box-shadow forces a repaint on every hover frame) */
.historyCard,
.howStepCard,
.aboutCard,
.faqItem,
.articleCard,
.feat,
.presetCard {
  transition:
    transform 0.25s ease,
    border-color 0.25s ease;
}

.historyCard:hover,
.howStepCard:hover,
.aboutCard:hover,
.articleCard:hover,
.feat:hover,
.presetCard:hover {
  transform: translateY(-2px);
  border-color: oklch(0.84 0.07 300 / 0.3);
  box-shadow:
    inset 0 1px 0 oklch(0.96 0.03 300 / 0.24),
    0 30px 70px -26px oklch(0.4 0.22 300 / 0.6);
}

/* ---------- Buttons ---------- */
.btn.primary,
.iconBtn.brand,
.pgBtn,
.reviewSendBtn,
.printBtn,
.tryOnBtn.primary {
  background:
    linear-gradient(150deg, oklch(0.62 0.24 292 / 0.95), oklch(0.6 0.26 305 / 0.92) 55%, oklch(0.62 0.24 318 / 0.9));
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow:
    inset 0 1px 0 oklch(0.97 0.03 300 / 0.4),
    inset 0 -2px 6px oklch(0.3 0.14 300 / 0.35),
    0 10px 30px -8px oklch(0.55 0.26 300 / 0.6);
}

.btn.primary:hover,
.iconBtn.brand:hover {
  background:
    linear-gradient(150deg, oklch(0.67 0.24 292 / 0.97), oklch(0.65 0.26 305 / 0.95) 55%, oklch(0.67 0.24 318 / 0.93));
}

.btn.ghost,
.iconBtn.ghost,
.pgNavLinks a,
.printBtn.outline,
.printSegBtn,
.qtyBtn,
.tryOnBtn.ghost,
.iconBtn {
  background: oklch(0.66 0.25 300 / 0.08);
  border: 1px solid oklch(0.84 0.06 300 / 0.24);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.btn.ghost:hover,
.iconBtn.ghost:hover,
.printBtn.outline:hover,
.printSegBtn:hover,
.qtyBtn:hover {
  background: oklch(0.66 0.25 300 / 0.18);
  border-color: oklch(0.86 0.08 300 / 0.45);
}

.iconBtn,
.btn,
.printBtn,
.tryOnBtn,
.qtyBtn,
.printSegBtn {
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

/* Header pill + drawers share the same glass */
.btnGroup {
  background: oklch(0.14 0.05 300 / 0.55);
  border: 1px solid oklch(0.84 0.06 300 / 0.18);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.slideDrawer {
  background: oklch(0.14 0.05 300 / 0.86);
  border-left: 1px solid oklch(0.84 0.06 300 / 0.14);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* ---------- Inputs ---------- */
.authInput,
select,
.controls input[type="text"],
.prSurveyInput,
.accNameInput {
  background: oklch(0.24 0.08 298 / 0.5);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 1px solid oklch(0.84 0.06 300 / 0.2);
  border-radius: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.authInput:focus,
select:focus,
.controls input[type="text"]:focus,
.prSurveyInput:focus,
.accNameInput:focus {
  border-color: oklch(0.72 0.2 300 / 0.65);
  box-shadow: 0 0 0 3px oklch(0.62 0.24 300 / 0.22);
}

/* ---------- Sticky nav glass ---------- */
.topbar,
.pgNav {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.pgNav {
  background: oklch(0.14 0.055 295 / 0.72);
  border-bottom: 1px solid oklch(0.84 0.06 300 / 0.14);
}

/* ---------- Heavy site originals, lightened ----------
   Full-viewport overlays and the footer blur the entire page behind
   them; a 4–8px blur keeps the dim-glass read at a fraction of the cost. */
.modalOverlay,
.printEditorOverlay,
.drawerBackdrop,
.dressEditorOverlay,
.authView,
.prFreeBanner {
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.homeFooter {
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Floating toasts and the hero ticker keep a whisper of blur */
.toastItem {
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.heroTickerText {
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* ---------- Static page cards ---------- */
.pgCard,
.pgForm {
  background:
    linear-gradient(150deg, rgba(126, 82, 208, 0.32), rgba(56, 30, 100, 0.5) 60%);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 1px solid rgba(196, 165, 255, 0.22);
  border-radius: 20px;
  box-shadow:
    inset 0 1px 0 rgba(238, 226, 255, 0.18),
    0 24px 60px -24px rgba(60, 20, 120, 0.6);
}

.pgFooter {
  border-top: 1px solid rgba(196, 165, 255, 0.16);
  background: linear-gradient(180deg, transparent, rgba(103, 60, 176, 0.1));
}

/* ---------- Smooth entrances (replay when a hidden box is shown) ---------- */
@keyframes lgFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.view,
.modalBox,
.printEditorModalBox,
.authCard,
.noticeModalBox,
.legalModal,
.prFreeCard,
.prSurveyCard,
.itemInspectorBox,
.enhancePanel,
.drawerContent {
  animation: lgFadeUp 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .view,
  .modalBox,
  .printEditorModalBox,
  .authCard,
  .noticeModalBox,
  .legalModal,
  .prFreeCard,
  .prSurveyCard,
  .itemInspectorBox,
  .enhancePanel,
  .drawerContent {
    animation: none;
  }
}

/* ---------- Details ---------- */
::selection {
  background: oklch(0.55 0.26 300 / 0.55);
  color: oklch(0.98 0.01 305);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, oklch(0.55 0.2 298 / 0.6), oklch(0.45 0.18 312 / 0.6));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, oklch(0.62 0.22 298 / 0.75), oklch(0.52 0.2 312 / 0.75));
  border: 2px solid transparent;
  background-clip: padding-box;
}

:focus-visible {
  outline: 2px solid oklch(0.7 0.2 300 / 0.8);
  outline-offset: 2px;
}

/* Small photo boxes: keep them proper rectangles with square corners */
.gridSlot,
.gridSlot.occupied,
.gridSlot.selected,
.printPhotoCanvas,
.photoBadge,
.photoHoverOverlay,
.slotEmptyLabel {
  border-radius: 0;
}
