/*!
 * © Alessandro Castagna — 321.al / EVOLAB
 * Tutti i diritti riservati. Uso non autorizzato vietato.
 * info@321.it · https://321.al
 *
 * SITO themeli.321.al — foglio di stile. Direzione: editorial luxury.
 * Crema + bronzo, Fraunces display, grana sottile, ombre diffuse, micro-motion.
 */

:root {
  --bg: 247 246 242;
  --surface: 255 255 255;
  --sunken: 240 238 231;
  --ink: 23 21 19;
  --ink-muted: 85 81 75;
  --ink-subtle: 138 133 125;
  --accent: 200 150 75;
  --accent-deep: 168 130 62;
  --identity: 228 30 32;
  --line: 228 224 216;
  --shadow: 23 21 19;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.32, 0.72, 0, 1);
  --maxw: 1200px;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: 20 19 18;
  --surface: 28 26 24;
  --sunken: 15 14 13;
  --ink: 247 246 242;
  --ink-muted: 184 178 168;
  --ink-subtle: 131 125 115;
  --accent: 216 168 91;
  --accent-deep: 200 150 75;
  --line: 44 41 37;
  --shadow: 0 0 0;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: 20 19 18;
    --surface: 28 26 24;
    --sunken: 15 14 13;
    --ink: 247 246 242;
    --ink-muted: 184 178 168;
    --ink-subtle: 131 125 115;
    --accent: 216 168 91;
    --accent-deep: 200 150 75;
    --line: 44 41 37;
    --shadow: 0 0 0;
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: rgb(var(--bg));
  color: rgb(var(--ink));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

/* Grana sottile su strato fisso, mai su contenuto che scorre. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
  background: rgb(var(--accent) / 0.28);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- Tipografia ---------- */
.font-display {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
}
.font-mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgb(var(--accent-deep));
}
.eyebrow::before {
  content: '';
  width: 1.6rem;
  height: 1px;
  background: rgb(var(--accent) / 0.7);
}

h1,
h2,
h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 550;
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: rgb(var(--ink-muted));
  line-height: 1.62;
  text-wrap: pretty;
  max-width: 44ch;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
  position: relative;
  z-index: 2;
}

section {
  position: relative;
  padding-block: clamp(5rem, 11vw, 9.5rem);
  z-index: 2;
}

.section-head {
  max-width: 46rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-head h2 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  margin-top: 1.2rem;
}
.section-head p {
  margin-top: 1.1rem;
  color: rgb(var(--ink-muted));
  font-size: 1.05rem;
  max-width: 40ch;
}

/* ---------- Navigazione: pill flottante ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding-top: 1.25rem;
  transition: padding 0.4s var(--ease);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: min(var(--maxw), calc(100% - 2rem));
  padding: 0.55rem 0.7rem 0.55rem 1.4rem;
  border-radius: 999px;
  background: rgb(var(--surface) / 0.72);
  border: 1px solid rgb(var(--line) / 0.9);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.5) inset, 0 10px 30px -18px rgb(var(--shadow) / 0.5);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), background 0.5s var(--ease);
}
.brand {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.brand .dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgb(var(--accent));
  box-shadow: 0 0 0 4px rgb(var(--accent) / 0.16);
}
.nav-links {
  display: flex;
  gap: 0.35rem;
}
.nav-links a {
  font-size: 0.9rem;
  color: rgb(var(--ink-muted));
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  transition: color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav-links a:hover {
  color: rgb(var(--ink));
  background: rgb(var(--sunken));
}
.nav-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.lang {
  display: flex;
  gap: 0.1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
}
.lang a {
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  color: rgb(var(--ink-subtle));
  transition: color 0.3s var(--ease);
}
.lang a[aria-current='true'] {
  color: rgb(var(--accent-deep));
}
.lang a:hover {
  color: rgb(var(--ink));
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgb(var(--line));
  background: transparent;
  color: rgb(var(--ink));
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.icon-btn:hover {
  background: rgb(var(--sunken));
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}
.icon-btn .sun {
  display: none;
}
:root[data-theme='dark'] .icon-btn .sun {
  display: block;
}
:root[data-theme='dark'] .icon-btn .moon {
  display: none;
}
.nav-burger {
  display: none;
}
.nav-burger .ico-x {
  display: none;
}
.nav-burger.open .ico-list {
  display: none;
}
.nav-burger.open .ico-x {
  display: block;
}

/* ---------- Bottoni ---------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--bg);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem 0.7rem 1.3rem;
  border-radius: 999px;
  background: rgb(var(--btn-bg));
  color: rgb(var(--btn-fg));
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.4s var(--ease), background 0.4s var(--ease), box-shadow 0.4s var(--ease);
  will-change: transform;
}
.btn .btn-ico {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgb(var(--btn-fg) / 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s var(--ease-soft), background 0.4s var(--ease);
}
.btn .btn-ico svg {
  width: 15px;
  height: 15px;
}
.btn:hover {
  box-shadow: 0 18px 40px -22px rgb(var(--shadow) / 0.7);
}
.btn:hover .btn-ico {
  transform: translate(2px, -2px);
  background: rgb(var(--btn-fg) / 0.22);
}
.btn:active {
  transform: scale(0.98);
}
.btn-accent {
  --btn-bg: var(--accent);
  --btn-fg: 20 19 18;
}
.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border-color: rgb(var(--line));
}
.btn-ghost .btn-ico {
  background: rgb(var(--ink) / 0.08);
}

/* ---------- Hero ---------- */
.hero {
  padding-top: clamp(9rem, 18vh, 13rem);
  padding-bottom: clamp(4rem, 8vw, 7rem);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: end;
}
.hero h1 {
  font-size: clamp(3.2rem, 10vw, 8.2rem);
  font-weight: 500;
  line-height: 0.98;
  margin-top: 1.6rem;
}
.hero h1 .line {
  display: block;
  overflow: hidden;
}
.hero h1 .line > span {
  display: block;
}
.hero h1 .accent {
  font-style: italic;
  font-weight: 400;
  color: rgb(var(--accent-deep));
}
.hero-side {
  padding-bottom: 0.6rem;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.2rem;
}
.hero-note {
  margin-top: 1.6rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: rgb(var(--ink-subtle));
}

/* medaglione decorativo del hero (nessuna immagine esterna) */
.seal {
  width: min(100%, 320px);
  aspect-ratio: 1;
  margin-left: auto;
  border-radius: 999px;
  border: 1px solid rgb(var(--line));
  display: grid;
  place-items: center;
  position: relative;
  background: radial-gradient(120% 120% at 30% 20%, rgb(var(--surface)), rgb(var(--sunken)));
  box-shadow: 0 40px 80px -50px rgb(var(--shadow) / 0.6);
}
.seal::before {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 999px;
  border: 1px solid rgb(var(--accent) / 0.35);
}
.seal .glyph {
  font-family: 'Fraunces', serif;
  font-size: 5.5rem;
  font-weight: 500;
  color: rgb(var(--ink));
  line-height: 1;
}
.seal .ring-text {
  position: absolute;
  inset: 0;
  animation: spin 26s linear infinite;
}
.seal .ring-text text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.2px;
  letter-spacing: 3px;
  fill: rgb(var(--ink-subtle));
  text-transform: uppercase;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Marquee ---------- */
.marquee {
  border-block: 1px solid rgb(var(--line));
  padding: 0;
  overflow: hidden;
}
.marquee-track {
  display: flex;
  gap: 3.5rem;
  padding-block: 1.4rem;
  width: max-content;
  animation: slide 34s linear infinite;
}
.marquee:hover .marquee-track {
  animation-play-state: paused;
}
.marquee-item {
  font-family: 'Fraunces', serif;
  font-size: 1.35rem;
  font-style: italic;
  color: rgb(var(--ink-muted));
  display: inline-flex;
  align-items: center;
  gap: 3.5rem;
  white-space: nowrap;
}
.marquee-item::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgb(var(--accent));
}
@keyframes slide {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Principi ---------- */
.principles-list {
  display: grid;
  gap: 0;
  border-top: 1px solid rgb(var(--line));
}
.principle {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: clamp(1rem, 4vw, 3rem);
  padding-block: clamp(1.6rem, 3vw, 2.4rem);
  border-bottom: 1px solid rgb(var(--line));
  align-items: start;
  transition: background 0.4s var(--ease);
}
.principle:hover {
  background: rgb(var(--surface) / 0.5);
}
.principle .n {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: rgb(var(--accent-deep));
  padding-top: 0.5rem;
}
.principle h3 {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 500;
}
.principle p {
  margin-top: 0.6rem;
  color: rgb(var(--ink-muted));
  max-width: 52ch;
}
.principle .body {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .principle {
    grid-template-columns: 5rem 0.9fr 1.1fr;
  }
  .principle .body {
    grid-column: 2 / 4;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 3rem;
    align-items: baseline;
  }
}

/* ---------- Capabilities (tier) ---------- */
.tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.tier {
  padding: 0.5rem;
  border-radius: 1.75rem;
  background: rgb(var(--sunken) / 0.6);
  border: 1px solid rgb(var(--line));
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.tier:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 60px -40px rgb(var(--shadow) / 0.65);
}
.tier-core {
  height: 100%;
  padding: clamp(1.5rem, 2.5vw, 2.2rem);
  border-radius: 1.4rem;
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--line) / 0.8);
  box-shadow: inset 0 1px 1px rgb(255 255 255 / 0.14);
  display: flex;
  flex-direction: column;
}
.tier .tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgb(var(--ink-subtle));
}
.tier h3 {
  font-size: 2rem;
  margin-top: 1.4rem;
}
.tier .desc {
  margin-top: 0.7rem;
  color: rgb(var(--ink-muted));
  font-size: 0.98rem;
}
.tier ul {
  list-style: none;
  margin-top: 1.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgb(var(--line));
  display: grid;
  gap: 0.7rem;
}
.tier li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.92rem;
  color: rgb(var(--ink-muted));
}
.tier li svg {
  width: 16px;
  height: 16px;
  color: rgb(var(--accent-deep));
  flex: none;
}

/* ---------- Stats ---------- */
.stats {
  background: rgb(var(--sunken) / 0.55);
  border-block: 1px solid rgb(var(--line));
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}
.stat .value {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat .label {
  margin-top: 0.8rem;
  font-size: 0.95rem;
}
.stat .note {
  margin-top: 0.2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: rgb(var(--ink-subtle));
}

/* ---------- Approach ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  counter-reset: step;
}
.step {
  position: relative;
  padding-top: 2.2rem;
  border-top: 2px solid rgb(var(--ink));
}
.step .n {
  position: absolute;
  top: -0.9rem;
  left: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  background: rgb(var(--bg));
  padding-right: 0.6rem;
  color: rgb(var(--accent-deep));
}
.step h3 {
  font-size: 1.4rem;
  font-weight: 500;
}
.step p {
  margin-top: 0.7rem;
  color: rgb(var(--ink-muted));
  font-size: 0.95rem;
}

/* ---------- Difference (split) ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.split h2 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 500;
}
.split .big-quote {
  font-family: 'Fraunces', serif;
  font-style: italic;
}
.split p.text {
  margin-top: 1.4rem;
  color: rgb(var(--ink-muted));
  font-size: 1.1rem;
  max-width: 46ch;
}
.point-list {
  list-style: none;
  display: grid;
  gap: 1rem;
}
.point {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.3rem 1.5rem;
  border-radius: 1.2rem;
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--line));
  transition: transform 0.4s var(--ease);
}
.point:hover {
  transform: translateX(6px);
}
.point .idx {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: rgb(var(--accent-deep));
  padding-top: 0.15rem;
}
.point span.t {
  font-size: 1.02rem;
}

/* ---------- CTA ---------- */
.cta-band {
  text-align: center;
}
.cta-card {
  position: relative;
  padding: clamp(3rem, 8vw, 6rem) clamp(1.5rem, 5vw, 4rem);
  border-radius: 2.25rem;
  background: rgb(var(--ink));
  color: rgb(var(--bg));
  overflow: hidden;
}
.cta-card h2 {
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  font-weight: 500;
  max-width: 18ch;
  margin: 0 auto;
}
.cta-card p {
  margin: 1.4rem auto 0;
  max-width: 44ch;
  color: rgb(var(--bg) / 0.7);
}
.cta-card .btn {
  margin-top: 2.4rem;
  --btn-bg: var(--accent);
  --btn-fg: 20 19 18;
}
.cta-card .halo {
  position: absolute;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 999px;
  border: 1px solid rgb(var(--accent) / 0.25);
  bottom: -30%;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
.cta-card .halo::before {
  content: '';
  position: absolute;
  inset: 22%;
  border-radius: 999px;
  border: 1px solid rgb(var(--accent) / 0.2);
}

/* ---------- Footer ---------- */
footer.site {
  border-top: 1px solid rgb(var(--line));
  padding-block: 3.5rem 2.5rem;
}
.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
}
.foot .brand {
  margin-right: 0;
}
.foot .meta {
  font-size: 0.85rem;
  color: rgb(var(--ink-subtle));
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: center;
}
.foot .meta a:hover {
  color: rgb(var(--ink));
}

/* ---------- Reveal (scroll) ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(6px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), filter 0.9s var(--ease);
  transition-delay: var(--delay, 0ms);
}
[data-reveal].in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ---------- Mobile menu overlay ---------- */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgb(var(--bg) / 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.menu-overlay a {
  font-family: 'Fraunces', serif;
  font-size: clamp(2rem, 9vw, 3.2rem);
  font-weight: 500;
  padding: 0.4rem 0;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.6s var(--ease), opacity 0.6s var(--ease);
}
.menu-overlay.open a {
  transform: none;
  opacity: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .seal {
    display: none;
  }
  .tiers,
  .stats-grid,
  .steps {
    grid-template-columns: 1fr;
  }
  .steps {
    gap: 2.2rem;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
  .nav-burger {
    display: inline-flex;
  }
}
@media (max-width: 620px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .principle {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .btn {
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
