/* =========================================================================
   Unika — la casa. Pareti bianche, inchiostro nero, la salvia come stanza
   intera, sabbia e grigio caldo come tinte delle altre stanze.
   Una sola linea da 1,5px, prezzi dentro cartellini a forma di casa.
   ========================================================================= */
@font-face { font-family: "Italiana"; src: url(fonts/Italiana.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: "DMSans"; src: url(fonts/DMSans.ttf) format("truetype"); font-weight: 100 1000; font-display: swap; }

:root {
  --wall: #fbfaf8;
  --ink: #151515;
  --ink-2: #57524c;          /* testo secondario tinto dal caldo (7:1) */
  --sage: #a9bfb1;
  --sage-deep: #3f5c4d;
  --sand: #ebdfcf;
  --stone: #dfdad4;
  --line: 1.5px solid var(--ink);

  --display: "Italiana", "Didot", serif;
  --text: "DMSans", system-ui, sans-serif;

  --t-small: 0.9375rem;
  --t-body: clamp(1.0625rem, 1rem + 0.2vw, 1.1875rem);
  --t-lead: clamp(1.5rem, 1.2rem + 1.1vw, 2.25rem);
  --t-h2: clamp(2.75rem, 1.6rem + 4.2vw, 5.5rem);
  --t-hero: clamp(2.75rem, 1.4rem + 5vw, 6rem);

  --m: clamp(16px, 4vw, 64px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --house: polygon(50% 0%, 100% 28%, 100% 100%, 0% 100%, 0% 28%);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-color: var(--ink) var(--wall); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--wall); color: var(--ink); font-family: var(--text); font-size: var(--t-body); line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 4px; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }
::selection { background: var(--sage); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.h2 { font-family: var(--display); font-weight: 400; font-size: var(--t-h2); line-height: 0.98; letter-spacing: -0.01em; text-wrap: balance; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 54px; padding: 0 28px;
  border: var(--line); background: var(--ink); color: var(--wall);
  font-size: 0.875rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
  transition: background-color 0.3s, color 0.3s;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn .ic { width: 18px; height: 18px; transition: transform 0.4s var(--ease); }
.btn:hover .ic { transform: translateX(4px); }
.btn--full { width: 100%; }

/* cartellino del prezzo a forma di casa */
.tag {
  display: inline-grid; place-items: center; min-width: 76px; padding: 14px 12px 6px;
  clip-path: var(--house); background: var(--ink); color: var(--wall);
  font-size: 0.9375rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2;
}
.tag--big { min-width: 120px; padding: 22px 18px 10px; font-size: 1.25rem; }

/* --- barra ------------------------------------------------------------- */
.top { position: sticky; top: 0; z-index: 50; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px var(--m); background: rgba(251, 250, 248, 0.9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.top__left { display: flex; align-items: center; gap: 28px; }
.top__back { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px 8px 8px; border: var(--line); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; transition: background-color 0.25s, color 0.25s; }
.top__back:hover { background: var(--ink); color: var(--wall); }
.top__back .ic { width: 16px; height: 16px; }
.top__nav { display: flex; gap: 28px; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.top__nav a { text-decoration: none; padding: 8px 0; background: linear-gradient(var(--ink), var(--ink)) 0 100% / 0 1.5px no-repeat; transition: background-size 0.4s var(--ease); }
.top__nav a:hover { background-size: 100% 1.5px; }
.top__logo img { height: 28px; width: auto; }
.top__icons { display: flex; justify-content: flex-end; gap: 4px; }
.icon { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; }
.icon__n { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: var(--wall); font-size: 0.75rem; line-height: 18px; text-align: center; }
.icon.is-bump { animation: bump 0.5s var(--ease); }
@keyframes bump { 35% { transform: translateY(-4px) scale(1.15); } }

/* =========================================================================
   LA HOME: la nicchia a forma di casa, la luce segue il cursore
   ========================================================================= */
.home { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); min-height: max(620px, calc(100svh - var(--top-h, 72px))); background: #f0eeeb; isolation: isolate; }
.home__text { position: relative; z-index: 2; display: grid; align-content: center; justify-items: start; gap: 22px; padding: 48px var(--m); pointer-events: none; }
.home__text a { pointer-events: auto; }
.home__title { font-family: var(--display); font-weight: 400; font-size: var(--t-hero); line-height: 1.02; letter-spacing: -0.01em; max-width: 11ch; text-wrap: balance; }
.home__sub { max-width: 34ch; font-size: 1.1875rem; line-height: 1.55; color: var(--ink-2); }
.home__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 8px; }
.home__link { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; padding: 6px 0; background: linear-gradient(var(--ink), var(--ink)) 0 100% / 100% 1.5px no-repeat; transition: background-size 0.45s var(--ease); }
.home__link:hover { background-size: 0 1.5px; background-position: 100% 100%; }
.home__stage { position: absolute; inset: 0; z-index: 1; overflow: hidden; touch-action: pan-y; cursor: crosshair; }
.home__still, .home__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.home__still { object-fit: cover; }
.home__canvas { opacity: 0; transition: opacity 0.9s var(--ease); }
.home__stage.is-live .home__canvas { opacity: 1; }
.home__hint { position: absolute; left: 72%; bottom: 26px; translate: -50% 0; font-size: 0.8125rem; letter-spacing: 0.01em; color: var(--ink-2); white-space: nowrap; pointer-events: none; transition: opacity 0.6s; }
.home__stage.is-touched .home__hint { opacity: 0; }
.hint--touch { display: none; }
@media (hover: none) { .hint--pointer { display: none; } .hint--touch { display: inline; } }
.js .home__text > * { opacity: 0; transform: translateY(18px); animation: rise 1s var(--ease) forwards; animation-delay: calc(0.15s + var(--i, 0) * 0.1s); }
.home__text > :nth-child(2) { --i: 1; }
.home__text > :nth-child(3) { --i: 2; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* =========================================================================
   STANZE
   ========================================================================= */
.stanze { padding: clamp(80px, 10vw, 150px) var(--m); background: var(--tint, var(--wall)); transition: background-color 0.8s var(--ease); }
.stanze__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 28px; }
.seg { display: flex; border: var(--line); }
.seg button { padding: 13px 22px; border: 0; background: none; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; transition: background-color 0.3s, color 0.3s; }
.seg button + button { border-left: var(--line); }
.seg button[aria-selected="true"] { background: var(--ink); color: var(--wall); }
.stanze__body { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(28px, 4vw, 64px); margin-top: 52px; align-items: start; }
.stanze__fig { overflow: hidden; clip-path: polygon(50% 0%, 100% 14%, 100% 100%, 0% 100%, 0% 14%); }
.stanze__fig img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: opacity 0.45s, transform 1.4s var(--ease); }
.stanze__fig.is-swap img { opacity: 0; transform: scale(1.05); }
.stanze__side { display: grid; gap: 32px; }
.stanze__testo { font-family: var(--display); font-size: var(--t-lead); line-height: 1.2; }
.minis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mini { display: grid; gap: 10px; width: 100%; padding: 0; border: 0; background: none; text-align: left; animation: rise 0.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 80ms); }
.mini__img { display: block; aspect-ratio: 4 / 5; overflow: hidden; }
.mini__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.mini:hover .mini__img img { transform: scale(1.06); }
.mini__txt { display: grid; gap: 2px; font-size: var(--t-small); }
.mini__txt b { font-weight: 600; }

/* =========================================================================
   NEGOZIO
   ========================================================================= */
.shop { padding: clamp(80px, 10vw, 150px) var(--m); }
.shop__head { display: grid; gap: 28px; }
.shop__tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; }
.cats button { padding: 10px 18px; border: var(--line); background: none; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; transition: background-color 0.25s, color 0.25s; }
.cats button[aria-pressed="true"] { background: var(--ink); color: var(--wall); }
.ord { display: flex; align-items: center; gap: 10px; font-size: var(--t-small); }
.ord select { appearance: none; padding: 10px 40px 10px 12px; border: var(--line); border-radius: 0; background: var(--wall) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23151515' stroke-width='1.5'/%3E%3C/svg%3E") right 12px center / 16px no-repeat; cursor: pointer; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 56px 24px; margin-top: 48px; }
.card { display: grid; gap: 14px; animation: rise 0.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
.card__frame { position: relative; }
.card__img { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; padding: 0; border: 0; background: var(--mat, var(--stone)); overflow: hidden; cursor: pointer; }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.card__img:hover img { transform: scale(1.04); }
.card__quick { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 11px; background: var(--wall); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0; transform: translateY(8px); transition: opacity 0.3s, transform 0.4s var(--ease); }
.card__img:hover .card__quick, .card__img:focus-visible .card__quick { opacity: 1; transform: none; }
.heart { position: absolute; top: 10px; right: 10px; z-index: 1; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--wall); }
.heart .ic { width: 20px; height: 20px; transition: fill 0.2s, transform 0.4s var(--ease); }
.heart[aria-pressed="true"] .ic { fill: var(--ink); transform: scale(1.12); }
.card__row { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.card__nome { font-weight: 600; line-height: 1.3; }
.card__cat { font-size: 0.875rem; color: var(--ink-2); }
.card__add { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; border: 0; border-bottom: var(--line); background: none; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.card__add .ic { width: 14px; height: 14px; }
.card__add > span { white-space: nowrap; }
.shop__demo { margin-top: 48px; font-size: var(--t-small); color: var(--ink-2); }

/* =========================================================================
   FRAGRANZE
   ========================================================================= */
.fra { display: grid; grid-template-columns: 7fr 5fr; background: var(--sage); }
.fra__fig { overflow: hidden; }
.fra__fig img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.6s var(--ease); }
.fra.is-in .fra__fig img { transform: scale(1); }
.quiz { display: grid; align-content: center; gap: 20px; padding: clamp(56px, 7vw, 100px) var(--m); }
.quiz > p { max-width: 36ch; }
.quiz__prog { display: flex; gap: 6px; margin-bottom: 8px; }
.quiz__prog span { width: 32px; height: 1.5px; background: rgba(21, 21, 21, 0.3); }
.quiz__prog span.on { background: var(--ink); }
.quiz__q { font-family: var(--display); font-size: var(--t-lead); line-height: 1.15; }
.quiz__opts { display: grid; gap: 8px; margin-top: 16px; }
.quiz__opts button { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border: var(--line); background: transparent; text-align: left; transition: background-color 0.3s, padding 0.4s var(--ease); }
.quiz__opts button:hover { background: var(--wall); padding-left: 28px; }
.quiz__step { animation: rise 0.5s var(--ease); }
.res { display: grid; grid-template-columns: 120px 1fr; gap: 22px; align-items: center; padding: 20px; background: var(--wall); animation: rise 0.5s var(--ease); }
.res__img { display: block; height: 220px; overflow: hidden; background: var(--sage); }
.res__img img { width: 100%; height: 100%; object-fit: cover; }
.res h3 { font-family: var(--display); font-weight: 400; font-size: var(--t-lead); line-height: 1.05; }
.res__acts { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 12px; }
.link { padding: 0; border: 0; background: none; text-decoration: underline; text-underline-offset: 4px; }

/* =========================================================================
   PERSONAL SHOPPER, PIEDE, RITORNO
   ========================================================================= */
.ps { display: grid; gap: 22px; justify-items: center; padding: clamp(90px, 11vw, 160px) var(--m); text-align: center; }
.ps > p { max-width: 50ch; color: var(--ink-2); }
.ps__form { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; width: min(900px, 100%); margin-top: 12px; }
.ps__form input { min-height: 54px; padding: 0 16px; border: var(--line); background: var(--wall); border-radius: 0; }
.ps__ok { color: var(--sage-deep); font-weight: 600; }
.ps__demo { font-size: var(--t-small); color: var(--ink-2); }
.pie { display: grid; justify-items: center; gap: 14px; padding: 90px var(--m) 120px; background: var(--ink); color: var(--wall); text-align: center; }
.pie__logo { width: min(440px, 76%); filter: invert(1); }
.pie__claim { font-family: var(--display); font-size: var(--t-lead); }
.pie__small { font-size: var(--t-small); color: #cfcac4; }
.pie__small a { color: var(--wall); }
.back { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 55; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 10px 12px; background: var(--ink); color: var(--wall); font-size: 0.8125rem; font-weight: 600; text-decoration: none; transition: transform 0.35s var(--ease); }
.back:hover { transform: translateX(-3px); }
.back.is-away { transform: translateY(170%); pointer-events: none; }
.shop { padding-bottom: 96px; }
.back .ic { width: 18px; height: 18px; }

/* =========================================================================
   CASSETTI, SCHEDA, TOAST
   ========================================================================= */
.drawer { position: fixed; inset: 0; z-index: 80; background: rgba(21, 21, 21, 0.35); animation: fade 0.3s; }
@keyframes fade { from { opacity: 0; } }
.drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(430px, 100%); display: grid; grid-template-rows: auto 1fr auto; background: var(--wall); animation: slide 0.5s var(--ease); }
@keyframes slide { from { transform: translateX(100%); } }
.drawer__head { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px; }
.drawer__head h2 { font-family: var(--display); font-weight: 400; font-size: 2.25rem; }
.drawer__list { overflow: auto; padding: 0 24px; display: grid; gap: 18px; align-content: start; }
.drawer__empty { padding: 0 24px; color: var(--ink-2); }
.riga { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; align-items: center; }
.riga__img { display: block; height: 92px; overflow: hidden; background: var(--stone); }
.riga__img img { width: 100%; height: 100%; object-fit: cover; }
.qty { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.qty button { display: grid; place-items: center; width: 30px; height: 30px; border: var(--line); background: none; }
.qty .ic { width: 14px; height: 14px; }
.riga__rm { padding: 0; border: 0; background: none; font-size: 0.875rem; text-decoration: underline; text-underline-offset: 3px; }
.drawer__foot { display: grid; gap: 12px; padding: 20px 24px 28px; border-top: var(--line); }
.drawer__tot { display: flex; justify-content: space-between; font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.drawer__note { font-size: var(--t-small); color: var(--sage-deep); }
.x { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; }

.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(21, 21, 21, 0.4); animation: fade 0.3s; }
.modal__card { position: relative; width: min(880px, 100%); max-height: calc(100svh - 40px); overflow: auto; display: grid; grid-template-columns: 1fr 1fr; background: var(--wall); animation: rise 0.45s var(--ease); }
.modal__x { position: absolute; right: 8px; top: 8px; z-index: 1; }
.modal__img { min-height: 460px; overflow: hidden; background: var(--bg, var(--stone)); }
.modal__img img { width: 100%; height: 100%; object-fit: cover; }
.modal__body { display: grid; gap: 16px; align-content: center; justify-items: start; padding: 52px 40px; }
.modal__cat { margin-top: -8px; color: var(--ink-2); }
.modal__nome { font-family: var(--display); font-weight: 400; font-size: var(--t-lead); line-height: 1.05; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 95; padding: 14px 22px; background: var(--ink); color: var(--wall); font-size: var(--t-small); transform: translate(-50%, 160%); opacity: 0; transition: transform 0.5s var(--ease), opacity 0.3s; pointer-events: none; }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* --- entrate --------------------------------------------------------------- */
.js .up { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease), transform 1s var(--ease); }
.js .up.is-in { opacity: 1; transform: none; }


/* =========================================================================
   TABLET E TELEFONO
   ========================================================================= */
@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 16px; }
  .stanze__body, .fra { grid-template-columns: 1fr; }
  .fra__fig img { aspect-ratio: 1 / 1; height: auto; }
}
@media (max-width: 700px) {
  .home { grid-template-columns: 1fr; grid-template-rows: auto minmax(380px, 58svh); min-height: 0; }
  .home__text { padding: 36px var(--m) 20px; gap: 16px; }
  .home__stage { position: relative; inset: auto; grid-row: 2; }
  .home__hint { left: 50%; }
  .top__nav { display: none; }
  .top__logo img { height: 22px; }
  .back { padding: 8px 12px 8px 10px; font-size: 0.75rem; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 12px 6px; letter-spacing: 0.04em; }
  .ps__form { grid-template-columns: 1fr; }
  .modal { align-items: end; padding: 0; }
  .modal__card { grid-template-columns: 1fr; max-height: 92svh; }
  .modal__img { min-height: 280px; }
  .modal__body { padding: 26px 22px 30px; }
  .card__row { flex-direction: column; align-items: start; gap: 8px; }
  .card__add { letter-spacing: 0.08em; }
  .card__add-x { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .js .home__text > * { opacity: 1; transform: none; animation: none; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .js .up { opacity: 1; transform: none; }
}
