/* librodeisogni.it — design system
   Concept: heritage del banco lotto e della tombola napoletana.
   Display Bodoni Moda, testo Hanken Grotesk, etichette Space Mono. */

:root {
  --paper:    oklch(0.977 0.006 85);
  --paper-2:  oklch(0.952 0.008 84);
  --paper-3:  oklch(0.905 0.012 80);
  --ink:      oklch(0.235 0.028 264);
  --ink-2:    oklch(0.36 0.03 264);
  --ink-3:    oklch(0.505 0.028 264);
  --bordeaux:   oklch(0.42 0.105 264);
  --bordeaux-d: oklch(0.295 0.075 264);
  --espresso:   oklch(0.205 0.05 264);
  --red:      oklch(0.52 0.13 264);
  --gold:     oklch(0.815 0.12 83);
  --gold-d:   oklch(0.715 0.125 78);
  --cream:    oklch(0.97 0.015 86);

  --maxw: 1180px;
  --r: 14px;
  --shadow: 0 18px 50px -28px oklch(0.20 0.03 35 / 0.55);
  --shadow-soft: 0 10px 30px -22px oklch(0.20 0.03 35 / 0.5);

  --sans: "Hanken Grotesk", system-ui, sans-serif;
  --serif: "Bodoni Moda", "Times New Roman", serif;
  --mono: "Space Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--bordeaux); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--red); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- typography ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.05; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); text-wrap: balance; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.9rem); text-wrap: balance; }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.7rem); }
p { max-width: 68ch; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-d);
}

.lead { font-size: clamp(1.05rem, 1.6vw, 1.28rem); color: var(--ink-2); max-width: 60ch; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 100;
  background: oklch(0.966 0.013 83 / 0.86);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--paper-3);
}
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 20px; }
.brand { display: flex; align-items: baseline; gap: .5ch; font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.brand b { color: var(--bordeaux); font-weight: 800; }
.brand .dot { font-family: var(--mono); font-size: .7rem; color: var(--gold-d); letter-spacing: .1em; align-self: center; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { font-size: .95rem; font-weight: 600; color: var(--ink-2); }
.nav a:hover, .nav a.on { color: var(--bordeaux); }
.nav a.cta-m { display: none; }
.nav-cta { font-family: var(--mono); font-size: .8rem; font-weight: 700; letter-spacing: .04em; padding: 9px 16px; border: 1.5px solid var(--bordeaux); border-radius: 999px; color: var(--bordeaux) !important; }
.nav-cta:hover { background: var(--bordeaux); color: var(--cream) !important; }
.menu-btn { display: none; width: 46px; height: 46px; border: 1.5px solid var(--paper-3); border-radius: 12px; background: var(--paper); cursor: pointer; align-items: center; justify-content: center; color: var(--ink); }
.menu-btn svg { width: 24px; height: 24px; }
.menu-btn:hover { border-color: var(--gold-d); }

/* ---------- number ball (firma) ---------- */
.ball {
  --d: 64px;
  width: var(--d); height: var(--d); flex: 0 0 var(--d);
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--sans); font-weight: 800;
  color: var(--cream);
  background:
    radial-gradient(circle at 33% 26%, oklch(0.54 0.115 264), var(--bordeaux) 54%, var(--bordeaux-d) 100%);
  box-shadow: inset 0 2px 5px oklch(0.97 0.015 86 / 0.28), inset 0 -7px 13px oklch(0.15 0.06 264 / 0.5), var(--shadow-soft);
  position: relative;
  isolation: isolate;
}
.ball::after {
  content: ""; position: absolute; inset: 5px; border-radius: 50%;
  border: 1.5px solid var(--gold); opacity: .42;
}
.ball span { font-family: var(--sans); font-weight: 800; font-size: calc(var(--d) * 0.46); line-height: 1; letter-spacing: -0.02em; z-index: 1; text-shadow: 0 1px 2px oklch(0.14 0.06 264 / 0.5); }
.ball.sm { --d: 46px; }
.ball.lg { --d: 130px; }
a.ball { transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
a.ball:hover { transform: translateY(-4px) rotate(-3deg); box-shadow: 0 16px 28px -16px oklch(0.30 0.115 28 / 0.7); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(115% 85% at 86% 6%, oklch(0.815 0.12 83 / 0.17), transparent 55%),
    linear-gradient(158deg, var(--espresso), var(--bordeaux-d) 94%);
  color: var(--cream);
  border-bottom: 3px solid var(--gold-d);
}
.hero::before { /* trama di numeri della cartella, tenue */
  content: "47 90 8 1 77 48 13 21 90 3 47 16 8 90 1 77 13 48 21 3 47 8 90 16";
  position: absolute; inset: -20% -10% auto -10%; font-family: var(--sans); font-weight: 800; font-size: 7rem;
  line-height: 1.1; letter-spacing: .2em; color: oklch(0.97 0.015 86 / 0.05); white-space: pre-wrap;
  pointer-events: none; transform: rotate(-8deg); z-index: 0;
}
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; padding-top: 84px; padding-bottom: 84px; }
.hero h1 { color: var(--cream); }
.hero h1 em { font-style: italic; color: var(--gold); }
.hero .lead { color: oklch(0.965 0.022 86 / 0.82); margin-top: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; place-items: center; }
.hero-art .ball:nth-child(1){ transform: translateY(8px); }
.hero-art .ball:nth-child(2){ transform: translateY(-14px); }
.hero-art .ball:nth-child(5){ transform: translateY(-10px); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-weight: 700; font-size: .9rem; letter-spacing: .03em; padding: 14px 24px; border-radius: 999px; transition: transform .2s var(--ease), background .2s, box-shadow .2s; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-d)); color: var(--espresso) !important; box-shadow: 0 12px 26px -14px oklch(0.66 0.12 73 / 0.8); }
.btn-gold:hover { box-shadow: 0 16px 30px -14px oklch(0.66 0.12 73 / 0.95); transform: translateY(-2px); }
.btn-ghost { border: 1.5px solid oklch(0.965 0.022 86 / 0.5); color: var(--cream) !important; }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold) !important; }
.btn-red { background: var(--bordeaux); color: var(--cream) !important; }
.btn-red:hover { background: var(--red); transform: translateY(-2px); }

/* ---------- sections ---------- */
.section { padding: 84px 0; }
.section.alt { background: var(--paper-2); border-top: 1px solid var(--paper-3); border-bottom: 1px solid var(--paper-3); }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.sec-head .lead { margin-top: 10px; }
.sec-head a.more { font-family: var(--mono); font-size: .82rem; font-weight: 700; white-space: nowrap; }

/* tombola board */
.board { display: grid; grid-template-columns: repeat(10, 1fr); gap: 12px; }
.board .ball { --d: 100%; aspect-ratio: 1; width: 100%; }
.board .ball span { font-size: clamp(.9rem, 2.2vw, 1.4rem); }
@media (max-width: 760px){ .board { grid-template-columns: repeat(6, 1fr); gap: 9px; } }
@media (max-width: 420px){ .board { grid-template-columns: repeat(5, 1fr); } }

/* sogni list */
.dreams { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.dream {
  display: flex; gap: 18px; align-items: center;
  background: var(--paper); border: 1px solid var(--paper-3); border-radius: var(--r);
  padding: 18px 20px; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.dream:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); border-color: var(--gold); }
.dream .ball { --d: 58px; }
.dream-txt h3 { font-size: 1.3rem; margin-bottom: 2px; }
.dream-txt p { font-size: .9rem; color: var(--ink-3); margin: 0; }
@media (max-width: 680px){ .dreams { grid-template-columns: 1fr; } }

/* ---------- article (numero / sogno) ---------- */
.page-head { background: var(--paper-2); border-bottom: 1px solid var(--paper-3); padding: 30px 0; }
.crumb { font-family: var(--mono); font-size: .76rem; letter-spacing: .04em; color: var(--ink-3); margin-bottom: 6px; }
.crumb a { color: var(--ink-3); } .crumb a:hover { color: var(--bordeaux); }

.article { padding: 56px 0 84px; }
.art-grid { display: grid; grid-template-columns: 150px 1fr; gap: 44px; align-items: start; }
.art-aside { position: sticky; top: 92px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.art-aside .nap { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--bordeaux); }
.art-aside .it { font-size: .82rem; color: var(--ink-3); font-family: var(--mono); letter-spacing: .03em; }
.art-body > * + * { margin-top: 22px; }
.art-body h2 { margin-top: 40px; }
.art-body .lead { font-family: var(--serif); font-style: italic; font-size: clamp(1.2rem, 2vw, 1.5rem); line-height: 1.4; color: var(--ink); max-width: 64ch; }
.art-body p { color: var(--ink-2); }

/* numeri associati box */
.nums { display: flex; flex-direction: column; gap: 14px; background: var(--paper-2); border: 1px solid var(--paper-3); border-radius: var(--r); padding: 22px 24px; }
.nums h3 { font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: var(--gold-d); font-weight: 800; }
.num-row { display: flex; align-items: center; gap: 16px; }
.num-row .ball { --d: 52px; }
.num-row .nota { font-size: .95rem; color: var(--ink-2); }
.num-row .nota b { color: var(--bordeaux); font-family: var(--serif); }

/* tags / correlati */
.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag { font-family: var(--mono); font-size: .82rem; font-weight: 700; padding: 8px 14px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--paper-3); color: var(--ink-2); }
.tag:hover { border-color: var(--gold); color: var(--bordeaux); }

/* prev / next numero */
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 50px; padding-top: 26px; border-top: 1px dashed var(--paper-3); }
.pager a { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: .85rem; font-weight: 700; color: var(--ink-2); }
.pager a:hover { color: var(--bordeaux); }
.pager .ball { --d: 40px; }

/* ---------- search (sogni index) ---------- */
.search { display: flex; align-items: center; gap: 12px; background: var(--paper); border: 1.5px solid var(--paper-3); border-radius: 999px; padding: 12px 20px; max-width: 440px; }
.search input { border: 0; background: none; font-family: var(--sans); font-size: 1rem; color: var(--ink); width: 100%; outline: none; }
.search input::placeholder { color: var(--ink-3); }
.search:focus-within { border-color: var(--gold); }

/* ---------- ad placeholder ---------- */
.ad { margin: 40px 0; min-height: 110px; display: grid; place-items: center; border: 1px dashed var(--paper-3); border-radius: var(--r); background: repeating-linear-gradient(135deg, var(--paper-2), var(--paper-2) 12px, var(--paper) 12px, var(--paper) 24px); }
.ad span { font-family: var(--mono); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.step { display: flex; flex-direction: column; gap: 10px; }
.step .k { font-family: var(--serif); font-size: 2.6rem; color: var(--gold-d); line-height: 1; }
.step h3 { font-family: var(--sans); font-size: 1.1rem; font-weight: 700; }
.step p { font-size: .95rem; color: var(--ink-2); }
@media (max-width: 760px){ .steps { grid-template-columns: 1fr; gap: 22px; } }

/* ---------- footer ---------- */
.site-foot { background: var(--espresso); color: oklch(0.965 0.022 86 / 0.78); padding: 64px 0 30px; border-top: 3px solid var(--gold-d); }
.foot-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.foot-brand .brand { color: var(--cream); }
.foot-brand .brand b { color: var(--gold); }
.foot-brand p { font-size: .9rem; margin-top: 14px; max-width: 38ch; color: oklch(0.965 0.022 86 / 0.6); }
.foot-col h5 { font-family: var(--mono); font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.foot-col a { display: block; color: oklch(0.965 0.022 86 / 0.72); font-size: .92rem; padding: 5px 0; }
.foot-col a:hover { color: var(--gold); }
.gioco { margin-top: 44px; padding: 16px 20px; border: 1px solid oklch(0.965 0.022 86 / 0.16); border-radius: var(--r); font-size: .8rem; color: oklch(0.965 0.022 86 / 0.6); display: flex; gap: 14px; align-items: center; }
.gioco b { color: var(--gold); font-family: var(--mono); }
.foot-bot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-top: 30px; padding-top: 22px; border-top: 1px solid oklch(0.965 0.022 86 / 0.14); font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; color: oklch(0.965 0.022 86 / 0.5); }
.foot-bot a { color: var(--gold); }

/* ---------- motion (discreta, content-safe) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .7s var(--ease) both; }
  .hero h1.rise { animation-delay: .05s; }
  .hero .lead.rise { animation-delay: .16s; }
  .hero .hero-actions.rise { animation-delay: .26s; }
  .hero-art .ball { animation: pop .6s var(--ease) both; }
  .hero-art .ball:nth-child(1){ animation-delay: .20s; }
  .hero-art .ball:nth-child(2){ animation-delay: .28s; }
  .hero-art .ball:nth-child(3){ animation-delay: .36s; }
  .hero-art .ball:nth-child(4){ animation-delay: .44s; }
  .hero-art .ball:nth-child(5){ animation-delay: .52s; }
  .hero-art .ball:nth-child(6){ animation-delay: .60s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 36px; padding-top: 60px; padding-bottom: 64px; }
  .hero-art { max-width: 360px; }
  .foot-top { grid-template-columns: 1fr 1fr; gap: 30px; }
  .foot-brand { grid-column: 1 / -1; }
  .art-grid { grid-template-columns: 1fr; gap: 24px; }
  .art-aside { position: static; flex-direction: row; justify-content: flex-start; }
}
@media (max-width: 680px) {
  .menu-btn { display: inline-flex; }
  .nav-cta { display: none; }
  .nav {
    position: absolute; top: 70px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--paper-3);
    padding: 6px 22px 16px; box-shadow: var(--shadow-soft);
    transform: translateY(-14px); opacity: 0; pointer-events: none;
    transition: transform .25s var(--ease), opacity .25s var(--ease);
  }
  .site-head.nav-open .nav { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 15px 4px; font-size: 1.08rem; border-bottom: 1px solid var(--paper-3); }
  .nav a:last-child { border-bottom: 0; }
  .nav a.cta-m { display: block; margin-top: 10px; color: var(--cream) !important; background: var(--bordeaux); border: 0; border-radius: 999px; text-align: center; padding: 14px; font-family: var(--mono); font-weight: 700; }
  .section { padding: 58px 0; }
  .sec-head { flex-direction: column; align-items: flex-start; }
  .foot-top { grid-template-columns: 1fr; }
  h1 { font-size: clamp(2.1rem, 9vw, 2.8rem); }
}

/* dizionario A-Z */
.az-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 20px; }
.az-nav a, .az-nav span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px;
  font-family: var(--mono); font-weight: 700; font-size: .92rem; text-decoration: none;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.az-nav a { color: var(--bordeaux); background: var(--paper-2); border: 1px solid var(--paper-3); }
.az-nav a:hover { background: var(--bordeaux); color: var(--cream); border-color: var(--bordeaux); }
.az-nav span.off { color: var(--ink-3); opacity: .3; border: 1px solid transparent; }
.az-count { margin-top: 12px; font-family: var(--mono); font-size: .8rem; color: var(--ink-3); letter-spacing: .02em; }
.az-group { margin-top: 44px; scroll-margin-top: 92px; }
.az-group:first-child { margin-top: 28px; }
.az-h {
  display: flex; align-items: baseline; gap: 10px; margin: 0 0 18px; padding-bottom: 9px;
  font-family: var(--serif); font-size: 2.2rem; line-height: 1; color: var(--bordeaux);
  border-bottom: 2px solid var(--gold);
}
.az-h span { font-family: var(--mono); font-size: .78rem; font-weight: 700; color: var(--ink-3); }
@media (max-width: 680px) {
  .az-nav a, .az-nav span { width: 30px; height: 30px; font-size: .82rem; }
  .az-h { font-size: 1.7rem; }
  .az-group { margin-top: 36px; }
}

/* domande frequenti */
.faq { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  border: 1px solid var(--paper-3); border-radius: 12px;
  background: var(--paper-2); padding: 15px 18px;
}
.faq-item summary {
  font-family: var(--serif); font-weight: 700; font-size: 1.14rem; color: var(--ink);
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 14px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-family: var(--mono); font-weight: 700; color: var(--bordeaux);
  flex: none; transition: transform .25s var(--ease);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin-top: 11px; color: var(--ink-2); max-width: none; }
