/* ============================================================================
   EMIL KOWALSKI DESIGN-ENGINEERING LAYER (emil-design-eng / apple-design / sonner)
   Applied across Quiz -> Game -> Examiner Report -> Native Checkout
   ============================================================================ */
:root {
  --ease-out-emil: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-in-out-emil: cubic-bezier(0.77, 0, 0.175, 1);
}

/* 1. Optical Typography & Antialiasing */
html, body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .q-title, .rep-hero-title, .rep-offer-title {
  text-wrap: balance;
  letter-spacing: -0.02em;
}

.q-count, .timer-pill, .rep-topbar-timer, .rep-gauge-center b,
.rep-price-big, .ck-total-line b, .pix-amount-big, #pts, #lives b {
  font-variant-numeric: tabular-nums;
}

/* 2. Drawer / Sheet Physics (Vaul / Apple curve — snappy 280ms, zero overshoot) */
.sheet {
  animation: emilSheetUp 280ms var(--ease-drawer) both !important;
  will-change: transform, opacity;
}
@keyframes emilSheetUp {
  from { transform: translate3d(0, 28px, 0); opacity: 0; }
  to { transform: translate3d(0, 0, 0); opacity: 1; }
}

/* 3. Never scale(0) or scale(0.2) — Natural Enter from scale(0.96) */
@keyframes emilPop {
  from { transform: scale(0.96) translate3d(0, 6px, 0); opacity: 0; }
  to { transform: scale(1) translate3d(0, 0, 0); opacity: 1; }
}
@keyframes emilCardEnter {
  from { transform: translate3d(0, 10px, 0) scale(0.985); opacity: 0; }
  to { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
}
.q-card {
  animation: emilCardEnter 240ms var(--ease-out-emil) both !important;
  will-change: transform, opacity;
}
.q-feedback {
  animation: emilPop 220ms var(--ease-out-emil) both !important;
}
.stamp {
  animation: emilStamp 260ms var(--ease-out-emil) both !important;
}
@keyframes emilStamp {
  from { transform: scale(1.18) rotate(-5deg); opacity: 0; }
  to { transform: scale(1) rotate(-3deg); opacity: 1; }
}

/* Staggered Quiz Option Entrance (30ms steps, subtle 6px lift) */
.q-opt {
  animation: emilOptIn 220ms var(--ease-out-emil) both;
  transition: transform 150ms var(--ease-out-emil), border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}
.q-opt:nth-of-type(1) { animation-delay: 20ms; }
.q-opt:nth-of-type(2) { animation-delay: 55ms; }
.q-opt:nth-of-type(3) { animation-delay: 90ms; }
.q-opt:nth-of-type(4) { animation-delay: 125ms; }
@keyframes emilOptIn {
  from { transform: translate3d(0, 8px, 0); opacity: 0; }
  to { transform: translate3d(0, 0, 0); opacity: 1; }
}
.q-opt:active {
  transform: scale(0.975) !important;
}

/* Smooth Progress Bar Fill */
.q-bar-fill {
  transition: width 320ms var(--ease-out-emil) !important;
}

/* 4. Tactile Press Feedback (scale 0.97) + Inner Hairline Highlights (Linear/Vercel craft) */
.btn, .rep-cta-main, .rep-cta-gold, .ck-cta, .ck-tab, .ck-bump, .pin.locked-btn {
  transition: transform 150ms var(--ease-out-emil), background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease !important;
}
.btn:active, .rep-cta-main:active, .rep-cta-gold:active, .ck-cta:active, .ck-tab:active {
  transform: scale(0.97) !important;
}
.ck-bump:active {
  transform: scale(0.985) !important;
}

/* Refined Specular Sheen on Primary CTAs (replaces noisy infinite pulse rings!) */
.btn.pulse, .rep-cta-main.pulse {
  animation: none !important;
  position: relative;
  overflow: hidden;
}
.btn.pulse::after, .rep-cta-main.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.26) 50%, transparent 75%);
  transform: translate3d(-120%, 0, 0);
  animation: emilSheen 3.6s var(--ease-in-out-emil) infinite;
  pointer-events: none;
}
@keyframes emilSheen {
  0%, 62% { transform: translate3d(-120%, 0, 0); }
  100% { transform: translate3d(130%, 0, 0); }
}

/* Hairline Top Inner Highlights on Dark Surfaces */
.cover-box, .loader-box, .rep-vis-card, .rep-offer-card, .rep-guar-card, .ck-card, .faq-item {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 28px rgba(0, 0, 0, 0.35) !important;
}

/* 5. Sonner-Grade Geo Toast (Compact Bottom-Left Smooth Enter + Exit) */
.geo-toast {
  animation: sonnerIn 260ms var(--ease-out-emil) both !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 26px rgba(0, 0, 0, 0.55) !important;
  will-change: transform, opacity;
}
.geo-toast.leaving {
  animation: sonnerOut 200ms var(--ease-out-emil) forwards !important;
}
@keyframes sonnerIn {
  from { transform: translate3d(0, 12px, 0) scale(0.96); opacity: 0; }
  to { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
}
@keyframes sonnerOut {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
  to { transform: translate3d(0, 10px, 0) scale(0.96); opacity: 0; }
}

/* 6. Smooth Score Gauge Draw-In Animation */
.rep-gauge-val {
  transition: stroke-dasharray 680ms var(--ease-out-emil);
}

/* 7. Crisp UGC Play Button Hover/Press + Video Scale */
.ugc-play-btn span {
  transition: transform 160ms var(--ease-out-emil), background-color 160ms ease;
}
.ugc-video-box:active .ugc-play-btn span {
  transform: scale(0.9);
}

/* 8. Accessibility: Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
