/* —— Tokens (palette CBSA campionata da brand) —— */
:root {
  --palette-red: #b5362f;
  --palette-gray-light: #b2b4b1;
  --palette-gray-dark: #5c5c5c;
  --palette-black: #000000;

  --bg: #e8e9e8;
  --perspective-bg: #e8e9e8;
  --bg-band: rgba(178, 180, 177, 0.42);
  --ink: var(--palette-black);
  --ink-muted: var(--palette-gray-dark);
  --line: rgba(0, 0, 0, 0.1);
  --accent: var(--palette-red);

  --font-sans: "Urbanist", system-ui, -apple-system, "Segoe UI", sans-serif;

  --fw-thin: 100;
  --fw-extralight: 200;
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;
  --fw-black: 900;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: clamp(1.75rem, 3vw, 2rem);
  --text-3xl: clamp(2rem, 4vw, 2.75rem);
  --text-4xl: clamp(2rem, 5vw, 3rem);
  --text-hero: clamp(2.75rem, 8vw, 5.5rem);

  --leading-tight: 1.08;
  --leading-snug: 1.2;
  --leading-normal: 1.55;
  --track-tight: -0.03em;
  --track-wide: 0.04em;
  --track-caps: 0.2em;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
  --space-2xl: clamp(6rem, 14vh, 10rem);

  --header-h: 4.5rem;
  --content-max: 72rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --logo-gray: #505759;
  --logo-fade-duration: 0.9s;
  --logo-fade-ease: cubic-bezier(0.22, 0.85, 0.35, 1);
  --logo-layer-step: 115ms;

  --ease-reveal: cubic-bezier(0.22, 0.85, 0.35, 1);
  --reveal-duration: 0.75s;
  --reveal-stagger: 90ms;
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  font-size: 100%;
  font-weight: var(--fw-light);
  line-height: var(--leading-normal);
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--bg);
  background: var(--ink);
  border-radius: 0.25rem;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: var(--fw-light);
  line-height: var(--leading-normal);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: inherit;
  font-style: normal;
  color: var(--ink);
  margin: 0;
}

h1 {
  font-size: var(--text-hero);
  font-weight: var(--fw-black);
  line-height: var(--leading-tight);
  letter-spacing: var(--track-tight);
}

h2 {
  font-size: var(--text-4xl);
  font-weight: var(--fw-extrabold);
  line-height: var(--leading-snug);
  letter-spacing: var(--track-tight);
}

h3 {
  font-size: var(--text-3xl);
  font-weight: var(--fw-bold);
  line-height: var(--leading-snug);
}

h4 {
  font-size: var(--text-2xl);
  font-weight: var(--fw-semibold);
  line-height: var(--leading-snug);
}

h5 {
  font-size: var(--text-xl);
  font-weight: var(--fw-semibold);
  line-height: var(--leading-snug);
}

h6 {
  font-size: var(--text-lg);
  font-weight: var(--fw-medium);
  line-height: var(--leading-snug);
  letter-spacing: var(--track-wide);
}

p,
li,
dd,
blockquote {
  font-weight: var(--fw-light);
}

strong,
b {
  font-weight: var(--fw-semibold);
}

em,
i,
cite {
  font-style: italic;
  font-weight: inherit;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a {
  font-weight: var(--fw-medium);
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: opacity 0.2s var(--ease), font-weight 0.2s var(--ease);
}

a:hover {
  opacity: 0.65;
  font-weight: var(--fw-semibold);
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  height: var(--header-h);
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  background: linear-gradient(
    to bottom,
    var(--bg) 40%,
    rgba(232, 233, 232, 0.85) 70%,
    transparent
  );
  backdrop-filter: blur(6px);
}

.logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.15;
}

.logo__mark {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.logo__tag {
  font-size: 0.7rem;
  font-weight: var(--fw-light);
  color: var(--ink-muted);
  letter-spacing: var(--track-wide);
}

.site-nav {
  display: none;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  letter-spacing: var(--track-wide);
}

.site-nav a {
  text-decoration: none;
}

.site-nav__cta {
  padding: 0.55rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.site-nav__cta:hover {
  opacity: 1;
  background: var(--accent);
  color: var(--bg);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 1px;
  background: var(--ink);
  transition: transform 0.25s var(--ease);
}

.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md) clamp(1.25rem, 4vw, 2.5rem);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  font-size: 1.125rem;
}

.mobile-nav[hidden] {
  display: none;
}

.mobile-nav a {
  text-decoration: none;
}

/* —— Hero —— */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: calc(100dvh - var(--header-h));
  padding: var(--space-lg) clamp(1.25rem, 4vw, 2.5rem) var(--space-xl);
  max-width: var(--content-max);
}

.hero__eyebrow {
  margin: 0 0 var(--space-md);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--accent);
}

.hero__title {
  display: flex;
  flex-direction: column;
  gap: clamp(0.35rem, 1.5vw, 0.65rem);
  margin: 0;
  font-size: clamp(1.85rem, 5.5vw, var(--text-hero));
  font-weight: var(--fw-black);
  line-height: var(--leading-tight);
  letter-spacing: var(--track-tight);
  max-width: 22ch;
}

.hero__title-line {
  display: block;
}

.hero__title-line--emphasis {
  font-weight: var(--fw-extrabold);
  color: var(--ink);
}

.hero__title-line--emphasis::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 2px;
  margin-top: 0.65rem;
  background: var(--accent);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.hero__hint {
  margin: var(--space-lg) 0 0;
  font-size: 0.7rem;
  font-weight: var(--fw-medium);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--ink-muted);
  opacity: 0.7;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--track-wide);
  text-decoration: none;
  border-radius: 999px;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.btn--primary {
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
}

.btn--primary:hover {
  opacity: 1;
  background: transparent;
  color: var(--accent);
}

.btn--ghost {
  border: 1px solid var(--palette-gray-light);
  color: var(--ink);
  background: rgba(178, 180, 177, 0.35);
}

.btn--ghost:hover {
  opacity: 1;
  border-color: var(--palette-gray-dark);
}

/* —— Sections —— */
.section {
  padding: var(--space-2xl) clamp(1.25rem, 4vw, 2.5rem);
}

.section--band {
  background: var(--bg-band);
  border-block: 1px solid var(--line);
}

.section--contact {
  padding-bottom: var(--space-xl);
}

.section__inner {
  max-width: var(--content-max);
  margin-inline: auto;
}

.section__inner--split {
  display: grid;
  gap: var(--space-lg);
}

.section__header {
  margin-bottom: var(--space-md);
}

.section__index {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: 0.7rem;
  font-weight: var(--fw-semibold);
  letter-spacing: var(--track-caps);
  color: var(--accent);
}

.section h2 {
  margin: 0;
}

.section__text,
.section__body p {
  margin: 0;
  max-width: 42ch;
  font-weight: var(--fw-light);
  color: var(--ink-muted);
  font-size: 1.05rem;
}

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 1.35rem, 0);
  transition:
    opacity var(--reveal-duration) var(--ease-reveal),
    transform var(--reveal-duration) var(--ease-reveal);
  transition-delay: calc(var(--reveal-delay, 0) * var(--reveal-stagger));
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.btn:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* —— Smartphone: contenuto sopra il canvas —— */
@media (max-width: 767px) {
  .site-header {
    height: 3.75rem;
    padding-inline: 1rem;
  }

  .hero {
    min-height: calc(100dvh - 3.75rem);
    padding: 2rem 1rem 3.5rem;
  }

  .hero__title {
    max-width: none;
    font-size: clamp(1.65rem, 7.5vw, 2.35rem);
  }

  .hero__title-line--emphasis::after {
    width: 2.5rem;
    margin-top: 0.5rem;
  }

  .hero__hint {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
  }

  .section {
    padding-block: clamp(4rem, 12vh, 6rem);
    padding-inline: 1rem;
  }

  .section--band {
    background: rgba(178, 180, 177, 0.55);
  }
}

/* —— Responsive nav —— */
@media (min-width: 768px) {
  .site-nav {
    display: flex;
  }

  .nav-toggle,
  .mobile-nav {
    display: none !important;
  }

  .hero__hint {
    display: block;
  }

  .section__inner--split {
    grid-template-columns: 1fr 1.4fr;
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero__hint {
    display: none;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
    will-change: auto;
  }
}
