/* ═══════════════════════════════════════════════════════════
   NEAITECH Utility — forensic toolbox
   Palette: slate + cyan (vicina al lab security, distinta dal
   violet cyber #9d7aff e dall’oro corporate).
   ═══════════════════════════════════════════════════════════ */

.utility-section {
  --u-bg0: #071018;
  --u-bg1: #0b1622;
  --u-bg2: #0e1c2c;
  --u-panel: rgba(14, 32, 48, 0.72);
  --u-border: rgba(56, 189, 248, 0.18);
  --u-border-strong: rgba(56, 189, 248, 0.45);
  --u-cyan: #22d3ee;
  --u-cyan-dim: #0891b2;
  --u-mint: #2dd4bf;
  --u-steel: #94a3b8;
  --u-text: #e2e8f0;
  --u-muted: #8ba0b5;
  --u-warn: #fbbf24;
  --u-danger: #f87171;
  --u-ok: #34d399;

  position: relative;
  padding: 4.75rem 0 4.25rem;
  background:
    radial-gradient(ellipse 55% 45% at 12% 0%, rgba(34, 211, 238, 0.09), transparent 55%),
    radial-gradient(ellipse 40% 50% at 95% 100%, rgba(8, 145, 178, 0.1), transparent 50%),
    linear-gradient(180deg, var(--u-bg0) 0%, var(--u-bg1) 48%, var(--u-bg2) 100%);
  color: var(--u-text);
  overflow: hidden;
  border-top: 1px solid rgba(34, 211, 238, 0.12);
  border-bottom: 1px solid rgba(34, 211, 238, 0.08);
}

/* scanline + grid (lab feel, non cyber-purple) */
.utility-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, #000 10%, transparent 92%);
  pointer-events: none;
  animation: util-grid-drift 28s linear infinite;
}

.utility-section::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 120%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(34, 211, 238, 0.03) 50%,
    transparent 100%
  );
  background-size: 100% 8px;
  animation: util-scanlines 6s linear infinite;
  pointer-events: none;
  opacity: 0.45;
}

@keyframes util-grid-drift {
  from { background-position: 0 0; }
  to { background-position: 40px 40px; }
}

@keyframes util-scanlines {
  from { transform: translateY(-20%); }
  to { transform: translateY(0%); }
}

.utility-section .container {
  position: relative;
  z-index: 1;
}

/* ── Header ── */
.utility-head {
  max-width: 680px;
  margin-bottom: 2.35rem;
}

.utility-kicker-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.7rem;
}

.utility-roman {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 9px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--u-bg0);
  background: linear-gradient(145deg, #67e8f9, var(--u-cyan) 45%, var(--u-cyan-dim));
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.35),
    0 8px 24px rgba(34, 211, 238, 0.25);
}

.utility-eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--u-cyan);
  font-weight: 600;
}

.utility-head h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  line-height: 1.12;
  margin: 0 0 0.8rem;
  color: #f8fafc;
}

.utility-head h2 em {
  font-style: italic;
  color: var(--u-cyan);
}

.utility-head p {
  color: var(--u-muted);
  font-size: 1.02rem;
  line-height: 1.65;
  margin: 0;
}

/* ── Grid ── */
.utility-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.15rem;
}

@media (max-width: 1100px) {
  .utility-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .utility-grid { grid-template-columns: 1fr; }
}

/* ── Card shell ── */
.utility-card {
  display: flex;
  flex-direction: column;
  background: var(--u-panel);
  border: 1px solid var(--u-border);
  border-radius: 18px;
  overflow: hidden;
  min-height: 100%;
  backdrop-filter: blur(10px);
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.3s ease,
    box-shadow 0.35s ease;
}

.utility-card:hover {
  transform: translateY(-5px);
  border-color: var(--u-border-strong);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(34, 211, 238, 0.12),
    0 0 40px rgba(34, 211, 238, 0.08);
}

.utility-card-live {
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28), 0 0 30px rgba(34, 211, 238, 0.07);
}

.utility-card-live:hover {
  border-color: rgba(34, 211, 238, 0.7);
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.4),
    0 0 48px rgba(34, 211, 238, 0.14);
}

.utility-card-soon {
  opacity: 0.92;
}

.utility-card-soon:hover {
  opacity: 1;
}

/* Viz stage */
.utility-viz {
  position: relative;
  height: 118px;
  background:
    linear-gradient(180deg, rgba(8, 20, 32, 0.95), rgba(10, 26, 40, 0.6));
  border-bottom: 1px solid rgba(34, 211, 238, 0.1);
  overflow: hidden;
}

.utility-viz::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.06), transparent);
  animation: util-sheen 4.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes util-sheen {
  0%, 100% { transform: translateX(-100%); opacity: 0; }
  40% { opacity: 1; }
  60% { transform: translateX(100%); opacity: 0; }
}

.util-svg {
  display: block;
  width: 100%;
  height: 100%;
  padding: 8px 10px 4px;
  /* iOS mette in pausa SMIL a dito alzato: questa animazione tiene acceso il compositor */
  animation: util-ios-alive 1.2s linear infinite;
}
@keyframes util-ios-alive {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, 0, 0.01px); }
}

.uv-frame {
  stroke: rgba(34, 211, 238, 0.2);
  stroke-width: 1;
  fill: rgba(6, 16, 26, 0.55);
}

.uv-mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 7px;
  fill: var(--u-cyan);
  letter-spacing: 0.06em;
  opacity: 0.85;
}

.utility-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.05rem 1.15rem 1.2rem;
}

.utility-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.utility-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}

.utility-badge.live {
  color: #042f2e;
  background: linear-gradient(90deg, var(--u-mint), var(--u-cyan));
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.35);
}

.utility-badge.soon {
  color: var(--u-steel);
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.utility-code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.65rem;
  color: var(--u-steel);
  letter-spacing: 0.08em;
}

.utility-card h3 {
  font-size: 1.18rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 0.45rem;
  letter-spacing: -0.01em;
}

.utility-card p {
  color: var(--u-muted);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0 0 0.75rem;
  flex-grow: 1;
}

.utility-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.95rem;
  padding: 0;
}

.utility-tags li {
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--u-cyan);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.2);
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
}

.utility-card-soon .utility-tags li {
  color: var(--u-steel);
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.18);
}

.utility-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.utility-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.utility-btn.primary {
  background: linear-gradient(135deg, var(--u-cyan), var(--u-cyan-dim));
  color: #042f2e;
  box-shadow: 0 8px 20px rgba(34, 211, 238, 0.25);
}

.utility-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(34, 211, 238, 0.35);
}

.utility-btn.ghost {
  border: 1px solid rgba(34, 211, 238, 0.28);
  color: #d0e8f2;
  background: transparent;
}

.utility-btn.ghost:hover {
  border-color: var(--u-cyan);
  color: var(--u-cyan);
}

.utility-soon-note {
  margin: auto 0 0 !important;
  font-size: 0.76rem !important;
  font-style: italic;
  color: #64748b !important;
  flex-grow: 0 !important;
}

.utility-gdpr {
  margin-top: 1.5rem;
  padding: 1.1rem 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  background: rgba(8, 145, 178, 0.1);
  color: #b8c9d9;
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 820px;
}
.utility-gdpr strong {
  color: var(--u-cyan);
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.utility-gdpr a {
  color: var(--u-mint);
  font-weight: 600;
  text-decoration: none;
}
.utility-gdpr a:hover { text-decoration: underline; }

.utility-foot {
  margin: 1.25rem 0 0;
  color: #64748b;
  max-width: 720px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.utility-foot a {
  color: var(--u-cyan);
  text-decoration: none;
  font-weight: 600;
  margin-left: 0.35rem;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.88rem;
}

.utility-foot a:hover { text-decoration: underline; }

/* ════════════════════════════════════════
   ANIMAZIONI DEDICATE
   ════════════════════════════════════════ */

/* ── Recover: disco + beam + frammenti che “tornano” ── */
.util-recover .uv-disk {
  stroke: rgba(34, 211, 238, 0.55);
  stroke-width: 1.5;
  fill: rgba(8, 145, 178, 0.12);
}

.util-recover .uv-disk-inner {
  stroke: rgba(45, 212, 191, 0.5);
  stroke-width: 1;
  fill: rgba(6, 20, 32, 0.8);
}

.util-recover .uv-spindle {
  fill: var(--u-cyan);
  animation: util-pulse 1.6s ease-in-out infinite;
}

.util-recover .uv-platter ellipse {
  fill: none;
  stroke: rgba(34, 211, 238, 0.35);
  stroke-width: 1;
}

.util-recover .uv-beam {
  stroke: url(#none);
  stroke: var(--u-mint);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
  opacity: 0.85;
  animation: util-beam 1.4s linear infinite;
  filter: drop-shadow(0 0 4px rgba(45, 212, 191, 0.8));
}

.util-recover .uv-frag {
  fill: rgba(34, 211, 238, 0.55);
  stroke: rgba(165, 243, 252, 0.6);
  stroke-width: 0.6;
}

.util-recover .uv-frag.f1 { animation-delay: 0s; }
.util-recover .uv-frag.f2 { animation-delay: 0.35s; }
.util-recover .uv-frag.f3 { animation-delay: 0.7s; }
.util-recover .uv-frag.f4 { animation-delay: 1.05s; }

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

@keyframes util-beam {
  from { stroke-dashoffset: 0; opacity: 0.4; }
  50% { opacity: 1; }
  to { stroke-dashoffset: -20; opacity: 0.4; }
}

@keyframes util-frag {
  0%, 100% { opacity: 0.25; transform: translate(4px, 2px); }
  50% { opacity: 1; transform: translate(-6px, 0); fill: rgba(45, 212, 191, 0.85); }
}

@keyframes util-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ── HashGuard: bit stream → hash seal ── */
.util-hash .uv-bits {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 8px;
  fill: rgba(148, 163, 184, 0.75);
  animation: util-bits 2.2s steps(8) infinite;
}

.util-hash .uv-bits.b1 { animation-delay: 0s; }
.util-hash .uv-bits.b2 { animation-delay: 0.2s; }
.util-hash .uv-bits.b3 { animation-delay: 0.4s; }

.util-hash .uv-funnel {
  fill: none;
  stroke: rgba(34, 211, 238, 0.45);
  stroke-width: 1.2;
  stroke-dasharray: 40;
  animation: util-funnel 2s ease-in-out infinite;
}

.util-hash .uv-lock {
  fill: rgba(8, 145, 178, 0.25);
  stroke: var(--u-cyan);
  stroke-width: 1.2;
}

.util-hash .uv-hash {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  fill: var(--u-cyan);
  animation: util-hash-tick 1.8s steps(4) infinite;
}

.util-hash .uv-seal {
  fill: none;
  stroke: rgba(45, 212, 191, 0.5);
  stroke-width: 1.5;
  stroke-dasharray: 12 8;
}

@keyframes util-bits {
  0% { opacity: 0.35; }
  50% { opacity: 1; fill: #67e8f9; }
  100% { opacity: 0.35; }
}

@keyframes util-funnel {
  0%, 100% { stroke-dashoffset: 40; opacity: 0.4; }
  50% { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes util-hash-tick {
  0% { opacity: 0.5; }
  25% { opacity: 1; }
  50% { opacity: 0.7; }
  75% { opacity: 1; }
  100% { opacity: 0.5; }
}

/* ── DiskHealth: gauge + ECG + bars ── */
.util-health .uv-gauge {
  fill: rgba(8, 20, 32, 0.6);
  stroke: rgba(34, 211, 238, 0.2);
  stroke-width: 1;
}

.util-health .uv-gauge-track {
  fill: none;
  stroke: rgba(148, 163, 184, 0.2);
  stroke-width: 4;
}

.util-health .uv-gauge-arc {
  fill: none;
  stroke: var(--u-ok);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 120;
  stroke-dashoffset: 30;
  filter: drop-shadow(0 0 4px rgba(52, 211, 153, 0.6));
}

.util-health .uv-needle {
  stroke: var(--u-cyan);
  stroke-width: 2;
  stroke-linecap: round;
}

.util-health .uv-temp {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  fill: var(--u-mint);
  font-weight: 700;
}

.util-health .uv-bar {
  fill: rgba(34, 211, 238, 0.35);
}

.util-health .uv-bar.b1 { animation-delay: 0s; }
.util-health .uv-bar.b2 { animation-delay: 0.15s; fill: rgba(45, 212, 191, 0.45); }
.util-health .uv-bar.b3 { animation-delay: 0.3s; fill: rgba(52, 211, 153, 0.55); }
.util-health .uv-bar.b4 { animation-delay: 0.45s; }

.util-health .uv-ecg {
  fill: none;
  stroke: var(--u-mint);
  stroke-width: 1.4;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 80;
  filter: drop-shadow(0 0 3px rgba(45, 212, 191, 0.7));
}

@keyframes util-gauge {
  0%, 100% { stroke-dashoffset: 40; }
  50% { stroke-dashoffset: 15; }
}

@keyframes util-needle {
  0%, 100% { transform: rotate(-25deg); }
  50% { transform: rotate(35deg); }
}

@keyframes util-bars {
  0%, 100% { transform: scaleY(0.75); opacity: 0.6; }
  50% { transform: scaleY(1); opacity: 1; }
}



@keyframes util-ecg {
  from { stroke-dashoffset: 80; }
  to { stroke-dashoffset: 0; }
}

/* ── SecureWipe: sweep wipe ── */
.util-wipe .uv-media {
  fill: rgba(15, 23, 42, 0.9);
  stroke: rgba(148, 163, 184, 0.35);
  stroke-width: 1;
}

.util-wipe .uv-data-rows .uv-bits {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  fill: rgba(248, 113, 113, 0.55);
  letter-spacing: 0.08em;
}

.util-wipe .uv-wipe-mask {
  fill: rgba(34, 211, 238, 0.28);
}

.util-wipe .uv-wipe-edge {
  stroke: var(--u-cyan);
  stroke-width: 2;
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.9));
}

.util-wipe .uv-wipe-label {
  animation: util-wipe-label 3.2s steps(3) infinite;
}

@keyframes util-wipe {
  0% { transform: scaleX(0.02); opacity: 0.9; }
  70% { transform: scaleX(1); opacity: 0.85; }
  100% { transform: scaleX(1); opacity: 0.35; }
}

@keyframes util-wipe-edge {
  0% { transform: translateX(0); opacity: 1; }
  70% { transform: translateX(124px); opacity: 1; }
  100% { transform: translateX(124px); opacity: 0.35; }
}

@keyframes util-wipe-label {
  0% { opacity: 0.6; }
  33% { opacity: 1; }
  66% { opacity: 0.8; }
  100% { opacity: 0.6; }
}

.utility-card.util-recover:hover .uv-beam { animation-duration: 0.7s; }
.utility-card.util-hash:hover .uv-bits { animation-duration: 1s; }
.utility-card.util-health:hover .uv-ecg { animation-duration: 0.9s; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .utility-section::before,
  .utility-section::after,
  .utility-viz::after,
  .util-svg * {
    animation: none !important;
  }
}
