/* ============== Shared layout/components ============== */

nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  z-index: 1000;
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--grey-900);
  transition: background 0.5s ease, border-bottom 0.5s ease;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--text-main);
  text-decoration: none;
  white-space: nowrap;
}

body.light-mode .nav-logo img {
  filter: invert(1);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  font-size: 11px;
  text-decoration: none;
  color: var(--cool-gray);
  opacity: 0.6;
  transition: opacity 0.3s;
}

.nav-links a:hover {
  opacity: 1;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-main);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  transition: transform 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.menu-toggle {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  z-index: 1100;
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text-main);
  transition: 0.3s;
}

.hero {
  position: relative;
  width: 100vw;
  overflow: hidden;
  background: var(--grey-950);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* heights differ by page; we keep defaults and override per-page below */
.hero {
  height: 60vh;
}

#noiseCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body {
  font-size: 15px;
  line-height: 1.7;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(46px, 6vw, 72px);
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--text-main);
  margin: 0;
}

.hero-subtitle {
  color: var(--grey-400);
  font-size: clamp(14px, 1.8vw, 17px);
  margin-top: 15px;
  font-weight: 300;
}

.fade-section {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 1.2s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

.fade-section.visible {
  opacity: 1;
  transform: translateY(0);
}

footer {
  padding: 40px 5%;
  border-top: 1px solid var(--grey-900);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--grey-400);
}

/* ============== index.html ============== */

/* index uses full-height hero */
body[data-page="home"] .hero {
  height: 100vh;
}

body[data-page="home"] .hero-content {
  pointer-events: none;
}

.hero-title {
  /* keep as shared; index overrides size */
}

body[data-page="home"] .hero-title {
  font-size: clamp(55px, 8vw, 80px);
  line-height: 1;
}

body[data-page="filosofia"] .hero-title {
  font-size: clamp(55px, 8vw, 80px);
}

.subtitle-wrapper {
  height: 30px;
  margin-top: 15px;
  position: relative;
  width: 100vw;
  display: flex;
  justify-content: center;
}

.subtitle-item {
  position: absolute;
  font-size: clamp(14px, 1.8vw, 17px);
  font-weight: 300;
  color: var(--grey-400);
  opacity: 0;
  white-space: nowrap;
  transition: opacity 1.2s ease-in-out;
}

.subtitle-item.active {
  opacity: 1;
}

.features-section {
  background: var(--feature-bg);
  padding: 100px 5%;
  transition: background 0.5s ease;
}

.grid-container {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 60px;
}

.feature-card h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  margin-bottom: 14px;
  color: var(--text-main);
}

.feature-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--grey-400);
}

.main-content {
  padding: 100px 5%;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}



.section-title {
  font-family: var(--font-serif);
  font-size: 28px;
  text-align: center;
  margin-bottom: 70px;
  color: var(--text-main);
}

.columns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 70px;
  margin-bottom: 90px;
}

.col h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  margin-bottom: 18px;
  color: var(--text-main);
}

.col p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--grey-400);
  margin-bottom: 16px;
}

.manifesto-box {
  text-align: center;
  max-width: 750px;
  margin: 0 auto 70px;
}

.manifesto-box p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--cool-gray);
  margin-bottom: 25px;
}

.manifesto-box h2 {
  font-family: var(--font-serif);
  font-size: 26px;
  color: var(--text-main);
}

.cta-section {
  text-align: center;
  margin: 100px 0;
}

body[data-page="home"] .cta-section {
  margin-bottom: 80px;
}

.btn-x {
  background: var(--text-main);
  color: var(--grey-950);
  padding: 12px 28px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.3s;
}

.btn-x:hover {
  opacity: 0.9;
}

.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

.modal-content {
  background-color: var(--grey-950);
  margin: 10% auto;
  padding: 40px;
  border: 1px solid var(--grey-800);
  width: 80%;
  max-width: 600px;
  color: var(--grey-400);
  font-size: 13px;
  line-height: 1.6;
  position: relative;
}

.modal-content h3 {
  font-family: var(--font-serif);
  color: var(--text-main);
  margin-bottom: 20px;
  font-size: 20px;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  color: var(--text-main);
  font-size: 24px;
  cursor: pointer;
}

/* ============== tecnologia.html ============== */
body[data-page="tecnologia"] .hero {
  height: 60vh;
}

body[data-page="tecnologia"] .hero-title {
  font-size: clamp(55px, 8vw, 80px);
}

body[data-page="tecnologia"] .columns-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

body[data-page="tecnologia"] .quote-box {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 24px;
  color: var(--text-main);
  padding: 80px 0;
  border-top: 1px solid var(--grey-900);
  border-bottom: 1px solid var(--grey-900);
  margin: 80px 0;
}

body[data-page="tecnologia"] .defense-section {
  margin-bottom: 100px;
}

body[data-page="tecnologia"] .defense-section h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  margin-bottom: 20px;
  color: var(--text-main);
}

body[data-page="tecnologia"] .defense-section p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--grey-400);
  margin-bottom: 20px;
}

body[data-page="tecnologia"] .stats-container {
  text-align: center;
  margin-bottom: 100px;
}

body[data-page="tecnologia"] .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 40px;
  margin-bottom: 40px;
}

body[data-page="tecnologia"] .stat-card {
  background: var(--feature-bg);
  padding: 25px;
  border-radius: 12px;
  text-align: left;
  border: 1px solid var(--grey-900);
}

body[data-page="tecnologia"] .stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

body[data-page="tecnologia"] .stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-main);
}

body[data-page="tecnologia"] .stat-label {
  font-size: 12px;
  color: var(--grey-400);
  margin-top: 8px;
}

body[data-page="tecnologia"] .stat-sub {
  font-size: 10px;
  color: #555;
  margin-top: 4px;
}

body[data-page="tecnologia"] .chart-svg {
  width: 70px;
  height: 35px;
}

body[data-page="tecnologia"] .path-anim {
  stroke: var(--text-main);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  transition: stroke-dashoffset 2s ease-out;
}

body[data-page="tecnologia"] .visible .path-anim {
  stroke-dashoffset: 0;
}

body[data-page="tecnologia"] .info-list {
  margin-bottom: 100px;
}

body[data-page="tecnologia"] .info-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  padding: 30px 0;
  border-bottom: 1px solid var(--grey-900);
}

body[data-page="tecnologia"] .info-row h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--text-main);
}

body[data-page="tecnologia"] .info-row p {

  font-size: 15px;

  color: var(--grey-400);

  line-height: 1.7;

}

body[data-page="tecnologia"] .building-header {
  text-align: center;
  margin-bottom: 40px;
}

body[data-page="tecnologia"] .building-header h2 {

  font-family: var(--font-serif);

  font-size: 28px;

  color: var(--text-main);

  margin-bottom: 10px;

}

body[data-page="tecnologia"] .building-header p {

  font-size: 15px;

  color: var(--grey-400);

}

.btn-white {
  background: var(--text-main);
  color: var(--grey-950);
  padding: 12px 28px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.3s;
}

.btn-white:hover {
  opacity: 0.9;
}

/* ============== ecosistema.html ============== */
.section-block {
  margin-bottom: 100px;
}

.section-header {
  margin-bottom: 40px;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--text-main);
  margin-bottom: 10px;
}

.section-header p {
  font-size: 15px;
  color: var(--grey-400);
}

.subsection-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--grey-400);
  margin-bottom: 25px;
  display: block;
  border-bottom: 1px solid var(--grey-900);
  padding-bottom: 10px;
}

.eco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  margin-bottom: 60px;
}

.eco-card {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.3s;
}

.eco-card:hover {
  opacity: 0.7;
}

.eco-card h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--text-main);
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.eco-card h3::after {
  content: "↗";
  font-size: 14px;
  opacity: 0.5;
}

.eco-card p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--grey-400);
}

.stay-in-loop {
  text-align: center;
  padding: 100px 0;
  border-top: 1px solid var(--grey-900);
}

.stay-in-loop h2 {

  font-family: var(--font-serif);

  font-size: 28px;

  color: var(--text-main);

  margin-bottom: 10px;

}

.stay-in-loop p {
  color: var(--grey-400);
  margin-bottom: 30px;
  font-size: 15px;
}

/* ============== piattaforma.html ============== */
body[data-page="piattaforma"] .section-header p {
  line-height: 1.8;
  max-width: 800px;
}

body[data-page="piattaforma"] .stats-grid {
  margin: 40px 0 80px;
}

body[data-page="piattaforma"] .stat-card {
  text-align: left;
}

body[data-page="piattaforma"] .stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

body[data-page="piattaforma"] .stat-value {
  font-size: 28px;
}

body[data-page="piattaforma"] .stat-sub {
  font-size: 11px;
  color: var(--grey-400);
}

.dot-usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 40px;
  margin-bottom: 100px;
}

.usage-col h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--text-main);
  margin-bottom: 16px;
}

.usage-col p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--grey-400);
}

body[data-page="piattaforma"] .columns-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 100px;
}

body[data-page="piattaforma"] .col h2 {
  font-size: 22px;
}

body[data-page="piattaforma"] .cta-section {
  border-top: 1px solid var(--grey-900);
  padding-top: 80px;
}

body[data-page="piattaforma"] .cta-section h2 {
  font-size: 36px;
  margin-bottom: 15px;
}

/* ============== filosofia.html ============== */
body[data-page="filosofia"] .container {

  max-width: 1000px;

  margin: 0 auto;

  padding: 100px 5% 60px;

  position: relative;

  z-index: 2;

}

.page-title {
  text-align: center;
  margin-bottom: 0;
}

.page-title h1 {
  font-family: var(--font-serif);
  font-size: clamp(55px, 8vw, 80px);
  color: var(--text-main);
  margin: 0;
}

.page-title p {
  font-size: clamp(14px, 1.8vw, 17px);
  color: var(--grey-400);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 300;
  margin-top: 15px;
}

.intro-section {
  margin-top: 0;
  margin-bottom: 120px;
}

.intro-section h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--text-main);
  margin-bottom: 24px;
}

.intro-section em {
  font-size: 16px;
  color: var(--grey-400);
  display: block;
  margin-bottom: 40px;
  font-style: italic;
}

.intro-section p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--grey-400);
  margin-bottom: 25px;
}

.lineage-header h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--text-main);
  margin-bottom: 10px;
}

.lineage-header p {
  font-size: 15px;
  color: var(--grey-400);
  margin-bottom: 60px;
}

.lineage-row {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 60px;
  margin-bottom: 80px;
  align-items: start;
}

.lineage-text span.tag {
  font-size: 10px;
  color: var(--grey-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  display: block;
}

.lineage-text h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--text-main);
  margin-bottom: 16px;
}

.lineage-text p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--grey-400);
}

body[data-page="filosofia"] .quote-box {
  background: var(--feature-bg);
  border: 1px solid var(--grey-900);
  padding: 30px;
  border-radius: 12px;
}

body[data-page="filosofia"] .quote-box p {
  font-style: italic;
  font-size: 14px;
  line-height: 1.6;
  color: var(--cool-gray);
  margin-bottom: 15px;
}

body[data-page="filosofia"] .quote-box cite {
  font-style: normal;
  font-size: 11px;
  color: var(--grey-400);
  display: block;
}

.completing-cycle {
  background-color: var(--feature-bg);
  padding: 120px 5%;
  text-align: center;
  transition: background 0.5s ease;
}

.completing-cycle h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--text-main);
  margin-bottom: 20px;
}

.completing-cycle p {
  max-width: 700px;
  margin: 0 auto 40px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--grey-400);
}

.completing-cycle h3 {
  font-family: var(--font-serif);
  font-size: 26px;
  color: var(--text-main);
  margin-top: 40px;
}

.stay-updated {
  padding: 100px 5%;
  text-align: center;
  background-color: var(--grey-950);
}

.stay-updated h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--text-main);
  margin-bottom: 10px;
}

.stay-updated p {
  color: var(--grey-400);
  margin-bottom: 30px;
  font-size: 14px;
}

body[data-page="piattaforma"] .hero-title {
  font-size: clamp(55px, 8vw, 80px);
}

body[data-page="ecosistema"] .hero-title {
  font-size: clamp(55px, 8vw, 80px);
}

body[data-page="contatti"] .hero-title {
  font-size: clamp(55px, 8vw, 80px);
}

/* ============== contatti.html ============== */
body[data-page="contatti"] .hero {
  height: 60vh;
}

body[data-page="contatti"] .hero-subtitle {
  font-size: clamp(14px, 1.8vw, 17px);
  margin-top: 15px;
  text-transform: none;
  letter-spacing: normal;
}

body[data-page="contatti"] .main-content {
  max-width: 800px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 80px;
}

.contact-info h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--text-main);
  margin-bottom: 20px;
}

.contact-info p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--grey-400);
  margin-bottom: 30px;
}

.info-item {
  margin-bottom: 25px;
}

.info-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--grey-400);
  margin-bottom: 5px;
  display: block;
}

.info-value {
  font-size: 16px;
  color: var(--text-main);
  text-decoration: none;
}

.contact-form {
  background: var(--feature-bg);
  padding: 40px;
  border-radius: 12px;
  border: 1px solid var(--grey-900);
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--grey-400);
  margin-bottom: 10px;
}

.form-control {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--grey-900);
  padding: 15px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.3s ease;
}

.form-control:focus {
  border-color: var(--grey-400);
}

textarea.form-control {
  height: 120px;
  resize: none;
}

.btn-submit {
  background: var(--text-main);
  color: var(--grey-950);
  border: none;
  padding: 14px 32px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.3s;
}

.btn-submit:hover {
  opacity: 0.9;
}

/* Supply Chart Styles */
.supply-chart-container {
  margin: 40px 0;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 30px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--cool-gray);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.chart-wrapper {
  width: 100%;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 20px;
}

.light-mode .chart-wrapper {
  background: rgba(255, 255, 255, 0.05);
}

.supply-chart {
  width: 100%;
  height: 400px;
  max-width: 800px;
  margin: 0 auto;
  display: block;
}

.emission-line, .supply-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 2s ease-out forwards;
}

.emission-line {
  animation-delay: 0.5s;
}

.supply-line {
  animation-delay: 0.8s;
}

.emission-line ~ circle, .supply-line ~ circle {
  opacity: 0;
  animation: fadeIn 0.5s ease-out forwards;
}

.emission-line ~ circle {
  animation-delay: 1.1s;
}

.supply-line ~ circle {
  animation-delay: 1.4s;
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Chart hover effects */
.supply-chart circle {
  transition: r 0.2s ease;
  cursor: pointer;
}

.supply-chart circle:hover {
  r: 6;
}

