:root {
  --accent: #2b6cb0;
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-text: #000000;
  --color-strong: #111111;
  --color-muted: #555555;
  --color-border: #eeeeee;
  --color-border-strong: #000000;
  --color-button-bg: #222222;
  --color-button-bg-hover: #444444;
  --color-button-text: #ffffff;
  --color-button-shadow: rgba(0, 0, 0, 0.2);
  --color-button-disabled-bg: #666666;
  --color-tooltip-bg: #000000;
  --color-tooltip-text: #ffffff;
  --color-tooltip-border: #000000;
  --color-nav-bg: #ffffff;
  --color-nav-border: #eeeeee;
  --color-footer-text: #000000;
  --color-toggle-bg: rgba(0, 0, 0, 0.82);
  --color-toggle-bg-hover: rgba(0, 0, 0, 0.92);
  --color-toggle-text: #ffffff;
  --color-toggle-shadow: rgba(0, 0, 0, 0.25);
  --color-shadow-soft: rgba(0, 0, 0, 0.24);
  --color-shadow-strong: rgba(0, 0, 0, 0.32);
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  margin: 0;
  padding: 0;
  font-size: clamp(16px, 1.2vw + 0.5rem, 18px);
  padding-top: 56px;
}

.centered-container {
  max-width: 900px;
  margin: 40px auto;
  padding: 30px 40px;
  box-sizing: border-box;
}

p {
  text-align: justify;
}

@media (max-width: 1000px) {
  .centered-container {
    max-width: 98vw;
    padding: 18px 2vw;
  }
}

@media (max-width: 500px) {
  .centered-container {
    padding: 10px 1vw;
    font-size: 12px;
  }
  body {
    font-size: 12px;
  }
}

/* Bottone stile discovery call */
.button-discovery {
  display: inline-block;
  background: var(--color-button-bg);
  color: var(--color-button-text);
  padding: 12px 28px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1em;
  border: none;
  box-shadow: 0 2px 8px var(--color-button-shadow);
  transition: background 0.2s;
}
.button-discovery:hover {
  background: var(--color-button-bg-hover);
}

/* Top navigation */
.top-nav { position: fixed; top: 0; left: 0; right: 0; height: 56px; background: var(--color-nav-bg); border-bottom: 1px solid var(--color-nav-border); z-index: 1000; display: flex; align-items: center; transition: transform 0.25s ease; will-change: transform; }
/* Hidden state for hide-on-scroll behavior */
.top-nav.is-hidden { transform: translateY(-100%); }
.top-nav, .top-nav * { font-family: inherit; font-size: inherit; line-height: inherit; }
.nav-inner { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.brand { font: inherit; font-weight: 700; letter-spacing: normal; font-size: 1.1em; }
.nav-links, .nav-links a, .cta-primary, .top-nav, .nav-inner {
  font: inherit;
  letter-spacing: normal;
  line-height: inherit;
}
.nav-links { display: flex; gap: 16px; align-items: center; }
.nav-links a { color: inherit; margin: 0; }
/* Menu links: bold on hover instead of underline */
.nav-links a:hover, .nav-links a:focus { text-decoration: none; font-weight: 700; margin: 0; }
.cta-primary {
  margin-left: 12px;
  display: inline-block;
  background: var(--color-button-bg);
  color: var(--color-button-text);
  padding: 12px 28px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1em;
  border: none;
  box-shadow: 0 2px 8px var(--color-button-shadow);
  transition: background 0.2s;
}
.cta-primary:hover { background: var(--color-button-bg-hover); text-decoration: none; }

/* Ensure nav CTA text stays bold */
.top-nav .cta-primary { color: var(--color-button-text); font-weight: bold; }


/* -------------------------------------------------- */
/* Home page and global layout enhancements           */
/* (migrated from inline <style> in index.html)        */
/* -------------------------------------------------- */
/* Page-level typography overrides */
.centered-container { max-width: 70ch; padding: 32px 20px; }
h1 { font-weight: 600; font-size: clamp(1.6rem, 3.2vw + 0.4rem, 2.2rem); letter-spacing: -0.01em; margin: 0 0 10px; }
h2 { font-size: clamp(1.05rem, 1.2vw + 0.5rem, 1.15rem); margin: 40px 0 12px; font-weight: 600; }
p { margin: 0 0 14px; }
ul { margin: 0 0 16px 1.2rem; }
li { margin: 4px 0; }
a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  margin: 0;
  transform-origin: left center;
  transition: transform 0.18s ease, color 0.18s ease, font-weight 0.18s ease, margin 0.18s ease;
}
a:hover {
  text-decoration: none;
  transform: scale(1.07);
  font-weight: 700;
  margin: 0 0.28em;
}
a:focus {
  transform: scale(1.07);
  font-weight: 700;
  margin: 0 0.28em;
}
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Disabled CTA when functional cookies are not enabled */
.cta-primary[aria-disabled="true"], .cta-primary.cc-disabled {
  cursor: not-allowed;
  background: var(--color-button-disabled-bg); /* keep opaque to avoid translucent tooltip */
  color: var(--color-button-text);
  box-shadow: none;
}

/* Simple tooltip for cookie‑gated actions */
.cc-tooltip { position: relative; }
.cc-tooltip[data-cc-tooltip]:hover::after,
.cc-tooltip[data-cc-tooltip]:focus::after {
  content: attr(data-cc-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-tooltip-bg);
  color: var(--color-tooltip-text);
  border: 1px solid var(--color-tooltip-border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  z-index: 50;
}
.cc-tooltip[data-cc-tooltip]:hover::before,
.cc-tooltip[data-cc-tooltip]:focus::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--color-tooltip-bg);
}

.color-mode-toggle.cc-tooltip[data-cc-tooltip]:hover::after,
.color-mode-toggle.cc-tooltip[data-cc-tooltip]:focus::after {
  left: auto;
  right: 0;
  bottom: calc(100% + 8px);
  transform: translateX(0);
  text-align: right;
}
.color-mode-toggle.cc-tooltip[data-cc-tooltip]:hover::before,
.color-mode-toggle.cc-tooltip[data-cc-tooltip]:focus::before {
  left: auto;
  right: 14px;
  transform: none;
  bottom: 100%;
}

/* Fluid media */
img, video { max-width: 100%; height: auto; }



/* Hero */
.hero h1 { margin-top: 6px; }
.subline { color: var(--color-strong); }
.micro { color: inherit; font-size: 0.75em; }

/* Floating color inversion toggle */
.color-mode-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2100;
  border: none;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  padding: 0;
  font: inherit;
  font-size: 1rem;
  color: var(--color-toggle-text);
  background: var(--color-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}
.color-mode-toggle.is-hidden {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}
.color-mode-toggle:hover { transform: translateY(-1px); }
.color-mode-toggle:focus-visible {
  outline: 2px solid var(--accent, #2b6cb0);
  outline-offset: 3px;
}
.color-mode-toggle__icon {
  display: inline-block;
  width: 67%;
  height: 67%;
  border-radius: 999px;
  position: relative;
  flex-shrink: 0;
  background: var(--color-bg);
}
.color-mode-toggle__icon::after {
  content: '';
  position: absolute;
  inset: 33%;
  border-radius: 999px;
  background: var(--color-text);
}
@supports (backdrop-filter: blur(10px)) {
  .color-mode-toggle {
    backdrop-filter: none;
  }
}
@media (max-width: 600px) {
  .color-mode-toggle {
    bottom: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    box-shadow: 0 6px 20px var(--color-shadow-soft);
  }
}

body.color-inverted {
  --color-bg: #050505;
  --color-surface: #0f0f0f;
  --color-text: #f5f5f5;
  --color-strong: #f9f9f9;
  --color-muted: #bbbbbb;
  --color-border: #2a2a2a;
  --color-border-strong: #f5f5f5;
  --color-button-bg: #f5f5f5;
  --color-button-bg-hover: #dcdcdc;
  --color-button-text: #111111;
  --color-button-shadow: rgba(0, 0, 0, 0.6);
  --color-button-disabled-bg: #949494;
  --color-tooltip-bg: #f5f5f5;
  --color-tooltip-text: #111111;
  --color-tooltip-border: #f5f5f5;
  --color-nav-bg: rgba(12, 12, 12, 0.95);
  --color-nav-border: #222222;
  --color-footer-text: #f5f5f5;
  --color-toggle-bg: rgba(255, 255, 255, 0.88);
  --color-toggle-bg-hover: rgba(255, 255, 255, 0.95);
  --color-toggle-text: #111111;
  --color-toggle-shadow: rgba(0, 0, 0, 0.55);
  --color-shadow-soft: rgba(0, 0, 0, 0.5);
  --color-shadow-strong: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
.stack-sm > * + * { margin-top: 8px; }
.stack-md > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 18px; }

/* Services */
.cards { list-style: none; padding: 0; margin: 0; }
.cards li { display: block; padding: 14px 0; border-top: 1px solid var(--color-border); }
.cards li:last-child { border-bottom: 1px solid var(--color-border); }
.learn { white-space: nowrap; color: inherit; }

/* FAQ */
details { border-top: 1px solid var(--color-border); padding: 12px 0; }
details:last-of-type { border-bottom: 1px solid var(--color-border); }
summary { cursor: pointer; font-weight: 600; }
summary::-webkit-details-marker { display: none; }

/* Footer */
footer { border-top: 1px solid var(--color-border); padding-top: 18px; font-size: 0.9em; color: inherit; }
.muted { color: var(--color-muted); }
footer .muted { color: inherit; }

/* Section spacing */
section { margin: 28px 0; }

/* Responsive refinements */
@media (max-width: 900px) {
  .centered-container { padding: 28px 18px; }
  .nav-links { gap: 12px; }
}

@media (max-width: 700px) {
  body { padding-top: 88px; }
  .nav-inner { padding: 0 12px; gap: 12px; }
  .nav-links { flex-wrap: wrap; column-gap: 12px; row-gap: 6px; }
}

@media (max-width: 480px) {
  body { padding-top: 96px; }
  .centered-container { padding: 22px 14px; }
  .nav-links { gap: 10px; }
}

/* Modal (shared across pages) */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.5); z-index: 2000; padding: 10px; box-sizing: border-box; }
.modal-content { position: relative; background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: 8px; width: min(96vw, 960px); height: min(92vh, 900px); box-shadow: 0 10px 30px var(--color-shadow-strong); overflow: hidden; }
.modal-content iframe { width: 100%; height: 100%; border: 0; display: block; }
.modal-close { position: absolute; top: 6px; right: 10px; background: none; border: none; font-size: 26px; line-height: 1; cursor: pointer; }
@media (max-width: 700px) {
  .modal { padding: 0; }
  .modal-content { width: 100vw; height: 100vh; border-radius: 0; }
  .modal-close { top: 12px; right: 14px; font-size: 28px; }
}
