/* ==============================================================================
   KRYSKAFLOW — Base Reset, Accessibility & Dual-Canvas Isolation
   ============================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg-base);
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-body);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

button,
input {
  font-family: inherit;
  color: inherit;
}

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

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--text-heading);
  letter-spacing: -0.03em;
}

/* Tabular figures across telemetry and pricing */
.tabular {
  font-variant-numeric: tabular-nums;
}

/* Accessibility & Keyboard Focus */
:focus-visible {
  outline: 2px solid var(--accent-indigo);
  outline-offset: 2px;
}

[inert],
[inert] * {
  opacity: 0.5;
  cursor: default;
  user-select: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Layout Container (Fluid padding without fixed blowout) */
.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(16px, 3vw, 32px);
}

.container-narrow {
  max-width: 880px;
}

/* Regional Pre-Paint Currency Hydration Helpers (Zero Cross-Currency Flash) */
html[data-region="in"] [data-currency-only="USD"],
html[data-region="global"] [data-currency-only="INR"] {
  display: none !important;
}

/* Dual-Canvas Responsive Isolation */
@media (max-width: 1024px) {
  .desktop-only {
    display: none !important;
  }
}

@media (min-width: 1025px) {
  .mobile-only {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .phone-only {
    display: none !important;
  }
}

body.force-desktop .phone-only,
body.force-desktop .mobile-only {
  display: none !important;
}

:root {
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}

@media (max-width: 768px) {
  html {
    scroll-padding-top: calc(74px + var(--sat));
    scroll-padding-bottom: calc(88px + var(--sab));
  }

  body:not(.force-desktop) {
    padding-bottom: calc(84px + var(--sab));
  }

  a,
  button,
  summary,
  input,
  [role="button"] {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  h1,
  h2,
  h3 {
    text-wrap: balance;
  }

  p,
  li {
    text-wrap: pretty;
  }
}

@media (pointer: coarse) {
  .chip-keyword,
  .matcher-chip,
  .acc-btn,
  .niche-tab-btn,
  .btn-sim-run,
  .faq-accordion-summary,
  .btn-version-pill {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .faq-accordion-summary {
    display: flex;
    justify-content: space-between;
  }

  .sim-wm-style-btn {
    position: relative;
    min-height: 36px;
  }

  .sim-wm-style-btn::after {
    content: "";
    position: absolute;
    inset: -4px 0;
  }

  .ios-switch::after {
    content: "";
    position: absolute;
    inset: -7px 0;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .navbar-studio,
  .mobile-bottom-dock,
  .hero-phone-dm-pill,
  .sim-watermark-panel {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #FFFFFF !important;
  }
}

/* Gradient Border Flashlight Utility Base */
.flash-card {
  position: relative;
}

.flash-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.24s ease;
  background: radial-gradient(
    255px circle at var(--fx, -500px) var(--fy, -500px),
    rgba(67, 56, 202, 0.08),
    transparent 70%
  );
  z-index: 2;
}

.flash-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    220px circle at var(--fx, -500px) var(--fy, -500px),
    rgba(67, 56, 202, 0.45),
    rgba(15, 23, 42, 0.06) 60%,
    transparent 85%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.flash-card[data-lit="true"] .flash-overlay {
  opacity: 1;
}

@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  .flash-overlay {
    display: none !important;
  }
}

/* ==============================================================================
   Shared Liquid-Glass Pill Capsule & Zero-Reflow Glider Template
   Reused across index, pricing, hall-of-fame, leaderboard, and mobile dock.
   ============================================================================== */
.kf-pill-group,
.hof-liquid-pill-capsule,
.hof-scope-group,
.hof-track-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: rgba(241, 245, 249, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 8px 22px -8px rgba(15, 23, 42, 0.11),
    0 2px 6px rgba(15, 23, 42, 0.04),
    inset 0 1px 1px rgba(15, 23, 42, 0.06),
    inset 0 -1px 0 rgba(255, 255, 255, 0.92);
  max-width: 100%;
}

.kf-glider,
.hof-liquid-glider,
.cycle-glider,
.agency-cycle-glider,
#niche-glider,
.sim-wm-glider,
.mob-dock-glider {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.99) 0%,
    rgba(248, 250, 252, 0.96) 58%,
    rgba(241, 245, 249, 0.98) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.96);
  box-shadow:
    0 6px 16px -4px rgba(15, 23, 42, 0.14),
    0 2px 5px rgba(15, 23, 42, 0.06),
    inset 0 1.5px 1px rgba(255, 255, 255, 1),
    inset 0 -1px 1px rgba(15, 23, 42, 0.05);
  transform-origin: 0 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  will-change: transform;
  opacity: 0;
}

.kf-glider::before,
.hof-liquid-glider::before,
.cycle-glider::before,
.agency-cycle-glider::before,
#niche-glider::before,
.sim-wm-glider::before,
.mob-dock-glider::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 8%;
  right: 8%;
  height: 46%;
  border-radius: var(--radius-pill);
  background: radial-gradient(
    90% 100% at 50% 0%,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(255, 255, 255, 0.18) 58%,
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
}

/* Color Variant: Obsidian Dark (#0F172A) */
.kf-glider--dark,
.hof-liquid-glider--dark,
#niche-glider,
.sim-wm-glider {
  background: linear-gradient(155deg, rgba(30, 41, 59, 0.96) 0%, rgba(15, 23, 42, 0.98) 100%);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    0 8px 18px -4px rgba(15, 23, 42, 0.28),
    0 2px 5px rgba(15, 23, 42, 0.14),
    inset 0 1px 0.5px rgba(255, 255, 255, 0.24);
}

.kf-glider--dark::before,
.hof-liquid-glider--dark::before,
#niche-glider::before,
.sim-wm-glider::before {
  background: radial-gradient(
    90% 100% at 50% 0%,
    rgba(255, 255, 255, 0.28) 0%,
    rgba(255, 255, 255, 0.05) 60%,
    transparent 100%
  );
}

/* Color Variant: Kryska Crimson Red (#FF1E27) */
.kf-glider--red,
.hof-liquid-glider--red {
  background: linear-gradient(155deg, #FF3B42 0%, #FF1E27 58%, #E60023 100%);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    0 8px 18px -4px rgba(255, 30, 39, 0.34),
    0 2px 6px rgba(255, 30, 39, 0.16),
    inset 0 1px 0.5px rgba(255, 255, 255, 0.36);
}

.kf-glider--red::before,
.hof-liquid-glider--red::before {
  background: radial-gradient(
    90% 100% at 50% 0%,
    rgba(255, 255, 255, 0.34) 0%,
    rgba(255, 255, 255, 0.06) 60%,
    transparent 100%
  );
}

/* Color Variant: Agency Light Pill on Dark Emerald Canvas */
.agency-cycle-glider {
  box-shadow:
    0 6px 16px -2px rgba(0, 0, 0, 0.40),
    0 2px 6px rgba(0, 0, 0, 0.22),
    inset 0 1.5px 1px rgba(255, 255, 255, 1),
    inset 0 -1px 1px rgba(15, 23, 42, 0.08);
}

/* Shared Founding 2000 Obsidian Celestial Starlight Accent */
@keyframes kfStarTwinkle {
  0%, 100% { opacity: 0.22; transform: scale(0.86); }
  50% { opacity: 0.88; transform: scale(1.08); }
}

.kf-celestial-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.kf-star {
  position: absolute;
  color: #FDE68A;
  will-change: opacity, transform;
}

.kf-star--1 { top: 18px; right: 86px; animation: kfStarTwinkle 3.8s ease-in-out infinite; }
.kf-star--2 { top: 46px; right: 28px; animation: kfStarTwinkle 4.4s ease-in-out 0.9s infinite; }
.kf-star--3 { bottom: 38px; right: 56px; animation: kfStarTwinkle 3.4s ease-in-out 1.6s infinite; }
.kf-star--4 { top: 68px; left: 48px; color: #E2E8F0; animation: kfStarTwinkle 4.8s ease-in-out 2.1s infinite; }

.kf-founding-modal-head {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(110% 90% at 90% 10%, rgba(251, 191, 36, 0.16) 0%, rgba(15, 23, 42, 0) 60%),
    linear-gradient(155deg, #090D16 0%, #0F172A 68%, #172136 100%);
  padding: 24px;
  color: #FFFFFF;
}

.kf-founding-modal-head > *:not(.kf-celestial-stars) {
  position: relative;
  z-index: 2;
}

/* Motion Safety: Preserve visible settled final state */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
  .kf-star {
    animation: none !important;
    opacity: 0.65;
  }
}
