/* Drapmi WordPress theme: behaviour styles.
   base.css / navbar.css / sections.css are the design (shared with the Next.js build).
   This file replaces what Motion (the JS animation library) did there, using CSS + IntersectionObserver. */

[hidden] { display: none !important; }
:root { --ease-in: cubic-bezier(0, 0, 0, 1); }

.skip-link:focus { position: fixed; left: 16px; top: 16px; width: auto; height: auto; margin: 0; clip: auto; z-index: 300; background: #fff; color: #000; padding: 10px 16px; border-radius: 8px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ───────── Reveal on scroll ───────── */
.js .rv { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease-in) var(--d, 0s), transform .8s var(--ease-in) var(--d, 0s); }
.js .rv.is-in { opacity: 1; transform: none; }
.js .rv-x { opacity: 0; transform: translateX(-12px); transition: opacity .5s var(--ease-in) var(--d, 0s), transform .5s var(--ease-in) var(--d, 0s); }
.js .is-in .rv-x, .js .rv-x.is-in { opacity: 1; transform: none; }

/* Headlines that rise in word by word */
.sw { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.sw-i { display: inline-block; }
.js .sw-i { transform: translateY(110%); transition: transform .8s var(--ease-in) var(--d, 0s); }
.js [data-split].is-in .sw-i, .js [data-reveal-words].is-in .sw-i { transform: none; }
.js .sw-i.is-now { transform: none; transition: none; animation: rise .9s var(--ease-in) var(--d, 0s) both; }
@keyframes rise { from { transform: translateY(110%); } to { transform: none; } }

/* Hero entrance */
.fx { animation: fxIn .8s var(--ease-in) var(--d, 0s) both; }
@keyframes fxIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.fx-stage { animation: stageIn 1s var(--ease-in) .2s both; }
@keyframes stageIn { from { opacity: 0; transform: translateY(24px) scale(.94); } to { opacity: 1; transform: none; } }
.fx-panel { animation: panelIn .9s var(--ease-in) .5s both; }
@keyframes panelIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.fx-bezel { animation: bezelIn 1s var(--ease-in) .35s both; }
@keyframes bezelIn { from { opacity: 0; } to { opacity: 1; } }

/* Fold band wipes in, photo settles */
.js .fold-band { clip-path: inset(0 100% 0 0); transition: clip-path 1.1s var(--ease); }
.js .fold-band.is-in { clip-path: inset(0 0 0 0); }
.js .how-photo { transform: scale(1.12); transition: transform 1.6s var(--ease-in); }
.js .is-in .how-photo { transform: none; }

/* ───────── Turntable ───────── */
.tt { position: relative; aspect-ratio: 2 / 3; }
.tt-shadow { position: absolute; left: 22%; right: 22%; bottom: 1.5%; height: 3%; border-radius: 50%; filter: blur(10px); }
.tt-front { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; user-select: none; transition: opacity .2s var(--ease); }
.tt .sprite { position: absolute; inset: 0; opacity: 0; }
.tt .tt-a { transition: opacity .2s var(--ease); }
.tt.is-ready .tt-front { opacity: 0; }
.tt.is-ready .tt-a { opacity: 1; }
.tt[data-ghost] .tt-front { opacity: .16; filter: grayscale(1); }

.dial { display: block; flex: none; }
.dial-g { transform-origin: 12px 12px; }

/* Hero stage */
.hero-fig { position: absolute; inset: 0; transition: opacity .2s var(--ease); }
.hero-stage.is-trying .hero-fig { opacity: .35; }
.hero-soon { background: #fff; color: var(--forest-800); height: auto; padding: 10px 16px; text-align: center; line-height: 18px; white-space: normal; width: max-content; max-width: 80%; }
.hero-soon span { font-weight: 400; color: var(--muted); }
.auto-toggle { background: #fff; color: var(--ink); }
.auto-toggle[aria-pressed="true"] { background: var(--forest-800); color: var(--neon-500); }
.choice { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.choice[aria-pressed="true"] { background: var(--forest-800); color: var(--neon-500); border-color: var(--forest-800); }
.sk-product { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.sk-product[aria-pressed="true"] { background: var(--slate-900); color: #fff; border-color: var(--slate-900); }

/* ───────── Navbar ───────── */
.nav-sheet:not([hidden]) { animation: sheetIn .2s var(--ease); }
.nav-sheet-links a { animation: linkIn .32s var(--ease-in) var(--d, 0s) both; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes linkIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.nav-burger span.is-open { background: transparent; }

/* ───────── Page switch loader ───────── */
#side-loader { display: none; position: fixed; inset: 0; z-index: 200; align-items: center; justify-content: center; }
#side-loader.is-on, .is-arriving #side-loader { display: flex; }
#side-loader[data-target="shop"] { background: var(--forest-800); color: var(--neon-500); }
#side-loader[data-target="brands"] { background: var(--cobalt-600); color: #fff; }
.side-loader-art { position: absolute; inset: 0; opacity: .3; }
#side-loader[data-target="brands"] .side-loader-art { background-image: url("../patterns/dhaka-cobalt.png"); opacity: .28; }
.side-loader-in { position: relative; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.side-loader-in img { width: 88px; height: auto; }
.side-loader-pct { font-size: clamp(88px, 14vw, 200px); line-height: 1; }
.side-loader-bar { width: min(320px, 70vw); height: 4px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.25); }
#side-loader[data-target="shop"] .side-loader-bar { background: rgba(238,255,84,.2); }
.side-loader-bar i { display: block; height: 100%; background: currentColor; }
/* If the script never runs, don't leave the curtain up. */
.is-arriving #side-loader { animation: arriveFail 0s 4s forwards; }
@keyframes arriveFail { to { visibility: hidden; opacity: 0; pointer-events: none; } }
#side-loader.is-lifting { transition: transform .72s cubic-bezier(.3, 0, 1, 1) .18s; transform: translateY(-100%); }

/* ───────── FAQ ───────── */
.faq-a { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .32s var(--ease), visibility 0s .32s; }
.faq-a > div { overflow: hidden; }
.faq-item.is-open .faq-a { grid-template-rows: 1fr; visibility: visible; transition-delay: 0s; }
.faq-plus { font-size: 24px; line-height: 1; color: var(--accent); transition: transform .2s var(--ease); }
.faq-item.is-open .faq-plus { transform: rotate(45deg); }

/* ───────── Doors ───────── */
.door { transition: transform 1s cubic-bezier(.65, 0, .25, 1), opacity .3s; }
.doorway:not(.is-open) .door:hover { transform: rotateY(-7deg); }
.doorway.is-open .door { transform: rotateY(-104deg); pointer-events: none; }
.doorway:not(.is-open) .door-back > * { visibility: hidden; }
.doorway.is-open { min-height: 560px; }
@media (max-width: 760px) { .doorway.is-open { min-height: 720px; } }

/* ───────── Forms ───────── */
.lead-form[hidden], .lead-done[hidden] { display: none !important; }
.lead-done { border-radius: 24px; padding: 32px; display: flex; flex-direction: column; gap: 16px; animation: paneIn .48s var(--ease-in); }
.done-shop { background: var(--neon-500); color: var(--forest-800); }
.done-brand { background: var(--slate-900); color: #e8edf5; gap: 12px; }
.lead-done:focus { outline: none; }
.lead-form.is-sending .btn[type="submit"] { opacity: .5; cursor: progress; }

/* ───────── Brands page ───────── */
.tour-tab { color: var(--ink); }
.tour-tab .tour-pill { display: none; }
.tour-tab[aria-selected="true"] { color: #fff; }
.tour-tab[aria-selected="true"] .tour-pill { display: block; }
.tour-copy:not([hidden]) { display: flex; animation: paneIn .32s var(--ease-in); }
.tour-pane:not([hidden]) { animation: paneIn .48s var(--ease-in); }
@keyframes paneIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.bar { transition: height .8s var(--ease-in); }
.nudge { animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(6px); } }
.switch { width: 40px; height: 24px; border-radius: 999px; border: 0; padding: 2px; background: var(--cobalt-600); cursor: pointer; display: flex; justify-content: flex-end; transition: background .2s; }
.switch[aria-checked="false"] { background: var(--slate-200); justify-content: flex-start; }
.switch span { width: 20px; height: 20px; border-radius: 50%; background: #fff; display: block; }
.float { animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.dms-after { opacity: 0; transform: translateY(16px) scale(.92); transition: opacity .35s, transform .45s cubic-bezier(.2, 1.2, .4, 1); }
.dms-after.is-on { opacity: 1; transform: none; }
.ig-order { transform: translateY(105%); transition: transform .7s var(--ease); }
.ig-order.is-on { transform: none; }
.dmb { animation: dmIn .35s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes dmIn { from { opacity: 0; transform: translateY(10px) scale(.9); } to { opacity: 1; transform: none; } }
#dash-bezel { will-change: transform; }

/* ───────── Plain pages ───────── */
.prose { max-width: 760px; }
.entry > * + * { margin-top: 1em; }
.entry h2, .entry h3 { font-family: var(--font-display); color: var(--ink); margin-top: 1.6em; }
.entry a { color: var(--accent); }
.entry ul, .entry ol { padding-left: 1.4em; }

/* ───────── Reduced motion ───────── */
@media (prefers-reduced-motion: reduce) {
  .js .rv, .js .rv-x, .js .sw-i, .js .fold-band, .js .how-photo { transform: none !important; transition: opacity .2s !important; }
  .js .sw-i, .js .rv, .js .rv-x { opacity: 0; }
  .js .rv.is-in, .js .is-in .rv-x, .js .rv-x.is-in, .js [data-split].is-in .sw-i, .js [data-reveal-words].is-in .sw-i { opacity: 1; }
  .js .fold-band { clip-path: none; opacity: 0; } .js .fold-band.is-in { opacity: 1; }
  .fx, .fx-stage, .fx-panel, .fx-bezel, .float, .nudge, .dmb, .lead-done, .tour-pane, .tour-copy { animation: none !important; }
  .js .sw-i.is-now { animation: none; opacity: 1; }
  .door, .doorway.is-open .door { transition: opacity .2s; }
  .doorway.is-open .door { transform: none; opacity: 0; }
  .ig-order { transition-duration: .01s; }
}
