/* Rewisp landing — design tokens + layout + demo animations.
   Dark, calm, one accent (wisp blue). No framework. */

:root {
  --bg: #0b0d16;
  --bg-2: #11141f;
  --card: #161a28;
  --card-2: #1a1e2e;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #eef0f6;
  --muted: #9aa1b5;
  --dim: #6b7288;
  --accent: #8ea2ff;
  --accent-2: #a6b4ff;
  --green: #7dd87d;
  --radius: 18px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace; }

/* scroll reveal — elements start dimmed/offset, .in when they enter view */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
  /* animation is off, so set the bar widths directly (else they'd stay empty) */
  .trow .fill { width: var(--w); }
  .dline { opacity: 1; transform: none; }
}

/* nav */
nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(11, 13, 22, .7);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .01em; }
.brand svg { display: block; }
.nav-links { display: flex; gap: 28px; font-size: 14px; color: var(--muted); }
.nav-links a:hover { color: var(--text); }
@media (max-width: 640px) { .nav-links { display: none; } }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--text); color: #0b0d16;
  font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: 999px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 30px rgba(142, 162, 255, .25); }
.btn.small { padding: 8px 16px; font-size: 13px; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.ghost:hover { color: var(--text); box-shadow: none; }

/* hero */
header { position: relative; padding: 110px 0 70px; text-align: center; }
.glow {
  position: absolute; inset: -200px 0 auto 0; height: 600px; pointer-events: none;
  background: radial-gradient(600px 300px at 50% 10%, rgba(142, 162, 255, .16), transparent 70%);
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; margin-bottom: 28px;
  background: rgba(255, 255, 255, .02);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(125, 216, 125, .5); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(125, 216, 125, .45); } 70% { box-shadow: 0 0 0 7px rgba(125, 216, 125, 0); } 100% { box-shadow: 0 0 0 0 rgba(125, 216, 125, 0); } }
h1 { font-size: clamp(42px, 7vw, 76px); line-height: 1.05; font-weight: 700; letter-spacing: -.03em; }
h1 .soft { color: var(--dim); }
.sub { margin: 24px auto 0; max-width: 560px; font-size: 19px; color: var(--muted); }
.cta-row { margin-top: 38px; display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; }
.hint { margin-top: 14px; font-size: 13px; color: var(--dim); }
.hint code, kbd { font-family: ui-monospace, "SF Mono", monospace; background: var(--card); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); font-size: .9em; }

/* ── search demo (hero) ── */
.demo {
  margin: 70px auto 0; max-width: 640px; text-align: left;
  background: linear-gradient(180deg, var(--card-2), #141827);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 40px 80px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .03) inset;
  overflow: hidden;
}
.demo .bar { display: flex; align-items: center; gap: 12px; padding: 18px 20px; font-size: 17px; }
.demo .bar .spark { color: var(--accent); animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.demo .q { border-right: 2px solid var(--accent); padding-right: 2px; white-space: nowrap; overflow: hidden; min-height: 1.2em; }
.demo .answer { border-top: 1px solid var(--line); padding: 18px 20px 16px; display: none; }
.demo .answer.show { display: block; animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }
.demo .a-main { font-size: 16px; font-weight: 600; }
.demo .a-detail { margin-top: 6px; font-size: 14px; color: var(--muted); }
.demo .a-meta { margin-top: 12px; display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--dim); }
.badge { border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; background: rgba(255, 255, 255, .03); white-space: nowrap; }
.badge.accent { color: var(--accent); border-color: rgba(142, 162, 255, .3); background: rgba(142, 162, 255, .08); }

/* sections */
section { padding: 90px 0; }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 700; letter-spacing: -.02em; margin-top: 10px; }
.lead { margin-top: 14px; color: var(--muted); max-width: 620px; font-size: 17px; }

/* ── interactive demos section ── */
.demos { margin-top: 52px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .demos { grid-template-columns: 1fr; } }
.panel {
  background: linear-gradient(180deg, var(--card-2), #141827);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; position: relative; overflow: hidden; min-height: 300px;
  display: flex; flex-direction: column;
}
.panel .ph { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.panel .ph .tag { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.panel .ph .dots { margin-left: auto; display: flex; gap: 6px; }
.panel .ph .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); display: block; }
.panel h3 { font-size: 16px; font-weight: 600; margin-top: auto; }
.panel .cap { margin-top: 6px; font-size: 13.5px; color: var(--muted); }

/* form-autofill demo */
.form-demo { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.field { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: rgba(255, 255, 255, .02); transition: border-color .3s, background .3s; }
.field .lab { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); }
.field .val { font-size: 14px; margin-top: 2px; min-height: 1.2em; color: var(--text); }
.field.filling { border-color: rgba(142, 162, 255, .55); background: rgba(142, 162, 255, .07); }
.field.done { border-color: rgba(125, 216, 125, .35); }
.field .src { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 10.5px; color: var(--green); opacity: 0; transition: opacity .3s; }
.field.done .src { opacity: 1; }
.field.skip { border-style: dashed; }
.field.skip .val { color: var(--dim); }
.field.skip .src { color: var(--dim); }

/* engine-chain demo */
.chain { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.chain .node {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  background: rgba(255, 255, 255, .02); transition: all .35s var(--ease); opacity: .5;
}
.chain .node .ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: rgba(255, 255, 255, .05); font-size: 14px; }
.chain .node .nm { font-size: 14px; font-weight: 600; }
.chain .node .st { margin-left: auto; font-size: 12px; color: var(--dim); }
.chain .node.active { opacity: 1; border-color: rgba(142, 162, 255, .5); background: rgba(142, 162, 255, .06); }
.chain .node.whiff { opacity: 1; border-color: rgba(255, 170, 120, .35); }
.chain .node.whiff .st { color: #f0b070; }
.chain .node.win { opacity: 1; border-color: rgba(125, 216, 125, .45); background: rgba(125, 216, 125, .05); }
.chain .node.win .st { color: var(--green); }
.chain .node .spinner { width: 13px; height: 13px; border: 2px solid rgba(142, 162, 255, .3); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }

/* digest demo */
.digest { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
/* Assemble on page load via animation — same JS-free approach as the bars.
   'both' holds the start/end states so lines never sit invisible at rest. */
.dline { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: rgba(255, 255, 255, .02); opacity: 0; animation: dline-in .5s var(--ease) both; }
.digest .dline:nth-child(1) { animation-delay: .3s; }
.digest .dline:nth-child(2) { animation-delay: .8s; }
.digest .dline:nth-child(3) { animation-delay: 1.3s; }
@keyframes dline-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.dline .dt { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); min-width: 74px; padding-top: 2px; }
.dline .dtxt { font-size: 13.5px; color: var(--muted); }
.dline .dtxt b { color: var(--text); font-weight: 600; }

/* time-tracking demo */
.time-demo { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.trow { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.trow .tn { width: 92px; color: var(--muted); flex-shrink: 0; }
.trow .track { flex: 1; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .05); overflow: hidden; }
/* Fill purely via a CSS animation that runs on page load — no JS, no reveal
   class, no scroll observer. --w is set per-bar inline in the HTML. 'both'
   holds width:0 before start and the target after, so the bar is never empty
   at rest. This is deliberately independent of everything else. */
.trow .fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); animation: fillbar 1.1s var(--ease) .35s both; }
.time-demo .trow:nth-child(2) .fill { animation-delay: .46s; }
.time-demo .trow:nth-child(3) .fill { animation-delay: .57s; }
.time-demo .trow:nth-child(4) .fill { animation-delay: .68s; }
@keyframes fillbar { from { width: 0; } to { width: var(--w); } }
.trow .tm { width: 58px; text-align: right; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* product shots */
.shots { margin-top: 56px; display: flex; flex-direction: column; gap: 72px; }
.shot { position: relative; text-align: center; }
.shot .frame {
  position: relative; display: inline-block; max-width: 100%;
  border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .55), 0 2px 0 rgba(255, 255, 255, .05) inset;
}
.shot .frame::before {
  content: ""; position: absolute; inset: -14% -6% auto -6%; height: 70%;
  background: radial-gradient(60% 100% at 50% 0%, rgba(142, 162, 255, .22), transparent 70%);
  filter: blur(30px); z-index: -1; pointer-events: none;
}
.shot img { display: block; width: 100%; height: auto; }
.shot.hero .frame { width: 720px; }
.shot.app .frame { width: 780px; }
.shot .cap { margin-top: 20px; font-size: 15px; color: var(--muted); }
.shot .cap b { color: var(--text); font-weight: 600; }
@media (max-width: 820px) { .shots { gap: 52px; } .shot .frame { width: 100% !important; } }

/* privacy strip */
.strip { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.checks { margin-top: 36px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 40px; max-width: 760px; }
@media (max-width: 700px) { .checks { grid-template-columns: 1fr; } }
.checks li { list-style: none; display: flex; gap: 12px; font-size: 15.5px; color: var(--muted); }
.checks li b { color: var(--text); font-weight: 600; }
.checks .tick { color: var(--green); flex-shrink: 0; }

/* how — capture animation */
.steps { margin-top: 44px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.step::before { counter-increment: step; content: "0" counter(step); font-family: ui-monospace, "SF Mono", monospace; font-size: 13px; color: var(--dim); }
.step h3 { margin-top: 10px; font-size: 17px; }
.step p { margin-top: 8px; font-size: 14.5px; color: var(--muted); }

.capture-viz { margin-top: 44px; position: relative; height: 150px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--card-2), #121524); overflow: hidden; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; }
.capture-viz .app-src { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; z-index: 2; }
.capture-viz .app-src .aname { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .03); transition: all .3s; }
.capture-viz .app-src .aname.hot { border-color: rgba(142, 162, 255, .5); color: var(--text); }
.capture-viz .store { display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 2; }
.capture-viz .store .stack { width: 46px; height: 46px; border-radius: 10px; border: 1px solid rgba(142, 162, 255, .35); background: rgba(142, 162, 255, .08); display: grid; place-items: center; color: var(--accent); }
.capture-viz .store .cnt { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.wisp-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px 2px rgba(142, 162, 255, .7); left: 130px; top: 50%; opacity: 0; z-index: 1; }
.wisp-dot.fly { animation: fly 1.15s var(--ease) forwards; }
@keyframes fly { 0% { opacity: 0; transform: translate(0, -50%) scale(.6); } 15% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--fx, 620px), -50%) scale(.4); } }

/* features grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 44px; }
@media (max-width: 800px) { .grid { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; transition: border-color .2s ease, transform .2s ease; }
.card:hover { border-color: rgba(142, 162, 255, .3); transform: translateY(-2px); }
.card .ic { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: rgba(142, 162, 255, .09); border: 1px solid rgba(142, 162, 255, .18); }
.card .ic svg { width: 19px; height: 19px; stroke: var(--accent); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { margin-top: 14px; font-size: 17px; font-weight: 600; }
.card p { margin-top: 8px; font-size: 14.5px; color: var(--muted); }

/* footer cta */
.final { text-align: center; padding: 110px 0 90px; }
footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 13px; color: var(--dim); }
.foot-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
footer a:hover { color: var(--text); }
