/* ============================================================
   UrielChat Presentation Site — Tema UrielSec
   Deep black -> UrielChat steel-navy gradient, 3D suction portal,
   realistic emerging smartphone showcase.
   ============================================================ */

:root {
  --bg-black: #03060c;
  --bg-navy: #0a172e;
  --bg-blue: #142b52;
  --bg-elev: rgba(12, 19, 34, 0.88);
  --bg-elev2: rgba(18, 30, 54, 0.94);

  --steel: #7fa3d9;
  --steel-bright: #b3caef;
  --steel-deep: #3f6aa8;
  --metal: #232c3d;
  --metal-hi: #3c4b68;

  --text: #dbe3f0;
  --text-dim: #8b9bb4;
  --text-faint: #6c7e99;

  --line: rgba(127, 163, 217, 0.2);
  --line-strong: rgba(127, 163, 217, 0.46);
  --ok: #5fd49a;
  --danger: #e0606b;

  --cut: 10px;
  --radius: 6px;
  --display: "Bahnschrift", "DIN Alternate", "Segoe UI", system-ui, sans-serif;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", "SF Mono", Consolas, Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-black);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* ---------- sfondi animati nero -> blu UrielChat (lisci, senza griglia) ---------- */

#bg-canvas,
.bg-gradient {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg-gradient {
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 85% 65% at 50% 108%, rgba(36, 82, 152, 0.48), transparent 68%),
    radial-gradient(ellipse 65% 55% at 50% 45%, rgba(20, 48, 96, 0.34), transparent 72%),
    linear-gradient(180deg, #020409 0%, #060c18 46%, #0c1d3a 100%);
}

.bg-gradient::after {
  content: "";
  position: absolute;
  inset: -15%;
  background:
    radial-gradient(circle 42vw at 26% 32%, rgba(58, 104, 178, 0.16), transparent 65%),
    radial-gradient(circle 36vw at 76% 68%, rgba(127, 163, 217, 0.11), transparent 65%);
  animation: spaceDrift 18s ease-in-out infinite alternate;
}

@keyframes spaceDrift {
  0% { transform: translate3d(-2%, -1%, 0) scale(1); opacity: 0.72; }
  100% { transform: translate3d(2%, 2%, 0) scale(1.06); opacity: 1; }
}

#bg-canvas { z-index: 2; }

/* ---------- controlli superiori ---------- */

.top-controls {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-btn {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(10, 17, 32, 0.8);
  backdrop-filter: blur(8px);
  color: var(--steel-bright);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
  transition: border-color .18s, background .18s, transform .18s;
}
.ctrl-btn:hover {
  border-color: var(--steel);
  background: rgba(20, 34, 62, 0.92);
  transform: translateY(-1px);
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(10, 17, 32, 0.78);
  backdrop-filter: blur(8px);
}
.lang-switch button {
  padding: 7px 11px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.lang-switch button[aria-pressed="true"] {
  background: rgba(127, 163, 217, 0.22);
  color: var(--steel-bright);
}

/* ==================== STADIO 1: INTRO 3D ==================== */

.stage-intro {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  perspective: 1400px;
  perspective-origin: 50% 48%;
  transform-style: preserve-3d;
  transition: opacity 0.45s ease;
}

.stage-intro.gone {
  pointer-events: none;
  opacity: 0;
}

.intro-cluster {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 560px;
  transform-style: preserve-3d;
  will-change: transform, opacity, filter;
}

.intro-cluster.sucking {
  animation: suckBack 0.76s cubic-bezier(0.55, -0.08, 0.86, 0.35) forwards;
}

.intro-cluster.returning {
  animation: returnIntro 0.72s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes suckBack {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateX(0deg) rotateZ(0deg) scale(1);
    filter: blur(0px) brightness(1);
  }
  38% {
    opacity: 0.96;
    transform: translate3d(0, -14px, -210px) rotateX(-52deg) rotateZ(-4deg) scale(0.76);
    filter: blur(0.4px) brightness(1.18);
  }
  100% {
    opacity: 0;
    transform: translate3d(0, -24px, -1100px) rotateX(-88deg) rotateZ(-14deg) scale(0.08);
    filter: blur(10px) brightness(1.5);
  }
}

@keyframes returnIntro {
  0% {
    opacity: 0;
    transform: translate3d(0, 12px, -780px) rotateX(-68deg) scale(0.16);
    filter: blur(8px);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateX(0deg) scale(1);
    filter: blur(0px);
  }
}

/* Vortice radiale al risucchio */
.vortex-ring,
.vortex-flash {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.1);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
}

.vortex-ring {
  width: 520px;
  height: 520px;
  border: 2px solid rgba(179, 202, 239, 0.65);
  box-shadow:
    0 0 65px rgba(127, 163, 217, 0.55),
    inset 0 0 48px rgba(63, 106, 168, 0.45);
}

.vortex-ring.active {
  animation: vortexCollapse 0.85s cubic-bezier(0.32, 0.88, 0.4, 1) forwards;
}

.vortex-flash {
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(179, 202, 239, 0.88), rgba(63, 106, 168, 0.25) 55%, transparent 72%);
}

.vortex-flash.active {
  animation: vortexFlash 0.7s ease-out forwards;
}

@keyframes vortexCollapse {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.45) rotate(0deg); }
  30% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.75) rotate(45deg); }
  75% { opacity: 0.7; transform: translate(-50%, -50%) scale(0.06) rotate(130deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.18) rotate(180deg); }
}

@keyframes vortexFlash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.1); }
  45% { opacity: 0.75; transform: translate(-50%, -50%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.8); }
}

.intro-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 18, 34, 0.68);
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--steel-bright);
  margin-bottom: 20px;
}

/* Logo grande reattivo al cursore (senza riquadro) */
.logo-3d {
  position: relative;
  width: clamp(240px, min(60vw, 44vh), 390px);
  height: clamp(240px, min(60vw, 44vh), 390px);
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  will-change: transform;
  margin-bottom: 14px;
}

.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(127, 163, 217, 0.24);
  pointer-events: none;
}

.orbit-1 {
  inset: -6px;
  transform: translateZ(-26px);
  animation: spinOrbit 22s linear infinite;
}

.orbit-2 {
  inset: -24px;
  border-style: solid;
  border-color: rgba(127, 163, 217, 0.14) transparent rgba(179, 202, 239, 0.22) transparent;
  transform: translateZ(-48px);
  animation: spinOrbitRev 16s linear infinite;
}

@keyframes spinOrbit {
  from { transform: translateZ(-26px) rotate(0deg); }
  to { transform: translateZ(-26px) rotate(360deg); }
}
@keyframes spinOrbitRev {
  from { transform: translateZ(-48px) rotate(360deg); }
  to { transform: translateZ(-48px) rotate(0deg); }
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transform: translateZ(24px);
  filter:
    drop-shadow(0 24px 44px rgba(0, 0, 0, 0.78))
    drop-shadow(0 0 42px rgba(74, 118, 184, 0.34));
}

.intro-sub {
  margin: 4px 0 26px;
  max-width: 440px;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.55;
}

/* Pulsante Entra: metallo blu cybersecurity + raggio di luce periodico */
.btn-enter {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 204px;
  padding: 15px 36px;
  border: 1px solid rgba(132, 168, 222, 0.52);
  border-radius: var(--radius);
  background: linear-gradient(155deg, #1d304f 0%, #0e1a30 48%, #182b48 100%);
  color: #e6eefc;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.65),
    0 0 26px rgba(50, 86, 146, 0.34),
    inset 0 1px 0 rgba(196, 218, 250, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6);
  transition: border-color .22s ease, box-shadow .22s ease, filter .22s ease;
}

.btn-enter::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -65%;
  width: 55%;
  height: 180%;
  background: linear-gradient(108deg, transparent 22%, rgba(192, 220, 255, 0.5) 50%, transparent 78%);
  transform: translateX(-140%) skewX(-18deg);
  pointer-events: none;
  animation: btnLightSweep 4.6s cubic-bezier(0.25, 0.8, 0.35, 1) infinite;
}

@keyframes btnLightSweep {
  0%, 72% { transform: translateX(-140%) skewX(-18deg); opacity: 0; }
  76% { opacity: 1; }
  94% { transform: translateX(340%) skewX(-18deg); opacity: 0.9; }
  100% { transform: translateX(360%) skewX(-18deg); opacity: 0; }
}

.btn-enter:hover {
  border-color: rgba(179, 202, 239, 0.85);
  filter: brightness(1.12);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.72),
    0 0 36px rgba(102, 146, 214, 0.45),
    inset 0 1px 0 rgba(215, 232, 255, 0.4);
}

.btn-enter-arrow {
  transition: transform .22s ease;
}
.btn-enter:hover .btn-enter-arrow {
  transform: translateX(4px);
}

/* ==================== STADIO 2: SMARTPHONE 3D ==================== */

.stage-phone {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  perspective: 1600px;
  pointer-events: none;
  opacity: 0;
}

.stage-phone.visible {
  pointer-events: auto;
  opacity: 1;
}

.phone-tilt {
  transform-style: preserve-3d;
  will-change: transform, opacity;
  height: min(812px, 90vh);
  aspect-ratio: 390 / 812;
  max-width: 94vw;
}

.stage-phone.emerging .phone-tilt {
  animation: phoneEmerge 0.92s cubic-bezier(0.16, 1.12, 0.3, 1) forwards;
}

.stage-phone.reversing .phone-tilt {
  animation: phoneRetreat 0.48s cubic-bezier(0.55, 0, 0.85, 0.45) forwards;
}

@keyframes phoneEmerge {
  0% {
    opacity: 0;
    transform: translate3d(0, 32px, -900px) rotateX(28deg) rotateY(-18deg) scale(0.32);
    filter: blur(8px);
  }
  58% {
    opacity: 1;
    transform: translate3d(0, -6px, 28px) rotateX(-2deg) rotateY(2deg) scale(1.02);
    filter: blur(0px);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateX(0deg) rotateY(0deg) scale(1);
    filter: blur(0px);
  }
}

@keyframes phoneRetreat {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateX(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(0, 18px, -850px) rotateX(24deg) scale(0.28);
  }
}

/* Chassis realistico smartphone */
.phone-frame {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 11px;
  border-radius: 48px;
  background: linear-gradient(145deg, #32415c 0%, #151c2a 32%, #0e1420 68%, #2a3750 100%);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.86),
    0 0 80px rgba(63, 106, 168, 0.25),
    inset 0 1px 2px rgba(255, 255, 255, 0.25),
    inset 0 -1px 2px rgba(0, 0, 0, 0.7);
}

/* Tasti fisici laterali */
.hw-btn {
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #4b5d80, #232d42);
}
.hw-mute { left: -3px; top: 112px; height: 26px; }
.hw-vol-up { left: -3px; top: 158px; height: 52px; }
.hw-vol-dn { left: -3px; top: 222px; height: 52px; }
.hw-power { right: -3px; top: 175px; height: 74px; }

.phone-bezel {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 38px;
  background: #05080f;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
}

/* Dynamic Island */
.dynamic-island {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  height: 24px;
  min-width: 118px;
  padding: 0 10px;
  border-radius: 999px;
  background: #020408;
  border: 1px solid rgba(127, 163, 217, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}
.di-cam {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #3c5b8c, #090e19);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.di-status {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--steel);
}

/* Status bar */
.phone-statusbar {
  height: 40px;
  padding: 12px 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--text);
  background: rgba(5, 8, 15, 0.94);
  flex-shrink: 0;
}

.sb-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sb-e2e {
  font-size: 9px;
  color: var(--ok);
  border: 1px solid rgba(95, 212, 154, 0.4);
  padding: 0 4px;
  border-radius: 3px;
}
.sb-sig {
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 9px;
}
.sb-sig i {
  display: block;
  width: 2.5px;
  background: var(--text);
  border-radius: 1px;
}
.sb-sig i:nth-child(1) { height: 3px; }
.sb-sig i:nth-child(2) { height: 5px; }
.sb-sig i:nth-child(3) { height: 7px; }
.sb-sig i:nth-child(4) { height: 9px; }

.sb-bat {
  width: 18px;
  height: 9px;
  border: 1px solid var(--text-dim);
  border-radius: 2.5px;
  padding: 1px;
  position: relative;
}
.sb-bat::after {
  content: "";
  position: absolute;
  right: -2.5px;
  top: 2px;
  width: 1.5px;
  height: 4px;
  background: var(--text-dim);
  border-radius: 0 1px 1px 0;
}
.sb-bat-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--ok);
  border-radius: 1px;
}

/* Boot splash interno */
.phone-boot {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: radial-gradient(circle at 50% 42%, #0e1e3a, #04070d 72%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.38s ease;
}
.phone-boot.active {
  opacity: 1;
  pointer-events: auto;
}
.boot-icon {
  width: 66px;
  height: 66px;
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(127, 163, 217, 0.45);
}
.boot-name {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: #fff;
}
.boot-bar {
  width: 150px;
  height: 3px;
  border-radius: 99px;
  background: rgba(127, 163, 217, 0.2);
  overflow: hidden;
}
.boot-bar-fill {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--steel-deep), var(--steel-bright));
}
.phone-boot.active .boot-bar-fill {
  animation: bootFill 0.65s ease-out forwards;
}
@keyframes bootFill {
  from { width: 0%; }
  to { width: 100%; }
}
.boot-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* ---------- Contenuto app interno dello smartphone ---------- */

.phone-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 95% 40% at 50% 0%, rgba(63, 106, 168, 0.22), transparent 65%),
    linear-gradient(180deg, #060b14 0%, #091223 100%);
}

.app-bar {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 17, 32, 0.88);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}
.app-brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
}
.app-brand-name {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
  line-height: 1.1;
}
.app-brand-sub {
  font-size: 10px;
  color: var(--text-dim);
}
.ver-badge {
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid rgba(127, 163, 217, 0.35);
  background: rgba(127, 163, 217, 0.12);
  color: var(--steel-bright);
}

.phone-viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 14px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(127, 163, 217, 0.3) transparent;
}
.phone-viewport::-webkit-scrollbar { width: 4px; }
.phone-viewport::-webkit-scrollbar-thumb { background: rgba(127, 163, 217, 0.28); border-radius: 99px; }

.phone-view { display: none; }
.phone-view.active {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: viewIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Home view */
.hero-card {
  padding: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.hero-kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--steel);
  margin-bottom: 5px;
}
.hero-h {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 19px;
  line-height: 1.2;
  color: #fff;
}
.hero-p {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.45;
}
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.metric {
  padding: 7px 6px;
  background: rgba(6, 11, 22, 0.72);
  border: 1px solid rgba(127, 163, 217, 0.14);
  border-radius: 4px;
  text-align: center;
}
.metric-val {
  display: block;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  color: var(--steel-bright);
}
.metric-lbl {
  display: block;
  font-size: 9.5px;
  color: var(--text-faint);
}

/* Mini chat animata */
.demo-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 14, 26, 0.9);
  overflow: hidden;
}
.demo-bar {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 25, 45, 0.85);
}
.demo-peer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.demo-shield { color: var(--ok); }
.demo-actions { display: flex; align-items: center; gap: 6px; }
.pq-pill {
  font-family: var(--mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(95, 212, 154, 0.45);
  color: var(--ok);
  background: rgba(95, 212, 154, 0.08);
}
.mini-btn {
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: rgba(127, 163, 217, 0.12);
  color: var(--steel-bright);
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
}
.mini-btn:hover { background: rgba(127, 163, 217, 0.24); }

.demo-chat-log {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 196px;
}

.d-sys,
.d-msg {
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transition: opacity 0.34s ease, transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
.d-sys.show,
.d-msg.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.d-msg.shred {
  opacity: 0 !important;
  transform: translateX(26px) scale(0.72) !important;
  filter: blur(4px);
}

.d-sys {
  align-self: center;
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(127, 163, 217, 0.1);
  color: var(--text-dim);
}
.d-pq { color: var(--ok); background: rgba(95, 212, 154, 0.1); }

.d-msg {
  max-width: 86%;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.35;
}
.d-msg.out {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(63, 106, 168, 0.88), rgba(40, 76, 130, 0.92));
  color: #fff;
  border: 1px solid rgba(179, 202, 239, 0.25);
}
.d-msg.in {
  align-self: flex-start;
  background: var(--bg-elev2);
  color: var(--text);
  border: 1px solid var(--line);
}
.d-meta {
  display: block;
  text-align: right;
  font-family: var(--mono);
  font-size: 9px;
  opacity: 0.72;
  margin-top: 2px;
}
.d-file-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.d-file-ico { font-size: 16px; }
.d-file-name { font-weight: 600; font-size: 11.5px; }
.d-file-sub { font-size: 9.5px; opacity: 0.82; }
.d-del-chip {
  margin-top: 6px;
  width: 100%;
  padding: 4px 8px;
  border: 1px solid rgba(224, 96, 107, 0.55);
  border-radius: 4px;
  background: rgba(224, 96, 107, 0.14);
  color: #ffc5cb;
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
}
.d-del-chip:hover { background: rgba(224, 96, 107, 0.28); }
.demo-del-note {
  padding: 7px 10px;
  border-top: 1px solid rgba(95, 212, 154, 0.28);
  background: rgba(95, 212, 154, 0.08);
  color: var(--ok);
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
}

.cta-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--steel-bright);
  background: linear-gradient(135deg, #4b77b8, #2f5590);
  color: #fff;
  text-decoration: none;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  transition: filter .18s;
}
.cta-primary:hover { filter: brightness(1.12); }

/* Tab 2: Security & Tunnel animato */
.sec-h {
  margin: 0;
  font-family: var(--display);
  font-size: 17px;
  color: #fff;
}
.sec-p {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}

.tunnel-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.tunnel-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.tn-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  border: 1px solid var(--steel);
  background: radial-gradient(circle at 35% 35%, rgba(127, 163, 217, 0.35), rgba(16, 30, 56, 0.9));
  box-shadow: 0 0 14px rgba(127, 163, 217, 0.25);
}
.tn-lbl { font-size: 10px; color: var(--text-dim); }
.tunnel-pipe {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.pipe-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--steel-bright);
  margin-bottom: 5px;
}
.pipe-track {
  position: relative;
  height: 6px;
  border-radius: 99px;
  background: rgba(127, 163, 217, 0.16);
  overflow: hidden;
}
.pkt {
  position: absolute;
  top: 1px;
  width: 18px;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--ok), #fff);
  animation: packetFlow 2.1s linear infinite;
}
.pkt-2 { animation-delay: 0.7s; }
.pkt-3 { animation-delay: 1.4s; }
@keyframes packetFlow {
  0% { left: -24px; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
.pipe-sub {
  margin-top: 5px;
  font-size: 9.5px;
  color: var(--ok);
}

.spec-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.spec-card {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.spec-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--steel);
  margin-bottom: 3px;
}
.spec-card h3 {
  margin: 0 0 3px;
  font-family: var(--display);
  font-size: 14px;
  color: #fff;
}
.spec-card p {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.42;
}

/* Tab 3: How stepper */
.how-progress {
  height: 3px;
  border-radius: 99px;
  background: rgba(127, 163, 217, 0.16);
  overflow: hidden;
}
.how-progress-fill {
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, var(--steel-deep), var(--steel-bright));
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.how-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.how-step {
  padding: 7px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(10, 17, 32, 0.72);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: border-color .18s, background .18s, color .18s;
}
.how-step.active {
  border-color: var(--steel);
  background: rgba(127, 163, 217, 0.16);
  color: #fff;
}
.step-num { font-family: var(--mono); font-size: 10px; color: var(--steel); }
.step-txt { font-size: 10px; font-weight: 600; }

.how-stage {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.how-visual {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.hv-badge {
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  color: var(--steel-bright);
  background: rgba(127, 163, 217, 0.12);
}
.hv-glyph {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--steel);
  color: var(--steel-bright);
  font-size: 18px;
  box-shadow: 0 0 18px rgba(127, 163, 217, 0.24);
}
.how-stage h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 15px;
  color: #fff;
}
.how-stage p {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.48;
}
.how-code {
  padding: 8px 10px;
  border-radius: 4px;
  background: #04070e;
  border: 1px solid rgba(127, 163, 217, 0.16);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ok);
  word-break: break-all;
}

/* Tab 4: Accordion features */
.acc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.acc-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  overflow: hidden;
}
.acc-head {
  width: 100%;
  padding: 11px 12px;
  border: 0;
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  font-family: var(--display);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.acc-chev {
  color: var(--steel);
  transition: transform 0.25s ease;
}
.acc-item.open .acc-chev {
  transform: rotate(180deg);
}
.acc-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.26s ease;
}
.acc-item.open .acc-body {
  grid-template-rows: 1fr;
}
.acc-body p {
  overflow: hidden;
  margin: 0;
  padding: 0 12px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.45;
  transition: padding 0.26s ease;
}
.acc-item.open .acc-body p {
  padding: 0 12px 12px;
}

/* Tab 5: Links */
.links-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.link-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  text-decoration: none;
  color: #fff;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  transition: border-color .18s, background .18s, transform .18s;
}
.link-card:hover {
  border-color: var(--steel);
  background: rgba(22, 37, 66, 0.94);
  transform: translateX(2px);
}
.link-card.primary-link {
  border-color: rgba(127, 163, 217, 0.55);
  background: linear-gradient(135deg, rgba(63, 106, 168, 0.35), rgba(14, 24, 44, 0.92));
}
.lc-ico {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: rgba(127, 163, 217, 0.14);
  border: 1px solid rgba(127, 163, 217, 0.28);
  color: var(--steel-bright);
  flex-shrink: 0;
}
.lc-body { flex: 1; min-width: 0; }
.lc-title { font-family: var(--display); font-size: 13.5px; font-weight: 600; }
.lc-url { font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); }
.lc-ext { font-family: var(--mono); color: var(--steel-bright); }

.btn-replay-inline {
  margin-top: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(127, 163, 217, 0.08);
  color: var(--steel-bright);
  font-family: var(--mono);
  font-size: 11.5px;
  cursor: pointer;
}
.btn-replay-inline:hover {
  border-color: var(--steel);
  background: rgba(127, 163, 217, 0.16);
}

/* Bottom navigation nello smartphone */
.phone-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px 4px;
  border-top: 1px solid var(--line);
  background: rgba(8, 13, 24, 0.96);
  flex-shrink: 0;
}
.nav-btn {
  border: 0;
  background: transparent;
  color: var(--text-faint);
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  border-radius: 6px;
  transition: color .18s, background .18s;
}
.nav-btn.active {
  color: var(--steel-bright);
  background: rgba(127, 163, 217, 0.12);
}
.nav-ico { font-size: 14px; line-height: 1; }
.nav-lbl { font-size: 10px; font-weight: 600; }

.phone-home-bar {
  width: 116px;
  height: 4px;
  margin: 4px auto 7px;
  border-radius: 99px;
  background: rgba(219, 227, 240, 0.34);
  flex-shrink: 0;
}

@media (max-width: 520px) {
  .phone-tilt {
    height: min(760px, 86vh);
    max-width: 95vw;
  }
  .top-controls {
    top: 10px;
    right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orbit-1, .orbit-2, .pkt, .bg-gradient::after, .btn-enter::after { animation: none !important; }
  .intro-cluster.sucking,
  .stage-phone.emerging .phone-tilt { animation-duration: 0.01ms !important; }
}
