/* ═══════════════════════════════════════════════════
   WEBLUCA.DEV — Portfolio Web Developer
   Stacked Cards • Horizontal Scroll
   ═══════════════════════════════════════════════════ */

/* ─── CSS Variables ─────────────────────────────── */
:root {
  --bg: #0c0c0c;
  --text: #f0f0eb;
  --muted: #999999;
  --accent1: #e8ff00;
  --accent2: #ff2d2d;
  --accent3: #4affb4;
  --border: #1c1c1c;
  --white: #ffffff;
  --panel-bg: #0c0c0c;
}

/* ─── Reset & Base ──────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  font-family: "DM Mono", monospace;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  cursor: none;
}

body.no-custom-cursor {
  cursor: auto;
}

/* Wrapper per lock orientamento: in landscape su mobile viene ruotato */
#orientation-lock {
  min-height: 100%;
}

/* ─── Horizontal Wrapper ────────────────────────── */
#horizontal-wrapper {
  display: flex;
  width: 500vw;
  height: 100vh;
  flex-shrink: 0;
}

/* ─── Stage (background layer) ──────────────────── */
.stage {
  width: 100vw;
  height: 100vh;
  flex-shrink: 0;
  position: relative;
  background: var(--stage-color, #0c0c0c);
}

/* ─── Panel (card on top) — 56px stage sopra e sotto ───── */
.panel {
  position: absolute;
  inset: 56px 0 56px 0;
  border-radius: 24px;
  background: var(--panel-bg);
  overflow-x: hidden;
  overflow-y: auto;
}

/* ─── Navbar ───────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: transparent;
  mix-blend-mode: difference;
}

.nav-logo {
  font-family: "DM Mono", monospace;
  font-size: 16px;
  color: var(--muted);
  text-decoration: none;
  mix-blend-mode: difference;
}

.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-link {
  font-family: "DM Mono", monospace;
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 16px;
  min-width: 72px;
  text-align: center;
  transition: color 0.25s ease, background 0.25s ease;
  border-radius: 4px;
  letter-spacing: 0.05em;
  position: relative;
  transform-origin: center;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.active {
  color: var(--accent1);
}

/* Burger Menu (McButton-style: hamburger → X animato) */
.burger,
.burger-btn {
  display: none;
  position: relative;
  width: 32px;
  height: 26px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transform-origin: center center;
}

.burger span,
.burger-btn span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text);
  transform-origin: center center;
}

.burger span:nth-child(1),
.burger-btn span:nth-child(1) {
  top: 0;
}
.burger span:nth-child(2),
.burger-btn span:nth-child(2) {
  top: 50%;
  margin-top: -1px;
}
.burger span:nth-child(3),
.burger-btn span:nth-child(3) {
  top: 100%;
  margin-top: -2px;
}

.burger-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s, visibility 0.3s;
}

.burger-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.burger-overlay a { font-family: "Clash Display"; font-weight: 700, sans-serif;
  font-size: 15vw;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
  opacity: 0;
}

/* ─── Loader ───────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

#loader-text {
  font-family: "DM Mono", monospace;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.2em;
}

/* ─── Scroll Progress ──────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: #ec4899;
  z-index: 1002;
  width: 0%;
}

/* ─── Flash Transition ────────────────────────── */
#flash {
  position: fixed;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 9997;
}

/* ─── Noise Grain ──────────────────────────────── */
#noise-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
}

/* ─── Custom Cursor ────────────────────────────── */
#cursor-dot {
  position: fixed;
  left: 0;
  top: 0;
  width: 6px;
  height: 6px;
  background: var(--accent1);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9996;
  transform-origin: center;
  transform: translate(-50%, -50%);
  transition: scale 0.2s ease;
}

#cursor-dot.hidden {
  scale: 0;
}

#cursor-ring {
  position: fixed;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--text);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9995;
  transform-origin: center;
  transform: translate(-50%, -50%);
  transition: scale 0.2s ease, background 0.2s ease;
}

#cursor-ring.hover {
  scale: 2.5;
  background: rgba(232, 255, 0, 0.1);
}

/* ─── Panel 1: HERO ────────────────────────────── */
#s-hero {
  --stage-color: #0c0c0c;
}

/* Hero: niente bordi, pannello a tutto schermo, visibilità scritte */
#s-hero .panel {
  border-radius: 0;
  inset: 0;
}

#s-hero .hero-top-row span,
#s-hero .hero-label,
#s-hero .hero-year,
#s-hero .hero-scroll,
#s-hero .hero-scroll span {
  color: #b0b0b0;
}

#s-hero .hero-est {
  color: #999;
  opacity: 0.9;
}

#s-hero .marquee {
  border-top: none;
}

#s-hero .marquee-inner span {
  color: #888;
}

.hero-top-row,
.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 120px 48px 0;
}

.hero-top-row span,
.hero-top span,
.hero-label,
.hero-year {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.3em;
}

.hero-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 100%;
  opacity: 0; /* nascosto fino al fade-in GSAP, evita lampeggio */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-title-group {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
}

.hero-title {
  font-family: "Clash Display", sans-serif;
  font-weight: 700;
  font-size: clamp(80px, 16vw, 260px);
  line-height: 0.9;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  transform: scaleX(1.08); /* lieve allargamento */
  transform-origin: center;
}

.hero-title .char {
  display: inline-block;
}

.hero-subtitle {
  font-family: "Clash Display", sans-serif;
  font-weight: 600;
  font-size: 2.6vw;
  color: var(--accent1);
  margin-top: -0.8vw;
  margin-left: 1vw;
  text-transform: lowercase;
  letter-spacing: 0.12em;
  text-align: right;
}

.hero-bottom-row,
.hero-bottom {
  position: absolute;
  bottom: 28px;
  left: 48px;
  right: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hero-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.2em;
}

.hero-year {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.3em;
}

.hero-est {
  font-family: "Clash Display", sans-serif;
  font-weight: 800;
  font-size: 30px;
  color: var(--border);
  opacity: 0.5;
}

/* ─── Panel 2: ABOUT ───────────────────────────── */
#s-about {
  --stage-color: #e8ff00;
}

/* Desktop: evita micro-scroll verticale indesiderato in About */
#s-about .panel {
  overflow-y: hidden;
}

.about-grid,
.about-inner {
  position: relative;
  padding: 48px 48px 48px;
  display: flex;
  gap: 8%;
  max-width: 1400px;
  margin: 0;
  min-height: 0;
}

.about-left {
  flex: 0 0 45%;
  position: relative;
  perspective: 800px;
}

.about-label {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  color: var(--accent1);
  letter-spacing: 0.4em;
  margin-bottom: 24px;
  display: block;
}

/* Titoli sezione: stessa grandezza, linea e padding-left */
.about-title,
.skills-title,
.projects-title,
.contact-title {
  font-family: "Clash Display", sans-serif;
  font-weight: 700;
  font-size: 8vw;
  line-height: 1;
  text-transform: uppercase;
  padding-left: 48px;
  white-space: nowrap;
}

.projects-subtitle {
  font-family: "DM Mono", monospace;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.08em;
  padding-left: 48px;
  margin-top: -2px;
  margin-bottom: 16px;
  max-width: 72ch;
}

.about-title {
  color: var(--text);
  transform-style: preserve-3d;
}

.about-title .char,
.skills-title .char,
.projects-title .char {
  display: inline-block;
  transform-origin: center bottom;
}

.about-right {
  flex: 0 0 47%;
  padding-top: 12%;
  margin-left: 8%;
}

.about-bio {
  font-family: "DM Mono", monospace;
  font-size: 15px;
  color: #999;
  line-height: 1.9;
  max-width: 520px;
  margin-bottom: 32px;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 32px;
}

/* Desktop: 2026 e ∞ a sx, 100% e 24/7 a dx */
.about-stat:nth-child(1) { grid-column: 1; grid-row: 1; }
.about-stat:nth-child(2) { grid-column: 1; grid-row: 2; }
.about-stat:nth-child(3) { grid-column: 2; grid-row: 1; }
.about-stat:nth-child(4) { grid-column: 2; grid-row: 2; }

.about-stat {
  padding-left: 16px;
  border-left: 2px solid var(--accent1);
}

.about-stat .stat-num,
.about-stat-num {
  font-family: "Clash Display", sans-serif;
  font-size: 3.2vw;
  color: var(--text);
  display: block;
}

.about-stat .stat-label,
.about-stat-label {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  color: #999;
  margin-top: 4px;
}

/* ─── Panel 3: SKILLS ──────────────────────────── */
#s-skills {
  --stage-color: #ff2d2d;
}

#s-skills .panel { padding: 48px 48px 48px;
  overflow: hidden;
}

.skills-title {
  font-family: "Clash Display", sans-serif;
  font-size: 8vw;
  color: var(--text);
  text-transform: uppercase;
  margin-bottom: 24px;
}

/* Griglia 4 colonne, compatto, spostata in alto a destra */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 90%;
  margin: 120px 0 0 auto;
  padding-right: 0;
  perspective: 800px;
}

.skill-block {
  padding: 16px 20px 16px 16px;
  border-left: 2px solid var(--border);
  cursor: default;
  transform-style: preserve-3d;
  transition: border-color 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    color 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-block:hover {
  border-left-color: #e8ff00;
}

.skill-block:hover .skill-name {
  color: #e8ff00;
}

.skill-name {
  display: block;
  font-family: "Clash Display", sans-serif;
  font-size: 1.5vw;
  color: var(--text);
  text-transform: uppercase;
  transition: color 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.skill-desc {
  display: block;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  color: #999;
  margin-top: 4px;
}

/* ─── Panel 4: PROJECTS ─────────────────────────── */
#s-projects {
  --stage-color: #0a1628;
}

#s-projects .panel {
  padding: 48px 48px 48px;
  overflow: hidden;
}

/* Viewport progetti — tutti visibili, niente taglio */
.projects-carousel-viewport {
  overflow: visible;
  margin-top: 8px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

.projects-title {
  font-family: "Clash Display", sans-serif;
  font-size: 8vw;
  color: var(--text);
  text-transform: uppercase;
  margin-bottom: 24px;
}

.projects-list {
  max-width: 900px;
  margin: 48px auto 0;
}

.project-row {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  display: flex;
  align-items: center;
  gap: 24px;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.project-row:last-child {
  border-bottom: 1px solid var(--border);
}

.project-num {
  font-family: "DM Mono", monospace;
  font-size: 9px;
  color: #999;
  flex-shrink: 0;
}

.project-name {
  font-family: "Clash Display", sans-serif;
  font-size: 2.8vw;
  color: var(--text);
  flex-shrink: 0;
}

.project-tags {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  color: #999;
}

.project-arrow {
  margin-left: auto;
  font-size: 18px;
  color: #999;
  transition: transform 0.3s ease;
}

/* Project overlay */
#project-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9990;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}

#project-overlay.visible {
  visibility: visible;
  pointer-events: auto;
}

.project-overlay .project-close,
.project-overlay-close {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  margin-left: auto;
}

.project-overlay-bar-left {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
  gap: 4px;
  align-items: center;
}

.project-overlay-bar-left {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.project-overlay-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 80px 48px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 88px; /* stessa altezza con/senza hint per X allineata */
}

.project-overlay-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.project-overlay-bar-left {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
  gap: 8px;
}

.project-overlay-bar-left {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
  gap: 8px;
  align-items: center;
}

.project-overlay-bar .project-overlay-title {
  font-size: 24px;
  margin-bottom: 0;
}

.project-overlay-hint {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.project-overlay-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.project-overlay-body .project-iframe,
.project-overlay-body .project-overlay-content {
  flex: 1;
  min-height: 0;
}

.project-iframe {
  width: 100%;
  border: none;
}

.project-overlay-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  padding: 120px 48px 80px;
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
  min-height: 0;
}

.project-overlay-title {
  font-family: "Clash Display", sans-serif;
  font-size: 48px;
  color: var(--text);
  margin-bottom: 16px;
}

.project-overlay-tags {
  font-family: "DM Mono", monospace;
  font-size: 12px;
  color: var(--accent1);
  margin-bottom: 32px;
}

.project-overlay-tags span {
  margin-right: 12px;
}

.project-overlay-desc {
  font-family: "DM Mono", monospace;
  font-size: 15px;
  color: #999;
  line-height: 1.9;
}

/* ─── Panel 5: CONTACT ─────────────────────────── */
#s-contact {
  --stage-color: #0c0c0c;
}

#s-contact .panel {
  --panel-bg: #f5f2eb;
}

.contact-content, .contact-inner { position: relative; padding: 48px 48px 120px; min-height: 100%; display: flex; flex-direction: column; justify-content: flex-start;
  align-items: center;
  text-align: center;
}

.panel-contact {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#s-contact .contact-subtitle {
  color: #555;
}

#s-contact .contact-footer {
  color: #555;
}

.contact-deco {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Clash Display", sans-serif;
  font-size: 20vw;
  color: rgba(12, 12, 12, 0.15);
}

.contact-title-wrap {
  margin-bottom: 24px;
}

.contact-title { font-family: "Clash Display"; font-weight: 700, sans-serif;
  font-size: 8vw;
  line-height: 0.8;
  color: var(--bg);
  text-transform: uppercase;
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 64px;
  align-self: flex-start;
}

.contact-title .char,
.contact-title .contact-char {
  display: inline-block;
  cursor: default;
  transition: color 0.3s ease, transform 0.3s ease;
}

.contact-subtitle {
  font-family: "DM Mono", monospace;
  font-size: 14px;
  color: var(--muted);
  margin-top: 48px;
  margin-bottom: 48px;
}

.contact-palette {
  --text: #0c0c0c;
  --muted: #666666;
}

.contact-cta {
  display: inline-block;
  border: 2px solid var(--bg);
  background: transparent;
  color: var(--bg);
  padding: 18px 48px;
  font-family: "DM Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
  position: relative;
}

.contact-cta:hover {
  background: var(--bg);
  color: #f5f2eb;
}

.contact-handwrite {
  margin-top: 86px;
  max-width: 900px;
  padding: 0 24px;
  color: rgba(12, 12, 12, 0.85);
  font-family: "fashionista", "Parisienne", "Playfair Display", cursive;
  font-size: clamp(28px, 3.2vw, 44px);
  font-style: italic;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.02em;
  user-select: none;
  text-shadow: 0 0 0.6px rgba(12, 12, 12, 0.35);
}

.contact-handwrite-text {
  white-space: pre-wrap;
}

.contact-handwrite-caret {
  display: inline-block;
  width: 10px;
  height: 0.95em;
  border-bottom: 2px solid rgba(12, 12, 12, 0.65);
  margin-left: 6px;
  transform: translateY(-2px);
  animation: contactCaretBlink 900ms steps(1, end) infinite;
}

.contact-handwrite.is-done .contact-handwrite-caret {
  opacity: 0;
  animation: none;
}

@keyframes contactCaretBlink {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

.contact-footer {
  position: absolute;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  color: var(--muted);
}

/* ─── Links & Buttons Cursor Hover ──────────────── */
a,
button,
.project-row,
.skill-block,
.contact-cta {
  cursor: none;
}

body.no-custom-cursor a,
body.no-custom-cursor button,
body.no-custom-cursor .project-row,
body.no-custom-cursor .skill-block,
body.no-custom-cursor .contact-cta {
  cursor: pointer;
}

/* ─── Mobile (< 768px) ─────────────────────────── */
@media (max-width: 768px) {
  html {
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
  }

  body {
    cursor: auto;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
  }

  body.no-custom-cursor {
    cursor: auto;
  }

  #cursor-dot,
  #cursor-ring {
    display: none !important;
  }

  #navbar {
    padding: 0 16px;
  }

  .nav-links {
    display: none;
  }

  .burger,
  .burger-btn,
  #navbar .burger {
    display: flex;
  }

  /* Layout verticale: wrapper colonna, stages uno sotto l'altro */
  #horizontal-wrapper {
    flex-direction: column;
    width: 100%;
    min-width: 0;
    height: auto;
    overflow-x: hidden;
  }

  .stage {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    /* 72px top = 48px sotto navbar + 24px giallo visibile | 24px bottom = stessa quantità sotto */
    padding: 72px 24px 24px 24px;
    box-sizing: border-box;
  }

  /* Panel: centrato verticalmente — stessa quantità di colore sopra e sotto (e ai lati) */
  .panel {
    position: relative;
    inset: unset;
    margin: 0;
    min-height: calc(100vh - 48px - 48px);
    min-height: calc(100dvh - 48px - 48px);
    max-height: calc(100vh - 48px - 48px);
    max-height: calc(100dvh - 48px - 48px);
    border-radius: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 1;
  }

  /* Hero — stesso trattamento per cornice uniforme */
  #s-hero .panel {
    margin: 0;
    border-radius: 16px;
    min-height: calc(100vh - 48px - 48px);
    min-height: calc(100dvh - 48px - 48px);
    max-height: calc(100vh - 48px - 48px);
    max-height: calc(100dvh - 48px - 48px);
  }

  .hero-top-row {
    padding: 48px 20px 0;
  }

  /* Titolo WEBLUCA su una riga, font ridotto per non spezzarsi */
  .hero-title {
    font-size: clamp(38px, 11vw, 64px);
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
  }

  .hero-subtitle {
    font-size: clamp(14px, 4vw, 18px);
    letter-spacing: 0.1em;
  }

  .hero-bottom-row {
    left: 20px;
    right: 20px;
    bottom: 24px;
  }

  .hero-est {
    font-size: 20px;
  }

  /* About */
  .about-grid {
    flex-direction: column;
    padding: 48px 20px 48px;
    gap: 32px;
    align-items: center;
    text-align: center;
  }

  .about-left {
    flex: none;
    width: 100%;
  }

  .about-right {
    text-align: left;
  }

  /* 4 stats in griglia 2x2: 2026 | ∞, 100% | 24/7 */
  .about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
    align-self: stretch;
    width: 100%;
  }

  .about-stat {
    align-self: flex-start;
  }

  .about-title {
    font-size: clamp(36px, 12vw, 72px);
    padding-left: 0;
    padding-right: 0;
    margin-left: 24px; /* offset a dx per centrare con gli altri titoli */
    text-align: center;
    white-space: normal;
  }

  .about-right {
    flex: none;
    padding-top: 0;
    margin-left: 0;
  }

  .about-bio {
    font-size: 14px;
    line-height: 2;
    margin-bottom: 28px;
  }

  .about-stat .stat-num,
  .about-stat-num {
    font-size: clamp(28px, 8vw, 48px);
  }

  /* Skills */
  #s-skills .panel {
    padding: 56px 20px 48px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .skills-title {
    font-size: clamp(36px, 12vw, 72px);
    padding-left: 0;
    padding-right: 0;
    text-align: center;
    margin-bottom: 24px;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 100%;
    margin: 32px 0 0;
    padding-right: 0;
  }

  .skill-block {
    padding: 12px 14px;
  }

  .skill-name {
    font-size: clamp(12px, 3.5vw, 16px);
  }

  .skill-desc {
    font-size: 10px;
  }

  /* Projects — layout a griglia, titolo centrato orizzontalmente */
  #s-projects .panel {
    padding: 48px 20px 48px;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .projects-subtitle {
    padding-left: 0;
    padding-right: 0;
    padding-inline: max(20px, env(safe-area-inset-left, 0px));
    text-align: center;
    margin-top: 10px;
    margin-bottom: 18px;
    letter-spacing: 0.06em;
  }

  .projects-title {
    font-size: clamp(36px, 12vw, 72px);
    padding: 0;
    margin-bottom: 20px;
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    /* Centratura forzata per iPhone 14 Pro Max */
    margin-left: auto;
    margin-right: auto;
  }

  #s-projects .projects-title {
    width: 100%;
    text-align: center;
    padding-inline: max(20px, env(safe-area-inset-left, 0px));
  }

  .projects-carousel-viewport {
    max-height: none;
    margin-top: 0;
    overflow-x: hidden;
  }

  .projects-list {
    max-width: 100%;
    margin: 24px 0 0;
  }

  .project-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 8px 12px;
    padding: 16px 0;
  }

  .project-num {
    grid-column: 1;
    grid-row: 1;
    font-size: 10px;
    align-self: center;
  }

  .project-name {
    grid-column: 2;
    grid-row: 1;
    font-size: clamp(16px, 5vw, 24px);
    align-self: center;
    min-width: 0;
    overflow-wrap: break-word;
  }

  .project-arrow {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
  }

  .project-tags {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 10px;
    gap: 8px;
    padding-left: 0;
  }

  /* Contact — contenuto dall'alto, PARLIAMO leggibile (no clip da centering) */
  .panel-contact {
    justify-content: flex-start;
    padding-top: 24px;
  }

  .contact-content,
  .contact-inner {
    padding: 48px 20px 48px;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .contact-title {
    font-size: clamp(32px, 10vw, 72px);
    padding-left: 0;
    align-self: center;
    justify-content: center;
    padding-bottom: 12px;
    margin-bottom: 40px;
    white-space: nowrap;
    flex-wrap: nowrap;
    overflow: visible;
    line-height: 1.5;
    max-width: 100%;
  }

  .contact-title .contact-char,
  .contact-title .char {
    overflow: visible;
  }

  .contact-subtitle {
    font-size: 13px;
    margin-top: 24px;
    margin-bottom: 32px;
  }

  .contact-cta {
    padding: 14px 32px;
    font-size: 11px;
  }

  .contact-handwrite {
    margin-top: 92px;
    padding: 0 10px;
    max-width: 100%;
    font-size: clamp(22px, 7vw, 30px);
    line-height: 1.1;
    min-height: 72px;
  }

  .contact-handwrite-caret {
    display: none;
  }

  .contact-footer {
    bottom: 24px;
    font-size: 10px;
  }

  /* Burger overlay — link grandi e cliccabili */
  .burger-overlay {
    padding: 48px 24px;
  }

  .burger-overlay a {
    font-size: clamp(32px, 10vw, 48px);
    padding: 12px 0;
    -webkit-tap-highlight-color: transparent;
  }

  /* Project overlay mobile */
  .project-overlay-bar {
    padding: 64px 20px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .project-overlay-bar .project-overlay-title {
    font-size: 18px;
  }

  .project-overlay-hint {
    font-size: 10px;
    order: 3;
    width: 100%;
  }

  .project-overlay .project-close,
  .project-overlay-close {
    width: 44px;
    height: 44px;
    font-size: 28px;
    flex-shrink: 0;
  }

  .project-overlay-content {
    padding: 48px 20px 40px;
  }

  .project-overlay-title {
    font-size: 28px;
  }

  .project-overlay-desc {
    font-size: 14px;
  }

  /* Landscape: layout stabile quando si ruota il telefono */
  @media (orientation: landscape) {
    .stage {
      min-height: auto;
      padding: 48px 24px;
    }
    .panel {
      min-height: auto;
      max-height: none;
    }
  }
}

/* Overlay blocco rotazione — visibile solo in landscape su smartphone */
.orientation-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg, #f5f2eb);
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.orientation-overlay-content {
  text-align: center;
  max-width: 280px;
}

.orientation-overlay-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  border: 3px solid var(--text, #0c0c0c);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--text, #0c0c0c);
  line-height: 1;
}
.orientation-overlay-icon::before {
  content: "↻";
}

.orientation-overlay p {
  font-family: "DM Mono", monospace;
  font-size: 14px;
  color: var(--text, #0c0c0c);
  letter-spacing: 0.05em;
  margin: 0;
}

/* Mostra overlay solo in landscape su mobile (altezza viewport < 500px) */
@media (orientation: landscape) and (max-height: 500px) {
  .orientation-overlay {
    display: flex !important;
  }
}

/* ─── Prefers Reduced Motion (accessibilità) ─────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


