/* ── On The Edge — nero industriale + grigio 127 ──────────────────── */
:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-2: #161616;
  --border: #262626;
  --text: #ededed;
  --muted: #9a9a9a;
  --grey: #7f7f7f;            /* g127 — lo stesso grigio delle foto */
  --accent: #ffffff;
  --font-sans: "Archivo", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--grey); color: var(--bg); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: #2c2c2c; border-radius: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }

a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.cursor { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.mono, .mono-tag { font-family: var(--font-mono); }

/* ── display type ── */
.hub-title, .view-title {
  font-stretch: 125%;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: -0.015em;
  line-height: 0.92;
}

/* ── nav ── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 58px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-img { height: 28px; width: auto; display: block; }
.logo-img.small { height: 20px; }
.wordmark { font-family: var(--font-mono); font-size: 1.1rem; font-weight: 500; }
.wordmark.small { font-size: 0.95rem; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase;
  letter-spacing: 0.08em; text-decoration: none; color: var(--muted);
  padding: 8px 12px; border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.current { color: var(--bg); background: var(--grey); }

/* ── viste / routing ── */
.view { display: none; }
.view.active { display: block; animation: viewIn 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.view-head { padding: 84px 0 56px; border-bottom: 1px solid var(--border); margin-bottom: 56px; }
.kicker {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted);
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 18px;
}
.view-title { font-size: clamp(2.6rem, 7vw, 5rem); margin-bottom: 26px; }
.lede { max-width: 600px; color: var(--muted); font-size: 1.06rem; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ── HUB ── */
#view-home.active { display: flex; flex-direction: column; min-height: calc(100vh - 58px); }
.hub-head {
  max-width: 1100px; width: 100%; margin: 0 auto;
  padding: 72px 24px 48px;
}
.hub-logo { height: 88px; width: auto; margin-bottom: 26px; }
.hub-title { font-size: clamp(3.2rem, 10vw, 7rem); }
/* il fill vive DENTRO il titolo, sulla riga di EDGE */
.hub-title .hub-fill {
  font-family: var(--font-mono); font-weight: 500;
  font-size: 0.3em; letter-spacing: 0.02em;
  text-transform: none; white-space: nowrap;
  margin-left: 0.18em; vertical-align: baseline;
}
.hub-sub {
  font-family: var(--font-mono); color: var(--muted); font-size: 0.92rem;
  letter-spacing: 0.06em; margin-top: 18px;
}
.hub-sub a { color: var(--muted); text-underline-offset: 3px; }
.hub-sub a:hover { color: var(--text); }

.panels { flex: 1; display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.panel {
  display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 28px;
  padding: 34px 24px;
  max-width: 1100px; width: 100%; margin: 0 auto;
  text-decoration: none; border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
  transition: background 0.25s ease, color 0.25s ease;
}
.panel-num {
  font-stretch: 125%; font-weight: 850; font-size: 3.4rem; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px #3a3a3a;
  transition: -webkit-text-stroke-color 0.25s, color 0.25s;
}
.panel-title {
  display: block; font-stretch: 125%; font-weight: 800; text-transform: uppercase;
  font-size: clamp(1.4rem, 3.6vw, 2.2rem); letter-spacing: -0.01em; line-height: 1.05;
}
.panel-desc {
  display: block; font-family: var(--font-mono); font-size: 0.8rem;
  color: var(--muted); margin-top: 8px; letter-spacing: 0.03em;
  transition: color 0.25s;
}
.panel-arrow { font-size: 1.8rem; transition: transform 0.25s ease; }
.panel:hover { background: var(--grey); color: var(--bg); }
.panel:hover .panel-num { -webkit-text-stroke-color: var(--bg); }
.panel:hover .panel-desc { color: var(--bg); }
.panel:hover .panel-arrow { transform: translateX(8px); }

/* marquee */
.marquee { overflow: hidden; border-top: 1px solid var(--border); padding: 11px 0; }
.marquee-track {
  display: flex; gap: 2.2rem; width: max-content;
  font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted);
  letter-spacing: 0.1em; animation: scroll 32s linear infinite;
}
@keyframes scroll { to { transform: translateX(-50%); } }

/* ── blocchi ── */
.block { padding: 0 0 72px; }
.block + .block { border-top: 1px solid var(--border); padding-top: 64px; }
.block-title {
  font-stretch: 125%; font-weight: 800; text-transform: uppercase;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin-bottom: 28px;
  display: flex; align-items: center; gap: 14px;
}
.mono-tag {
  font-size: 0.66rem; font-weight: 500; letter-spacing: 0.1em;
  background: var(--grey); color: var(--bg); padding: 5px 10px; border-radius: 4px;
  text-transform: uppercase; transform: translateY(-2px);
}
.block-lede { color: var(--muted); max-width: 560px; margin-bottom: 30px; }

.steps {
  display: flex; gap: 12px 28px; flex-wrap: wrap; list-style: none;
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted);
  margin-bottom: 34px;
}
.steps b {
  color: var(--bg); background: var(--grey); border-radius: 3px;
  padding: 1px 6px; margin-right: 8px; font-weight: 500;
}
.steps.wide { flex-direction: column; gap: 14px; margin-bottom: 38px; }

.btn {
  display: inline-block; padding: 13px 24px; border-radius: 5px;
  font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.04em;
  text-transform: uppercase; text-decoration: none; cursor: pointer;
  border: 1px solid var(--accent); transition: all 0.15s ease;
}
.btn.primary { background: var(--accent); color: var(--bg); font-weight: 500; }
.btn.primary:hover { background: transparent; color: var(--accent); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--grey); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── preventivatore ── */
.quote-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 22px; align-items: start; }
.dropzone {
  border: 1.5px dashed #3a3a3a; border-radius: 8px;
  padding: 40px 24px; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface);
}
.dropzone:hover, .dropzone.drag { border-color: var(--grey); background: var(--surface-2); }
.dz-title { font-size: 1.08rem; }
.dz-sub { color: var(--muted); margin-top: 4px; }
.dz-sub .link { text-decoration: underline; text-underline-offset: 3px; }
.dz-note { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); margin-top: 16px; letter-spacing: 0.04em; }
.dz-demo { margin-top: 12px; font-size: 0.85rem; color: var(--muted); }
.link-btn {
  background: none; border: none; color: var(--text); font: inherit;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0;
}
.file-chip {
  margin-top: 14px; font-family: var(--font-mono); font-size: 0.78rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 5px; padding: 8px 12px; display: inline-block;
}
.error { margin-top: 14px; color: #ff7a7a; font-size: 0.9rem; }

.params { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.params label, .od-label {
  display: flex; flex-direction: column; gap: 6px;
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.params select, .params input, .od-label input, .od-label select {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 5px;
  padding: 11px 12px; font-family: var(--font-sans); font-size: 0.95rem;
  width: 100%; appearance: none;
}
.params select:focus, .params input:focus, .od-label input:focus, .od-label select:focus {
  outline: none; border-color: var(--grey);
}

.result {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 26px; min-height: 320px;
  display: flex; flex-direction: column;
}
.result-empty { color: var(--muted); margin: auto; text-align: center; }
.result-empty span { font-size: 0.85rem; }
.result-rows div {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.result-rows dt {
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.result-rows dd { font-size: 1rem; font-variant-numeric: tabular-nums; }
.result-rows .price-row { border-bottom: none; padding-top: 16px; }
.result-rows .price-row dd { font-size: 1.65rem; font-weight: 700; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.result-note { font-size: 0.78rem; color: var(--muted); margin-top: 10px; }
.result-cta { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.result-cta .btn { text-align: center; }
.fineprint {
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted);
  margin-top: 24px; letter-spacing: 0.03em;
}

/* ── hero 3D in home ── */
.hero3d {
  position: relative; height: 170px; max-width: 460px; margin-bottom: 26px;
  cursor: grab; touch-action: none;
}
.hero3d:active { cursor: grabbing; }
.hero3d canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }

/* ── form ── */
.params .span2 { grid-column: 1 / -1; }

/* ── banner preventivo condiviso ── */
.quote-banner {
  font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.7;
  background: var(--surface); border: 1px solid var(--grey); border-radius: 8px;
  padding: 14px 18px; margin-bottom: 40px; white-space: pre-wrap;
}

/* ── badge fiducia ── */
.badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.badge {
  font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--border); border-radius: 99px; padding: 6px 13px;
}
.badge::before { content: "✓ "; color: var(--grey); }

/* ── toggle modello/layer + UI layer ── */
.view-toggle {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  display: flex; gap: 4px; background: rgba(10, 10, 10, 0.7);
  border: 1px solid var(--border); border-radius: 6px; padding: 3px;
}
.vt-btn {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
  background: none; border: none; border-radius: 4px;
  padding: 8px 12px; cursor: pointer; touch-action: manipulation;
  transition: color 0.15s, background 0.15s;
}
.vt-btn:hover { color: var(--text); }
.vt-btn.active { background: var(--grey); color: var(--bg); }
.layer-ui {
  position: absolute; left: 10px; right: 10px; bottom: 8px; z-index: 3;
  display: flex; align-items: center; gap: 10px;
}
.layer-play {
  background: var(--grey); color: var(--bg); border: none; border-radius: 4px;
  width: 34px; height: 30px; font-size: 0.62rem; cursor: pointer; flex: none;
  touch-action: manipulation;
}
.layer-play:hover { background: var(--text); }
.layer-ui input[type="range"] {
  flex: 1; appearance: none; height: 4px; border-radius: 2px;
  background: var(--surface-2); outline: none;
}
.layer-ui input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
}
.layer-ui input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border: none; border-radius: 50%;
  background: var(--accent); cursor: pointer;
}
.layer-count {
  font-family: var(--font-mono); font-size: 0.62rem; color: var(--muted);
  min-width: 70px; text-align: right; font-variant-numeric: tabular-nums;
}

/* stato di caricamento dei viewer 3D (Three.js da CDN) */
.viewer-loading {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 220% 100%; animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -220% 0; } }
.slice-progress {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--bg); background: var(--grey);
  padding: 4px 9px; border-radius: 4px;
}

/* ── casi studio ── */
.casi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.caso {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; transition: border-color 0.2s, transform 0.2s;
}
.caso:hover { border-color: var(--grey); transform: translateY(-3px); }
.caso img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.caso h4 {
  font-stretch: 125%; text-transform: uppercase; font-size: 1.02rem;
  padding: 18px 20px 6px;
}
.caso p { color: var(--muted); font-size: 0.88rem; padding: 0 20px 20px; }

/* ── configuratore gruccia ── */
.config-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 22px; align-items: stretch; }
.config-viewer {
  position: relative; height: 360px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; cursor: grab; touch-action: none;
}
.config-viewer:active { cursor: grabbing; }
.config-viewer canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.config-panel { display: flex; flex-direction: column; gap: 16px; justify-content: center; }
.config-panel .btn { text-align: center; }
#cfg-name { font-size: 1.05rem; }

/* ── viewer 3D nel risultato ── */
.stl-view {
  position: relative; height: 210px; margin-bottom: 16px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; cursor: grab; touch-action: none;
}
.stl-view:active { cursor: grabbing; }
.stl-view canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.stl-hint {
  position: absolute; bottom: 10px; right: 12px; z-index: 2; pointer-events: none;
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
}

/* ── materioteca 3D ── */
.mat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: stretch; margin-bottom: 26px; }
.mat-viewer {
  position: relative; height: 420px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; cursor: grab; touch-action: none;
}
.mat-viewer:active { cursor: grabbing; }
.mat-viewer canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.mat-panel { display: flex; flex-direction: column; gap: 14px; padding: 6px 0; }
.mat-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.mat-chip {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border); border-radius: 5px;
  padding: 9px 16px; cursor: pointer; transition: all 0.15s ease;
}
.mat-chip:hover { color: var(--text); border-color: var(--grey); }
.mat-chip.active { background: var(--grey); color: var(--bg); border-color: var(--grey); }
.mat-name { font-stretch: 125%; text-transform: uppercase; font-size: 1.5rem; }
.mat-desc { color: var(--muted); font-size: 0.95rem; min-height: 3.4em; }
.mat-bars { display: flex; flex-direction: column; gap: 10px; }
.mat-bar { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 12px; }
.mat-bar-label {
  font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted);
}
.mat-bar-track { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.mat-bar-fill { height: 100%; background: var(--grey); border-radius: 3px; transition: width 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
.mat-uses { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); letter-spacing: 0.04em; }
.mat-uses::before { content: "→ "; color: var(--grey); }

/* ── preventivatore laser ── */
.laser-quote { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 22px; align-items: start; margin-top: 26px; }
.lz-result-box { min-height: 0; }

/* ── libreria materiali: righe split, non card ── */
.matlib-grid { border-top: 1px solid var(--border); margin-bottom: 22px; }
.matlib {
  display: grid; grid-template-columns: 190px 1fr; gap: 22px; align-items: start;
  padding: 18px 0; border-bottom: 1px solid var(--border);
  background: none; border-radius: 0; transition: background 0.2s;
}
.matlib:hover { background: linear-gradient(90deg, rgba(127,127,127,.05), transparent); transform: none; border-color: var(--border); }
.matlib-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.matlib h4 { font-stretch: 125%; text-transform: uppercase; font-size: 1.02rem; }
.matlib-tag {
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--grey); background: none;
  padding: 0; border: none; white-space: nowrap;
}
.matlib-tag::before { content: "— "; }
.matlib p { color: var(--muted); font-size: 0.84rem; margin-bottom: 10px; }
.matlib-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.matlib-chips { gap: 0; }
.matlib-chips span {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.06em;
  color: var(--muted); border: none; padding: 0;
}
.matlib-chips span + span::before { content: " · "; color: var(--border); margin: 0 6px; }
@media (max-width: 640px) { .matlib { grid-template-columns: 1fr; gap: 8px; } }

/* ── reel YouTube ── */
.yt {
  position: relative; aspect-ratio: 16 / 9; max-width: 760px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; cursor: pointer;
}
.yt img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.85; transition: opacity 0.2s, transform 0.3s; }
.yt:hover img { opacity: 1; transform: scale(1.02); }
.yt-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(10, 10, 10, 0.8); border: 1px solid var(--grey);
  color: var(--text); font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.yt:hover .yt-play { background: var(--grey); color: var(--bg); transform: translate(-50%, -50%) scale(1.08); }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ── laser: righe split (etichetta stretta | descrizione) ── */
.laser-grid { border-top: 1px solid var(--border); margin-bottom: 26px; }
.laser-card {
  display: grid; grid-template-columns: 190px 1fr; gap: 22px; align-items: baseline;
  background: none; border: none; border-bottom: 1px solid var(--border);
  border-radius: 0; padding: 22px 0; transition: background 0.2s;
}
.laser-card:hover { background: linear-gradient(90deg, rgba(127,127,127,.05), transparent); transform: none; }
.laser-card p:last-child { color: var(--muted); font-size: 0.92rem; }
.laser-card b { color: var(--text); }
.laser-label {
  font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text); margin: 0; padding: 0; border: none;
}
.laser-note { color: var(--muted); font-size: 0.92rem; margin-bottom: 26px; }
@media (max-width: 640px) { .laser-card { grid-template-columns: 1fr; gap: 8px; } }

/* ── studio: split asimmetrico 35/65, indice enorme, niente scatole ── */
.studio-grid { border-top: 1px solid var(--border); margin-bottom: 72px; }
.studio-card {
  display: grid; grid-template-columns: 130px 1fr; gap: 30px; align-items: start;
  background: none; border: none; border-bottom: 1px solid var(--border);
  border-radius: 0; padding: 34px 0; transition: background 0.2s;
}
.studio-card:hover { background: linear-gradient(90deg, rgba(127,127,127,.05), transparent); transform: none; }
.card-index {
  font-stretch: 125%; font-weight: 850; font-size: 3.4rem; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.2px #3a3a3a; margin: 0;
}
.studio-card:hover .card-index { -webkit-text-stroke-color: var(--grey); }
.studio-card h3 {
  font-stretch: 125%; text-transform: uppercase; font-size: 1.4rem; margin-bottom: 12px;
}
.studio-card > p { color: var(--muted); font-size: 0.95rem; margin-bottom: 18px; }
.mono-list { list-style: none; font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.mono-list li { padding: 7px 0; border-top: 1px solid var(--border); }
@media (max-width: 640px) { .studio-card { grid-template-columns: 1fr; gap: 14px; } .card-index { font-size: 2.2rem; } }
.mono-list li::before { content: "→ "; color: var(--grey); }

/* ── shop ── */
/* ── shop: split asimmetrico 38/62, immagine a sfondare | contenuto ── */
.shop-grid { border-top: 1px solid var(--border); margin-bottom: 56px; }
.product {
  display: grid; grid-template-columns: 38% 1fr; gap: 30px; align-items: stretch;
  background: none; border: none; border-bottom: 1px solid var(--border);
  border-radius: 0; overflow: visible; transition: background 0.2s;
  padding: 30px 0;
}
.product:hover { background: linear-gradient(90deg, rgba(127,127,127,.05), transparent); transform: none; border-color: var(--border); }
.product-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: rgb(127, 127, 127); }
.product-media img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  transition: transform 0.3s ease;
}
.product:hover .product-media img { transform: scale(1.03); }
.product-tag {
  position: absolute; top: 12px; right: 12px;
  font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text); background: var(--bg);
  padding: 4px 9px; border-radius: 0; border: 1px solid var(--border);
}
.product-info { padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; justify-content: center; }
.product-info h3 { font-stretch: 125%; text-transform: uppercase; font-size: 1.15rem; }
.product-info > p { color: var(--muted); font-size: 0.9rem; flex: 1; }
.product-price { font-family: var(--font-mono); font-size: 1.2rem; font-weight: 500; }
.product-cta { display: flex; gap: 10px; margin-top: 12px; }
.product-cta .btn { padding: 10px 18px; font-size: 0.74rem; }
@media (max-width: 640px) { .product { grid-template-columns: 1fr; } }

.shop-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 64px; }
.info-item { border-top: 1px solid var(--border); padding-top: 16px; }
.info-item p:last-child { color: var(--muted); font-size: 0.9rem; }

.faq { padding-bottom: 80px; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  cursor: pointer; padding: 18px 0; font-size: 1rem; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); font-size: 0.92rem; padding-bottom: 18px; max-width: 640px; }
.faq details a { color: var(--text); }

/* ── modale ordine ── */
dialog#order-dialog {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 0; width: min(480px, calc(100vw - 32px));
  margin: auto;
}
dialog#order-dialog::backdrop { background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(3px); }
.order-form { padding: 30px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.order-form h3 { font-stretch: 125%; text-transform: uppercase; font-size: 1.4rem; }
.od-price { font-family: var(--font-mono); font-size: 1.1rem; }
.od-fields { display: flex; flex-direction: column; gap: 14px; }
.dialog-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: 1px solid var(--border); color: var(--muted);
  width: 34px; height: 34px; border-radius: 5px; font-size: 1.1rem; cursor: pointer;
}
.dialog-close:hover { color: var(--text); border-color: var(--grey); }
.od-summary {
  font-size: 0.74rem; color: var(--muted); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px;
  white-space: pre-wrap; line-height: 1.7;
}
.od-hint { font-size: 0.74rem; color: var(--muted); }

/* toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--grey); color: var(--bg);
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em;
  padding: 11px 20px; border-radius: 6px; z-index: 100;
  animation: toastIn 0.25s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ── footer ── */
.footer { border-top: 1px solid var(--border); padding: 26px 0; }
.footer-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted);
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }

/* ── responsive ── */
@media (max-width: 860px) {
  .view-head { padding: 56px 0 40px; margin-bottom: 44px; }
  .quote-grid, .studio-grid, .shop-grid, .laser-quote { grid-template-columns: 1fr; }
  .laser-grid, .shop-info, .casi-grid { grid-template-columns: 1fr; }
  .hero3d { height: 130px; }
  .panel { grid-template-columns: 72px 1fr auto; gap: 16px; padding: 26px 24px; }
  .panel-num { font-size: 2.2rem; }
  .hub-head { padding: 48px 24px 36px; }
  .hub-logo { height: 64px; }
}
@media (max-width: 560px) {
  .nav-links a { padding: 7px 9px; font-size: 0.66rem; }
  .params { grid-template-columns: 1fr; }
  .product-cta { flex-direction: column; }
}

/* ── reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
  .marquee-track { animation: none; }
  .view.active { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .viewer-loading { animation: none; }
}

/* ════════════════════════════════════════════════════════════════════
   DECK MODE — tutto dentro lo swipe (orizzontale = sezioni, verticale = contenuto)
   ════════════════════════════════════════════════════════════════════ */
:root { --green: #46e07a; }

body.deck-mode { height: 100dvh; overflow: hidden; }

#bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#bg canvas { display: block; width: 100% !important; height: 100% !important; }

/* nav fissa sopra al deck */
body.deck-mode .nav { position: fixed; left: 0; right: 0; top: 0; z-index: 40; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.gc-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); user-select: none; }
.gc-sw { width: 40px; height: 22px; border-radius: 12px; background: #222;
  border: 1px solid var(--border); position: relative; transition: .3s; flex: none; }
.gc-sw i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--grey); transition: .3s; }
#gc:checked + .gc-sw { background: rgba(70,224,122,.2); border-color: var(--green); }
#gc:checked + .gc-sw i { transform: translateX(18px); background: var(--green); }

/* deck orizzontale con snap nativo */
.deck { position: fixed; inset: 0; z-index: 2;
  display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.deck::-webkit-scrollbar { display: none; }

.sec { position: relative; flex: none; width: 100vw; height: 100dvh;
  scroll-snap-align: start; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.sec::-webkit-scrollbar { display: none; }
#sec-stampa, #sec-studio, #sec-shop { background: rgba(10,10,10,0.93); }
#sec-home { background: transparent; }

.sec-scroll { min-height: 100%; padding: 76px 0 64px; }
.sec .container { max-width: 1100px; margin: 0 auto; padding: 0 26px; }

/* home hero centrato */
.sec-home { display: flex; align-items: center; }
.home-hero { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 26px; }
.home-hero .hub-title { font-size: clamp(2.8rem, 12vw, 6rem); }
.home-hero .hub-sub { font-size: 0.92rem; }
.scroll-cue { margin-top: 30px; font-family: var(--font-mono); font-size: 0.66rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); transition: opacity .4s; }
.scroll-cue::after { content: " →"; }

/* dots di navigazione */
.dots { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 41; display: flex; gap: 9px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #333; border: none;
  padding: 0; cursor: pointer; transition: .25s; }
.dot.on { background: var(--grey); width: 22px; border-radius: 4px; }

/* il viewer STL cattura il drag, non scrolla il deck */
.stl-view, .mat-viewer { touch-action: none; }

/* la view-head non ha più il bordo/spazio enorme dentro al deck */
body.deck-mode .view-head { padding: 8px 0 40px; border-bottom: 1px solid var(--border); margin-bottom: 48px; }

/* ── skin G-CODE globale ── */
body.gcode { background: #02110a; color: var(--green); }
body.gcode #sec-stampa, body.gcode #sec-studio, body.gcode #sec-shop { background: rgba(2,17,10,0.93); }
body.gcode .nav { background: rgba(2,17,10,0.85); border-color: rgba(70,224,122,.3); }
body.gcode .brand img { filter: brightness(0) saturate(100%) invert(78%) sepia(38%) saturate(720%) hue-rotate(86deg) brightness(96%); }
body.gcode .wordmark, body.gcode .kicker, body.gcode .gc-toggle, body.gcode .hub-sub,
body.gcode .lede, body.gcode .block-lede, body.gcode .scroll-cue { color: var(--green); }
body.gcode .view-title { color: transparent; -webkit-text-stroke: 1.4px var(--green); }
/* nel hub il titolo galleggia direttamente sopra il wireframe (nessun pannello dietro, a differenza
   delle sezioni che hanno uno sfondo quasi opaco): serve un riempimento pieno + un retro-pannello
   scuro, altrimenti sparisce dentro le linee verdi della stampante */
body.gcode .hub-title { color: var(--green); -webkit-text-stroke: 0; text-shadow: 0 0 12px rgba(2,17,10,.9); }
body.gcode #sec-home .home-hero {
  background: rgba(2,17,10,.82); backdrop-filter: blur(5px);
  padding: 22px 26px; margin: 0 -26px;
}
body.gcode .block-title, body.gcode .studio-card h3, body.gcode .matlib h4,
body.gcode .product-info h3, body.gcode .caso h4 { color: var(--green); }
body.gcode .nav-links a { color: rgba(70,224,122,.7); }
body.gcode .nav-links a.current { background: var(--green); color: #02110a; }
body.gcode .dot { background: rgba(70,224,122,.3); }
body.gcode .dot.on { background: var(--green); }
body.gcode .btn.primary { background: var(--green); color: #02110a; border-color: var(--green); }
body.gcode .btn.ghost { color: var(--green); border-color: rgba(70,224,122,.4); }
body.gcode .mono-tag { background: var(--green); color: #02110a; }
body.gcode .badge, body.gcode .pts li, body.gcode .matlib-chips span { border-color: rgba(70,224,122,.4); color: var(--green); }
body.gcode .dropzone { border-color: rgba(70,224,122,.5); }
body.gcode .matlib, body.gcode .laser-card, body.gcode .studio-card, body.gcode .product, body.gcode .caso,
body.gcode .result, body.gcode .params select, body.gcode .params input { border-color: rgba(70,224,122,.25); }
body.gcode::after { content: ""; position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(70,224,122,.04) 0 1px, transparent 1px 3px); }

@media (max-width: 560px) {
  .nav-links { display: none; }
  .sec .container { padding: 0 20px; }
}

/* ════════════════════════════════════════════════════════════════════
   OVERRIDE — modello HUB 3D: una sezione visibile alla volta.
   Dal hub (home) si vedono i 4 oggetti sul piatto; cliccandone uno si
   apre la sua sezione, con l'oggetto 3D in cima e i contenuti sotto.
   ════════════════════════════════════════════════════════════════════ */
body.deck-mode { height: auto; overflow: visible; overflow-x: hidden; overflow-y: auto; }
html { height: auto; overflow-y: auto; }
#bg { position: fixed; inset: 0; z-index: 0; }
.nav { position: fixed; left: 0; right: 0; top: 0; z-index: 40; }
.deck { position: static; display: block; overflow: visible; height: auto; }

/* sezioni: nascoste, solo .active visibile */
.sec { display: none; width: auto; height: auto; min-height: 0;
  scroll-snap-align: none; overflow: visible; }
.sec.active { display: block; }

/* HOME = hub: titolo che galleggia, i click passano agli oggetti 3D */
#sec-home { background: transparent; }
#sec-home.active { display: flex; align-items: center; min-height: 100vh; }
#sec-home .home-hero { pointer-events: none; }
#sec-home .home-hero a { pointer-events: auto; }

/* sezioni contenuto: oggetto 3D in cima (spazio vuoto ~56vh), poi si scorre */
.sec.active:not(#sec-home) { min-height: 100vh; background: transparent; }
.sec.active:not(#sec-home) .sec-scroll { padding: 62vh 0 12vh; pointer-events: none; }
.sec.active:not(#sec-home) .sec-scroll > * { pointer-events: auto; }
.sec.active:not(#sec-home) .container {
  background: rgba(10,10,10,0.9);
  border-top: 2px solid var(--grey);
  border-radius: 0;
  padding-top: 34px; padding-bottom: 30px;
  backdrop-filter: blur(4px);
}

/* pulsante ritorno al hub — visibile solo dentro le sezioni */
.back-hub { display: none; position: fixed; top: 64px; left: 20px; z-index: 45;
  background: rgba(10,10,10,.8); border: 1px solid var(--border); color: var(--muted);
  font-family: var(--font-mono); font-size: .65rem; letter-spacing: .08em; text-transform: uppercase;
  padding: 9px 14px; border-radius: 8px; cursor: pointer; backdrop-filter: blur(4px); }
.back-hub:hover { color: #fff; border-color: #555; }
body:not([data-sec="home"]) .back-hub { display: inline-flex; }

/* bobina/filo: solo dentro le sezioni, mai nel hub */
body[data-sec="home"] #spool, body[data-sec="home"] #filamentLine { display: none; }

/* hub: titolo ancorato in basso a sinistra, compatto — non copre gli oggetti/etichette */
#sec-home.active { align-items: flex-end; }
#sec-home .home-hero { padding: 0 24px 7vh; max-width:1100px; width:100%; margin:0 auto; }
#sec-home .hub-title { font-size: clamp(2.2rem, 5.5vw, 4.2rem); }
#sec-home .hub-title .hub-fill { font-size: 0.34em; }


/* form mail unico (sezione render/real time) */
.mailbox textarea { width: 100%; background: rgba(0,0,0,.45); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font-mono); font-size: .85rem; padding: 14px;
  border-radius: 8px; resize: vertical; outline: none; }
.mailbox textarea:focus { border-color: var(--grey); }


/* ── override industriale: angoli squadrati, niente pill/rounded ── */
.btn, .badge, .mono-tag, .dropzone, .result,
.mailbox textarea, .params select, .params input, .file-chip { border-radius: 2px !important; }
.gc-sw { border-radius: 12px !important; }
.gc-sw i { border-radius: 50% !important; }

/* bobina: su schermi stretti sta a destra, lontana dal testo */
@media (max-width: 720px) {
  #spool { transform: scale(.78); transform-origin: bottom right; }
}


/* estrusione "a tasto": solo sui cliccabili, le superfici grandi diventano bande piatte */
.dropzone { border: 1px solid #3a3a3a; box-shadow: 6px 6px 0 rgba(0,0,0,.55); }
.btn { border: 1px solid #444 !important; box-shadow: 4px 4px 0 rgba(0,0,0,.65); }
.btn:active { transform: translate(3px,3px); box-shadow: 1px 1px 0 rgba(0,0,0,.65); }
.vt-btn:active, .link-btn:active { transform: translate(1px,1px); }
.badge { box-shadow: 3px 3px 0 rgba(0,0,0,.5); }


/* ════════════════════════════════════════════════════════════════════
   REDESIGN C — split asimmetrico, contrasti e negativi. Niente card:
   bande piene chiaro/scuro, tipografia che lavora, linee dure.
   ════════════════════════════════════════════════════════════════════ */

/* testata sezione: titolo a sinistra, lede a destra in basso, linea verticale */
.view-head {
  display: grid; grid-template-columns: 1fr 0.9fr; gap: 0; align-items: end;
  border-bottom: 2px solid var(--text); padding: 74px 0 34px;
}
.view-head .kicker { grid-column: 1 / -1; }
.view-head .view-title { margin-bottom: 0; font-size: clamp(2.8rem, 8vw, 6rem); }
.view-head .lede {
  border-left: 1px solid var(--border); padding-left: 28px; margin-left: 28px;
  font-size: 0.98rem; max-width: none;
}

/* studio: bande piene alternate — la prima è il NEGATIVO (chiara, testo nero) */
.studio-grid { border-top: none; margin-bottom: 72px;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 0; }
.studio-card {
  display: block; border: none; border-radius: 0; padding: 40px 34px;
  transition: none; margin: 0; border-bottom: none;
}
.studio-card:nth-child(odd) { background: var(--grey); color: #0a0a0a; }
.studio-card:nth-child(even) { background: #141414; color: var(--text); }
.studio-card:hover { background: var(--grey); transform: none; }
.studio-card:nth-child(even):hover { background: #181818; }
.studio-card:nth-child(odd) h3 { color: #0a0a0a; }
.studio-card:nth-child(odd) > p { color: #1c1c1c; }
.studio-card:nth-child(odd) .card-index { -webkit-text-stroke-color: #0a0a0a55; }
.studio-card:nth-child(odd) .mono-list,
.studio-card:nth-child(odd) .mono-list li { color: #222; border-color: #0a0a0a33; }
.studio-card:nth-child(odd) .mono-list li::before { color: #0a0a0a; }
.card-index { font-size: 2.2rem; margin-bottom: 14px; }

/* preventivatore: asimmetria marcata; il RISULTATO è il negativo */
.quote-grid { grid-template-columns: 1.25fr 0.75fr; gap: 30px; }
.quote-right .result {
  background: var(--grey); color: #0a0a0a; border: none; border-radius: 0;
  padding: 22px; box-shadow: none;
}
.quote-right .result .result-empty,
.quote-right .result .result-empty span { color: #1c1c1c; }
.quote-right .result dt { color: #333; }
.quote-right .result dd { color: #0a0a0a; }
.quote-right .result .result-rows > div { border-color: #0a0a0a2b; }
.quote-right .result .price-row dd { color: #000; }
.quote-right .result .result-note { color: #2a2a2a; }
.quote-right .result .stl-hint, .quote-right .result .layer-count { color: #333; }
.quote-right .result .stl-view { background: #0d0d0d; border: 2px solid #0a0a0a; }
.quote-right .result .btn.primary { background: #0a0a0a; color: var(--grey); border-color: #0a0a0a !important; }
.quote-right .result .btn.primary:hover { background: transparent; color: #0a0a0a; }
.quote-right .result .btn.ghost { color: #0a0a0a; border-color: #0a0a0a55 !important; box-shadow: 4px 4px 0 rgba(0,0,0,.25); }

/* etichette pill piene → outline dure */
.mono-tag { background: none; color: var(--text); border: 1px solid var(--text); border-radius: 0; }

/* mailbox: banda con lama bianca a sinistra */
.mailbox { border-left: 6px solid var(--text); padding-left: 26px; }
.mailbox textarea { box-shadow: none; border: 1px solid #3a3a3a; }

/* mobile: le colonne collassano */
@media (max-width: 760px) {
  .view-head { grid-template-columns: 1fr; }
  .view-head .lede { border-left: none; padding-left: 0; margin-left: 0; margin-top: 18px; }
  .studio-grid { grid-template-columns: 1fr; }
}
