:root {
  --night: #071018;
  --night-2: #0b1720;
  --ink: #10202a;
  --paper: #e9e1d2;
  --paper-soft: #c9c1b3;
  --copper: #b87850;
  --copper-bright: #da9b6e;
  --line: rgba(233, 225, 210, .14);
  --line-strong: rgba(218, 155, 110, .4);
  --shadow: 0 30px 80px rgba(0,0,0,.38);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--night); }
body {
  margin: 0;
  color: var(--paper);
  background:
    radial-gradient(circle at 82% 15%, rgba(34, 81, 92, .26), transparent 31rem),
    linear-gradient(180deg, #071018 0%, #0a151d 48%, #071018 100%);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  left: 1rem;
  top: 1rem;
  transform: translateY(-160%);
  background: var(--paper);
  color: var(--night);
  padding: .7rem 1rem;
  border-radius: .25rem;
}
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  padding: 0 clamp(1.2rem, 5vw, 5rem);
  border-bottom: 1px solid transparent;
  transition: background .35s ease, border-color .35s ease, min-height .35s ease;
}
.site-header.is-scrolled { min-height: 62px; background: rgba(7, 16, 24, .87); backdrop-filter: blur(18px); border-color: var(--line); }
.wordmark { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; text-transform: uppercase; font-size: .67rem; letter-spacing: .18em; font-weight: 650; }
.wordmark-mark { color: var(--copper-bright); font-size: 1.15rem; }
.nav { display: flex; gap: clamp(1rem, 3vw, 2.7rem); }
.nav a { position: relative; text-decoration: none; color: var(--paper-soft); font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; }
.nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -.55rem; height: 1px; background: var(--copper-bright); transition: right .25s ease; }
.nav a:hover::after, .nav a:focus-visible::after { right: 0; }
.private-badge { justify-self: end; display: inline-flex; align-items: center; gap: .55rem; color: var(--paper-soft); font-size: .67rem; letter-spacing: .1em; text-transform: uppercase; }
.private-badge span { color: #a6c5b0; font-size: .55rem; box-shadow: 0 0 12px rgba(166, 197, 176, .5); }

.hero { min-height: 100svh; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .78fr); align-items: center; gap: 3rem; padding: 9rem clamp(1.5rem, 8vw, 9rem) 6rem; isolation: isolate; overflow: hidden; }
.hero::after { content: ""; position: absolute; z-index: -2; width: 48vw; height: 48vw; border: 1px solid rgba(184,120,80,.14); border-radius: 50%; right: -8vw; top: 13%; box-shadow: inset 0 0 90px rgba(184,120,80,.04); }
.hero-copy { max-width: 760px; position: relative; z-index: 2; }
.eyebrow, .section-index, .panel-role, .detail-kicker { margin: 0 0 1.25rem; color: var(--copper-bright); font-size: .68rem; font-weight: 650; text-transform: uppercase; letter-spacing: .22em; }
h1, h2, h3, blockquote { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
h1 { margin: 0; max-width: 13ch; font-size: clamp(3.55rem, 7.2vw, 7.8rem); line-height: .91; letter-spacing: -.055em; }
h1 em { color: var(--copper-bright); font-weight: 400; }
.hero-line { max-width: 58ch; margin: 2.3rem 0 0; color: var(--paper-soft); font-family: Georgia, serif; font-size: clamp(1.05rem, 1.5vw, 1.38rem); line-height: 1.62; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.4rem 2.2rem; margin-top: 2.5rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 1.2rem; min-height: 52px; padding: .8rem 1.4rem; text-decoration: none; text-transform: uppercase; letter-spacing: .14em; font-weight: 650; font-size: .67rem; }
.button-primary { background: var(--copper); color: #0a1217; transition: background .25s ease, transform .25s ease; }
.button-primary:hover, .button-primary:focus-visible { background: var(--copper-bright); transform: translateY(-2px); }
.soundless-button { display: inline-flex; gap: .7rem; align-items: center; padding: .7rem 0; border: 0; background: transparent; color: var(--paper-soft); font-size: .76rem; cursor: pointer; }
.wind-glyph { color: var(--copper-bright); font-size: 1.45rem; transition: letter-spacing .4s ease; }
.soundless-button.is-active .wind-glyph { animation: breathe 2.4s ease-in-out infinite; }

.book-scene { position: relative; height: min(68vh, 620px); display: grid; place-items: center; perspective: 1300px; }
.book { position: relative; width: clamp(205px, 21vw, 310px); aspect-ratio: .7; transform: rotateY(-14deg) rotateX(7deg) rotateZ(2deg); transform-style: preserve-3d; filter: drop-shadow(24px 40px 33px rgba(0,0,0,.55)); animation: bookFloat 8s ease-in-out infinite; }
.book-cover { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 13% 12%; color: #c6aa86; background: linear-gradient(135deg, #142731 0%, #0b151c 60%, #101f28 100%); border: 1px solid rgba(218,155,110,.45); box-shadow: inset 0 0 0 6px #0b151c, inset 0 0 0 7px rgba(184,120,80,.22), inset 18px 0 35px rgba(0,0,0,.42); transform: translateZ(15px); }
.cover-author { font-size: clamp(.42rem, .65vw, .62rem); text-transform: uppercase; letter-spacing: .26em; text-align: center; }
.cover-rule { width: 32%; height: 1px; background: rgba(218,155,110,.5); margin: 12% auto 18%; }
.cover-title { font-family: Georgia, serif; text-align: center; font-size: clamp(1.35rem, 2.5vw, 2.5rem); line-height: 1.12; }
.cover-key { margin: auto auto 0; font-size: 2rem; transform: rotate(-24deg); color: var(--copper-bright); }
.book-spine { position: absolute; top: 1%; bottom: 1%; left: -17px; width: 30px; background: #081116; transform: rotateY(90deg); }
.book-pages { position: absolute; z-index: -1; inset: 7px -12px 7px 10px; background: repeating-linear-gradient(90deg, #bcb4a5 0 1px, #ded5c5 1px 3px); transform: translateZ(-4px); }
.book-shadow { position: absolute; width: 65%; height: 12%; bottom: 12%; border-radius: 50%; background: rgba(0,0,0,.6); filter: blur(24px); transform: rotate(-4deg); }
.mist { position: absolute; z-index: -1; width: 40rem; height: 18rem; border-radius: 50%; background: rgba(113, 148, 153, .07); filter: blur(55px); }
.mist-one { right: -8rem; top: 22%; animation: drift 12s ease-in-out infinite; }
.mist-two { left: 15%; bottom: -8%; animation: drift 15s ease-in-out infinite reverse; }
.scroll-note { position: absolute; left: clamp(1.5rem, 5vw, 5rem); bottom: 2rem; display: flex; align-items: center; gap: 1rem; color: rgba(233,225,210,.5); font-family: Georgia, serif; font-style: italic; font-size: .78rem; }
.scroll-note span { display: block; width: 44px; height: 1px; background: var(--copper); }

.section { padding: clamp(6rem, 11vw, 10rem) clamp(1.5rem, 8vw, 9rem); border-top: 1px solid var(--line); position: relative; }
.section-heading { max-width: 970px; margin-bottom: clamp(3.5rem, 7vw, 6rem); }
h2 { margin: 0; font-size: clamp(2.5rem, 5vw, 5.3rem); line-height: 1.02; letter-spacing: -.045em; }
.section-intro { max-width: 58ch; color: var(--paper-soft); margin: 1.7rem 0 0; }
.premise { background: linear-gradient(125deg, rgba(15,35,45,.4), transparent 60%); }
.premise-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .82fr); gap: clamp(4rem, 10vw, 10rem); align-items: center; max-width: 1280px; margin: auto; }
.premise-copy { max-width: 660px; }
.premise-copy p { color: var(--paper-soft); }
.premise-copy .lead { color: var(--paper); font-family: Georgia, serif; font-size: clamp(1.25rem, 2vw, 1.75rem); line-height: 1.52; }
blockquote { margin: 3rem 0 0; padding: 2rem 0 2rem 2rem; border-left: 1px solid var(--copper); color: var(--copper-bright); font-size: clamp(1.3rem, 2.2vw, 2rem); line-height: 1.45; }
.threshold { display: grid; justify-items: center; }
.door-frame { width: min(100%, 320px); aspect-ratio: .68; padding: 18px; position: relative; border: 1px solid rgba(218,155,110,.24); background: #060d12; box-shadow: var(--shadow), inset 0 0 35px rgba(0,0,0,.8); perspective: 1100px; }
.door { position: absolute; inset: 18px; transform-origin: left center; border: 1px solid rgba(218,155,110,.31); background: linear-gradient(125deg, #14242d, #0a141a 65%); color: var(--paper-soft); cursor: pointer; transition: transform 1.25s cubic-bezier(.2,.7,.2,1), filter .4s ease; z-index: 2; box-shadow: inset -24px 0 55px rgba(0,0,0,.4); }
.door:hover { filter: brightness(1.18); }
.threshold.is-open .door { transform: rotateY(-77deg); }
.door-number { position: absolute; top: 13%; left: 0; right: 0; color: rgba(218,155,110,.64); font-family: Georgia, serif; font-size: 1.25rem; letter-spacing: .18em; }
.door-handle { position: absolute; right: 14%; top: 51%; width: 9px; height: 9px; border-radius: 50%; background: var(--copper-bright); box-shadow: 0 0 0 5px rgba(184,120,80,.08), 0 0 18px rgba(218,155,110,.35); }
.door-light { position: absolute; inset: 18px; display: grid; place-content: center; gap: .4rem; padding: 2rem 2rem 2rem 4rem; color: #172831; background: radial-gradient(circle at 30% 45%, #efe6cf, #c79f72 70%, #765036); font-family: Georgia, serif; line-height: 1.4; opacity: .94; }
.door-light strong { font-weight: 400; font-style: italic; }
.interaction-hint { margin: 1.2rem 0 0; color: rgba(233,225,210,.5); text-transform: uppercase; letter-spacing: .18em; font-size: .6rem; }

.characters { background: #09131a; }
.character-layout { display: grid; grid-template-columns: minmax(250px, .6fr) minmax(0, 1.4fr); gap: clamp(2rem, 7vw, 7rem); max-width: 1260px; margin: auto; }
.character-tabs { border-top: 1px solid var(--line); }
.character-tab { width: 100%; display: grid; grid-template-columns: 2rem 1fr; gap: 1rem; text-align: left; padding: 1.3rem .4rem; border: 0; border-bottom: 1px solid var(--line); color: var(--paper-soft); background: transparent; cursor: pointer; transition: color .25s ease, padding-left .25s ease, background .25s ease; }
.character-tab:hover, .character-tab:focus-visible, .character-tab.is-active { color: var(--paper); padding-left: .8rem; background: linear-gradient(90deg, rgba(184,120,80,.1), transparent); }
.character-tab.is-active .tab-number { color: var(--copper-bright); }
.character-tab span:last-child { display: grid; gap: .15rem; }
.character-tab strong { font-family: Georgia, serif; font-size: 1.14rem; font-weight: 400; }
.character-tab small, .tab-number { font-size: .65rem; text-transform: uppercase; letter-spacing: .14em; }
.tab-number { padding-top: .28rem; color: rgba(233,225,210,.35); }
.character-panel { min-height: 470px; display: grid; grid-template-columns: minmax(150px, .55fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; padding: clamp(2rem, 5vw, 4.5rem); border: 1px solid var(--line); background: linear-gradient(130deg, rgba(22,44,55,.7), rgba(7,15,21,.7)); box-shadow: var(--shadow); }
.portrait-mark { aspect-ratio: .76; display: grid; place-items: center; color: rgba(218,155,110,.73); border: 1px solid rgba(218,155,110,.28); background: radial-gradient(circle at 50% 34%, rgba(184,120,80,.18), transparent 23%), linear-gradient(145deg, #152a34, #071015); font-family: Georgia, serif; font-size: clamp(3rem, 6vw, 6rem); letter-spacing: -.08em; box-shadow: inset 0 0 60px rgba(0,0,0,.5); }
.character-panel h3, .symbol-detail h3 { margin: 0 0 1rem; color: var(--paper); font-size: clamp(2.2rem, 4vw, 4.4rem); line-height: 1; }
.character-panel > div:last-child > p:not(.panel-role) { max-width: 57ch; color: var(--paper-soft); }
.character-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 2rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.character-facts div { min-width: 0; }
.character-facts dt { color: var(--copper-bright); font-size: .6rem; text-transform: uppercase; letter-spacing: .16em; }
.character-facts dd { margin: .5rem 0 0; color: var(--paper-soft); font-size: .78rem; line-height: 1.4; }
.character-panel.is-changing { animation: panelChange .38s ease; }

.map-section { padding-bottom: 0; background: radial-gradient(circle at 45% 38%, rgba(20,54,64,.5), transparent 35rem), #071018; }
.map-shell { max-width: 1320px; margin: auto; display: grid; grid-template-columns: minmax(620px, 1.4fr) minmax(260px, .6fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.symbol-map { position: relative; width: 100%; aspect-ratio: 760 / 590; min-height: 540px; }
.map-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.map-lines line { stroke: rgba(233,225,210,.13); stroke-width: 1; transition: stroke .35s ease, stroke-width .35s ease, opacity .35s ease; }
.map-lines line.is-active { stroke: var(--copper-bright); stroke-width: 1.7; filter: drop-shadow(0 0 4px rgba(218,155,110,.5)); }
.map-center, .symbol-node { position: absolute; translate: -50% -50%; border-radius: 50%; display: grid; place-content: center; text-align: center; }
.map-center { left: 48.7%; top: 48.2%; width: 122px; aspect-ratio: 1; border: 1px solid var(--copper); color: var(--paper); background: #132630; box-shadow: 0 0 0 15px rgba(184,120,80,.045), 0 0 55px rgba(184,120,80,.13); }
.map-center span, .symbol-node span { font-family: Georgia, serif; }
.map-center small, .symbol-node small { color: rgba(233,225,210,.5); font-size: .55rem; text-transform: uppercase; letter-spacing: .12em; }
.symbol-node { width: 98px; aspect-ratio: 1; border: 1px solid rgba(233,225,210,.22); color: var(--paper-soft); background: rgba(7,16,24,.8); backdrop-filter: blur(6px); cursor: pointer; transition: transform .3s ease, border-color .3s ease, color .3s ease, background .3s ease, opacity .3s ease; }
.symbol-node:hover, .symbol-node:focus-visible, .symbol-node.is-active { transform: scale(1.09); border-color: var(--copper-bright); color: var(--paper); background: #152b35; outline: none; box-shadow: 0 0 22px rgba(184,120,80,.16); }
.symbol-node.is-related { border-color: rgba(218,155,110,.58); }
.symbol-map.has-selection .symbol-node:not(.is-active):not(.is-related) { opacity: .42; }
.node-armadio { left: 15.5%; top: 21.5%; }
.node-porta { left: 45.5%; top: 13.4%; }
.node-chiave { left: 80.3%; top: 24.6%; }
.node-vento { left: 76%; top: 54.2%; }
.node-respiro { left: 82.4%; top: 83.5%; }
.node-valle { left: 46.7%; top: 88.1%; }
.node-fotografia { left: 12.6%; top: 55.3%; }
.node-leo { left: 15.5%; top: 79.5%; }
.node-bambino { left: 24.7%; top: 49.7%; width: 88px; }
.symbol-detail { min-height: 330px; padding: 2.4rem; border-left: 1px solid var(--copper); background: rgba(5,12,17,.6); }
.symbol-detail h3 { font-size: clamp(2.3rem, 4vw, 4rem); }
.symbol-detail > p:not(.detail-kicker) { color: var(--paper-soft); }
.connections { margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.connections span { color: var(--copper-bright); text-transform: uppercase; letter-spacing: .18em; font-size: .6rem; }
.connections p { margin: .4rem 0 0; color: var(--paper); font-family: Georgia, serif; }
.symbol-detail.is-changing { animation: panelChange .38s ease; }

.structure { max-width: 1320px; margin: clamp(6rem, 10vw, 10rem) auto 0; padding: clamp(2rem, 5vw, 4rem) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.structure-header { display: flex; justify-content: space-between; gap: 2rem; align-items: baseline; margin-bottom: 2.8rem; }
.structure-header .section-index { margin: 0; }
.structure-header h3 { margin: 0; font-size: clamp(1.6rem, 3vw, 3rem); }
.movements { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0; padding: 0; list-style: none; background: var(--line); }
.movements li { min-height: 180px; display: grid; grid-template-columns: 2rem 1fr; gap: 1rem; padding: 2rem; background: var(--night); transition: background .3s ease; }
.movements li:hover { background: #10212a; }
.movement-index { color: var(--copper-bright); font-family: Georgia, serif; }
.movements strong { display: block; font-family: Georgia, serif; font-size: 1.35rem; font-weight: 400; }
.movements p { margin: .7rem 0 0; color: var(--paper-soft); font-size: .85rem; }
.site-footer { max-width: 1320px; margin: auto; min-height: 160px; display: flex; justify-content: space-between; gap: 2rem; align-items: center; color: rgba(233,225,210,.48); font-size: .7rem; }
.site-footer div { display: grid; }
.site-footer div span { color: var(--paper); font-family: Georgia, serif; font-size: 1.05rem; }
.site-footer div small { text-transform: uppercase; letter-spacing: .11em; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .75s ease, transform .75s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@keyframes bookFloat { 0%,100% { transform: rotateY(-14deg) rotateX(7deg) rotateZ(2deg) translateY(0); } 50% { transform: rotateY(-10deg) rotateX(5deg) rotateZ(1deg) translateY(-15px); } }
@keyframes drift { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(-3rem,1rem,0) scale(1.08); } }
@keyframes breathe { 0%,100% { transform: scaleX(1); opacity: .6; } 50% { transform: scaleX(1.6); opacity: 1; } }
@keyframes panelChange { 0% { opacity: .45; transform: translateY(7px); } 100% { opacity: 1; transform: translateY(0); } }

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto; }
  .nav { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 9rem; }
  .book-scene { position: absolute; z-index: -1; width: 50vw; height: 55vh; right: -5vw; top: 27%; opacity: .22; }
  .premise-grid, .character-layout, .map-shell { grid-template-columns: 1fr; }
  .threshold { margin-top: 1rem; }
  .character-tabs { display: grid; grid-template-columns: repeat(2, 1fr); }
  .character-tab { border-right: 1px solid var(--line); }
  .symbol-map { max-width: 760px; margin: auto; }
  .symbol-detail { max-width: 650px; min-height: 0; }
}

@media (max-width: 680px) {
  .site-header { min-height: 64px; padding-inline: 1rem; }
  .private-badge { font-size: 0; }
  .private-badge::after { content: "Privato"; font-size: .58rem; }
  .wordmark { font-size: .6rem; }
  .hero { min-height: 92svh; padding: 7.5rem 1.25rem 5rem; }
  .hero::after { width: 90vw; height: 90vw; }
  h1 { font-size: clamp(3rem, 15vw, 5rem); }
  .section { padding: 5rem 1.25rem; }
  .premise-grid { gap: 3rem; }
  .character-tabs { grid-template-columns: 1fr; }
  .character-panel { grid-template-columns: 1fr; padding: 1.25rem; min-height: 0; }
  .portrait-mark { width: 100%; max-height: 210px; aspect-ratio: 1.7; }
  .character-facts { grid-template-columns: 1fr; }
  .symbol-map { min-height: 510px; aspect-ratio: .74; }
  .map-lines { display: none; }
  .map-center { left: 50%; top: 49%; width: 106px; }
  .symbol-node { width: 80px; }
  .node-armadio { left: 14%; top: 14%; }
  .node-porta { left: 50%; top: 9%; }
  .node-chiave { left: 86%; top: 16%; }
  .node-vento { left: 88%; top: 43%; }
  .node-respiro { left: 83%; top: 76%; }
  .node-valle { left: 50%; top: 91%; }
  .node-fotografia { left: 14%; top: 45%; }
  .node-leo { left: 17%; top: 78%; }
  .node-bambino { left: 50%; top: 72%; width: 76px; }
  .structure-header, .site-footer { display: grid; }
  .movements { grid-template-columns: 1fr; }
  .movements li { min-height: 140px; }
  .site-footer { padding: 3rem 0; align-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
