:root {
  --bg: #090909;
  --bg-soft: #111111;
  --panel: rgba(16, 16, 16, 0.88);
  --panel-strong: #161616;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f1ebe4;
  --muted: #c0b7ae;
  --accent: #b1251a;
  --accent-soft: #e0483b;
  --gold: #ae8961;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 22px;
  --content-width: 1180px;
  --font-body: Georgia, "Times New Roman", serif;
  --font-display: "Palatino Linotype", "Book Antiqua", Garamond, Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(177, 37, 26, 0.18), transparent 32%),
    linear-gradient(180deg, #050505 0%, #0d0d0d 50%, #070707 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.site-shell {
  min-height: 100vh;
}

.topbar,
.hero-grid,
.section,
.section-banner {
  width: min(calc(100% - 2rem), var(--content-width));
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0 0;
}

.brand,
.eyebrow,
.card-label,
.topbar-links a {
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand {
  font-size: 0.95rem;
  color: var(--gold);
}

.topbar-links {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.hero {
  padding-bottom: 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.85fr;
  gap: 2rem;
  align-items: end;
  padding: 5rem 0 2rem;
}

.eyebrow {
  color: var(--gold);
  font-size: 0.8rem;
  margin: 0 0 1rem;
}

h1,
h2,
h3,
p,
blockquote {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  text-wrap: balance;
  color: #f5efe8;
}

h1 {
  font-size: clamp(1.05rem, 1.9vw, 1.7rem);
  line-height: 1.0;
  letter-spacing: 0.01em;
  margin-bottom: 0.85rem;
  white-space: nowrap;
  max-width: 14ch;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

h2 {
  font-size: clamp(1.4rem, 2.4vw, 2.1rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
  margin-bottom: 0.7rem;
  max-width: 22ch;
}

h3 {
  font-size: clamp(0.95rem, 1.1vw, 1.08rem);
  line-height: 1.15;
  margin-bottom: 0.55rem;
  letter-spacing: 0.04em;
}

h1 .r, h2 .r, h3 .r {
  color: var(--accent-soft);
}

.lead,
.story-grid p,
.author-panel p,
.banner-copy p,
.newsletter-layout p,
.feature-card p,
.section-intro {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--muted);
}

.section-intro {
  max-width: 58rem;
  margin-bottom: 0;
}

.hero-actions,
.banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2rem 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.8rem 1.3rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  color: #fff7f4;
}

.button-secondary {
  background: transparent;
  border-color: rgba(241, 235, 228, 0.24);
}

.button-disabled,
.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* store logos row */
.store-logos {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  flex-wrap: wrap;
}

.store-logo-link {
  display: inline-flex;
  align-items: center;
  opacity: 0.82;
  transition: opacity 220ms ease, transform 280ms cubic-bezier(.22,.68,0,1.2), filter 220ms ease;
}

.store-logo-link:hover {
  opacity: 1;
  transform: translateY(-3px) scale(1.06);
  filter: brightness(1.3) drop-shadow(0 0 8px rgba(255,255,255,0.35));
}

.store-logo {
  height: 2rem;
  width: auto;
  display: block;
}

.store-logo--amazon {
  height: 2rem;
}

/* IBS: colori grigi/dorati → bianco */
.store-logo--ibs {
  height: 1.9rem;
  filter: brightness(0) invert(1);
}

/* Il Libraio: rosso → bianco */
.store-logo--libraio {
  height: 1.5rem;
  filter: brightness(0) invert(1);
}

.hero-points,
.checklist {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.7;
}

.hero-card,
.feature-card,
.author-panel,
.newsletter-form,
.pull-quote,
.book-spread {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 1rem;
}

.book-cover {
  position: relative;
  width: min(100%, 310px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: calc(var(--radius) - 8px);
  border: 1px solid rgba(241, 235, 228, 0.08);
  background: #050505;
  perspective: 1600px;
  isolation: isolate;
}

.book-cover::before {
  content: "";
  position: absolute;
  inset: 8% 10% -12%;
  background:
    radial-gradient(circle at 50% 35%, rgba(224, 72, 59, 0.32), transparent 42%),
    radial-gradient(circle at 50% 100%, rgba(174, 137, 97, 0.24), transparent 50%);
  filter: blur(26px);
  opacity: 0.52;
  transform: translateY(26px) scale(0.84);
  transition: opacity 420ms ease, transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
  pointer-events: none;
}

.book-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0 38%, rgba(255, 255, 255, 0.08) 48%, transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%, transparent 72%, rgba(177, 37, 26, 0.1));
  mix-blend-mode: screen;
  opacity: 0;
  transform: translateX(-30%) skewX(-14deg);
  transition: opacity 260ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
  pointer-events: none;
}

.book-cover img,
.book-spread img {
  display: block;
  width: 100%;
  height: auto;
}

.book-cover img {
  position: relative;
  z-index: 1;
  transform-origin: 50% 56%;
  transform: rotateY(-24deg) rotateX(6deg) translateX(-10px) translateZ(0) scale(0.94);
  filter: drop-shadow(0 26px 36px rgba(0, 0, 0, 0.52));
  transition:
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 520ms ease;
  will-change: transform, filter;
}

.hero-card:hover .book-cover::before,
.hero-card:focus-within .book-cover::before,
.book-spread:hover::before,
.book-spread:focus-within::before {
  opacity: 1;
  transform: translateY(0) scale(1.18);
}

.hero-card:hover .book-cover::after,
.hero-card:focus-within .book-cover::after,
.book-spread:hover::after,
.book-spread:focus-within::after {
  opacity: 1;
  transform: translateX(22%) skewX(-14deg);
}

.hero-card:hover .book-cover img,
.hero-card:focus-within .book-cover img,
.book-spread:hover img,
.book-spread:focus-within img {
  transform: rotateY(8deg) rotateX(-2deg) translateX(8px) translateY(-18px) scale(1.1);
  filter:
    drop-shadow(0 42px 60px rgba(0, 0, 0, 0.74))
    drop-shadow(0 0 40px rgba(224, 72, 59, 0.24));
}

.hero-card-copy {
  padding: 1rem 0.6rem 0.3rem;
}

.hero-card dl {
  margin: 0;
}

.hero-card div + div {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.hero-card dt {
  color: var(--gold);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.35rem;
}

.hero-card dd {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
}

.section {
  padding: 4rem 0;
}

.section-contrast {
  padding: 4rem 2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(177, 37, 26, 0.06), rgba(8, 8, 8, 0.85));
}

.section-heading {
  margin-bottom: 2rem;
}

.story-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.8fr;
  gap: 1.5rem;
  align-items: start;
}

.pull-quote {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.pull-quote p {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.6vw, 2.2rem);
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: var(--text);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.cards-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-card,
.author-panel {
  padding: 1.5rem;
}

.author-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.78fr);
  gap: 1.5rem;
  align-items: start;
}

.book-spread {
  position: relative;
  max-width: 360px;
  margin: 0 auto;
  padding: 1rem;
  overflow: hidden;
  isolation: isolate;
}

.book-spread::before {
  content: "";
  position: absolute;
  inset: auto 12% 6% 12%;
  height: 22%;
  background: radial-gradient(circle at 50% 50%, rgba(224, 72, 59, 0.24), transparent 62%);
  filter: blur(26px);
  opacity: 0.6;
  transform: translateY(16px) scale(0.84);
  transition: opacity 420ms ease, transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
  pointer-events: none;
}

.book-spread::after {
  content: "";
  position: absolute;
  inset: 1rem;
  background: linear-gradient(120deg, transparent 0 42%, rgba(255, 255, 255, 0.06) 50%, transparent 58%);
  opacity: 0;
  transform: translateX(-28%) skewX(-14deg);
  transition: opacity 260ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
  pointer-events: none;
}

.book-spread img {
  position: relative;
  z-index: 1;
  max-width: 72%;
  margin: 0 auto;
  transform-origin: 50% 55%;
  transform: rotateY(-18deg) rotateX(4deg) translateX(-8px) scale(0.94);
  filter: drop-shadow(0 26px 38px rgba(0, 0, 0, 0.56));
  transition:
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 520ms ease;
}

.book-spread figcaption {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.section-banner {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 2rem;
  align-items: center;
  margin: 1rem auto;
  padding: 2rem;
  border: 1px solid rgba(174, 137, 97, 0.25);
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(135deg, rgba(177, 37, 26, 0.18), rgba(9, 9, 9, 0.6)),
    var(--panel-strong);
  box-shadow: var(--shadow);
}

.newsletter-layout {
  display: grid;
  grid-template-columns: 1fr 0.95fr;
  gap: 1.5rem;
  align-items: start;
}

.newsletter-layout > * {
  align-self: start;
}

.newsletter-form {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
}

.newsletter-form label {
  display: grid;
  gap: 0.45rem;
  font-size: 0.95rem;
  color: var(--text);
}

.newsletter-form input,
.newsletter-form select {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(241, 235, 228, 0.14);
  border-radius: 14px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
}

.newsletter-form option {
  color: #111;
}

.consent {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.consent input {
  width: 1rem;
  min-height: 1rem;
  margin-top: 0.25rem;
}

.form-note,
.card-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.section-quarta {
  padding: 5rem 2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8,8,8,0.9) 0%, rgba(177,37,26,0.07) 50%, rgba(8,8,8,0.9) 100%);
  text-align: center;
}

.quarta-tagline {
  margin-bottom: 3rem;
}

.quarta-tagline p {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 0.1em;
  text-transform: uppercase;
}

.quarta-tagline p em {
  font-style: normal;
  color: var(--accent-soft);
}

.quarta-layout {
  display: grid;
  grid-template-columns: 1fr 0.75fr;
  gap: 3rem;
  align-items: center;
  text-align: left;
}

.quarta-body {
  text-align: left;
}

.quarta-cover {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  isolation: isolate;
}

.quarta-cover::before {
  content: "";
  position: absolute;
  inset: 10% 8%;
  background:
    radial-gradient(circle at 50% 60%, rgba(224, 72, 59, 0.35), transparent 55%),
    radial-gradient(circle at 30% 30%, rgba(174, 137, 97, 0.18), transparent 45%);
  filter: blur(32px);
  opacity: 0.5;
  z-index: 0;
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  transform: scale(0.88);
  pointer-events: none;
}

.quarta-cover:hover::before {
  opacity: 1;
  transform: scale(1.12);
}

.quarta-cover img {
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: calc(var(--radius) - 4px);
  display: block;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  transform-origin: 50% 52%;
  transform: scale(0.97) translateY(4px) rotateY(-8deg) rotateZ(-1.5deg);
  filter:
    drop-shadow(0 32px 60px rgba(0,0,0,0.65))
    drop-shadow(0 0 0px rgba(224,72,59,0));
  transition:
    transform 900ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 700ms ease;
  will-change: transform, filter;
  perspective: 1200px;
}

.quarta-cover:hover img {
  transform: scale(1.06) translateY(-8px) rotateY(6deg) rotateZ(1deg);
  filter:
    drop-shadow(0 48px 80px rgba(0,0,0,0.75))
    drop-shadow(0 0 48px rgba(224,72,59,0.32))
    drop-shadow(0 0 18px rgba(174,137,97,0.22));
}

.quarta-body p {
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.quarta-body strong {
  color: var(--text);
}

.quarta-body em {
  font-style: italic;
  color: var(--text);
}

/* ── Giustizia figure ─────────────────────────────────────── */

/* 1. Versione hero: figura atmosferica in background */
.hero-grid {
  position: relative;
}

.giustizia-bg {
  position: absolute;
  right: 2%;
  top: 50%;
  transform: translateY(-50%);
  height: 85%;
  width: auto;
  max-height: 580px;
  opacity: 0.07;
  pointer-events: none;
  user-select: none;
  filter: grayscale(1) brightness(0.6);
  z-index: 0;
}

/* 2. Versione sezione #libro: figura principale */
.giustizia-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.giustizia-figure {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  filter: grayscale(0.25) brightness(0.82) contrast(1.1);
  transition:
    transform  420ms cubic-bezier(.22,.68,0,1.1),
    filter     300ms ease;
  cursor: default;
}

.giustizia-figure:hover {
  transform: translateY(-10px) rotate(-2deg);
  filter: grayscale(0.55) brightness(0.55) contrast(1.3)
          drop-shadow(0 14px 36px rgba(0,0,0,0.9))
          drop-shadow(0 0 18px rgba(100,10,10,0.7));
}

.pull-quote-under {
  margin: 0;
  text-align: center;
  border-left: none !important;
  border-top: 2px solid var(--accent);
  padding: 1rem 0 0 !important;
}

/* ── SO logo grafico ───────────────────────────────────────── */
.so-logo {
  display: block;
  max-width: 460px;
  width: 100%;
  height: auto;
  /* rimuove l'alone giallo dello sfondo originale */
  mix-blend-mode: screen;
  filter: brightness(1) saturate(1.1);
  transition:
    transform 380ms cubic-bezier(.22,.68,0,1.15),
    filter    280ms ease;
  cursor: default;
}

.so-logo:hover {
  transform: rotate(var(--so-rot, -3deg)) scale(1.04);
  filter: brightness(2.0) saturate(1.3) drop-shadow(0 0 22px rgba(177,37,26,0.9));
}

/* versione compatta per sezioni secondarie */
.so-logo-sm {
  display: block;
  max-width: 220px;
  width: 100%;
  height: auto;
  mix-blend-mode: screen;
  filter: brightness(0.9) saturate(1.05);
  transition:
    transform 380ms cubic-bezier(.22,.68,0,1.15),
    filter    280ms ease;
  cursor: default;
}

.so-logo-sm:hover {
  transform: rotate(var(--so-rot, 2.5deg)) scale(1.06);
  filter: brightness(2.2) saturate(1.4) drop-shadow(0 0 18px rgba(224,72,59,0.95));
}

@media (max-width: 960px) {
  .hero-grid,
  .story-grid,
  .cards-grid,
  .cards-grid.compact,
  .section-banner,
  .newsletter-layout,
  .author-layout,
  .quarta-layout {
    grid-template-columns: 1fr;
  }

  .quarta-cover {
    order: -1;
  }

  .topbar {
    flex-direction: column;
    gap: 0.8rem;
    align-items: flex-start;
  }

  h1,
  h2 {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .topbar,
  .hero-grid,
  .section,
  .section-banner {
    width: min(calc(100% - 1.2rem), var(--content-width));
  }

  .hero-grid {
    padding-top: 3rem;
  }

  .book-cover,
  .book-spread {
    width: min(100%, 280px);
    max-width: 280px;
  }

  .button {
    width: 100%;
  }

  .book-cover img,
  .book-spread img,
  .hero-card:hover .book-cover img,
  .book-spread:hover img {
    transform: none;
  }

  .book-cover::after,
  .book-spread::after {
    display: none;
  }
}
