/* ============================================================
   WAREWELL WEB — shared web styles (consumes warewell/tokens.css)
   ============================================================ */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  background: var(--ww-bg); color: var(--ww-ink);
  font-family: var(--ww-font-body); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- W3: Dark mode (auto via prefers-color-scheme, forced via data attr) ---------- */
html[data-ww-theme="dark"] {
  --ww-line: rgba(246, 243, 238, 0.16);
  --ww-cream: #1B1D17;
}
html[data-ww-theme="dark"] .nav.is-scrolled,
html[data-ww-theme="dark"] .nav-sheet { background: rgba(17,17,17,0.88); }
html[data-ww-theme="dark"] .nav-lockup b,
html[data-ww-theme="dark"] .nav-burger { color: var(--ww-porcelain); }
html[data-ww-theme="dark"] #try .panel[style*="--ww-porcelain"] { background: var(--ww-surface) !important; }
html[data-ww-theme="dark"] .sticky-cta { background: var(--ww-porcelain); color: var(--ww-carbon); }
html[data-ww-theme="dark"] .sticky-cta svg { stroke: var(--ww-olive); }
html[data-ww-theme="dark"] .sticky-cta-x { color: rgba(17,17,17,0.55); }
html[data-ww-theme="dark"] .panel--dark { border: 1px solid rgba(246,243,238,0.14); }
html[data-ww-theme="dark"] .vmeter { background: rgba(246,243,238,0.16); }

/* ---------- W3: Skip link + focus ---------- */
.skip-link {
  position: fixed; top: -64px; left: 16px; z-index: 300;
  background: var(--ww-carbon); color: var(--ww-porcelain);
  padding: 12px 20px; border-radius: 10px; font-size: 14px; font-weight: 500;
  text-decoration: none; transition: top 200ms var(--ww-ease);
}
.skip-link:focus { top: 14px; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 2px solid var(--ww-olive); outline-offset: 3px; border-radius: 4px;
}
html[data-ww-theme="dark"] a:focus-visible,
html[data-ww-theme="dark"] button:focus-visible,
html[data-ww-theme="dark"] summary:focus-visible,
html[data-ww-theme="dark"] input:focus-visible { outline-color: var(--ww-social); }

/* ---------- Layout ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
section { position: relative; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 300ms var(--ww-ease), box-shadow 300ms var(--ww-ease);
}
.nav.is-scrolled { background: rgba(246,243,238,0.88); backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--ww-line); }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 18px 40px; display: flex; align-items: center; gap: 36px; }
.nav-lockup { display: flex; align-items: center; gap: 10px; color: var(--ww-olive); text-decoration: none; }
.nav-lockup b { font-family: var(--ww-font-display); font-weight: 500; font-size: 16px; letter-spacing: 0.26em; color: var(--ww-ink); }
.nav-links { display: flex; gap: 28px; margin-left: auto; align-items: center; }
.nav-links a:not(.ww-btn) { font-size: 14.5px; font-weight: 500; color: var(--ww-ink-2); text-decoration: none; transition: color var(--ww-dur-control) var(--ww-ease); }
.nav-links a:not(.ww-btn):hover { color: var(--ww-ink); }
.nav-links a.ww-btn { text-decoration: none; }

/* ---------- Type ---------- */
.eyebrow { font-family: var(--ww-font-mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ww-cta); }
.h-display { font-family: var(--ww-font-display); font-weight: 600; line-height: 1.02; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
.h-sub { font-size: 19px; color: var(--ww-ink-3); line-height: 1.6; max-width: 54ch; text-wrap: pretty; }

/* ---------- Reveal on scroll ---------- */
/* ---------- Reveal on scroll — transform-only (opacity must never gate content:
   throttled iframes freeze transitions at their start value) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .rv:not(.in) { transform: translateY(30px); }
  .rv { transition: transform 700ms var(--ww-ease-out); }
  .rv.in { transform: none; }
  .rv-d1 { transition-delay: 90ms; } .rv-d2 { transition-delay: 180ms; } .rv-d3 { transition-delay: 270ms; } .rv-d4 { transition-delay: 360ms; }
}

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; border-top: 1px solid var(--ww-line); border-bottom: 1px solid var(--ww-line); padding: 16px 0; }
.marquee-track { display: flex; gap: 56px; width: max-content; }
@media (prefers-reduced-motion: no-preference) {
  .marquee-track { animation: marq 36s linear infinite; }
}
@keyframes marq { to { transform: translateX(-50%); } }
.marquee span { font-family: var(--ww-font-display); font-style: italic; font-size: 19px; color: var(--ww-ink-3); white-space: nowrap; display: inline-flex; align-items: center; gap: 56px; }
.marquee i { font-style: normal; color: var(--ww-cta); }

/* ---------- Collage (web) ---------- */
.collage { position: relative; }
.collage .piece {
  position: absolute; border-radius: 12px; overflow: hidden;
  box-shadow: 0 16px 36px -12px rgba(17,17,17,0.35);
  outline: 1px solid rgba(17,17,17,0.06);
  transform: rotate(var(--rot, 0deg));
  display: grid; place-items: center;
}
@media (prefers-reduced-motion: no-preference) {
  .collage.assemble .piece { animation: webAssemble 640ms var(--ww-ease-out) both; }
}
@keyframes webAssemble {
  from { transform: translateY(34px) rotate(0deg) scale(0.9); }
  to { transform: translateY(0) rotate(var(--rot, 0deg)) scale(1); }
}

/* ---------- Cards / panels ---------- */
.panel { background: var(--ww-surface); border: 1px solid var(--ww-line); border-radius: 18px; }
.panel--soft { background: var(--ww-cream); border-color: transparent; }
.panel--dark { background: var(--ww-carbon); color: var(--ww-porcelain); border-color: transparent; }
.panel--brand { background: var(--ww-olive); color: var(--ww-porcelain); border-color: transparent; }

/* ---------- Buttons (web sizes) ---------- */
.btn-xl { padding: 19px 38px; font-size: 17px; }

/* ---------- Phone mock ---------- */
.phone {
  width: 320px; aspect-ratio: 320 / 660; border-radius: 44px; background: var(--ww-carbon);
  padding: 10px; box-shadow: 0 40px 80px -24px rgba(17,17,17,0.45), 0 0 0 1px rgba(17,17,17,0.2);
  position: relative;
}
.phone-screen { width: 100%; height: 100%; border-radius: 35px; background: var(--ww-porcelain); overflow: hidden; position: relative; display: flex; flex-direction: column; }
.phone-notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 86px; height: 24px; border-radius: 999px; background: var(--ww-carbon); z-index: 5; }

/* ---------- Section numbering ---------- */
.sec-kicker { display: flex; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.sec-kicker .n { font-family: var(--ww-font-mono); font-size: 12px; color: var(--ww-cta); letter-spacing: 0.18em; }

/* ---------- Vote meters ---------- */
.vmeter { height: 8px; border-radius: 999px; background: var(--ww-champagne); overflow: hidden; }
.vmeter > i { display: block; height: 100%; border-radius: 999px; background: var(--ww-olive); width: 0; transition: width 1100ms var(--ww-ease-out); }
.vmeter--citrus > i { background: var(--ww-social); }

/* ---------- Mobile nav ---------- */
.nav-burger { display: none; margin-left: auto; background: none; border: 1px solid var(--ww-line); border-radius: 10px; width: 42px; height: 42px; cursor: pointer; color: var(--ww-ink); place-items: center; }
.nav-sheet {
  display: none; flex-direction: column; gap: 4px;
  background: var(--ww-porcelain); border-bottom: 1px solid var(--ww-line);
  padding: 10px 22px 18px; box-shadow: var(--ww-shadow-2);
}
.nav-sheet a { font-size: 16px; font-weight: 500; color: var(--ww-ink); text-decoration: none; padding: 12px 4px; border-bottom: 1px solid var(--ww-cream); }
.nav-sheet a.ww-btn { margin-top: 12px; border-bottom: 0; color: var(--ww-porcelain); }
.nav.sheet-open .nav-sheet { display: flex; }

/* ---------- Sticky scroll CTA ---------- */
.sticky-cta {
  position: fixed; left: 50%; bottom: 18px; z-index: 90;
  width: min(560px, calc(100vw - 28px));
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--ww-carbon); color: var(--ww-porcelain);
  border-radius: 999px; padding: 10px 12px 10px 20px;
  box-shadow: var(--ww-shadow-3);
  transform: translate(-50%, calc(100% + 26px));
  transition: transform 380ms var(--ww-ease-out);
}
.sticky-cta.show { transform: translate(-50%, 0); }
.sticky-cta-text { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky-cta-x { background: none; border: 0; color: rgba(246,243,238,0.55); font-size: 22px; cursor: pointer; padding: 4px 8px; line-height: 1; }

/* ---------- Waitlist joined state ---------- */
.joined-card { background: var(--ww-surface); border: 1px solid var(--ww-line); border-radius: 16px; padding: 20px; display: grid; gap: 12px; max-width: 460px; text-align: left; }
#cta .joined-card { background: rgba(246,243,238,0.1); border-color: rgba(246,243,238,0.25); margin: 0 auto; }
#cta .joined-card .jc-link { background: rgba(17,17,17,0.25); }
.joined-card .jc-pos { font-family: var(--ww-font-display); font-weight: 600; font-size: 30px; line-height: 1.1; }
.joined-card .jc-link { display: flex; align-items: center; gap: 10px; background: var(--ww-cream); border-radius: 10px; padding: 10px 14px; }
.joined-card .jc-link code { font-family: var(--ww-font-mono); font-size: 12.5px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--ww-line); }
.faq-item summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-family: var(--ww-font-display); font-size: 19px; font-weight: 600; padding: 20px 4px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-family: var(--ww-font-mono); font-size: 20px; color: var(--ww-cta); flex: none; transition: transform var(--ww-dur-control) var(--ww-ease); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin: 0; padding: 0 4px 22px; font-size: 15px; color: var(--ww-ink-3); line-height: 1.65; max-width: 64ch; }

/* ---------- Footer columns ---------- */
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.fcol { display: grid; gap: 10px; align-content: start; }
.fcol .fhead { font-family: var(--ww-font-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ww-ink-3); margin-bottom: 4px; }
.fcol a { font-size: 14px; color: var(--ww-ink-2); text-decoration: none; }
.fcol a:hover { color: var(--ww-ink); }
@media (max-width: 900px) { .footer-cols { grid-template-columns: 1fr 1fr; } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--ww-line); padding: 56px 0 48px; }

/* ---------- Count-up ---------- */
.num-big { font-family: var(--ww-font-display); font-weight: 600; line-height: 1; }

@media (max-width: 900px) {
  .wrap { padding: 0 22px; }
  .nav-inner { padding: 14px 22px; }
  .nav-links { display: none; }
  .nav-burger { display: grid; }
  .nav { background: rgba(246,243,238,0.92); backdrop-filter: blur(14px); }
  html[data-ww-theme="dark"] .nav { background: rgba(17,17,17,0.9); }
  .grid2, .grid3, .demo-grid { grid-template-columns: 1fr !important; }
  .phone { width: 270px; }
  .marquee-track span { font-size: 16px; }
  .sticky-cta-text { font-size: 12.5px; }
}
@media (max-width: 420px) {
  .wrap { padding: 0 16px; }
  .btn-xl { padding: 16px 24px; font-size: 15.5px; }
  .phone { width: 240px; }
}
