/* ===========================================================================
   DURHAM MOBILE MICROSUCTION — THE MOTION LAYER
   ---------------------------------------------------------------------------
   Everything that moves, glows or celebrates, kept apart from app.css so the
   booking flow underneath never depends on it. Delete the <link> and the
   <script src="fx.js"> and the page is the same booking app, just still.

   The motifs are hers, not decoration for its own sake:
     · SOUND WAVES   the business is hearing. Fine lines ripple across the
                     header like a waveform, in her logo blue.
     · LIGHT         an aurora drifting behind the header, soft particles of
                     light rising through it, a spotlight that follows the
                     pointer across anything you can choose.
     · CELEBRATION   a booking ends in a burst of confetti and a ticket that
                     lands — the moment someone's ears are about to be sorted.

   prefers-reduced-motion switches every one of these off at the bottom.
   ======================================================================== */

/* --- the aurora ---------------------------------------------------------- */
.hero { isolation: isolate; }
.hero::before {
  content: ''; position: absolute; inset: -40% -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 46% at 18% 30%, color-mix(in srgb, var(--brand) 55%, transparent), transparent 60%),
    radial-gradient(30% 40% at 82% 18%, color-mix(in srgb, var(--sky) 32%, transparent), transparent 62%),
    radial-gradient(42% 50% at 60% 92%, color-mix(in srgb, var(--brand) 50%, transparent), transparent 64%),
    radial-gradient(26% 30% at 92% 70%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%);
  filter: blur(6px) saturate(130%);
  animation: aurora 22s cubic-bezier(.45, .05, .55, .95) infinite alternate;
}
@keyframes aurora {
  0%   { transform: translate3d(-3%, -2%, 0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(4%, 3%, 0) rotate(6deg) scale(1.12); }
  100% { transform: translate3d(-2%, 5%, 0) rotate(-4deg) scale(1.05); }
}
.fx-particles { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.hero-in { z-index: 2; }
.hero-mark { z-index: 1; animation: mark-float 9s ease-in-out infinite alternate; }
@keyframes mark-float { from { transform: translateY(-46%) rotate(-2deg); } to { transform: translateY(-50%) rotate(2deg); } }

/* --- sound rings rippling out from the ear ------------------------------- */
.fx-rings { position: absolute; z-index: 1; pointer-events: none; right: calc(min(22rem, 46vw) * .32 - 2rem); top: 50%;
  width: 0; height: 0; }
.fx-rings i { position: absolute; left: 50%; top: 50%; width: min(30rem, 62vw); aspect-ratio: 1; border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--sky) 55%, transparent); box-shadow: 0 0 24px color-mix(in srgb, var(--sky) 25%, transparent), inset 0 0 24px color-mix(in srgb, var(--sky) 12%, transparent);
  transform: translate(-50%, -50%) scale(.15); opacity: 0; animation: ring-out 6s cubic-bezier(.2, .6, .3, 1) infinite; }
.fx-rings i:nth-child(2) { animation-delay: 1.5s; } .fx-rings i:nth-child(3) { animation-delay: 3s; } .fx-rings i:nth-child(4) { animation-delay: 4.5s; }
@keyframes ring-out { 0% { transform: translate(-50%, -50%) scale(.15); opacity: 0; } 15% { opacity: .9; } 100% { transform: translate(-50%, -50%) scale(1.15); opacity: 0; } }
.hero-mark { opacity: .12; filter: drop-shadow(0 0 30px color-mix(in srgb, var(--sky) 50%, transparent)); }

/* --- the sound waves ------------------------------------------------------ */
.fx-waves { position: absolute; left: 0; right: 0; bottom: -6px; width: 100%; height: 130px; aspect-ratio: auto; z-index: 1; pointer-events: none; opacity: .9; overflow: visible; }
.hero .hero-in { padding-bottom: 5.5rem; }
.hero::after { z-index: 2; }
.fx-waves path { fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.fx-waves .w1 { stroke: url(#fx-wave-a); stroke-width: 2; animation: wave-slide 9s linear infinite; }
.fx-waves .w2 { stroke: url(#fx-wave-b); stroke-width: 1.4; opacity: .7; animation: wave-slide 13s linear infinite reverse; }
.fx-waves .w3 { stroke: url(#fx-wave-a); stroke-width: 1; opacity: .45; animation: wave-slide 17s linear infinite; }
@keyframes wave-slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* --- the headline arrives word by word ----------------------------------- */
.fx-words .w { display: inline-block; opacity: 0; transform: translateY(.55em) rotateX(-40deg); filter: blur(8px);
  animation: word-in .9s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: calc(.15s + var(--i) * .11s); transform-origin: 50% 100%; }
@keyframes word-in { to { opacity: 1; transform: none; filter: blur(0); } }
.fx-words .w.shine {
  background: linear-gradient(100deg, #fff 0%, #fff 40%, var(--sky) 50%, #fff 60%, #fff 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: word-in .9s cubic-bezier(.2, .8, .2, 1) forwards, shine 5s 1.6s ease-in-out infinite;
  animation-delay: calc(.15s + var(--i) * .11s), 1.6s;
}
@keyframes shine { 0%, 60% { background-position: 120% 0; } 100% { background-position: -30% 0; } }
.hero .eyebrow, .hero .lede, .chips li { opacity: 0; animation: rise-in .8s cubic-bezier(.2, .8, .2, 1) forwards; }
.hero .eyebrow { animation-delay: .05s; }
.hero .lede { animation-delay: .55s; }
.chips li:nth-child(1) { animation-delay: .7s; } .chips li:nth-child(2) { animation-delay: .8s; } .chips li:nth-child(3) { animation-delay: .9s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.chips li { backdrop-filter: blur(8px); transition: background .3s, transform .3s; }
.chips li:hover { background: rgba(255, 255, 255, .16); transform: translateY(-2px); }

/* --- the steps come up as cards being dealt ------------------------------- */
.flow .step, .ticket { opacity: 0; animation: deal .75s cubic-bezier(.2, .8, .2, 1) forwards; }
.flow .step:nth-child(1) { animation-delay: .35s; } .flow .step:nth-child(2) { animation-delay: .43s; }
.flow .step:nth-child(3) { animation-delay: .51s; } .flow .step:nth-child(4) { animation-delay: .59s; }
.flow .step:nth-child(5) { animation-delay: .67s; } .ticket { animation-delay: .5s; }
@keyframes deal { from { opacity: 0; transform: translateY(26px) scale(.985); } to { opacity: 1; transform: none; } }
.step.current { position: relative; }
.step.current::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg), color-mix(in srgb, var(--brand) 0%, transparent) 0deg, var(--brand) 70deg, var(--sky) 110deg, color-mix(in srgb, var(--brand) 0%, transparent) 180deg, color-mix(in srgb, var(--brand) 0%, transparent) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
  animation: orbit 5s linear infinite;
}
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes orbit { to { --ang: 360deg; } }
.step.current .step-n { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 50%, transparent); animation: beacon 2.4s ease-out infinite; }
@keyframes beacon { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent); } 100% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--brand) 0%, transparent); } }
.step.done .step-n { animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 0% { transform: scale(.4); } 100% { transform: scale(1); } }
.step-body { animation: unfold .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes unfold { from { opacity: 0; transform: translateY(8px); clip-path: inset(0 0 30% 0); } to { opacity: 1; transform: none; clip-path: inset(0); } }
.chosen { animation: rise-in .45s cubic-bezier(.2, .8, .2, 1); }

/* --- the pointer spotlight on everything you can choose ------------------ */
.choice, .date-btn, .time-btn, .ticket { --mx: 50%; --my: 50%; }
.choice::before, .date-btn::before, .time-btn::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(180px circle at var(--mx) var(--my), color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%);
}
.date-btn, .time-btn { position: relative; overflow: hidden; }
.choice:hover::before, .date-btn:hover::before, .time-btn:hover::before { opacity: 1; }
.choice { overflow: hidden; }
.choice[aria-pressed="true"] { animation: chosen .55s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes chosen { 0% { transform: scale(.97); } 60% { transform: scale(1.012); } 100% { transform: scale(1); } }
.choice .ic { transition: transform .4s cubic-bezier(.3, 1.6, .5, 1), background .3s, color .3s; }
.choice:hover .ic { transform: rotate(-8deg) scale(1.08); }
.choice .price { transition: transform .3s; }
.choice:hover .price { transform: scale(1.06); }

/* New options pop in one after another (fx.js sets --i). */
.fx-pop { opacity: 0; animation: pop-in .5s cubic-bezier(.2, .9, .3, 1.2) forwards; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }
.time-btn[aria-pressed="true"], .date-btn[aria-pressed="true"] { animation: chosen .45s cubic-bezier(.3, 1.4, .5, 1); box-shadow: 0 8px 22px -8px color-mix(in srgb, var(--deep) 60%, transparent); }
.date-btn[aria-pressed="true"] { background: linear-gradient(160deg, var(--deep-3), var(--deep)); }

/* --- the ticket ---------------------------------------------------------- */
.ticket { transition: transform .5s cubic-bezier(.2, .8, .2, 1), box-shadow .5s; }
.ticket:hover { transform: translateY(-3px); }
.ticket-head { position: relative; overflow: hidden; background: linear-gradient(120deg, var(--deep), var(--deep-3) 60%, var(--deep)); }
.ticket-head::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%); transform: translateX(-100%); animation: sweep 6s 2s ease-in-out infinite; }
@keyframes sweep { 0%, 70% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.fx-bump { animation: bump .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); color: var(--brand); } 100% { transform: scale(1); } }
.ticket dd { transition: color .3s; }
.ticket dd:not(.empty) { animation: rise-in .4s ease-out; }

/* --- the main button ------------------------------------------------------ */
[data-submit] { position: relative; overflow: hidden; background: linear-gradient(120deg, var(--deep), var(--brand-text) 50%, var(--deep)); background-size: 200% 100%; transition: background-position .6s, transform .2s, box-shadow .2s; }
[data-submit]:hover { background-position: 100% 0; box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--deep) 70%, transparent); }
[data-submit]::after { content: ''; position: absolute; top: -50%; bottom: -50%; width: 40%; left: -60%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); animation: btn-sweep 3.5s 1s ease-in-out infinite; }
@keyframes btn-sweep { 0%, 60% { left: -60%; } 100% { left: 130%; } }

/* --- the celebration ------------------------------------------------------ */
.fx-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 100; }
.done-card { animation: land .9s cubic-bezier(.2, .9, .25, 1.15) both; }
@keyframes land { 0% { opacity: 0; transform: translateY(40px) scale(.94) rotateX(12deg); } 100% { opacity: 1; transform: none; } }
.done-top { position: relative; overflow: hidden; isolation: isolate; }
.done-top::before { content: ''; position: absolute; inset: -50%; z-index: -1;
  background: conic-gradient(from 0deg, color-mix(in srgb, var(--sky) 0%, transparent), color-mix(in srgb, var(--sky) 22%, transparent), color-mix(in srgb, var(--sky) 0%, transparent) 30%, color-mix(in srgb, var(--sky) 18%, transparent) 60%, color-mix(in srgb, var(--sky) 0%, transparent) 75%);
  animation: rays 14s linear infinite; }
@keyframes rays { to { transform: rotate(360deg); } }
.tick { animation: tick-in .7s .15s cubic-bezier(.3, 1.6, .5, 1) both; box-shadow: 0 0 0 0 rgba(143, 227, 185, .5); }
.tick::after { content: ''; position: absolute; }
@keyframes tick-in { 0% { transform: scale(0) rotate(-30deg); } 100% { transform: none; } }
.done-top h2 { animation: rise-in .6s .35s both; }
.done-top p { animation: rise-in .6s .45s both; }
.ref { animation: rise-in .6s .6s both; }

/* The safety net (see fx.js): once settled, nothing can be left invisible. */
.fx-settled .fx-words .w, .fx-settled .hero .eyebrow, .fx-settled .hero .lede, .fx-settled .chips li,
.fx-settled .flow .step, .fx-settled .ticket, .fx-settled .fx-pop, .fx-settled .done-card,
.fx-settled .done-top h2, .fx-settled .done-top p, .fx-settled .ref { opacity: 1 !important; transform: none !important; filter: none !important; animation: none !important; transition: none !important; }
.fx-settled .fx-words .w.shine { animation: shine 5s ease-in-out infinite !important; }

/* --- a hairline of light tracking how far down the page you are ------------ */
.fx-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50; transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--brand), var(--sky)); box-shadow: 0 0 12px color-mix(in srgb, var(--brand) 70%, transparent); pointer-events: none; }

@media (max-width: 520px) {
  .fx-waves { height: 80px; }
}

/* REDUCED MOTION — CALMED, NOT FROZEN.
   People who switch this on are protecting themselves from things that
   slide, zoom, spin or move across the screen. Slow changes of light and
   opacity are a different thing, and taking them away too would leave those
   visitors (and anyone whose Windows "Animation effects" is simply off) with
   a flat page. So: light drifts much more slowly, things fade instead of
   rising, and nothing translates, scales or rotates. */
@media (prefers-reduced-motion: reduce) {
  .hero::before { animation-duration: 70s; }
  .hero-mark { animation: none; }
  .fx-rings i { animation-name: ring-glow; animation-duration: 8s; }
  .fx-waves .w1, .fx-waves .w2, .fx-waves .w3 { animation-duration: 60s; }
  .fx-words .w, .fx-words .w.shine { transform: none !important; filter: none !important; animation-name: fade-in, shine !important; }
  .fx-words .w:not(.shine) { animation-name: fade-in !important; }
  .hero .eyebrow, .hero .lede, .chips li, .flow .step, .ticket, .fx-pop, .chosen, .step-body,
  .done-card, .done-top h2, .done-top p, .ref { animation-name: fade-in !important; transform: none !important; clip-path: none !important; }
  .choice[aria-pressed="true"], .time-btn[aria-pressed="true"], .date-btn[aria-pressed="true"], .step.done .step-n, .tick, .fx-bump { animation: none !important; }
  .step.current .step-n { animation-duration: 4s; }
  .choice:hover .ic, .choice:hover .price, .ticket:hover, .chips li:hover { transform: none; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
/* Calm rings: fixed sizes, only their light breathes. */
@keyframes ring-glow { 0%, 100% { opacity: 0; } 50% { opacity: .7; } }
@media (prefers-reduced-motion: reduce) {
  .fx-rings i { transform: translate(-50%, -50%) scale(.45); }
  .fx-rings i:nth-child(2) { transform: translate(-50%, -50%) scale(.7); }
  .fx-rings i:nth-child(3) { transform: translate(-50%, -50%) scale(.95); }
  .fx-rings i:nth-child(4) { transform: translate(-50%, -50%) scale(1.2); }
}
