/* ==========================================================
   SPAZIO — HOME RETRO
   Stile anni '90 / pixel / quasi monocromatico
   ========================================================== */

:root {
  --bg: #2d3135;
  --bg-2: #3a3f44;
  --panel: #d1d1d1;
  --panel-light: #ededed;
  --panel-dark: #90959a;
  --ink: #111317;
  --ink-soft: #33383e;
  --line: #0f1114;
  --white: #f7f7f4;

  /* Colore solo per piccoli dettagli e icone */
  --pink: #ff4f8a;
  --cyan: #26d6d6;
  --yellow: #ffd45d;
  --green: #34d16c;
  --blue: #4d7cff;
  --purple: #7d64ff;

  --shadow: 4px 4px 0 rgba(0, 0, 0, 0.78);
  --radius: 0px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: #23272b;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  padding-top: 48px;
  color: var(--ink);
  background-color: #23272b;
  background-image:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.07), transparent 32rem),
    linear-gradient(180deg, #3e444a 0, #2b2f33 45%, #23272b 100%);
  background-repeat: no-repeat;
  font-family: "Courier New", "Lucida Console", monospace;
  font-weight: 700;
  letter-spacing: -0.02em;
  image-rendering: pixelated;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: .16;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(0, 0, 0, 0) 0,
      rgba(0, 0, 0, 0) 3px,
      rgba(0, 0, 0, .33) 4px
    );
  mix-blend-mode: multiply;
}

.page-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  opacity: .07;
  background-image:
    repeating-radial-gradient(circle at 0 0, #000 0 1px, transparent 1px 3px);
  background-size: 5px 5px;
}

/* =========================
   LAYOUT
   ========================= */

.site-shell {
  width: min(1500px, calc(100% - 44px));
  margin: 0 auto 16px;
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(330px, .82fr);
  gap: 20px;
  align-items: stretch;
}

.main-column,
.sidebar {
  min-width: 0;
}

/*
 * La colonna sinistra si estende sempre fino all'altezza della sidebar.
 * Chi sono + Novità restano in fondo; tutto lo spazio aggiuntivo viene
 * assorbito dalla finestra BENVENUTO.
 */
.main-column {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 18px;
  align-self: stretch;
}

.sidebar {
  display: grid;
  gap: 18px;
  align-content: start;
}

.lower-grid {
  margin-top: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

/* =========================
   FINESTRA RETRO
   ========================= */

.retro-window {
  min-width: 0;
  overflow: hidden;
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow:
    inset 2px 2px 0 var(--white),
    inset -2px -2px 0 #6d7175,
    var(--shadow);
}

.window-titlebar {
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  border-bottom: 2px solid #111;
  background:
    repeating-linear-gradient(
      180deg,
      #dadada 0 2px,
      #b7b7b7 2px 4px
    );
}

.window-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .96rem;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
}

.window-title > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-date {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

#current-time {
  color: var(--ink-soft);
}

.title-icon {
  flex: 0 0 auto;
  font-size: 1.05rem;
  color: var(--yellow);
  -webkit-text-stroke: .6px #111;
}

.window-controls {
  flex: 0 0 auto;
  display: flex;
  gap: 7px;
}

.control {
  width: 12px;
  height: 12px;
  border: 2px solid #151515;
  border-radius: 50%;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.7);
}

.control-pink { background: var(--pink); }
.control-yellow { background: var(--yellow); }
.control-cyan { background: var(--cyan); }


/* =========================
   HERO
   ========================= */

/*
 * La finestra hero è l'elemento elastico della colonna sinistra.
 * Quando la sidebar diventa più lunga, cresce questa finestra e non
 * viene creato spazio vuoto sotto Chi sono / Novità.
 */
.hero-window {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.hero-window .window-titlebar {
  flex: 0 0 auto;
}

.hero-scene {
  position: relative;
  flex: 1 1 auto;
  min-height: 515px;
  overflow: hidden;
  isolation: isolate;
  color: #f7f7f4;
  background:
    linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.18)),
    url("/assets/images/hero-bg.webp") center center / cover no-repeat;
}


.hero-copy {
  position: relative;
  z-index: 2;
  width: 90%;
  max-width: none;
  padding: 86px 0 0 10%;
  text-shadow: 3px 3px 0 rgba(0,0,0,.5);
}

.eyebrow {
  display: inline-block;
  margin: 0 0 15px;
  padding: 4px 7px;
  color: #111;
  background: #dedede;
  border: 2px solid #111;
  text-shadow: none;
  font-size: clamp(.95rem, 1.55vw, 1.3rem);
  font-weight: 900;
  line-height: 1.55;
  letter-spacing: .08em;
  text-transform: uppercase;
}


.spotify-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #111;
  background: #d8d8d8;
  border: 3px solid #111;
  box-shadow: inset 2px 2px 0 #fff,
    inset -2px -2px 0 #777,
    3px 3px 0 rgba(0,0,0,.7);
  text-decoration: none;
  text-shadow: none;
  flex: 0 0 auto;
  padding: 10px 13px;
  white-space: nowrap;
  font-size: .78rem;
}


.spotify-button:hover,
.spotify-button:focus-visible {
  color: #fff;
  background: #33383d;
  outline: none;
}


/* =========================
   ABOUT
   ========================= */

.about-content {
  padding: 18px;
}

.about-text {
  min-width: 0;
  font-size: 0;
}

.about-text::after {
  content: "";
  display: block;
  clear: both;
}

.about-photo {
  float: left;
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 12px 4px 0;
  object-fit: contain;
  object-position: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  image-rendering: auto;
}

.about-text p {
  margin: 0 0 12px;
  font-size: .84rem;
  line-height: 1.5;
}

.about-text p:last-child {
  margin-bottom: 0;
}

/* =========================
   LISTE SIDEBAR
   ========================= */


.menu-list > a {
  color: var(--ink);
  text-decoration: none;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) 18px;
  gap: 9px;
  align-items: center;
  min-height: 63px;
  padding: 7px 12px;
}

.menu-list > a:visited {
  color: var(--ink);
}

.menu-list a:hover,
.menu-list a:focus-visible {
  color: var(--ink);
  background: #b5b8bb;
  outline: none;
}

.menu-list a > span:nth-child(2) {
  min-width: 0;
}

.menu-list strong,
.menu-list small {
  display: block;
}

.menu-list strong {
  margin-bottom: 2px;
  font-size: .92rem;
  font-weight: 900;
}

.menu-list small {
  color: var(--ink-soft);
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.22;
}


.menu-list {
  padding: 6px 0;
}


.menu-icon {
  width: 37px;
  min-height: 37px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  color: #111;
  border: 2px solid #111;
  background: #f0f0ee;
  box-shadow:
    inset 2px 2px 0 #fff,
    inset -2px -2px 0 #838383;
  text-align: center;
}

.menu-icon-image {
  padding: 4px;
}

.menu-icon-image img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 27px;
  max-height: 27px;
  object-fit: contain;
  image-rendering: pixelated;
}

.menu-list b {
  font-size: 1.8rem;
  line-height: 1;
}

.title-icon-image {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
}

.title-icon-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.icon-agri { color: var(--green); }
.icon-code { color: var(--cyan); font-size: .82rem; }
.icon-tools { color: var(--yellow); }
.icon-spotify { color: var(--green); }
.icon-discord { color: var(--purple); }
.icon-github { color: #171717; }
.icon-chatgpt { color: var(--green); }
.icon-linkedin { color: var(--blue); font-size: 1rem; }

/* =========================
   PLAYER AUDIO LOCALE
   ========================= */

.music-player {
  width: min(1500px, calc(100% - 44px));
  margin: 18px auto 16px;
}

#site-audio {
  display: none;
}

.player-content {
  display: grid;
  grid-template-columns:
    72px
    minmax(170px, .8fr)
    50px
    190px
    minmax(270px, 1.25fr)
    auto;
  gap: 18px;
  align-items: center;
  padding: 12px 16px 14px;
}

.album-art {
  position: relative;
  width: 72px;
  height: 72px;
  min-width: 72px;
  min-height: 72px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  justify-self: start;
  border: 3px solid #111;
  background: #171b1f;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.38);
}

.album-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.track-info {
  min-width: 0;
}

.track-info strong,
.track-info small {
  display: block;
}

.track-info strong {
  margin-bottom: 4px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-info small {
  color: #3e4348;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-icon-button,
.player-controls button,
.volume-inline-button {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.player-icon-button {
  width: 42px;
  height: 42px;
  font-size: 1.7rem;
}

.player-icon-button[aria-pressed="true"] {
  color: var(--pink);
}

.player-icon-button:hover,
.player-controls button:hover,
.volume-inline-button:hover,
.player-icon-button:focus-visible,
.player-controls button:focus-visible,
.volume-inline-button:focus-visible {
  background: #aaaeb1;
  outline: 2px solid #111;
  outline-offset: -1px;
}

.player-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.player-controls button {
  width: 44px;
  height: 42px;
  font-size: 1.2rem;
}

.progress-block {
  min-width: 0;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: .78rem;
}

.pixel-range {
  width: 100%;
  height: 14px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

.pixel-range::-webkit-slider-runnable-track {
  height: 9px;
  border: 2px solid #111;
  background: #b8b9b9;
  box-shadow: inset 1px 1px 0 #eee;
}

.pixel-range::-webkit-slider-thumb {
  width: 12px;
  height: 19px;
  margin-top: -7px;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid #111;
  border-radius: 0;
  background: #d7d7d7;
  box-shadow:
    inset 1px 1px 0 #fff,
    inset -1px -1px 0 #777;
}

.pixel-range::-moz-range-track {
  height: 5px;
  border: 2px solid #111;
  border-radius: 0;
  background: #b8b9b9;
}

.pixel-range::-moz-range-thumb {
  width: 10px;
  height: 17px;
  border: 2px solid #111;
  border-radius: 0;
  background: #d7d7d7;
}

.volume-control {
  display: grid;
  grid-template-columns: 42px minmax(90px, 180px);
  align-items: center;
  justify-content: end;
  gap: 8px;
  margin-top: 9px;
}

.volume-inline-button {
  width: 38px;
  height: 30px;
}

.volume-slider {
  height: 12px;
}


.music-player .window-controls {
  margin-left: auto;
}

/* =========================
   FOOTER + TOAST
   ========================= */

.site-footer {
  width: min(1500px, calc(100% - 44px));
  margin: 0 auto 30px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 5px 0;
  color: #d5d6d6;
  font-size: .76rem;
}

.status-led {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-led i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  border: 1px solid #101010;
  box-shadow: 0 0 8px rgba(52,209,108,.65);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10000;
  transform: translate(-50%, 25px);
  padding: 11px 14px;
  color: #111;
  background: #e5e5e2;
  border: 3px solid #111;
  box-shadow: 4px 4px 0 rgba(0,0,0,.75);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s linear, transform .15s linear;
  font-size: .8rem;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* =========================
   ACCESSO DISCORD (pop-up)
   ========================= */

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(17, 19, 23, .72);
}

.login-overlay[hidden] {
  display: none;
}

.login-window {
  width: min(430px, 100%);
}

.login-close {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  font: inherit;
  font-size: 1rem;
  font-weight: 900;
  color: #111;
  background: #d8d8d8;
  border: 2px solid #111;
  box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #777;
  cursor: pointer;
}

.login-close:hover,
.login-close:focus-visible {
  color: #fff;
  background: #33383d;
  outline: none;
}

.login-body {
  padding: 16px 18px 18px;
  color: var(--ink);
}

.login-area {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 2px dashed #8b8f94;
}

.login-area strong,
.login-area small {
  display: block;
}

.login-area strong {
  font-size: 1rem;
  font-weight: 900;
}

.login-area small {
  color: var(--ink-soft);
  font-size: .78rem;
  font-weight: 700;
}

.login-heading {
  margin: 0 0 6px;
  font-size: .95rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.login-message {
  margin: 0;
  font-size: .86rem;
  font-weight: 700;
  line-height: 1.45;
}

.login-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
  padding: 8px 10px;
  background: #f0f0ee;
  border: 2px solid #111;
  box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #9a9a9a;
  font-size: .82rem;
  font-weight: 900;
}

.login-user img {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  object-fit: cover;
  border: 2px solid #111;
  background: #5865f2;
}

.login-user span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-user small {
  display: block;
  color: var(--ink-soft);
  font-weight: 700;
}

.login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.login-actions form {
  display: contents;
}

.login-actions .spotify-button {
  font: inherit;
  font-size: .78rem;
  font-weight: 900;
  cursor: pointer;
}

.login-actions .spotify-button img {
  width: 18px;
  height: 18px;
}

.login-actions .is-primary,
.login-actions .is-primary:visited {
  color: #fff;
  background: #4f5bd5;
  box-shadow: inset 2px 2px 0 #8b94ff, inset -2px -2px 0 #2f3790, 3px 3px 0 rgba(0,0,0,.7);
}

.login-actions .is-primary:hover,
.login-actions .is-primary:focus-visible {
  color: #fff;
  background: #33383d;
  box-shadow: inset 2px 2px 0 #555, inset -2px -2px 0 #111, 3px 3px 0 rgba(0,0,0,.7);
}

.login-note {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: .72rem;
  font-weight: 700;
}

.login-cursor::after {
  content: "_";
  animation: login-blink 1s steps(1) infinite;
}

@keyframes login-blink {
  50% { opacity: 0; }
}

/* Riga account in fondo alla finestra Categorie */
.login-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-top: 2px solid #111;
  background: #c4c6c8;
  font-size: .76rem;
  font-weight: 900;
}

.login-status[hidden] {
  display: none;
}

.login-status span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-status span::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border: 2px solid #111;
  background: #90959a;
  vertical-align: -1px;
}

.login-status.is-online span::before {
  background: #5865f2;
}

.login-status form {
  margin: 0;
}

.login-status a,
.login-status button {
  display: inline-block;
  padding: 4px 8px;
  font: inherit;
  font-size: .72rem;
  font-weight: 900;
  color: #111;
  text-decoration: none;
  background: #d8d8d8;
  border: 2px solid #111;
  box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #777;
  cursor: pointer;
}

.login-status a:visited {
  color: #111;
}

.login-status a:hover,
.login-status a:focus-visible,
.login-status button:hover,
.login-status button:focus-visible {
  color: #fff;
  background: #33383d;
  outline: none;
}

/* =========================
   ACCESSIBILITÀ
   ========================= */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }

  .login-cursor::after {
    animation: none;
  }
}
