:root {
  --bg: #0a0a0a;         /* Nero profondo */
  --bg-alt: #121212;     /* Grigio scurissimo */
  --text: #e0e0e0;       /* Bianco sporco per riposare gli occhi */
  --muted: #707070;      /* Grigio per testi secondari */
  --accent: #ffffff;     /* Bianco puro per elementi attivi */
  --border: #262626;     /* Bordi sottili e scuri */
  --code-bg: #1a1a1a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

/* Navigazione minimale */
.top-nav {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.nav-menu {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  gap: 2rem;
}

.nav-menu a {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-menu a:hover { color: var(--accent); }

/* Main Content */
main {
  max-width: 850px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

section { margin-bottom: 5rem; }

h2 {
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  display: inline-block;
  padding-bottom: 0.3rem;
}

/* ASCII ART Logo */
pre {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.85rem;
  line-height: 1.1;
  background: transparent;
  color: var(--accent);
  overflow-x: auto;
  white-space: pre;
  padding: 0;
  margin: 0 0 3rem 0;
  border: none;
}

/* Tabella semplificata */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-alt);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

code {
  font-family: monospace;
  background: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  color: var(--accent);
  white-space: nowrap;
}

/* Permette al codice dentro le celle di andare a capo su mobile */
td code {
  white-space: normal;
  word-break: break-word;
}

/* Link e Bottoni */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.btn:hover {
  background: var(--accent);
  color: var(--bg);
}

.sheet-preview {
  position: relative;
  display: block;
  border: 1px solid var(--border);
  filter: grayscale(1); /* Effetto minimale: diventa colorato solo al passaggio */
  transition: filter 0.3s ease;
}

.sheet-preview:hover { filter: grayscale(0); }

.sheet-preview img { width: 100%; display: block; }

footer {
  text-align: center;
  padding: 4rem 2rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.muted { color: var(--muted); font-size: 0.9rem; }

/* Release body (Markdown renderizzato) */
.release-body h1,
.release-body h2,
.release-body h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin: 1.5rem 0 0.5rem;
  border: none;
  display: block;
  padding: 0;
}

.release-body ul {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.release-body li {
  margin-bottom: 0.3rem;
  color: var(--text);
}

.release-body p {
  margin: 0.5rem 0;
}

.release-body code {
  font-family: monospace;
  background: var(--code-bg);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  color: var(--accent);
  font-size: 0.85em;
}

.release-body strong {
  color: var(--accent);
  font-weight: 600;
}

.hero { margin-bottom: 5rem; }

.hero-inner {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.hero-logo {
  font-family: ui-monospace, "SF Mono", "Noto Sans Mono", Menlo, "Courier New", monospace;
  font-size: clamp(0.52rem, 1.6vw, 0.85rem);
  line-height: 1.1;
  letter-spacing: 0;         
  font-variant-ligatures: none;
  -webkit-font-smoothing: none; 
  background: transparent;
  color: var(--accent);
  white-space: pre;
  padding: 0;
  margin: 0;
  border: none;
  flex-shrink: 0;
  overflow: hidden;
}

.hero-tagline {
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(0.72rem, 1.4vw, 0.85rem);
  line-height: 1.7;
  color: var(--text);
  margin: 0;
  white-space: normal;
  min-width: 0; 
}

/* ── Stili base per il Burger Menu (Nascosto su Desktop) ── */
.burger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
  z-index: 100;
}

.burger-line {
  display: block;
  width: 25px;
  height: 2px;
  background-color: var(--text);
  transition: all 0.3s ease;
}

/* ── Changelog back link ─────────────────────────────────────── */
.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }

/* ── Articles grid ───────────────────────────────────────────── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.article-card {
  border: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color 0.2s;
}

.article-card:hover { border-color: var(--accent); }

.article-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.article-title {
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
  color: var(--accent);
  border: none;
  display: block;
  padding: 0;
}

.article-title a {
  color: inherit;
  text-decoration: none;
}

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

.article-date {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: auto;
}

/* h1 for inner pages */
h1 {
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* ── Previene il glitch grafico di caricamento (Layout Shift) ── */
site-nav, site-footer {
  display: block;
}

/* Riserva lo spazio visivo esatto prima ancora che il JS si attivi */
site-nav:not(:defined) {
  height: 73px; /* Altezza della navbar su desktop */
  border-bottom: 1px solid var(--border);
}

/* Navbar mobile e Responsive Layout (Max 600px) ──────────────── */
@media (max-width: 600px) {

  site-nav:not(:defined) {
    height: 58px; /* Altezza della navbar su mobile */
  }

  /* Fa scorrere il testo dell'hero sotto il logo ASCII */
  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  /* Impostazioni Navbar mobile */
  .top-nav {
    display: flex;
    justify-content: flex-end; 
    padding: 1rem;
    position: relative;
  }

  .burger-btn {
    display: flex;
  }

  /* Animazione Hamburger a X */
  .burger-btn.active .burger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .burger-btn.active .burger-line:nth-child(2) { opacity: 0; }
  .burger-btn.active .burger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Trasformazione menu in tendina a comparsa */
  .nav-menu {
    display: none; 
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
    gap: 1.5rem;
    text-align: center;
    z-index: 99;
  }

  /* Mostra la tendina se attiva */
  .nav-menu.active {
    display: flex; 
  }

  .nav-menu a {
    font-size: 1.1rem;
    letter-spacing: 1px;
  }

  /* ── Tabella responsive: ogni riga diventa una card ── */
  .table-container {
    border: none;
  }

  table, thead, tbody, th, td, tr {
    display: block;
  }

  /* Nasconde l'header originale ma lo lascia accessibile agli screen reader */
  thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  tbody tr {
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    background: var(--bg-alt);
    padding: 0;
  }

  td {
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
  }

  td:last-child {
    border-bottom: none;
  }

  /* Etichetta della colonna sopra il valore */
  td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    margin-bottom: 0.35rem;
  }
}


/* ── Link nel Footer ── */
.footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem; /* Spazio tra logo e testo */
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--accent);
}

.reddit-icon {
  width: 1.2rem;
  height: 1.2rem;
}