/* =========================================
   RING ZERO PIRATE — main.css
   Cyberpunk terminal brutalismo
   ========================================= */

/* ── Variables ─────────────────────────── */
:root {
  --bg:           #030305;
  --bg-panel:     #0a0a12;
  --bg-card:      #0d0d18;
  --border:       #1a1a2e;
  --border-glow:  #00ff4133;

  --green:        #00ff41;
  --green-dim:    #00cc33;
  --green-dark:   #003d0f;
  --cyan:         #00d4ff;
  --cyan-dim:     #0099bb;
  --red:          #ff0040;
  --red-dim:      #cc0033;
  --yellow:       #ffd700;
  --purple:       #bf00ff;

  --text:         #b0b8c8;
  --text-bright:  #e8eaf0;
  --text-dim:     #555a70;

  --font-mono:    'Space Mono', monospace;
  --font-display: 'Orbitron', monospace;
  --font-body:    'IBM Plex Sans', sans-serif;
  --font-code:    'Fira Code', monospace;

  --radius:       2px;
  --glow-green:   0 0 8px #00ff4180, 0 0 20px #00ff4130;
  --glow-cyan:    0 0 8px #00d4ff80, 0 0 20px #00d4ff30;
  --glow-red:     0 0 8px #ff004080, 0 0 20px #ff004030;

  --transition:   200ms ease;
}

/* ── Reset ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Scanlines ──────────────────────────── */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,.15) 2px,
    rgba(0,0,0,.15) 4px
  );
  mix-blend-mode: multiply;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ── Typography ─────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-bright);
  letter-spacing: .04em;
}

a { color: var(--green); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--cyan); }

code, pre {
  font-family: var(--font-code);
}

/*pre {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  padding: 1.25rem;
  overflow-x: auto;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}*/
pre {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  padding: 1.25rem;
  overflow-x: auto;          /* scroll solo sul codice */
  border-radius: var(--radius);
  margin: 1.5rem 0;
  max-width: 100%;           /* non sfora mai il contenitore */

  /* Scrollbar verde fluo */
  scrollbar-width: thin;                        /* Firefox */
  scrollbar-color: var(--green) var(--bg-panel); /* Firefox */
}

/* Chrome / Safari / Edge */
pre::-webkit-scrollbar {
  height: 4px;
}

pre::-webkit-scrollbar-track {
  background: var(--bg-panel);
}

pre::-webkit-scrollbar-thumb {
  background: var(--green);
  border-radius: 2px;
}

pre::-webkit-scrollbar-thumb:hover {
  background: var(--green-dim);
  box-shadow: var(--glow-green);
}

code {
  background: var(--bg-panel);
  color: var(--green);
  padding: .1em .4em;
  border-radius: var(--radius);
  font-size: .88em;
}

pre code { background: transparent; padding: 0; color: inherit; }

/* ── Terminal header bar ────────────────── */
.terminal-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-bottom: none;
  padding: .5rem 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: .75rem;
  color: var(--text-dim);
}

.th-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.th-dot.red    { background: #ff5f57; }
.th-dot.yellow { background: #febc2e; }
.th-dot.green  { background: var(--green); box-shadow: var(--glow-green); }
.th-path { margin-left: .5rem; color: var(--green-dim); font-size: .78rem; }

/* ── Header ─────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(3,3,5,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: .9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  font-family: var(--font-display);
  font-size: .9rem;
  color: var(--text-bright);
  letter-spacing: .1em;
  display: flex;
  align-items: center;
  gap: .1em;
}

.logo-bracket { color: var(--green); font-size: 1.1em; }
.logo-text    { color: var(--cyan); }

.logo-link:hover .logo-text { text-shadow: var(--glow-cyan); }

.skull {
  font-size: 0.85em;
  color: var(--accent);
  opacity: 0.7;
  filter: drop-shadow(0 0 4px var(--accent));
}

/* ── Nav ────────────────────────────────── */
.main-nav { display: flex; align-items: center; }
.nav-list  { list-style: none; display: flex; gap: .25rem; }

.nav-link {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .9rem;
  font-size: .82rem;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: var(--radius);
  letter-spacing: .06em;
  transition: all var(--transition);
  position: relative;
}

.nav-link::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--green);
  transition: width var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--green);
  border-color: var(--border-glow);
  background: var(--green-dark);
}

.nav-link:hover::before,
.nav-link.active::before { width: 100%; }

.menu-icon { color: var(--green); font-size: .7em; }
.ext-arrow { font-size: .75em; opacity: .7; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--green);
  transition: all var(--transition);
}

/* ── Hero + Glitch ──────────────────────── */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 4rem 2rem;
}

.hero-inner {
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  width: 100%;
}

/* Glitch Title */
.glitch-title {
  display: flex;
  flex-direction: column;
  line-height: 1;
  margin: 1.5rem 0 1rem;
  position: relative;
}

.gt-line1 {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 10vw, 8rem);
  font-weight: 900;
  color: var(--text-bright);
  letter-spacing: -.02em;
  position: relative;
  display: block;

  animation: glitch-1 4s infinite;
}

.gt-line2 {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 10vw, 8rem);
  font-weight: 900;
  color: var(--green);
  letter-spacing: -.02em;
  text-shadow: var(--glow-green);
  display: block;

  animation: glitch-2 4s infinite .5s;
}

/* Glitch pseudo-layers */
.gt-line1::before,
.gt-line1::after,
.gt-line2::before,
.gt-line2::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.gt-line1::before { content: 'Ring Zero'; color: var(--red);  left: 2px;  animation: glitch-clip-1 4s infinite; }
.gt-line1::after  { content: 'Ring Zero'; color: var(--cyan); left: -2px; animation: glitch-clip-2 4s infinite; }
.gt-line2::before { content: 'Pirate';   color: var(--red);  left: 2px;  animation: glitch-clip-3 4s infinite .5s; }
.gt-line2::after  { content: 'Pirate';   color: var(--cyan); left: -2px; animation: glitch-clip-4 4s infinite .5s; }

@keyframes glitch-1 {
  0%, 90%, 100% { transform: translate(0); }
  92%  { transform: translate(-3px, 1px); }
  94%  { transform: translate(3px, -1px); }
  96%  { transform: translate(-1px, 2px); }
  98%  { transform: translate(2px, -2px); }
}

@keyframes glitch-2 {
  0%, 88%, 100% { transform: translate(0); }
  90%  { transform: translate(3px, -1px); }
  92%  { transform: translate(-2px, 2px); }
  94%  { transform: translate(1px, -3px); }
  96%  { transform: translate(-3px, 1px); }
}

@keyframes glitch-clip-1 {
  0%, 90%, 100% { clip-path: polygon(0 0,100% 0,100% 0,0 0); opacity: 0; }
  92% { clip-path: polygon(0 10%,100% 10%,100% 30%,0 30%); opacity: .8; }
  94% { clip-path: polygon(0 50%,100% 50%,100% 70%,0 70%); opacity: .6; }
  96% { clip-path: polygon(0 80%,100% 80%,100% 90%,0 90%); opacity: .5; }
}

@keyframes glitch-clip-2 {
  0%, 91%, 100% { clip-path: polygon(0 0,100% 0,100% 0,0 0); opacity: 0; }
  93% { clip-path: polygon(0 20%,100% 20%,100% 45%,0 45%); opacity: .7; }
  95% { clip-path: polygon(0 60%,100% 60%,100% 75%,0 75%); opacity: .5; }
}

@keyframes glitch-clip-3 {
  0%, 88%, 100% { clip-path: polygon(0 0,100% 0,100% 0,0 0); opacity: 0; }
  90% { clip-path: polygon(0 5%,100% 5%,100% 25%,0 25%); opacity: .9; }
  93% { clip-path: polygon(0 55%,100% 55%,100% 80%,0 80%); opacity: .6; }
}

@keyframes glitch-clip-4 {
  0%, 89%, 100% { clip-path: polygon(0 0,100% 0,100% 0,0 0); opacity: 0; }
  91% { clip-path: polygon(0 35%,100% 35%,100% 55%,0 55%); opacity: .8; }
  94% { clip-path: polygon(0 70%,100% 70%,100% 88%,0 88%); opacity: .5; }
}

/* Hero subtitle */
.hero-subtitle {
  font-family: var(--font-code);
  font-size: 1rem;
  color: var(--cyan-dim);
  margin-bottom: 2rem;
  letter-spacing: .05em;
}

/* Hero tags */
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2.5rem;
}

.htag {
  padding: .2em .8em;
  border: 1px solid var(--green-dark);
  color: var(--green-dim);
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: var(--radius);
  background: rgba(0,255,65,.04);
}

/* CTA buttons */
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.6rem;
  font-family: var(--font-mono);
  font-size: .85rem;
  letter-spacing: .1em;
  border-radius: var(--radius);
  border: 1px solid;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.cta-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--transition);
}

.cta-btn:hover::before { opacity: .08; }

.cta-btn.primary {
  color: var(--bg);
  background: var(--green);
  border-color: var(--green);
  text-shadow: none;
}
.cta-btn.primary:hover {
  box-shadow: var(--glow-green);
  color: var(--bg);
}

.cta-btn.secondary {
  color: var(--cyan);
  background: transparent;
  border-color: var(--cyan-dim);
}
.cta-btn.secondary:hover {
  box-shadow: var(--glow-cyan);
  color: var(--cyan);
}

.btn-cursor {
  animation: blink .8s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Hex background */
.hex-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.hex-grid {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(0,255,65,.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0,212,255,.05) 0%, transparent 40%),
    radial-gradient(circle at 60% 80%, rgba(191,0,255,.04) 0%, transparent 40%);
}

/* ── Hero title row ─────────────────────── */
.hero-title-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 4rem);
  width: 100%;
}

.hero-title-row .glitch-title {
  flex: 0 0 auto;           /* impedisce all'h1 di espandersi */
}

.ring { color: var(--text-bright); }
.zero { color: var(--cyan); text-shadow: var(--glow-cyan); }

.logo-glitch {
  flex: 0 0 auto;
  position: relative;
  width: clamp(480px, 28vw, 1024px);
  height: clamp(480px, 28vw, 1024px);
  /*mix-blend-mode: screen;*/
}

.logo-glitch img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-main {
  animation: glitch-1 4s infinite;
}

.logo-ghost-1 {
  filter: drop-shadow(2px 0 var(--red));
  opacity: 0;
  animation: logo-ghost-red 4s infinite;
}

.logo-ghost-2 {
  filter: drop-shadow(-2px 0 var(--cyan));
  opacity: 0;
  animation: logo-ghost-cyan 4s infinite;
}

@keyframes logo-ghost-red {
  0%, 90%, 100% { clip-path: polygon(0 0,100% 0,100% 0,0 0); opacity: 0; transform: translate(3px, 0); }
  92% { clip-path: polygon(0 10%,100% 10%,100% 30%,0 30%); opacity: .75; transform: translate(3px, 1px); }
  94% { clip-path: polygon(0 50%,100% 50%,100% 70%,0 70%); opacity: .55; transform: translate(-2px, -1px); }
  96% { clip-path: polygon(0 80%,100% 80%,100% 90%,0 90%); opacity: .45; transform: translate(3px, 0); }
}

@keyframes logo-ghost-cyan {
  0%, 91%, 100% { clip-path: polygon(0 0,100% 0,100% 0,0 0); opacity: 0; transform: translate(-3px, 0); }
  93% { clip-path: polygon(0 20%,100% 20%,100% 45%,0 45%); opacity: .65; transform: translate(-3px, 1px); }
  95% { clip-path: polygon(0 60%,100% 60%,100% 75%,0 75%); opacity: .45; transform: translate(2px, -1px); }
}

/* ── Latest Posts Section ───────────────── */
.latest-posts {
  max-width: 1440px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.section-title {
  font-size: 1.3rem;
  color: var(--text-bright);
  letter-spacing: .08em;
}

.sh-bracket { color: var(--green); margin-right: .4em; }

.view-all {
  font-size: .8rem;
  color: var(--text-dim);
  letter-spacing: .05em;
  transition: color var(--transition);
}
.view-all:hover { color: var(--cyan); }

/* Post cards grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: border-color var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--green);
  opacity: 0;
  transition: opacity var(--transition);
}

.post-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.post-card:hover::before { opacity: 1; }

.pc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.pc-meta {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.pc-date {
  font-size: .72rem;
  color: var(--text-dim);
  letter-spacing: .05em;
}

.pc-tags { display: flex; gap: .3rem; flex-wrap: wrap; }

.pc-tag {
  font-size: .65rem;
  color: var(--cyan-dim);
  border: 1px solid rgba(0,212,255,.2);
  padding: .1em .5em;
  border-radius: var(--radius);
  text-transform: lowercase;
}

.pc-title {
  font-family: var(--font-mono);
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.35;
}

.pc-title a { color: var(--text-bright); }
.pc-title a:hover { color: var(--green); }

.pc-excerpt {
  font-family: var(--font-body);
  font-size: .88rem;
  color: var(--text-dim);
  line-height: 1.65;
  flex: 1;
}

.pc-read-more {
  font-size: .78rem;
  color: var(--green-dim);
  display: flex;
  align-items: center;
  gap: .3em;
  margin-top: auto;
  transition: gap var(--transition);
}

.pc-read-more:hover { color: var(--green); gap: .6em; }
.pc-read-more .arrow { transition: transform var(--transition); }
.pc-read-more:hover .arrow { transform: translateX(4px); }

/* Severity badges */
.severity-badge {
  font-size: .62rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .1em;
  padding: .15em .6em;
  border-radius: var(--radius);
  border: 1px solid;
}

.sev-critical { color: var(--red);    border-color: var(--red);    background: rgba(255,0,64,.1); }
.sev-high     { color: var(--yellow); border-color: var(--yellow); background: rgba(255,215,0,.1); }
.sev-medium   { color: var(--cyan);   border-color: var(--cyan);   background: rgba(0,212,255,.1); }
.sev-low      { color: var(--green);  border-color: var(--green);  background: rgba(0,255,65,.1); }
.sev-info     { color: var(--purple); border-color: var(--purple); background: rgba(191,0,255,.1); }

/* ── Articles page ──────────────────────── */
.articles-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.page-header {
  margin-bottom: 3rem;
}

.page-title {
  font-size: 2.5rem;
  margin: 1rem 0 .5rem;
  letter-spacing: .05em;
}

.pt-accent { color: var(--green); margin-right: .4em; }

.page-desc {
  font-size: .82rem;
  color: var(--text-dim);
  letter-spacing: .05em;
}

/* Articles list */
.articles-list { display: flex; flex-direction: column; gap: .75rem; }

.article-row {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}

.article-row:hover { border-color: var(--border-glow); }

.ar-left { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.ar-date { font-size: .78rem; color: var(--text-dim); white-space: nowrap; }

.ar-title { font-family: var(--font-mono); font-size: .92rem; font-weight: 700; margin-bottom: .3rem; }
.ar-title a { color: var(--text-bright); }
.ar-title a:hover { color: var(--green); }

.ar-tags { display: flex; gap: .3rem; flex-wrap: wrap; }
.ar-tag {
  font-size: .65rem;
  color: var(--text-dim);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: .1em .5em;
  border-radius: var(--radius);
}

.ar-read {
  font-size: .8rem;
  color: var(--green-dim);
  white-space: nowrap;
  padding: .3em .8em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: all var(--transition);
}
.ar-read:hover {
  color: var(--green);
  border-color: var(--border-glow);
  background: var(--green-dark);
}

/* ── Single post ────────────────────────── */
.single-post {
  max-width: 1050px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.post-header {
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
}

.ph-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.ph-date { font-size: .78rem; color: var(--text-dim); }

.cve-badge {
  font-size: .72rem;
  color: var(--yellow);
  border: 1px solid rgba(255,215,0,.3);
  padding: .15em .6em;
  border-radius: var(--radius);
  background: rgba(255,215,0,.08);
  font-family: var(--font-code);
}

.post-title {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -.01em;
}

.ph-tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.ph-tag {
  font-size: .72rem;
  color: var(--cyan-dim);
  border: 1px solid rgba(0,212,255,.2);
  padding: .2em .7em;
  border-radius: var(--radius);
  background: rgba(0,212,255,.05);
}

/* Post content */
.post-content {
  line-height: 1.85;
  font-family: var(--font-body);
  font-size: 1.15rem;
  color: var(--text);
  text-align: justify;         /* Giustifica il testo */
  text-justify: inter-word;    /* Ottimizza lo spazio tra le parole */
  hyphens: auto;           /* <--- AGGIUNTA QUI */
  word-break: break-word;
  overflow-x: visible;
}
.post-content h2 { font-size: 1.4rem; color: var(--green); margin: 2.5rem 0 1rem; padding-left: .75rem; border-left: 3px solid var(--green); }
.post-content h3 { font-size: 1.15rem; color: var(--cyan); margin: 2rem 0 .75rem; }
.post-content p  { margin-bottom: 1.4rem; font-size: 1.10rem; }
.post-content ul,
.post-content ol { margin: 1rem 0 1rem 1.5rem; font-family: var(--font-body); }
.post-content li { margin-bottom: .5rem; }
.post-content blockquote {
  border-left: 3px solid var(--purple);
  padding: .75rem 1.25rem;
  background: var(--bg-panel);
  color: var(--text-dim);
  margin: 1.5rem 0;
  font-style: italic;
}
.post-content img { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
/*.post-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .88rem; }*/
.post-content table:not(.highlight table) { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .88rem; }
.post-content th { background: var(--bg-panel); color: var(--green); border: 1px solid var(--border); padding: .6rem 1rem; text-align: left; }
.post-content td:not(.highlight td) { border: 1px solid var(--border); padding: .6rem 1rem; }
.post-content tr:nth-child(even) td { background: var(--bg-panel); }

/* Post footer nav */
.post-footer { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--border); }

.pf-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.pf-prev, .pf-back, .pf-next {
  font-size: .82rem;
  color: var(--text-dim);
  padding: .4em .9em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.pf-prev:hover, .pf-back:hover, .pf-next:hover {
  color: var(--green);
  border-color: var(--border-glow);
  background: var(--green-dark);
}

/* ── Footer ─────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 2rem 1.75rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-name {
  font-family: var(--font-display);
  font-size: .85rem;
  color: var(--green);
  letter-spacing: .08em;
  text-shadow: var(--glow-green);
}

.footer-sep {
  color: var(--text-dim);
  font-size: .75rem;
}

.footer-author {
  font-size: .82rem;
  color: var(--text-bright);
  letter-spacing: .04em;
}

.footer-social a {
    color: #0077b5; /* Il blu ufficiale di LinkedIn */
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer-social a:hover {
    opacity: 0.7;
}

.footer-social svg {
    vertical-align: middle;
}

.footer-project {
  font-size: .82rem;
  color: var(--cyan-dim);
  letter-spacing: .04em;
}

.footer-quote {
  font-size: .82rem;
  color: var(--cyan);
  font-style: italic;
  letter-spacing: .04em;
}

.footer-copy {
  font-size: .78rem;
  color: var(--text);
  letter-spacing: .05em;
}

/* ── Syntax highlight override ──────────── */
.highlight pre { border-left-color: none }
.highlight td:last-child pre {
  border-left: none;
}

/* ── Pagination ─────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-top: 3rem;
}

.pagination a, .pagination span {
  padding: .4em .9em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .8rem;
  color: var(--text-dim);
  transition: all var(--transition);
}

.pagination a:hover { color: var(--green); border-color: var(--border-glow); }
.pagination .active span { color: var(--green); border-color: var(--green); background: var(--green-dark); }

/* ── Responsive ─────────────────────────── */
@media (max-width: 768px) {
   .hero-title-row {
    flex-direction: column;       /* stack verticale */
    align-items: flex-start;      /* allineato a sinistra come il testo */
    gap: 1.5rem;
  }

  .logo-glitch {
    width: clamp(80px, 35vw, 160px);   /* scala sul viewport mobile */
    height: clamp(80px, 35vw, 160px);
    align-self: center;                /* logo centrato sotto il titolo */
  }
  .header-inner { flex-wrap: wrap; gap: .75rem; }

  .nav-toggle { display: flex; }

  .nav-list {
    display: none;
    position: fixed;
    top: 60px; left: 0; right: 0;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem;
    gap: .25rem;
  }

  .nav-list.open { display: flex; }

  .article-row { grid-template-columns: 1fr; gap: .5rem; }
  .ar-left { flex-direction: row; }

  .pf-nav { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
  .logo-glitch {
    width: 45vw;    /* occupa quasi metà schermo su telefoni piccoli */
    height: 45vw;
  }
}

/* ── 404 page ───────────────────────────── */
.error-page {
  max-width: 820px;
  margin: 6rem auto;
  padding: 2rem;
}

.error-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 3rem 2.5rem;
  text-align: center;
}

.error-code { margin-bottom: 1.5rem; }

.ec-num {
  font-family: var(--font-display);
  font-size: clamp(5rem, 18vw, 9rem);
  font-weight: 900;
  color: var(--red);
  text-shadow: var(--glow-red);
  display: block;
  position: relative;
  animation: glitch-1 3s infinite;
}

.ec-num::before {
  content: attr(data-text);
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  color: var(--cyan); clip-path: polygon(0 10%,100% 10%,100% 35%,0 35%);
  animation: glitch-clip-1 3s infinite;
}

.ec-num::after {
  content: attr(data-text);
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  color: var(--green); clip-path: polygon(0 60%,100% 60%,100% 80%,0 80%);
  animation: glitch-clip-2 3s infinite;
}

.error-msg {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--red-dim);
  letter-spacing: .1em;
  margin-bottom: .75rem;
}

.error-sub {
  font-size: .85rem;
  color: var(--text-dim);
  margin-bottom: 2.5rem;
}

.error-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Language switcher ──────────────────── */
.lang-switch {
  display: flex;
  align-items: center;
  margin-left: 1rem;
  border-left: 1px solid var(--border);
  padding-left: 1rem;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .9rem;
  font-size: .82rem;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: var(--radius);
  letter-spacing: .06em;
  transition: all var(--transition);
  position: relative;
}

.lang-btn::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--green);
  transition: width var(--transition);
}

.lang-btn:hover {
  color: var(--green);
  border-color: var(--border-glow);
  background: var(--green-dark);
}

.lang-btn:hover::before {
  width: 100%;
}

/* ── Line numbers syntax highlight ─────── */
.highlight table td:first-child {
  padding-right: 1.2em;
  color: var(--text-dim);
  user-select: none;        /* non selezionabile quando copi il codice */
  text-align: right;
  min-width: 2em;
  border-right: 1px solid transparent;
}

.highlight table td:last-child {
  padding-left: 0.8em;
}

.highlight table {
  width: 100%;
  border-collapse: collapse;
}

.post-content pre {
  overflow-x: auto;
  max-width: 100%;
  box-sizing: border-box;
}

.highlight {
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--green) var(--bg-panel);
}

.highlight::-webkit-scrollbar {
  height: 4px;
}

.highlight::-webkit-scrollbar-track {
  background: var(--bg-panel);
}

.highlight::-webkit-scrollbar-thumb {
  background: var(--green);
  border-radius: 2px;
}

