/* ─────────────────────────────────────────────────────────────
   LSP — Atelier delle Misure
   Direzione estetica: "Editorial Print Atelier"
   Tipografia: Filson Pro (display/UI) + Fraunces (editorial accent)
   Brand: viola #5A2E90, oro #FCD627
   ───────────────────────────────────────────────────────────── */

@font-face { font-family: 'Filson Pro'; src: url('assets/fonts/FilsonProLight.ttf')   format('truetype'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Filson Pro'; src: url('assets/fonts/FilsonProRegular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Filson Pro'; src: url('assets/fonts/FilsonProBold.ttf')    format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Filson Pro'; src: url('assets/fonts/FilsonProHeavy.ttf')   format('truetype'); font-weight: 900; font-style: normal; font-display: swap; }

:root {
  /* ── Brand core ── */
  --lsp-purple: #5A2E90;
  --lsp-purple-light: #8B5FBF;
  --lsp-purple-dark: #2A1248;
  --lsp-purple-deep: #1A0B30;
  --lsp-gold: #FCD627;
  --lsp-gold-warm: #F5A623;
  --lsp-gold-soft: rgba(252, 214, 39, 0.85);
  --lsp-black: #0A0612;
  --lsp-ink: #1A1428;
  --lsp-white: #FFFFFF;

  /* ── Vellum (plate paper) ── */
  --vellum: #F4ECD8;
  --vellum-dark: #E8DCC0;
  --vellum-shadow: #8B7B5C;
  --vellum-rule: #2D2A24;
  --vellum-text: #2D2A24;
  --vellum-text-light: #6B5F4A;
  --plate-cut: #2D2A24;
  --plate-bleed: #C73E3A;
  --plate-bleed-fill: rgba(199, 62, 58, 0.06);
  --plate-safe: #7A6F5C;
  --plate-spine: #5A4F40;

  /* ── Typography ── */
  --fnt-display: 'Filson Pro', 'Poppins', system-ui, sans-serif;
  --fnt-editorial: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --fnt-mono: 'Filson Pro', system-ui, sans-serif; /* tight numeric */

  /* ── Misc ── */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --gold-rule: linear-gradient(90deg, transparent, var(--lsp-gold) 20%, var(--lsp-gold) 80%, transparent);
}

* { box-sizing: border-box; }
*::selection { background: var(--lsp-gold); color: var(--lsp-purple-deep); }

html, body {
  margin: 0; padding: 0;
  font-family: var(--fnt-display);
  color: rgba(255,255,255,0.92);
  background: var(--lsp-black);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 90% 60% at 15% -5%,   rgba(90,46,144,0.45), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 20%,  rgba(252,214,39,0.05), transparent 60%),
    radial-gradient(ellipse 60% 60% at 50% 100%,  rgba(139,95,191,0.18), transparent 65%),
    linear-gradient(180deg, #16091F 0%, #0A0612 60%, #06030D 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Grain overlay */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  width: 100vw; height: 100vh; opacity: 0.18;
  mix-blend-mode: overlay;
}

a { color: inherit; }
em { font-family: var(--fnt-editorial); font-style: italic; font-weight: 400; }

/* ─────────────────────────────────────────────────────────────
   TOPBAR
   ───────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 6, 18, 0.72);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid rgba(252,214,39,0.10);
}
.topbar-inner {
  max-width: 1320px; margin: 0 auto;
  padding: 16px clamp(20px, 4vw, 48px);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 16px;
  text-decoration: none; color: inherit;
  position: relative;
}
.brand::after {
  content: ""; position: absolute; right: -16px; top: 50%;
  width: 1px; height: 32px; transform: translateY(-50%);
  background: linear-gradient(180deg, transparent, rgba(252,214,39,0.25), transparent);
}
.brand img { height: 44px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: var(--fnt-editorial);
  font-weight: 500; font-style: italic;
  font-size: 17px; letter-spacing: -0.01em;
  color: var(--lsp-white);
}
.brand-sub {
  font-family: var(--fnt-display);
  font-size: 10.5px; color: var(--lsp-gold);
  font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase;
  margin-top: 3px;
}

.topbar-meta {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--fnt-display);
  font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase;
}
.meta-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--lsp-gold);
  box-shadow: 0 0 12px var(--lsp-gold);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }
.meta-label { color: rgba(255,255,255,0.45); font-weight: 500; }
.meta-value {
  color: var(--lsp-white); font-weight: 700;
  font-family: var(--fnt-editorial); font-style: italic;
  letter-spacing: 0.02em; text-transform: none; font-size: 13px;
}
.meta-divider { width: 1px; height: 14px; background: rgba(255,255,255,0.15); }
@media (max-width: 720px) {
  .topbar-meta { display: none; }
}

/* ─────────────────────────────────────────────────────────────
   SIDE RAIL (vertical decorative)
   ───────────────────────────────────────────────────────────── */
.side-rail {
  position: fixed;
  left: 22px; top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left center;
  z-index: 5;
  display: flex; align-items: center; gap: 16px;
  font-family: var(--fnt-display);
  font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase;
  color: rgba(252, 214, 39, 0.55);
  white-space: nowrap;
}
.rail-line { width: 60px; height: 1px; background: linear-gradient(90deg, transparent, currentColor); }
.side-rail .rail-line:last-child { background: linear-gradient(90deg, currentColor, transparent); }
@media (max-width: 1100px) { .side-rail { display: none; } }

/* ─────────────────────────────────────────────────────────────
   CONTAINER
   ───────────────────────────────────────────────────────────── */
.container {
  position: relative; z-index: 2;
  max-width: 1320px; margin: 0 auto;
  padding: clamp(40px, 7vw, 96px) clamp(20px, 4vw, 48px) 80px;
}

/* Reveal animations */
[data-reveal] {
  opacity: 0; transform: translateY(24px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
}
[data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ─────────────────────────────────────────────────────────────
   HERO
   ───────────────────────────────────────────────────────────── */
.hero { margin-bottom: clamp(48px, 7vw, 80px); }

.hero-grid {
  display: grid; grid-template-columns: 1fr 220px; gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; } }

.kicker {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--fnt-display); font-size: 11px;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--lsp-gold);
  margin: 0 0 28px;
}
.kicker-num { font-family: var(--fnt-editorial); font-style: italic; font-size: 14px; letter-spacing: 0.04em; text-transform: none; color: var(--lsp-gold); }
.kicker-line { width: 36px; height: 1px; background: currentColor; }
.kicker-text { font-weight: 500; }

.hero h1 {
  font-family: var(--fnt-display);
  font-weight: 900;
  font-size: clamp(36px, 6.4vw, 86px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0 0 32px;
  color: var(--lsp-white);
  text-wrap: balance;
  max-width: 14ch;
}
.hero h1 em {
  font-family: var(--fnt-editorial);
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  color: var(--lsp-gold);
  letter-spacing: -0.02em;
}

.lead {
  font-family: var(--fnt-editorial);
  font-weight: 400; font-style: normal;
  font-size: clamp(15px, 1.35vw, 19px); line-height: 1.55;
  color: rgba(255,255,255,0.72); max-width: 52ch;
  margin: 0 0 40px;
  font-variation-settings: "opsz" 30;
}
.lead-em {
  font-style: italic; color: var(--lsp-white);
  font-variation-settings: "SOFT" 100, "opsz" 36;
}

.hero-meta {
  display: flex; gap: clamp(24px, 4vw, 56px);
  align-items: flex-end;
  border-top: 1px solid rgba(252,214,39,0.18);
  padding-top: 22px;
  max-width: 540px;
}
.hmeta { display: flex; flex-direction: column; gap: 4px; }
.hmeta-num {
  font-family: var(--fnt-editorial);
  font-style: italic; font-weight: 500;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1; color: var(--lsp-gold);
  font-variation-settings: "SOFT" 100, "opsz" 96;
  letter-spacing: -0.02em;
}
.hmeta-label {
  font-family: var(--fnt-display); font-size: 10.5px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255,255,255,0.5); font-weight: 500;
}

/* COLOPHON / SEAL */
.colophon {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding-top: 8px;
  color: var(--lsp-gold);
}
.colophon-stamp {
  width: 110px; height: 110px;
  animation: rotate 60s linear infinite;
}
@keyframes rotate { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .colophon-stamp { animation: none; } }
.seal { width: 100%; height: 100%; color: var(--lsp-gold); opacity: 0.85; }
.colophon-text {
  font-family: var(--fnt-editorial);
  font-size: 12px; line-height: 1.55;
  color: rgba(255,255,255,0.55);
  text-align: center; max-width: 220px;
  font-variation-settings: "opsz" 12;
}
.colophon-text em { color: var(--lsp-gold); }
@media (max-width: 880px) { .colophon { flex-direction: row; justify-content: flex-start; } .colophon-text { text-align: left; } }

/* DIVIDER (gold rule with terminator dots) */
.divider {
  border: none; height: 1px;
  background: var(--gold-rule);
  margin: clamp(40px, 6vw, 72px) 0;
  position: relative;
}
.divider::before, .divider::after {
  content: ""; position: absolute; top: 50%;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--lsp-gold);
  transform: translateY(-50%);
  box-shadow: 0 0 12px var(--lsp-gold);
}
.divider::before { left: 0; }
.divider::after  { right: 0; }

/* ─────────────────────────────────────────────────────────────
   PANEL CONVENTION
   ───────────────────────────────────────────────────────────── */
.panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.015) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: clamp(20px, 2.4vw, 32px);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
}

.panel-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(252,214,39,0.15);
}
.panel-num {
  font-family: var(--fnt-editorial);
  font-style: italic; font-weight: 400;
  font-size: 36px; line-height: 1;
  color: var(--lsp-gold);
  font-variation-settings: "SOFT" 100, "opsz" 96;
  letter-spacing: -0.04em;
}
.panel-head h2 {
  font-family: var(--fnt-display);
  font-weight: 700; font-size: 12px;
  letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--lsp-white); margin: 0;
}
.panel-head p {
  font-family: var(--fnt-editorial); font-size: 13px;
  color: rgba(255,255,255,0.55); margin: 4px 0 0;
  font-variation-settings: "opsz" 12;
}

/* ─────────────────────────────────────────────────────────────
   APP GRID
   ───────────────────────────────────────────────────────────── */
.app-grid {
  display: grid; grid-template-columns: 360px 1fr; gap: 28px;
}
@media (max-width: 1020px) { .app-grid { grid-template-columns: 1fr; } }

/* ── Form fields ─────────────────────────────────────────── */
.field { margin-bottom: 24px; }
.field label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-family: var(--fnt-display); font-weight: 500;
  font-size: 12px; letter-spacing: 0.10em; text-transform: uppercase;
  color: rgba(255,255,255,0.85); margin-bottom: 10px;
}
.field-num {
  font-family: var(--fnt-editorial);
  font-style: italic; font-weight: 400;
  font-size: 16px; letter-spacing: 0; text-transform: lowercase;
  color: var(--lsp-gold); margin-right: 8px;
  font-variation-settings: "SOFT" 100, "opsz" 24;
}
.hint {
  font-family: var(--fnt-editorial); font-style: italic;
  font-size: 11.5px; color: rgba(255,255,255,0.50);
  font-weight: 400; letter-spacing: 0; text-transform: none;
}

select, input[type="number"] {
  width: 100%;
  font-family: var(--fnt-display); font-weight: 500;
  font-size: 15px;
  color: var(--lsp-white);
  background: rgba(10, 6, 18, 0.65);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 14px 16px;
  min-height: 50px;
  outline: none;
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease), background 200ms var(--ease);
  appearance: none; -webkit-appearance: none;
}
select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--lsp-gold) 50%),
    linear-gradient(135deg, var(--lsp-gold) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
  cursor: pointer;
}
select option { background: var(--lsp-purple-deep); color: var(--lsp-white); }
select:hover, input[type="number"]:hover { border-color: rgba(252,214,39,0.30); }
select:focus, input[type="number"]:focus {
  border-color: var(--lsp-gold);
  box-shadow: 0 0 0 4px rgba(252,214,39,0.14);
  background: rgba(10, 6, 18, 0.85);
}

.page-row { display: grid; grid-template-columns: 50px 1fr 50px; gap: 8px; }
.step {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(252,214,39,0.08); color: var(--lsp-gold);
  border: 1px solid rgba(252,214,39,0.22);
  border-radius: 12px;
  cursor: pointer; min-height: 50px;
  transition: all 200ms var(--ease);
}
.step:hover { background: var(--lsp-gold); color: var(--lsp-purple); transform: translateY(-1px); }
.step:active { transform: translateY(0); }
.step svg { display: block; }

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { text-align: center; font-family: var(--fnt-editorial); font-style: italic; font-variation-settings: "opsz" 30; font-size: 18px; }

.warn {
  margin: 10px 0 0; font-size: 12px;
  color: var(--lsp-gold); font-family: var(--fnt-editorial); font-style: italic;
  padding: 10px 12px; background: rgba(252,214,39,0.08);
  border-left: 2px solid var(--lsp-gold); border-radius: 4px;
}

/* ── Unit toggle (segmented) ─────────────────────────────── */
.unit-toggle {
  position: relative;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(10, 6, 18, 0.55);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 5px; border-radius: 12px;
  margin: 28px 0 24px;
  overflow: hidden;
}
.unit-btn {
  position: relative; z-index: 1;
  font-family: var(--fnt-editorial);
  font-style: italic; font-weight: 500; font-size: 14px;
  letter-spacing: 0.04em; text-transform: lowercase;
  background: transparent; color: rgba(255,255,255,0.55);
  border: none; border-radius: 8px; padding: 11px 8px;
  cursor: pointer; transition: color 250ms var(--ease);
  font-variation-settings: "SOFT" 100, "opsz" 24;
}
.unit-btn:hover { color: var(--lsp-white); }
.unit-btn.is-active { color: var(--lsp-purple); font-weight: 700; }
.unit-indicator {
  position: absolute; z-index: 0;
  top: 5px; bottom: 5px; left: 5px;
  width: calc((100% - 10px) / 3);
  background: var(--lsp-gold);
  border-radius: 8px;
  transition: transform 400ms var(--ease-spring);
  box-shadow: 0 4px 16px rgba(252,214,39,0.30);
}

/* Plate empty-state */
.plate-empty {
  width: 100%; padding: 60px 20px; text-align: center;
}
.plate-empty p {
  font-family: var(--fnt-editorial); font-style: italic;
  font-size: 20px; color: var(--vellum-text); margin: 0;
  font-variation-settings: "SOFT" 100, "opsz" 36;
}
.plate-empty-sub {
  font-family: var(--fnt-display) !important; font-style: normal !important;
  font-size: 12px !important;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--vellum-text-light) !important; margin-top: 14px !important;
}

/* ── Summary block ───────────────────────────────────────── */
.summary-block { margin-top: 28px; position: relative; }
.summary-rule {
  display: block; width: 100%; height: 1px;
  background: linear-gradient(90deg, var(--lsp-gold) 0%, var(--lsp-gold) 40px, rgba(252,214,39,0.15) 40px);
  margin-bottom: 18px;
}
.summary-block h3 {
  font-family: var(--fnt-display); font-weight: 700;
  font-size: 10.5px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--lsp-gold); margin: 0 0 12px;
}
.statement {
  font-family: var(--fnt-editorial); font-style: italic;
  font-weight: 400; font-size: 18px; line-height: 1.35;
  color: var(--lsp-white); margin: 0 0 8px;
  font-variation-settings: "SOFT" 80, "opsz" 30;
  text-wrap: balance;
}
.statement-sub {
  font-family: var(--fnt-display); font-weight: 400;
  font-size: 12px; line-height: 1.5; color: rgba(255,255,255,0.55);
  letter-spacing: 0.04em; margin: 0;
}

/* ─────────────────────────────────────────────────────────────
   RESULTS — Specimen + Cards
   ───────────────────────────────────────────────────────────── */
.results { display: flex; flex-direction: column; }

/* ── HERO RESULT: spine width as type specimen ───────────── */
.specimen {
  position: relative;
  background: linear-gradient(135deg, rgba(252,214,39,0.10) 0%, rgba(245,166,35,0.04) 100%);
  border: 1px solid rgba(252,214,39,0.28);
  border-radius: 16px;
  padding: clamp(24px, 3vw, 36px);
  margin-bottom: 20px;
  overflow: hidden;
}
.specimen::before {
  content: "Spine"; position: absolute;
  top: 50%; right: -40px; transform: translateY(-50%) rotate(90deg); transform-origin: center;
  font-family: var(--fnt-editorial); font-style: italic;
  font-size: 110px; line-height: 1; opacity: 0.04;
  color: var(--lsp-gold);
  font-variation-settings: "SOFT" 100, "opsz" 144;
  pointer-events: none;
}
.specimen-header {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  border-bottom: 1px solid rgba(252,214,39,0.18);
  padding-bottom: 14px; margin-bottom: 20px;
}
.specimen-label {
  font-family: var(--fnt-display); font-weight: 700;
  font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--lsp-gold);
}
.specimen-helper {
  font-family: var(--fnt-editorial); font-style: italic;
  font-size: 13px; color: rgba(255,255,255,0.55);
  font-variation-settings: "opsz" 12;
}
.specimen-value {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: 18px;
}
.specimen-number {
  font-family: var(--fnt-editorial); font-style: italic;
  font-weight: 500;
  font-size: clamp(54px, 9vw, 110px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--lsp-white);
  font-variation-settings: "SOFT" 100, "opsz" 144;
  background: linear-gradient(180deg, var(--lsp-white) 0%, var(--lsp-gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: all 400ms var(--ease);
}
.specimen-footer {
  display: flex; align-items: center; gap: 14px;
  padding-top: 16px; border-top: 1px dashed rgba(252,214,39,0.18);
}
.specimen-tick {
  width: 24px; height: 1px; background: var(--lsp-gold);
}
.specimen-meta {
  font-family: var(--fnt-display); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.6); font-weight: 500;
}

/* ── Card grid ───────────────────────────────────────────── */
.result-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 720px) { .result-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px) { .result-cards { grid-template-columns: 1fr; } }

.card {
  position: relative;
  background: rgba(10, 6, 18, 0.55);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 18px 18px 16px;
  display: flex; flex-direction: column;
  gap: 8px;
  transition: all 280ms var(--ease);
  overflow: hidden;
}
.card::after {
  content: ""; position: absolute; left: 18px; right: 18px; bottom: 14px;
  height: 1px; background: var(--lsp-gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform 400ms var(--ease);
}
.card:hover {
  border-color: rgba(252,214,39,0.35);
  background: rgba(10, 6, 18, 0.75);
  transform: translateY(-3px);
}
.card:hover::after { transform: scaleX(1); }
.card.span2 { grid-column: span 2; }
@media (max-width: 720px) { .card.span2 { grid-column: span 2; } }
@media (max-width: 440px) { .card.span2 { grid-column: span 1; } }

.card-label {
  font-family: var(--fnt-display); font-weight: 500;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  line-height: 1.3;
}
.card-label em {
  font-family: var(--fnt-editorial); font-style: italic;
  font-size: 11px; letter-spacing: 0;
  color: rgba(255,255,255,0.4); text-transform: lowercase;
  margin-left: 4px;
}
.card-value {
  font-family: var(--fnt-editorial); font-style: italic;
  font-weight: 500; font-size: 22px;
  color: var(--lsp-white); letter-spacing: -0.01em;
  line-height: 1.15;
  font-variation-settings: "SOFT" 100, "opsz" 36;
  margin-top: auto;
}

/* ─────────────────────────────────────────────────────────────
   PLATE — diagram on vellum
   ───────────────────────────────────────────────────────────── */
.plate-section { margin-top: 8px; }

.plate-head {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  justify-content: space-between; gap: 24px;
  margin-bottom: 28px;
}
.plate-head-left { display: flex; align-items: flex-start; gap: 14px; }
.plate-head-left h2 {
  font-family: var(--fnt-display); font-weight: 700;
  font-size: 12px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--lsp-white); margin: 8px 0 4px;
}
.plate-sub {
  font-family: var(--fnt-editorial); font-style: italic;
  font-size: 13px; color: rgba(255,255,255,0.55);
  margin: 0; max-width: 56ch;
  font-variation-settings: "opsz" 12;
}

.tabs {
  display: flex; gap: 4px;
  background: rgba(10, 6, 18, 0.5);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
}
.tab {
  font-family: var(--fnt-display); font-weight: 500;
  font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase;
  background: transparent; color: rgba(255,255,255,0.55);
  border: none; border-radius: 8px;
  padding: 10px 16px; cursor: pointer;
  transition: all 250ms var(--ease);
}
.tab:hover { color: var(--lsp-white); }
.tab.is-active {
  background: var(--lsp-gold); color: var(--lsp-purple);
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(252,214,39,0.25);
}

/* PLATE — superficie vellum cream pulita (no viola; il brand sta dentro il template SVG) */
.plate {
  position: relative;
  background:
    radial-gradient(ellipse 100% 80% at 50% 0%, rgba(255,255,255,0.08), transparent 70%),
    linear-gradient(180deg, var(--vellum) 0%, var(--vellum-dark) 100%);
  border-radius: 4px;
  padding: 38px 40px 30px;
  box-shadow:
    0 30px 80px -20px rgba(0,0,0,0.7),
    0 10px 40px -10px rgba(0,0,0,0.5),
    inset 0 0 0 1px rgba(45, 42, 36, 0.12);
  color: var(--vellum-text);
  overflow: hidden;
}
.plate::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(45, 42, 36, 0.08) 1px, transparent 1px);
  background-size: 6px 6px;
  pointer-events: none;
  opacity: 0.7;
}
.plate::after {
  content: ""; position: absolute; inset: 0;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400'><filter id='n'><feTurbulence baseFrequency='0.85' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.18  0 0 0 0 0.16  0 0 0 0 0.14  0 0 0 0.08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
  pointer-events: none; mix-blend-mode: multiply;
  opacity: 0.35;
}

/* Watermark/signature HTML rimossi — il brand sta DENTRO il template SVG */
.plate-watermark, .plate-signature { display: none !important; }

/* Registration marks (corners) */
.reg {
  position: absolute; width: 22px; height: 22px;
  pointer-events: none; z-index: 2;
  color: var(--vellum-rule); opacity: 0.55;
}
.reg::before, .reg::after {
  content: ""; position: absolute; background: currentColor;
}
.reg::before { width: 100%; height: 1px; top: 50%; left: 0; }
.reg::after  { width: 1px; height: 100%; left: 50%; top: 0; }
.reg-tl { top: 14px; left: 14px; }
.reg-tr { top: 14px; right: 14px; }
.reg-bl { bottom: 14px; left: 14px; }
.reg-br { bottom: 14px; right: 14px; }

/* PLATE META (top labels) */
.plate-meta {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  border-bottom: 1px solid rgba(45,42,36,0.20);
  padding-bottom: 14px; margin-bottom: 24px;
  position: relative; z-index: 1;
}
.plate-tag {
  font-family: var(--fnt-display); font-weight: 700;
  font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--plate-bleed);
  background: rgba(199, 62, 58, 0.08);
  padding: 5px 10px; border-radius: 4px;
  border: 1px solid rgba(199, 62, 58, 0.20);
}
.plate-title {
  font-family: var(--fnt-editorial); font-style: italic;
  font-weight: 500; font-size: 19px;
  color: var(--vellum-text);
  font-variation-settings: "SOFT" 100, "opsz" 36;
}
.plate-id {
  font-family: var(--fnt-display); font-weight: 500;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--vellum-text-light);
}

.plate-stage {
  width: 100%; display: flex; justify-content: center;
  padding: 20px 0;
  position: relative; z-index: 1;
  min-height: 320px;
}
.plate-stage svg { max-width: 100%; height: auto; display: block; }

/* PLATE FOOTER */
.plate-footer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
  justify-content: space-between;
  border-top: 1px solid rgba(45,42,36,0.20);
  padding-top: 16px; margin-top: 16px;
  position: relative; z-index: 1;
}
.legend { display: flex; flex-wrap: wrap; gap: 18px; }
.legend-item {
  font-family: var(--fnt-display); font-weight: 500;
  font-size: 10.5px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--vellum-text-light);
  display: inline-flex; align-items: center; gap: 8px;
}
.lg { display: inline-block; width: 24px; height: 2px; }
.lg-trim   { background: var(--plate-cut); }
.lg-bleed  { background: var(--plate-bleed); }
.lg-safe   { background: repeating-linear-gradient(90deg, var(--plate-safe) 0 4px, transparent 4px 8px); }
.lg-spine  { background: repeating-linear-gradient(90deg, var(--plate-spine) 0 3px, transparent 3px 6px); }

.export-col { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.export-row { display: flex; gap: 8px; }
.export-hint {
  font-family: var(--fnt-editorial); font-style: italic;
  font-size: 11px; color: var(--vellum-text-light);
  margin: 0; max-width: 32ch; text-align: right;
  font-variation-settings: "opsz" 12;
}
@media (max-width: 640px) { .export-col { align-items: stretch; } .export-hint { text-align: left; max-width: none; } }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--fnt-display); font-weight: 700;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 11px 18px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer;
  transition: all 250ms var(--ease);
}
.btn svg { display: block; }
.btn.primary {
  background: var(--vellum-text); color: var(--vellum);
}
.btn.primary:hover {
  background: var(--lsp-purple); color: var(--lsp-gold);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(90, 46, 144, 0.40);
}
.btn.ghost {
  background: transparent; color: var(--vellum-text);
  border-color: rgba(45,42,36,0.30);
}
.btn.ghost:hover {
  border-color: var(--vellum-text); background: rgba(45,42,36,0.06);
}

/* ─────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────── */
.site-footer {
  position: relative; z-index: 2;
  border-top: 1px solid rgba(252,214,39,0.12);
  margin-top: 60px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.4));
}
.footer-inner {
  max-width: 1320px; margin: 0 auto;
  padding: 40px clamp(20px, 4vw, 48px);
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  font-family: var(--fnt-display); font-size: 12px;
  color: rgba(255,255,255,0.5); line-height: 1.65;
}
@media (max-width: 640px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-col p { margin: 0; }
.footer-logo { height: 36px; margin-bottom: 14px; opacity: 0.85; }
.footer-col strong { color: var(--lsp-white); font-weight: 700; }
.footer-right { text-align: right; }
@media (max-width: 640px) { .footer-right { text-align: left; } }
.footer-meta {
  font-family: var(--fnt-editorial); font-style: italic;
  font-size: 14px; color: var(--lsp-gold);
  margin-bottom: 12px !important;
  font-variation-settings: "SOFT" 100, "opsz" 24;
}
.footer-right a {
  color: var(--lsp-gold); text-decoration: none; font-weight: 500;
  border-bottom: 1px solid rgba(252,214,39,0.30);
  transition: border-color 200ms var(--ease);
}
.footer-right a:hover { border-color: var(--lsp-gold); }

/* ─────────────────────────────────────────────────────────────
   SVG (plate) — visual rules for the technical drawing
   These map to classes generated by diagram.js
   ───────────────────────────────────────────────────────────── */
.svg-trim       { fill: rgba(45,42,36,0.02); stroke: var(--plate-cut); stroke-width: 1.6; }
.svg-bleed-fill { fill: var(--plate-bleed-fill); stroke: var(--plate-bleed); stroke-width: 1.6; }
.svg-bleed-line { stroke: var(--plate-bleed); stroke-width: 1.6; fill: none; }
.svg-trim-line  { stroke: var(--plate-cut); stroke-width: 1.6; fill: none; }
.svg-safe       { fill: none; stroke: var(--plate-safe); stroke-width: 1.2; stroke-dasharray: 6 4; }
.svg-spine-line { stroke: var(--plate-spine); stroke-width: 1.4; stroke-dasharray: 5 3; fill: none; }
.svg-fold       { stroke: var(--plate-spine); stroke-width: 1; stroke-dasharray: 3 3; fill: none; opacity: 0.7; }
.svg-barcode    { fill: rgba(45,42,36,0.08); stroke: var(--plate-cut); stroke-width: 1; stroke-dasharray: 2 2; }
.svg-arrow      { stroke: var(--plate-bleed); stroke-width: 1.3; fill: none; }
.svg-arrow-head { fill: var(--plate-bleed); }
.svg-label {
  font-family: var(--fnt-editorial); font-style: italic; font-weight: 600;
  font-size: 22px; fill: var(--plate-bleed);
  font-variation-settings: "SOFT" 100, "opsz" 36;
  paint-order: stroke fill;
  stroke: rgba(244, 236, 216, 0.85); stroke-width: 3.5;
}
.svg-label-white {
  font-family: var(--fnt-display); font-weight: 700;
  font-size: 14px; fill: var(--vellum-text-light);
  letter-spacing: 0.14em; text-transform: uppercase;
}
.svg-zone-label {
  font-family: var(--fnt-display); font-weight: 700;
  font-size: 16px; fill: var(--vellum-text-light);
  letter-spacing: 0.22em; text-transform: uppercase;
  opacity: 0.78;
}
.svg-placeholder-title {
  font-family: var(--fnt-editorial); font-style: italic; font-weight: 500;
  font-size: 42px; fill: var(--vellum-shadow); opacity: 0.38;
  font-variation-settings: "SOFT" 100, "opsz" 96;
}
.svg-placeholder-sub {
  font-family: var(--fnt-editorial); font-style: italic; font-weight: 400;
  font-size: 16px; fill: var(--vellum-shadow); opacity: 0.4;
}
.svg-spine-text {
  font-family: var(--fnt-display); font-weight: 700;
  font-size: 12px; fill: var(--vellum-shadow); opacity: 0.45;
  letter-spacing: 0.20em; text-transform: uppercase;
}
.svg-divider { stroke: var(--plate-bleed); stroke-width: 0.6; stroke-dasharray: 2 3; fill: none; }
.svg-reg-corner { stroke: var(--vellum-text); stroke-width: 0.8; fill: none; opacity: 0.6; }
