:root {
  --bg: #0b0d11;
  --fg: #e7ecf3;
  --muted: #9aa6b2;
  --brand: #ffc107;
  --brand2: #8ab4ff;
  --border: #1c2230;
}

body {
  background: var(--bg);
  color: var(--fg);
}

/* Gradiente soft e grana leggera (tutto inline-friendly per BSS) */

.bg-surface {
  background: radial-gradient(1200px 600px at -10% -10%, #122036 0%, transparent 60%), radial-gradient(1200px 600px at 110% 10%, #0e2a2a 0%, transparent 55%), var(--bg);
  position: relative;
}

.bg-surface:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .06;
  mix-blend-mode: overlay;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="160" height="160" viewBox="0 0 160 160"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="2" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23n)" opacity="0.42"/></svg>');
}

/* Badge */

.pill-badge {
  border: 1px solid var(--border);
  color: var(--muted);
  background: linear-gradient(180deg,#0e1420,#0a0f16);
}

.dot {
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  background: var(--brand);
}

/* Glitch minimale (solo 2 layer, CPU-friendly) */

.glitch {
  position: relative;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.05;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.35));
}

.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

.glitch::before {
  color: var(--brand);
  clip-path: polygon(0 2%,100% 0,100% 48%,0 52%);
  animation: gl1 3s infinite linear alternate;
}

.glitch::after {
  color: var(--brand2);
  clip-path: polygon(0 52%,100% 48%,100% 100%,0 98%);
  animation: gl2 2.6s infinite linear alternate;
}

@keyframes gl1 {
  0% {
    transform: translate(0,0);
  }
  50% {
    transform: translate(-1px,0);
  }
  100% {
    transform: translate(.5px,.2px);
  }
}

@keyframes gl2 {
  0% {
    transform: translate(0,0);
  }
  50% {
    transform: translate(1px,.3px);
  }
  100% {
    transform: translate(-.5px,-.2px);
  }
}

/* Terminale typewriter */

.terminal {
  background: rgba(15,18,24,.85);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 0 0 1px rgba(95,243,210,.08), 0 15px 45px rgba(0,0,0,.35);
}

.terminal .line {
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid var(--brand);
  width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.terminal .line:nth-child(1) {
  animation: type 1.8s steps(28) .2s forwards, caret .9s step-end infinite;
}

.terminal .line:nth-child(2) {
  animation: type 1.6s steps(26) 2.3s forwards, caret .9s step-end infinite;
}

.terminal .line:nth-child(3) {
  animation: type 1.2s steps(22) 4.1s forwards, caret .9s step-end infinite;
}

@keyframes type {
  to {
    width: 100%;
  }
}

@keyframes caret {
  50% {
    border-color: transparent;
  }
}

/* Link & note */

.muted {
  color: var(--muted);
}

/* Riduci animazioni per accessibilità */

@media (prefers-reduced-motion: reduce) {
  .glitch::before, .glitch::after, .terminal .line {
    animation: none!important;
    width: auto;
    border-right: 0;
  }
}

