/* ============ Nuova Banda di Orzano - versione 2 (immersiva) ============ */
:root {
  --ink: #0a1030;
  --ink-2: #101a47;
  --navy: #14286b;
  --blue: #3a56d4;
  --yellow: #f4c24d;
  --red: #e8613f;
  --cream: #f7f1e3;
  --text: #e9ebf7;
  --muted: #9aa0c3;
  --line: rgba(255, 255, 255, .14);
  --display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

html { overflow-x: clip; scroll-behavior: smooth; background: var(--ink); }
body {
  margin: 0; background: var(--ink); color: var(--text); overflow-x: clip;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
::selection { background: var(--yellow); color: var(--ink); }
.font-display { font-family: var(--display); }
.font-serif-i { font-family: var(--serif); font-style: italic; font-weight: 400; }

/* grana di fondo */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* barra di avanzamento */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 120; background: linear-gradient(90deg, var(--yellow), var(--red)); transform-origin: 0 50%; transform: scaleX(0); }

/* cursore personalizzato (solo dispositivi con mouse) */
.cur-dot, .cur-ring { position: fixed; top: 0; left: 0; z-index: 130; pointer-events: none; border-radius: 50%; opacity: 0; transition: opacity .3s; }
.cur-dot { width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--yellow); }
.cur-ring { width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 1.5px solid rgba(255, 255, 255, .7); mix-blend-mode: difference; transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .35s, opacity .3s; }
.has-cursor .cur-dot, .has-cursor .cur-ring { opacity: 1; }
.cur-ring.is-hover { width: 84px; height: 84px; margin: -42px 0 0 -42px; background: rgba(244, 194, 77, .9); border-color: transparent; }
@media (hover: hover) and (pointer: fine) { .has-cursor, .has-cursor a, .has-cursor button { cursor: none; } }

/* alone che segue il mouse */
.glow { position: fixed; top: 0; left: 0; width: 640px; height: 640px; margin: -320px 0 0 -320px; z-index: 1; pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle, rgba(58, 86, 212, .28), transparent 62%); filter: blur(30px); opacity: 0; transition: opacity .6s; }
.has-cursor .glow { opacity: 1; }

/* transizione tra pagine */
.curtain { position: fixed; inset: 0; z-index: 200; background: var(--yellow); transform: translateY(100%); pointer-events: none; }
.curtain.in { transition: transform .55s var(--ease); transform: translateY(0); }
.page-enter .curtain { transform: translateY(0); animation: curtainOut .8s var(--ease) .05s forwards; }
@keyframes curtainOut { to { transform: translateY(-100%); } }

/* navigazione */
.nav-link { position: relative; padding: .55rem 1rem; border-radius: 999px; font-weight: 600; font-size: .9rem; letter-spacing: .01em; color: var(--text); transition: color .3s, background .3s; }
.nav-link:hover { background: rgba(255, 255, 255, .1); }
.nav-link[aria-current="page"] { background: var(--yellow); color: var(--ink); }
.glass { background: rgba(14, 18, 48, .55); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); border: 1px solid var(--line); }
.logo-pill { background: #fff; border-radius: 999px; padding: 4px 12px; display: block; }
.logo-pill img { height: 34px; width: auto; display: block; }
.burger { width: 46px; height: 46px; border-radius: 50%; background: var(--yellow); position: relative; border: 0; }
.burger span, .burger span::before { content: ""; position: absolute; left: 14px; width: 18px; height: 2px; background: var(--ink); transition: transform .4s var(--ease); }
.burger span { top: 17px; } .burger span::before { top: 10px; left: 0; }
.menu-open .burger span { transform: translateY(5px) rotate(45deg); }
.menu-open .burger span::before { transform: translateY(-5px) rotate(-90deg); }
.overlay-menu { position: fixed; inset: 0; z-index: 60; background: var(--ink); display: flex; flex-direction: column; justify-content: center; padding: 100px 28px 40px; clip-path: circle(0 at calc(100% - 44px) 44px); transition: clip-path .7s var(--ease); pointer-events: none; }
.menu-open .overlay-menu { clip-path: circle(150% at calc(100% - 44px) 44px); pointer-events: auto; }
.overlay-menu a { font-family: var(--display); font-weight: 700; font-size: clamp(2.6rem, 12vw, 4.5rem); line-height: 1.1; color: var(--text); opacity: 0; transform: translateY(30px); transition: opacity .5s, transform .6s var(--ease), color .3s; }
.menu-open .overlay-menu a { opacity: 1; transform: none; }
.overlay-menu a:nth-child(2) { transition-delay: .06s; } .overlay-menu a:nth-child(3) { transition-delay: .12s; }
.overlay-menu a:nth-child(4) { transition-delay: .18s; } .overlay-menu a:nth-child(5) { transition-delay: .24s; }
.overlay-menu a[aria-current="page"] { color: var(--yellow); }

/* titoli spezzati per parole */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }
.split .w > span { display: inline-block; transform: translateY(110%); transition: transform 1s var(--ease); transition-delay: calc(var(--i) * 70ms + var(--d, 0ms)); }
.split.in .w > span { transform: none; }

/* reveal */
.rv { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0ms); }
.rv.in { opacity: 1; transform: none; }
.clip-rv { clip-path: inset(0 0 100% 0); transition: clip-path 1.2s var(--ease); }
.clip-rv.in { clip-path: inset(0); }

/* bottoni magnetici */
.magnetic { display: inline-flex; transition: transform .3s var(--ease); will-change: transform; }
.btn-y { display: inline-flex; align-items: center; gap: .7rem; background: var(--yellow); color: var(--ink); font-weight: 700; padding: 1.05rem 1.9rem; border-radius: 999px; transition: background .3s, box-shadow .3s; }
.btn-y:hover { box-shadow: 0 18px 50px -12px rgba(244, 194, 77, .7); }
.btn-y .ar { transition: transform .4s var(--ease); }
.btn-y:hover .ar { transform: translateX(6px) rotate(-45deg); }

/* ---------- HERO ---------- */
.hero { position: relative; height: 100svh; min-height: 620px; overflow: hidden; isolation: isolate; background: var(--ink-2); }
.hs { position: absolute; inset: 0; opacity: 0; clip-path: inset(0 0 0 100%); transition: opacity .01s .9s, clip-path 1.1s var(--ease); z-index: 0; }
.hs.on { opacity: 1; clip-path: inset(0); transition: opacity .01s, clip-path 1.1s var(--ease); z-index: 1; }
.hs.leave { opacity: 1; clip-path: inset(0); z-index: 0; transition: none; }
.hs img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.18); transition: transform 8s linear; }
.hs.on img { transform: scale(1.02); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(180deg, rgba(10, 16, 48, .55) 0%, transparent 28%, transparent 40%, rgba(10, 16, 48, .92) 100%); }
.years-art { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: clamp(.5rem, 4vw, 4rem); font-family: var(--display); font-weight: 800; line-height: .8; padding-bottom: 36vh;
  background: radial-gradient(900px 520px at 70% 20%, rgba(58, 86, 212, .5), transparent 60%), radial-gradient(700px 480px at 15% 85%, rgba(232, 97, 63, .28), transparent 60%), var(--ink-2); }
.years-art .y { font-size: clamp(2.6rem, 10vw, 9rem); color: transparent; -webkit-text-stroke: 2px rgba(255, 255, 255, .55); }
.years-art .n { font-size: clamp(6rem, 21vw, 19rem); color: var(--yellow); letter-spacing: -.06em; text-shadow: 0 0 80px rgba(244, 194, 77, .35); }
.hero-title { font-family: var(--display); font-weight: 800; text-transform: uppercase; line-height: .86; letter-spacing: -.045em; font-size: clamp(2.7rem, 10.5vw, 10.5rem); }
.hero-dots { display: flex; gap: 8px; }
.hero-dots button { height: 4px; width: 56px; background: rgba(255, 255, 255, .25); border: 0; border-radius: 4px; position: relative; overflow: hidden; padding: 0; }
.hero-dots button::before { content: ""; position: absolute; inset: 0; background: var(--yellow); transform: scaleX(0); transform-origin: 0 50%; }
.hero-dots button.on::before { transform: scaleX(1); }
.hero.run .hero-dots button.on::before { transform: scaleX(0); animation: fillbar var(--dur, 6500ms) linear forwards; }
@keyframes fillbar { to { transform: scaleX(1); } }
.cap-pill.swap { animation: capIn .8s var(--ease); }
@keyframes capIn { from { opacity: 0; transform: translateY(14px); } }
.scroll-cue { width: 26px; height: 44px; border: 1.5px solid rgba(255, 255, 255, .55); border-radius: 20px; position: relative; }
.scroll-cue::after { content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 3px; background: var(--yellow); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { opacity: 1; transform: translateY(0); } 80%, 100% { opacity: 0; transform: translateY(16px); } }

/* marquee */
.marq { overflow: hidden; border-block: 1px solid var(--line); padding: 1.4rem 0; background: var(--ink); }
.marq-in { display: flex; gap: 3rem; width: max-content; animation: marq 40s linear infinite; font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 6vw, 5rem); letter-spacing: -.03em; text-transform: uppercase; white-space: nowrap; }
.marq-in span:nth-child(even) { color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, .5); }
.marq-in i { color: var(--yellow); font-style: normal; }
@keyframes marq { to { transform: translateX(-50%); } }
.marq:hover .marq-in { animation-play-state: paused; }

/* elenco sezioni con anteprima che segue il mouse */
.rows a.row { display: grid; grid-template-columns: auto 1fr auto; gap: 1.2rem; align-items: center; padding: 2.2rem 0; border-top: 1px solid var(--line); position: relative; transition: padding .5s var(--ease), color .3s; }
.rows a.row:last-child { border-bottom: 1px solid var(--line); }
.rows .num { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 1.4rem; }
.rows .ttl { font-family: var(--display); font-weight: 800; font-size: clamp(2.4rem, 8vw, 7rem); letter-spacing: -.045em; line-height: 1; text-transform: uppercase; transition: transform .5s var(--ease), color .3s; }
.rows .arr { width: 64px; height: 64px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 1.6rem; transition: background .3s, color .3s, transform .5s var(--ease), border-color .3s; }
.rows a.row:hover .ttl { transform: translateX(18px); color: var(--yellow); }
.rows a.row:hover .arr { background: var(--yellow); color: var(--ink); border-color: var(--yellow); transform: rotate(-45deg); }
.rows .thumb { display: none; }
.preview { position: fixed; top: 0; left: 0; z-index: 55; width: 340px; height: 230px; border-radius: 18px; overflow: hidden; pointer-events: none; opacity: 0; transform: scale(.7); transition: opacity .35s, transform .5s var(--ease); box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .7); }
.preview.on { opacity: 1; transform: scale(1); }
.preview img { width: 100%; height: 100%; object-fit: cover; }
@media (hover: none), (max-width: 820px) {
  .preview { display: none; }
  .rows a.row { grid-template-columns: 1fr auto; grid-template-areas: "thumb thumb" "ttl arr"; padding: 1.6rem 0; }
  .rows .num { display: none; }
  .rows .thumb { display: block; grid-area: thumb; border-radius: 18px; overflow: hidden; aspect-ratio: 16 / 9; }
  .rows .thumb img { width: 100%; height: 100%; object-fit: cover; }
  .rows .ttl { grid-area: ttl; font-size: clamp(2.2rem, 11vw, 4rem); }
  .rows .arr { grid-area: arr; width: 52px; height: 52px; }
}

/* ---------- pagine interne ---------- */
.p-hero { position: relative; min-height: 78svh; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; }
.p-hero .bgi { position: absolute; inset: -6% 0; z-index: -2; }
.p-hero .bgi img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; }
.p-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 16, 48, .55), rgba(10, 16, 48, .15) 35%, rgba(10, 16, 48, .95)); }
.p-hero.plain { min-height: 62svh; background: radial-gradient(900px 520px at 80% 10%, rgba(58, 86, 212, .55), transparent 60%), radial-gradient(600px 400px at 10% 90%, rgba(232, 97, 63, .25), transparent 60%), var(--ink-2); }
.p-hero.plain::after { display: none; }
.p-title { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: -.045em; line-height: .88; font-size: clamp(3rem, 12vw, 11rem); }
.eyebrow { font-family: var(--serif); font-style: italic; color: var(--yellow); font-size: clamp(1.3rem, 2.4vw, 2rem); }

.paper { background: var(--cream); color: #14172e; }
.paper ::selection { background: var(--ink); color: var(--yellow); }
.story p { font-size: clamp(1.05rem, 1.5vw, 1.25rem); line-height: 1.75; margin: 0 0 1.5em; }
.story p:first-child { font-family: var(--serif); font-size: clamp(1.7rem, 3.4vw, 2.7rem); line-height: 1.25; color: var(--navy); }
.story p:first-child::first-letter { float: left; font-family: var(--display); font-weight: 800; font-size: 6.6rem; line-height: .78; padding: .06em .1em 0 0; color: #d12c2c; }

/* classi di studio */
.cls { counter-reset: c; }
.cls li { counter-increment: c; display: flex; align-items: center; gap: 1.2rem; padding: 1.5rem 0; border-top: 1px solid var(--line); font-family: var(--display); font-weight: 700; font-size: clamp(1.4rem, 3.6vw, 2.8rem); letter-spacing: -.02em; text-transform: uppercase; transition: padding .5s var(--ease), color .3s, background .3s; }
.cls li:last-child { border-bottom: 1px solid var(--line); }
.cls li::before { content: counter(c, decimal-leading-zero); font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.2rem; color: var(--muted); min-width: 2.2rem; }
.cls li::after { content: "♪"; margin-left: auto; color: var(--yellow); opacity: 0; transform: translateX(-20px) rotate(-20deg); transition: opacity .4s, transform .5s var(--ease); }
.cls li:hover { padding-left: 1.4rem; color: var(--yellow); }
.cls li:hover::after { opacity: 1; transform: none; }

/* card di vetro */
.card-g { background: linear-gradient(160deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03)); border: 1px solid var(--line); border-radius: 28px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform .5s var(--ease), border-color .3s, background .3s; }
.card-g:hover { transform: translateY(-8px); border-color: rgba(244, 194, 77, .6); }
.card-g a { transition: color .3s; word-break: break-word; }
.card-g a:hover { color: var(--yellow); }
.tel, .mail { display: block; padding: .15rem 0; font-weight: 600; white-space: normal; }
a[href^="tel"] { white-space: nowrap; }

/* iframe e mappe */
.frame { border-radius: 28px; overflow: hidden; border: 1px solid var(--line); background: var(--ink-2); aspect-ratio: 16 / 10; }
.frame iframe { width: 100%; height: 100%; border: 0; display: block; filter: saturate(1.1); }
.map-card img { transition: transform 1s var(--ease); }
.map-card:hover img { transform: scale(1.08); }

/* footer */
.wordmark { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: -.06em; line-height: .8; font-size: clamp(3.2rem, 17.5vw, 18rem); color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, .28); white-space: nowrap; user-select: none; transition: color .6s, -webkit-text-stroke-color .6s; }
.foot:hover .wordmark { color: var(--yellow); -webkit-text-stroke-color: var(--yellow); }
.sp a { background: #fff; border-radius: 16px; padding: 12px 18px; display: grid; place-items: center; transition: transform .4s var(--ease); }
.sp a:hover { transform: translateY(-6px) rotate(-2deg); }
.sp img { height: 32px; width: auto; }
.soc a { width: 56px; height: 56px; border-radius: 50%; background: #fff; display: grid; place-items: center; transition: transform .4s var(--ease); }
.soc a:hover { transform: translateY(-6px) rotate(-8deg); }
.soc img { width: 28px; height: 28px; object-fit: contain; }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 300; background: var(--yellow); color: var(--ink); padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .split .w > span, .rv, .clip-rv { transform: none; opacity: 1; clip-path: none; }
  .hs { clip-path: none; } .marq-in { animation: none; }
}

/* ---------- galleria scorrevole ---------- */
.gal { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 max(20px, calc((100vw - 1280px) / 2)) 24px; scroll-padding-inline: max(20px, calc((100vw - 1280px) / 2)); scrollbar-width: none; cursor: grab; }
.gal::-webkit-scrollbar { display: none; }
.gal.drag { cursor: grabbing; scroll-snap-type: none; }
.gal figure { flex: 0 0 min(78vw, 560px); margin: 0; scroll-snap-align: start; }
.gal .ph { border-radius: 26px; overflow: hidden; aspect-ratio: 4 / 3; position: relative; }
.gal img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); pointer-events: none; -webkit-user-drag: none; }
.gal figure:hover img { transform: scale(1.08); }
.gal figcaption { padding: 14px 4px 0; font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--text); }

/* ---------- eventi ---------- */
.ev { display: grid; grid-template-columns: 110px 1fr auto; gap: 1.4rem; align-items: center; padding: 1.5rem 0; border-top: 1px solid rgba(10, 16, 48, .16); transition: padding .4s var(--ease); }
.ev:last-child { border-bottom: 1px solid rgba(10, 16, 48, .16); }
.ev:hover { padding-left: 1rem; }
.ev .d { font-family: var(--display); font-weight: 800; font-size: 2.6rem; line-height: .9; color: var(--navy); }
.ev .d small { display: block; font: 600 .8rem/1.2 'Inter', sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #6a6f8e; margin-top: 6px; }
.ev .t { font-family: var(--display); font-weight: 700; font-size: clamp(1.3rem, 2.6vw, 2rem); letter-spacing: -.02em; }
.ev .l { color: #5a5f80; font-size: .95rem; }
@media (max-width: 640px) { .ev { grid-template-columns: 80px 1fr; } .ev .go { display: none; } }

/* nasconde il testo scritto dentro la foto dei contatti (ora è testo vero nella pagina) */
.hide-baked { background: linear-gradient(180deg, transparent 52%, var(--ink) 70%); }
@media (max-width: 768px) { .hide-baked { background: linear-gradient(180deg, transparent 24%, var(--ink) 40%); } }
