/* ==========================================================================
   DrClerq Web Platform v5 — Flagship 60fps GPU Material & Motion System
   Default: Matte Obsidian Dark · Authentic Celestial Toggle · v3.5 Motion
   ========================================================================== */

@keyframes cometSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes shimmerSweep {
  0% { transform: translateX(-130%); }
  100% { transform: translateX(230%); }
}

@keyframes breathAura {
  0%, 100% { opacity: 0.34; transform: scale(0.97); }
  50% { opacity: 0.58; transform: scale(1.03); }
}

@keyframes unlockRipple {
  0% { transform: scale(0.86); opacity: 0.85; }
  100% { transform: scale(2.12); opacity: 0; }
}

/* DEFAULT THEME: MATTE OBSIDIAN DARK */
:root,
html[data-theme="dark"] {
  --bg: #0d1012;
  --bg-subtle: #121619;
  --panel: #181c20;
  --panel2: #14181b;
  --surface: #1e2328;
  --line: #2b333b;
  --line-soft: rgba(43, 51, 59, 0.72);
  --text: #f3f7f5;
  --muted: #9ba8b1;
  --subtle: #c3cfd6;
  --accent: #8cf0d4;
  --accent2: #4ef0c4;
  --grad-start: #7cefd0;
  --grad-end: #d4fff3;
  --action: #12805f;
  --action2: #189c74;
  --on-action: #f4fbf8;
  --selected: #162d26;
  --badge-bg: #142620;
  --danger: #f5a999;
  --danger-bg: #261518;
  --danger-border: #68333d;
  --warning: #f0d494;
  --warning-bg: #251e10;
  --warning-border: #5e4a20;
  --info: #56b9eb;
  --info-bg: #122430;
  --shadow-color: rgba(0, 0, 0, 0.64);
  --highlight: #313840;
  --card-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.038) 0%, rgba(255, 255, 255, 0) 44%);
  --lift: 0 24px 56px -14px rgba(0, 0, 0, 0.7), 0 6px 18px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.075);
  --lift-sm: 0 10px 24px -8px rgba(0, 0, 0, 0.56), inset 0 1px 0 rgba(255, 255, 255, 0.055);
  --inset: inset 2px 3px 9px rgba(0, 0, 0, 0.56), inset -2px -2px 6px rgba(255, 255, 255, 0.03);
  --glass: rgba(13, 16, 18, 0.82);
  --hero-glow: radial-gradient(ellipse 72% 55% at 50% -12%, rgba(40, 210, 165, 0.16), transparent 68%),
               radial-gradient(circle at 80% 25%, rgba(18, 128, 95, 0.13), transparent 44%);
  --comet-base: #222a30;
  --comet-c1: #1ea87f;
  --comet-hot: #dcfff5;
  --comet-ambient: rgba(30, 168, 127, 0.24);
  --motion-paper-top: #2a3036;
  --motion-paper-bottom: #1e2328;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-sm: 11px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ALABASTER LIGHT */
html[data-theme="light"] {
  --bg: #eaf0ec;
  --bg-subtle: #e2ebe5;
  --panel: #f7faf8;
  --panel2: #e8f0eb;
  --surface: #ffffff;
  --line: #bdcfc5;
  --line-soft: rgba(189, 207, 197, 0.7);
  --text: #10221b;
  --muted: #465f55;
  --subtle: #556e64;
  --accent: #096348;
  --accent2: #0c805d;
  --grad-start: #075840;
  --grad-end: #0e8e67;
  --action: #0d7455;
  --action2: #118a66;
  --on-action: #ffffff;
  --selected: #d6ebe0;
  --badge-bg: #dbece3;
  --danger: #b03a2e;
  --danger-bg: #fcece9;
  --danger-border: #e5b5ae;
  --warning: #8a5b0c;
  --warning-bg: #fbf0d8;
  --warning-border: #dfc07f;
  --info: #0c6591;
  --info-bg: #e4f2fa;
  --shadow-color: rgba(16, 36, 28, 0.11);
  --highlight: #ffffff;
  --card-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0) 46%);
  --lift: 0 18px 40px -14px rgba(16, 40, 31, 0.11), 0 3px 10px rgba(16, 40, 31, 0.045), inset 0 1px 0 rgba(255, 255, 255, 0.96);
  --lift-sm: 0 6px 16px -6px rgba(16, 40, 31, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --inset: inset 1.5px 2.5px 6px rgba(16, 40, 31, 0.07), inset -1.5px -1.5px 5px rgba(255, 255, 255, 0.94);
  --glass: rgba(244, 248, 245, 0.86);
  --hero-glow: radial-gradient(ellipse 68% 52% at 50% -14%, rgba(13, 134, 98, 0.13), transparent 66%),
               radial-gradient(circle at 80% 24%, rgba(13, 134, 98, 0.08), transparent 44%);
  --comet-base: #cbdcd3;
  --comet-c1: #0b8661;
  --comet-hot: #38e4b6;
  --comet-ambient: rgba(11, 134, 97, 0.16);
  --motion-paper-top: #fcfffc;
  --motion-paper-bottom: #deeee4;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  margin: 0; font-family: var(--font-sans); background: var(--bg); color: var(--text);
  line-height: 1.55; transition: background-color 280ms var(--ease), color 280ms var(--ease);
  overflow-x: hidden;
}
section[id] { scroll-margin-top: 92px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a, button, input, select, label, .iphone-shell {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button { cursor: pointer; }
svg { display: block; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 3px; }

/* Strict Tabular Numerals — Zero Horizontal Shimmer on Timers, KPIs & Counters */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tabular, .kpi-val, .roi-num, .otp-input, .count { font-variant-numeric: tabular-nums; }

select.custom-select {
  appearance: none; -webkit-appearance: none;
  padding-right: 38px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23788b82' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

/* ==========================================================================
   EXACT DRCLERQ APP CELESTIAL TOGGLE (Sun + Cloud <-> Crescent Moon + Stars)
   Ported 1:1 from DrClerq_Premium_Mockup_v3_5.html
   ========================================================================== */
.celestial-toggle {
  width: 72px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  border-radius: 999px;
  transition: transform 160ms var(--ease);
}
.celestial-toggle:hover { transform: scale(1.03); }
.celestial-toggle:active { transform: scale(0.96); }

.celestial-track {
  width: 68px;
  height: 34px;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line);
  background: var(--selected);
  box-shadow: var(--inset);
  transition: background-color 300ms var(--ease), border-color 300ms ease, box-shadow 300ms ease;
}
html[data-theme="dark"] .celestial-track {
  background: #14181c;
  border-color: #363e47;
}

.celestial-star {
  position: absolute;
  border-radius: 999px;
  background: #e8f4ef;
  opacity: 0;
  transform: scale(0.4) translateY(3px);
  transition: opacity 300ms var(--ease), transform 320ms var(--ease);
  pointer-events: none;
}
.celestial-star.s1 { left: 42px; top: 8px; width: 3.2px; height: 3.2px; }
.celestial-star.s2 { left: 37px; top: 21px; width: 2.2px; height: 2.2px; transition-delay: 40ms; }
.celestial-star.s3 { left: 54px; top: 15px; width: 2.4px; height: 2.4px; transition-delay: 75ms; }
html[data-theme="dark"] .celestial-star {
  opacity: 0.95;
  transform: scale(1) translateY(0);
}

.celestial-cloud {
  position: absolute;
  left: -5px;
  bottom: -10px;
  width: 44px;
  height: 28px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 -1px 3px rgba(255, 255, 255, 0.72);
  opacity: 0.94;
  transform: translateY(0);
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
  pointer-events: none;
}
.celestial-cloud-puff {
  position: absolute;
  left: 10px;
  top: -9px;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  background: var(--surface);
}
html[data-theme="dark"] .celestial-cloud {
  opacity: 0;
  transform: translateY(10px);
}

.celestial-orb-carrier {
  position: absolute;
  bottom: 2px;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(30px);
  transition: transform 320ms var(--ease);
  pointer-events: none;
}
html[data-theme="dark"] .celestial-orb-carrier {
  transform: translateX(0px);
}

.celestial-sun,
.celestial-moon {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 280ms var(--ease), transform 320ms var(--ease);
}
.celestial-sun {
  color: var(--accent);
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
html[data-theme="dark"] .celestial-sun {
  opacity: 0;
  transform: rotate(75deg) scale(0.55);
}
.celestial-moon {
  color: #f3f7f5;
  opacity: 0;
  transform: rotate(-45deg) scale(0.55);
}
html[data-theme="dark"] .celestial-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ==========================================================================
   GPU-Composited Dual-Comet RotatingPerimeterGlow (Zero Main-Thread Repaints!)
   Uses clipped transform: rotate(360deg) rotor instead of background repaints
   ========================================================================== */
.comet-frame {
  position: relative;
  border-radius: var(--comet-radius, 28px);
  padding: var(--comet-rim, 1.8px);
  background: var(--comet-base);
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--lift), 0 0 34px -10px var(--comet-ambient);
  transition: box-shadow 260ms var(--ease);
}
.comet-frame::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 260%;
  aspect-ratio: 1 / 1;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--comet-c1) 44deg,
    var(--comet-hot) 72deg,
    var(--comet-c1) 98deg,
    transparent 138deg,
    transparent 180deg,
    var(--comet-c1) 224deg,
    var(--comet-hot) 252deg,
    var(--comet-c1) 278deg,
    transparent 318deg,
    transparent 360deg
  );
  animation: cometSpin var(--comet-speed, 5.2s) linear infinite;
  will-change: transform;
  pointer-events: none;
  z-index: 0;
}
/* Hover-awakened variant for secondary cards (keeps focal hierarchy calm) */
.comet-frame.hover-only {
  box-shadow: var(--lift);
}
.comet-frame.hover-only::before {
  opacity: 0;
  animation-play-state: paused;
  transition: opacity 320ms var(--ease);
}
.comet-frame.hover-only:hover,
.comet-frame.hover-only:focus-within {
  box-shadow: var(--lift), 0 0 36px -10px var(--comet-ambient);
}
.comet-frame.hover-only:hover::before,
.comet-frame.hover-only:focus-within::before {
  opacity: 1;
  animation-play-state: running;
}

.comet-frame.qa-warn { --comet-c1: #c7963b; --comet-hot: #fff0c4; --comet-ambient: rgba(199, 150, 59, 0.28); }
.comet-frame.err-glow { --comet-c1: #cf5242; --comet-hot: #ffd5cd; --comet-ambient: rgba(207, 82, 66, 0.34); }

.comet-inner {
  position: relative;
  z-index: 1;
  border-radius: calc(var(--comet-radius, 28px) - var(--comet-rim, 1.8px));
  background-color: var(--panel);
  background-image: var(--card-sheen);
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ==========================================================================
   Titanium iPhone 16 Pro Mockup Frame + Seamless iOS 9:41 Status Bar Mask
   ========================================================================== */
.iphone-stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1300px;
}
.iphone-aura {
  position: absolute;
  width: min(340px, 86vw);
  height: min(340px, 86vw);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(78, 240, 196, 0.2) 0%, rgba(18, 128, 95, 0.09) 46%, transparent 72%);
  filter: blur(32px);
  pointer-events: none;
  animation: breathAura 7.5s ease-in-out infinite;
  will-change: transform, opacity;
}
.iphone-shell {
  position: relative;
  width: min(296px, calc(100vw - 48px));
  padding: 10px;
  border-radius: 49px;
  background: linear-gradient(145deg, #4b545d 0%, #1c2025 42%, #323942 100%);
  box-shadow:
    0 34px 74px -18px rgba(0, 0, 0, 0.68),
    0 10px 24px rgba(0, 0, 0, 0.32),
    inset 0 1px 1.5px rgba(255, 255, 255, 0.32),
    inset 0 -1px 2px rgba(0, 0, 0, 0.74);
  transform-style: preserve-3d;
  will-change: transform;
  cursor: pointer;
}
.iphone-shell::before {
  content: ""; position: absolute; right: -3px; top: 140px; width: 3px; height: 58px;
  border-radius: 0 3px 3px 0; background: linear-gradient(180deg, #525c64, #262c31);
}
.iphone-shell::after {
  content: ""; position: absolute; left: -3px; top: 120px; width: 3px; height: 44px;
  border-radius: 3px 0 0 3px; background: linear-gradient(180deg, #525c64, #262c31);
  box-shadow: 0 56px 0 #343b42;
}
.iphone-bezel {
  position: relative;
  border-radius: 40px;
  overflow: hidden;
  background: #0d1012;
  aspect-ratio: 9 / 19.45;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.08);
}
/* Seamless iOS Status Bar Mask (cleanly hides underlying Android status bar icons) */
.iphone-statusbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 31px;
  padding: 0 19px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--sb-bg, #16181a);
  color: var(--sb-ink, #f3f7f5);
  font-family: -apple-system, BlinkMacSystemFont, "Plus Jakarta Sans", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  transition: background-color 420ms var(--ease), color 420ms var(--ease);
  pointer-events: none;
  user-select: none;
}
.iphone-sb-icons {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.iphone-island {
  position: absolute; top: 6.5px; left: 50%; transform: translateX(-50%);
  width: 76px; height: 19px; border-radius: 999px; background: #050607; z-index: 8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.iphone-glare {
  position: absolute; inset: 0; z-index: 7; pointer-events: none;
  background: radial-gradient(circle at var(--gx, 28%) var(--gy, 18%), rgba(255, 255, 255, 0.14) 0%, transparent 52%);
}
.iphone-layer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  opacity: 0; transform: scale(1.018);
  transition: opacity 520ms var(--ease), transform 640ms var(--ease);
  will-change: opacity, transform;
}
.iphone-layer.shown { opacity: 1; transform: scale(1); z-index: 2; }

/* ==========================================================================
   Shared Surfaces, Typography & Hysteresis Scroll Reveals
   ========================================================================== */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow-dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--accent2); box-shadow: 0 0 10px var(--accent2);
}

.pill {
  display: inline-flex; align-items: center; gap: 6px; width: fit-content;
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1px solid var(--line); background: var(--badge-bg); color: var(--accent);
}
.pill.warn { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning); }
.pill.danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.pill.info { background: var(--info-bg); border-color: rgba(86, 185, 235, 0.35); color: var(--info); }
.pill.neutral { background: var(--panel2); color: var(--muted); }

.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 20px; border-radius: 14px; font-size: 14px; font-weight: 700;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  box-shadow: var(--lift-sm);
  transition: transform 180ms var(--ease), box-shadow 200ms var(--ease), border-color 180ms var(--ease), background-color 180ms var(--ease), color 180ms var(--ease);
}
@media (hover: hover) {
  .btn:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--accent); }
  .icon-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
}
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: var(--inset); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.btn-primary {
  background: linear-gradient(150deg, var(--action2) 0%, var(--action) 100%);
  border-color: rgba(140, 240, 212, 0.28);
  color: var(--on-action);
  box-shadow: 0 12px 26px -6px rgba(14, 122, 88, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}
.btn-primary::after {
  content: ""; position: absolute; inset: 0; width: 44%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: translateX(-140%); pointer-events: none;
}
.btn-primary:hover::after { animation: shimmerSweep 900ms var(--ease); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 11px; }
.btn-lg { padding: 14px 26px; font-size: 15px; border-radius: 16px; }

.icon-btn {
  width: 40px; height: 40px; padding: 0; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  box-shadow: var(--lift-sm);
  transition: border-color 180ms var(--ease), transform 160ms var(--ease);
}

.card {
  background-color: var(--panel);
  background-image: var(--card-sheen);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--lift);
  transition: transform 260ms var(--ease), border-color 220ms var(--ease), background-color 240ms var(--ease);
}

.brand-lockup { display: inline-flex; align-items: center; gap: 12px; }
.icon-slot { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Bidirectional Scroll Reveal with Hysteresis (zero boundary flicker) */
.reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.988);
  transition: opacity 600ms var(--ease), transform 640ms var(--ease);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Elevated Toast */
.toast {
  position: fixed; right: 24px; bottom: 28px; z-index: 95;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--accent2);
  color: var(--text); font-size: 13.5px; font-weight: 700;
  box-shadow: 0 20px 48px var(--shadow-color);
  opacity: 0; transform: translateY(10px) scale(0.98); pointer-events: none;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }

@media (prefers-reduced-motion: reduce) {
  .comet-frame::before, .iphone-aura { animation: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}
