
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;600&family=Share+Tech+Mono&display=swap');

:root {
  --accent-color: #00ff91;
  --accent-green: #27c93f;
  --accent-red: #ff0040;

  --bg-base: #0b0b0c;
  --bg-cyber-gradient: radial-gradient(ellipse at 50% 0%, #1c2e26 0%, #101211 100%);
  --bg-cyber-glow: radial-gradient(ellipse at 60% 40%, #00ff9140 0%, transparent 70%);
  --crt-scan: repeating-linear-gradient(
    to bottom, 
    rgba(0,255,145,0.04), 
    rgba(0,255,145,0.03) 2px, 
    transparent 3px, 
    transparent 7px
  );
}


/* === BASE RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  font-family: 'Fira Code', monospace;
  background: var(--bg-gradient), var(--bg-color);
  color: var(--accent-color);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  
}

body {
      font-family: "Fira Code", monospace;
      background: var(--bg-cyber-gradient, radial-gradient(ellipse at 50% 0%, #1c2e26 0%, #101211 100%)), #0b0b0c;
      color: #e7f6ff;
      min-height: 100vh;
    }


/* === NAVBAR === */
.cyber-navbar {
  background: linear-gradient(to bottom, rgba(0,0,0,0.85), rgba(0,0,0,0.65));
  border-bottom: 1px solid var(--accent-color);
  backdrop-filter: blur(6px);
  padding: 0.75rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,255,145,0.1);
  z-index: 1030;
}

.navbar-brand.glitch-text {
  color: var(--accent-color);
  font-size: 1.6rem;
  font-weight: 600;
  text-shadow: 0 0 2px var(--accent-color);
  animation: cyber-glitch 1.5s infinite;
  text-decoration: none;
  text-transform: none;
  margin-left: 1rem;
}

@keyframes cyber-glitch {
  0%, 100% { text-shadow: 0 0 2px var(--accent-color); }
  20% { text-shadow: -2px 0 var(--accent-red), 2px 0 var(--accent-color); }
  40% { text-shadow: 2px 2px var(--accent-red); }
  60% { text-shadow: -1px -1px var(--accent-color), 1px 1px var(--accent-red); }
  80% { text-shadow: 1px 0 var(--accent-red), -1px 0 var(--accent-color); }
}

/* === NAV LINKS === */
.navbar-nav {
  align-items: center;
}

.navbar-nav .nav-link {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  color: #bfffd4;
  padding: 0.5rem 1rem;
  position: relative;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--accent-color);
  font-weight: bold;
  text-shadow: 0 0 6px var(--accent-color);
}

.navbar-nav .nav-link::after {
  content: '';
  display: block;
  height: 2px;
  width: 0%;
  background: var(--accent-color);
  position: absolute;
  bottom: -3px;
  left: 0;
  transition: width 0.3s ease;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
  width: 100%;
}

/*───────────────────────────────────────────────
  NAVBAR – Ottimizzazioni Mobile / Small Tablet
───────────────────────────────────────────────*/
@media (max-width: 768px){          /* telefono + piccoli tablet */
  /* barra un po’ più sottile */
  .cyber-navbar{
    padding: .55rem .9rem;          /* prima .75 / 1.5 */
    backdrop-filter: blur(4px);     /* leggermente meno pesante */
  }

  /* logo / brand */
  .navbar-brand.glitch-text{
    font-size: 1.35rem;             /* meno alto */
    margin-left: .4rem;             /* riduce spazi vuoti */
  }

  /* menu: link leggermente più piccoli e ravvicinati */
  .navbar-nav .nav-link{
    font-size: .9rem;
    padding: .45rem .65rem;
  }
}

/* -- Telefoni “very small” (< 576 px) -- */
@media (max-width: 576px){
  .cyber-navbar{
    padding: .45rem .7rem;
  }
  .navbar-brand.glitch-text{
    font-size: 1.2rem;
  }
  .navbar-nav .nav-link{
    font-size: .85rem;
    padding: .4rem .55rem;
  }
}


/* === TOGGLER === */
.navbar-toggler {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  color: var(--accent-color);
}

/* === TERMINAL === */
main.terminal {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  width: 100%;
}

.terminal-output {
  max-width: 1080px;
  width: 100%;
  font-size: 1.2rem;
  white-space: pre-wrap;
  color: var(--accent-color);
}

.big-output {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
  margin-left: 1.5rem;
}

.sh-output {
  color: var(--accent-green);
  font-style: italic;
  font-family: 'Share Tech Mono', monospace;
  margin: 0.25rem 0 0.25rem 1.5rem;
  white-space: pre-wrap;
}

/* Cursore terminale */
.no-native-caret:focus {
  outline: none;
  caret-color: transparent;
}

.terminal-cursor {
  display: inline-block;
  width: 10px;
  height: 1em;
  background-color: #00ff00;
  animation: blinkC 1s steps(1) infinite;
  vertical-align: bottom;
}

@keyframes blinkC {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Input terminale */
.user-input{
  outline:none;
  display:inline-block;
  min-width:5px;
  max-width:920px;
  white-space:pre-wrap;
  overflow-wrap:anywhere; 
  word-break:break-word;
}

/* Riga prompt */
.prompt-line{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  gap:0.4rem;
  margin-top:0.2rem;
  max-width:920px;
}

/* =================================================================
   FOOTER  ─ cyber matrix style
================================================================= */
/* ---------- FOOTER ---------- */
.cyber-footer{
  background:linear-gradient(to top,#050805,#0d1309);
  color:#89ffb8;font:.85rem 'Fira Code',monospace;
  padding:.8rem 1.2rem 4.4rem;text-align:center;
  border-top:1px solid var(--accent-color);
  box-shadow:0 -2px 8px rgba(0,255,145,.12)
}
.footer-sep{margin:0 .4rem;color:#31ff90}
.footer-copy{color:#66ffa6}.footer-tag{color:#99ffc8}

/* ---------- brand con glitch RGB ---------- */
.footer-brand{
  position:relative;
  color:var(--accent-color);
  font-weight:600;
  text-shadow:0 0 3px var(--accent-color);
  display:inline-block;                /* importante per il clip */
  overflow:hidden;
}

/* due “copie fantasma” – ciano e magenta */
.footer-brand::before,
.footer-brand::after{
  content:attr(data-text);             /* TESTO reale, non la class */
  position:absolute;inset:0;
  mix-blend-mode:screen;               /* somma i canali RGB        */
  pointer-events:none;
  animation:glitchShift 2.2s infinite steps(20);   /* jitter X        */
}

/* canale CYAN (↑) – parte superiore */
.footer-brand::before{
  color:#00eaff;
  clip-path:inset(0 0 55% 0);          /* metà superiore            */
}

/* canale MAGENTA (↓) – parte inferiore */
.footer-brand::after{
  color:#ff1a6d;
  clip-path:inset(55% 0 0 0);          /* metà inferiore            */
}

/* lieve pulsazione globale del verde */
@keyframes footerPulse{
  0%,100%{text-shadow:0 0 3px var(--accent-color)}
  50%    {text-shadow:0 0 8px var(--accent-color)}
}
.footer-brand{animation:footerPulse 3s infinite ease-in-out}

/* micro-spostamenti laterali pseudo-random */
@keyframes glitchShift{
  0%  {transform:translateX( 0  )}
  10% {transform:translateX( 1px)}
  20% {transform:translateX(-1px)}
  30% {transform:translateX( 0  )}
  40% {transform:translateX( 1.5px)}
  50% {transform:translateX(-1.5px)}
  60% {transform:translateX( 0  )}
  70% {transform:translateX( 1px)}
  80% {transform:translateX(-1px)}
  90% {transform:translateX( 0  )}
  100%{transform:translateX( 0  )}
}

/* ========== FOOTER BASE ========== */
.cyber-footer{
  position:relative;
  background:linear-gradient(to top,#050805,#0d1309);
  color:#89ffb8;
  font:.85rem 'Fira Code',monospace;
  text-align:center;
  padding:.8rem 1.4rem 1.4rem;
  border-top:1px solid var(--accent-color);
  box-shadow:0 -2px 8px rgba(0,255,145,.12);
}
.footer-sep{margin:0 .38rem;color:#31ff90}
.footer-copy{color:#66ffa6}
.footer-mail{color:#a0ffc0;text-decoration:none}
.footer-mail:hover{text-decoration:underline;color:#c4ffd2}

/* ========== Brand glitch (più visibile) ========== */
.footer-brand{
  position:relative;display:inline-block;overflow:hidden;
  color:var(--accent-color);font-weight:600;
  text-shadow:0 0 3px var(--accent-color);
  animation:footerPulse 3s infinite ease-in-out;
}
.footer-brand::before,
.footer-brand::after{
  content:attr(data-text);
  position:absolute;inset:0;opacity:.65;pointer-events:none;
  mix-blend-mode:screen;animation:glitchShift 2.2s infinite steps(20);
}
.footer-brand::before{color:#00eaff;clip-path:inset(0 0 55% 0)}
.footer-brand::after {color:#ff1a6d;clip-path:inset(55% 0 0 0)}
@keyframes footerPulse{
  0%,100%{text-shadow:0 0 3px var(--accent-color)}
  50%    {text-shadow:0 0 8px var(--accent-color)}
}
@keyframes glitchShift{
  0%,30%,60%,100%{transform:translateX(0)}
  10%,70%        {transform:translateX(1px)}
  20%,80%        {transform:translateX(-1px)}
  40%            {transform:translateX(1.5px)}
  50%            {transform:translateX(-1.5px)}
}

/* ========== Quote ========== */
.footer-quote{
  display:block;                     /* manda a capo sui desktop stretti */
  margin-top:.4rem;
  font-size:.78rem;
  color:#7affc9;
  font-style:italic;
}

/* ========== Responsive tweaks ========== */
@media (max-width:768px){
  .cyber-footer{font-size:.8rem;padding-bottom:3rem}
  .footer-quote{font-size:.72rem}
}


/* === TERMINAL STYLES === */

.terminal-box {
  background: rgba(0,0,0,0.8);
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0,255,145,0.06), 0 1px 1.5px rgba(0,255,145,0.03);
  border: 1.5px solid #222;
  overflow: hidden;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Contenitore che potrà scrollare se serve */
.terminal-scroll{
  /* altezza massima calcolata – 100 vh meno navbar e footer */
  max-height: calc(100vh - var(--nav-h) - 60px); /* 60 = tuo footer */
  overflow-y: auto;
  padding-right: 6px;            /* un filo d’aria a destra */
}

/* barra stile Matrix ma sottile / discreta */
.terminal-scroll::-webkit-scrollbar{
  width: 6px;
}
.terminal-scroll::-webkit-scrollbar-track{
  background: transparent;
}
.terminal-scroll::-webkit-scrollbar-thumb{
  background: #00ff41;
  border-radius: 4px;
  box-shadow: 0 0 6px #00ff41;
}
.terminal-scroll{
  scrollbar-width: thin;               /* Firefox */
  scrollbar-color: #00ff41 transparent;
}
.terminal-scroll::-webkit-scrollbar{ opacity: 0; transition: opacity .25s }
.terminal-scroll:hover::-webkit-scrollbar{ opacity: 1 }
.terminal-scroll{ scrollbar-color: transparent transparent; }
.terminal-scroll:hover{ scrollbar-color:#00ff41 transparent; }


@media (max-width: 991.98px) {
  .terminal-layout .row {
    flex-direction: column;
  }
  .terminal-box, .window-card {
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 768px) {
  .window-card {
    margin-bottom: 2rem;
  }
}


/* Effetto neon/ombra-glow per il testo terminale */
.terminal-output, .terminal-output * {
  text-shadow:
    0 0 2px #00ff91cc,
    0 0 8px #00ff9140;
}

/* Sfondo terminale più “vivo” ma sobrio */

.terminal-bg {
      position: absolute;
      inset: 0;
      z-index: 0;
      pointer-events: none;
      background:
        repeating-linear-gradient(to bottom, transparent, rgba(0,255,145,0.02) 2px, transparent 4px),
        radial-gradient(ellipse at center, #00ff9140 0%, transparent 60%),
        /*url('../img/noise.png');*/;
      mix-blend-mode: lighten;
      opacity: 0.22;
    }
    main.terminal {
      min-height: 72vh;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      position: relative;
      background: none;
      z-index: 1;
      padding: 2.5rem 0 2rem;
    }
    .terminal-output {
      max-width: 920px;
      width: 100%;
      font-size: 1.23rem;
      z-index: 2;
      min-height: 320px;
      text-shadow: 0 0 2px #00ff91cc, 0 0 8px #00ff9140;
    }

.window-card {
  background: linear-gradient(120deg, #141a17 80%, #0b0b0c 100%);
  border-radius: 10px;
  box-shadow: 0 2px 18px 0 #00ff9130, 0 1.5px 2px #0b0b0c70;
  border: 1.5px solid #00ff9155;
  overflow: hidden;
  margin-bottom: 2.2rem;
  transition: box-shadow 0.3s, border-color 0.3s, transform 0.25s;
  position: relative;
}
.window-card:hover {
  box-shadow: 0 8px 26px #00ff91bb;
  border-color: #00ff91;
  transform: translateY(-4px) scale(1.012);
}

.window-header {
  padding: 0.5rem 1rem 0.45rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,255,145,0.09);
  border-bottom: 1.5px solid #00ff9170;
  font-family: "Share Tech Mono", monospace;
  font-size: 1.08rem;
  color: #00ff91;
  letter-spacing: 0.04em;
}

.window-header .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.dot.red { background-color: #ff5f56; }
.dot.yellow { background-color: #ffbd2e; }
.dot.green { background-color: var(--accent-green, #27c93f); }

.window-body {
  padding: 1.15rem 1.6rem 1.25rem 1.6rem;
  font-family: "Fira Code", monospace;
  background: transparent;
  color: #f3fff6;
  font-size: 1.09rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
  position: relative;
  z-index: 1;
}

.window-body .email-box {
  font-family: "Fira Code", monospace;
  font-size: 1.03rem;
  border: 1px dashed #00ff91;
  background: rgba(0,255,145,0.08);
  border-radius: .42rem;
  padding: .43rem 1.05rem;
  color: #00ff91;
  word-break: break-all;
  filter: drop-shadow(0 0 3px #00ff9150);
  box-shadow: 0 0 12px #00ff9125;
  animation: contact-glow 2s alternate infinite;
}

@keyframes contact-glow {
  from { box-shadow: 0 0 8px #00ff9120, 0 0 0 #00ff91; }
  to { box-shadow: 0 0 20px #00ff9150, 0 0 5px #00ff91; }
}

.window-body p,
.window-body small,
.window-body code {
  color: #eaffea;
  animation: fadeintext 1.2s;
}

.window-body small, .window-body .text-muted {
  color: #b6ffe1 !important;
  opacity: 0.84;
  font-size: .92em;
  font-style: italic;
  letter-spacing: 0.01em;
  transition: color 0.2s;
  background: rgba(0,255,145,0.04);
  border-radius: 3px;
  padding: 0 .18em;
  margin-top: .45em;
  display: inline-block;
  animation: fadeintext 1.3s;
}


.window-body p strong,
.window-body code {
  color: #00ff91;
  font-weight: 600;
  text-shadow: 0 0 4px #00ff91;
  background: rgba(0,255,145,0.07);
  border-radius: .25rem;
  padding: 0 .2rem;
}

.window-body .btn,
.window-body .btn-outline-info,
.window-body .btn-outline-primary {
  font-family: "Share Tech Mono", monospace;
  font-size: 1.01rem;
  border-radius: .35rem;
  border-width: 2px;
  transition: box-shadow 0.22s, background 0.18s;
  box-shadow: 0 0 8px #00ff9122;
  position: relative;
  z-index: 2;
}
.window-body .btn-outline-info:hover,
.window-body .btn-outline-primary:hover {
  color: #111;
  background: #00ff91;
  border-color: #00ff91;
  box-shadow: 0 0 20px #00ff91bb, 0 1.5px 8px #00ff9144;
  text-shadow: none;
}

/* Linkedin icon: forced color & animated */
.window-body .bi-linkedin {
  fill: #00a0dc !important;
  color: #00a0dc !important;
  filter: drop-shadow(0 0 5px #00c3ff99);
  width: 19px;
  height: 19px;
  vertical-align: -3px;
  transition: filter 0.18s;
}
.window-body .btn-outline-primary:hover .bi-linkedin {
  filter: drop-shadow(0 0 9px #00e5ff) brightness(1.2);
}

@keyframes fadeintext {
  from { opacity: 0; transform: translateY(6px);}
  to { opacity: 1; transform: none;}
}

/* Matrix effect: solo LinkedIn card */
.matrix-bg {
  position: relative;
}
.matrix-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 255, 140, .08) 0 1px,
    transparent 1px 3px
  );
  pointer-events: none;
  z-index: 1;
}
.matrix-code {
  font-family: "Fira Code", monospace;
  color: #00ff9c;
  font-size: .75rem;
  line-height: .77rem;
  opacity: .45;
  user-select: none;
  z-index: 2;
  pointer-events: none;
}

/* Responsive card padding */
@media (max-width: 700px) {
  .window-body { padding: .88rem .8rem 1.05rem .8rem; font-size: .98rem; }
  .window-card { margin-bottom: 1.2rem; }
}
