/* Ensemblum – motion layer.
   Everything here is decoration: the pages work and read the same without it,
   and it switches off for people who ask their device for reduced motion. */

@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes pulseDot { 0%, 100% { box-shadow: 0 0 0 0 rgba(227, 179, 65, .55); } 60% { box-shadow: 0 0 0 7px rgba(227, 179, 65, 0); } }
@keyframes pulseDotDark { 0%, 100% { box-shadow: 0 0 0 0 rgba(138, 100, 16, .45); } 60% { box-shadow: 0 0 0 6px rgba(138, 100, 16, 0); } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes draw { from { stroke-dashoffset: 40; } to { stroke-dashoffset: 0; } }
@keyframes drift { from { transform: translate3d(-4%, -2%, 0) scale(1); } to { transform: translate3d(4%, 3%, 0) scale(1.12); } }

/* ---------- Content entrance ---------- */
main > section, main > .wrap { animation: fadeUp .35s cubic-bezier(.2, .7, .2, 1) both; }
main > section:nth-child(2) { animation-delay: .06s; }
main > section:nth-child(3) { animation-delay: .12s; }
.stagger > * { animation: fadeUp .55s cubic-bezier(.2, .7, .2, 1) both; }
.stagger > *:nth-child(2) { animation-delay: .1s; }
.stagger > *:nth-child(3) { animation-delay: .2s; }
.stagger > *:nth-child(4) { animation-delay: .3s; }
.flash { animation: fadeUp .4s ease both; }

/* ---------- Micro-interactions ---------- */
.btn { transition: transform .15s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-accent:hover { box-shadow: 0 6px 18px -6px rgba(227, 179, 65, .65); }
.btn .ic { transition: transform .2s ease; }
.btn:hover .ic { transform: translateX(3px); }
.grid3 .card, .cand { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.grid3 .card:hover, .cand:hover { transform: translateY(-2px); box-shadow: 0 10px 28px -14px rgba(20, 26, 51, .35); }
input, select, textarea { transition: border-color .15s ease, box-shadow .15s ease; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(227, 179, 65, .35); }
.brand svg { transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.brand:hover svg { transform: rotate(45deg); }
.step { animation: pop .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: inherit; }

/* Live states */
.chip-warn { align-items: center; gap: 6px; }
.chip-warn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brass-text); animation: pulseDotDark 1.8s ease-out infinite; }
.waves .now span { animation: pulseDot 1.8s ease-out infinite; }
.card-ok { animation: fadeUp .45s ease both; }
.card-ok .ic { stroke-dasharray: 40; animation: draw .7s .25s ease both; }
.cand-top { border-color: var(--brass); box-shadow: 0 0 0 1px rgba(227, 179, 65, .35); }

/* Bars and progress grow into place */
.bar div, .progress div { transform-origin: left center; animation: grow .9s cubic-bezier(.2, .7, .2, 1) .15s both; }

/* ---------- Home hero ---------- */
.hero-home { position: relative; overflow: hidden; }
.hero-home::before {
  content: ""; position: absolute; top: -40%; right: -20%; width: 90%; aspect-ratio: 1;
  background: radial-gradient(circle at center, rgba(227, 179, 65, .14) 0%, rgba(227, 179, 65, .05) 35%, rgba(227, 179, 65, 0) 62%);
  animation: drift 14s ease-in-out infinite alternate; pointer-events: none;
}
.hero-grid { position: relative; display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 40px; } .hero-home { padding: 56px 0 72px; } }

.free-pill {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 22px 0 0;
  padding: 7px 14px; border-radius: 999px; font-size: 14px; color: #fff;
  background: rgba(227, 179, 65, .1); border: 1px solid rgba(227, 179, 65, .4);
}
.free-pill a { color: var(--brass); font-weight: 600; }
.free-pill a:hover { color: #fff; }
.free-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brass); animation: pulseDot 2s ease-out infinite; }
.hero-slim .free-pill { margin: 0 0 6px; }
.card-later { margin-top: 8px; border-left: 4px solid var(--brass); }

/* The animated example (12 s loop) */
.demo { width: 100%; max-width: 440px; justify-self: center; }
.demo-seats { display: block; width: 100%; height: auto; overflow: visible; }
.seat-dot { fill: #fff; opacity: .55; animation: breathe 3.2s ease-in-out infinite; }
.podium { fill: none; stroke: var(--brass); stroke-width: 2; opacity: .8; }
.seat-gap, .seat-gap-ring { transform-box: fill-box; transform-origin: center; }
/* Three stories per page, 12 s each: every empty seat lives only during its own third. */
.seat-gap { fill: #141A33; stroke: var(--brass); stroke-width: 2; stroke-dasharray: 3 3; opacity: 0; animation: gapFill 36s cubic-bezier(.2, .7, .2, 1) infinite backwards; }
.seat-gap-ring { fill: none; stroke: var(--brass); stroke-width: 1.5; opacity: 0; animation: ring 36s ease-out infinite backwards; }
@keyframes breathe { 0%, 100% { opacity: .38; } 50% { opacity: .85; } }
@keyframes gapFill {
  0% { opacity: 1; fill: #141A33; stroke-dasharray: 3 3; transform: scale(1); }
  19.3% { opacity: 1; fill: #141A33; stroke-dasharray: 3 3; transform: scale(1); }
  20.7% { opacity: 1; fill: var(--brass); stroke-dasharray: none; transform: scale(1.5); }
  22% { opacity: 1; fill: var(--brass); stroke-dasharray: none; transform: scale(1); }
  30% { opacity: 1; fill: var(--brass); transform: scale(1); }
  32.5%, 100% { opacity: 0; fill: var(--brass); transform: scale(1); }
}
@keyframes ring {
  0% { transform: scale(1); opacity: .9; } 4% { transform: scale(2.3); opacity: 0; }
  4.1% { transform: scale(1); opacity: .9; } 8% { transform: scale(2.3); opacity: 0; }
  8.1% { transform: scale(1); opacity: .9; } 12% { transform: scale(2.3); opacity: 0; }
  12.1% { transform: scale(1); opacity: .9; } 16% { transform: scale(2.3); opacity: 0; }
  16.1% { transform: scale(1); opacity: .9; } 19.3% { transform: scale(2.1); opacity: 0; }
  21.3% { transform: scale(1); opacity: .9; } 25.3% { transform: scale(3); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

.demo-stage { display: grid; margin-top: 14px; }
.demo-stage > .scene { grid-area: 1 / 1; margin-top: 0; opacity: 0; animation: scene 36s linear infinite backwards; }
@keyframes scene { 0%, 33.2% { opacity: 1; visibility: visible; } 33.3%, 100% { opacity: 0; visibility: hidden; } }
.demo-feed { display: grid; gap: 8px; margin-top: 14px; }
.dm {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 9px 12px;
  border-radius: 12px; font-size: 14px; color: #fff;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
  opacity: 0; transform: translateY(8px);
}
.dm small { display: block; color: var(--soft-on-dark); font-size: 12px; }
.dm strong { font-weight: 600; }
.dm1 { animation: dm1 12s ease infinite; }
.dm2 { animation: dm2 12s ease infinite; }
.dm3 { animation: dm3 12s ease infinite; }
.dm4 { animation: dm4 12s ease infinite; border-color: rgba(227, 179, 65, .55); background: rgba(227, 179, 65, .12); }
@keyframes dm1 { 0%, 3% { opacity: 0; transform: translateY(8px); } 7%, 90% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: none; } }
@keyframes dm2 { 0%, 18% { opacity: 0; transform: translateY(8px); } 22%, 90% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: none; } }
@keyframes dm3 { 0%, 38% { opacity: 0; transform: translateY(8px); } 42%, 90% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: none; } }
@keyframes dm4 { 0%, 58% { opacity: 0; transform: translateY(8px) scale(.98); } 62%, 90% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: none; } }
.dm-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--brass); animation: pulseDot 1.6s ease-out infinite; }
.dm-ic { flex: none; width: 24px; text-align: center; color: var(--brass); }
.dm-av { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--brass); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.dm-ok { flex: none; width: 24px; height: 24px; border-radius: 50%; background: #3FA58B; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
@media (max-width: 899px) { .demo { max-width: 380px; } .dm { font-size: 13px; } }

/* ---------- Respect "reduce motion": show the finished state, no movement ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .dm { opacity: 1; transform: none; }
  .seat-gap { fill: var(--brass); stroke-dasharray: none; opacity: 0; }
  .gap-g:first-of-type .seat-gap { opacity: 1; }
  .seat-gap-ring { opacity: 0; }
  .demo-stage > .scene { opacity: 0; visibility: hidden; }
  .demo-stage > .scene:first-child { opacity: 1; visibility: visible; }
  .btn:hover, .grid3 .card:hover, .cand:hover { transform: none; }
}
