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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background-color: #0a0b0d;
  color: #e4e4e7;
  overflow-x: hidden;
}

.font-display {
  font-family: 'Syne', system-ui, sans-serif;
}

.font-mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* Ambient layers */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 70%);
}

.glow-ember {
  position: absolute;
  width: min(520px, 90vw);
  height: min(520px, 90vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 163, 23, 0.12) 0%, rgba(196, 30, 58, 0.04) 45%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
}

.glow-ember--hero {
  top: -10%;
  right: -5%;
}

.glow-ember--section {
  bottom: -20%;
  left: -10%;
}

/* Glass surfaces */
.glass-panel {
  background: rgba(18, 20, 26, 0.55);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 24px 48px rgba(0, 0, 0, 0.35);
}

.glass-panel--elevated {
  background: rgba(22, 24, 32, 0.72);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 32px 64px rgba(0, 0, 0, 0.45);
}

/* Hero radar mock */
.radar-mock {
  position: relative;
  aspect-ratio: 1;
  max-width: 420px;
  margin-left: auto;
}

.radar-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(232, 163, 23, 0.15);
}

.radar-ring:nth-child(2) { inset: 12%; }
.radar-ring:nth-child(3) { inset: 24%; }
.radar-ring:nth-child(4) { inset: 36%; }

.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(232, 163, 23, 0.25) 40deg, transparent 80deg);
  animation: radar-sweep 4s linear infinite;
}

@keyframes radar-sweep {
  to { transform: rotate(360deg); }
}

.crosshair-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
}

.crosshair-center::before,
.crosshair-center::after {
  content: '';
  position: absolute;
  background: #e8a317;
}

.crosshair-center::before {
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  transform: translateY(-50%);
}

.crosshair-center::after {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-50%);
}

.radar-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c41e3a;
  box-shadow: 0 0 12px rgba(196, 30, 58, 0.8);
  animation: pulse-dot 2s ease-in-out infinite;
}

.radar-dot--1 { top: 22%; left: 68%; animation-delay: 0s; }
.radar-dot--2 { top: 58%; left: 28%; animation-delay: 0.4s; }
.radar-dot--3 { top: 72%; left: 62%; animation-delay: 0.8s; }

@keyframes pulse-dot {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

@media (prefers-reduced-motion: reduce) {
  .radar-sweep { animation: none; opacity: 0.3; }
  .radar-dot { animation: none; }
}

/* Float animation */
.float-subtle {
  animation: float-subtle 6s ease-in-out infinite;
}

@keyframes float-subtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Tab panel */
.tab-panel[hidden] {
  display: none;
}

/* Pricing popular */
.pricing-card--popular {
  border-color: rgba(232, 163, 23, 0.45);
  box-shadow: 0 0 0 1px rgba(232, 163, 23, 0.2), 0 24px 48px rgba(232, 163, 23, 0.08);
}

/* Lang toggle */
.lang-btn[aria-pressed="true"] {
  background: rgba(232, 163, 23, 0.2);
  color: #e8a317;
  border-color: rgba(232, 163, 23, 0.4);
}

/* Focus */
:focus-visible {
  outline: 2px solid #e8a317;
  outline-offset: 2px;
}

/* FAQ */
.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
}

.faq-chevron {
  transition: transform 0.3s ease;
}

/* Nav scrolled */
.nav-scrolled {
  background: rgba(10, 11, 13, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Device frame */
.device-frame {
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 12px 8px;
  background: linear-gradient(180deg, #161820 0%, #0f1115 100%);
  min-width: 100px;
}

.device-notch {
  width: 40%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  margin: 0 auto 8px;
}

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(16px);
}

.stagger-children.is-visible > * {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.is-visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.is-visible > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.is-visible > *:nth-child(4) { transition-delay: 0.2s; }

/* App pages */
.page-main {
  position: relative;
  z-index: 10;
  min-height: auto;
  padding-top: 6rem;
  padding-bottom: 4rem;
}

.auth-card,
.checkout-card {
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  color: #94a3b8;
  margin-bottom: 0.375rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 11, 13, 0.6);
  color: #f4f4f5;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: rgba(232, 163, 23, 0.5);
}

.form-error {
  color: #c41e3a;
  font-size: 0.875rem;
}

/* Plan modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 60;
}

.plan-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  pointer-events: none;
}

.plan-modal:not(.hidden) {
  pointer-events: auto;
}

.plan-modal__panel {
  width: 100%;
  max-width: 26rem;
  pointer-events: auto;
}

.platform-btn {
  flex: 1;
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 11, 13, 0.5);
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.platform-btn:hover {
  border-color: rgba(232, 163, 23, 0.35);
}

.platform-btn--active {
  border-color: rgba(232, 163, 23, 0.55);
  background: rgba(232, 163, 23, 0.1);
  box-shadow: 0 0 0 1px rgba(232, 163, 23, 0.2);
}

.platform-btn[aria-pressed="true"] {
  border-color: rgba(232, 163, 23, 0.55);
  background: rgba(232, 163, 23, 0.1);
}

/* Payment options */
.payment-option {
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.payment-option:hover {
  border-color: rgba(232, 163, 23, 0.3);
}

.payment-option--active {
  border-color: rgba(232, 163, 23, 0.5);
  background: rgba(232, 163, 23, 0.08);
}

.cart-count-badge {
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.25rem;
  font-size: 0.625rem;
  line-height: 1.125rem;
  text-align: center;
  border-radius: 9999px;
  background: #c41e3a;
  color: #fff;
  font-weight: 700;
}

/* Mobile drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 20rem);
  z-index: 80;
  background: rgba(14, 16, 22, 0.98);
  backdrop-filter: blur(16px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.3s ease;
  padding: 1rem 1.25rem 2rem;
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
}

.mobile-drawer.translate-x-full {
  transform: translateX(100%);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 75;
  background: rgba(0, 0, 0, 0.6);
}

/* Mobile bottom bar */
.mobile-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  background: rgba(10, 11, 13, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem 1rem;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
  .mobile-bottom-bar {
    display: none;
  }
}

.has-mobile-bar main,
.has-mobile-bar .page-main {
  padding-bottom: 5.5rem;
}

@media (min-width: 768px) {
  .has-mobile-bar main,
  .has-mobile-bar .page-main {
    padding-bottom: inherit;
  }
}

/* Toast */
.dgk-toast {
  position: fixed;
  left: 50%;
  bottom: max(5.5rem, calc(4.5rem + env(safe-area-inset-bottom)));
  transform: translateX(-50%) translateY(1rem);
  z-index: 90;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  background: rgba(22, 24, 32, 0.95);
  border: 1px solid rgba(232, 163, 23, 0.35);
  color: #f4f4f5;
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: calc(100vw - 2rem);
  text-align: center;
}

@media (min-width: 768px) {
  .dgk-toast {
    bottom: 2rem;
  }
}

.dgk-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Touch targets */
.btn-touch {
  min-height: 2.75rem;
  min-width: 2.75rem;
}

/* Hero mobile */
@media (max-width: 767px) {
  .hero-title {
    max-width: none;
    font-size: clamp(1.75rem, 8vw, 2.5rem);
  }

  .radar-mock {
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
  }

  .trust-strip li {
    text-align: left;
  }

  .plan-modal {
    align-items: flex-end;
    padding: 0;
  }

  .plan-modal__panel {
    max-width: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
  }

  .platform-btn {
    padding: 1.125rem 0.75rem;
    min-height: 3.5rem;
  }
}

/* Shorter brand on very small screens */
@media (max-width: 380px) {
  .brand-long {
    display: none;
  }
  .brand-short {
    display: inline;
  }
}

@media (min-width: 381px) {
  .brand-short {
    display: none;
  }
}
