/* ============================================================
   TapMe — palette Anna e Marco ETS
   Giallo #FFCB00 · Celeste #45B5E8 · Bianco #FFFFFF · Nero #111111
   Font: Fraunces (display) · Inter (body) · JetBrains Mono (data)
   ============================================================ */

:root {
  --brand: #FFCB00;
  /* giallo vivace — primary */
  --brand-deep: #E6B500;
  --brand-light: #FFE566;
  --accent: #45B5E8;
  /* celeste — bottoni e interattivi */
  --accent-deep: #2E9FD4;
  --warm: #FFD700;
  /* giallo caldo — micro accent */
  --ink: #111111;
  --ink-soft: #4A4A4A;
  --paper: #FFFFFF;
  --paper-soft: #FAFAFA;
  --paper-deep: #F0F0F0;
  --ease-magnet: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--brand);
  color: var(--paper);
}

/* ===== Overlay rumore globale ===== */
.noise-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
  opacity: 0.04;
  mix-blend-mode: multiply;
}

.mono-tag {
  letter-spacing: 0.18em;
}

em {
  font-style: italic;
}

/* ===== A. NAVBAR ===== */
#navbar .nav-pill {
  background: transparent;
  border: 1px solid transparent;
  transition: background-color 0.4s var(--ease-magnet),
    backdrop-filter 0.4s var(--ease-magnet),
    border-color 0.4s var(--ease-magnet),
    color 0.4s var(--ease-magnet),
    box-shadow 0.4s var(--ease-magnet);
  color: var(--paper);
}

#navbar.is-scrolled .nav-pill {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-color: rgba(255, 203, 0, 0.30);
  color: var(--ink);
  box-shadow: 0 8px 24px -12px rgba(255, 203, 0, 0.20);
}

#navbar .nav-link {
  color: inherit;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

#navbar .nav-link:hover {
  opacity: 1;
  transform: translateY(-1px);
  background: rgba(69, 181, 232, 0.12);
}

#navbar .logo-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  background: var(--brand);
  opacity: 0.3;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.3;
  }

  50% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* ===== Bottoni magnetici ===== */
.btn-magnetic {
  transition: transform 0.4s var(--ease-magnet), box-shadow 0.4s var(--ease-magnet);
  will-change: transform;
}

.btn-magnetic:hover {
  transform: scale(1.03) translateY(-1px);
  box-shadow: 0 12px 28px -10px rgba(69, 181, 232, 0.45);
}

.btn-magnetic .btn-bg {
  transition: transform 0.5s var(--ease-magnet);
}

.btn-magnetic:hover .btn-bg {
  transform: translateX(0);
}

/* ===== B. HERO ===== */
.hero-image {
  background-image: url("https://images.unsplash.com/photo-1559131397-f94da358f7ca?w=1920&auto=format&fit=crop&q=80");
  background-size: cover;
  background-position: center 30%;
  filter: saturate(0.9) brightness(0.92);
  will-change: transform;
}

@media (max-width: 768px) {
  .hero-image {
    background-position: center;
  }
}

/* fallback gradient blu se l'immagine non carica */
.hero-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 60%, #FFE566 0%, #FFCB00 40%, #111111 100%);
  z-index: -1;
}

/* ===== C. FEATURES ===== */
.feature-card {
  transition: transform 0.4s var(--ease-magnet);
}

.feature-card:hover {
  transform: translateY(-4px);
}

/* Card 1 — Tap stage */
.tap-stage {
  background: radial-gradient(circle at center, rgba(255, 203, 0, 0.15), transparent 70%);
  border-radius: 1.5rem;
}

.tap-circle {
  z-index: 3;
  transition: transform 0.3s var(--ease-bounce), box-shadow 0.3s ease;
  box-shadow: 0 10px 30px -8px rgba(255, 203, 0, 0.55);
}

.tap-circle.is-firing {
  transform: scale(0.92);
}

.tap-rings {
  z-index: 1;
}

.tap-ring {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  opacity: 0;
}

.tap-ring.is-firing {
  animation: tapRing 1.4s var(--ease-magnet) forwards;
}

@keyframes tapRing {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }

  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

.tap-contacts {
  pointer-events: none;
}

.tap-contact {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--paper);
  border: 1.5px solid var(--brand-light);
  color: var(--brand);
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s var(--ease-bounce), background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  z-index: 2;
}

.tap-contact.is-receiving {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
  transform: scale(1.18);
}

/* Card 2 — Live Feed */
.feed-stage {
  position: relative;
}

#feed-output .feed-line {
  display: block;
  opacity: 0;
  transform: translateY(6px);
}

#feed-output .feed-line.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#feed-output .feed-line .feed-time {
  color: var(--accent);
  margin-right: 8px;
}

#feed-output .feed-line .feed-name {
  color: var(--accent-deep);
  font-weight: 500;
}

#feed-output .feed-cursor {
  display: inline-block;
  width: 7px;
  height: 12px;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 1s steps(2) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Card 3 — Reverse Ping (sostituisce phone demo) */
.reverse-stage {
  background: radial-gradient(circle at center, rgba(255, 203, 0, 0.10), transparent 70%);
  border-radius: 1.5rem;
}

.reverse-user,
.reverse-friend {
  position: absolute;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  z-index: 2;
}

.reverse-user {
  width: 56px;
  height: 56px;
  background: var(--brand);
  color: var(--ink);
  border: 2px solid var(--brand-deep);
  font-size: 0.85rem;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.reverse-friend {
  width: 32px;
  height: 32px;
  background: var(--paper);
  color: var(--accent);
  border: 1.5px solid rgba(69, 181, 232, 0.40);
  font-size: 0.72rem;
  transition: transform 0.3s var(--ease-bounce), background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.reverse-user.is-pinged {
  animation: reversePulse 0.7s var(--ease-bounce);
}

@keyframes reversePulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }

  40% {
    transform: translate(-50%, -50%) scale(1.18);
    box-shadow: 0 0 0 18px rgba(255, 203, 0, 0.25);
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 0 rgba(255, 203, 0, 0);
  }
}

.reverse-friend.is-sending {
  background: var(--warm);
  border-color: var(--warm);
  color: var(--ink);
  transform: scale(1.15);
}

.reverse-arrows {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.reverse-arrows path {
  fill: none;
  stroke: var(--warm);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  stroke-linecap: round;
  opacity: 0;
}

.reverse-arrows path.is-active {
  animation: dashFlow 1.2s linear forwards;
}

@keyframes dashFlow {
  0% {
    opacity: 0;
    stroke-dashoffset: 40;
  }

  20% {
    opacity: 0.85;
  }

  100% {
    opacity: 0;
    stroke-dashoffset: 0;
  }
}

/* ===== Mini-features row (i 2 punti minori sotto le 3 card) ===== */
.mini-feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 22px;
  background: var(--paper-soft);
  border: 1px solid rgba(255, 203, 0, 0.22);
  border-radius: 1.25rem;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.mini-feature:hover {
  background: var(--paper-deep);
  border-color: rgba(255, 203, 0, 0.50);
}

.mini-feature-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(69, 181, 232, 0.25);
}

/* ===== D. PHILOSOPHY ===== */
.philosophy-bg {
  background-image: url("https://images.unsplash.com/photo-1444703686981-a3abbc4d4fe3?w=1920&auto=format&fit=crop&q=70");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  filter: saturate(0.7) brightness(0.55);
}

@media (max-width: 768px) {
  .philosophy-bg {
    background-attachment: scroll;
  }
}

.split-word {
  display: inline-block;
  transform: translateY(20px);
  opacity: 0;
}

/* ===== E. PROTOCOL ===== */
.protocol-stack {
  position: relative;
  padding: 0 1.5rem;
}

@media (min-width: 768px) {
  .protocol-stack {
    padding: 0 2.5rem;
  }
}

.protocol-card {
  position: relative;
  margin-bottom: 1.5rem;
  z-index: 1;
}

.protocol-card-inner {
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 50px -25px rgba(17, 17, 17, 0.12);
  transition: transform 0.4s var(--ease-magnet), filter 0.4s var(--ease-magnet), opacity 0.4s var(--ease-magnet);
  max-width: 1200px;
  margin: 0 auto;
}

.protocol-rings {
  transform-origin: center;
  animation: slowRotate 28s linear infinite;
}

@keyframes slowRotate {
  to {
    transform: translate(200px, 200px) rotate(360deg);
  }
}

.protocol-scan {
  transform-origin: center;
  animation: scanLine 3.4s ease-in-out infinite;
}

@keyframes scanLine {

  0%,
  100% {
    transform: translateY(-160px);
    opacity: 0.2;
  }

  50% {
    transform: translateY(160px);
    opacity: 0.9;
  }
}

/* ===== Utility responsive ===== */
@media (max-width: 768px) {
  #hero h1 .hero-line-2 {
    font-size: clamp(3rem, 14vw, 5.5rem);
  }

  #navbar {
    top: 8px;
    left: 8px;
    right: 8px;
    transform: none;
  }

  #navbar .nav-pill {
    width: 100%;
    justify-content: space-between;
  }
}

/* riduce le animazioni per chi le ha disabilitate */
@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;
  }
}