/* ══════════════════════════════════════════
   PORTFOLIO — stylesheet
   Font system ripreso da style.css (Mutable Net):
   Body:        Lunchtype22
   Titoli/label: Lunchtype25 Condensed
   Corsivo:     Lunchtype23 Medium Italic
   Colori:      invariati (grigio + blu / cyberspace verde)
   ══════════════════════════════════════════ */

/* ── FONT FACES (cartella fonts/) ── */
@font-face {
  font-family: 'Lunchtype22';
  src: url('fonts/Lunchtype22-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal;
}
@font-face {
  font-family: 'Lunchtype23';
  src: url('fonts/Lunchtype23-Medium-Italic.ttf') format('truetype');
  font-weight: 500; font-style: italic;
}
@font-face {
  font-family: 'Lunchtype25';
  src: url('fonts/Lunchtype25-Light_Condensed.ttf') format('truetype');
  font-weight: 300; font-style: normal;
}
@font-face {
  font-family: 'Lunchtype25';
  src: url('fonts/Lunchtype25-Regular_Condensed.ttf') format('truetype');
  font-weight: 400; font-style: normal;
}
@font-face {
  font-family: 'Lunchtype25';
  src: url('fonts/Lunchtype25-Medium-Condensed.ttf') format('truetype');
  font-weight: 500; font-style: normal;
}

  :root {
    --bg-primary: #b5b5b5;
    --text-primary: #0000ff;

    --font-body:   'Lunchtype22', 'Helvetica Neue', sans-serif;
    --font-italic: 'Lunchtype23', 'Helvetica Neue', sans-serif;
    --font-label:  'Lunchtype25', 'Helvetica Neue', sans-serif;

    /* spessore di filetti e contorni immagini */
    --line: 1.5px;
  }

  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  /* bold → Lunchtype22 weight 500, mai italic */
  strong, b {
    font-family: var(--font-body);
    font-weight: 500;
    font-style: normal;
  }
  em, i {
    font-family: var(--font-italic);
    font-style: italic;
    font-weight: 500;
  }

  /* titoletti delle sezioni a sinistra: stesso font dei titoli progetto */
  .history-column em,
  .about-content em {
    font-family: var(--font-label);
    font-style: normal;
    font-weight: 500;
    letter-spacing: 0.01em;
  }
  h1, h2 {
    font-family: var(--font-label);
    font-weight: 500;
    font-size: 26px;
    line-height: 1.1;
  }
  h3, h4 {
    font-family: var(--font-label);
    font-weight: 500;
    font-size: 18px;
    line-height: 1.2;
  }
  p {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.2;
  }

  body {
    display: flex;
    flex-direction: row;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 18px;
    line-height: 1.2;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
  }

  a {
    color: var(--text-primary);
    text-decoration: underline;
    cursor: crosshair;
  }

  button,
  .portfolio-item img,
  .about-button,
  .close-about,
  .close,
  .gallery img,
  .gallery video {
    cursor: crosshair;
  }

  header.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--bg-primary);
    padding: 20px 30px;
    z-index: 100;
    border-bottom: var(--line) solid var(--text-primary);
  }

  header.site-header .header-title {
    font-family: var(--font-label);
    font-size: 26px;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1;
  }

  header.site-header .header-title a {
    color: var(--text-primary);
    text-decoration: none;
  }

  header.site-header .header-title a:hover {
    text-decoration: underline;
  }

  .history-column {
    width: 25%;
    padding: 40px 20px;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    border-right: var(--line) solid var(--text-primary);
  }

  .history-column p {
    margin-bottom: 12px;
    font-size: 18px;
    line-height: 1.2;
  }

  .history-column p.emoji {
    font-size: 2rem;
    line-height: 1.2;
  }

  .main-column {
    flex: 1;
    padding: 120px 3vw 40px;
    max-width: 1200px;
    margin: 0 auto;
  }

  .project-title {
    font-family: var(--font-label);
    font-size: 26px;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin-bottom: 20px;
  }

  .project-description {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.2;
    margin-bottom: 30px;
    width: 100%;
  }

  .intro-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 30px;
    width: 100%;
  }

  .intro-col-left {
    flex: 1.2;
    min-width: 240px;
    max-width: 400px;
  }

  .intro-col-right {
    flex: 2.8;
    min-width: 500px;
  }

  .gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    width: 100%;
  }

  /* immagini: normali → bitmap ad alto contrasto in hover (come style.css) */
  .gallery img,
  .gallery video {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: var(--line) solid var(--text-primary);
    transition: filter 0.2s ease;
  }

  .gallery img:hover,
  .gallery video:hover {
    filter: grayscale(1) contrast(10) brightness(0.8);
  }

  .gallery .horizontal {
    width: 100%;
  }

  .gallery .vertical,
  .gallery .half-horizontal {
    width: calc(50% - 15px);
  }

  .lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 255, 0.7);
    justify-content: center;
    align-items: center;
  }

  .lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    /* nessun filtro hover dentro la lightbox */
    filter: none !important;
    transition: none !important;
  }

  .lightbox .close {
    position: absolute;
    top: 30px;
    right: 30px;
    color: #fff;
    font-family: var(--font-label);
    font-size: 26px;
    font-weight: 500;
  }

  .lightbox .close:hover {
    color: #b5b5b5;
  }

  .about-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--text-primary);
    border-radius: 20px;
    padding: 10px 20px;
    font-family: var(--font-label);
    font-size: 18px;
    font-weight: 500;
    display: none;
    z-index: 200;
  }

  .about-modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 255, 0.2);
    overflow-y: auto;
  }

  .about-content {
    background: var(--bg-primary);
    margin: 5% auto;
    padding: 20px;
    border: 2px solid var(--text-primary);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
  }

  @media (max-width: 768px) {
    body {
      flex-direction: column;
    }

    .history-column {
      display: none;
    }

    .about-button {
      display: block;
    }

    .main-column {
      width: 100%;
      padding: 100px 20px 40px;
    }

    .gallery .vertical,
    .gallery .half-horizontal {
      width: 100%;
    }

    .intro-columns {
      flex-direction: column;
    }

    .intro-col-left,
    .intro-col-right {
      max-width: 100%;
      min-width: auto;
    }

    .intro-col-right p {
      word-wrap: break-word;
    }

    .about-modal {
      background: var(--bg-primary);
      z-index: 9999;
    }

    .about-content {
      width: 100% !important;
      max-width: 100% !important;
      height: 100%;
      max-height: none !important;
      border-radius: 0 !important;
      border: none !important;
      padding: 30px 20px 20px !important;
      overflow-y: auto;
      padding-top: 80px !important;
    }

    .about-content .header-title {
      margin-top: 0 !important;
      padding-left: 30px;
      text-align: left !important;
    }

    .about-content .about-back-button {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      padding: 20px 30px;
      background: var(--bg-primary);
      border-bottom: var(--line) solid var(--text-primary);
      z-index: 10000;
    }

    .about-content .about-back-button a {
      font-size: 26px;
      font-weight: 500;
      font-family: var(--font-label);
      color: var(--text-primary);
      text-decoration: none;
    }

    .about-content .about-back-button a:hover {
      text-decoration: underline;
    }
  }

  /* 🌗 Toggle switch slider */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: crosshair;
  top: 0; left: 0;
  right: 0; bottom: 0;
  background-color: #0000ff;
  transition: .4s;
  border-radius: 30px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px; width: 20px;
  left: 4px; bottom: 4px;
  background-color: #b5b5b5;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #00ff00;
}
input:checked + .slider:before {
  transform: translateX(22px);
  background-color: #000000;
}

/* 🌙 Modalità verde attiva */
body.cyberspace-mode {
  --bg-primary: #000000;
  --text-primary: #00ff00;
}

body.cyberspace-mode a {
  color: var(--text-primary);
}

/* Popup centrale */
#mode-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: black;
  color: #00ff00;
  padding: 16px 28px;
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 18px;
  text-align: center; /* ✅ centratura testo */
  z-index: 100000;
  border: 2px solid #00ff00;
  border-radius: 14px;
  display: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
#mode-popup.active {
  display: block;
  opacity: 1;
}

/* 🟢 Modalità Cyberspace Green – Lightbox */
body.cyberspace-mode .lightbox {
  background: rgba(0, 0, 0, 0.9) !important; /* sfondo nero trasparente */
}

body.cyberspace-mode .lightbox .close {
  color: #00ff00 !important; /* X verde fluo */
}

body.cyberspace-mode .lightbox .close:hover {
  color: #00ff00 !important;
}

body.cyberspace-mode .lightbox img {
  filter: none !important;
}

/* ══════════════════════════════════════════════════════════════
   INDEX — griglia progetti (ex <style> inline di index.html)
   Tutto scoped su .portfolio-item / .portfolio-columns per non
   collidere con .project-title / .project-description delle
   pagine progetto. Font e effetto immagini come style.css.
   ══════════════════════════════════════════════════════════════ */

/* Galleria DESKTOP */
.portfolio-columns {
  display: flex;
  gap: 35px;
}

.column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 35px;
}

/* Galleria MOBILE nascosta di default */
.portfolio-mobile {
  display: none;
}

.portfolio-item {
  text-align: center;
}

/* immagini: normali → bitmap ad alto contrasto in hover (come style.css) */
.portfolio-item img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
  border: var(--line) solid var(--text-primary);
  cursor: crosshair;
  transition: filter 0.2s ease;
}

.portfolio-item img:hover {
  filter: grayscale(1) contrast(10) brightness(0.8);
}

/* titolo card: Lunchtype25 Medium (come .card-name) */
.portfolio-item .project-title {
  display: block;
  margin: 10px 0 0;
  font-family: var(--font-label);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--text-primary);
  word-wrap: break-word;
}

.portfolio-item .project-title strong {
  font-family: var(--font-label);
  font-weight: 500;
}

.portfolio-item .project-title:hover {
  text-decoration: underline;
}

/* descrizione: Lunchtype22 (come .card-sub ma col corpo del testo) */
.portfolio-item .project-description {
  width: auto;
  max-width: 90%;
  margin: 4px auto 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.3;
}

.portfolio-item .project-year {
  display: block;
  margin-top: 4px;
  font-family: var(--font-label);
  font-size: 14px;
  letter-spacing: 0.04em;
}

/* "+" mirino al centro dell'immagine */
.project-plus {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: monospace;
  font-size: 30px;
  font-weight: 190;
  line-height: 1;
  color: var(--text-primary);
  -webkit-text-stroke: 1px #fff;
  pointer-events: none;
  z-index: 10;
}

/* ── EFFETTO IMMAGINI UNIVERSALE (come style.css: img:hover) ──
   qualsiasi immagine/video di qualsiasi pagina → bitmap ad alto contrasto.
   Il velo colorato (.project-overlay, sotto) lo trasforma in duotone. */
img,
video {
  transition: filter 0.2s ease;
}

img:hover,
video:hover {
  filter: grayscale(1) contrast(10) brightness(0.8);
}

/* Markup SENZA script per le altre pagine: avvolgi il media e metti il velo
   subito dopo. La classe di formato (vertical / half-horizontal / horizontal)
   va sul wrapper.
   <div class="img-fx vertical"><img src="…"><div class="project-overlay"></div></div> */
.img-fx {
  position: relative;
  display: block;
}

.img-fx > img,
.img-fx > video {
  display: block;
  width: 100%;
  height: auto;
}

.gallery .img-fx.horizontal {
  width: 100%;
}

.gallery .img-fx.vertical,
.gallery .img-fx.half-horizontal {
  width: calc(50% - 15px);
}

@media (max-width: 768px) {
  .gallery .img-fx.vertical,
  .gallery .img-fx.half-horizontal {
    width: 100%;
  }
}

/* duotone in hover: sull'immagine già in bianco/nero ad alto contrasto,
   l'overlay con mix-blend-mode: screen trasforma il NERO nel colore del
   tema (blu elettrico / verde fluo) e lascia i chiari com'erano.
   Si attiva solo in hover sull'immagine, in sync con il filtro. */
.project-overlay {
  position: absolute;
  inset: 0;
  background: var(--text-primary);
  mix-blend-mode: screen;
  border-radius: 12px;
  opacity: 0 !important;            /* !important: lo script scrive opacity inline */
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 3;
}

img:hover + .project-overlay,
video:hover + .project-overlay {
  opacity: 1 !important;
}

/* Cyberspace Green: duotone inverso — il NERO resta nero, il BIANCO diventa
   verde fluo (multiply col verde; brightness 1 così i chiari sono pieni) */
body.cyberspace-mode img:hover,
body.cyberspace-mode video:hover {
  filter: grayscale(1) contrast(10) brightness(1);
}

body.cyberspace-mode .project-overlay {
  background: #00ff00;
  mix-blend-mode: multiply;
}

/* Loading screen: tinta piena con messa a fuoco */
#loading-screen {
  position: fixed;
  inset: 0;
  background: #0000ff;
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, backdrop-filter 0.8s ease;
  will-change: opacity, backdrop-filter;
}

#loading-screen.active {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(0px);
}

#loading-screen,
#loading-screen * {
  cursor: crosshair !important;
}

/* mirino bianco, statico */
#loading-screen .loading-plus {
  position: relative;
  width: 30px;
  height: 30px;
}

#loading-screen .loading-plus::before,
#loading-screen .loading-plus::after {
  content: '';
  position: absolute;
  background: #fff;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#loading-screen .loading-plus::before { width: 2px;  height: 20px; }
#loading-screen .loading-plus::after  { width: 20px; height: 2px;  }

/* ── Index: modalità Cyberspace Green ── */
#loading-screen.cyberspace-mode {
  background: #00ff00;
}

#loading-screen.cyberspace-mode .loading-plus::before,
#loading-screen.cyberspace-mode .loading-plus::after {
  background: #000 !important;
}

body.cyberspace-mode .project-plus {
  color: #00ff00 !important;
  -webkit-text-stroke: 1px #000 !important;
}

/* ── Index: mobile ── */
@media (max-width: 768px) {
  .portfolio-columns {
    display: none;
  }

  .portfolio-mobile {
    display: flex;
    flex-direction: column;
    gap: 35px;
  }

  .close-about {
    position: absolute;
    top: 20px;
    right: 20px;
    font-family: var(--font-label);
    font-size: 26px;
    font-weight: 500;
    color: var(--text-primary);
    z-index: 10000;
  }
}