/* Peeklix — immersive site (v2)
   Dark, full-screen WebGL behind everything; text and panels float on top.
   Motion still follows emilkowalski/skills: custom ease-out curves, press feedback,
   hover only on fine pointers, reduced-motion respected, nothing blocks interaction. */

:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);

  --bg: #07060b;
  --ink: #f4f1fb;
  --ink-2: rgba(244, 241, 251, 0.72);
  --mute: rgba(244, 241, 251, 0.48);
  --line: rgba(255, 255, 255, 0.09);
  --glass: rgba(20, 17, 30, 0.55);
  --glass-2: rgba(255, 255, 255, 0.05);
  --brand: #a35bf0;
  --brand-2: #7c22d0;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --font: "IBM Plex Sans Arabic", system-ui, "Segoe UI", Tahoma, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.7 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
}
body:not(.ready) { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 8px; }
::selection { background: rgba(163, 91, 240, 0.45); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left)); }
h1, h2, h3 { margin: 0; letter-spacing: -0.025em; text-wrap: balance; font-weight: 700; }
p { margin: 0; color: var(--ink-2); max-width: 60ch; text-wrap: pretty; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--mute); direction: ltr; unicode-bidi: isolate; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.eyebrow::before { content: ""; width: 24px; height: 1px; background: linear-gradient(to left, transparent, var(--brand)); }
.grad { background: linear-gradient(100deg, #e9d5ff 0%, #c084fc 35%, #60a5fa 70%, #67e8f9 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- WebGL canvas ---------- */
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; display: block; outline: none; }
.no-gl #gl { display: none; }
.fallback { display: none; position: fixed; inset: 0; z-index: 0; place-items: center;
  background: radial-gradient(60% 50% at 50% 40%, rgba(124, 34, 208, 0.35), transparent 70%), radial-gradient(40% 40% at 30% 70%, rgba(59, 130, 246, 0.2), transparent 70%), var(--bg); }
.fallback img { width: 160px; opacity: 0.9; }
.no-gl .fallback { display: grid; }
/* vignette + grain over the scene, under the content */
.veil { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(7, 6, 11, 0.75) 100%); }
main, .site-nav, footer { position: relative; z-index: 2; }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--bg);
  transition: opacity 700ms var(--ease-out), visibility 0s linear 700ms;
}
.ready .loader { opacity: 0; visibility: hidden; }
.loader-core { position: relative; width: 132px; height: 132px; display: grid; place-items: center; }
.loader-core svg.ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.loader-core circle { fill: none; stroke-width: 1.5; }
.loader-core .track { stroke: rgba(255, 255, 255, 0.08); }
.loader-core .bar { stroke: url(#lg); stroke-linecap: round; stroke-dasharray: 402; stroke-dashoffset: 402; transition: stroke-dashoffset 200ms linear; }
.loader-core img { width: 46px; height: 46px; }
.loader-num { position: absolute; bottom: -44px; inset-inline: 0; text-align: center; font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em; color: var(--mute); font-variant-numeric: tabular-nums; direction: ltr; }
.ready .loader-core { transform: scale(1.15); opacity: 0; transition: transform 700ms var(--ease-out), opacity 500ms ease; }

/* ---------- Custom cursor (fine pointers only) ---------- */
.cursor { position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none; display: none; }
.has-cursor .cursor { display: block; }
.cursor .dot, .cursor .ring { position: absolute; top: 0; left: 0; border-radius: 50%; will-change: transform; }
.cursor .dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #fff; mix-blend-mode: difference; }
.cursor .ring { width: 36px; height: 36px; margin: -18px 0 0 -18px; border: 1px solid rgba(255, 255, 255, 0.4);
  transition: width 250ms var(--ease-out), height 250ms var(--ease-out), margin 250ms var(--ease-out), border-color 200ms ease, background-color 200ms ease; }
.cursor.hover .ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-color: rgba(163, 91, 240, 0.8); background: rgba(163, 91, 240, 0.08); }
.cursor.down .ring { width: 28px; height: 28px; margin: -14px 0 0 -14px; }
.has-cursor, .has-cursor a, .has-cursor button, .has-cursor summary { cursor: none; }

/* ---------- Floating nav ---------- */
.site-nav { position: fixed; top: 0; inset-inline: 0; z-index: 20; pointer-events: none; }
.site-nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 84px; }
.site-nav a, .site-nav button { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; text-decoration: none; letter-spacing: -0.02em; }
.brand img { width: 30px; height: 30px; }
.pill {
  display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px; pointer-events: auto;
  background: rgba(16, 14, 24, 0.55); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: inset 0 0 0 1px var(--line), 0 10px 30px -10px rgba(0, 0, 0, 0.6);
}
.pill a { padding: 8px 16px; border-radius: 999px; font-size: 14px; color: var(--ink-2); text-decoration: none; transition: color 150ms ease, background-color 150ms ease; }
.pill a.cta { background: var(--ink); color: #0b0a10; font-weight: 600; }
.pill .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
@media (hover: hover) and (pointer: fine) {
  .pill a:not(.cta):hover { color: var(--ink); background: var(--glass-2); }
  .pill a.cta:hover { background: #e7e0f5; }
}
.pill a:active { transform: scale(0.97); }
.pill a { transition: color 150ms ease, background-color 150ms ease, transform 160ms var(--ease-out); }
@media (max-width: 820px) {
  .pill a:not(.cta), .pill .sep { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 56px; padding: 0 26px; border-radius: 999px; border: 0; text-decoration: none; cursor: pointer;
  font-weight: 600; font-size: 16px; touch-action: manipulation; user-select: none;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, box-shadow 200ms ease;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-light { background: var(--ink); color: #0b0a10; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 10px 40px -8px rgba(163, 91, 240, 0.6); }
.btn-glass { background: rgba(255, 255, 255, 0.06); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
@media (hover: hover) and (pointer: fine) {
  .btn-light:hover { background: #ece4fb; }
  .btn-glass:hover { background: rgba(255, 255, 255, 0.1); }
}
.btn .store { display: flex; flex-direction: column; line-height: 1.15; text-align: start; }
.btn .store small { font-size: 11px; font-weight: 500; opacity: 0.65; }
/* magnetic wrapper keeps press-scale and magnet offset on separate elements */
[data-magnetic] { display: inline-block; transition: transform 500ms var(--ease-expo); will-change: transform; }

/* ---------- Word reveal ---------- */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.06em 0 0.16em; margin: -0.06em 0 -0.16em; }
.split .w > span { display: inline-block; transform: translateY(105%); transition: transform 900ms var(--ease-expo) var(--d, 0ms); }
.split.in .w > span { transform: none; }
.fade-up { opacity: 0; transform: translateY(14px); transition: opacity 700ms ease var(--d, 0ms), transform 900ms var(--ease-expo) var(--d, 0ms); }
.in .fade-up, .fade-up.in { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
/* top padding always leaves room for the 3D bubble above the headline (scene.js measures it) */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding: calc(120px + clamp(150px, 26vh, 320px)) 0 56px; }
.hero-bottom { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: end; }
.hero h1 { font-size: clamp(44px, 8vw, 112px); line-height: 1.02; letter-spacing: -0.04em; }
.hero .lede { font-size: 18px; margin-top: 4px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); }
.scroll-hint { display: inline-flex; align-items: center; gap: 12px; }
.scroll-hint .line { width: 1px; height: 32px; background: rgba(255, 255, 255, 0.15); position: relative; overflow: hidden; }
.scroll-hint .line::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform: translateY(-100%); animation: drip 2.2s var(--ease-in-out) infinite; }
@keyframes drip { 0% { transform: translateY(-100%); } 50% { transform: translateY(0); } 100% { transform: translateY(100%); } }
.hero-top { position: absolute; top: 110px; inset-inline: 0; }
@media (max-width: 820px) {
  .hero { padding-bottom: 32px; padding-top: calc(90px + clamp(150px, 28vh, 300px)); }
  .hero-top { display: none; }
  .hero-bottom { grid-template-columns: 1fr; gap: 8px; }
  .hero-meta { margin-top: 28px; }
}

/* ---------- Story chapters (sticky text over the scene) ---------- */
.chapter { position: relative; height: 240vh; }
.chapter .stick { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; }
.chapter .text { width: min(480px, 46%); margin-inline-start: 0; }
.chapter .num { font-family: var(--mono); font-size: 13px; color: var(--brand); letter-spacing: 0.15em; direction: ltr; display: inline-block; margin-bottom: 20px; }
.chapter h2 { font-size: clamp(36px, 5vw, 68px); line-height: 1.05; letter-spacing: -0.035em; }
.chapter p { margin-top: 22px; font-size: 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; padding: 0; list-style: none; }
.tags li { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
.spec { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin-top: 28px; font-size: 14px; }
.spec dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--mute); padding-top: 3px; direction: ltr; text-align: end; }
.spec dd { margin: 0; color: var(--ink); }
@media (max-width: 820px) {
  .chapter { height: 200vh; }
  .chapter .stick { align-items: flex-end; padding-bottom: 72px; }
  .chapter .text { width: 100%; padding: 22px; border-radius: 22px; background: rgba(12, 10, 18, 0.6); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px var(--line); }
  .chapter h2 { font-size: 34px; }
  .chapter p { font-size: 16px; margin-top: 14px; }
}

/* progress rail for the story */
.rail { position: fixed; inset-inline-end: 28px; top: 50%; transform: translateY(-50%); z-index: 15; display: grid; gap: 14px; opacity: 0; transition: opacity 400ms ease; pointer-events: none; }
.rail.on { opacity: 1; }
.rail span { width: 2px; height: 28px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); position: relative; overflow: hidden; }
.rail span i { position: absolute; inset: 0; background: linear-gradient(var(--brand), var(--cyan)); transform-origin: top; transform: scaleY(var(--p, 0)); }
@media (max-width: 820px) { .rail { display: none; } }

/* ---------- Content on glass ---------- */
#more { padding-top: 10vh; }
.block { padding: 120px 0; }
@media (max-width: 820px) { .block { padding: 80px 0; } }
.block-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin-bottom: 56px; }
.block-head h2 { font-size: clamp(34px, 4.6vw, 60px); line-height: 1.06; }
.block-head p { font-size: 17px; }
@media (max-width: 820px) { .block-head { grid-template-columns: 1fr; gap: 16px; margin-bottom: 36px; } }

.panel {
  position: relative; border-radius: 24px; padding: 32px;
  background: var(--glass); backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
/* light that follows the pointer across a panel (spotlight) */
.panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 300ms ease;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(163, 91, 240, 0.16), transparent 60%);
}
@media (hover: hover) and (pointer: fine) { .panel:hover::before { opacity: 1; } }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step .n { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; color: var(--brand); direction: ltr; display: inline-block; }
.step h3 { font-size: 22px; margin: 64px 0 10px; }
.step .art { position: absolute; top: 24px; inset-inline-end: 24px; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(140deg, rgba(163, 91, 240, 0.3), rgba(59, 130, 246, 0.15)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.step .art svg { width: 26px; height: 26px; color: #e9d5ff; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } }

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.bento .panel { grid-column: span 2; min-height: 200px; display: flex; flex-direction: column; justify-content: flex-end; }
.bento .wide { grid-column: span 3; }
.bento h3 { font-size: 20px; margin-bottom: 6px; }
.bento .ic { position: absolute; top: 26px; inset-inline-start: 28px; color: var(--brand); }
.bento .ic svg { width: 26px; height: 26px; }
.bento .big { font-size: clamp(48px, 6vw, 80px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; position: absolute; top: 24px; inset-inline-start: 28px; }
@media (max-width: 900px) { .bento .panel, .bento .wide { grid-column: span 3; } }
@media (max-width: 600px) { .bento { grid-template-columns: 1fr; } .bento .panel, .bento .wide { grid-column: auto; } }

.limits { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.limits ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 14px; }
.limits li { display: flex; gap: 12px; color: var(--ink-2); }
.limits li svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 4px; }
.limits .yes svg { color: #4ade80; }
.limits .no svg { color: var(--mute); }
.limits h3 { font-size: 20px; }
@media (max-width: 820px) { .limits { grid-template-columns: 1fr; } }

.prices { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 880px; margin: 0 auto; }
.price-card { display: flex; flex-direction: column; }
.price-card.featured { background: linear-gradient(160deg, rgba(124, 34, 208, 0.45), rgba(30, 20, 60, 0.6) 60%); box-shadow: inset 0 0 0 1px rgba(192, 132, 252, 0.45), 0 30px 80px -30px rgba(124, 34, 208, 0.6); }
.price { font-size: 64px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; margin: 22px 0 6px; font-variant-numeric: tabular-nums; }
.price small { font-size: 16px; font-weight: 500; letter-spacing: 0; color: var(--mute); }
.price-card ul { list-style: none; padding: 0; margin: 24px 0 32px; display: grid; gap: 10px; flex: 1; }
.price-card li { display: flex; gap: 10px; color: var(--ink-2); }
.price-card li svg { width: 18px; height: 18px; color: var(--brand); flex-shrink: 0; margin-top: 5px; }
.price-card .btn { width: 100%; }
.badge { display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); margin-inline-start: 10px; vertical-align: middle; direction: ltr; }
@media (max-width: 820px) { .prices { grid-template-columns: 1fr; } }

.faq { max-width: 820px; margin: 0 auto; padding: 8px 32px; }
.faq details + details { border-top: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 24px 0; font-weight: 600; font-size: 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px; touch-action: manipulation; }
.faq summary::-webkit-details-marker { display: none; }
.faq .plus { width: 32px; height: 32px; border-radius: 50%; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: center; flex-shrink: 0; transition: transform 250ms var(--ease-out), background-color 200ms ease; }
.faq .plus svg { width: 14px; height: 14px; }
.faq details[open] .plus { transform: rotate(45deg); background: var(--brand-2); }
.faq .ans { padding: 0 0 24px; }
.faq details[open] .ans { animation: ans 250ms var(--ease-out); }
html.kbd .faq details[open] .ans, html.kbd .faq .plus { animation: none; transition: none; }
@keyframes ans { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 600px) { .faq { padding: 4px 20px; } .faq summary { font-size: 16px; } }

.outro { min-height: 100vh; min-height: 100svh; display: grid; align-items: end; text-align: center; padding: 38vh 0 96px; }
.outro h2 { font-size: clamp(48px, 9vw, 128px); line-height: 1; letter-spacing: -0.045em; }
@media (max-width: 820px) { .outro { padding-top: 48vh; } }
.outro p { margin: 24px auto 36px; font-size: 18px; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 36px 0 calc(36px + env(safe-area-inset-bottom)); background: rgba(7, 6, 11, 0.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 14px; color: var(--mute); }
footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
footer a { text-decoration: none; transition: color 150ms ease; }
footer .copy { margin-inline-start: auto; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; direction: ltr; }
@media (hover: hover) and (pointer: fine) { footer a:hover { color: var(--ink); } }

/* ---------- Privacy page ---------- */
.doc-page main { padding-top: 120px; }
.doc-hero h1 { font-size: clamp(40px, 6vw, 80px); line-height: 1.04; letter-spacing: -0.04em; margin-top: 12px; }
.doc-hero p { margin-top: 16px; }
.draft { margin-top: 28px; display: flex; gap: 12px; align-items: flex-start; border-radius: 16px; padding: 16px 18px; font-size: 14px; max-width: 76ch;
  background: rgba(245, 158, 11, 0.1); color: #fcd34d; box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.25); }
.draft svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; }
.doc-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 56px; padding: 56px 0 120px; }
.toc { position: sticky; top: 100px; align-self: start; display: grid; gap: 2px; font-size: 14px; }
.toc a { color: var(--mute); text-decoration: none; padding: 8px 14px; border-radius: 10px; transition: color 150ms ease; }
.toc a[aria-current="true"] { color: var(--ink); background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); }
@media (hover: hover) and (pointer: fine) { .toc a:hover { color: var(--ink); } }
.doc { max-width: 70ch; }
.doc h2 { font-size: 26px; margin: 52px 0 14px; scroll-margin-top: 100px; }
.doc h2:first-child { margin-top: 0; }
.doc ul { padding-inline-start: 20px; display: grid; gap: 10px; color: var(--ink-2); }
.doc b { color: var(--ink); }
.doc .ph { background: rgba(163, 91, 240, 0.18); color: #e9d5ff; border-radius: 4px; padding: 0 5px; }
@media (max-width: 820px) {
  .doc-grid { grid-template-columns: 1fr; gap: 24px; padding-top: 32px; }
  .toc { top: 76px; z-index: 5; display: flex; overflow-x: auto; white-space: nowrap; scrollbar-width: none; padding: 8px 24px; margin: 0 -24px;
    background: rgba(7, 6, 11, 0.8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .split .w > span { transform: none; transition: none; }
  .fade-up { transform: none; transition: opacity 300ms ease; }
  .scroll-hint .line::after { animation: none; transform: none; }
  [data-magnetic] { transition: none; transform: none !important; }
  .btn:active, .pill a:active { transform: none; }
}
