/* merceria.store
   Layout: banco di merceria. Carta chiara, inchiostro prugna e ruggine del logo;
   i colori veri li portano i prodotti. Dettagli presi dal mestiere: metro da sarta
   in centimetri reali, cuciture a punto filza, cartella colori con i codici. */

@layer reset, base, components, pages, motion;

@font-face { font-family: "Fredoka"; src: url("../fonts/fredoka.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("../fonts/dm-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("../fonts/dm-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

/* Colore variante: registrato come <color> così le transizioni lo sfumano */
@property --c { syntax: "<color>"; inherits: true; initial-value: #9A3D26; }
@property --spin { syntax: "<angle>"; inherits: true; initial-value: 0deg; }

:root {
  --ink: #2E1A21;
  --ink-soft: #6A555D;
  --brand: #9A3D26;
  --brand-deep: #7B2E1B;
  --brand-tint: #F6E3DA;
  --paper: #FBF8F6;
  --paper-2: #F3ECE8;
  --surface: #FFFFFF;
  --line: #E8DCD7;
  --teal: #1F5A63;
  --tape: #F0C649;
  --night: #27141B;
  --cream: #FBF3EC;

  --display: "Fredoka", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --radius: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow: 0 1px 0 var(--line), 0 14px 34px -24px rgba(46, 26, 33, .4);
}

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
  body, h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset, address { margin: 0; padding: 0; }
  ul, ol { list-style: none; }
  fieldset { border: 0; min-width: 0; }
  address { font-style: normal; }
  img, svg { display: block; max-width: 100%; }
  img { height: auto; }
  button, input, select, textarea { font: inherit; color: inherit; }
  button { cursor: pointer; background: none; border: 0; padding: 0; }
  a { color: inherit; text-decoration: none; }
  [hidden] { display: none !important; }
}

@layer base {
  body {
    font-family: var(--body);
    font-size: 1rem;
    line-height: 1.55;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
  }
  h1, h2, h3, legend { font-family: var(--display); font-weight: 600; line-height: 1.05; letter-spacing: -.015em; text-wrap: balance; }
  h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
  h2 { font-size: clamp(1.55rem, 2.8vw, 2.2rem); }
  h3 { font-size: 1.15rem; }
  p { text-wrap: pretty; }
  strong { font-weight: 700; }
  :focus-visible { outline: 2.5px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
  ::selection { background: var(--brand); color: #fff; }

  .wrap { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px)); }
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .skip { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; transition: top .2s; }
  .skip:focus { top: 12px; }
  .ico { width: 1.25em; height: 1.25em; flex: none; }
  .eyebrow { font-family: var(--mono); font-size: .78rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
  .code { font-family: var(--mono); font-size: .86em; letter-spacing: .02em; }

  /* Illustrazioni: tinte derivate dal colore variante */
  .art-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
  .art {
    --c-d: color-mix(in oklab, var(--c) 76%, #1c0c12);
    --c-dd: color-mix(in oklab, var(--c) 56%, #1c0c12);
    --c-l: color-mix(in oklab, var(--c) 68%, #fff);
    aspect-ratio: 1;
    overflow: visible;
    transition: --c .45s var(--ease);
  }
  .a-f { fill: var(--c); } .a-fd { fill: var(--c-d); } .a-fdd { fill: var(--c-dd); } .a-fl { fill: var(--c-l); }
  .a-st, .a-stl, .a-sf, .a-mtl { fill: none; stroke-linecap: round; stroke-linejoin: round; }
  .a-st { stroke: var(--c-d); } .a-stl { stroke: var(--c-l); } .a-sf { stroke: var(--c); } .a-mtl { stroke: #A9AEB6; }
  .a-pp { fill: #F6EBD9; } .a-ppd { fill: #DCC7A6; }
  .a-wd { fill: #E2C39B; } .a-wdd { fill: #C49A6C; }
  .a-mt { fill: #D7DADF; } .a-mtd { fill: #9CA2AB; }
  .a-hl { fill: rgba(40, 20, 27, .62); }
  .a-cut { fill: var(--art-bg, var(--paper-2)); }
  .a-sh { fill: rgba(46, 26, 33, .13); opacity: var(--art-shadow, 1); }
  .a-pin-a { fill: #E8715A; } .a-pin-b { fill: #2FA3A8; } .a-pin-c { fill: #D2A02F; } .a-pin-d { fill: #F7F5F0; }
}

@layer components {
  /* ── Pulsanti: una cucitura a punto filza corre dentro il bordo ── */
  .btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55em;
    min-height: 48px; padding: .7em 1.5em; border-radius: 999px;
    font-family: var(--display); font-weight: 500; font-size: 1.02rem; letter-spacing: .005em; white-space: nowrap;
    background: var(--brand); color: #fff;
    box-shadow: 0 8px 20px -10px var(--brand-deep);
    transition: transform .25s var(--ease), box-shadow .25s, background .2s;
  }
  .btn::after { content: ""; position: absolute; inset: 4px; border-radius: inherit; border: 1.5px dashed rgba(255, 255, 255, .5); pointer-events: none; }
  .btn:hover { background: var(--brand-deep); transform: translateY(-2px); box-shadow: 0 14px 24px -12px var(--brand-deep); }
  .btn:active { transform: translateY(0) scale(.98); }
  .btn .ico { transition: transform .25s var(--ease); }
  .btn:hover .ico:last-child { transform: translateX(3px); }
  .btn--lg { min-height: 56px; padding-inline: 1.8em; font-size: 1.1rem; }
  .btn--block { display: flex; width: 100%; }
  .btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
  .btn--ghost::after { border-color: transparent; }
  .btn--ghost:hover { background: var(--ink); color: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }
  .btn--light { background: var(--cream); color: var(--ink); box-shadow: none; }
  .btn--light::after { border-color: rgba(46, 26, 33, .35); }
  .btn--light:hover { background: #fff; box-shadow: 0 12px 24px -14px rgba(0, 0, 0, .6); }
  .btn[disabled], .btn.is-busy { opacity: .65; pointer-events: none; }

  .icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; transition: background .2s; }
  .icon-btn:hover { background: var(--paper-2); }
  .icon-btn .ico { width: 24px; height: 24px; }

  .link-arrow { display: inline-flex; align-items: center; gap: .4em; font-weight: 600; color: var(--brand); white-space: nowrap; }
  .link-arrow .ico { transition: transform .25s var(--ease); }
  .link-arrow:hover .ico { transform: translateX(4px); }

  /* ── Campioni colore ── */
  .swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
  .swatch {
    position: relative; display: block; width: 30px; aspect-ratio: 1; border-radius: 50%; flex: none; cursor: pointer;
    background: var(--s);
    box-shadow: inset 0 0 0 1px rgba(46, 26, 33, .2), inset 0 -5px 8px -4px rgba(46, 26, 33, .28);
    transition: transform .25s var(--ease);
  }
  .swatch::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1.5px dashed var(--ink); opacity: 0; transform: scale(.7) rotate(-40deg); transition: opacity .2s, transform .35s var(--ease); }
  .swatch:hover { transform: scale(1.12); }
  .swatch.is-active::after, .swatch:has(input:checked)::after { opacity: 1; transform: none; }
  .swatch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
  .swatch:has(input:focus-visible) { outline: 2.5px solid var(--teal); outline-offset: 7px; }
  .swatches--mini { gap: 9px; min-height: 26px; }
  .swatches--mini .swatch { width: 18px; }
  .swatches--mini .swatch::after { inset: -4px; }
  .swatches--lg { gap: 14px; padding: 6px; }
  .swatches--lg .swatch { width: 38px; }
  .swatches__more { font-family: var(--mono); font-size: .76rem; color: var(--ink-soft); padding: 2px 4px; }
  .swatches__more:hover { color: var(--brand); }

  /* ── Misure / taglie ── */
  .pills { display: flex; flex-wrap: wrap; gap: 10px; }
  .pill { position: relative; cursor: pointer; }
  .pill input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
  .pill span { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 64px; min-height: 48px; padding: .4em 1em; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 600; line-height: 1.2; transition: background .2s, color .2s, box-shadow .2s, transform .25s var(--ease); }
  .pill small { font-family: var(--mono); font-weight: 400; font-size: .74rem; color: var(--ink-soft); transition: color .2s; }
  .pill:hover span { box-shadow: inset 0 0 0 1.5px var(--ink); transform: translateY(-2px); }
  .pill:has(input:checked) span { background: var(--ink); color: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }
  .pill:has(input:checked) small { color: rgba(255, 255, 255, .72); }
  .pill:has(input:focus-visible) span { outline: 2.5px solid var(--teal); outline-offset: 3px; }

  /* ── Quantità ── */
  .qty { display: inline-flex; align-items: center; height: 56px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
  .qty button { display: grid; place-items: center; width: 48px; height: 100%; border-radius: 50%; color: var(--ink); transition: background .2s, color .2s; }
  .qty button:hover { background: var(--brand-tint); color: var(--brand); }
  .qty button .ico { width: 16px; height: 16px; }
  .qty input { width: 2.6em; text-align: center; border: 0; background: transparent; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; padding: 0; }
  .qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  .qty--sm { height: 38px; }
  .qty--sm button { width: 36px; }
  .qty--sm button .ico { width: 13px; height: 13px; }
  .qty--sm input { width: 2.1em; font-size: .95rem; }

  .tag { position: absolute; left: 14px; top: 14px; padding: .32em .8em; border-radius: 999px; font-family: var(--mono); font-size: .68rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px -4px rgba(46, 26, 33, .4); transform: translateZ(30px); }
  .tag--new { background: var(--teal); color: #fff; }

  .price { font-family: var(--display); font-weight: 600; font-size: 1.22rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .price small { font-family: var(--body); font-weight: 500; font-size: .76rem; color: var(--ink-soft); }

  .chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip { position: relative; cursor: pointer; }
  .chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
  .chip span { display: block; padding: .5em 1em; border-radius: 999px; font-size: .92rem; font-weight: 600; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); transition: background .2s, color .2s, box-shadow .2s; }
  .chip:hover span { box-shadow: inset 0 0 0 1.5px var(--ink); }
  .chip:has(input:checked) span { background: var(--ink); color: #fff; box-shadow: none; }
  .chip:has(input:focus-visible) span { outline: 2.5px solid var(--teal); outline-offset: 3px; }

  .select select { appearance: none; min-height: 44px; padding: 0 2.6em 0 1.1em; border-radius: 999px; border: 0; font-weight: 600; cursor: pointer; background: var(--surface) 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='%232E1A21' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right .9em center / 1.1em no-repeat; box-shadow: inset 0 0 0 1.5px var(--line); }
  .select select:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }

  /* ── Testata ── */
  .topbar { background: var(--night); color: var(--cream); font-size: .84rem; }
  .topbar__in { display: flex; justify-content: space-between; gap: 16px; padding-block: 8px; }
  .topbar span { display: inline-flex; align-items: center; gap: .5em; white-space: nowrap; }
  .topbar .ico { opacity: .75; }

  .header { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5); border-bottom: 1px solid var(--line); view-transition-name: header; }
  .header__in { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: clamp(12px, 3vw, 40px); padding-block: 14px; }
  .header__logo img { width: auto; height: 42px; }
  .header__burger { display: none; }

  .search { position: relative; display: flex; align-items: center; max-width: 520px; width: 100%; justify-self: center; }
  .search > .ico { position: absolute; left: 16px; color: var(--ink-soft); pointer-events: none; }
  .search input { width: 100%; height: 46px; padding: 0 1.2em 0 2.9em; border-radius: 999px; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow .2s; }
  .search input::placeholder { color: color-mix(in srgb, var(--ink-soft) 80%, transparent); }
  .search input:focus { outline: 0; box-shadow: inset 0 0 0 2px var(--ink); }
  .search--page { max-width: 620px; margin-top: 20px; gap: 10px; justify-self: start; }
  .search--page input { height: 52px; }

  .cart-btn { position: relative; display: inline-flex; align-items: center; gap: .5em; height: 46px; padding: 0 1.1em 0 .9em; border-radius: 999px; background: var(--ink); color: #fff; font-family: var(--display); font-weight: 500; transition: background .2s, transform .25s var(--ease); }
  .cart-btn:hover { background: var(--brand); transform: translateY(-1px); }
  .cart-btn .ico { width: 22px; height: 22px; }
  .cart-btn__count { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--tape); color: var(--ink); font-family: var(--mono); font-size: .78rem; font-weight: 500; }
  .cart-btn__count.is-empty { background: rgba(255, 255, 255, .16); color: #fff; }
  .cart-btn.is-bump { animation: bump .5s var(--ease); }

  .nav { border-top: 1px solid var(--line); }
  .nav__in { display: flex; gap: clamp(14px, 2.2vw, 30px); overflow-x: auto; scrollbar-width: none; padding-block: 0; }
  .nav__in::-webkit-scrollbar { display: none; }
  .nav__link { position: relative; display: inline-flex; align-items: center; gap: .5em; padding: 12px 0; font-weight: 600; font-size: .95rem; white-space: nowrap; color: var(--ink); }
  .nav__link::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(46, 26, 33, .15); transition: transform .3s var(--ease); }
  .nav__link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 0; border-bottom: 2.5px dashed var(--c); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
  .nav__link:hover::before { transform: scale(1.5); }
  .nav__link:hover::after, .nav__link.is-current::after { transform: none; }

  /* ── Schede prodotto ── */
  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 236px), 1fr)); gap: clamp(14px, 2vw, 26px); }

  .card { position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); transform-style: preserve-3d; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .6s var(--ease), box-shadow .35s; }
  .card.is-tilting { transition: transform .08s linear, box-shadow .35s; }
  .card:hover { box-shadow: 0 1px 0 var(--line), 0 34px 44px -30px color-mix(in srgb, var(--c) 60%, var(--ink)); z-index: 2; }
  .card__media { position: relative; display: grid; place-items: center; aspect-ratio: 1 / .9; border-radius: var(--radius) var(--radius) 0 0; transform-style: preserve-3d; background: radial-gradient(circle at 50% 56%, color-mix(in oklab, var(--c) 30%, var(--paper-2)) 0 34%, transparent 64%), var(--paper-2); }
  .card__media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .7), transparent 46%); opacity: 0; transition: opacity .3s; }
  .card:hover .card__media::after { opacity: 1; }
  .card__art { width: 68%; transform: translateZ(40px); transition: transform .6s var(--ease), --c .45s var(--ease); filter: drop-shadow(0 12px 10px rgba(46, 26, 33, .12)); }
  .card:hover .card__art { transform: translateZ(74px) rotate(-5deg) scale(1.05); }
  .card__body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 16px 18px 18px; transform: translateZ(18px); }
  .card__brand { font-family: var(--mono); font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-soft); }
  .card__name { font-size: 1.08rem; font-weight: 500; line-height: 1.2; }
  .card__name a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
  .card__sizes { font-size: .86rem; color: var(--ink-soft); min-height: 26px; display: flex; align-items: center; }
  .card .swatches, .card__foot form { position: relative; z-index: 1; }
  .card__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; }
  .btn-add { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: #fff; transition: background .2s, transform .35s var(--ease); }
  .btn-add::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 1.5px dashed rgba(255, 255, 255, .45); }
  .btn-add { position: relative; }
  .btn-add:hover { background: var(--brand); transform: rotate(90deg) scale(1.08); }
  .btn-add.is-busy { animation: pulse .6s ease-in-out infinite; }

  /* ── Carrello laterale ── */
  .drawer { position: fixed; inset: 0; z-index: 100; visibility: hidden; perspective: 1800px; transition: visibility 0s .5s; }
  .drawer.is-open { visibility: visible; transition-delay: 0s; }
  .drawer__backdrop { position: absolute; inset: 0; background: rgba(39, 20, 27, .5); opacity: 0; transition: opacity .4s; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
  .drawer.is-open .drawer__backdrop { opacity: 1; }
  .drawer__panel { position: absolute; inset: 0 0 0 auto; width: min(460px, 100%); display: flex; flex-direction: column; background: var(--paper); box-shadow: -30px 0 60px -30px rgba(39, 20, 27, .6); transform-origin: right center; transform: translateX(105%) rotateY(-32deg); transition: transform .55s var(--ease); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .drawer.is-open .drawer__panel { transform: none; }
  .drawer__panel:focus { outline: 0; }
  .drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 14px 24px; border-bottom: 1.5px dashed var(--line); }
  .drawer__head h2 { font-size: 1.4rem; }
  .drawer__body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .drawer__body > .freeship { margin: 18px 24px 4px; }
  .drawer__lines { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 24px 12px; overscroll-behavior: contain; }
  .drawer__foot { display: grid; gap: 10px; padding: 16px 24px 22px; background: var(--surface); border-top: 1px solid var(--line); }
  .drawer__note { font-size: .84rem; color: var(--ink-soft); }

  .freeship { display: grid; gap: 8px; font-size: .92rem; }
  .freeship p { display: flex; align-items: center; gap: .4em; flex-wrap: wrap; }
  .freeship.is-done p { color: var(--teal); }
  .freeship__track { height: 16px; border-radius: 4px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
  .freeship__tape { height: 100%; min-width: 6px; border-radius: 3px 0 0 3px; background-color: var(--tape); background-image: repeating-linear-gradient(90deg, var(--ink) 0 1.2px, transparent 1.2px 1cm), repeating-linear-gradient(90deg, rgba(46, 26, 33, .65) 0 1px, transparent 1px 1mm); background-size: 100% 100%, 100% 45%; background-repeat: no-repeat; border-right: 3px solid var(--ink); transition: width .8s var(--ease); }

  .lines { display: grid; }
  .line { position: relative; display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; gap: 14px; padding-block: 16px; border-bottom: 1.5px dashed var(--line); animation: line-in .45s var(--ease) both; }
  .line:last-child { border-bottom: 0; }
  .line__art { display: grid; place-items: center; width: 78px; height: 78px; border-radius: 16px; background: radial-gradient(circle, color-mix(in oklab, var(--c) 30%, var(--paper-2)) 0 40%, var(--paper-2) 72%); }
  .line__art .art { width: 78%; }
  .line__info { display: grid; gap: 2px; align-content: start; min-width: 0; }
  .line__brand { font-family: var(--mono); font-size: .66rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-soft); }
  .line__name { font-family: var(--display); font-weight: 500; font-size: 1.04rem; line-height: 1.2; }
  .line__name:hover { color: var(--brand); }
  .line__variant { display: flex; align-items: center; flex-wrap: wrap; gap: .35em; font-size: .86rem; color: var(--ink-soft); }
  .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(46, 26, 33, .2); }
  .line__row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
  .line__unit { font-size: .82rem; color: var(--ink-soft); }
  .line__total { margin-left: auto; font-family: var(--display); font-weight: 600; font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .line__remove { align-self: start; display: grid; place-items: center; width: 32px; height: 32px; margin: -4px -6px 0 0; border-radius: 50%; color: var(--ink-soft); transition: background .2s, color .2s, transform .3s var(--ease); }
  .line__remove:hover { background: var(--brand-tint); color: var(--brand); transform: rotate(90deg); }
  .line__remove .ico { width: 16px; height: 16px; }

  .totals { display: grid; gap: 8px; }
  .totals__row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-variant-numeric: tabular-nums; }
  .totals__row small { font-size: .78rem; font-weight: 400; color: var(--ink-soft); margin-left: .3em; }
  .totals__row--big { font-family: var(--display); font-size: 1.2rem; font-weight: 500; }
  .totals__row--big strong { font-size: 1.5rem; font-weight: 600; }
  .totals .totals__row--big { margin-top: 6px; padding-top: 14px; border-top: 1.5px dashed var(--line); }

  .empty { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 48px 28px; margin: auto; max-width: 420px; }
  .empty__art { width: 132px; animation: bob 6s ease-in-out infinite; }
  .empty p { color: var(--ink-soft); }
  .empty .btn { margin-top: 8px; }
  .empty--page { padding-block: clamp(40px, 8vw, 96px); max-width: 520px; }
  .empty .chips { justify-content: center; margin-top: 8px; }

  .toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 120; display: flex; align-items: center; gap: .6em; max-width: min(92vw, 460px); padding: .8em 1.3em; border-radius: 999px; background: var(--night); color: var(--cream); font-weight: 600; font-size: .95rem; box-shadow: 0 20px 40px -18px rgba(39, 20, 27, .8); opacity: 0; transform: translate(-50%, 24px) scale(.96); pointer-events: none; transition: opacity .3s, transform .45s var(--ease); }
  .toast.is-on { opacity: 1; transform: translate(-50%, 0); }
  .toast.is-error { background: var(--brand-deep); }

  .flyer { position: fixed; z-index: 150; pointer-events: none; left: 0; top: 0; }
  .flyer--photo { object-fit: cover; border-radius: 18px; }

  /* ── Piede ── */
  .footer { position: relative; margin-top: clamp(40px, 7vw, 96px); background: var(--night); color: color-mix(in srgb, var(--cream) 78%, transparent); font-size: .95rem; }
  .footer__stitch { position: absolute; inset: 14px 0 auto; border-top: 2px dashed color-mix(in srgb, var(--cream) 28%, transparent); }
  .footer__grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px); padding-block: clamp(56px, 7vw, 88px) 40px; }
  .footer__brand { display: grid; gap: 18px; align-content: start; max-width: 36ch; }
  .footer__brand img { width: min(250px, 100%); }
  .footer__col { display: grid; gap: 12px; align-content: start; }
  .footer__col h2 { font-family: var(--mono); font-size: .76rem; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; color: var(--tape); }
  .footer__col ul { display: grid; gap: 7px; }
  .footer a { transition: color .2s; }
  .footer a:hover { color: #fff; text-decoration: underline dashed; text-underline-offset: 4px; }
  .footer address { color: var(--cream); }
  .footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 20px calc(24px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid color-mix(in srgb, var(--cream) 14%, transparent); font-size: .86rem; }
  .footer__credit strong { color: var(--cream); font-family: var(--display); font-weight: 500; letter-spacing: .01em; }
}

@layer pages {
  .section { padding-block: clamp(44px, 6.5vw, 88px); }
  .section--tight { padding-block: clamp(24px, 3.5vw, 44px) clamp(44px, 6.5vw, 88px); }
  .section--tint { background: linear-gradient(var(--paper-2), var(--paper)); }
  .section--flush { padding-block: 0; }
  .section__head { display: grid; gap: 8px; margin-bottom: clamp(22px, 3vw, 36px); max-width: 60ch; }
  .section__head p { color: var(--ink-soft); font-size: 1.05rem; }
  .section__head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; max-width: none; }
  .section__head--row > div { display: grid; gap: 8px; }

  /* ── Hero ── */
  .hero { position: relative; overflow: clip; background: radial-gradient(120% 90% at 85% 10%, var(--brand-tint), transparent 60%), var(--paper); }
  .hero__in { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); align-items: center; gap: clamp(16px, 4vw, 56px); padding-block: clamp(36px, 6vw, 84px) clamp(40px, 6vw, 80px); }
  .hero__copy { display: grid; gap: 22px; justify-items: start; }
  .hero h1 { font-size: clamp(2.7rem, 6.4vw, 5.1rem); line-height: .95; letter-spacing: -.025em; }
  .hero h1 em { font-style: normal; color: var(--c); position: relative; white-space: nowrap; transition: --c .5s var(--ease); }
  .hero h1 em::after { content: ""; position: absolute; left: .04em; right: .2em; bottom: .02em; border-bottom: .055em dashed currentColor; opacity: .5; }
  .hero__lead { max-width: 46ch; font-size: clamp(1.05rem, 1.5vw, 1.22rem); color: var(--ink-soft); }
  .hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
  .hero__cta .btn:first-child { background: var(--c); transition: transform .25s var(--ease), box-shadow .25s, --c .5s var(--ease), filter .2s; box-shadow: 0 10px 24px -12px var(--c); }
  .hero__cta .btn:first-child:hover { filter: brightness(.88); }
  .hero__picker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 6px; padding-top: 20px; border-top: 1.5px dashed var(--line); width: 100%; max-width: 520px; }
  .hero__picker p { font-size: .9rem; font-weight: 600; flex-basis: 100%; }
  .hero__colorname { font-family: var(--mono); font-size: .82rem; color: var(--ink-soft); }

  .hero__scene { position: relative; aspect-ratio: 1 / .92; perspective: 1300px; }
  .hero__disc { position: absolute; left: 50%; top: 50%; width: 84%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle at 34% 28%, color-mix(in oklab, var(--c) 22%, #fff), color-mix(in oklab, var(--c) 34%, var(--paper-2)) 70%); transition: --c .5s var(--ease); }
  .hero__disc::after { content: ""; position: absolute; inset: 16px; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--c) 45%, transparent); animation: turn 80s linear infinite; }
  .hero__thread { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
  .hero__thread path { fill: none; stroke: var(--c); stroke-width: 1; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; transition: --c .5s var(--ease); }
  .hero__stage { position: absolute; left: 50%; top: 50%; translate: -50% -50%; scale: var(--spool-scale, 1.3); transform-style: preserve-3d; transform: rotateX(calc(-20deg + var(--py, 0) * -12deg)) rotateY(calc(var(--px, 0) * 26deg)) rotateZ(10deg); transition: transform .5s var(--ease); }

  .hero__float { position: absolute; width: var(--w); transform: translate3d(calc(var(--px, 0) * var(--d) * 1px), calc(var(--py, 0) * var(--d) * 1px), 0) rotate(var(--rot)); transition: transform .6s var(--ease); filter: drop-shadow(0 16px 14px rgba(46, 26, 33, .16)); animation: bob var(--t, 7s) ease-in-out infinite; }
  .hero__float--a { --w: 23%; --d: -30; --rot: -14deg; --t: 6s; left: 2%; top: 6%; }
  .hero__float--b { --w: 27%; --d: 44; --rot: 10deg; --t: 8s; right: -3%; bottom: 3%; }
  .hero__float--c { --w: 13%; --d: 60; --rot: 22deg; --t: 5s; right: 8%; top: 4%; }
  .hero__float--d { --w: 19%; --d: -52; --rot: -30deg; --t: 9s; left: 4%; bottom: 6%; }

  /* Rocchetto 3D */
  .spool {
    --r: 92px; --n: 24; --w: calc(2 * var(--r) * tan(180deg / var(--n)));
    --c-d: color-mix(in oklab, var(--c) 70%, #1c0c12);
    --c-l: color-mix(in oklab, var(--c) 84%, #fff);
    position: relative; width: calc(var(--r) * 2); height: 196px; transform-style: preserve-3d;
    animation: bob 7s ease-in-out infinite;
  }
  .spool__body { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(var(--spin)); animation: spin 22s linear infinite; }
  .spool__face {
    --a: calc(var(--i) * 360deg / var(--n));
    position: absolute; top: 0; left: calc(50% - var(--w) / 2 - .5px); width: calc(var(--w) + 1px); height: 100%;
    transform: rotateY(var(--a)) translateZ(var(--r)); backface-visibility: hidden;
    background: repeating-linear-gradient(177.6deg, var(--c-d) 0 2px, var(--c) 2px 6px, var(--c-l) 6px 8px);
    background-position-y: calc(var(--i) * 1px);
    transition: --c .5s var(--ease);
  }
  .spool__face::before, .spool__face::after { content: ""; position: absolute; inset: 0; }
  .spool__face::after { background: #1c0c12; opacity: calc((1 - cos(var(--a) + var(--spin) + 36deg)) * .33); }
  .spool__face::before { background: #fff; opacity: calc(max(0, cos(var(--a) + var(--spin) + 36deg) - .86) * 1.3); }
  .spool__flange { position: absolute; left: 50%; width: 0; height: 0; transform-style: preserve-3d; }
  .spool__flange--top { top: 0; }
  .spool__flange--bottom { top: 100%; }
  .spool__flange i { --d: calc(var(--r) * 2.6); position: absolute; left: calc(var(--d) / -2); top: calc(var(--d) / -2); width: var(--d); height: var(--d); border-radius: 50%; transform: rotateX(90deg) translateZ(calc((var(--k) - 4.5) * 2.4px)); background: #B98D5F; }
  .spool__flange i:first-child { background: #A57A4E; }
  .spool__flange i:last-child { background: repeating-radial-gradient(circle, transparent 0 7px, rgba(120, 78, 40, .1) 7px 8px), radial-gradient(circle, #5A3D2B 0 8%, #C9A074 8.6% 11%, #EBCFA6 11.6% 62%, #DDBB8E 100%); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }

  /* Metro da sarta: 1 tacca = 1 mm, numeri ogni centimetro vero */
  .tape { position: relative; height: 40px; overflow: hidden; background-color: var(--tape); border-block: 1px solid color-mix(in srgb, var(--ink) 30%, var(--tape));
    background-image: repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 1cm), repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px .5cm), repeating-linear-gradient(90deg, color-mix(in srgb, var(--ink) 70%, transparent) 0 1px, transparent 1px 1mm);
    background-size: 100% 19px, 100% 13px, 100% 8px; background-repeat: no-repeat; }
  .tape__in { position: absolute; left: 0; bottom: 3px; display: flex; font-family: var(--mono); font-size: 11px; font-weight: 500; line-height: 1; color: var(--ink); }
  .tape__in span { flex: 0 0 1cm; text-align: center; translate: .5cm 0; }

  /* ── Reparti ── */
  .cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); perspective: 1400px; }
  .cat { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 18px; align-content: center; align-items: center; min-height: 128px; padding: 16px 20px 16px 16px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); transform-style: preserve-3d; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .6s var(--ease), box-shadow .35s, background .35s; }
  .cat.is-tilting { transition: transform .08s linear, box-shadow .35s, background .35s; }
  .cat:hover { background: color-mix(in oklab, var(--c) 12%, var(--surface)); box-shadow: 0 1px 0 var(--line), 0 28px 36px -28px color-mix(in srgb, var(--c) 70%, var(--ink)); }
  .cat__art { grid-row: 1 / 3; width: 96px; padding: 8px; border-radius: 18px; background: color-mix(in oklab, var(--c) 16%, var(--paper-2)); transform: translateZ(34px); transition: transform .6s var(--ease); }
  .cat:hover .cat__art { transform: translateZ(60px) rotate(-6deg) scale(1.06); }
  .cat__name { align-self: end; font-family: var(--display); font-weight: 500; font-size: 1.18rem; line-height: 1.15; transform: translateZ(20px); }
  .cat__count { align-self: start; font-family: var(--mono); font-size: .76rem; color: var(--ink-soft); margin-top: 4px; }

  /* ── Cartella colori ── */
  .shade { background: var(--night); color: var(--cream); background-image: radial-gradient(80% 120% at 0% 0%, rgba(154, 61, 38, .35), transparent 60%); }
  .shade__in { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: center; padding-block: clamp(48px, 7vw, 96px); }
  .shade__copy { display: grid; gap: 18px; justify-items: start; }
  .shade__copy .eyebrow { color: var(--tape); }
  .shade__copy p:not(.eyebrow) { color: color-mix(in srgb, var(--cream) 76%, transparent); max-width: 44ch; font-size: 1.05rem; }
  .shade__wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; perspective: 900px; }
  .reel { --c-d: color-mix(in oklab, var(--c) 72%, #1c0c12); display: grid; justify-items: center; gap: 3px; padding: 14px 4px 10px; border-radius: 14px; background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); text-align: center; transform-style: preserve-3d; transition: transform .45s var(--ease), background .3s; }
  .reel:hover, .reel:focus-visible { transform: translateY(-8px) rotateX(14deg); background: rgba(255, 255, 255, .12); }
  .reel__spool { position: relative; width: 42px; height: 54px; margin-bottom: 6px; transition: transform .45s var(--ease); }
  .reel:hover .reel__spool { transform: translateZ(26px) rotate(-8deg); }
  .reel__spool::before, .reel__spool::after { content: ""; position: absolute; left: 0; right: 0; height: 9px; border-radius: 5px; background: linear-gradient(#EBCFA6, #C49A6C); z-index: 1; }
  .reel__spool::before { top: 0; } .reel__spool::after { bottom: 0; }
  .reel__spool i { position: absolute; inset: 7px 6px; background: linear-gradient(90deg, rgba(255, 255, 255, .28), transparent 34%, rgba(0, 0, 0, .28)), repeating-linear-gradient(176deg, var(--c-d) 0 1.5px, var(--c) 1.5px 5px); }
  .reel__code { font-family: var(--mono); font-size: .74rem; font-weight: 500; color: var(--cream); }
  .reel__name { font-size: .68rem; line-height: 1.15; color: color-mix(in srgb, var(--cream) 62%, transparent); }

  /* ── Banner kit ── */
  .promo { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: center; gap: 24px; padding: clamp(28px, 5vw, 64px); border-radius: clamp(24px, 3vw, 40px); background: var(--teal); color: var(--cream); overflow: hidden; isolation: isolate; }
  .promo::before { content: ""; position: absolute; inset: 12px; border-radius: inherit; border: 2px dashed rgba(251, 243, 236, .32); pointer-events: none; z-index: -1; }
  .promo__copy { display: grid; gap: 14px; justify-items: start; }
  .promo__copy .eyebrow { color: var(--tape); }
  .promo__copy p:not(.eyebrow) { max-width: 46ch; color: color-mix(in srgb, var(--cream) 82%, transparent); }
  .promo h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
  .promo__art { position: relative; aspect-ratio: 1.3 / 1; }
  .promo__art .art { position: absolute; filter: drop-shadow(0 18px 16px rgba(0, 0, 0, .28)); transition: transform .7s var(--ease); }
  .promo__art .art:nth-child(1) { width: 58%; left: 20%; top: 2%; z-index: 2; }
  .promo__art .art:nth-child(2) { width: 40%; right: 0; bottom: 0; z-index: 3; }
  .promo__art .art:nth-child(3) { width: 44%; left: 0; bottom: 2%; z-index: 1; }
  .promo:hover .art:nth-child(1) { transform: translateY(-10px) rotate(-5deg); }
  .promo:hover .art:nth-child(2) { transform: translate(8px, 6px) rotate(18deg); }
  .promo:hover .art:nth-child(3) { transform: translate(-8px, 4px) rotate(-10deg); }

  .services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
  .service { display: grid; gap: 8px; align-content: start; padding-top: 22px; border-top: 2px dashed var(--line); }
  .service .ico { width: 32px; height: 32px; color: var(--brand); }
  .service p { color: var(--ink-soft); }

  /* ── Intestazioni di pagina ── */
  .pagehead { background: color-mix(in oklab, var(--c) 13%, var(--paper)); border-bottom: 1.5px dashed color-mix(in oklab, var(--c) 34%, var(--line)); overflow: clip; }
  .pagehead--plain { background: var(--paper-2); border-bottom-color: var(--line); }
  .pagehead__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: clamp(22px, 3.4vw, 44px); }
  .pagehead__in > div { display: grid; gap: 10px; min-width: 0; flex: 1; }
  .pagehead p { color: var(--ink-soft); max-width: 60ch; font-size: 1.05rem; }
  .pagehead__art { width: clamp(96px, 14vw, 168px); flex: none; rotate: -8deg; margin-block: -10px; filter: drop-shadow(0 14px 12px rgba(46, 26, 33, .14)); animation: bob 7s ease-in-out infinite; }
  .crumbs { display: flex; flex-wrap: wrap; gap: .5em; font-size: .86rem; color: var(--ink-soft); }
  .crumbs a:hover { color: var(--brand); text-decoration: underline dashed; text-underline-offset: 3px; }
  .crumbs [aria-current] { color: var(--ink); font-weight: 600; }

  .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: clamp(18px, 2.4vw, 30px); }
  .toolbar__count { font-family: var(--mono); font-size: .84rem; color: var(--ink-soft); }
  .toolbar .select { margin-left: auto; }

  /* ── Scheda prodotto ── */
  .pdp { padding-block: clamp(18px, 2.6vw, 30px) clamp(44px, 6vw, 88px); }
  .pdp__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(24px, 5vw, 72px); align-items: start; margin-top: 18px; }
  .pdp__visual { position: sticky; top: 132px; }

  .stage { position: relative; display: grid; place-items: center; aspect-ratio: 1 / .96; border-radius: clamp(24px, 3vw, 40px); perspective: 1100px; overflow: hidden; cursor: grab; touch-action: pan-y; user-select: none; --art-bg: color-mix(in oklab, var(--c) 24%, var(--paper-2));
    background: radial-gradient(circle at 50% 44%, color-mix(in oklab, var(--c) 34%, var(--paper-2)) 0, var(--paper-2) 70%); transition: --c .5s var(--ease); }
  .stage::before { content: ""; position: absolute; inset: 14px; border-radius: inherit; border: 2px dashed color-mix(in srgb, var(--c) 38%, transparent); pointer-events: none; transition: --c .5s var(--ease); }
  .stage.is-dragging { cursor: grabbing; }
  .stage__floor { position: absolute; left: 50%; bottom: 15%; width: 44%; height: 7%; translate: -50% 0; border-radius: 50%; background: radial-gradient(closest-side, rgba(46, 26, 33, .3), transparent); filter: blur(6px); }
  .stage__scene { width: 60%; aspect-ratio: 1; transform-style: preserve-3d; animation: sway 9s ease-in-out infinite; }
  .stage.is-dragging .stage__scene, .stage.is-touched .stage__scene { animation-play-state: paused; }
  .stage__obj { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .7s var(--ease); }
  .stage.is-dragging .stage__obj { transition: none; }
  .stage__layer { --art-shadow: 0; position: absolute; inset: 0; width: 100%; height: 100%; transform: translateZ(calc((var(--k) - 4) * 3.4px)); filter: brightness(.6) saturate(1.15); pointer-events: none; }
  .stage__layer:last-child { filter: none; }
  .stage__hint { position: absolute; right: 26px; top: 26px; display: inline-flex; align-items: center; gap: .4em; font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: color-mix(in srgb, var(--ink) 62%, transparent); pointer-events: none; }
  .stage__label { position: absolute; left: 26px; bottom: 26px; display: grid; gap: 1px; padding: 9px 14px 10px; border-radius: 10px; background: var(--surface); box-shadow: 0 10px 24px -14px rgba(46, 26, 33, .5); font-family: var(--display); font-weight: 500; line-height: 1.2; pointer-events: none; rotate: -3deg; }
  .stage__label::before { content: ""; position: absolute; inset: 3px; border-radius: 7px; border: 1.2px dashed var(--line); }
  .stage__label .code { color: var(--ink-soft); font-size: .72rem; }

  .pdp__info { display: grid; gap: 16px; align-content: start; }
  .pdp__brand { font-family: var(--mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
  .pdp__info h1 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
  .pdp__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5em; font-family: var(--display); font-weight: 600; font-size: 2rem; font-variant-numeric: tabular-nums; }
  .pdp__price small { font-family: var(--body); font-size: .9rem; font-weight: 500; color: var(--ink-soft); }
  .pdp__vat { font-size: .8rem !important; }
  .pdp__desc { font-size: 1.08rem; color: var(--ink-soft); max-width: 54ch; }
  .pdp__form { display: grid; gap: 22px; padding-block: 22px; border-block: 1.5px dashed var(--line); }
  .opt { display: grid; gap: 10px; }
  .opt legend, .opt__label { font-family: var(--body); font-weight: 700; font-size: .95rem; letter-spacing: 0; padding: 0; margin-bottom: 10px; }
  .opt__value { font-weight: 500; color: var(--ink-soft); margin-left: .5em; }
  .opt--static { display: block; }
  .opt--static .opt__label { margin: 0; }
  .pdp__buy { display: flex; flex-wrap: wrap; gap: 12px; }
  .pdp__add { flex: 1 1 260px; }
  .pdp__add-total { margin-left: .3em; padding-left: .8em; border-left: 1.5px dashed rgba(255, 255, 255, .5); font-variant-numeric: tabular-nums; }
  .pdp__meter { font-size: .9rem; color: var(--ink-soft); margin-top: -8px; }
  .pdp__perks { display: grid; gap: 8px; font-size: .95rem; }
  .pdp__perks li { display: flex; align-items: center; gap: .7em; }
  .pdp__perks .ico { color: var(--teal); width: 22px; height: 22px; }
  .spec { border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); padding: 4px 20px; }
  .spec summary { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; font-family: var(--display); font-weight: 500; font-size: 1.1rem; cursor: pointer; list-style: none; }
  .spec summary::-webkit-details-marker { display: none; }
  .spec summary::after { content: "+"; font-size: 1.5rem; line-height: 1; transition: transform .3s var(--ease); }
  .spec[open] summary::after { transform: rotate(45deg); }
  .spec dl { display: grid; padding-bottom: 12px; }
  .spec dl div { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 16px; padding: 10px 0; border-top: 1.5px dashed var(--line); font-size: .95rem; }
  .spec dt { color: var(--ink-soft); }
  .spec dd { font-weight: 600; }

  /* ── Carrello, checkout, ordine ── */
  .cartpage, .checkout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
  .cartpage__lines { display: grid; gap: 8px; }
  .cartpage__lines .line { grid-template-columns: 104px minmax(0, 1fr) auto; }
  .cartpage__lines .line__art { width: 104px; height: 104px; }
  .summary { display: grid; gap: 18px; padding: 24px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); position: sticky; top: 132px; }
  .summary h2 { font-size: 1.4rem; }
  .summary__note { font-size: .86rem; color: var(--ink-soft); }

  .checkout__main { display: grid; gap: 20px; }
  .panel { display: grid; gap: 18px; padding: 24px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
  .panel legend, .panel h2 { float: left; width: 100%; font-size: 1.3rem; padding: 0; margin-bottom: 0; }
  .panel legend + * { clear: both; }
  .panel legend small { font-family: var(--body); font-size: .8rem; font-weight: 500; color: var(--ink-soft); letter-spacing: 0; margin-left: .4em; }
  .panel p { color: var(--ink-soft); }
  .fields { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
  .field { grid-column: 1 / -1; display: grid; gap: 6px; }
  .field--half { grid-column: span 3; }
  .field--third { grid-column: span 2; }
  .field label { font-weight: 600; font-size: .92rem; }
  .field input, .field textarea { width: 100%; min-height: 50px; padding: .7em 1em; border: 0; border-radius: 14px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow .2s, background .2s; }
  .field textarea { resize: vertical; line-height: 1.5; }
  .field input:focus, .field textarea:focus { outline: 0; background: var(--surface); box-shadow: inset 0 0 0 2px var(--ink); }
  .field.has-error input { box-shadow: inset 0 0 0 2px var(--brand); background: var(--brand-tint); }
  .field__error { font-size: .86rem; font-weight: 600; color: var(--brand); }
  .choices { display: grid; gap: 10px; }
  .choice { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; transition: box-shadow .2s, background .2s; }
  .choice:has(input:checked) { background: var(--surface); box-shadow: inset 0 0 0 2px var(--ink); }
  .choice input { appearance: none; width: 22px; height: 22px; margin: 0; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink-soft); background: var(--surface); transition: box-shadow .2s; }
  .choice input:checked { box-shadow: inset 0 0 0 6.5px var(--brand); }
  .choice__body { display: grid; gap: 1px; }
  .choice__title { font-weight: 700; }
  .choice__note { font-size: .88rem; color: var(--ink-soft); }
  .choice__price { font-family: var(--mono); font-size: .86rem; white-space: nowrap; }
  .check { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
  .check input { flex: none; appearance: none; width: 22px; height: 22px; margin: 1px 0 0; border-radius: 7px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--ink-soft); transition: background .2s, box-shadow .2s; }
  .check input:checked { background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 76% no-repeat; box-shadow: none; }
  .check.has-error input { box-shadow: inset 0 0 0 2px var(--brand); }
  .alert { margin-bottom: 20px; padding: 14px 18px; border-radius: 14px; background: var(--brand-tint); color: var(--brand-deep); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--brand) 40%, transparent); }

  .minilines { display: grid; gap: 12px; }
  .minilines li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
  .minilines__art { position: relative; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: color-mix(in oklab, var(--c) 22%, var(--paper-2)); }
  .minilines__art .art { width: 78%; }
  .minilines__art b { position: absolute; right: -6px; top: -6px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--ink); color: #fff; font-family: var(--mono); font-size: .68rem; font-weight: 500; }
  .minilines__name { font-weight: 600; line-height: 1.25; font-size: .95rem; }
  .minilines__name small { display: block; font-weight: 400; color: var(--ink-soft); font-size: .82rem; }
  .minilines__total { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

  .order { display: grid; gap: clamp(24px, 4vw, 44px); }
  .order__head { display: grid; gap: 12px; justify-items: center; text-align: center; max-width: 620px; margin-inline: auto; padding-top: clamp(8px, 3vw, 32px); }
  .order__head p:not(.eyebrow) { color: var(--ink-soft); font-size: 1.08rem; }
  .order__seal { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: var(--teal); color: #fff; position: relative; animation: pop .7s var(--ease) both; }
  .order__seal::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .6); animation: turn 24s linear infinite; }
  .order__seal .ico { width: 34px; height: 34px; }
  .order__grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr); gap: 20px; align-items: start; }
  .order__side { display: grid; gap: 20px; }
  .panel--plain h2 { float: none; }

  .prose { display: grid; gap: 16px; max-width: 820px; }
  .prose h2 { margin-top: 20px; font-size: 1.5rem; }
  .prose a { color: var(--brand); text-decoration: underline dashed; text-underline-offset: 4px; }
  .table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); font-size: .95rem; }
  .table th, .table td { padding: 14px 18px; text-align: left; vertical-align: top; border-bottom: 1.5px dashed var(--line); }
  .table th { font-family: var(--mono); font-size: .74rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
  .table tr:last-child td { border-bottom: 0; }

  .errorpage { display: grid; gap: 14px; justify-items: center; text-align: center; max-width: 560px; }
  .errorpage__art { width: 170px; animation: bob 6s ease-in-out infinite; }
  .errorpage p:not(.eyebrow) { color: var(--ink-soft); font-size: 1.08rem; }
  .errorpage__cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 10px; }

  /* ── Schermi stretti ── */
  @media (max-width: 1020px) {
    .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cats .cat:last-child { grid-column: 1 / -1; }
    .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .shade__in { grid-template-columns: minmax(0, 1fr); }
  }
  @media (max-width: 860px) {
    .topbar__mid, .topbar__end { display: none; }
    .topbar__in { justify-content: center; }
    .header__in { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "burger logo cart" "search search search"; gap: 10px 8px; padding-block: 10px 12px; }
    .header__burger { display: grid; grid-area: burger; margin-left: -10px; }
    .header__logo { grid-area: logo; justify-self: start; }
    .header__logo img { height: 32px; }
    .search { grid-area: search; max-width: none; }
    .cart-btn { grid-area: cart; padding: 0 .8em; }
    .cart-btn__label { display: none; }
    .nav { display: none; }
    .nav.is-open { display: block; animation: drop .35s var(--ease); }
    .nav__in { flex-direction: column; gap: 0; padding-block: 6px 12px; }
    .nav__link { padding: 13px 0; font-size: 1.05rem; border-bottom: 1.5px dashed var(--line); }
    .nav__link::after { display: none; }

    .hero__in { grid-template-columns: minmax(0, 1fr); }
    .hero__scene { order: -1; max-width: 440px; width: 100%; margin-inline: auto; --spool-scale: 1; }
    .pdp__grid, .cartpage, .checkout, .order__grid, .promo { grid-template-columns: minmax(0, 1fr); }
    .pdp__visual, .summary { position: static; }
    .promo__art { max-width: 380px; width: 100%; margin-inline: auto; }
    .services { grid-template-columns: minmax(0, 1fr); }
    .section__head--row { flex-direction: column; align-items: flex-start; }
    .pagehead__art { display: none; }
    .toolbar .select { margin-left: 0; }
  }
  @media (max-width: 560px) {
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .card__body { padding: 12px 12px 14px; }
    .card__name { font-size: .98rem; }
    .card .swatches--mini .swatch:nth-child(n + 5) { display: none; }
    .btn-add { width: 42px; height: 42px; }
    .price { font-size: 1.08rem; }
    .tag { left: 10px; top: 10px; font-size: .6rem; }
    .cats { grid-template-columns: minmax(0, 1fr); }
    .cat { min-height: 0; grid-template-columns: 72px minmax(0, 1fr); padding: 12px 16px 12px 12px; }
    .cat__art { width: 72px; }
    .hero__scene { --spool-scale: .86; }
    .hero__cta .btn { flex: 1 1 100%; }
    .footer__grid { grid-template-columns: minmax(0, 1fr); }
    .field--half, .field--third { grid-column: 1 / -1; }
    .choice { grid-template-columns: auto minmax(0, 1fr); }
    .choice__price { grid-column: 2; }
    .cartpage__lines .line { grid-template-columns: 78px minmax(0, 1fr) auto; }
    .cartpage__lines .line__art { width: 78px; height: 78px; }
    .panel, .summary { padding: 18px; }
    .stage__hint { right: 20px; top: 20px; }
    .stage__label { left: 20px; bottom: 20px; }
    .table th, .table td { padding: 12px; }
  }
}

@layer motion {
  @keyframes spin { to { --spin: 360deg; } }
  @keyframes turn { to { rotate: 360deg; } }
  @keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
  @keyframes sway { 0%, 100% { transform: rotateY(-22deg) rotateX(8deg); } 50% { transform: rotateY(22deg) rotateX(2deg); } }
  @keyframes bump { 30% { transform: scale(1.14) rotate(-4deg); } 60% { transform: scale(.96) rotate(2deg); } }
  @keyframes pulse { 50% { transform: scale(.9); } }
  @keyframes pop { from { transform: scale(.4) rotate(-30deg); opacity: 0; } }
  @keyframes drop { from { opacity: 0; translate: 0 -10px; } }
  @keyframes line-in { from { opacity: 0; translate: 16px 0; } }
  @keyframes draw { from { stroke-dashoffset: 1; } }
  @keyframes rise { from { opacity: 0; translate: 0 44px; } }

  @media (prefers-reduced-motion: no-preference) {
    .hero__thread path { animation: draw 2.2s .2s var(--ease) both; }

    /* Le schede salgono mentre entrano nello schermo (solo dove il browser lo supporta) */
    @supports (animation-timeline: view()) {
      .grid > .card, .cats > .cat, .services > .service, .shade__wall > li {
        animation: rise linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 60%;
      }
    }

    /* Passaggio tra pagine: l'illustrazione vola dalla scheda al palco */
    @view-transition { navigation: auto; }
    ::view-transition-group(*) { animation-duration: .5s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
    .spool__body { animation: none; }
  }

  @media (hover: none) {
    .card:hover .card__art { transform: translateZ(40px); }
  }
}

/* ═══════════ Foto reali e ricamo personalizzato ═══════════ */

@font-face { font-family: "Dancing Script"; src: url("../fonts/dancing-script.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair-italic.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }

@layer components {
  /* ── Testata: collegamento al ricamo ── */
  .header__in { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .header__custom { display: inline-flex; align-items: center; gap: .5em; height: 46px; padding: 0 1.1em; border-radius: 999px; font-family: var(--display); font-weight: 500; white-space: nowrap; color: var(--brand); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--brand) 45%, transparent); background: var(--brand-tint); transition: background .2s, color .2s, transform .25s var(--ease); }
  .header__custom:hover, .header__custom.is-current { background: var(--brand); color: #fff; transform: translateY(-1px); }
  .nav__link--custom { display: none; color: var(--brand); }

  /* ── Schede con fotografia ── */
  .card--photo .card__media { overflow: hidden; background: var(--paper-2); }
  .card__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), opacity .3s; }
  .card--photo:hover .card__photo { transform: scale(1.07); }
  .tag--custom { left: auto; right: 14px; display: inline-flex; align-items: center; gap: .4em; background: var(--brand); color: #fff; }
  .tag--custom .ico { width: 1.1em; height: 1.1em; }

  .thumb-photo { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
  .line__art { overflow: hidden; }
  .line__custom, .minilines__custom { display: flex; align-items: flex-start; gap: .4em; font-size: .84rem; font-weight: 600; color: var(--brand); }
  .line__custom .ico { width: 1.1em; height: 1.1em; margin-top: .15em; }
  .minilines__art .thumb-photo { border-radius: 12px; }
  .minilines__name .minilines__custom { display: block; color: var(--brand); font-weight: 600; }

  /* ── Reparti: tessere fotografiche ── */
  .tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 18px); perspective: 1600px; }
  .tile { position: relative; display: block; aspect-ratio: 4 / 3.2; border-radius: var(--radius); overflow: hidden; background: color-mix(in oklab, var(--c) 30%, var(--paper-2)); isolation: isolate; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .6s var(--ease), box-shadow .35s; box-shadow: var(--shadow); }
  .tile.is-tilting { transition: transform .08s linear, box-shadow .35s; }
  .tile:hover { box-shadow: 0 30px 40px -28px color-mix(in srgb, var(--c) 60%, var(--ink)); z-index: 2; }
  .tile__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); z-index: -2; }
  .tile__art { position: absolute; inset: 10% 25% 30%; width: 50%; z-index: -2; }
  .tile:hover .tile__photo { transform: scale(1.09); }
  .tile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(39, 20, 27, .86) 0, rgba(39, 20, 27, .35) 38%, transparent 62%); }
  .tile::after { content: ""; position: absolute; inset: 9px; border-radius: 15px; border: 1.5px dashed rgba(255, 255, 255, .7); opacity: 0; transform: scale(1.04); transition: opacity .3s, transform .45s var(--ease); pointer-events: none; }
  .tile:hover::after, .tile:focus-visible::after { opacity: 1; transform: none; }
  .tile__body { position: absolute; left: 18px; right: 18px; bottom: 16px; display: grid; gap: 2px; color: #fff; }
  .tile__name { font-family: var(--display); font-weight: 500; font-size: clamp(1.05rem, 1.5vw, 1.32rem); line-height: 1.12; text-wrap: balance; }
  .tile__count { display: inline-flex; align-items: center; gap: .4em; font-family: var(--mono); font-size: .74rem; color: rgba(255, 255, 255, .82); }
  .tile__count .ico { width: 1.2em; height: 1.2em; transition: transform .3s var(--ease); }
  .tile:hover .tile__count .ico { transform: translateX(5px); }

  /* ── Telaio da ricamo con anteprima cucita ── */
  .hoop { --fabric: #EFE6D8; --thread: #B3202F; position: relative; width: min(100%, 250px); aspect-ratio: 1; flex: none; padding: 13px; border-radius: 50%; background: conic-gradient(from 20deg, #D9B48A, #EFD6B0, #C49A6C, #E6C9A0, #B98D5F, #EFD6B0, #D9B48A); box-shadow: 0 22px 34px -20px rgba(46, 26, 33, .55), inset 0 0 0 1px rgba(120, 78, 40, .35), inset 0 2px 2px rgba(255, 255, 255, .5); }
  .hoop__screw { position: absolute; top: -13px; left: 50%; width: 30px; height: 20px; translate: -50% 0; border-radius: 5px; background: linear-gradient(#EFD6B0, #B98D5F); box-shadow: inset 0 0 0 1px rgba(120, 78, 40, .35); }
  .hoop__screw::after { content: ""; position: absolute; left: 50%; top: 4px; width: 38px; height: 7px; translate: -50% 0; border-radius: 4px; background: linear-gradient(#E3E6EA, #9CA2AB); }
  .hoop__fabric { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; container-type: inline-size; background-color: var(--fabric); background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, .16) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(0, 0, 0, .07) 0 1px, transparent 1px 3px); box-shadow: inset 0 0 0 3px rgba(120, 78, 40, .45), inset 0 12px 26px -10px rgba(0, 0, 0, .3); transition: background-color .45s var(--ease); }

  .stitch { --hatch: repeating-linear-gradient(112deg, var(--thread) 0 .045em, color-mix(in oklab, var(--thread) 68%, #1c0c12) .045em .075em, color-mix(in oklab, var(--thread) 82%, #fff) .075em .11em); display: flex; align-items: center; justify-content: center; gap: .16em; margin: 0; max-width: 100%; line-height: 1.15; white-space: nowrap; font-family: "Dancing Script", "Segoe Script", cursive; font-weight: 700; font-size: min(27cqi, calc(170cqi / max(var(--len), 3))); filter: drop-shadow(0 .035em 0 rgba(30, 12, 18, .4)) drop-shadow(0 .07em .06em rgba(30, 12, 18, .2)); }
  .stitch > span:not(.stitch__icon) { padding: .08em .14em .18em; background: var(--hatch); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: .014em color-mix(in oklab, var(--thread) 62%, #1c0c12); }
  .stitch[data-font="stampatello"] { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: min(19cqi, calc(118cqi / max(var(--len), 3))); }
  .stitch[data-font="classico"] { font-family: "Playfair Display", Georgia, serif; font-style: italic; font-weight: 700; font-size: min(24cqi, calc(150cqi / max(var(--len), 3))); }
  .stitch__icon { display: inline-block; flex: none; width: .78em; height: .78em; background: var(--hatch, currentColor); -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
  .stitch__icon--cuore { --m: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M12 21s-8-5.200-8-11a4.600 4.600 0 0 1 8-3 4.600 4.600 0 0 1 8 3c0 5.800-8 11-8 11z%22/%3E%3C/svg%3E"); }
  .stitch__icon--stella { --m: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M12 2l3 6.600 7.200.800-5.400 4.900 1.500 7.100L12 17.800l-6.300 3.600 1.500-7.100L1.800 9.400 9 8.600z%22/%3E%3C/svg%3E"); }
  .stitch__icon--fiore { --m: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Ccircle cx=%2212%22 cy=%225.600%22 r=%223.900%22/%3E%3Ccircle cx=%2218.200%22 cy=%2210.100%22 r=%223.900%22/%3E%3Ccircle cx=%2215.800%22 cy=%2217.300%22 r=%223.900%22/%3E%3Ccircle cx=%228.200%22 cy=%2217.300%22 r=%223.900%22/%3E%3Ccircle cx=%225.800%22 cy=%2210.100%22 r=%223.900%22/%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%223%22/%3E%3C/svg%3E"); }

  /* ── Pannello ricamo nella scheda prodotto ── */
  .emb { border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow .3s; }
  .emb.is-on { box-shadow: inset 0 0 0 2px var(--brand); }
  .emb--demo, .emb--demo.is-on { box-shadow: none; background: transparent; }
  .emb__toggle { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; }
  .emb__toggle input { appearance: none; width: 46px; height: 28px; margin: 0; border-radius: 999px; background: var(--line); position: relative; transition: background .25s; cursor: pointer; }
  .emb__toggle input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(46, 26, 33, .3); transition: transform .3s var(--ease); }
  .emb__toggle input:checked { background: var(--brand); }
  .emb__toggle input:checked::after { transform: translateX(18px); }
  .emb__toggle-text { display: grid; line-height: 1.3; }
  .emb__toggle-text small { color: var(--ink-soft); font-size: .86rem; }
  .emb__toggle-price { font-family: var(--mono); font-size: .9rem; font-weight: 500; color: var(--brand); white-space: nowrap; }
  .emb__body { display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr); gap: 22px; align-items: start; padding: 22px 18px 20px; border-top: 1.5px dashed var(--line); animation: drop .4s var(--ease); }
  .emb--demo .emb__body { border-top: 0; padding: 12px 0 0; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); gap: 28px; }
  .emb__body .hoop { margin: 10px auto 0; }
  .emb__fields { display: grid; gap: 18px; min-width: 0; }
  .emb__fields .opt legend { margin-bottom: 8px; }
  .emb__count { float: right; font-family: var(--mono); font-weight: 400; font-size: .78rem; color: var(--ink-soft); }
  .emb__note { font-size: .86rem; color: var(--ink-soft); }
  .pill--font span, .pill--icon span { flex-direction: row; gap: .45em; min-width: 0; min-height: 44px; font-size: 1rem; }
  .pill--font[data-font="corsivo"] span { font-family: "Dancing Script", cursive; font-weight: 700; font-size: 1.3rem; }
  .pill--font[data-font="stampatello"] span { font-family: var(--display); text-transform: uppercase; letter-spacing: .05em; font-size: .9rem; }
  .pill--font[data-font="classico"] span { font-family: "Playfair Display", Georgia, serif; font-style: italic; font-weight: 700; font-size: 1.1rem; }
  .pill--icon .stitch__icon { --hatch: currentColor; width: 1em; height: 1em; }
}

@layer pages {
  /* ── Intestazione reparto con foto ── */
  .pagehead__photo { width: clamp(180px, 26vw, 340px); aspect-ratio: 3 / 2; flex: none; object-fit: cover; border-radius: 18px; rotate: 2.5deg; margin-block: -6px; border: 6px solid var(--surface); box-shadow: 0 22px 34px -22px rgba(46, 26, 33, .6); }

  /* ── Galleria prodotto ── */
  .gallery { display: grid; gap: 12px; perspective: 1400px; }
  .gallery__frame { position: relative; aspect-ratio: 1 / 1.08; border-radius: clamp(22px, 3vw, 36px); overflow: hidden; background: var(--paper-2); transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .7s var(--ease), box-shadow .35s; box-shadow: 0 30px 46px -34px rgba(46, 26, 33, .7); }
  .gallery__frame.is-tilting { transition: transform .08s linear; }
  .gallery__frame::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .34), transparent 46%); opacity: 0; transition: opacity .3s; }
  .gallery__frame:hover::after { opacity: 1; }
  .gallery__main { width: 100%; height: 100%; object-fit: cover; transition: opacity .25s; }
  .gallery__main.is-swapping { opacity: 0; }
  .gallery .stage__label { z-index: 1; }
  .gallery__thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
  .gallery__thumb { width: 76px; height: 76px; padding: 0; border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 1.5px var(--line); opacity: .7; transition: opacity .2s, transform .25s var(--ease), box-shadow .2s; }
  .gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
  .gallery__thumb:hover { opacity: 1; transform: translateY(-3px); }
  .gallery__thumb.is-active { opacity: 1; box-shadow: 0 0 0 2.5px var(--ink); }
  .gallery__note { font-size: .84rem; color: var(--ink-soft); }

  /* ── Home: fascia ricamo personalizzato ── */
  .custom { padding-block: clamp(36px, 5vw, 72px) clamp(44px, 6.5vw, 88px); background: linear-gradient(var(--paper), var(--brand-tint) 22%, var(--brand-tint) 62%, var(--paper)); }
  .custom__in { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 6vw, 88px); align-items: center; margin-bottom: clamp(30px, 4vw, 52px); }
  .custom__photos { position: relative; aspect-ratio: 1 / .78; }
  .custom__photo { position: absolute; object-fit: cover; border-radius: 22px; box-shadow: 0 30px 44px -30px rgba(46, 26, 33, .75); }
  .custom__photo--a { left: 0; top: 0; width: 82%; height: 84%; rotate: -2.5deg; }
  .custom__photo--b { right: 0; bottom: 0; width: 38%; height: 54%; rotate: 4deg; border: 7px solid var(--surface); }
  .custom__badge { position: absolute; right: 4%; top: 4%; width: 34%; aspect-ratio: 2 / 1; display: grid; place-items: center; container-type: inline-size; border-radius: 10px; rotate: 6deg; background-color: #F6EBD9; background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, .3) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 3px); box-shadow: 0 16px 24px -14px rgba(46, 26, 33, .7); outline: 1.5px dashed rgba(154, 61, 38, .5); outline-offset: -6px; animation: bob 6s ease-in-out infinite; }
  .custom__copy { display: grid; gap: 18px; justify-items: start; }
  .custom__copy h2 { font-size: clamp(1.9rem, 4vw, 3.1rem); }
  .custom__copy p:not(.eyebrow) { font-size: 1.1rem; color: var(--ink-soft); max-width: 46ch; }
  .custom__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }

  /* ── Pagina Personalizza ── */
  .atelier { background: radial-gradient(90% 100% at 100% 0%, var(--brand-tint), transparent 62%), var(--paper); padding-block: clamp(22px, 3vw, 40px) clamp(36px, 5vw, 64px); }
  .atelier__in { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: clamp(26px, 5vw, 72px); align-items: start; }
  .atelier__copy { display: grid; gap: 18px; padding-top: 6px; }
  .atelier h1 { font-size: clamp(2.3rem, 5vw, 4rem); line-height: .98; letter-spacing: -.02em; }
  .atelier h1 em { font-style: normal; color: var(--brand); }
  .atelier__lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 48ch; }
  .steps { display: grid; gap: 14px; margin-top: 8px; }
  .steps li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
  .steps b { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-family: var(--display); font-weight: 600; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); outline: 1.5px dashed color-mix(in srgb, var(--brand) 50%, transparent); outline-offset: 3px; }
  .steps span { padding-top: 6px; color: var(--ink-soft); }
  .steps strong { color: var(--ink); }
  .atelier__demo { display: grid; gap: 14px; padding: clamp(20px, 3vw, 32px); border-radius: clamp(22px, 3vw, 34px); background: var(--surface); box-shadow: 0 1px 0 var(--line), 0 40px 60px -44px rgba(46, 26, 33, .6); }
  .atelier__demo-title { font-family: var(--display); font-weight: 500; font-size: 1.35rem; }
  .atelier__fabrics { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-top: 16px; border-top: 1.5px dashed var(--line); font-size: .92rem; font-weight: 600; }
  .photostrip { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: clamp(10px, 1.4vw, 18px); }
  .photostrip__item { margin: 0; height: clamp(200px, 26vw, 340px); border-radius: var(--radius); overflow: hidden; }
  .photostrip__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
  .photostrip__item:hover img { transform: scale(1.06); }

  .credits { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
  .credits li { display: grid; gap: 6px; font-size: .84rem; }
  .credits img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; }
  .credits a { color: var(--ink-soft); }
  .credits a:hover { color: var(--brand); text-decoration: underline dashed; text-underline-offset: 3px; }

  @media (max-width: 1100px) {
    .header__custom { display: none; }
    .header__in { grid-template-columns: auto minmax(0, 1fr) auto; }
    .nav__link--custom { display: inline-flex; }
    .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }
  @media (max-width: 860px) {
    .custom__in, .atelier__in { grid-template-columns: minmax(0, 1fr); }
    .custom__photos { max-width: 520px; width: 100%; margin-inline: auto; }
    .pagehead__photo { display: none; }
    .photostrip { grid-template-columns: 1fr 1fr; }
    .photostrip__item--wide { grid-column: 1 / -1; }
  }
  @media (max-width: 560px) {
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tile { aspect-ratio: 1 / 1; }
    .tile__body { left: 12px; right: 12px; bottom: 12px; }
    .emb__body, .emb--demo .emb__body { grid-template-columns: minmax(0, 1fr); }
    .emb__body .hoop { width: min(100%, 210px); }
    .emb__toggle { grid-template-columns: auto minmax(0, 1fr); }
    .emb__toggle-price { grid-column: 2; }
    .tag--custom { right: 10px; }
    .card--photo .tag:not(.tag--custom) { display: none; }
  }
}

@layer motion {
  @media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
      .tiles > .tile { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
    }
  }
}
