/* Story Loom AI design system for the landing concepts.
   Tokens and components are taken from storyloomai.com (background, spectrum gradient, header, capability
   dashes, the floating emblem) and storyloomai.art (ember gradient, eyebrows, glass cards, pill buttons, space
   backdrop). Type is Geist (headings and text) and Geist Mono, sized for easy reading. */
:root {
  --bg: #0a0910;
  --bg-deep: #08090d;
  --text: #f4eee6;
  --ink: #f3f0f8;
  --muted: #bab3c8;
  --soft: #d8d2e2;
  --dim: #6d6679;
  --line: #2a2436;
  --hair: #ffffff13;
  --warm: #ffb36b;
  --coral: #ff7a59;
  --violet: #8f7bff;
  --lilac: #b684fc;
  --pink: #fc74c9;
  --spectrum: linear-gradient(110deg, #dfc5ff 0%, #b684fc 28%, #ed85dc 53%, #ff71bf 70%, #dfc5ff 100%);
  --ember: linear-gradient(100deg, var(--violet), var(--coral) 45%, var(--warm) 70%, var(--violet));
  --display: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text-font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --glass: linear-gradient(180deg, rgba(28, 23, 40, .72), rgba(16, 13, 24, .6));
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; color-scheme: dark; overflow-x: clip; }
section[tabindex="-1"]:focus { outline: none; }
body {
  margin: 0; color: var(--text); font: 18px/1.7 var(--text-font); font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: clip;
  background:
    radial-gradient(ellipse at 10% 20%, #60287120, transparent 42%),
    radial-gradient(ellipse at 90% 35%, #1e70a820, transparent 48%),
    radial-gradient(ellipse at 50% 100%, #9c3b1617, transparent 45%),
    var(--bg-deep);
  background-attachment: fixed;
}
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; font-weight: 600; letter-spacing: -.04em; }
.wrap { position: relative; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 32px; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- three.js space, with a painted sky when WebGL is missing ---------- */
#space { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; opacity: 0; transition: opacity 2s ease; z-index: 0; }
.gl #space { opacity: 1; }
.backdrop { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1px 1px at 12% 22%, #fff8, transparent), radial-gradient(1px 1px at 78% 14%, #fff7, transparent),
    radial-gradient(1.5px 1.5px at 64% 72%, #fff6, transparent), radial-gradient(1px 1px at 30% 80%, #fff5, transparent),
    radial-gradient(1px 1px at 90% 58%, #fff6, transparent), radial-gradient(1.5px 1.5px at 46% 36%, #fff5, transparent),
    radial-gradient(22% 30% at 72% 60%, rgba(143,123,255,.3), transparent 70%),
    radial-gradient(60% 50% at 70% 60%, rgba(143,123,255,.12), transparent 70%),
    radial-gradient(40% 40% at 20% 30%, rgba(255,122,89,.10), transparent 70%); }
.gl .backdrop { opacity: 0; transition: opacity 2s ease; }
.veil { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: linear-gradient(180deg, rgba(10,9,16,.45) 0%, rgba(10,9,16,0) 22%, rgba(10,9,16,0) 74%, rgba(10,9,16,.5) 100%); }
main, section, footer, .sl-top { position: relative; z-index: 2; }
/* spinning and fly-in decorations may poke past the edge; clip (not hidden) so sticky sections keep working */
main { overflow-x: clip; }

/* ---------- header (storyloomai.com) ---------- */
.sl-top { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--hair); background: #08090d85;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.sl-top.float { position: fixed; left: 0; right: 0; background: transparent; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; transition: background .3s, border-color .3s; }
.sl-top.float.solid { background: #08090d99; border-color: var(--hair); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.sl-top .wrap { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; gap: 12px; align-items: center; text-decoration: none; font: 700 20px/1 var(--display); letter-spacing: -.035em; color: var(--ink); }
.brand img { width: 24px; height: 39px; object-fit: contain; filter: drop-shadow(0 0 8px #e248b655); }
.brand em { font-style: normal; color: #a9a4b6; font-weight: 400; margin-left: 2px; }
.brand small { margin-left: 4px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--warm); font: 700 10.5px/1 var(--text-font); letter-spacing: .16em; text-transform: uppercase; }
.sl-nav { display: flex; gap: 30px; font-size: 16px; font-weight: 500; color: var(--soft); }
.sl-nav a { text-decoration: none; transition: color .2s; }
.sl-nav a:hover { color: #fff; }
@media (max-width: 860px) { .sl-nav { display: none; } }
.pill { display: inline-flex; align-items: center; gap: 8px; background: #ffffff0d; border: 1px solid #ffffff2b; color: var(--ink);
  font: 500 15.5px/1 var(--text-font); letter-spacing: .2px; padding: 11px 22px; border-radius: 999px; text-decoration: none; cursor: pointer; transition: background .2s, border-color .2s; white-space: nowrap; }
.pill:hover { background: #ffffff1f; border-color: #ffffff55; }

/* ---------- type ---------- */
.eyebrow { margin: 0 0 20px; color: var(--warm); font: 600 15px/1.3 var(--text-font); letter-spacing: .2em; text-transform: uppercase; }
.tagline { font-size: 16.5px; color: #cfc8dc; letter-spacing: .1px; }
.display { font-family: var(--display); font-weight: 700; letter-spacing: -.045em; line-height: 1.03; }
.title { margin: 0 0 26px; max-width: 15em; font-size: clamp(36px, 5.2vw, 66px); line-height: 1.04; letter-spacing: -.045em; font-weight: 700; }
.lead { color: var(--soft); font-size: clamp(19px, 2.1vw, 23px); line-height: 1.6; max-width: 32em; margin: 0; }
.spectrum { background: var(--spectrum); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: sl-spectrum 12s ease-in-out infinite; }
.ember { background: var(--ember); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: sl-spectrum 14s ease-in-out infinite; }
@keyframes sl-spectrum { 0%, 100% { background-position: 0 0; } 50% { background-position: 100% 0; } }
.dashes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.dashes li { display: flex; align-items: center; gap: 15px; font-size: 18.5px; color: #e6e0ef; }
.dashes i { width: 20px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #a96cfd, #f56fc0); box-shadow: 0 0 12px #c869e55c; flex: none; }

/* ---------- buttons (storyloomai.art) ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 9px; padding: 15px 28px; border-radius: 999px; border: 1px solid #3a3446; background: rgba(13,11,18,.45);
  color: var(--text); font: 600 17.5px/1.4 var(--text-font); cursor: pointer; text-decoration: none; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: border-color .2s, background .2s, transform .2s; }
.btn svg { width: 17px; height: 17px; }
.btn:hover, .btn:focus-visible { border-color: var(--warm); background: rgba(255,179,107,.08); outline: none; transform: translateY(-1px); }
.btn.primary { border-color: transparent; background: linear-gradient(100deg, var(--violet), var(--coral)); color: #fff; }
.btn.primary:hover, .btn.primary:focus-visible { border-color: transparent; background: linear-gradient(100deg, #9d8bff, #ff8a6b); }

/* ---------- glass cards (storyloomai.art) ---------- */
.card { position: relative; padding: 28px 26px 30px; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--glass);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: border-color .25s, transform .25s; --c: var(--violet); }
.card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(60% 50% at 0% 0%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%); }
.card:hover { border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.card > * { position: relative; }
.card .ic { display: block; width: 44px; height: 44px; margin-bottom: 20px; color: var(--c); }
.card .ic svg { width: 100%; height: 100%; stroke-width: 1.5; }
.card h3 { font-size: 25px; letter-spacing: -.02em; }
.card p { margin: 10px 0 0; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(20,16,30,.6); font-size: 15.5px; color: var(--soft); }
.chip svg { width: 16px; height: 16px; color: var(--c, var(--warm)); }

/* ---------- the emblem, floating and tilting (storyloomai.com) ---------- */
.emblem { position: relative; display: grid; place-items: center; perspective: 900px; }
.emblem::before { content: ""; position: absolute; inset: 12% -12%; background: radial-gradient(ellipse, #a238dd42, transparent 68%); filter: blur(25px); animation: sl-breathe 8s ease-in-out infinite; }
.emblem .tilt { position: relative; display: grid; place-items: center; transform: rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg)); transition: transform .6s cubic-bezier(.22,1,.36,1); }
.emblem img { position: relative; width: 100%; height: auto; filter: drop-shadow(0 0 12px #e248b65c) drop-shadow(0 0 36px #7936e854); animation: sl-float 9s ease-in-out infinite, sl-glow 6s ease-in-out infinite; user-select: none; -webkit-user-drag: none; }
@keyframes sl-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-14px) rotate(1deg); } }
@keyframes sl-glow { 0%, 100% { filter: drop-shadow(0 0 12px #e248b65c) drop-shadow(0 0 36px #7936e854); } 50% { filter: drop-shadow(0 0 18px #e248b688) drop-shadow(0 0 56px #7936e888); } }
@keyframes sl-breathe { 0%, 100% { opacity: .7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }

/* ---------- scroll cue (storyloomai.art) ---------- */
.cue { position: absolute; left: 50%; bottom: 28px; z-index: 3; display: grid; justify-items: center; gap: 8px; transform: translateX(-50%);
  color: var(--muted); font: 500 13px/1 var(--text-font); letter-spacing: .25em; text-transform: uppercase; text-decoration: none; transition: opacity .4s; }
.cue i { width: 1px; height: 44px; background: linear-gradient(var(--warm), transparent); transform-origin: top; animation: sl-drop 2.2s ease-in-out infinite; }
@keyframes sl-drop { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.scrolled .cue { opacity: 0; pointer-events: none; }

/* ---------- footer (storyloomai.art) ---------- */
.sl-foot { padding: 30px 0 96px; color: #8d869b; font-size: 15.5px; }
.sl-foot .wrap > div { display: flex; flex-wrap: wrap; gap: 16px 28px; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 26px; }
.sl-foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--soft); }
.sl-foot a { text-decoration: none; transition: color .2s; }
.sl-foot a:hover { color: #fff; }

/* ---------- the big see-through words behind each section ----------
   <span class="bg-word" aria-hidden="true">Narrative</span> as a section's first child. sl.js drifts them
   sideways as the page scrolls (transform only); with reduce motion they stay put. */
.bg-word { position: absolute; z-index: 0; left: 0; top: var(--y, 2vh); pointer-events: none; user-select: none; white-space: nowrap;
  font: 800 clamp(120px, 21vw, 340px)/.8 var(--display); letter-spacing: -.06em; padding: 0 .04em .12em;
  background: linear-gradient(100deg, rgba(182,132,252,.13), rgba(237,133,220,.08) 45%, rgba(255,122,89,.07));
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.055);
  transform: translate3d(var(--x, 0px), 0, 0); will-change: transform; }
.bg-word.r { left: auto; right: 0; }
.bg-word.c { left: 50%; transform: translate3d(calc(-50% + var(--x, 0px)), 0, 0); }
section > .wrap { z-index: 1; }

/* ---------- reveal on scroll (opacity + transform only: both run on the compositor, so scrolling stays smooth) ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.1,1); transition-delay: calc(var(--d, 0) * 90ms); }
.reveal.in { opacity: 1; transform: none; }

/* sl.js marks sections that are off screen; their looping animations wait there instead of costing frames */
.off, .off *, .off *::before, .off *::after { animation-play-state: paused !important; }

/* phones: blurring what sits behind every card is the costliest thing on the page, so cards go solid instead */
@media (max-width: 700px) {
  .card { -webkit-backdrop-filter: none; backdrop-filter: none; background: linear-gradient(180deg, rgba(26,21,37,.94), rgba(15,12,22,.92)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
}
