/* Florence Space — motion layer. All animation is scoped to html.motion,
   which motion.js adds only when the visitor does not prefer reduced motion. */
:root { --ease: cubic-bezier(.2, .8, .2, 1); --ease-in-out: cubic-bezier(.65, 0, .35, 1); }

/* ---------- page transitions (cross-document view transitions + fallback) ---------- */
@view-transition { navigation: auto; }
.topbar { view-transition-name: topbar; }
::view-transition-old(root) { animation: vt-out .28s var(--ease-in-out) both; }
::view-transition-new(root) { animation: vt-in .45s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-10px); filter: blur(4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } }
.motion body { animation: page-in .6s var(--ease) both; }
@keyframes page-in { from { opacity: 0; } }

/* ---------- scroll progress + shrinking top bar ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--gold), #e0b4a5); transform-origin: 0 50%; transform: scaleX(0); z-index: 40; pointer-events: none; }
.topbar { transition: box-shadow .3s, background .3s; }
.topbar .wrap { transition: height .35s var(--ease); }
.topbar.scrolled { box-shadow: 0 10px 30px -22px rgba(0, 0, 0, .35); background: rgba(255, 255, 255, .9); }
.topbar.scrolled .wrap { height: 58px; }
.brand img { transition: transform .5s var(--ease); }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.nav a:not(.btn) { position: relative; }
.nav a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease); }
.nav a:not(.btn):hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- buttons: shine + magnetic ---------- */
.btn { position: relative; overflow: hidden; transition: background .2s, color .2s, border-color .2s, transform .25s var(--ease), box-shadow .25s; }
.btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-120%); pointer-events: none; }
.motion .btn:hover::after { transform: translateX(120%); transition: transform .8s var(--ease); }
.btn:active { transform: scale(.97) !important; }
.btn:not(.ghost):hover { box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .6); }

/* ---------- reveal on scroll ---------- */
.motion [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0ms); }
.motion [data-reveal="left"] { transform: translateX(-30px); }
.motion [data-reveal="scale"] { transform: scale(.96); }
.motion [data-reveal].in { opacity: 1; transform: none; }

/* ---------- hero headline words ---------- */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .04em .12em; margin: 0 -.04em -.12em; }
.split .w > span { display: inline-block; transform: translateY(110%) rotate(4deg); animation: word-up 1s var(--ease) forwards; }
@keyframes word-up { to { transform: none; } }
.motion .hero .caps, .motion .hero p, .motion .hero .cta { animation: fade-up .9s var(--ease) both; }
.motion .hero .caps { animation-delay: .05s; }
.motion .hero p { animation-delay: .55s; }
.motion .hero .cta { animation-delay: .7s; }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } }
.hero h1 em, .hero h1 em .w > span { color: var(--gold); }

/* ---------- hero light + viewfinder autofocus ---------- */
.hero { position: relative; }
.hero::before { content: ""; position: absolute; inset: -40px calc(-1 * clamp(18px, 4vw, 64px)); pointer-events: none; z-index: -1;
  background: radial-gradient(520px circle at var(--mx, 75%) var(--my, 45%), rgba(176, 122, 102, .14), transparent 60%); transition: background .2s; }
.viewfinder { transform: perspective(900px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)); transition: transform .5s var(--ease); transform-style: preserve-3d; }
.viewfinder img { transform: translate(var(--tx, 0), var(--ty, 0)); transition: transform .5s var(--ease); }
.motion .viewfinder::before { animation: c-tl 1.1s var(--ease) .25s both; }
.motion .viewfinder::after { animation: c-tr 1.1s var(--ease) .35s both; }
.motion .viewfinder i::before { animation: c-bl 1.1s var(--ease) .45s both; }
.motion .viewfinder i::after { animation: c-br 1.1s var(--ease) .55s both; }
@keyframes c-tl { from { opacity: 0; transform: translate(-40px, -40px); } }
@keyframes c-tr { from { opacity: 0; transform: translate(40px, -40px); } }
@keyframes c-bl { from { opacity: 0; transform: translate(-40px, 40px); } }
@keyframes c-br { from { opacity: 0; transform: translate(40px, 40px); } }
.motion .viewfinder img { animation: focus-in 1.5s var(--ease) .2s both; }
@keyframes focus-in { 0% { opacity: 0; filter: blur(14px); scale: 1.08; } 55% { opacity: 1; filter: blur(3px); scale: 1.01; } 70% { filter: blur(5px); } 100% { filter: blur(0); scale: 1; } }
.viewfinder.locked::before, .viewfinder.locked::after, .viewfinder.locked i::before, .viewfinder.locked i::after { animation: af-lock .9s ease both; }
@keyframes af-lock { 0%, 100% { border-color: var(--ink); } 20%, 60% { border-color: var(--gold); } 40% { border-color: var(--ink); } }
.af-box { position: absolute; left: 50%; top: 42%; width: 64px; height: 44px; margin: -22px 0 0 -32px; border: 1.5px solid var(--gold); opacity: 0; pointer-events: none; }
.motion .af-box { animation: af-box 1.6s ease .5s both; }
@keyframes af-box { 0% { opacity: 0; transform: scale(1.8); } 25% { opacity: 1; transform: scale(1); } 40%, 60% { opacity: .2; } 50%, 70% { opacity: 1; } 100% { opacity: 0; } }
.spark { position: absolute; color: var(--gold); font-size: 16px; opacity: 0; pointer-events: none; }
.motion .spark { animation: twinkle 3.2s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0); } 45% { opacity: 1; transform: scale(1.1) rotate(90deg); } 60% { opacity: .8; transform: scale(.9) rotate(120deg); } }

/* ---------- marquee band ---------- */
.marquee { margin-inline: calc(50% - 50vw); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); overflow: hidden; padding: 18px 0; user-select: none; }
.marquee .track { display: flex; width: max-content; gap: 0; }
.motion .marquee .track { animation: marquee 38s linear infinite; }
.marquee:hover .track { animation-play-state: paused; }
.marquee span { font: italic 400 clamp(26px, 3.2vw, 44px) var(--serif); padding: 0 28px; white-space: nowrap; display: flex; align-items: center; gap: 56px; }
.marquee span::after { content: "✦"; font: normal 400 16px var(--sans); color: var(--gold); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- theme cards ---------- */
.theme-card { position: relative; overflow: hidden; transition: background .3s; }
.theme-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(320px circle at var(--x, 50%) var(--y, 50%), rgba(176, 122, 102, .16), transparent 65%); }
.theme-card:hover::before { opacity: 1; }
.theme-card:hover { background: var(--paper); }
.theme-card .n, .theme-card h3, .theme-card .go { transition: transform .45s var(--ease), color .3s; }
.theme-card:hover .n { transform: translateX(6px); }
.theme-card:hover h3 { transform: translateY(-3px); }
.theme-card h3 { position: relative; display: inline-block; align-self: flex-start; }
.theme-card h3::after { content: ""; position: absolute; left: 0; bottom: 2px; height: 1px; width: 100%; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.theme-card:hover h3::after { transform: scaleX(1); }
.theme-card .go { display: inline-block; }
.theme-card:hover .go { transform: translateX(8px); color: var(--gold); }
.theme-card .dotc { position: absolute; right: 24px; top: 26px; width: 10px; height: 10px; border-radius: 50%; background: var(--c); transform: scale(0); transition: transform .45s var(--ease); }
.theme-card:hover .dotc { transform: scale(1); }

/* ---------- package tabs + tiers ---------- */
.pk-tabs.has-ind { position: relative; }
.pk-tabs .tab-ind { position: absolute; left: 0; top: 0; border-radius: 999px; background: var(--ink); z-index: 0; transition: transform .5s var(--ease), width .5s var(--ease); }
.pk-tabs.has-ind button { position: relative; z-index: 1; background: transparent; transition: color .3s, border-color .3s; }
.pk-tabs.has-ind button.on { background: transparent; color: #fff; border-color: transparent; }
.pk-tabs.has-ind button:not(.on):hover { border-color: var(--ink); }
.tier { transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s; }
.tier:hover { transform: translateY(-6px); box-shadow: 0 26px 50px -30px rgba(0, 0, 0, .35); }
.motion .tiers.swap .tier { animation: tier-in .6s var(--ease) both; }
.motion .tiers.swap .tier:nth-child(2) { animation-delay: .07s; }
.motion .tiers.swap .tier:nth-child(3) { animation-delay: .14s; }
@keyframes tier-in { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.tier li { transition: transform .3s var(--ease); }
.tier:hover li { transform: translateX(3px); }
.tier.lux { background: linear-gradient(var(--paper), var(--paper)) padding-box, linear-gradient(135deg, var(--ink), var(--gold), var(--ink)) border-box; border: 1px solid transparent; }

/* ---------- contact cards ---------- */
.contact a { transition: transform .4s var(--ease), border-color .3s, box-shadow .4s; }
.contact a:hover { transform: translateY(-4px); border-color: var(--ink); box-shadow: 0 20px 40px -30px rgba(0, 0, 0, .4); }
.contact a b { transition: color .3s; }
.contact a:hover b { color: var(--gold); }

/* ---------- booking form ---------- */
.chip { transition: background .2s, color .2s, border-color .2s, transform .25s var(--ease), box-shadow .25s; }
.chip:not(.full):hover { transform: translateY(-2px); box-shadow: 0 8px 18px -14px rgba(0, 0, 0, .5); }
.motion .chip.pop { animation: pop .4s var(--ease); }
@keyframes pop { 40% { transform: scale(.93); } 75% { transform: scale(1.05); } }
.step h3 span { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; transition: background .3s, color .3s, transform .4s var(--ease); }
.step.done h3 span { background: var(--gold); color: #fff; letter-spacing: 0; transform: rotate(360deg); }
.motion #timeChips .chip { animation: fade-up .45s var(--ease) both; }
.summary dd { transition: color .3s; }
.motion .summary dd.flash { animation: flash .8s ease; }
@keyframes flash { 0% { color: var(--gold); transform: translateX(-4px); } 100% { color: inherit; } }
.summary dd { display: inline-block; }
.book-progress { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 6px 0 22px; }
.book-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ink), var(--gold)); transition: width .6s var(--ease); }
.motion .card.done:not(.hide) { animation: done-in .8s var(--ease) both; }
@keyframes done-in { from { opacity: 0; transform: scale(.94); } }
input, select, textarea { transition: border-color .2s, box-shadow .25s; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px rgba(176, 122, 102, .14); }

/* shutter */
.shutter { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.shutter i { position: absolute; left: 0; right: 0; height: 50%; background: #111; }
.shutter i:first-child { top: 0; transform: translateY(-100%); animation: sh-top .75s var(--ease-in-out) both; }
.shutter i:nth-child(2) { bottom: 0; transform: translateY(100%); animation: sh-bot .75s var(--ease-in-out) both; }
.shutter b { position: absolute; inset: 0; background: #fff; opacity: 0; animation: sh-flash .75s ease both; }
@keyframes sh-top { 0% { transform: translateY(-100%); } 40%, 50% { transform: translateY(0); } 100% { transform: translateY(-100%); } }
@keyframes sh-bot { 0% { transform: translateY(100%); } 40%, 50% { transform: translateY(0); } 100% { transform: translateY(100%); } }
@keyframes sh-flash { 0%, 50% { opacity: 0; } 58% { opacity: .9; } 100% { opacity: 0; } }
.burst { position: fixed; color: var(--gold); pointer-events: none; z-index: 101; animation: burst 1.2s var(--ease) both; }
@keyframes burst { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(180deg); } }

/* ---------- admin ---------- */
.motion .main.enter > * { animation: fade-up .5s var(--ease) both; }
.motion .main.enter > *:nth-child(2) { animation-delay: .05s; }
.motion .main.enter > *:nth-child(3) { animation-delay: .1s; }
.motion .main.enter > *:nth-child(4) { animation-delay: .15s; }
.motion .main.enter > *:nth-child(5) { animation-delay: .2s; }
.motion .main.enter .kpi { animation: fade-up .55s var(--ease) both; }
.motion .main.enter .kpi:nth-child(2) { animation-delay: .06s; }
.motion .main.enter .kpi:nth-child(3) { animation-delay: .12s; }
.motion .main.enter .kpi:nth-child(4) { animation-delay: .18s; }
.motion .main.enter .bar .t i { animation: grow-w 1s var(--ease) .2s both; }
.motion .main.enter .vbars i { animation: grow-h 1s var(--ease) .2s both; }
@keyframes grow-w { from { width: 0; } }
@keyframes grow-h { from { height: 0; } }
.kpi, .panel, .pk-theme { transition: box-shadow .35s var(--ease), transform .35s var(--ease); }
.kpi:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -28px rgba(0, 0, 0, .4); }
.side a { transition: background .2s, color .2s, padding-left .3s var(--ease); }
.side a:not(.on):hover { padding-left: 20px; }
.row { transition: background .2s, padding-left .25s var(--ease); }
.row:hover { padding-left: 10px; }
.cal .day { transition: background .2s; }
.cal .ev { transition: transform .2s var(--ease); }
.cal .ev:hover { transform: translateX(3px); }
.motion .toast { animation: toast-in .45s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px); } }
.motion .modal-bg { animation: bg-in .25s ease both; }
@keyframes bg-in { from { opacity: 0; } }
.motion .login .card { animation: done-in .8s var(--ease) both; }
.motion .login img { animation: focus-in 1.4s var(--ease) .1s both; }
