/* ==========================================================================
   CORE — token, reset, tipografia, bottoni, nav, footer, motion utilities
   Federico Quattrocchi · Coldwell Banker 24RE
   ========================================================================== */

:root {
  /* Brand */
  --navy: #042067;
  --navy-hi: #0b2f8a;
  --ink: #020817;          /* navy quasi nero: superficie scura */
  --ink-2: #071331;        /* superficie scura elevata */
  --gold: #c9a962;
  --gold-hi: #ead39c;
  --gold-lo: #a7843d;

  /* Neutri (scala Apple) */
  --paper: #f5f5f7;
  --white: #ffffff;
  --text: #1d1d1f;         /* su bianco 16.8:1 */
  --text-2: #6e6e73;       /* su bianco 5.0:1 · su paper 4.6:1 */
  --on-dark: #f5f5f7;
  --on-dark-2: #a1a1a6;    /* su ink 7.9:1 */
  --hairline: rgba(0, 0, 0, .08);
  --hairline-dark: rgba(255, 255, 255, .1);

  --gold-text: linear-gradient(180deg, #f3e2b4 0%, #c9a962 55%, #a7843d 100%);

  /* Tipografia */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --gutter: 20px;
  --max: 1080px;
  --max-wide: 1240px;
  --radius: 28px;
  --radius-sm: 18px;
  --nav-h: 52px;

  /* Motion */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
}

@media (min-width: 734px) {
  :root { --gutter: 40px; --nav-h: 56px; }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -.022em;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(201, 169, 98, .35); }
body.is-locked { overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--wide { max-width: calc(var(--max-wide) + var(--gutter) * 2); }
.section { padding: 96px 0; position: relative; }
@media (min-width: 1069px) { .section { padding: 140px 0; } }
.section--dark { background: var(--ink); color: var(--on-dark); }
.section--paper { background: var(--paper); }
.center { text-align: center; }

/* ---------- Tipografia ---------- */
h1, h2, h3, .lead, .display, .promise { text-wrap: balance; }
p { text-wrap: pretty; }
.h1 + .lead, .h2 + .lead, .h3 + .lead { margin-top: 16px; }
.eyebrow {
  display: inline-block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--gold-lo);
  margin-bottom: 14px;
}
.section--dark .eyebrow, .hero .eyebrow { color: var(--gold); }

.display {
  font-size: clamp(44px, 11vw, 96px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -.045em;
}
.h1 {
  font-size: clamp(40px, 9vw, 80px);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -.04em;
}
.h2 {
  font-size: clamp(34px, 6.4vw, 64px);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -.035em;
}
.h3 {
  font-size: clamp(24px, 3.6vw, 32px);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -.025em;
}
.lead {
  font-size: clamp(19px, 2.4vw, 24px);
  line-height: 1.38;
  font-weight: 500;
  letter-spacing: -.02em;
  color: var(--text-2);
  max-width: 36ch;
}
.center .lead { margin-left: auto; margin-right: auto; }
.section--dark .lead, .hero .lead { color: var(--on-dark-2); }
.muted { color: var(--text-2); }
.section--dark .muted { color: var(--on-dark-2); }

.gold {
  background: var(--gold-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.nowrap { white-space: nowrap; }
.fine {
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--text-2);
}
.section--dark .fine, .hero .fine { color: #86868b; }

/* ---------- Bottoni ---------- */
.btn {
  --h: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--h);
  padding: 0 28px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.015em;
  white-space: nowrap;
  transition: transform .35s var(--ease), background-color .25s ease, box-shadow .35s var(--ease), color .25s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  isolation: isolate;
}
.btn:active { transform: scale(.97); }
.btn--gold {
  color: var(--ink);
  background: linear-gradient(180deg, #e3c98a 0%, #c9a962 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 10px 30px -10px rgba(201, 169, 98, .65);
}
.btn--gold:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 16px 40px -12px rgba(201, 169, 98, .85); transform: translateY(-1px); }
.btn--ink { color: var(--white); background: var(--ink); }
.btn--ink:hover { background: var(--navy); }
.btn--lg { --h: 58px; padding: 0 34px; font-size: 18px; }
.btn--sm { --h: 34px; padding: 0 16px; font-size: 14px; }
.btn .arrow { transition: transform .35s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 17px;
  font-weight: 500;
  color: var(--gold-lo);
}
.section--dark .link, .hero .link { color: var(--gold); }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.center .cta-row { justify-content: center; }

/* ---------- Nav (vetro) ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  color: var(--on-dark);
  transition: background-color .4s ease, box-shadow .4s ease, color .4s ease;
}
.nav.is-scrolled {
  background: rgba(2, 8, 23, .72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 var(--hairline-dark);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav__brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nav__logo { height: 30px; width: auto; }
.nav__name { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.nav__name strong { font-size: 14px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.nav__name span { font-size: 11px; color: var(--on-dark-2); letter-spacing: 0; white-space: nowrap; }
.nav .btn--sm { opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .4s ease, transform .4s var(--ease); }
.nav.is-scrolled .btn--sm { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Barra CTA mobile ---------- */
.dock {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 18px;
  border-radius: 999px;
  color: var(--on-dark);
  background: rgba(7, 19, 49, .78);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 0 0 1px var(--hairline-dark) inset, 0 20px 40px -12px rgba(0, 0, 0, .5);
  transform: translateY(140%);
  transition: transform .6s var(--ease);
}
.dock.is-visible { transform: none; }
.dock__text { font-size: 13px; line-height: 1.25; font-weight: 500; color: var(--on-dark-2); }
.dock__text strong { display: block; color: var(--on-dark); font-size: 15px; font-weight: 600; }
.dock .btn { --h: 44px; padding: 0 20px; font-size: 15px; }
@media (min-width: 834px) { .dock { display: none; } }

/* ---------- Footer ---------- */
.footer { background: var(--paper); color: var(--text-2); font-size: 12px; letter-spacing: 0; padding: 40px 0 120px; }
@media (min-width: 834px) { .footer { padding-bottom: 40px; } }
.footer__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--hairline); }
.footer__brand { display: flex; align-items: center; gap: 14px; }
.footer__brand img { height: 44px; width: auto; }
.footer__brand strong { display: block; color: var(--text); font-size: 15px; font-weight: 600; letter-spacing: -.015em; }
.footer__contacts { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; }
.footer__contacts a { color: var(--text); }
.footer__contacts a:hover { color: var(--gold-lo); }
.footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 16px; }

/* ---------- Motion utilities ---------- */
.reveal {
  opacity: 0;
  transform: translate3d(0, 32px, 0);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal--scale { transform: scale(.94); }
.reveal--blur { filter: blur(12px); transition-property: opacity, transform, filter; }
.reveal--blur.is-in { filter: none; }

.rise { opacity: 0; animation: rise 1.2s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 120ms + 150ms); }
@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 28px, 0); filter: blur(10px); }
  to { opacity: 1; transform: none; filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
  .reveal, .rise { opacity: 1; transform: none; filter: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav.is-scrolled, .dock { background: var(--ink-2); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.footer__note { padding-top: 16px; max-width: 90ch; line-height: 1.5; }
@media (max-width: 833px) { .nav .btn--sm { display: none; } }
