/* slicknote.app home: the app's own motion (src/lib/motion.ts): Pop for ticks, Glide for arrivals, 45 ms stagger.
   Everything is visible and finished with Reduce Motion on, or if the script never runs. */
:root {
  --pop: cubic-bezier(.34, 1.56, .64, 1);
  --glide: cubic-bezier(.22, 1, .36, 1);
  --snap: cubic-bezier(.2, 0, 0, 1);
  --red: #E5484D;
  --phone-bg: #F8FAFC; --phone-card: #FFFFFF; --phone-text: #0F1115; --phone-sub: #5B6472; --phone-ring: #C5CCD6;
  --shadow: 0 30px 60px -20px rgba(15, 23, 42, .25), 0 12px 24px -12px rgba(15, 23, 42, .18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --shadow: 0 30px 60px -20px rgba(0, 0, 0, .6), 0 12px 24px -12px rgba(0, 0, 0, .5); }
}
:root[data-theme="dark"] { --shadow: 0 30px 60px -20px rgba(0, 0, 0, .6), 0 12px 24px -12px rgba(0, 0, 0, .5); }

body.home { overflow-x: hidden; }

/* Header: sticky, frosted once you scroll. */
header.bar { position: sticky; top: 0; z-index: 10; transition: background .3s var(--glide), box-shadow .3s var(--glide), backdrop-filter .3s; }
header.bar.scrolled { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); box-shadow: 0 1px 0 var(--line); }

/* Hero */
.hero2 { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center; padding-block: 40px 80px; }
.eyebrow { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--secondary); margin-bottom: 18px; }
.hero2 h1 { font-size: clamp(40px, 7vw, 76px); line-height: 1.02; letter-spacing: -0.045em; font-weight: 700; text-wrap: balance; }
.thing { color: var(--blue-text); position: relative; white-space: nowrap; display: inline-block; }
.thing svg { position: absolute; left: 0; bottom: -0.26em; width: 100%; height: 0.32em; overflow: visible; }
.thing .draw { fill: none; stroke: var(--blue); stroke-width: 4.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.hero2 .lede { max-width: 38ch; }

/* Arrivals: words rise in on load (Glide), staggered. */
.js .rise { opacity: 0; transform: translateY(14px); }
.js.ready .rise { opacity: 1; transform: none; transition: opacity .55s var(--glide), transform .55s var(--glide); transition-delay: calc(var(--d) * 90ms + 80ms); }
.js .thing .draw { stroke-dashoffset: 1; }
.js.ready .thing .draw { stroke-dashoffset: 0; transition: stroke-dashoffset .9s var(--glide) .55s; }

/* Two phones: the live demo in front, Pages behind; they float gently. */
.stage { position: relative; height: 600px; perspective: 1400px; }
.phone { position: absolute; width: 280px; aspect-ratio: 600 / 1304; border-radius: 44px; padding: 10px; background: #0F1115; box-shadow: var(--shadow); }
.phone img, .phone .screen { width: 100%; height: 100%; border-radius: 34px; display: block; object-fit: cover; }
.phone.back { right: 0; top: 40px; transform: rotate(7deg) scale(.88); opacity: .95; }
.phone.front { left: 8%; top: 0; transform: rotate(-3deg); }
.js .phone { opacity: 0; translate: 0 40px; }
.js.ready .phone { opacity: 1; translate: 0 0; transition: opacity .7s var(--glide), translate .9s var(--glide); }
.js.ready .phone.front { transition-delay: .25s; }
.js.ready .phone.back { transition-delay: .45s; }
.float { animation: float 7s ease-in-out infinite; }
.phone.back.float { animation-duration: 9s; animation-delay: -3s; }
@keyframes float { 50% { margin-top: -10px; } }

/* The demo phone's screen: a little Today, drawn in HTML. */
.screen { background: var(--phone-bg); color: var(--phone-text); position: relative; overflow: hidden; padding: 22px 16px; font-size: 12px; }
.ui-top { display: flex; justify-content: space-between; align-items: center; }
.ui-wm { font: 700 17px/1 'Geist Mono', monospace; letter-spacing: -0.04em; display: inline-flex; align-items: flex-end; gap: 2px; }
.ui-wm svg { width: 18px; height: 7px; } .ui-wm path { fill: none; stroke: #2563EB; stroke-width: 2.4; stroke-linecap: round; }
.ui-glass { display: inline-flex; gap: 10px; padding: 7px 10px; border-radius: 14px; background: #fff; box-shadow: 0 2px 8px rgba(15,23,42,.08); }
.ui-glass i { width: 10px; height: 10px; border-radius: 50%; border: 1.6px solid #0F1115; }
.ui-day { margin-top: 22px; display: grid; gap: 2px; }
.ui-day b { font-size: 17px; letter-spacing: -0.02em; }
.ui-day span { color: var(--phone-sub); font-size: 10.5px; }
.ui-time { margin-top: 18px; color: var(--phone-sub); font-size: 9.5px; }
.ui-note { margin-top: 6px; }
.ui-title { color: #2563EB; font-weight: 700; font-size: 13.5px; position: relative; display: inline-block; transition: color .3s; }
.ui-title.done { color: var(--phone-sub); }
.ui-title .strike { position: absolute; left: -2px; right: -2px; top: 50%; height: 8px; margin-top: -4px; overflow: visible; }
.ui-type { margin-top: 8px; min-height: 18px; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; }
.caret { display: inline-block; width: 1.5px; height: 14px; background: #2563EB; vertical-align: -2px; margin-left: 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ui-type.gone { display: none; }
.ui-list { list-style: none; margin-top: 8px; display: grid; gap: 9px; }
.ui-list li { display: flex; align-items: center; gap: 9px; font-size: 12.5px; opacity: 0; transform: translateY(6px) scale(.96); }
.ui-list li.in { opacity: 1; transform: none; transition: opacity .35s var(--glide), transform .45s var(--pop); }
.ring { width: 16px; height: 16px; border-radius: 50%; border: 1.6px solid var(--phone-ring); flex: none; display: grid; place-items: center; transition: background .2s, border-color .2s; }
.ring svg { width: 10px; height: 10px; transform: scale(0); transition: transform .45s var(--pop); }
.ring svg path { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
li.ticked .ring { background: #2563EB; border-color: #2563EB; }
li.ticked .ring svg { transform: scale(1); }
.item { position: relative; transition: color .3s; }
li.ticked .item { color: var(--phone-sub); }
.strike { opacity: 0; } li.ticked .strike, .ui-title.done .strike { opacity: 1; }
.strike path { fill: none; stroke: var(--red); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.item .strike { position: absolute; left: -2px; right: -2px; top: 50%; height: 8px; margin-top: -4px; overflow: visible; width: calc(100% + 4px); }
li.ticked .strike path, .ui-title.done .strike path { stroke-dashoffset: 0; transition: stroke-dashoffset .4s var(--glide) .1s; }
.ui-toast { position: absolute; left: 50%; bottom: 22px; translate: -50% 30px; opacity: 0; white-space: nowrap; background: #1F2430; color: #fff; border-radius: 99px; padding: 8px 8px 8px 14px; font-size: 11px; display: flex; align-items: center; gap: 8px; transition: opacity .3s var(--glide), translate .45s var(--pop); }
.ui-toast span { color: #7AA5F8; }
.ui-toast em { font-style: normal; background: rgba(255,255,255,.14); border-radius: 99px; padding: 4px 10px; font-weight: 600; }
.ui-toast.show { opacity: 1; translate: -50% 0; }

/* Reveals on scroll: rise in with a 45 ms stagger. */
.js .reveal { opacity: 0; transform: translateY(22px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity .6s var(--glide), transform .7s var(--glide); transition-delay: calc(var(--i, 0) * 45ms); }

.section-title { font-size: clamp(26px, 4vw, 40px); letter-spacing: -0.035em; line-height: 1.1; text-wrap: balance; }
.sub { color: var(--secondary); margin-top: 10px; max-width: 60ch; }

/* How it works */
.how { padding-block: 20px 80px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px; }
.step .num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--tint); color: var(--blue-text); font-weight: 700; font-size: 14px; }
.step h3 { margin-top: 14px; font-size: 19px; letter-spacing: -0.02em; }
.step p { margin-top: 8px; color: var(--secondary); font-size: 14.5px; line-height: 1.55; }

/* Features */
.features2 { padding-block: 0 80px; }
.grid2 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px; transition: transform .45s var(--pop), box-shadow .3s var(--glide), border-color .3s; }
.feat:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.feat .ico { width: 36px; height: 36px; fill: none; stroke: var(--blue); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.feat h3 { margin-top: 12px; font-size: 17px; letter-spacing: -0.02em; }
.feat p { margin-top: 6px; color: var(--secondary); font-size: 14px; line-height: 1.55; }

/* Themes: two slow ribbons of real theme swatches, opposite ways; they pause under the pointer. */
.themes { padding-block: 0 80px; overflow: hidden; }
.ribbon { display: flex; gap: 12px; width: max-content; margin-top: 24px; animation: drift 70s linear infinite; }
.ribbon.rev { animation-direction: reverse; animation-duration: 85s; margin-top: 12px; }
.themes:hover .ribbon { animation-play-state: paused; }
@keyframes drift { to { transform: translateX(-50%); } }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px 7px 10px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); white-space: nowrap; font-size: 14px; font-weight: 600; box-shadow: 0 2px 10px -6px rgba(15,23,42,.35); }
.chip .mk { width: 36px; height: 30px; flex: none; overflow: visible; }
.sw { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(15,23,42,.1); }
.sw i { width: 12px; height: 12px; border-radius: 50%; }
.chip small { color: var(--secondary); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }

/* The promise: the S's squiggle hops, like the app's. */
.promise { padding-block: 0 80px; }
.promise-card { display: flex; gap: 28px; align-items: center; background: var(--tint); border-radius: 28px; padding: 32px; }
.promise-card h2 { font-size: clamp(22px, 3.2vw, 32px); letter-spacing: -0.03em; line-height: 1.15; }
.promise-card p { color: var(--secondary); margin-top: 10px; max-width: 58ch; }
.hop { flex: none; display: flex; align-items: flex-end; gap: 4px; }
.hop .s { font: 700 72px/0.8 'Geist Mono', monospace; letter-spacing: -0.05em; color: var(--text); }
.hop svg { width: 52px; height: 16px; overflow: visible; animation: hop 2.6s var(--pop) infinite; transform-origin: 50% 100%; }
.hop path { fill: none; stroke: var(--blue); stroke-width: 4; stroke-linecap: round; }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0) scaleY(1); } 70% { transform: translateY(-14px) scaleY(1.15); } 80% { transform: translateY(0) scaleY(.85); } 88% { transform: translateY(-3px); } }

/* The KEEP OUT wink, and the S that hides Crazy Style (three taps). */
.keepout { color: #E5484D; font-weight: 700; letter-spacing: .06em; font-size: .9em; }
button.hop { background: none; border: 0; cursor: pointer; color: inherit; padding: 4px; border-radius: 14px; -webkit-tap-highlight-color: transparent; }
button.hop:active .s { transform: scale(.94); }
.hop .s { display: inline-block; transition: transform .18s var(--snap); }
.found { font-weight: 700; color: #E5484D; min-height: 0; margin-bottom: 4px; }
.found:empty { display: none; }
.boom { position: fixed; width: 9px; height: 14px; border-radius: 3px; pointer-events: none; z-index: 50; animation: boom 1.1s var(--glide) forwards; }
@keyframes boom { to { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }

/* Pro */
.pro2 { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-block: 0 96px; }
.pro2 h2 { font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -0.03em; }
.pro2 p { color: var(--secondary); margin-top: 8px; max-width: 56ch; }
.pill { transition: transform .18s var(--snap), box-shadow .3s var(--glide); }
.pill:hover { transform: translateY(-2px); }
.pill:active { transform: scale(.97); }

@media (max-width: 860px) {
  .hero2 { grid-template-columns: 1fr; padding-top: 16px; }
  .stage { height: 520px; max-width: 420px; width: 100%; margin: 0 auto; }
  .phone { width: 240px; }
  .steps, .grid2 { grid-template-columns: 1fr; }
  .promise-card { flex-direction: column; align-items: flex-start; padding: 24px; }
}
@media (max-width: 420px) { .phone { width: 210px; } .stage { height: 460px; } .phone.back { right: -8px; } }

/* Reduce Motion: everything shown, still. */
@media (prefers-reduced-motion: reduce) {
  .float, .ribbon, .hop svg, .caret { animation: none !important; }
  .ribbon { flex-wrap: wrap; width: auto; justify-content: center; padding-inline: 16px; }
  .ribbon.rev { display: none; }
  .js .rise, .js .reveal, .js .phone { opacity: 1 !important; transform: none !important; translate: none !important; }
  .js .thing .draw { stroke-dashoffset: 0; }
  * { transition-duration: 0s !important; }
}
