/* Blasat — Anteprima 3D
   Fondo neutro in entrambi i temi: l'oggetto del cliente e' l'unica cosa
   colorata in pagina. Il verde Blasat vive solo nel logo. */

:root {
  color-scheme: light dark;

  --bg: #f7f6f4;
  --surface: #ffffff;
  --stage-a: #ffffff;
  --stage-b: #eceae6;

  --ink: #1d1d1f;
  --ink-soft: #5c5c61;
  --ink-faint: #6e6e73;
  --line: rgba(0, 0, 0, .09);
  --line-soft: rgba(0, 0, 0, .06);

  --brand: #0d3d2e;
  --accent: #6f2590;
  --on-accent: #ffffff;

  --shadow-sm: 0 .5px 1px rgba(0, 0, 0, .04), 0 2px 6px rgba(0, 0, 0, .05);
  --shadow-lg: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 34px rgba(0, 0, 0, .08);

  --radius: 12px;
  --radius-lg: 20px;
  --ease: cubic-bezier(.32, .72, 0, 1);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0b;
    --surface: #161618;
    --stage-a: #1c1c1f;
    --stage-b: #121214;

    --ink: #f5f5f7;
    --ink-soft: #a8a8ae;
    --ink-faint: #86868b;
    --line: rgba(255, 255, 255, .11);
    --line-soft: rgba(255, 255, 255, .07);

    --brand: #f5f5f7;
    --accent: #c79ae2;
    --on-accent: #1a0b24;

    --shadow-sm: 0 .5px 1px rgba(0, 0, 0, .5);
    --shadow-lg: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px rgba(0, 0, 0, .55);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-x: none;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

a { color: inherit; }

.wrap {
  width: min(100% - 36px, 900px);
  margin-inline: auto;
}

/* ---------- intestazione ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 4px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-logo {
  width: 76px;
  height: 27px;
  flex: none;
  color: var(--brand);
  background: currentColor;
  -webkit-mask: url(/brand/logo-horizontal.svg) no-repeat center / contain;
  mask: url(/brand/logo-horizontal.svg) no-repeat center / contain;
}

.brand-tag {
  padding-left: 10px;
  border-left: 1px solid var(--line);
  font-size: .82rem;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
}

.back {
  font-size: .86rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}

.back:hover { color: var(--ink); }

/* ---------- titolo ---------- */

.head { padding: 22px 0 18px; max-width: 32rem; }

.eyebrow {
  margin: 0 0 8px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

h1 {
  margin: 0;
  font-size: clamp(1.7rem, 6.4vw, 2.6rem);
  line-height: 1.07;
  letter-spacing: -.028em;
  font-weight: 640;
}

.head p {
  margin: 10px 0 0;
  font-size: .98rem;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* ---------- palco 3D ---------- */

.stage {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, var(--stage-a), var(--stage-b));
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

model-viewer {
  display: block;
  width: 100%;
  height: clamp(300px, 46vh, 430px);
  background: transparent;
  --poster-color: transparent;
  --progress-bar-color: var(--accent);
  --progress-mask: transparent;
}

.scale-tag {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid var(--line-soft);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  font-size: .72rem;
  font-weight: 590;
  color: var(--ink-soft);
  pointer-events: none;
}

.scale-tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.hint {
  margin: 10px 2px 0;
  font-size: .8rem;
  color: var(--ink-faint);
}

/* ---------- invito alla realtà aumentata ---------- */

.ar {
  margin-top: 22px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
}

.ar[hidden] { display: none; }

.ar-title {
  margin: 0 0 5px;
  font-size: 1.02rem;
  font-weight: 620;
  letter-spacing: -.016em;
}

.ar-note {
  margin: 0;
  font-size: .89rem;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-top: 15px;
  padding: 14px 22px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.011em;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s var(--ease), opacity .2s var(--ease);
}

.btn:hover { opacity: .9; }
.btn:active { transform: scale(.975); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* riquadro con il QR, per chi arriva da computer */
.qr {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.qr img {
  width: 108px;
  height: 108px;
  flex: none;
  border-radius: 10px;
  background: #fff;
  padding: 7px;
  border: 1px solid var(--line-soft);
}

.qr p { margin: 0; font-size: .86rem; color: var(--ink-soft); }
.qr strong { display: block; color: var(--ink); font-size: .93rem; margin-bottom: 3px; }

/* ---------- scheda tecnica ---------- */

.specs {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-soft);
}

.specs li {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 18px;
  justify-content: space-between;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: .91rem;
}

.specs .k { color: var(--ink-soft); }
.specs .v { font-weight: 560; font-variant-numeric: tabular-nums; }

/* ---------- indice ---------- */

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  margin-top: 6px;
}

.card {
  display: block;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}

.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card:active { transform: scale(.99); }

.card-shot {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -4px -4px 16px;
  padding: 10px;
  min-height: 124px;
  border-radius: 14px;
  background: linear-gradient(165deg, var(--stage-a), var(--stage-b));
  border: 1px solid var(--line-soft);
}

.card-shot img { width: 100%; height: auto; max-height: 128px; object-fit: contain; }

.card h2 {
  margin: 0 0 7px;
  font-size: 1.18rem;
  font-weight: 620;
  letter-spacing: -.022em;
}

.card p { margin: 0; font-size: .88rem; color: var(--ink-soft); }

.card-go {
  display: inline-block;
  margin-top: 14px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--card-accent, var(--accent));
}

.empty {
  padding: 38px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--ink-soft);
}

/* ---------- chiusura ---------- */

footer {
  margin-top: 46px;
  padding: 22px 0 34px;
  border-top: 1px solid var(--line-soft);
  font-size: .8rem;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  justify-content: space-between;
}

.made {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.made-mark {
  width: 15px;
  height: 13px;
  color: var(--ink-faint);
  background: currentColor;
  -webkit-mask: url(/brand/logomark.svg) no-repeat center / contain;
  mask: url(/brand/logomark.svg) no-repeat center / contain;
}

footer a { font-weight: 550; color: var(--ink-soft); text-decoration: none; }
footer a:hover { color: var(--ink); }

/* ---------- telefono ---------- */

@media (max-width: 700px) {
  .wrap { width: calc(100% - 32px); }
  model-viewer { height: clamp(250px, 34vh, 340px); }
  .head { padding: 18px 0 14px; }
  .head p { font-size: .94rem; }
  .qr { flex-direction: column; align-items: flex-start; gap: 14px; }

  /* L'invito ad aprire l'AR resta a portata di pollice mentre si scorre,
     sopra la barra di Safari (safe-area) e non sotto. */
  #ar-live:not([hidden]) {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    margin: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    border: 1px solid var(--line-soft);
    border-bottom: 0;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 -1px 0 var(--line-soft), 0 -12px 34px rgba(0, 0, 0, .16);
  }

  #ar-live:not([hidden]) .ar-title,
  #ar-live:not([hidden]) .ar-note { display: none; }
  #ar-live:not([hidden]) .btn { margin-top: 0; padding: 15px 22px; }

  /* spazio perche' la barra fissa non copra il fondo pagina */
  body.has-ar-bar { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
