/* ============================================================
   Cypher Web — Demo Platform — Shared infrastructure styles
   Loaded by every vertical demo. Each demo defines its OWN
   palette/type/layout in its own <style> block — this file only
   holds the bits that must behave identically everywhere:
   the demo bar, the WhatsApp float, reveal-on-scroll baseline,
   and a few layout-agnostic utilities.
   ============================================================ */

:root{
  --demo-bar-h: 40px;
}

/* ---------- film grain (cheap, GPU-free texture for premium tactility) ----------
   Applied on any positioned container via class="cw-grain". Uses a tiny inline
   SVG turbulence pattern tiled at 160px so it never looks like a stock overlay. */
.cw-grain{ position:relative; }
.cw-grain::before{
  content:'';
  position:absolute; inset:0; z-index:1; pointer-events:none;
  opacity:0.05; mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media(prefers-reduced-motion: reduce){ .cw-grain::before{ opacity:0.035; } }

/* ---------- staggered headline reveal: wrap each word in <span class="cw-word"> ----------
   Parent needs class="cw-split-in" (add "cw-run" via JS/IntersectionObserver to start). */
.cw-split-in .cw-word{ display:inline-block; overflow:hidden; }
.cw-split-in .cw-word > span{ display:inline-block; transform:translateY(110%); transition:transform .7s cubic-bezier(.16,1,.3,1); }
.cw-split-in.cw-run .cw-word > span{ transform:translateY(0); }
@media(prefers-reduced-motion: reduce){
  .cw-split-in .cw-word > span{ transform:none; transition:none; }
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
@media(prefers-reduced-motion: reduce){ html{ scroll-behavior:auto; } }

/* ---------- Cypher Web demo bar ---------- */
.cw-demo-bar{
  position:sticky; top:0; z-index:300;
  display:flex; align-items:center; justify-content:center; gap:10px;
  height:var(--demo-bar-h);
  background:#0A0A0C; color:#E7E7EA;
  font-family:'Inter',system-ui,sans-serif;
  font-size:12.5px;
  padding:0 16px;
  border-bottom:1px solid rgba(255,255,255,0.08);
}
.cw-demo-bar strong{ font-weight:700; }
.cw-demo-bar a{
  color:#fff; text-decoration:underline; text-underline-offset:2px;
  display:inline-flex; align-items:center; gap:4px;
}
.cw-demo-bar a:hover{ opacity:.8; }

/* ---------- WhatsApp float (opt-in per demo) ---------- */
.cw-wa-float{
  position:fixed; right:20px; bottom:20px; z-index:250;
  width:56px; height:56px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:#25D366; color:#fff;
  box-shadow:0 14px 30px -8px rgba(0,0,0,0.5);
  transition:transform .25s ease;
}
.cw-wa-float:hover{ transform:scale(1.08); }
@media(prefers-reduced-motion: reduce){ .cw-wa-float{ transition:none; } }

/* ---------- reveal-on-scroll baseline (per-demo timing/easing may override) ---------- */
.cw-reveal{ opacity:0; transform:translateY(24px); }
.cw-reveal.cw-show{
  opacity:1; transform:translateY(0);
  transition:opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1);
}
@media(prefers-reduced-motion: reduce){
  .cw-reveal{ opacity:1 !important; transform:none !important; }
  *{ animation:none !important; }
}

/* ---------- generic focus visibility (every demo must keep this) ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible{
  outline:2px solid currentColor; outline-offset:3px;
}

/* ---------- booking widget skeleton (each demo re-skins via its own vars) ---------- */
.cw-book{ max-width:760px; margin:0 auto; }
.cw-book-steps{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:28px; }
.cw-book-step{
  flex:1; min-width:80px; text-align:center; padding:10px 8px; border-radius:8px;
  font-size:11.5px; font-weight:600; letter-spacing:0.02em; cursor:default;
  border:1px solid var(--cw-book-border, rgba(0,0,0,0.12));
  color:var(--cw-book-muted, #888);
  transition:all .3s ease;
}
.cw-book-step.cw-active{
  background:var(--cw-book-accent, #111); color:var(--cw-book-accent-text, #fff);
  border-color:var(--cw-book-accent, #111);
}
.cw-book-step.cw-done{ opacity:.6; }
.cw-book-panel{ display:none; }
.cw-book-panel.cw-active{ display:block; }
.cw-book-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:10px; }
.cw-book-option{
  border:1px solid var(--cw-book-border, rgba(0,0,0,0.12)); border-radius:10px; padding:14px;
  cursor:pointer; text-align:left; background:none; font-family:inherit; color:inherit;
  transition:all .2s ease;
}
.cw-book-option:hover{ border-color:var(--cw-book-accent, #111); }
.cw-book-option.cw-selected{ border-color:var(--cw-book-accent, #111); background:var(--cw-book-accent-soft, rgba(0,0,0,0.04)); }
.cw-book-option .n{ font-weight:700; font-size:14px; margin-bottom:4px; }
.cw-book-option .d{ font-size:12px; color:var(--cw-book-muted, #888); }
.cw-book-nav{ display:flex; justify-content:space-between; margin-top:24px; gap:12px; }
.cw-book-field{ margin-bottom:14px; }
.cw-book-field label{ display:block; font-size:13px; font-weight:600; margin-bottom:6px; }
.cw-book-field input{
  width:100%; padding:12px 14px; border-radius:8px; font-size:14px; font-family:inherit;
  border:1px solid var(--cw-book-border, rgba(0,0,0,0.15)); background:var(--cw-book-input-bg, #fff); color:inherit;
}
.cw-book-confirm{ text-align:center; padding:32px 0; }
.cw-book-confirm .check{
  width:56px;height:56px;border-radius:50%;background:var(--cw-book-accent,#111);color:var(--cw-book-accent-text,#fff);
  display:flex;align-items:center;justify-content:center;margin:0 auto 16px;
}

/* ---------- FAQ accordion skeleton ---------- */
.cw-faq-item{ border-bottom:1px solid var(--cw-book-border, rgba(0,0,0,0.12)); }
.cw-faq-q{
  width:100%; display:flex; justify-content:space-between; align-items:center; gap:16px;
  background:none; border:none; font-family:inherit; font-size:16px; font-weight:600; text-align:left;
  padding:20px 4px; cursor:pointer; color:inherit;
}
.cw-faq-q .cw-plus{ flex-shrink:0; transition:transform .3s ease; }
.cw-faq-item.cw-open .cw-plus{ transform:rotate(45deg); }
.cw-faq-a{ max-height:0; overflow:hidden; transition:max-height .4s ease; }
.cw-faq-item.cw-open .cw-faq-a{ max-height:240px; }
.cw-faq-a p{ padding:0 4px 20px; font-size:14.5px; line-height:1.65; color:var(--cw-book-muted,#666); }

.cw-container{ max-width:1180px; margin:0 auto; padding:0 32px; }
@media(max-width:640px){ .cw-container{ padding:0 20px; } }
.cw-sr-only{ position:absolute; width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap; }
