/* =========================================================================
   QuestBoard — sito vetrina. Tema medieval fantasy, coerente coi design token
   dell'app (src/styles.css): ink scuro, oro, cremisi, pergamena; Cinzel + EB
   Garamond. La cornice dorata ornata è la firma visiva (dal FantasyCard).
   ========================================================================= */

:root {
  /* Palette (dall'app) */
  --ink: #0b1020;
  --ink-2: #141a2e;
  --ink-3: #1e2740;
  --parchment: #efe6d0;
  --parchment-2: #e3d6b8;
  --gold: #c9a24b;
  --gold-hi: #e7c874;
  --blood: #7a1f2b;
  --blood-hi: #9b2b39;
  --emerald: #3f7d4f;
  --emerald-hi: #57a86c;
  --ink-muted: #8a93ad;
  --ink-parchment: #2a2118;
  --ink-parchment-2: #6a5c40;

  /* Tipografia */
  --font-display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --font-body: 'EB Garamond', 'Iowan Old Style', Georgia, 'Times New Roman', serif;

  /* Struttura */
  --maxw: 1160px;
  --radius: 6px;
  --gold-line: color-mix(in srgb, var(--gold) 55%, transparent);
  --gold-faint: color-mix(in srgb, var(--gold) 22%, transparent);
  --shadow-glow: 0 0 0 1px rgb(201 162 75 / 0.22), 0 22px 60px -28px rgb(0 0 0 / 0.85);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 1.075rem;
  line-height: 1.65;
  background-color: var(--ink);
  background-image:
    radial-gradient(1200px 620px at 50% -8%, rgb(30 39 64 / 0.6), transparent),
    radial-gradient(900px 500px at 90% 12%, rgb(122 31 43 / 0.14), transparent),
    linear-gradient(180deg, var(--ink), #06090f);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: 0.015em;
  line-height: 1.12;
  margin: 0;
  font-weight: 700;
}

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

:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 3px;
  border-radius: 3px;
}

::selection { background: color-mix(in srgb, var(--gold) 45%, transparent); color: #fff; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--gold) 38%, transparent); border-radius: 8px; }
::-webkit-scrollbar-track { background: #06090f; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2.2rem); }

/* ---- Label maiuscoletto (eyebrow "SKILLS / TIRI SALVEZZA") ---------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 0.74rem; font-weight: 600;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--gold-hi);
  margin: 0 0 1rem;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; flex: none;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.eyebrow--center { justify-content: center; }
.eyebrow--center::after {
  content: ""; width: 26px; height: 1px; flex: none;
  background: linear-gradient(90deg, var(--gold), transparent);
}

/* =========================================================================
   Cornice dorata ornata (firma) — riprende il FantasyCard dell'app.
   ========================================================================= */
.frame {
  position: relative;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink-2) 92%, transparent), var(--ink));
  box-shadow: var(--shadow-glow);
}
.frame__corner {
  position: absolute; width: 38px; height: 38px;
  color: var(--gold-hi);
  filter: drop-shadow(0 0 2px color-mix(in srgb, var(--gold-hi) 45%, transparent));
  pointer-events: none; z-index: 2;
}
.frame__corner--tl { top: -1px; left: -1px; }
.frame__corner--tr { top: -1px; right: -1px; transform: scaleX(-1); }
.frame__corner--bl { bottom: -1px; left: -1px; transform: scaleY(-1); }
.frame__corner--br { bottom: -1px; right: -1px; transform: scale(-1, -1); }

/* Gemma a rombo di metà lato (come nei frame di riferimento). */
.frame--gems::before,
.frame--gems::after {
  content: ""; position: absolute; left: 50%; width: 9px; height: 9px;
  background: var(--gold-hi); transform: translateX(-50%) rotate(45deg);
  box-shadow: 0 0 6px color-mix(in srgb, var(--gold-hi) 55%, transparent);
  z-index: 2;
}
.frame--gems::before { top: -5px; }
.frame--gems::after { bottom: -5px; }

/* =========================================================================
   Banner cremisi (come il banner-nome della scheda) — titoli di sezione.
   ========================================================================= */
.banner {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--parchment);
  padding: 0.42rem 1.05rem;
  background: linear-gradient(180deg, var(--blood-hi), var(--blood));
  border: 1px solid var(--gold-line);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 12%, transparent);
}

/* ---- Bottoni ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-weight: 600; font-size: 0.98rem;
  letter-spacing: 0.03em;
  padding: 0.8rem 1.5rem;
  border-radius: 4px; border: 1px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--blood {
  color: var(--parchment);
  background: linear-gradient(180deg, var(--blood-hi), var(--blood));
  border-color: var(--gold-line);
  box-shadow: 0 10px 26px -12px rgb(122 31 43 / 0.9), inset 0 1px 0 color-mix(in srgb, #fff 14%, transparent);
}
.btn--blood:hover { box-shadow: 0 16px 34px -12px rgb(155 43 57 / 0.95), 0 0 0 1px var(--gold-hi); }
.btn--ghost {
  color: var(--gold-hi);
  background: color-mix(in srgb, var(--gold) 8%, transparent);
  border-color: var(--gold-line);
}
.btn--ghost:hover { background: color-mix(in srgb, var(--gold) 16%, transparent); border-color: var(--gold-hi); }
.btn--lg { padding: 1rem 1.9rem; font-size: 1.05rem; }

/* =========================================================================
   Topbar
   ========================================================================= */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  border-bottom: 1px solid var(--gold-faint);
}
.nav__inner { display: flex; align-items: center; gap: 1.5rem; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; }
.brand__crest { width: 34px; height: 34px; color: var(--gold-hi); flex: none; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.32rem; letter-spacing: 0.04em; }
.brand__name b { color: var(--gold-hi); font-weight: 700; }
.nav__links { display: flex; gap: 1.6rem; margin-left: auto; }
.nav__links a {
  text-decoration: none; color: var(--parchment); font-family: var(--font-display);
  font-size: 0.92rem; font-weight: 600; letter-spacing: 0.02em; opacity: 0.82;
  position: relative; padding: 0.2rem 0;
}
.nav__links a:hover { opacity: 1; color: var(--gold-hi); }
.nav__cta { margin-left: 0.4rem; }
.nav__toggle { display: none; }

/* =========================================================================
   Hero
   ========================================================================= */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero__grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero__title {
  font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 900; line-height: 1.04;
  margin: 1.3rem 0 0;
}
.hero__title em { font-style: normal; color: var(--gold-hi); }
.hero__lead { font-size: clamp(1.1rem, 1.6vw, 1.28rem); color: color-mix(in srgb, var(--parchment) 86%, transparent); max-width: 34ch; margin: 1.4rem 0 0; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; margin-top: 2rem; color: var(--ink-muted); font-size: 0.86rem; letter-spacing: 0.02em; }
.hero__meta span { display: inline-flex; align-items: center; gap: 0.5rem; }
.hero__meta span::before { content: ""; width: 7px; height: 7px; background: var(--gold-hi); transform: rotate(45deg); flex: none; }

/* ---- Artefatto scheda (ricreazione della scheda 5e) ---------------------- */
.sheet { overflow: hidden; }
.sheet__banner {
  position: relative;
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.2rem;
  background: linear-gradient(180deg, var(--blood-hi), var(--blood));
  border-bottom: 1px solid var(--gold-line);
}
.sheet__id { min-width: 0; }
.sheet__name { font-size: 1.35rem; color: var(--parchment); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet__epithet { color: var(--gold-hi); font-size: 1.02rem; font-style: italic; }
.sheet__sub { font-family: var(--font-display); font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: color-mix(in srgb, var(--parchment) 72%, transparent); margin-top: 0.15rem; }
.sheet__medal { margin-left: auto; text-align: center; flex: none; }
.medal {
  width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; color: var(--parchment);
  background: radial-gradient(circle at 50% 35%, var(--ink-3), var(--ink));
  border: 2px solid var(--gold-hi);
  box-shadow: 0 0 0 3px var(--blood), 0 0 14px color-mix(in srgb, var(--gold-hi) 40%, transparent);
}
.xpbar { margin-top: 0.5rem; width: 118px; }
.xpbar__track { height: 6px; border-radius: 4px; background: rgb(0 0 0 / 0.35); border: 1px solid var(--gold-faint); overflow: hidden; }
.xpbar__fill { height: 100%; width: 8%; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); }
.xpbar__label { font-size: 0.66rem; color: color-mix(in srgb, var(--parchment) 72%, transparent); margin-top: 0.2rem; letter-spacing: 0.08em; }

.sheet__body { padding: 1.1rem; display: grid; grid-template-columns: auto 1fr; gap: 1rem; }
.portrait {
  width: 92px; height: 116px; border-radius: 4px; flex: none;
  display: grid; place-items: center;
  color: var(--gold-hi);
  background: linear-gradient(180deg, var(--ink-3), var(--ink));
  border: 2px solid var(--gold-line);
  box-shadow: inset 0 0 0 3px rgb(0 0 0 / 0.3);
}
.portrait svg { width: 52px; height: 52px; opacity: 0.9; }
.sheet__stats { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.abilities { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.35rem; }
.ability {
  text-align: center; padding: 0.32rem 0.1rem 0.28rem;
  background: var(--parchment); color: var(--ink-parchment);
  border: 1px solid var(--gold-line); border-radius: 3px;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%);
}
.ability__k { font-family: var(--font-display); font-size: 0.56rem; letter-spacing: 0.08em; color: var(--ink-parchment-2); }
.ability__m { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; line-height: 1; margin-top: 0.1rem; }
.ability__s { font-size: 0.58rem; color: var(--ink-parchment-2); margin-top: 0.12rem; }

.bars { display: flex; gap: 0.5rem; }
.bar { flex: 1; }
.bar__label { display: flex; justify-content: space-between; font-family: var(--font-display); font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 0.2rem; }
.bar__track { height: 22px; border-radius: 3px; border: 1px solid var(--gold-faint); background: rgb(0 0 0 / 0.35); position: relative; overflow: hidden; }
.bar__fill { position: absolute; inset: 0; }
.bar__fill--hp { background: linear-gradient(180deg, var(--emerald-hi), var(--emerald)); }
.bar__fill--hd { width: 100%; background: linear-gradient(180deg, var(--blood-hi), var(--blood)); }
.bar__val { position: relative; z-index: 1; display: grid; place-items: center; height: 100%; font-family: var(--font-display); font-weight: 700; font-size: 0.8rem; color: var(--parchment); }
.sheet__tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.chip { font-family: var(--font-display); font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.2rem 0.5rem; border-radius: 3px; border: 1px solid var(--gold-faint); color: color-mix(in srgb, var(--parchment) 85%, transparent); }

/* =========================================================================
   Sezioni generiche
   ========================================================================= */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section__head { max-width: 62ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section__head--center { margin-inline: auto; text-align: center; }
.section__title { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
.section__title em { font-style: normal; color: var(--gold-hi); }
.section__intro { color: color-mix(in srgb, var(--parchment) 80%, transparent); font-size: 1.12rem; margin-top: 1rem; }

.rule { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-faint), transparent); margin: 0; }

/* ---- Griglia funzionalità (capitoli) ------------------------------------- */
.chapters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.chapter {
  position: relative; padding: 1.4rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink-2) 88%, transparent), var(--ink));
  border: 1px solid var(--gold-faint); border-radius: var(--radius);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
/* Gemme d'angolo (versione leggera in CSS) */
.chapter::before, .chapter::after {
  content: ""; position: absolute; width: 7px; height: 7px; background: var(--gold);
  transform: rotate(45deg); opacity: 0.6; transition: opacity 0.18s ease, background 0.18s ease;
}
.chapter::before { top: 7px; left: 7px; }
.chapter::after { bottom: 7px; right: 7px; }
.chapter:hover { transform: translateY(-4px); border-color: var(--gold-line); box-shadow: var(--shadow-glow); }
.chapter:hover::before, .chapter:hover::after { opacity: 1; background: var(--gold-hi); }
.chapter__icon { width: 42px; height: 42px; color: var(--gold-hi); margin-bottom: 0.9rem; }
.chapter__title { font-size: 1.18rem; margin-bottom: 0.4rem; }
.chapter__title span { color: var(--gold-hi); font-size: 0.72rem; letter-spacing: 0.14em; display: block; margin-bottom: 0.25rem; text-transform: uppercase; }
.chapter__text { color: color-mix(in srgb, var(--parchment) 78%, transparent); font-size: 0.98rem; margin: 0; }

/* ---- Come funziona (sequenza numerata reale) ----------------------------- */
.steps { display: grid; gap: 1px; background: var(--gold-faint); border: 1px solid var(--gold-faint); border-radius: var(--radius); overflow: hidden; }
.step {
  display: grid; grid-template-columns: auto 1fr; gap: 1.4rem; align-items: baseline;
  padding: 1.6rem clamp(1.2rem, 3vw, 2rem);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink-2) 82%, transparent), var(--ink));
}
.step__n { font-family: var(--font-display); font-weight: 900; font-size: clamp(2rem, 4vw, 3rem); color: transparent; -webkit-text-stroke: 1px var(--gold); line-height: 1; }
.step__body h3 { font-size: 1.28rem; }
.step__body p { color: color-mix(in srgb, var(--parchment) 80%, transparent); margin: 0.4rem 0 0; }

/* ---- Spotlight scheda ---------------------------------------------------- */
.spotlight { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.checklist { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 0.85rem; }
.checklist li { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; align-items: baseline; }
.checklist li::before { content: ""; width: 10px; height: 10px; background: var(--gold-hi); transform: rotate(45deg); box-shadow: 0 0 6px color-mix(in srgb, var(--gold-hi) 50%, transparent); }
.checklist b { color: var(--parchment); font-weight: 600; }
.checklist span { color: var(--ink-muted); }

/* ---- Per chi (DM / Player) ---------------------------------------------- */
.audience { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.audience__col { padding: clamp(1.6rem, 3vw, 2.4rem); }
.audience__col h3 { font-size: 1.5rem; margin: 1rem 0 0.3rem; }
.audience__col h3 em { font-style: normal; color: var(--gold-hi); }
.audience__col ul { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: 0.7rem; }
.audience__col li { display: grid; grid-template-columns: auto 1fr; gap: 0.7rem; color: color-mix(in srgb, var(--parchment) 82%, transparent); }
.audience__col li::before { content: "◆"; color: var(--gold); font-size: 0.7rem; line-height: 1.6; }

/* ---- FAQ ----------------------------------------------------------------- */
.faq { display: grid; gap: 0.7rem; max-width: 820px; margin-inline: auto; }
.faq details {
  border: 1px solid var(--gold-faint); border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink-2) 80%, transparent), var(--ink));
  overflow: hidden;
}
.faq details[open] { border-color: var(--gold-line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.1rem 1.3rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1.08rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold-hi); font-size: 1.4rem; font-family: var(--font-display); transition: transform 0.2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0; padding: 0 1.3rem 1.2rem; color: color-mix(in srgb, var(--parchment) 80%, transparent); }

/* ---- CTA finale ---------------------------------------------------------- */
.cta { text-align: center; padding: clamp(2.6rem, 6vw, 4.2rem) clamp(1.2rem, 5vw, 3rem); }
.cta h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
.cta h2 em { font-style: normal; color: var(--gold-hi); }
.cta p { color: color-mix(in srgb, var(--parchment) 82%, transparent); font-size: 1.15rem; margin: 1rem auto 2rem; max-width: 46ch; }

/* ---- Footer -------------------------------------------------------------- */
.footer { border-top: 1px solid var(--gold-faint); padding: clamp(2.5rem, 5vw, 3.5rem) 0 2rem; margin-top: 2rem; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.footer__about p { color: var(--ink-muted); max-width: 34ch; margin: 0.9rem 0 0; font-size: 0.96rem; }
.footer h4 { font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-hi); margin-bottom: 1rem; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; }
.footer a { text-decoration: none; color: color-mix(in srgb, var(--parchment) 78%, transparent); font-size: 0.96rem; }
.footer a:hover { color: var(--gold-hi); }
.footer__bottom { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; justify-content: space-between; align-items: center; margin-top: 2.5rem; padding-top: 1.4rem; border-top: 1px solid var(--gold-faint); color: var(--ink-muted); font-size: 0.84rem; }

/* =========================================================================
   Reveal allo scroll
   ========================================================================= */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .chapter:hover { transform: none; }
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { order: -1; max-width: 460px; }
  .chapters { grid-template-columns: repeat(2, 1fr); }
  .spotlight { grid-template-columns: 1fr; }
  .audience { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 1.02rem; }
  .nav__links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 0.5rem 1.2rem 1rem;
    background: color-mix(in srgb, var(--ink) 96%, transparent);
    border-bottom: 1px solid var(--gold-faint);
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 0.7rem 0; border-bottom: 1px solid var(--gold-faint); }
  .nav__cta { display: none; }
  .nav__toggle {
    display: inline-grid; place-items: center; margin-left: auto;
    width: 42px; height: 42px; background: transparent; cursor: pointer;
    border: 1px solid var(--gold-line); border-radius: 4px; color: var(--gold-hi);
  }
  .chapters { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .step { grid-template-columns: 1fr; gap: 0.5rem; }
}
