/* =========================================================================
   Palchet — landing
   Superficie "vetrina" scura (warm near-black) + banda cream "diario".
   Palette/tipografia ereditate da palchet-app/DESIGN.md (identità del brand).
   ========================================================================= */

:root {
  /* superfici scure (vetrina) */
  --ink:        #16130f;   /* fondo pagina, near-black caldo */
  --ink-soft:   #1c1a18;   /* superficie vetrina */
  --ink-raise:  #221f1b;   /* bande/card sollevate */
  --line:       rgba(236, 226, 205, 0.13);
  --line-hi:    rgba(236, 226, 205, 0.26);

  /* testo su scuro */
  --ivory:      #ece2cd;
  --ivory-dim:  rgba(236, 226, 205, 0.74);
  --ivory-mute: rgba(236, 226, 205, 0.55);

  /* accenti (= DESIGN.md, leggermente schiariti per il fondo scuro) */
  --bronze:     #c8a877;
  --bronze-hi:  #d9b884;
  --green:      #2d7a3f;
  --green-dark: #276c39;   /* hover bottone: testo chiaro resta >=AA */
  --danger:     #d96a5a;   /* errore su scuro (terracotta schiarita, AA) */
  --forest:     #1b3319;
  --field-line: rgba(236, 226, 205, 0.46); /* bordo controlli form, >=3:1 */

  /* banda chiara "diario" */
  --cream:      #f5f1e8;
  --cream-raise:#faf7ef;
  --cream-line: #ddd6c8;
  --cream-ink:  #2a2622;
  --cream-dim:  #6b6055;

  /* tipografia */
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* misura */
  --wrap: 1180px;
  --gutter: clamp(1.25rem, 5vw, 4rem);

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

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; line-height: 1.04; letter-spacing: -0.01em; }
p { margin: 0; }

::selection { background: var(--bronze); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--bronze-hi);
  outline-offset: 3px;
  border-radius: 3px;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: absolute; left: 1rem; top: -100%;
  background: var(--bronze); color: var(--ink);
  padding: 0.6rem 1rem; border-radius: 10px; z-index: 100;
  font-weight: 600; font-size: 0.9rem; text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------- eyebrow ---------- */
.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bronze);
  font-weight: 600;
  margin: 0 0 1rem;
}
.eyebrow--ink { color: var(--cream-dim); }

/* ---------- buttons ---------- */
.btn {
  --pad-y: 0.85rem; --pad-x: 1.5rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--sans); font-weight: 600; font-size: 0.95rem;
  letter-spacing: 0.01em; text-decoration: none;
  padding: var(--pad-y) var(--pad-x); border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  min-height: 48px;
  transition: transform 0.4s var(--ease), background-color 0.3s var(--ease),
              border-color 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.4s var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--green); color: #fbf7ee;
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 8px 24px -12px rgba(45,122,63,0.9);
}
.btn--primary:hover { background: var(--green-dark); transform: translateY(-2px); }

.btn--ghost {
  background: transparent; color: var(--ivory);
  border-color: var(--line-hi);
}
.btn--ghost:hover { border-color: var(--bronze); color: var(--bronze-hi); }

.btn--quiet {
  background: transparent; color: var(--ivory-dim);
  padding-inline: 0.6rem; border-radius: 0;
  border-bottom: 1px solid var(--line-hi); min-height: auto;
}
.btn--quiet:hover { color: var(--bronze-hi); border-color: var(--bronze); }

.btn--block { width: 100%; }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-stuck {
  background: rgba(22, 19, 15, 0.82);
  backdrop-filter: blur(12px) saturate(1.1);
  border-bottom-color: var(--line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 0.85rem; padding-bottom: 0.85rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand__mark { height: 48px; width: auto; }
.brand__word {
  font-family: var(--serif); font-size: 2.1rem; font-weight: 600;
  letter-spacing: 0.07em; color: var(--ivory); line-height: 1;
}
.site-header__cta { --pad-y: 0.6rem; --pad-x: 1.1rem; min-height: 42px; font-size: 0.88rem; }
@media (max-width: 540px) {
  .brand__mark { height: 40px; }
  .brand__word { font-size: 1.7rem; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-bottom: clamp(3rem, 9vh, 7rem); padding-top: 6rem;
  overflow: hidden; isolation: isolate;
}
.hero__bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: 32% 22%;
  animation: kenburns 26s var(--ease) infinite alternate;
}
@keyframes kenburns { from { transform: scale(1.04); } to { transform: scale(1.13); } }
.hero__veil {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 90% at 70% 8%, rgba(22,19,15,0) 30%, rgba(22,19,15,0.5) 100%),
    linear-gradient(180deg, rgba(22,19,15,0.42) 0%, rgba(22,19,15,0.12) 34%, rgba(22,19,15,0.62) 76%, var(--ink) 100%);
}
.hero__content { position: relative; max-width: 760px; }
.hero__title {
  font-size: clamp(2.7rem, 1.6rem + 5.2vw, 5.6rem);
  margin: 0.4rem 0 1.4rem;
  text-wrap: balance;
  text-shadow: 0 2px 40px rgba(0,0,0,0.45);
}
.hero__sub {
  font-size: clamp(1.05rem, 0.98rem + 0.5vw, 1.3rem);
  color: var(--ivory-dim); max-width: 48ch; line-height: 1.55;
  text-shadow: 0 1px 20px rgba(0,0,0,0.5);
}
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.1rem 1.6rem; margin-top: 2.2rem; }

.hero__scroll {
  position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%);
  z-index: 1; width: 28px; height: 46px; display: grid; place-items: start center;
  border: 1px solid var(--line-hi); border-radius: 999px; padding-top: 8px;
}
.hero__scroll-line { width: 2px; height: 10px; border-radius: 2px; background: var(--bronze); animation: scrollpulse 1.9s var(--ease) infinite; }
@keyframes scrollpulse { 0%,100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(8px); } }

/* dictionary motif — ora chiude la pagina nel footer */
.def__word { font-style: normal; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.7em; color: var(--bronze); }
.def__pos { color: var(--ivory-mute); }
.def__sep { color: var(--bronze); padding: 0 0.2em; }

/* ---------- essenza (banda cream) ---------- */
.essenza { background: var(--cream); color: var(--cream-ink); }
.essenza__inner { padding-block: clamp(4.5rem, 12vh, 9rem); max-width: 880px; }
.essenza__title {
  color: var(--cream-ink);
  font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.9rem);
  margin-bottom: 1.4rem;
}
.essenza__body { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.4rem); color: #4a443c; max-width: 60ch; line-height: 1.6; }

/* ---------- section head ---------- */
.section-head { padding-block: clamp(4rem, 11vh, 8rem) 1rem; max-width: 640px; }
.section-head__title { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.3rem); }

/* ---------- momenti ---------- */
.momenti { background: var(--ink); padding-bottom: clamp(3rem, 8vh, 6rem); }
.momento { padding-block: clamp(2rem, 5vh, 3.5rem); }
.momento__grid {
  display: grid; grid-template-columns: 1.15fr 1fr; align-items: center;
  gap: clamp(1.8rem, 5vw, 5rem);
}
.momento--flip .momento__media { order: 2; }
.momento--flip .momento__text { order: 1; }

.momento__media {
  margin: 0; border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 60px -34px rgba(0,0,0,0.85);
  position: relative;
}
.momento__media::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--line); pointer-events: none;
}
.momento__media img {
  width: 100%; height: auto; display: block; /* rapporto nativo: variazione voluta tra i momenti */
  transition: transform 1.1s var(--ease);
}
.momento:hover .momento__media img { transform: scale(1.035); }

.momento__title { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.6rem); margin-bottom: 0.8rem; }
.momento__body { color: var(--ivory-dim); max-width: 42ch; font-size: 1.05rem; }

/* ---------- tester ---------- */
.tester { background: var(--ink-soft); border-top: 1px solid var(--line); }
.tester__grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 6rem); align-items: start;
  padding-block: clamp(4.5rem, 12vh, 9rem);
}
.tester__title { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.7rem); margin-bottom: 1.2rem; }
.tester__lede { color: var(--ivory-dim); max-width: 46ch; font-size: 1.08rem; }
.tester__facts { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 0.85rem; }
.tester__facts li { display: flex; align-items: baseline; gap: 0.85rem; color: var(--ivory-dim); font-size: 0.98rem; }
.tester__facts li::before { content: ""; flex: none; width: 16px; height: 1px; background: var(--bronze); transform: translateY(-0.32em); }

.tester__form {
  background: var(--ink-raise); border: 1px solid var(--line);
  border-radius: 24px; padding: clamp(1.5rem, 3vw, 2.4rem);
  display: grid; gap: 1.15rem;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.15rem; }
.field { display: grid; gap: 0.45rem; }
.field label { font-size: 0.82rem; letter-spacing: 0.06em; color: var(--bronze); font-weight: 600; }

.field label .field__opt { color: var(--ivory-mute); font-weight: 400; text-transform: none; letter-spacing: 0.02em; font-style: italic; }
.field input, .select-wrap select, .field textarea {
  width: 100%; font-family: var(--sans); font-size: 1rem; color: var(--ivory);
  background: rgba(0,0,0,0.22); border: 1px solid var(--field-line);
  border-radius: 12px; padding: 0.8rem 0.95rem; min-height: 48px;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
  appearance: none;
}
.field textarea { min-height: 0; resize: vertical; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--ivory-mute); }
.field input:focus, .select-wrap select:focus, .field textarea:focus { outline: none; border-color: var(--bronze); background: rgba(0,0,0,0.32); }
/* errore: un solo trattamento, rosso danger (mai il verde-azione) */
.field input[data-error="1"], .field [aria-invalid="true"], .select-wrap select[data-error="1"] { border-color: var(--danger); }

.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 1rem; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--bronze); border-bottom: 2px solid var(--bronze);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.select-wrap select { color: var(--ivory); }
.select-wrap select:invalid { color: var(--ivory-mute); }
.select-wrap select option { color: #1a1a1a; }

.tester__privacy { font-size: 0.82rem; color: var(--ivory-mute); line-height: 1.5; margin-top: -0.2rem; }

.form-status { font-size: 0.92rem; margin-top: 0.2rem; line-height: 1.5; }
.form-status[data-kind="error"] { color: var(--danger); }
.form-status[data-kind="info"] { color: var(--ivory-dim); }
.form-status a { color: var(--bronze-hi); text-underline-offset: 3px; }

.tester__done { text-align: center; align-self: center; max-width: 30ch; margin-inline: auto; }
.tester__done-mark {
  width: 64px; height: 64px; margin: 0 auto 1.2rem; border-radius: 999px;
  display: grid; place-items: center; font-size: 1.7rem; color: var(--ink);
  background: var(--bronze); box-shadow: 0 12px 30px -14px var(--bronze);
}
.tester__done-title { font-size: 2rem; margin-bottom: 0.7rem; }
.tester__done-body { color: var(--ivory-dim); }

/* ---------- contatti ---------- */
.contatti { background: var(--ink); border-top: 1px solid var(--line); }
.contatti__inner { padding-block: clamp(4rem, 11vh, 8rem); }
.contatti__title { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); margin-bottom: 2.4rem; }
.contatti__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.contatto { background: var(--ink); }
.contatto a, .contatto { display: block; }
.contatto a { padding: 1.5rem 1.6rem; text-decoration: none; transition: background-color 0.3s var(--ease); }
.contatto a:hover { background: var(--ink-raise); }
.contatto__k { display: block; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--bronze); margin-bottom: 0.4rem; }
.contatto__v { display: block; font-family: var(--serif); font-size: 1.5rem; color: var(--ivory); }
.contatti__soon { margin-top: 1.4rem; font-size: 0.95rem; color: var(--ivory-mute); }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); border-top: 1px solid var(--line); }
.site-footer > .wrap { padding-block: clamp(3.5rem, 8vh, 5.5rem); }
.foot-def {
  font-family: var(--serif); font-style: italic; line-height: 1.5;
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.55rem);
  color: var(--ivory-dim); max-width: 60ch; margin: 0;
  padding-bottom: clamp(2rem, 5vh, 3rem); margin-bottom: clamp(2rem, 5vh, 3rem);
  border-bottom: 1px solid var(--line);
}
.site-footer__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.site-footer__brand { display: flex; align-items: center; gap: 1rem; }
.site-footer__brand img { width: 64px; height: auto; }
.site-footer__legal { font-size: 0.82rem; color: var(--ivory-mute); letter-spacing: 0.03em; }

/* ---------- reveal motion ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in-view { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__bg { animation: none; }
  .hero__scroll-line { animation: none; }
  .momento:hover .momento__media img { transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .momento__grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .momento--flip .momento__media { order: 0; }
  .momento--flip .momento__text { order: 0; }
  .momento__body { max-width: none; }
  .tester__grid { grid-template-columns: 1fr; }
  .tester__lede { max-width: none; }
}
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .contatti__list { grid-template-columns: 1fr; }
  .site-header__cta { display: none; }
}
