/* SlidePal — slidepal.app
   Home is a single full-screen, app-feeling view: emoji loader reel + a
   slide-to-unlock CTA. Legal/support pages are normal scrolling docs. */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400..800&display=swap');

:root {
  --red: #ff1e1e;
  --red-deep: #d10016;
  --ink: #141417;
  --muted: #6a6a73;
  --bg: #ffffff;
  --panel: #f4f4f2;
  --line: #e8e8e2;
  --font-display: "Bricolage Grotesque", -apple-system, system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --maxw: 1100px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--red-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--red); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 16px; padding: 13px 22px; border-radius: 12px; border: 0; cursor: pointer; transition: background .15s ease, transform .12s ease; }
.btn:hover { background: var(--red-deep); text-decoration: none; transform: translateY(-2px); }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--ink); }
.brand img { width: 26px; height: 26px; }

/* ============ HOME: single full-screen app view ============ */
body.home { height: 100vh; height: 100dvh; overflow: hidden; }
.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.app-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; }
.app-top a:not(.brand) { color: var(--muted); font-weight: 600; font-size: 14px; }
.app-top a:not(.brand):hover { color: var(--ink); text-decoration: none; }

.app-main { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 26px; gap: 10px; }
.app-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(34px, 9vw, 66px); line-height: .95; letter-spacing: -.04em; margin: 2px 0 0; max-width: 100%; }
.app-info { color: var(--muted); font-size: clamp(16px, 4.4vw, 20px); max-width: 32ch; margin: 0; line-height: 1.45; }
.app-info em { font-style: normal; font-weight: 700; color: var(--red); }

/* slide loader — emoji rides the S-slide bezier (ported from iOS SlideLoadingAnimationView).
   .loader is a fixed 250px reference (the iOS coordinate space); --scale is UNITLESS so
   transform: scale() stays valid. The emoji is driven along the path in JS (offset-path is
   unreliable in Safari). */
.loader-wrap { --scale: 0.86; width: calc(250px * var(--scale)); height: calc(250px * var(--scale)); position: relative; }
.loader { position: absolute; top: 50%; left: 50%; width: 250px; height: 250px; margin: -125px 0 0 -125px; transform: scale(var(--scale)); transform-origin: center; }
.slide-bg, .slide-fg { position: absolute; inset: 0; width: 250px; height: 250px; }
.slide-channel { position: absolute; inset: 0; width: 250px; height: 250px;
  -webkit-mask-image: url("/slide/mask.png"); mask-image: url("/slide/mask.png");
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 0 0; mask-position: 0 0;
  -webkit-mask-size: 250px 250px; mask-size: 250px 250px; }
.slide-emoji { position: absolute; top: 0; left: 0; width: 40px; height: 40px; font-size: 32px; line-height: 40px; text-align: center; opacity: 0; will-change: transform, opacity; }
@media (max-width: 560px) { .loader-wrap { --scale: 0.74; } }
@media (max-height: 700px) { .loader-wrap { --scale: 0.6; } }

.app-bottom { padding: 0 22px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* slide to unlock */
.slider { position: relative; height: 66px; width: 100%; max-width: 440px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; touch-action: none; outline: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.slider:focus-visible { box-shadow: 0 0 0 3px rgba(255,30,30,.35); }
.slider-fill { position: absolute; inset: 0; background: var(--red); border-radius: 999px; transform-origin: left; transform: scaleX(var(--p, 0)); opacity: .14; }
.slider.done .slider-fill { opacity: 1; transition: opacity .2s ease; }
.slider-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: .01em;
  background: linear-gradient(90deg, #b7b7bf 0%, #b7b7bf 38%, #ffffff 50%, #b7b7bf 62%, #b7b7bf 100%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
  animation: shimmer 2.6s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }
.slider.done .slider-label { opacity: 0; }
.slider-knob { position: absolute; top: 6px; left: 6px; width: 54px; height: 54px; border-radius: 50%; background: transparent; border: 0; padding: 0; display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; box-shadow: 0 4px 14px rgba(0,0,0,.22); }
.slider-knob:active { cursor: grabbing; }
.slider-knob img { width: 54px; height: 54px; border-radius: 50%; display: block; pointer-events: none; -webkit-user-drag: none; user-drag: none; }

.app-fallback { color: var(--muted); font-size: 13px; font-weight: 600; }
.app-legal { font-family: var(--mono); font-size: 12px; color: #aaa; }
.app-legal a { color: #999; }
.app-legal a:hover { color: var(--ink); text-decoration: none; }

/* entrance */
.reveal { opacity: 0; transform: translateY(20px); animation: rise .65s cubic-bezier(.2,.7,.2,1) forwards; }
.d1 { animation-delay: .05s; } .d2 { animation-delay: .16s; } .d3 { animation-delay: .28s; } .d4 { animation-delay: .4s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; opacity: 1; transform: none; } }

/* ============ shared header/footer (legal + 404) ============ */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.9); -webkit-backdrop-filter: saturate(180%) blur(10px); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a:not(.btn) { color: var(--muted); font-weight: 600; font-size: 15px; }
.nav a:not(.btn):hover { color: var(--ink); text-decoration: none; }

footer { border-top: 1px solid var(--line); padding: 40px 0; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer .brand { font-size: 18px; }
footer .links a { color: var(--muted); margin-left: 20px; font-family: var(--mono); font-size: 13px; font-weight: 500; }
footer .links a:first-child { margin-left: 0; }
footer .links a:hover { color: var(--ink); text-decoration: none; }

/* ============ legal / content pages ============ */
.doc { padding: 56px 0 80px; }
.doc .wrap { max-width: 720px; }
.doc h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(28px, 6vw, 52px); letter-spacing: -.03em; margin: 0 0 6px; }
.doc .updated { color: var(--muted); font-size: 13px; margin: 0 0 34px; font-family: var(--mono); }
.doc h2 { font-family: var(--font-display); font-weight: 700; font-size: 23px; letter-spacing: -.01em; margin: 38px 0 10px; }
.doc p, .doc li { color: #33333a; font-size: 16.5px; line-height: 1.65; }
.doc ul { padding-left: 20px; }
.doc a { font-weight: 600; }
.callout { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin: 24px 0; }
.callout p { margin: 0; }
.back { display: inline-block; margin-bottom: 20px; color: var(--muted); font-weight: 500; font-family: var(--mono); font-size: 13px; }

/* centered hero (404) */
.hero.center { text-align: center; padding: 120px 0; }
.hero.center .wrap { max-width: 560px; margin: 0 auto; }
.hero.center .logo { width: 80px; height: 80px; margin: 0 auto 22px; display: block; filter: drop-shadow(0 10px 24px rgba(255,30,30,.25)); }
.hero.center h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(34px, 7vw, 60px); letter-spacing: -.03em; margin: 0 0 12px; }
.hero.center .lead { color: var(--muted); font-size: 18px; margin: 0 0 26px; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 560px) {
  .nav a:not(.btn) { display: none; }
}
