@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&display=swap');

:root {
  --ink: #0A1A26;
  --teal: #00C896;
  --teal-mid: #00A87A;
  --alert: #FF4B2B;
  --carta: #F0FAF7;
  --white: #FFFFFF;
  --ring-out-dk: #083A30;
  --ring-mid-dk: #0D6650;
  --ring-out-lt: #B2E8DA;
  --ring-mid-lt: #5DCDB4;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: #0d1f2d;
  color: #fff;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.grain-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: url('https://grainy-gradients.vercel.app/noise.svg');
  opacity: 0.04;
  pointer-events: none;
  z-index: 9999;
}

::selection { background: rgba(0,200,150,0.3); }

.font-editorial { font-family: 'Playfair Display', serif; }
.font-body { font-family: 'DM Sans', sans-serif; }

/* Architectural Grid */
.architectural-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none; z-index: 0;
}

/* Radar Background */
.radar-bg-element {
  position: absolute; pointer-events: none; z-index: 0;
}
.radar-bg-element .radar-inner { width: 100%; height: 100%; position: relative; animation: spin 40s linear infinite; }
.radar-bg-element .ring-outer { position: absolute; inset: 0; border: 2px solid rgba(0,200,150,0.15); border-radius: 50%; }
.radar-bg-element .ring-mid { position: absolute; inset: 20%; border: 2px solid rgba(0,200,150,0.25); border-radius: 50%; animation: spin-reverse 50s linear infinite; }
.radar-bg-element .ring-inner { position: absolute; inset: 40%; border: 2px solid rgba(0,200,150,0.4); border-radius: 50%; border-style: dashed; }
.radar-bg-element .radar-sweep {
  position: absolute; top: 50%; left: 50%; width: 50%; height: 1px;
  background: linear-gradient(to right, transparent, rgba(0,200,150,0.4));
  transform-origin: left center; animation: radar-scan 6s linear infinite;
}
.radar-bg-element .radar-glow {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; height: 100%; background: rgba(0,200,150,0.05); border-radius: 50%; filter: blur(80px);
}

/* Animations */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes spin-reverse { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }
@keyframes radar-scan { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

@keyframes sweep-vertical {
  0%, 100% { transform: translateY(-100%); opacity: 0; }
  50% { transform: translateY(100%); opacity: 1; }
}

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

@keyframes soft-pulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(0,200,150,0.5)); }
  50% { filter: drop-shadow(0 0 2px rgba(0,200,150,0.1)); }
}

@keyframes gentle-scan {
  0% { transform: translateX(-100%) skewX(-15deg); opacity: 0; }
  10%, 90% { opacity: 0.1; }
  100% { transform: translateX(200%) skewX(-15deg); opacity: 0; }
}

.animate-soft-float { animation: soft-float 8s ease-in-out infinite; }
.animate-soft-pulse { animation: soft-pulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

.premium-card-hover {
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1) !important;
  position: relative;
  overflow: hidden;
}
.premium-card-hover::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent, rgba(0,200,150,0.03), transparent);
  transform: translateX(-100%) skewX(-15deg);
  pointer-events: none;
}
.premium-card-hover:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 30px 60px -15px rgba(0, 200, 150, 0.12), inset 0 0 0 1px rgba(0, 200, 150, 0.2);
  border-color: rgba(0, 200, 150, 0.3);
}
.premium-card-hover:hover::before {
  animation: gentle-scan 2s ease-in-out;
}

.btn-premium {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.btn-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(0, 200, 150, 0.3);
}
.btn-premium:active {
  transform: scale(0.98);
}


/* Scroll Reveal */
.reveal-on-scroll {
  opacity: 0; transform: translateY(50px);
  transition: opacity 1.2s cubic-bezier(0.16,1,0.3,1), transform 1.2s cubic-bezier(0.16,1,0.3,1);
  will-change: opacity, transform;
}
.reveal-on-scroll.is-visible { opacity: 1; transform: translateY(0); }
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }

/* Tumbler 3D Scanner */
.scan-text-container {
  position: relative; height: 110px; width: 100%;
  display: flex; align-items: center; justify-content: center; perspective: 1200px;
}
.scan-text-item {
  position: absolute; width: 100%; display: flex; justify-content: center; align-items: center;
  transition: all 1s cubic-bezier(0.25,1,0.5,1);
  opacity: 0; transform: translateY(30px) rotateX(-40deg) scale(0.9);
  filter: blur(8px); pointer-events: none;
}
.scan-text-item.active {
  opacity: 1; transform: translateY(0) rotateX(0deg) scale(1);
  filter: drop-shadow(0 0 10px rgba(0,200,150,0.4)) blur(0px);
  pointer-events: auto; z-index: 10;
}
.scan-text-item.prev {
  opacity: 0; transform: translateY(-30px) rotateX(40deg) scale(1.1); filter: blur(8px);
}

.scanner-sweep-vertical {
  position: absolute; inset: -20px 0;
  background: linear-gradient(to bottom, transparent 45%, rgba(0,200,150,0.6) 50%, transparent 55%);
  mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
  animation: sweep-vertical 3s ease-in-out infinite;
  mix-blend-mode: screen; pointer-events: none; z-index: 30;
}

/* Badge */
.badge {
  display: inline-block; background: rgba(0,200,150,0.1);
  padding: 6px 16px; border-radius: 9999px;
  border: 1px solid rgba(0,200,150,0.2);
  box-shadow: 0 0 15px rgba(0,200,150,0.1);
  font-size: 10px; font-weight: 700; letter-spacing: 3px;
  color: var(--teal); text-transform: uppercase;
  font-family: 'DM Sans', sans-serif;
}

/* Accent Bar */
.accent-bar {
  width: 6px; min-height: 40px; background: var(--teal);
  border-radius: 9999px; flex-shrink: 0; align-self: stretch;
}

/* Separator */
.separator-line { width: 48px; height: 2px; background: var(--teal); border-radius: 9999px; }
.separator-sub { width: 100%; height: 1px; background: var(--ring-out-dk); border-radius: 9999px; margin-top: 12px; }

/* Data Bars */
.data-bar { width: 100%; margin-bottom: 12px; }
.data-bar-track {
  width: 100%; height: 32px; background: rgba(255,255,255,0.05);
  border-radius: 4px; position: relative; display: flex;
  align-items: center; padding: 0 12px; border: 1px solid rgba(255,255,255,0.05);
}
.data-bar-fill {
  position: absolute; top: 0; left: 0; height: 100%; border-radius: 4px;
}
.data-bar-fill.primary { background: var(--teal); opacity: 0.75; }
.data-bar-fill.secondary { background: var(--ring-mid-dk); }
.data-bar-labels {
  position: relative; z-index: 10; font-size: 13px; font-weight: 700;
  color: #fff; letter-spacing: 0.05em; width: 100%;
  display: flex; justify-content: space-between;
}
.data-bar-labels .value-primary { color: #0A1A26; font-weight: 900; }
.data-bar-labels .value-secondary { color: var(--teal); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(6,15,22,0.9);
  backdrop-filter: blur(12px); cursor: pointer;
}
.modal-content {
  position: relative; width: 100%; max-width: 768px;
  border-radius: 16px; padding: 32px 48px;
  max-height: 85vh; overflow-y: auto;
  animation: modal-in 0.3s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.modal-hidden { display: none; }

/* Utility */
.text-teal { color: var(--teal); }
.bg-ink { background: var(--ink); }
.bg-carta { background: var(--carta); }
.text-ink { color: var(--ink); }

/* =============================================
   PAGE SCAN LINE — striscia orizzontale teal
   che scende lentamente, effetto sorveglianza
   ============================================= */
@keyframes page-scan {
  0%   { top: -2px; opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 0.6; }
  100% { top: 100vh; opacity: 0; }
}

.page-scan-line {
  position: fixed;
  left: 0; width: 100%; height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0,200,150,0.06) 10%,
    rgba(0,200,150,0.38) 50%,
    rgba(0,200,150,0.06) 90%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 9997;
  animation: page-scan 10s linear infinite;
}

/* =============================================
   CURSOR CROSSHAIR — mirino teal desktop
   ============================================= */
.cursor-xhair {
  position: fixed;
  width: 44px; height: 44px;
  pointer-events: none;
  z-index: 9996;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.cursor-xhair.visible { opacity: 1; }

.ch-h {
  position: absolute;
  width: 100%; height: 1px;
  top: 50%; transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, rgba(0,200,150,0.6), transparent);
}
.ch-v {
  position: absolute;
  height: 100%; width: 1px;
  left: 50%; transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(0,200,150,0.6), transparent);
}
.ch-dot {
  position: absolute;
  width: 3px; height: 3px;
  background: rgba(0,200,150,0.95);
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px rgba(0,200,150,0.8);
}

/* =============================================
   LIQUID GLASS CARD — Apple visionOS style
   ============================================= */
.glass-card {
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  background: linear-gradient(
    145deg,
    rgba(255,255,255,0.055) 0%,
    rgba(255,255,255,0.02) 60%,
    rgba(0,200,150,0.015) 100%
  ) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.07) inset,
    0 24px 48px -12px rgba(0,0,0,0.45),
    0 0 0 0.5px rgba(0,200,150,0.08);
  transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.glass-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(255,255,255,0.18) 40%, rgba(255,255,255,0.22) 60%, transparent 95%);
  pointer-events: none;
  z-index: 2;
  border-radius: inherit;
}

.glass-card:hover {
  background: linear-gradient(
    145deg,
    rgba(255,255,255,0.08) 0%,
    rgba(255,255,255,0.03) 60%,
    rgba(0,200,150,0.04) 100%
  ) !important;
  box-shadow:
    0 0 0 1px rgba(0,200,150,0.25) inset,
    0 32px 64px -16px rgba(0,0,0,0.5),
    0 0 60px -10px rgba(0,200,150,0.12),
    0 0 0 0.5px rgba(0,200,150,0.2);
  transform: translateY(-6px) scale(1.005) !important;
  border-color: rgba(0,200,150,0.3) !important;
}

/* =============================================
   3D TILT CARD — perspective tilt on hover
   ============================================= */
.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.25s ease-out, box-shadow 0.25s ease-out;
  will-change: transform;
}

/* =============================================
   RADAR HERO — dynamic pulse + glow
   replaces banal soft-float
   ============================================= */
@keyframes radar-hero-pulse {
  0%   {
    transform: scale(1) rotate(0deg);
    filter: drop-shadow(0 0 15px rgba(0,200,150,0.08));
    opacity: 0.35;
  }
  20%  {
    transform: scale(1.07) rotate(72deg);
    filter: drop-shadow(0 0 55px rgba(0,200,150,0.38));
    opacity: 0.5;
  }
  40%  {
    transform: scale(1.02) rotate(144deg);
    filter: drop-shadow(0 0 30px rgba(0,200,150,0.15));
    opacity: 0.38;
  }
  60%  {
    transform: scale(1.09) rotate(216deg);
    filter: drop-shadow(0 0 70px rgba(0,200,150,0.42));
    opacity: 0.52;
  }
  80%  {
    transform: scale(1.01) rotate(288deg);
    filter: drop-shadow(0 0 20px rgba(0,200,150,0.1));
    opacity: 0.33;
  }
  100% {
    transform: scale(1) rotate(360deg);
    filter: drop-shadow(0 0 15px rgba(0,200,150,0.08));
    opacity: 0.35;
  }
}

.animate-radar-hero {
  animation: radar-hero-pulse 18s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  transform-origin: center center;
}
