/* Stili personalizzati */
html {
  height: 100vh;
  height: 100dvh;
  width: 100vw;
}

body {
  font-family: "Inter", sans-serif;
  background-color: #090909;
  color: #fff;
  cursor: none;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
}

/* Lenis smooth scroll */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

/* Home page - no scroll */
body.page-home {
  overflow: hidden;
  position: fixed;
  touch-action: pan-y;
  /* Permetti touch verticale per il canvas */
}

body.page-home html {
  overflow: hidden;
}

/* Vertical pages - scrollable */
body.page-vertical {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Main wrapper adjustments */
body.page-home #main-wrapper {
  height: 100vh;
}

body.page-vertical #main-wrapper {
  min-height: 100vh;
  height: auto;
}

#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-color: #090909;
  touch-action: none;
  /* Permetti completa gestione touch sul canvas */
  -webkit-tap-highlight-color: transparent;
  /* Rimuovi evidenziazione touch su iOS */
  user-select: none;
  /* Previeni selezione testo durante touch */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

#main-wrapper::before,
#main-wrapper::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  height: 25vh;
  z-index: 1;
  pointer-events: none;
}

#main-wrapper::before {
  top: 0;
  background: linear-gradient(to bottom, #090909 0%, rgba(9, 9, 9, 0) 100%);
}

#main-wrapper::after {
  bottom: 0;
  background: linear-gradient(to top, #090909 0%, rgba(9, 9, 9, 0) 100%);
}

.font-space-mono {
  font-family: "Space Mono", monospace;
}

.blinking-cursor {
  animation: blink 1s step-end infinite;
}

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

.marquee-content {
  display: inline-block;
  white-space: nowrap;
  animation: marquee 100s linear infinite;
  flex-shrink: 0;
  /* Prevents shrinking in flex container */
}

.marquee-container:hover .marquee-content {
  animation: marquee 180s linear infinite;
}

.marquee-container {
  display: flex;
  /* Enables side-by-side layout */
  overflow: hidden;
  margin-bottom: 0px;
  /* Removed bottom margin as requested earlier/general cleanup */
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-100%);
  }
}

#custom-cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  background-color: white;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9999;
  transition: transform 0.1s ease-out;
}

.color-switcher {
  cursor: pointer;
}

/* Navigation */
nav a {
  transition: color 0.2s;
}

nav a:hover {
  color: #22d3ee;
}

nav a.active {
  color: #22d3ee;
}

/* Stili modale contatti */
#contact-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  pointer-events: auto;
}

#contact-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

#modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

#modal-content {
  position: relative;
  background: #090909;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  animation: slideUp 0.3s ease-out;
}

#modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  transition: color 0.2s;
}

#modal-close:hover {
  color: #22d3ee;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  margin: 0.5rem 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  color: #fff;
  text-decoration: none;
  transition: all 0.2s;
}

.contact-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #22d3ee;
  transform: translateX(4px);
}

.contact-link svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.contact-icon-btn {
  cursor: pointer;
  transition: color 0.2s;
}

.contact-icon-btn:hover {
  color: #22d3ee;
}

/* Scroll area per contenuto centrale */
.content-list {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border-radius: 8px;
  padding: 1.5rem;
}

/* Blur background for content pages (foundation/project) */
.content-blur-container {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
  .content-blur-container {
    padding: 1.5rem;
    border-radius: 8px;
  }
}

.content-scroll-area::-webkit-scrollbar {
  width: 6px;
}

.content-scroll-area::-webkit-scrollbar-track {
  background: transparent;
}

.content-scroll-area::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

.content-scroll-area::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Card styles */
.product-card,
.project-card {
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s;
}

.product-card:hover,
.project-card:hover {
  border-color: #555;
  background: rgba(255, 255, 255, 0.05);
}

.expand-btn {
  cursor: pointer;
  transition: transform 0.3s;
}

.expand-btn:hover {
  transform: scale(1.1);
}

.card-expanded .expand-btn {
  transform: rotate(45deg);
}

.card-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-out;
}

.card-expanded .card-content {
  max-height: 4000px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Typography Styles */
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  color: #fff;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 1em;
}

.prose h1 {
  font-size: 2.5rem;
  margin-top: 0;
}

.prose h2 {
  font-size: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
}

.prose h3 {
  font-size: 1.5rem;
  color: #22d3ee;
}

.prose h4 {
  font-size: 1.25rem;
}

.prose h5 {
  font-size: 1.125rem;
}

.prose h6 {
  font-size: 1rem;
  color: #9ca3af;
}

.prose p {
  color: #d1d5db;
  line-height: 1.8;
  margin-top: 1em;
  margin-bottom: 1em;
}

.prose ul,
.prose ol {
  color: #d1d5db;
  margin-top: 1em;
  margin-bottom: 1em;
  padding-left: 2em;
}

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

.prose li {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  line-height: 1.7;
}

.prose li::marker {
  color: #22d3ee;
}

.prose ul ul,
.prose ol ul,
.prose ul ol,
.prose ol ol {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.prose strong {
  color: #fff;
  font-weight: 700;
}

.prose em {
  color: #e5e7eb;
  font-style: italic;
}

.prose a {
  color: #22d3ee;
  text-decoration: underline;
  text-decoration-color: rgba(34, 211, 238, 0.3);
  transition: all 0.2s;
}

.prose a:hover {
  color: #06b6d4;
  text-decoration-color: rgba(6, 182, 212, 1);
}

.prose blockquote {
  border-left: 4px solid #22d3ee;
  padding-left: 1.5rem;
  margin-left: 0;
  margin-right: 0;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  font-style: italic;
  color: #9ca3af;
}

.prose code {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: "Space Mono", monospace;
  font-size: 0.9em;
  color: #22d3ee;
}

.prose pre {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}

.prose pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.875rem;
  color: #e5e7eb;
}

.prose img {
  border-radius: 8px;
  margin-top: 2em;
  margin-bottom: 2em;
}

.prose hr {
  border-color: rgba(255, 255, 255, 0.1);
  margin-top: 3em;
  margin-bottom: 3em;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2em;
  margin-bottom: 2em;
}

.prose th {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-weight: 700;
  padding: 0.75rem;
  text-align: left;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.prose td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #d1d5db;
}

.prose tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 768px) {
  body {
    cursor: auto;
  }

  #custom-cursor {
    display: none;
  }

  #modal-content {
    padding: 1.5rem;
  }

  .prose h1 {
    font-size: 2rem;
  }

  .prose h2 {
    font-size: 1.75rem;
  }

  .prose h3 {
    font-size: 1.375rem;
  }

  .prose ul,
  .prose ol {
    padding-left: 1.5em;
  }
}

/* Vertical Specific Prose Overrides */
/* Surface - Magenta #F40DED */
.prose-surface h3 { color: #F40DED; }
.prose-surface a { color: #F40DED; text-decoration-color: rgba(244, 13, 237, 0.3); }
.prose-surface a:hover { color: #d90dce; text-decoration-color: #d90dce; }
.prose-surface li::marker { color: #F40DED; }
.prose-surface blockquote { border-left-color: #F40DED; }
.prose-surface code { color: #F40DED; }

/* System - Orange #FF4715 */
.prose-system h3 { color: #FF4715; }
.prose-system a { color: #FF4715; text-decoration-color: rgba(255, 71, 21, 0.3); }
.prose-system a:hover { color: #e64012; text-decoration-color: #e64012; }
.prose-system li::marker { color: #FF4715; }
.prose-system blockquote { border-left-color: #FF4715; }
.prose-system code { color: #FF4715; }

/* Scan - Cyan #00ECE6 */
.prose-scan h3 { color: #00ECE6; }
.prose-scan a { color: #00ECE6; text-decoration-color: rgba(0, 236, 230, 0.3); }
.prose-scan a:hover { color: #00d4cf; text-decoration-color: #00d4cf; }
.prose-scan li::marker { color: #00ECE6; }
.prose-scan blockquote { border-left-color: #00ECE6; }
.prose-scan code { color: #00ECE6; }