/* Motion layer for the marketing site. Everything here is progressive: without
   JS, WebGL or newer CSS features the page simply stays static and readable. */

@property --beam { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* ---- Reading progress ---- */
.progress { position: fixed; inset: 0 0 auto; z-index: 60; height: 3px; background: var(--gradient); transform: scaleX(var(--read, 0)); transform-origin: left; pointer-events: none; }

/* ---- Hero light field ---- */
.shader { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; opacity: 0; transition: opacity 1.4s var(--ease); -webkit-mask-image: linear-gradient(#000 72%, transparent); mask-image: linear-gradient(#000 72%, transparent); }
.shader.on { opacity: 1; }
.shader.on ~ .aurora { display: none; }

/* Headline: words rise out of a mask, then the accent word carries a slow shimmer */
.w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; margin-bottom: -.08em; }
.w > i { display: inline-block; font-style: normal; transform: translateY(108%); animation: wordUp 1s var(--ease) forwards; animation-delay: calc(var(--i) * 80ms + 120ms); }
@keyframes wordUp { to { transform: none; } }
.hero h1 { animation: none; }
#hero-word { background-size: 220% 100%; animation: shimmer 7s ease-in-out infinite alternate; transition: opacity .32s var(--ease), transform .32s var(--ease), filter .32s var(--ease); }
#hero-word.swap { filter: blur(9px); }
@keyframes shimmer { to { background-position: 100% 0; } }

/* ---- Buttons: magnetic pull and a sweep of light ---- */
.btn { position: relative; overflow: hidden; translate: var(--mx, 0) var(--my, 0); transition: translate .35s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease), background .15s, border-color .15s, color .15s; }
.btn-primary::after, .final-btn::after { content: ""; position: absolute; inset: 0 auto 0 -60%; width: 45%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent); transform: skewX(-18deg); transition: left .7s var(--ease); pointer-events: none; }
.btn-primary:hover::after, .final-btn:hover::after { left: 120%; }

/* ---- Nav: a pill glides to the section you're reading ---- */
.nav-links { position: relative; isolation: isolate; }
.nav-links a { padding: 6px 2px; transition: color .2s; }
.nav-links a.current { color: var(--brand-deep); }
.nav-pill { position: absolute; z-index: -1; top: 50%; height: 32px; margin-top: -16px; border-radius: 10px; background: var(--brand-soft); opacity: 0; transition: left .45s var(--ease), width .45s var(--ease), opacity .3s; }

/* ---- Capability ribbon ---- */
.ribbon { position: relative; overflow: hidden; padding: 16px 0; border-block: 1px solid var(--line); background: rgba(255, 255, 255, .6); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.ribbon-track { display: flex; width: max-content; animation: ribbon 46s linear infinite; }
.ribbon:hover .ribbon-track { animation-play-state: paused; }
.ribbon span { display: inline-flex; align-items: center; gap: 40px; padding-right: 40px; font-size: 14.5px; font-weight: 620; color: var(--ink-2); white-space: nowrap; }
.ribbon span::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); opacity: .5; }
@keyframes ribbon { to { transform: translateX(-50%); } }

/* ---- Reveals, softened with blur ---- */
.reveal { filter: blur(10px); transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { filter: none; }

/* ---- Cards: 3D tilt and a light that follows the pointer along the edge ---- */
[data-tilt] { transform-style: preserve-3d; }
.tile[data-tilt]:hover, .plan[data-tilt]:hover { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px); transition: transform .12s linear, box-shadow .28s var(--ease); }
.tile::after, .plan::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), var(--brand), transparent 70%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); opacity: 0; transition: opacity .3s; pointer-events: none; }
.tile:hover::after, .plan:hover::after { opacity: 1; }
.tile-grad::after { display: none; }

/* The recommended plan's border is a slowly orbiting beam of light */
.plan-best { border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, conic-gradient(from var(--beam), var(--brand), var(--sky), #c7d2ff 40%, var(--brand)) border-box; animation: beam 6s linear infinite; }
@keyframes beam { to { --beam: 360deg; } }

/* ---- Scroll-driven story: a connection, frame by frame ---- */
.story { position: relative; height: 420vh; background: linear-gradient(180deg, var(--bg), #eef2ff 18%, #eef2ff 82%, var(--bg)); }
.story-pin { position: sticky; top: 0; height: 100vh; min-height: 560px; display: flex; align-items: center; overflow: hidden; }
.story-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 56px; align-items: center; width: min(1180px, 100% - 48px); margin: 0 auto; }
.story-rail { display: flex; gap: 6px; margin-bottom: 26px; }
.story-rail i { flex: 1; height: 4px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.story-rail i::after { content: ""; display: block; height: 100%; background: var(--gradient); transform: scaleX(var(--fill, 0)); transform-origin: left; }
.story-copy { position: relative; min-height: 200px; }
.story-copy article { position: absolute; inset: 0; opacity: 0; transform: translateY(26px); filter: blur(8px); transition: opacity .55s var(--ease), transform .55s var(--ease), filter .55s var(--ease); pointer-events: none; }
.story-copy article.on { opacity: 1; transform: none; filter: none; }
.story-copy h3 { font-size: clamp(27px, 3.4vw, 40px); font-weight: 800; letter-spacing: -.03em; }
.story-copy p { margin-top: 12px; font-size: 18px; color: var(--ink-2); }
.story-frame { position: relative; aspect-ratio: 16 / 10.5; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow-l); overflow: hidden; transform: perspective(1400px) rotateY(calc(-5deg + var(--p, 0) * 10deg)) rotateX(2deg); will-change: transform; }
.frame-bar { position: absolute; inset: 0 0 auto; z-index: 3; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.frame-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.frame-bar span { margin-left: 8px; font-size: 12px; color: var(--ink-3); }
.layer { position: absolute; inset: 36px 0 0; display: grid; place-items: center; padding: 22px; opacity: 0; transform: scale(.96); filter: blur(6px); transition: opacity .55s var(--ease), transform .55s var(--ease), filter .55s var(--ease); pointer-events: none; }
.layer.on { opacity: 1; transform: none; filter: none; }

.l-link { display: flex; align-items: center; gap: 8%; width: 100%; justify-content: center; }
.l-url { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); font-size: clamp(11px, 1.15vw, 14px); font-family: var(--mono); color: var(--ink-2); white-space: nowrap; }
.l-url b { padding: 4px 11px; background: var(--brand); color: #fff; border-radius: 7px; font-family: var(--font); font-weight: 650; }
.l-plane { position: absolute; left: 53%; top: 44%; width: 26px; height: 26px; color: var(--brand); animation: storyFly 2.4s var(--ease) infinite; }
@keyframes storyFly { 0% { transform: translate(-60px, 26px) rotate(-10deg); opacity: 0; } 25% { opacity: 1; } 75% { opacity: 1; } 100% { transform: translate(90px, -24px) rotate(6deg) scale(.6); opacity: 0; } }
.l-pc { width: 22%; min-width: 80px; aspect-ratio: 16 / 11; border-radius: 9px; background: var(--gradient); box-shadow: 0 16px 30px -10px rgba(59, 91, 253, .55); }

.l-list { width: min(88%, 460px); }
.l-row { display: flex; align-items: center; gap: 12px; padding: 11px 13px; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: 14.5px; font-weight: 620; box-shadow: var(--shadow-s); }
.l-row small { margin-left: auto; font-weight: 500; color: var(--ink-3); font-size: 12.5px; }
.l-row.new { border-color: var(--mint); background: var(--mint-soft); transform: translateY(16px) scale(.94); opacity: 0; transition: transform .7s .25s cubic-bezier(.2, 1.4, .4, 1), opacity .5s .25s; }
.layer.on .l-row.new { transform: none; opacity: 1; }
.l-row.new small { color: var(--mint-deep); font-weight: 650; }

.l-crypt { width: 100%; text-align: center; }
.l-nodes { display: flex; align-items: center; justify-content: center; width: min(86%, 460px); margin: 0 auto; }
.l-node { display: grid; place-items: center; width: clamp(54px, 7vw, 76px); aspect-ratio: 1; flex: none; border-radius: 20px; background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 0 rgba(59, 91, 253, .3); animation: nodePulse 2.2s ease-out infinite; }
.l-node:last-child { animation-delay: 1.1s; }
.l-node svg { width: 46%; height: 46%; }
@keyframes nodePulse { 70%, 100% { box-shadow: 0 0 0 18px rgba(59, 91, 253, 0); } }
.l-wire { position: relative; flex: 1; min-width: 12px; height: 3px; margin: 0 6px; background: var(--line-2); border-radius: 2px; overflow: hidden; }
.l-wire::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, var(--brand) 0 14px, transparent 14px 34px); background-size: 34px 100%; animation: packets .55s linear infinite; }
@keyframes packets { to { background-position: 34px 0; } }
.l-cipher { margin-top: 20px; font-family: var(--mono); font-size: clamp(10.5px, 1.1vw, 13px); color: var(--ink-3); letter-spacing: .04em; min-height: 3em; padding: 0 6%; }
.l-seal { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; padding: 5px 13px; border-radius: 99px; background: var(--mint-soft); color: var(--mint-deep); font-size: 13px; font-weight: 680; }

.layer.l-desktop { padding: 0; place-items: stretch; background: linear-gradient(135deg, #dfe6ff, #d6f1ff 60%, #ffeade); }
.l-win { position: absolute; background: rgba(255, 255, 255, .92); border-radius: 10px; box-shadow: var(--shadow); transform: translateY(18px); opacity: 0; transition: transform .7s var(--ease), opacity .6s; }
.layer.on .l-win { transform: none; opacity: 1; }
.l-win.a { left: 7%; top: 11%; width: 52%; height: 58%; transition-delay: .1s; }
.l-win.b { right: 7%; top: 28%; width: 36%; height: 44%; transition-delay: .25s; }
.l-win::before { content: ""; display: block; height: 14%; border-radius: 10px 10px 0 0; background: var(--surface-2); }
.l-win i { display: block; height: 7%; margin: 5% 8% 0; border-radius: 4px; background: var(--surface-2); }
.l-win i:nth-child(2) { width: 62%; }
.l-taskbar { position: absolute; inset: auto 0 0; height: 9%; background: rgba(255, 255, 255, .7); backdrop-filter: blur(6px); }
.l-pointer { position: absolute; left: 30%; top: 40%; width: 18px; height: 18px; color: var(--ink); animation: storyRoam 8s ease-in-out infinite; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25)); }
@keyframes storyRoam { 25% { translate: 170px 40px; } 50% { translate: 240px -50px; } 75% { translate: 50px 70px; } }
.l-live { position: absolute; left: 50%; top: 12px; translate: -50% 0; display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 99px; background: rgba(255, 255, 255, .95); box-shadow: var(--shadow); font-size: 12.5px; font-weight: 680; color: var(--mint-deep); white-space: nowrap; }

/* ---- Details ---- */
.faq { interpolate-size: allow-keywords; }
.faq::details-content { height: 0; overflow: clip; transition: height .4s var(--ease), content-visibility .4s allow-discrete; }
.faq[open]::details-content { height: auto; }
.price b { display: inline-block; }
.price.flip b { animation: priceFlip .5s var(--ease); }
@keyframes priceFlip { from { opacity: 0; transform: translateY(70%) rotateX(-60deg); filter: blur(4px); } }
.billing-toggle { position: relative; isolation: isolate; }
.billing-toggle button.on { background: none; box-shadow: none; }
.toggle-thumb { position: absolute; z-index: -1; top: 4px; bottom: 4px; border-radius: 9px; background: var(--surface); box-shadow: var(--shadow-s); transition: left .4s var(--ease), width .4s var(--ease); }

/* ---- Scroll-linked effects, where the browser can do them natively ---- */
@supports (animation-timeline: scroll()) {
  .stage-tilt { animation: stageAway linear both; animation-timeline: scroll(root); animation-range: 0 90vh; }
  @keyframes stageAway { to { scale: .9; translate: 0 90px; opacity: .25; } }
  .hero-copy { animation: copyAway linear both; animation-timeline: scroll(root); animation-range: 10vh 80vh; }
  @keyframes copyAway { to { translate: 0 -60px; opacity: 0; } }
  .section-ink { animation: inkOpen linear both; animation-timeline: view(); animation-range: entry 0% cover 28%; }
  @keyframes inkOpen { from { clip-path: inset(0 5% round 34px); } to { clip-path: inset(0 0 round 0); } }
  .final { animation: finalIn linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; }
  @keyframes finalIn { from { scale: .93; } }
}

/* ---- Small screens: the story stacks, with the picture on top ---- */
@media (max-width: 900px) {
  .story { height: 380vh; }
  .story-grid { grid-template-columns: 1fr; gap: 18px; }
  .story-frame { order: -1; transform: none; }
  .story-copy { min-height: 190px; }
  .story-copy p { font-size: 16px; }
  .story-rail { margin-bottom: 14px; }
  .story-pin { align-items: flex-start; padding-top: 84px; }
  .story-grid { width: calc(100% - 36px); }
  .layer { padding: 12px; }
  .l-row { padding: 7px 11px; margin-bottom: 5px; font-size: 13px; }
  .l-row:nth-child(3) { display: none; }
  .l-cipher { margin-top: 10px; min-height: 0; max-height: 2.8em; overflow: hidden; }
  .l-url { padding: 7px 7px 7px 10px; }
  .l-pc { display: none; }
  .l-plane { left: 72%; top: 62%; }
}
@media (max-width: 560px) {
  .nav-inner { gap: 8px; }
  .nav-actions { gap: 2px; }
  .nav-actions .btn-sm { font-size: 13.5px; padding: 7px 10px; }
  .logo { font-size: 17px; gap: 7px; }
  .logo .logo-mark { width: 27px; height: 27px; }
  .logo b { margin-left: -7px; }
}

@media (prefers-reduced-motion: reduce) {
  /* The story becomes an ordinary list of its four frames. */
  .story { height: auto; padding: 60px 0; }
  .story-pin { position: static; height: auto; }
  .story-grid { grid-template-columns: 1fr; }
  .story-rail { display: none; }
  .story-copy { min-height: 0; }
  .story-copy article { position: static; opacity: 1; transform: none; filter: none; margin-bottom: 18px; }
  .story-frame { transform: none; }
  .layer.l-desktop { opacity: 1; transform: none; filter: none; }
  .w > i { transform: none; }
  .stage-tilt, .hero-copy, .section-ink, .final { animation: none; }
}
