/* ================= VARIABLES & RESET ================= */
:root {
    --bg-main: #fcfcf9; 
    --bg-alt: #f4f4f0;  
    --text-main: #2b2b2b; 
    --text-muted: #7a7a7a; 
    --accent: #c99d66; 
    --font-title: 'Ovo', serif;
    --font-text: 'Syne', sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================= CUSTOM SCROLLBAR ================= */
/* Per Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-main);
}

/* Per Chrome, Edge e Safari */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background-color: var(--accent);
    border-radius: 10px;
    border: 2px solid var(--bg-main); /* Crea un effetto di "respiro" sui lati */
}

::-webkit-scrollbar-thumb:hover {
    background-color: #b58955; /* Leggermente più scuro in hover */
}

/* ================= TITOLI (H2) WEIGHT 300 ================= */
h2 {
    font-family: var(--font-title);
    font-weight: 300; 
}

/* ================= HEADER ================= */
header {
    position: fixed; top: 0; left: 0; width: 100%; padding: 1rem 3rem;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 100; background-color: var(--bg-alt);
}
.logo-btn { 
    font-weight: 400; font-size: 2rem; letter-spacing: 2px; 
    text-transform: uppercase; color: var(--text-main); text-decoration: none;
    display: flex; align-items: center; gap: 12px;
}
.logo-btn img { width: auto; height: 40px; object-fit: contain; }
.menu-btn { 
    font-weight: 400; font-size: 1.6rem; letter-spacing: 2px; 
    text-transform: uppercase; color: var(--text-main); text-decoration: none;
}

/* ================= STORYTELLING LAYOUT ================= */

.text-chapter {
    min-height: 80vh; display: flex; flex-direction: column;
    justify-content: center; padding: 0 10vw; margin-top: 15vh;
}
.text-chapter h1 { font-family: var(--font-title); font-size: 1.6rem; color: var(--text-main); font-weight: 300; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 1rem; }

/* Layout specifico per il primo capitolo (Testo a sx, Logo a dx) */
.first-chapter {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 5rem;
}
.first-chapter .text-content {
    width: 60%;
}
.first-chapter .logo-wrapper {
    width: 40%;
    display: flex;
    justify-content: center;
}
.first-chapter .logo-wrapper img {
    width: 100%;
    object-fit: contain;
}

.quote {
    font-size: clamp(3rem, 6.5vw, 7rem);
    line-height: 1.05; margin-bottom: 2.5rem; max-width: 85vw; color: var(--text-main);
}
.quote-accent { color: var(--accent); font-style: italic; font-weight: 300; }

.info {
    font-family: var(--font-text); font-weight: 400; font-size: 1.1rem; 
    line-height: 1.8; letter-spacing: 0.5px;
    color: var(--text-muted); max-width: 700px; margin-left: 10vw;
    margin-bottom: 5vh;
}

.stories-link {
    display: flex;
    gap: 32px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 2.5rem;
}
.story-ext-link { 
    font-family: var(--font-text);
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-main);
    text-decoration: none; 
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(17, 17, 17, 0.2);
    transition: color 0.3s, border-color 0.3s;
}
.story-ext-link:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.signature {width: 800px; text-align: left; margin-right: 10vw;}

.img-chapter {
    width: 100%; padding: 5vh 10vw 20vh 10vw;
    display: flex; justify-content: center; align-items: center;
}
.img-wrapper { overflow: hidden; width: 100%; position: relative; background-color: #eaeaea; }
.img-wrapper img { width: 100%; height: 100%; object-fit: cover; will-change: transform; display: block; }

.layout-full { width: 80vw; height: 90vh; }
.layout-portrait { width: 40vw; height: 85vh; margin: 0 auto; }
.layout-double { display: flex; gap: 5vw; width: 80vw; justify-content: center; }
.layout-double .img-wrapper { width: 35vw; height: 75vh; }
.layout-double .img-wrapper:nth-child(2) { margin-top: 15vh; height: 85vh; }

.line { overflow: hidden; }

/* ================= FOOTER ================= */
footer {
    background-color: var(--bg-alt);
    padding: 15vh 10vw 5vh 10vw;
    display: flex; flex-direction: column;
}

.footer-cta { margin-bottom: 15vh; text-align: center; }
.footer-title { font-size: 6vw; margin-bottom: 2rem; color: var(--text-main); }

/* Nuovi box contatti footer */
.contact-boxes {
    display: flex; justify-content: center; gap: 2rem; margin-top: 3rem;
}
.contact-box {
    border: 1px solid var(--accent); padding: 2.5rem 4rem;
    display: flex; flex-direction: column; align-items: center;
    text-decoration: none; transition: background-color 0.4s;
}
.contact-map {
    display: flex; justify-content: center; margin-top: 3rem;
}
.contact-map img {
    width: 100%; height: auto; border: 1px solid var(--accent); transition: transform 0.4s; object-fit: cover;
}
.box-label {
    font-family: var(--font-text); font-size: 0.8rem; text-transform: uppercase;
    letter-spacing: 2px; color: var(--text-muted); margin-bottom: 0.5rem; transition: color 0.4s;
    display: flex; align-items: center; gap: 8px; justify-content: center;
}
.flag {
    display: flex; align-items: center; justify-content: center;
}
/* Scaliamo gli SVG per essere in armonia col testo a 0.8rem */
.flag svg {
    width: 24px;
    height: 24px;
}
.box-number {
    font-family: var(--font-title); font-size: 2.2rem; font-weight: 300; 
    color: var(--text-main); transition: color 0.4s;
}
.contact-box:hover {
    background-color: var(--accent);
}
.contact-box:hover .box-label, .contact-box:hover .box-number {
    color: var(--bg-main);
}

.footer-info {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem;
    border-top: 1px solid rgba(0,0,0,0.1); padding-top: 5vh;
}
.info-col h4 {
    font-family: var(--font-text); font-weight: 500; font-size: 0.8rem;
    text-transform: uppercase; letter-spacing: 2px; margin-bottom: 1.5rem; color: var(--text-main);
}
.info-col p, .info-col a, .footer-bottom a {
    font-family: var(--font-text); font-weight: 400; font-size: 1rem;
    line-height: 1.8; color: var(--text-muted); text-decoration: none; display: block;
}
.info-col a:hover, .footer-bottom a:hover { color: var(--accent); }

.footer-bottom {
    margin-top: 10vh; display: flex; justify-content: space-between;
    font-family: var(--font-text); font-size: 0.8rem; color: var(--text-muted);
}

/* ================= INTRO / SHARAN STYLES ================= */

/* Su mobile l'intro viene nascosta via JS, ma aggiungiamo un
   safety fallback CSS: se .intro-active è ancora presente ma
   siamo su mobile, non blocchiamo lo scroll e mostriamo il sito. */
@media (max-width: 1024px) {
  body.intro-active {
    background: var(--bg-main) !important;
    overflow: auto !important;
  }
  #intro-wrapper { display: none !important; }
  #main-site {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  #scroll-hint { display: none !important; }
}

body.intro-active {
  background: #000 !important;
}

/* INTRO */
#intro-wrapper { width: 100%; position: relative; }
#parallax-container {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  overflow: hidden; z-index: 1;
}
.layer {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  background-size: cover; background-position: center;
  background-repeat: no-repeat;
  will-change: transform, opacity;
}
#layer-bg   { background-image: url('../assets/castello.webp'); z-index: 10; transform-origin: center bottom; }
#layer-gate { background-image: url('../assets/cancello.webp');  z-index: 20; transform-origin: center bottom; }

#ui-container {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh; z-index: 40;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  pointer-events: none;
}
.scroll-text {
  position: absolute;
  color: #fff;
  font-family: var(--font-title);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700; font-style: italic;
  text-align: center;
  text-shadow: 0 4px 40px rgba(0,0,0,0.9);
  opacity: 0; visibility: hidden;
  letter-spacing: 0.01em;
}
#enter-btn {
  opacity: 0; 
  visibility: hidden;
  padding: 18px 50px;
  font-family: var(--font-text);
  font-size: 0.9rem;
  font-weight: 400;
  color: #fff;
  text-transform: uppercase; 
  letter-spacing: 4px;
  cursor: pointer;
  pointer-events: auto;
  background: rgba(30, 24, 22, 0.85); 
  backdrop-filter: blur(8px);
  border: 1px solid rgba(201,157,102,0);
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
#enter-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -150%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: skewX(-25deg);
  transition: all 0.7s ease;
  pointer-events: none;
}
#enter-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(201,157,102,0.2);
}
#enter-btn:hover::before {
  left: 200%;
}
#scroll-hint {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.scroll-hint-text {
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-text);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 4px;
  text-transform: uppercase;
}
.scroll-hint-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.6), rgba(255,255,255,0));
  animation: scroll-line 1.8s ease-in-out infinite;
  transform-origin: top center;
}
@keyframes scroll-line {
  0%   { transform: scaleY(0); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}
#scroll-spacer { height: 500vh; position: relative; z-index: 0; }

#main-site {
  pointer-events: none; opacity: 0;
  position: relative; z-index: 50;
  background: var(--bg-main);
}


/* LEGGENDA SHARAN */
.scrollytelling-wrapper {
  position: relative;
  height: 350vh; 
}
.hero-scroll-section {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--bg-main);
  color: var(--text-main);
  z-index: 1;
}
.title-h2 {
  font-family: var(--font-title);
  font-weight: 300;
  font-size: clamp(3rem, 6.5vw, 7rem);
  line-height: 1.05;
  color: var(--text-main);
  position: absolute;
  top: 25%;
  z-index: 1;
  text-align: center;
  margin: 0;
}
.image-wrapper {
  position: absolute;
  top: 55%;
  width: 60%;
  max-width: 800px;
  height: 50vh;
  z-index: 2; 
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.8);
}
.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.svg-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 1200px;
  z-index: 3; 
  pointer-events: none;
}
.svg-sharan {
  fill: transparent; 
  stroke: #ffffff;
  stroke-dasharray: 2000; 
  stroke-dashoffset: 2000;
  font-family: "Helvetica", "Arial", sans-serif;
  font-size: 140px;
  font-weight: 900;
  letter-spacing: 5px;
  stroke-width: 2px;
}
.svg-subtitle {
  fill: #ffffff;
  opacity: 0;
  font-family: "Helvetica", "Arial", sans-serif;
  font-size: 42px;
  font-weight: 300;
  letter-spacing: 2px;
}
.white-panel {
  position: relative;
  background-color: var(--bg-main);
  color: #000;
  min-height: 100vh;
  margin-top: -100vh; 
  z-index: 10;
  padding: 100px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.white-panel .content {
  max-width: 1100px;
  padding: 100px 0;
}
.legend-content {
  display: flex;
  gap: 40px;
  align-items: center;
}
.legend-image {
  width: 40%;
}
.legend-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
}
.legend-intro {
  width: 60%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.white-panel .content p {
  font-family: var(--font-title);
  font-style: italic;
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--text-main);
  line-height: 1.8;
  text-align: left;
}
/* effetto fumo */
.white-panel::before {
  content: '';
  position: absolute;
  top: -20vh;
  left: 0;
  width: 100%;
  height: 20vh;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, var(--bg-main) 100%);
  z-index: 9;
  pointer-events: none;
}
.white-panel h2 {
  font-family: var(--font-title);
  font-size: clamp(3rem, 5vw, 5.5rem);
  font-weight: 300;
  line-height: 1.15;
  color: var(--text-main);
  margin-bottom: 28px;
}
.white-panel h2 em { font-style: italic; color: var(--accent); }
.white-panel .stories-link {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.stories-link a { text-decoration: none; }
.smoke-transition {
  position: absolute;
  top: -500px;
  left: 0;
  width: 100%;
  height: 500px;
  z-index: 11;
  pointer-events: none;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 25%, black 75%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 25%, black 75%, transparent 100%);
}
.smoke-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%; 
  height: 100%; 
  background-repeat: repeat-x;
  background-position: center bottom;
}
.smoke-layer.smoke-1 {
  background-image: url('./fog1.png');
  opacity: 0.8;
  animation: smokePan 35s linear infinite;
}
.smoke-layer.smoke-2 {
  background-image: url('./fog2.png');
  opacity: 0.5;
  animation: smokePan 50s linear infinite reverse;
}
@keyframes smokePan {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); } 
}


/* BOOK TRIGGER */
.book-trigger {
  display: inline-block;
  font-family: var(--font-text);
  font-style: italic;
  font-size: clamp(1rem, 1.6vw, 1.4rem);
  font-weight: 400;
  color: var(--text-main);
  cursor: pointer;
  position: relative;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(60,40,20,0.3);
  transition: border-color 0.3s ease, color 0.3s ease;
  letter-spacing: 0.02em;
}
.book-trigger::after {
  content: "↗";
  margin-left: 6px;
  font-style: normal;
  font-size: 0.85em;
  opacity: 0.6;
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: inline-block;
}
.book-trigger:hover {
  border-color: rgba(60,40,20,0.8);
  color: #3c2814;
}
.book-trigger:hover::after {
  opacity: 1;
  transform: translate(2px,-2px);
}
 
/* BOOK MODAL WRAPPER */
.book-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.book-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 8, 4, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: backdropFadeIn 0.5s ease forwards;
}
@keyframes backdropFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
 
.book-modal-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 20px;
  width: 100%;
}
 
/* Close button */
.book-close {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 10001;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.75);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, color 0.25s, transform 0.25s;
}
.book-close:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
  transform: rotate(90deg);
}
 
/* 3D BOOK SCENE */
.book-scene {
  perspective: 1800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}
 
.book {
  position: relative;
  width: min(480px, 90vw);
  height: min(620px, 78vh);
  transform-style: preserve-3d;
}
 
/* Each page is a leaf that flips */
.book-page {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform-origin: left center;
  transform: rotateY(0deg);
  transition: transform 0.9s cubic-bezier(0.645, 0.045, 0.355, 1.000);
}
 
.book-page.flipped {
  transform: rotateY(-180deg);
}
 
/* Page faces */
.page-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}
.page-face.page-front {
  background: #fdf6e9;
}
.page-face.page-back {
  background: #fdf6e9;
  transform: rotateY(180deg);
}
 
/* Subtle paper texture on pages */
.page-face::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(180,160,120,0.08) 27px,
      rgba(180,160,120,0.08) 28px
    );
  pointer-events: none;
}
 
/* Page spine shadow (left edge on front face) */
.book-page:not(.book-cover) .page-face.page-front::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 100%;
  background: linear-gradient(to right, rgba(0,0,0,0.08), transparent);
  pointer-events: none;
}
 
/* COVER STYLES */
.book-cover .page-face.page-front {
  background: #1a0f06;
  box-shadow:
    inset -4px 0 12px rgba(0,0,0,0.5),
    6px 6px 40px rgba(0,0,0,0.6),
    -2px 0 8px rgba(255,255,255,0.03);
}
.book-cover .page-face.page-front::before {
  background-image: none;
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 4px,
      rgba(201,157,102,0.03) 4px,
      rgba(201,157,102,0.03) 5px
    );
}
 
.cover-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  gap: 12px;
  color: #c99d66;
  text-align: center;
  border: 1px solid rgba(201,157,102,0.2);
  margin: 20px;
}
.cover-ornament {
  font-size: 1.4rem;
  opacity: 0.7;
  letter-spacing: 4px;
}
.cover-ornament-bottom {
  font-size: 0.75rem;
  letter-spacing: 6px;
  opacity: 0.5;
}
.cover-eyebrow {
  font-family: var(--font-text);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0.6;
  margin: 0;
}
.cover-title {
  font-family: var(--font-title);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 300;
  line-height: 1.15;
  color: #e8c988;
  margin: 8px 0;
  text-shadow: 0 2px 20px rgba(201,157,102,0.3);
}
.cover-title em {
  font-style: italic;
}
.cover-subtitle {
  font-family: var(--font-title);
  font-style: italic;
  font-size: 0.95rem;
  opacity: 0.6;
  margin: 0;
  letter-spacing: 0.05em;
}
 
/* Back cover exterior */
.back-cover-exterior {
  background: #1a0f06 !important;
}
.back-cover .page-face.page-front {
  background: #1a0f06;
  border-radius: 12px 2px 2px 12px;
}
.back-cover-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #c99d66;
  text-align: center;
  border: 1px solid rgba(201,157,102,0.15);
  margin: 20px;
}
.back-ornament {
  font-size: 1.2rem;
  opacity: 0.5;
}
.back-ornament.small { font-size: 0.8rem; }
.back-castle {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 300;
  color: #e8c988;
  margin: 0;
}
.back-location {
  font-family: var(--font-text);
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0.5;
  margin: 0;
}
.back-tagline {
  font-family: var(--font-title);
  font-style: italic;
  font-size: 0.9rem;
  opacity: 0.5;
  margin: 4px 0 0;
}
 
/* PAGE CONTENT */
.page-content {
  position: absolute;
  inset: 0;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}
 
.page-chapter {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8b6535;
  margin: 0;
  flex-shrink: 0;
}
 
.page-text {
  font-family: var(--font-title);
  font-size: clamp(0.88rem, 1.4vw, 1.2rem);
  font-weight: 400;
  line-height: 1.8;
  color: #2c1f0e;
  margin: 0;
}
 
.italic-note {
  font-style: italic !important;
  color: #6b4e2a !important;
  border-left: 2px solid rgba(160,120,70,0.3);
  padding-left: 14px;
  font-size: 0.88rem !important;
}
 
.end-ornament {
  font-family: var(--font-title);
  text-align: center;
  color: #8b6535;
  letter-spacing: 0.2em;
  font-size: 1rem;
  margin-top: auto;
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
}
 
/* NAVIGATION */
.book-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.book-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.65);
  font-family: var(--font-text);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 18px;
  cursor: pointer;
  border-radius: 2px;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.book-nav-btn:hover {
  border-color: rgba(201,157,102,0.5);
  color: #c99d66;
  background: rgba(201,157,102,0.05);
}
.book-nav-btn:disabled {
  opacity: 0.2;
  cursor: default;
  pointer-events: none;
}
.book-progress {
  display: flex;
  align-items: center;
}
.book-progress-dots {
  display: flex;
  gap: 8px;
}
.book-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: background 0.3s, transform 0.3s;
}
.book-dot.active {
  background: #c99d66;
  transform: scale(1.3);
}
 
/* Page curl shadow on flip */
.book-page.flipping .page-face.page-front {
  box-shadow:
    inset -4px 0 12px rgba(0,0,0,0.15),
    8px 4px 30px rgba(0,0,0,0.35),
    -8px 0 20px rgba(0,0,0,0.2);
}
 
/* RESPONSIVE */
@media (max-width: 520px) {
  .book {
    width: 92vw;
    height: 70vh;
  }
  .page-content {
    padding: 24px 20px 24px 24px;
    gap: 12px;
  }
  .cover-title {
    font-size: 1.8rem;
  }
  .book-nav-btn span { display: none; }
  .book-nav-btn { padding: 10px 14px; }
}

/* ================================================================
   COOKIE BANNER
   ================================================================ */
#cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  width: 90%;
  max-width: 600px;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(201, 157, 102, 0.3);
  padding: 24px;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 20px;
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
}

#cookie-banner.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.cookie-content h4 {
  font-family: var(--font-title);
  color: #e8c988;
  font-size: 1.2rem;
  margin: 0 0 10px 0;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.cookie-content p {
  font-family: var(--font-text);
  color: #ccc;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0;
}

.cookie-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.cookie-btn {
  font-family: var(--font-text);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 20px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cookie-reject {
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cookie-reject:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.cookie-accept {
  background: rgba(201, 157, 102, 0.15);
  color: #e8c988;
  border: 1px solid rgba(201, 157, 102, 0.5);
}

.cookie-accept:hover {
  background: rgba(201, 157, 102, 0.25);
  border-color: #e8c988;
  color: #fff;
}

@media (max-width: 520px) {
  #cookie-banner {
    bottom: 0;
    width: 100%;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
  }
  .cookie-buttons {
    flex-direction: column;
  }
  .cookie-btn {
    width: 100%;
  }
}

#cookie-revoke-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 40px;
  height: 40px;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(201, 157, 102, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9998;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
}

#cookie-revoke-btn.show {
  opacity: 1;
  transform: scale(1);
}

#cookie-revoke-btn:hover {
  background: rgba(201, 157, 102, 0.2);
  border-color: rgba(201, 157, 102, 0.8);
}

#cookie-revoke-btn svg {
  width: 20px;
  height: 20px;
  fill: #e8c988;
}

/* ================= LANGUAGE SWITCHER ================= */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-text);
    font-weight: 400;
    font-size: 0.9rem;
    letter-spacing: 2px;
}
.lang-switch a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}
.lang-switch a:hover {
    color: var(--accent);
}
.lang-switch a.active {
    color: var(--text-main);
    font-weight: 600;
}
.lang-switch span {
    color: rgba(0,0,0,0.2);
}

/* 1. Intro Switcher */
.lang-switch-intro {
    position: absolute;
    top: 30px;
    right: 40px;
    z-index: 100;
    pointer-events: auto;
    
    background: rgba(12, 8, 4, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(201, 157, 102, 0.3);
    border-radius: 20px;
    padding: 6px 14px;
}
.lang-switch-intro a {
    color: rgba(255, 255, 255, 0.5);
}
.lang-switch-intro a.active, .lang-switch-intro a:hover {
    color: #fff;
}
.lang-switch-intro span {
    color: rgba(255, 255, 255, 0.3);
}

/* 2. Header Switcher */
.logo-text {
    display: flex;
    align-items: center;
}
.lang-switch-nav {
    margin-left: 24px;
    margin-top: 4px;
}

/* 3. Internal Switcher */
.lang-switch-internal {
    justify-content: center;
    margin-bottom: 24px;
}

/* ================= RESPONSIVE ================= */

/* ── Tablet (≤ 1024px) ── */
@media (max-width: 1024px) {
    /* Footer info */
    .footer-info { grid-template-columns: repeat(2, 1fr); gap: 3rem; }

    /* Leggenda */
    .legend-content { flex-direction: column; text-align: left; }
    .legend-image { display: none; }
    .legend-intro { width: 100%; }

    /* Header */
    header { padding: 0.85rem 2rem; }

    /* Sezioni testo — allineamento sinistra forzato (override inline style) */
    .text-chapter {
        min-height: auto;
        padding: 0 6vw;
        margin-top: 12vh;
        align-items: flex-start !important;
        text-align: left !important;
    }
    .quote { font-size: clamp(2.2rem, 5.5vw, 4rem); }
    .info {
        margin-left: 0;
        margin-right: 0 !important;
        max-width: 90%;
    }

    /* Sezioni immagine */
    .img-chapter { padding: 4vh 6vw 12vh 6vw; }
    .layout-full  { width: 90vw; height: 60vh; }
    .layout-portrait { width: 60vw; height: 65vh; }
    .layout-double .img-wrapper { height: 55vh; }
    .layout-double .img-wrapper:nth-child(2) { margin-top: 10vh; height: 60vh; }

    /* Firma */
    .signature { width: 100%; margin-right: 0; }
    .signature img { max-width: 500px; }

    /* Footer */
    .footer-cta { margin-bottom: 10vh; }
    .footer-title { font-size: 5vw; }

    /* Leggenda Sharan — scroll naturale: solo titolo, niente foto né fumo */
    .scrollytelling-wrapper { height: auto; }
    .hero-scroll-section {
        position: relative;
        height: auto;
        min-height: auto;
        padding: 8vh 6vw 3vh;
        background: transparent;
        overflow: visible;
    }
    .title-h2 {
        position: relative;
        top: auto;
        padding-top: 0;
        font-size: clamp(2.5rem, 6vw, 5rem);
        text-align: left;
        margin: 0;
    }
    /* Nasconde foto Sharan e SVG — su mobile si scorre direttamente al testo */
    .image-wrapper { display: none; }
    .svg-container { display: none; }
    /* Nasconde il fumo decorativo */
    .smoke-transition { display: none; }
    .smoke-layer { display: none; }
    /* White panel: elimina margine negativo e padding eccessivo */
    .white-panel { margin-top: 0; padding: 0 6vw 6vh; }
    .white-panel::before { display: none; }
    .white-panel .content { padding: 4vh 0 0; max-width: 100%; }
    /* Testo leggenda allineato a sinistra */
    .stories { width: 100%; margin-top: 4vh; }
    .white-panel .content p { text-align: left; }
    .white-panel .legend-intro { text-align: left; }
}

/* ── Smartphone (≤ 768px) ── */
@media (max-width: 768px) {
    /* Header */
    header { padding: 0.75rem 1.5rem; }
    .first-chapter .logo-wrapper { display: none; }

    /* Primo capitolo */
    .first-chapter {
        flex-direction: column;
        align-items: flex-start;
        gap: 3rem;
        min-height: auto;
    }
    .first-chapter .text-content { width: 100%; }

    /* Quote e testi — allineamento sinistra forzato */
    .quote { font-size: clamp(1.9rem, 7.5vw, 2.8rem); }
    .text-chapter {
        padding: 0 5vw;
        margin-top: 10vh;
        align-items: flex-start !important;
        text-align: left !important;
    }
    .text-chapter h1 { font-size: 1rem; }
    .info {
        font-size: 1rem;
        margin-left: 0;
        margin-right: 0 !important;
        max-width: 100%;
        margin-bottom: 3vh;
    }

    /* Immagini */
    .img-chapter { padding: 3vh 5vw 8vh 5vw; }
    .layout-full  { width: 95vw; height: 45vh; }
    .layout-portrait { width: 88vw; height: 50vh; }
    .layout-double { flex-direction: column; align-items: center; }
    .layout-double .img-wrapper { width: 88vw; height: 48vh; }
    .layout-double .img-wrapper:nth-child(2) { margin-top: 4vh; height: 50vh; }

    /* Firma — sinistra su mobile */
    .signature { width: 100%; margin-right: 0; text-align: left; }
    .signature img { max-width: 260px; }

    /* Footer */
    .footer-cta { margin-bottom: 8vh; }
    .footer-title { font-size: 8vw; }
    footer { padding: 10vh 5vw 4vh 5vw; }
    .contact-boxes { flex-direction: column; gap: 1rem; }
    .contact-box { padding: 1.5rem; }
    .box-number { font-size: 1.6rem; }
    .footer-info {
        grid-template-columns: 1fr;
        padding-top: 4vh;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 6vh;
        text-align: center;
    }

    /* Leggenda Sharan: titolo + testo a sinistra, niente foto né fumo */
    .scrollytelling-wrapper { height: auto; }
    .hero-scroll-section {
        position: relative;
        height: auto;
        min-height: auto;
        padding: 6vh 5vw 2vh;
        background: transparent;
        overflow: visible;
    }
    .title-h2 {
        position: relative;
        top: auto;
        font-size: clamp(2rem, 7vw, 3rem);
        padding-top: 0;
        text-align: left;
        width: 100%;
    }
    .image-wrapper { display: none; }
    .svg-container { display: none; }
    .smoke-transition { display: none; }
    .smoke-layer { display: none; }
    .white-panel {
        margin-top: 0;
        padding: 0 5vw 6vh;
        min-height: auto;
    }
    .white-panel::before { display: none; }
    .white-panel .content { padding: 2vh 0; max-width: 100%; }
    .white-panel .content p {
        font-size: 1.2rem;
        line-height: 1.7;
        text-align: left;
    }
    .white-panel h2 {
        font-size: clamp(2rem, 7vw, 3.5rem);
        text-align: left;
    }
    .white-panel .legend-content { text-align: left; }
    .stories-link { gap: 16px; align-items: flex-start; }
    
    /* Book modal */
    .book { width: 92vw; height: 72vh; }
    .page-content { padding: 20px 18px; gap: 12px; }
}

/* ── Smartphone piccoli (≤ 480px) ── */
@media (max-width: 480px) {
    /* Header */
    header { padding: 0.7rem 1rem; }
    .logo-text { width: 100%; justify-content: space-between; }
    .menu-btn { display: none; }
    .first-chapter .logo-wrapper { display: none; }

    /* Quote */
    .quote { font-size: clamp(1.6rem, 8.5vw, 2.2rem); }

    /* Immagini */
    .layout-full  { height: 38vh; }
    .layout-portrait { height: 42vh; }
    .layout-double .img-wrapper { height: 42vh; }

    /* Footer */
    .footer-title { font-size: 9vw; }
    .box-number { font-size: 1.4rem; }
    .contact-box { padding: 1.2rem; }

    /* White panel leggenda */
    .white-panel { padding: 30px 14px; }
    .white-panel .content p { font-size: 1.05rem; }
}
