/* ══════════════════════════════════════════════
   miclogs.com — stylesheet v5
   Fonts: DM Serif Display + DM Mono (default) / Inter (optional)
   Palette: dark/light theme via body.light
═══════════════════════════════════════════════ */

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

:root {
  --black:        #07070a;
  --sidebar-bg:   #0a0a0e;
  --surface:      #0f0f15;
  --violet:       #7c3aed;
  --violet-mid:   #4c1d95;
  --violet-neon:  #a855f7;
  --violet-dim:   rgba(124, 58, 237, 0.14);
  --text:         #ebebf2;
  --text-muted:   #4a4a5a;
  --text-faint:   #2a2a38;
  --mono:         'IBM Plex Mono', monospace;
  --serif:        'IBM Plex Sans', sans-serif;
  --sidebar-w:    230px;
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --t:            0.26s var(--ease);
}

/* ── Font switcher: body.font-inter ──────────── */
body.font-inter {
  --mono: 'Inter', sans-serif;
}

/* ── Light theme ──────────────────────────────── */
body.light {
  --black:        #f0eff5;
  --sidebar-bg:   #e8e6f0;
  --surface:      #dddbe8;
  --violet:       #6d28d9;
  --violet-mid:   #4c1d95;
  --violet-neon:  #7c3aed;
  --violet-dim:   rgba(109, 40, 217, 0.1);
  --text:         #0e0c14;
  --text-muted:   #6b6880;
  --text-faint:   #c4c2d4;
}

body.light .display-title { color: #0e0c14; }
body.light .section-title { color: #0e0c14; }
body.light .display-sub { color: rgba(14,12,20,0.45); }
body.light .hero-gradient {
  background:
    radial-gradient(ellipse 80% 80% at 70% 50%, rgba(139,92,246,0.1) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 20% 80%, rgba(109,40,217,0.07) 0%, transparent 50%),
    var(--black);
}
body.light .hero-grain { opacity: 0.025; }
body.light .sidebar-toggle { background: rgba(232,230,240,0.95); }
body.light .display-title em {
  text-shadow: 0 0 18px rgba(109,40,217,0.35), 0 0 40px rgba(109,40,217,0.15);
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--black);
  color: var(--text);
  font-family: var(--mono);
  overflow: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

body {
  display: flex;
  height: 100vh;
}

/* ══════════════════════════════════════════════
   MOBILE HAMBURGER MENU
═══════════════════════════════════════════════ */
.mob-menu-btn {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 500;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  background: rgba(10,10,14,0.92);
  border: 1px solid var(--text-faint);
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  -webkit-appearance: none;
  appearance: none;
  padding: 0;
  margin: 0;
  outline: none;
  box-sizing: border-box;
}

.mob-menu-btn:hover {
  background: rgba(124,58,237,0.15);
  border-color: rgba(124,58,237,0.35);
}

body.light .mob-menu-btn {
  background: rgba(232,230,240,0.92);
}

body.mob-open .mob-menu-btn {
  border-color: rgba(124,58,237,0.45);
  background: rgba(124,58,237,0.12);
}

/* Burger icon — due span CSS */
.burger-icon {
  width: 16px;
  height: 16px;
  position: relative;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  pointer-events: none;
  flex-shrink: 0;
}

.burger-icon span {
  display: block;
  position: absolute;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-muted);
  left: 0;
  -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease;
}

.burger-icon .bl-top { top: 3px; }
.burger-icon .bl-bot { top: 11px; }

body.mob-open .burger-icon .bl-top {
  -webkit-transform: translateY(4px) rotate(45deg);
  transform: translateY(4px) rotate(45deg);
  background: var(--violet-neon);
}

body.mob-open .burger-icon .bl-bot {
  -webkit-transform: translateY(-4px) rotate(-45deg);
  transform: translateY(-4px) rotate(-45deg);
  background: var(--violet-neon);
}

/* Overlay */
.mob-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 299;
  opacity: 0;
  transition: opacity 0.28s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

body.mob-open .mob-overlay {
  opacity: 1;
}

/* ── Theme toggle button ──────────────────────── */
.theme-toggle {
  position: absolute;
  bottom: 20px;
  right: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--text-faint);
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 6px;
  transition: color 0s, background var(--t), border-color var(--t);
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--violet-dim);
  border-color: rgba(124,58,237,0.3);
}

.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none; }
body.light .theme-toggle .icon-moon { display: none; }
body.light .theme-toggle .icon-sun  { display: block; }

/* ── Sidebar expand button (desktop only) ──────── */
.sidebar-toggle {
  position: fixed;
  top: 16px;
  left: 12px;
  z-index: 200;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,10,14,0.9);
  border: 1px solid var(--text-faint);
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t), color var(--t), background var(--t);
}

.sidebar-toggle:hover {
  color: var(--text);
  background: rgba(124,58,237,0.15);
  border-color: rgba(124,58,237,0.3);
}

body.sidebar-hidden .sidebar-toggle {
  opacity: 1;
  pointer-events: all;
}

body.sidebar-hidden .sidebar {
  width: 0 !important;
  min-width: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  overflow: hidden;
  border-right-color: transparent;
}

/* ── Sidebar ──────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--text-faint);
  display: flex;
  flex-direction: column;
  padding: 40px 32px;
  position: relative;
  z-index: 10;
  transition: width var(--t), min-width var(--t), padding var(--t), border-right-color var(--t), background 0.3s ease;
  overflow: hidden;
}

.sidebar::after {
  content: '';
  position: absolute;
  right: -1px; top: 15%; bottom: 15%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--violet-mid), transparent);
  opacity: 0.6;
}

/* Collapse button */
.sidebar-collapse {
  position: absolute;
  top: 14px;
  right: 10px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 5px;
  opacity: 0;
  transition: opacity var(--t), color 0s, background var(--t), border-color var(--t);
}

.sidebar:hover .sidebar-collapse {
  opacity: 1;
}

.sidebar-collapse:hover {
  color: var(--text);
  background: rgba(124,58,237,0.12);
  border-color: rgba(124,58,237,0.25);
}

/* ── Logo ─────────────────────────────────────── */
.logo {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 52px;
  margin-top: 4px;
}

.logo-mark {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 300;
  color: var(--violet);
  letter-spacing: -0.05em;
}

.logo-text {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--text);
  opacity: 0.7;
}

/* ── Nav ──────────────────────────────────────── */
nav { flex: 1; }

nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-link {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 14px 10px 16px;
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  border-radius: 6px;
  transition: border-color var(--t), background var(--t);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0; top: 18%; bottom: 18%;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--violet-neon);
  box-shadow: 0 0 6px 1px var(--violet-neon), 0 0 12px 2px rgba(168,85,247,0.5);
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}

.nav-link:hover::before,
.nav-link.active::before {
  opacity: 1;
}

.nl-label {
  position: relative;
  z-index: 2;
  color: inherit;
}

.nl-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(ellipse 80% 120% at var(--mx, 30%) 50%,
    rgba(168,85,247,0.2) 0%, transparent 70%);
  transition: opacity 0.18s ease;
  pointer-events: none;
  z-index: 1;
}

.nav-link:hover .nl-glow { opacity: 1; }

.nav-link:hover {
  color: var(--text);
  border-color: rgba(124,58,237,0.18);
  background: rgba(124,58,237,0.06);
}

.nav-link.active {
  color: #c4b5fd;
  border-color: rgba(124,58,237,0.3);
  background: rgba(124,58,237,0.1);
}

body.light .nav-link.active {
  color: var(--violet);
}

.nav-link.active .nl-glow {
  opacity: 1;
  background: radial-gradient(ellipse 100% 140% at 25% 50%,
    rgba(168,85,247,0.22) 0%, transparent 65%);
}

/* ── Sidebar footer ───────────────────────────── */
.sidebar-footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.sidebar-footer-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-domain, .footer-year {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  opacity: 0.35;
}

/* ── Stage ────────────────────────────────────── */
.stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 80% at 70% 50%, rgba(76,29,149,0.22) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 20% 80%, rgba(124,58,237,0.12) 0%, transparent 50%),
    radial-gradient(ellipse 40% 40% at 80% 20%, rgba(50,20,100,0.18) 0%, transparent 50%),
    var(--black);
  pointer-events: none;
  transition: background 0.3s ease;
}

.hero-grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='1'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  opacity: 0.045;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* ── Views ────────────────────────────────────── */
.view {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  padding: 56px 64px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.view.active {
  opacity: 1;
  pointer-events: all;
}

.view-inner { width: 100%; }

/* ── Home ─────────────────────────────────────── */
.home-inner { padding-bottom: 8px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.22em;
  color: var(--violet-neon);
  opacity: 0.7;
  margin-bottom: 16px;
}

.display-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(64px, 9vw, 120px);
  font-weight: 400;
  line-height: 0.92;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  transition: color 0.3s ease;
}

.display-title em {
  font-style: italic;
  color: var(--violet-neon);
  text-shadow: 0 0 18px rgba(168,85,247,0.6), 0 0 40px rgba(168,85,247,0.25);
}

.display-sub {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: rgba(235,235,242,0.4);
  line-height: 1.8;
  margin-bottom: 32px;
  transition: color 0.3s ease;
}

.home-tags { display: flex; gap: 10px; flex-wrap: wrap; }

.tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  border: 1px solid var(--text-faint);
  padding: 5px 12px;
  border-radius: 2px;
}

/* ── Section titles ───────────────────────────── */
.section-title {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 400;
  color: #fff;
  letter-spacing: -0.01em;
  margin-bottom: 40px;
  line-height: 1;
  transition: color 0.3s ease;
}

/* ── Projects ─────────────────────────────────── */
#view-projects, #view-about, #view-contact {
  align-items: flex-start;
  padding-top: 56px;
  padding-bottom: 48px;
}

#view-projects .view-inner,
#view-about .view-inner,
#view-contact .view-inner {
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--violet-mid) transparent;
}

.project-grid {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--text-faint);
  width: 100%;
}

.project-card {
  padding: 22px 16px 22px 0;
  border-bottom: 1px solid var(--text-faint);
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 20px;
  width: 100%;
  position: relative;
  transition: background var(--t), padding-left var(--t);
  cursor: default;
}

.project-card::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--violet-neon);
  box-shadow: 0 0 6px 1px var(--violet-neon), 0 0 14px 3px rgba(168,85,247,0.45);
  opacity: 0;
  transition: opacity 0.15s ease;
}

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

.project-card:hover {
  background: rgba(124,58,237,0.05);
  padding-left: 14px;
}

.project-num {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 300;
  color: var(--violet-neon);
  opacity: 0.45;
  letter-spacing: 0.1em;
  grid-row: 1;
  padding-top: 3px;
}

.project-card h3 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.06em;
  grid-column: 2;
  grid-row: 1;
  margin-bottom: 7px;
}

.project-card p {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.65;
  grid-column: 2;
  grid-row: 2;
  margin-bottom: 10px;
}

.project-tags {
  grid-column: 2;
  grid-row: 3;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.project-tags span {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--violet-neon);
  opacity: 0.55;
  border: 1px solid rgba(168,85,247,0.2);
  padding: 3px 8px;
  border-radius: 2px;
}

/* ══════════════════════════════════════════════
   SKELETON LOADING
═══════════════════════════════════════════════ */
@keyframes sk-pulse {
  0%, 100% { opacity: 0.35; }
  50%       { opacity: 0.65; }
}

.project-skeleton {
  padding: 22px 16px 22px 0;
  border-bottom: 1px solid var(--text-faint);
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 20px;
  width: 100%;
}

.project-skeleton > * {
  background: var(--text-faint);
  border-radius: 2px;
  animation: sk-pulse 1.7s ease-in-out infinite;
}

.project-skeleton > *:nth-child(2) { animation-delay: 0.1s; }
.project-skeleton > *:nth-child(3) { animation-delay: 0.2s; }
.project-skeleton > *:nth-child(4) { animation-delay: 0.3s; }
.project-skeleton > *:nth-child(5) { animation-delay: 0.4s; }

.sk-num   { grid-column:1; grid-row:1; width: 22px; height: 9px; margin-top: 3px; }
.sk-title { grid-column:2; grid-row:1; width: 52%; height: 12px; margin-bottom: 10px; }
.sk-title-short { width: 38%; }
.sk-desc  { grid-column:2; grid-row:2; width: 88%; height: 9px; margin-bottom: 6px; }
.sk-desc-short { width: 64%; grid-row: 3; margin-bottom: 0; }
.sk-desc-med   { width: 75%; }
.sk-desc-long  { width: 93%; }
.sk-desc-xs    { width: 50%; grid-row: 3; margin-bottom: 0; }
.sk-tags { grid-column:2; grid-row:4; display:flex; gap:6px; margin-top: 4px; }
.sk-tags span { height: 18px; width: 40px; border-radius: 2px; background: var(--text-faint); animation: sk-pulse 1.7s ease-in-out infinite; }
.sk-tags span:nth-child(2) { animation-delay: 0.15s; width: 50px; }
.sk-tags span:nth-child(3) { animation-delay: 0.3s; width: 44px; }

/* ── Error state ──────────────────────────────── */
.project-error-state {
  padding: 24px 0 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.projects-loading {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  padding: 24px 0;
  opacity: 0.5;
}

.projects-error {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(239,68,68,0.7);
  letter-spacing: 0.06em;
}

.retry-btn {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--violet-neon);
  background: none;
  border: 1px solid rgba(168,85,247,0.3);
  padding: 5px 14px;
  border-radius: 3px;
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
}

.retry-btn:hover {
  background: var(--violet-dim);
  border-color: rgba(168,85,247,0.5);
}

/* ── About ────────────────────────────────────── */
.about-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 36px;
}

.about-lead {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.04em;
  line-height: 1.6;
}

.about-body p {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.75;
  letter-spacing: 0.03em;
}

.about-stack { display: flex; gap: 10px; flex-wrap: wrap; }

.about-stack span {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  border: 1px solid var(--text-faint);
  padding: 5px 12px;
  border-radius: 2px;
  opacity: 0.7;
}

/* ── Contact ──────────────────────────────────── */
.contact-links {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--text-faint);
  width: 100%;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 16px 20px 0;
  border-bottom: 1px solid var(--text-faint);
  text-decoration: none;
  width: 100%;
  position: relative;
  transition: background var(--t), padding-left var(--t);
}

.contact-row::before {
  content: '';
  position: absolute;
  left: 0; top: 22%; bottom: 22%;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--violet-neon);
  box-shadow: 0 0 6px 1px var(--violet-neon), 0 0 14px 3px rgba(168,85,247,0.45);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.contact-row:hover::before { opacity: 1; }

.contact-row:hover {
  background: rgba(124,58,237,0.05);
  padding-left: 14px;
}

.contact-row:hover .contact-arrow {
  color: var(--violet-neon);
  transform: translateX(4px);
}

.contact-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.16em;
  color: var(--violet-neon);
  opacity: 0.6;
  min-width: 64px;
}

.contact-value {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--text);
  flex: 1;
}

.contact-arrow {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-muted);
  transition: color var(--t), transform var(--t);
}



/* ══════════════════════════════════════════════
   HOME RIPROGETTATA
═══════════════════════════════════════════════ */
.home-hero {
  margin-bottom: 36px;
}

.home-now {
  background: rgba(124,58,237,0.06);
  border: 1px solid rgba(124,58,237,0.15);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 36px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.home-now-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--violet-neon);
  opacity: 0.6;
  flex-shrink: 0;
}

.home-now-text {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 300;
  color: rgba(235,235,242,0.5);
  line-height: 1.7;
  letter-spacing: 0.03em;
}

body.light .home-now-text {
  color: rgba(14,12,20,0.5);
}

.home-divider {
  border-top: 1px solid var(--text-faint);
  margin-bottom: 32px;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}

.home-col-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--violet-neon);
  opacity: 0.5;
  margin-bottom: 14px;
}

/* Home projects list */
.home-projects-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.home-proj-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--text-faint);
  cursor: pointer;
  transition: background var(--t), padding-left var(--t);
  position: relative;
}

.home-proj-item:first-child {
  border-top: 1px solid var(--text-faint);
}

.home-proj-item::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--violet-neon);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.home-proj-item:hover::before { opacity: 1; }
.home-proj-item:hover { background: rgba(124,58,237,0.04); padding-left: 8px; }

.home-proj-num {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--violet-neon);
  opacity: 0.4;
  letter-spacing: 0.1em;
  padding-top: 2px;
}

.home-proj-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}

.home-proj-desc {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Skeleton home projects */
.home-proj-sk {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--text-faint);
}

.home-proj-sk:first-child { border-top: 1px solid var(--text-faint); }

.home-proj-sk span {
  height: 10px;
  border-radius: 2px;
  background: var(--text-faint);
  animation: sk-pulse 1.7s ease-in-out infinite;
  display: block;
}

.home-proj-sk span:first-child { width: 16px; margin-top: 2px; }
.home-proj-sk span:last-child  { width: 70%; }

/* More button */
.home-more-btn {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--violet-neon);
  opacity: 0.6;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: opacity var(--t);
}

.home-more-btn:hover { opacity: 1; }

/* About text */
.home-about-text {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.75;
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}

/* Home contact list */
.home-contact-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.home-contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--text-faint);
  text-decoration: none;
  transition: padding-left var(--t);
  position: relative;
}

.home-contact-item:first-child { border-top: 1px solid var(--text-faint); }

.home-contact-item::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--violet-neon);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.home-contact-item:hover::before { opacity: 1; }
.home-contact-item:hover { padding-left: 8px; }

.home-contact-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--violet-neon);
  opacity: 0.5;
  min-width: 52px;
}

.home-contact-value {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 300;
  color: var(--text-muted);
  flex: 1;
}

/* Mobile home grid */
@media (max-width: 640px) {
  .home-grid { grid-template-columns: 1fr; gap: 32px; }
  .home-now { flex-direction: column; gap: 6px; }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — MOBILE
═══════════════════════════════════════════════ */
@media (max-width: 640px) {
  html, body {
    overflow: auto;
    height: auto;
  }

  body {
    flex-direction: column;
    overflow: auto;
  }

  /* ── Hamburger visibile ── */
  .mob-menu-btn {
    display: -webkit-flex !important;
    display: flex !important;
    -webkit-appearance: none !important;
    appearance: none !important;
  }

  .sidebar-toggle { display: none !important; }

  /* ── Drawer ── */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100% !important;
    width: 260px !important;
    min-width: 0 !important;
    z-index: 400 !important;
    display: -webkit-flex !important;
    display: flex !important;
    -webkit-flex-direction: column !important;
    flex-direction: column !important;
    padding: 0 !important;
    transform: translateX(-100%) !important;
    -webkit-transform: translateX(-100%) !important;
    transition: transform 0.32s cubic-bezier(0.4,0,0.2,1) !important;
    -webkit-transition: -webkit-transform 0.32s cubic-bezier(0.4,0,0.2,1) !important;
    border-right: 1px solid var(--text-faint) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  body.mob-open .sidebar {
    transform: translateX(0) !important;
    -webkit-transform: translateX(0) !important;
  }

  body.mob-open .mob-overlay { display: block; }

  .sidebar::after { display: none !important; }
  .sidebar-collapse { display: none !important; }

  /* Logo: spazio per il bottone hamburger */
  .sidebar .logo {
    margin-top: 64px !important;
    margin-bottom: 24px !important;
    padding-left: 28px !important;
    padding-right: 28px !important;
  }

  /* Nav */
  .sidebar nav {
    padding: 0 16px !important;
    -webkit-flex: 1 !important;
    flex: 1 !important;
  }

  nav ul { -webkit-flex-direction: column; flex-direction: column; gap: 3px; }
  .nav-link { padding: 11px 14px 11px 16px; font-size: 13px; }

  /* Footer: sempre visibile in fondo */
  .sidebar .sidebar-footer {
    display: -webkit-flex !important;
    display: flex !important;
    margin-top: auto !important;
    padding: 16px 28px 32px 28px !important;
    border-top: 1px solid var(--text-faint) !important;
    -webkit-flex-shrink: 0 !important;
    flex-shrink: 0 !important;
  }

  /* ── Stage ── */
  .stage {
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
  }

  .view {
    position: relative;
    opacity: 1;
    -webkit-transform: none;
    transform: none;
    pointer-events: all;
    display: none;
    padding: 72px 28px 48px;
    -webkit-align-items: flex-start;
    align-items: flex-start;
  }

  .view.active { display: -webkit-flex; display: flex; }

  #view-projects .view-inner,
  #view-about .view-inner,
  #view-contact .view-inner {
    max-height: none;
    overflow-y: visible;
  }

  .display-title { font-size: 52px; }
  .section-title { font-size: 36px; margin-bottom: 28px; }

}

/* ══════════════════════════════════════════════
   CUSTOM PAGES — block renderer
═══════════════════════════════════════════════ */

.custom-page-blocks {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 40px;
}

.cp-h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.cp-h2 {
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-top: 8px;
}

.cp-h3 {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.1em;
  text-transform: lowercase;
  margin-top: 4px;
}

.cp-p {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.8;
  letter-spacing: 0.03em;
  max-width: 640px;
}

.cp-img-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 680px;
}

.cp-img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--text-faint);
  object-fit: cover;
}

.cp-caption {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  opacity: 0.6;
}

.cp-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--text-faint);
  width: 100%;
}

.cp-list-item {
  padding: 18px 16px 18px 0;
  border-bottom: 1px solid var(--text-faint);
  position: relative;
  transition: background var(--t), padding-left var(--t);
}

.cp-list-item::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--violet-neon);
  box-shadow: 0 0 6px 1px var(--violet-neon), 0 0 14px 3px rgba(168,85,247,0.45);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.cp-list-item:hover::before { opacity: 1; }
.cp-list-item:hover { background: rgba(124,58,237,0.04); padding-left: 14px; }

.cp-list-item-title {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}

.cp-list-item-desc {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 8px;
}

.cp-list-item-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cp-list-item-tags span {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--violet-neon);
  opacity: 0.55;
  border: 1px solid rgba(168,85,247,0.2);
  padding: 2px 7px;
  border-radius: 2px;
}

.cp-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--violet-neon);
  text-decoration: none;
  border: 1px solid rgba(168,85,247,0.25);
  padding: 8px 16px;
  border-radius: 4px;
  transition: background var(--t), border-color var(--t);
}

.cp-link:hover {
  background: var(--violet-dim);
  border-color: rgba(168,85,247,0.45);
}

@media (hover: none) {
  .nav-link:not(.active):hover,
  .nav-link:not(.active):focus {
    color: var(--text-muted);
    border-color: transparent;
    background: none;
  }
  .nav-link:not(.active):hover .nl-glow { opacity: 0; }
  .nav-link:not(.active):hover::before { opacity: 0; }

  .nav-link:active {
    background: rgba(124,58,237,0.08);
    border-color: rgba(124,58,237,0.2);
    color: var(--text);
  }

  .project-card:hover {
    background: none;
    padding-left: 0;
  }
  .project-card:hover::before { opacity: 0; }

  .project-card:active {
    background: rgba(124,58,237,0.05);
  }

  .contact-row:hover {
    background: none;
    padding-left: 0;
  }
  .contact-row:hover::before { opacity: 0; }
  .contact-row:hover .contact-arrow {
    color: var(--text-muted);
    transform: none;
  }

  .contact-row:active {
    background: rgba(124,58,237,0.05);
  }

  .cp-list-item:hover {
    background: none;
    padding-left: 0;
  }
  .cp-list-item:hover::before { opacity: 0; }

  .cp-link:hover {
    background: none;
    border-color: rgba(168,85,247,0.25);
  }
}
