/* ============================================================
   VALORA HUB — Stylesheet condiviso (style.css)
   ============================================================ */

:root {
  --bg: #0a0a0a;
  --bg-soft: #0f0f0f;
  --bg-card: #131312;
  --fg: #f4f2ee;
  --fg-dim: #8a8780;
  --fg-mute: #4a4844;
  --line: #1f1e1b;
  --line-strong: #2a2925;
  --accent: #d9ff3f;
  --serif: 'Fraunces', 'Times New Roman', serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  line-height: 1.4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

::selection { background: var(--accent); color: #000; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(10, 10, 10, 0.65);
  border-bottom: 1px solid var(--line);
}
.nav__brand {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  font-weight: 500;
}
.nav__brand .blink {
  color: var(--accent);
  animation: blink 1.2s infinite;
}
.nav__brand .nav__sub {
  color: var(--fg-mute);
  font-weight: 400;
  margin-left: 0.4rem;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
}
.nav__links {
  display: flex;
  gap: 2.2rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.nav__links a {
  transition: color .3s var(--ease);
  position: relative;
}
.nav__links a:hover { color: var(--fg); }
.nav__links a.active { color: var(--fg); }
.nav__links a.active::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0; right: 0;
  height: 1px;
  background: var(--accent);
}
.nav__cta {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  padding: 0.7rem 1.2rem;
  transition: all .35s var(--ease);
}
.nav__cta:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* Mobile menu */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  cursor: pointer;
  padding: 0.5rem;
}
.mobile-menu {
  display: none;
  position: fixed;
  top: 60px; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 99;
  padding: 3rem 2rem;
  flex-direction: column;
  gap: 1.5rem;
}
.mobile-menu.active { display: flex; }
.mobile-menu a {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--fg);
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.mobile-menu a em { font-style: italic; color: var(--fg-dim); }

@media (max-width: 760px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: block; }
  .nav { padding: 1rem 1.25rem; }
}

/* ============================================================
   PAGE HEADER (per pagine interne)
   ============================================================ */
.page-header {
  padding: 9rem 2rem 5rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.page-header__meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 2rem;
}
.page-header__meta::before {
  content: "";
  display: inline-block;
  width: 1.5rem;
  height: 1px;
  background: var(--accent);
  vertical-align: middle;
  margin-right: 0.75rem;
}
.page-header__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.8rem, 8vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  max-width: 14ch;
}
.page-header__title em {
  font-style: italic;
  color: var(--fg-dim);
}
.page-header__sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.1rem, 1.5vw, 1.4rem);
  color: var(--fg-dim);
  max-width: 50ch;
  margin-top: 2rem;
  line-height: 1.5;
}
@media (max-width: 760px) {
  .page-header { padding: 7rem 1.25rem 3rem; }
}

/* ============================================================
   SECTION SCAFFOLD
   ============================================================ */
section {
  padding: 7rem 2rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}
@media (max-width: 760px) {
  section { padding: 4.5rem 1.25rem; }
}
.section__head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  margin-bottom: 4rem;
  align-items: start;
}
.section__num {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--fg-dim);
  text-transform: uppercase;
}
.section__num::before {
  content: "";
  display: inline-block;
  width: 1.5rem;
  height: 1px;
  background: var(--accent);
  vertical-align: middle;
  margin-right: 0.75rem;
}
.section__label {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}
.section__label em {
  font-style: italic;
  color: var(--fg-dim);
}
@media (max-width: 760px) {
  .section__head { grid-template-columns: 1fr; gap: 1.5rem; margin-bottom: 2.5rem; }
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  padding: 5rem 2rem 2rem;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  position: relative;
}
.foot__mark {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(5rem, 18vw, 18rem);
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: var(--fg);
  margin-bottom: 3rem;
  user-select: none;
}
.foot__mark em {
  font-style: italic;
  color: var(--accent);
}
.foot {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}
.foot__col strong {
  display: block;
  color: var(--fg-mute);
  font-weight: 400;
  margin-bottom: 0.8rem;
  font-size: 0.65rem;
}
.foot__col p {
  line-height: 1.8;
  color: var(--fg-dim);
}
.foot__col a { color: var(--fg-dim); transition: color .3s var(--ease); }
.foot__col a:hover { color: var(--accent); }
.foot__nav {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.foot__nav p {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.foot__nav a { margin: 0 0.3rem; color: var(--fg-dim); transition: color .3s var(--ease); }
.foot__nav a:hover { color: var(--accent); }
.foot__bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--fg-mute);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  flex-wrap: wrap;
  gap: 1rem;
}
.foot__bottom .signature {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.85rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg-dim);
}
.foot__bottom .signature em { color: var(--fg); font-weight: 400; }
@media (max-width: 760px) {
  .foot { grid-template-columns: 1fr; gap: 2rem; }
  .foot__bottom { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   COOKIE BANNER
   ============================================================ */
.cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  padding: 1.5rem;
  z-index: 200;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--fg-dim);
  transform: translateY(150%);
  transition: transform .6s var(--ease);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner strong {
  color: var(--fg);
  font-weight: 500;
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.cookie-banner a { color: var(--accent); text-decoration: underline; }
.cookie-banner__actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}
.cookie-banner button {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: all .3s var(--ease);
}
.cookie-banner button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}
.cookie-banner button:hover {
  border-color: var(--fg);
}
.cookie-banner button.primary:hover {
  background: var(--fg);
  border-color: var(--fg);
}

/* ============================================================
   ANIMATIONS — Fail-safe: visibili anche senza JavaScript
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
  /* Fail-safe: se dopo 1.5s niente è successo, mostra comunque */
  animation: autoReveal 1.5s var(--ease) 1.5s forwards;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  animation: none; /* annulla autoReveal se JS funziona */
}
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .25s; }
.reveal-delay-3 { transition-delay: .4s; }
.reveal-delay-4 { transition-delay: .55s; }

/* Quando JS è disabilitato, mostra subito */
.no-js .reveal {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

@keyframes autoReveal {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
