/* ============================================================
   E-Stile Roma — base.css
   Reset, token, tipografia, utilities (Galleria Bianca)
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, picture, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Token ---------- */
:root {
  /* Palette */
  --bg: #F4F1EC;
  --ink: #15130F;
  --accent: #E63329;   /* vermiglio Castiglioni */
  --accent2: #C7A86A;  /* oro premium */
  --muted: #6E685E;   /* ~4.6:1 su --bg (WCAG AA) mantenendo il tono caldo */
  --surface: #FBFAF7;
  --dark: #0A0908;     /* camera oscura */

  /* Tipografia */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Spaziatura (scala 8px) */
  --s1: 4px;  --s2: 8px;  --s3: 16px; --s4: 24px; --s5: 40px;
  --s6: 64px; --s7: 104px; --s8: 168px; --s9: 272px;

  --gutter: clamp(20px, 6vw, 120px);
  --section-gap: clamp(96px, 14vh, 240px);
  --grid-gap: clamp(24px, 3vw, 56px);
  --maxw: 1320px;
  --read: 64ch;

  /* Raggi */
  --r-card: 4px;
  --r-pill: 999px;
  --r-input: 2px;

  /* Hairline */
  --hair: rgba(21, 19, 15, 0.12);
  --hair-strong: rgba(21, 19, 15, 0.22);

  /* Easing */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Base ---------- */
html { scroll-behavior: auto; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
}
/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Tipografia ---------- */
.display {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.5rem, 11vw, 13rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
}
.h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 6rem);
  line-height: 0.96;
  letter-spacing: -0.015em;
}
.h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.75rem, 3.5vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.h3 {
  font-family: var(--body);
  font-weight: 600;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  line-height: 1.15;
}
.lead {
  font-family: var(--body);
  font-weight: 400;
  font-size: clamp(1.15rem, 1.6vw, 1.5rem);
  line-height: 1.55;
}
.eyebrow {
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.price {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.95rem;
}
.accent-text { color: var(--accent); }
.accent2-text { color: var(--accent2); }
.italic-display { font-family: var(--display); font-style: italic; font-weight: 400; }

/* ---------- Layout utilities ---------- */
.wrap { width: 100%; padding-inline: var(--gutter); }
.maxw { max-width: var(--maxw); margin-inline: auto; }
.section { padding-block: var(--section-gap); position: relative; }
.stack-sm > * + * { margin-top: var(--s3); }
.stack-md > * + * { margin-top: var(--s4); }
.stack-lg > * + * { margin-top: var(--s5); }

.hairline { height: 1px; width: 100%; background: var(--hair); border: 0; }
.hairline-accent { height: 1px; width: 100%; background: var(--accent); border: 0; transform-origin: left center; }

/* ---------- Reveal helpers (mask + traslazione) ---------- */
.reveal-line { overflow: hidden; display: block; }
.reveal-line > span { display: inline-block; will-change: transform; }

.r-mask { overflow: hidden; }
[data-reveal] { will-change: transform, opacity; }

/* ---------- Bottoni ---------- */
.btn {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: var(--s3) var(--s5);
  border-radius: var(--r-pill);
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: color 0.4s var(--ease-out);
  z-index: 0;
}
.btn::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s var(--ease-expo);
  z-index: -1;
}
.btn:hover { color: var(--surface); border-color: var(--accent); }
.btn:hover::before { transform: scaleX(1); }
.btn--solid { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn--solid:hover { color: var(--surface); }

/* ---------- Tag / badge ---------- */
.tag {
  display: inline-block;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--surface);
  white-space: nowrap;
}
.tag--gold { background: var(--accent2); color: var(--ink); }

/* ---------- Progress line (lettura globale) ---------- */
.progress-line {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  z-index: 200;
  pointer-events: none;
}

/* ---------- Cursore custom ---------- */
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 8px; height: 8px;
  border-radius: var(--r-pill);
  background: var(--accent);
  pointer-events: none;
  z-index: 300;
  transform: translate(-50%, -50%);
  mix-blend-mode: normal;
  display: none;
}
.cursor-pill {
  position: fixed;
  top: 0; left: 0;
  min-width: 56px; height: 56px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--surface);
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 299;
  transform: translate(-50%, -50%) scale(0);
  transform-origin: center;
}
@media (hover: hover) and (pointer: fine) {
  .cursor-dot { display: block; }
  .cursor-pill { display: flex; }
  body.has-custom-cursor { cursor: none; }
  body.has-custom-cursor a,
  body.has-custom-cursor button { cursor: none; }
}

/* ---------- Accessibilità ---------- */
.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;
}
.skip-link {
  position: absolute; left: var(--s3); top: -60px;
  background: var(--ink); color: var(--surface);
  padding: var(--s2) var(--s4); border-radius: var(--r-card);
  z-index: 400; transition: top 0.2s ease;
}
.skip-link:focus { top: var(--s3); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}
