/* ==========================================================================
   Gran Canaria GO — css/base.css
   1. Design tokens
   2. Reset e fondamenta
   3. Sfondo atmosferico
   4. Tipografia
   5. Utility e accessibilità
   ========================================================================== */

/* ------------------------------------------------------------- 1. Token */

:root {
  /* Superfici notturne */
  --bg-1000: #02080f;
  --bg-900:  #04101d;
  --bg-800:  #06182a;
  --bg-700:  #0a2138;
  --bg-600:  #0e2c49;

  /* Vetro */
  --glass:        rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --glass-deep:   rgba(6, 24, 42, 0.72);
  --border:       rgba(255, 255, 255, 0.10);
  --border-strong:rgba(255, 255, 255, 0.20);

  /* Testo */
  --text:       #eaf5ff;
  --text-muted: #a2bcd2;
  --text-dim:   #6d8aa3;

  /* Palette Gran Canaria */
  --ocean:      #0ea5e9;
  --ocean-deep: #0369a1;
  --turquoise:  #2ee6c5;
  --orange:     #ff8a3d;
  --orange-deep:#ff6a1f;
  --amber:      #fbbf24;
  --violet:     #a78bfa;
  --danger:     #f87171;
  --success:    #34d399;

  /* Gradienti */
  --gradient-brand: linear-gradient(115deg, #2ee6c5 0%, #22c3e6 32%, #3b82f6 62%, #ff8a3d 100%);
  --gradient-cool:  linear-gradient(135deg, #2ee6c5 0%, #0ea5e9 100%);
  --gradient-warm:  linear-gradient(135deg, #ff8a3d 0%, #fbbf24 100%);
  --gradient-deep:  linear-gradient(180deg, #0b2c4a 0%, #04101d 100%);
  --gradient-soft:  linear-gradient(135deg, rgba(46,230,197,.16), rgba(14,165,233,.10) 45%, rgba(255,138,61,.14));

  /* Forme */
  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius:    20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --radius-pill: 999px;

  /* Ombre e luce */
  --shadow-sm:   0 10px 24px -14px rgba(0, 0, 0, 0.75);
  --shadow-soft: 0 24px 60px -30px rgba(0, 0, 0, 0.85);
  --shadow-lift: 0 34px 70px -32px rgba(0, 0, 0, 0.9);
  --glow-cool:   0 22px 60px -28px rgba(14, 165, 233, 0.75);
  --glow-warm:   0 22px 60px -28px rgba(255, 138, 61, 0.7);

  --blur: 20px;
  --blur-strong: 34px;

  /* Misure */
  --container: 1240px;
  --nav-h: 76px;

  /* Movimento */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --speed-fast: 0.18s;
  --speed: 0.32s;
  --speed-slow: 0.6s;

  --font-display: 'Outfit', 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* -------------------------------------------------------- 2. Fondamenta */

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

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  /* Importante: l'overflow orizzontale va bloccato sulla radice (html),
     non sul body. Su body trasformerebbe il body nel contenitore di scroll
     e window.scrollY resterebbe a 0, rompendo il pulsante "torna su",
     lo scroll all'inizio pagina ad ogni cambio rotta e lo stato della navbar. */
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.62;
  color: var(--text);
  background: var(--bg-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.has-modal { overflow: hidden; }

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

button, input, select, textarea { font: inherit; color: inherit; }

button { background: none; border: none; cursor: pointer; }

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

ul, ol { list-style: none; }

::selection { background: rgba(46, 230, 197, 0.32); color: #fff; }

:focus-visible {
  outline: 2px solid var(--turquoise);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.03); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(46, 230, 197, 0.5), rgba(14, 165, 233, 0.5));
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(46, 230, 197, 0.85), rgba(14, 165, 233, 0.85));
  background-clip: content-box;
}

/* -------------------------------------------------- 3. Sfondo atmosferico */

.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(1100px 700px at 12% -6%, rgba(46, 230, 197, 0.16), transparent 62%),
    radial-gradient(900px 620px at 88% 4%, rgba(255, 138, 61, 0.14), transparent 60%),
    radial-gradient(1200px 900px at 50% 108%, rgba(14, 165, 233, 0.20), transparent 65%),
    linear-gradient(180deg, #04101d 0%, #030b14 45%, #02080f 100%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 78%);
}

/* Alone che segue leggermente il puntatore: puro dettaglio premium. */
.bg-glow {
  position: fixed;
  z-index: -1;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(46, 230, 197, 0.11), transparent 68%);
  transform: translate3d(-50%, -50%, 0);
  transition: opacity 0.6s var(--ease);
  opacity: 0;
  will-change: transform;
}
body.has-pointer .bg-glow { opacity: 1; }

/* ---------------------------------------------------------- 4. Tipografia */

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.35rem, 5.6vw, 4.15rem); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.65rem); }
h3 { font-size: clamp(1.22rem, 2.2vw, 1.6rem); }
h4 { font-size: 1.06rem; }

p { color: var(--text-muted); text-wrap: pretty; }

.lead {
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
  color: var(--text-muted);
  max-width: 62ch;
}

strong { color: var(--text); font-weight: 700; }

.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--turquoise);
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient-cool);
}

.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.tiny { font-size: 0.8rem; line-height: 1.5; }

/* ------------------------------------------------------- 5. Utility */

.container {
  width: min(100% - 2.6rem, var(--container));
  margin-inline: auto;
}
@media (max-width: 560px) { .container { width: min(100% - 1.7rem, var(--container)); } }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-sm { display: flex; flex-direction: column; gap: 0.5rem; }
.stack-lg { display: flex; flex-direction: column; gap: 2rem; }
.row { display: flex; align-items: center; gap: 0.75rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.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;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius-pill);
  background: var(--turquoise);
  color: #02202b;
  font-weight: 700;
  transition: top var(--speed) var(--ease);
}
.skip-link:focus { top: 14px; }

/* Vetro riutilizzabile */
.glass {
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
}

/* Animazione di comparsa allo scroll */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

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

@keyframes pulse-ring {
  0%   { transform: scale(0.85); opacity: 0.85; }
  70%  { transform: scale(2.1);  opacity: 0; }
  100% { transform: scale(2.1);  opacity: 0; }
}

@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Riduzione del movimento per chi lo preferisce */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
