/* Lona homepage */
html { scroll-behavior: smooth; }
html.l-bot-hover body { cursor: pointer; }
.lona-page { overflow-x: clip; }

/* The bot lives on one fixed stage and travels between sections. */
#lonaStage { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 5; pointer-events: none; }
.l-bot-fallback { position: fixed; z-index: 5; left: 50%; top: 22vh; width: 220px; transform: translateX(-50%); border-radius: 40px; pointer-events: none; }

/* Ambient field behind everything: a faint violet bloom where the bot stands. */
.l-ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60vw 40vw at 50% 30%, rgba(91, 61, 245, .16), transparent 70%),
    radial-gradient(40vw 30vw at 15% 90%, rgba(60, 100, 255, .06), transparent 70%); }
.l-section { position: relative; z-index: 2; }
.l-wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

.l-display { font-family: var(--font-display); font-weight: 700; line-height: 1.02; }
.l-h2 { font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 700; }
.l-lede { color: var(--mute); font-size: clamp(1.02rem, 1.6vw, 1.2rem); max-width: 56ch; }

/* ---------- hero ---------- */
.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; text-align: center; padding: calc(var(--topbar-h) + 44vh) 16px 7vh; }
.hero h1 { font-size: clamp(2.9rem, 8.5vw, 7rem); }
.hero .l-lede { margin: 18px auto 0; }
.hero-hint { margin-top: 18px; color: #5f5f69; font-size: .88rem; }

/* composer — the Higgsfield-style prompt bar */
.composer { width: min(760px, 100%); margin: 34px auto 0; padding: 10px; text-align: start;
  background: rgba(20, 20, 25, .78); border: 1px solid var(--line-2); border-radius: 28px;
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: border-color .3s, box-shadow .3s; }
.composer:focus-within { border-color: rgba(143, 115, 255, .7); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9), 0 0 0 5px var(--eye-wash), 0 0 60px -10px rgba(143, 115, 255, .45); }
.composer textarea { display: block; width: 100%; min-height: 64px; max-height: 180px; resize: none; border: 0; outline: none; background: transparent; color: var(--ink); font: 400 1.12rem/1.55 var(--font-ui); padding: 12px 14px 6px; }
.composer textarea::placeholder { color: #6a6a74; }
.composer-bar { display: flex; align-items: center; gap: 10px; padding: 4px; flex-wrap: wrap; }
.composer-modes { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.mode { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); font: 500 .92rem var(--font-ui); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.mode svg { width: 16px; height: 16px; }
.mode:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.mode[aria-pressed="true"] { color: var(--ink); border-color: rgba(143, 115, 255, .6); background: rgba(143, 115, 255, .14); }
.composer .l-btn { height: 46px; }

/* ---------- story (pinned) ---------- */
.story { height: 520vh; }
.story-pin { position: sticky; top: 0; height: 100svh; display: flex; align-items: center; }
.story-pin .l-wrap { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
.story-copy { grid-column: 1; position: relative; min-height: 340px; }
.chapter { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 18px; opacity: 0; transform: translateY(28px); transition: opacity .6s var(--ease), transform .7s var(--ease); pointer-events: none; }
.chapter.is-on { opacity: 1; transform: none; pointer-events: auto; }
.chapter h2 { font-size: clamp(2.6rem, 6.5vw, 5.6rem); font-weight: 700; }
.chapter p { color: var(--ink-2); font-size: clamp(1.05rem, 1.6vw, 1.25rem); max-width: 34ch; }
.chapter a { align-self: flex-start; color: var(--eye-hi); text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.chapter a:hover { text-decoration: underline; text-underline-offset: 5px; }
.chapter a svg { width: 18px; height: 18px; }
html[dir="rtl"] .chapter a svg { transform: scaleX(-1); }
.story-ticks { position: absolute; inset-inline-start: 0; bottom: -64px; display: flex; gap: 8px; }
.story-ticks span { width: 26px; height: 3px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.story-ticks span i { display: block; height: 100%; width: 0; background: var(--eye); }

/* ---------- featured reel ---------- */
.reel { padding: 14vh 0 10vh; }
.reel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.reel-head .l-lede { margin-top: 10px; }
.reel-nav { display: flex; gap: 8px; }
.reel-nav button svg { width: 18px; height: 18px; }
html[dir="rtl"] .reel-nav button svg { transform: scaleX(-1); }
.reel-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 380px); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px max(16px, calc((100vw - 1240px) / 2 + 40px)) 30px; scrollbar-width: none; perspective: 1400px; }
.reel-track::-webkit-scrollbar { display: none; }

.tile { position: relative; scroll-snap-align: center; aspect-ratio: 4 / 5.2; border-radius: var(--r-visor); overflow: hidden; background: var(--visor); border: 1px solid var(--line); isolation: isolate;
  transform-style: preserve-3d; transition: transform .5s var(--ease), border-color .3s, box-shadow .5s; will-change: transform; }
.tile:hover { border-color: rgba(143, 115, 255, .45); box-shadow: 0 40px 90px -40px rgba(91, 61, 245, .7); }
.tile-media { position: absolute; inset: 0; z-index: 0; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s var(--ease); }
.tile:hover .tile-media > img { transform: scale(1.05); }
.tile::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, .92) 100%); }
.tile-meta { position: absolute; inset: auto 0 0 0; z-index: 3; padding: 24px; }
.tile-meta h3 { font-size: 1.5rem; font-weight: 600; }
.tile-meta p { color: var(--ink-2); margin-top: 6px; font-size: .96rem; }
.tile-link { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.tile-link:focus-visible { outline: 2px solid var(--eye); outline-offset: -4px; }

/* tile: image generator — prompt types, image resolves */
.gen-img { filter: blur(26px) saturate(.2) brightness(.7); transform: scale(1.12); transition: filter 1.6s var(--ease), transform 1.6s var(--ease) !important; }
.tile.is-done .gen-img { filter: none; transform: scale(1); }
.prompt-chip { position: absolute; z-index: 3; top: 18px; inset-inline: 18px; padding: 12px 16px; border-radius: 16px; background: rgba(10, 10, 14, .72); border: 1px solid var(--line-2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: .92rem; color: var(--ink); min-height: 46px; }
.prompt-chip .caret { display: inline-block; width: 2px; height: 1.05em; background: var(--eye-hi); vertical-align: -2px; margin-inline-start: 2px; animation: l-caret 1s steps(1) infinite; }
@keyframes l-caret { 50% { opacity: 0; } }

/* tile: chat */
.chat-mock { position: absolute; inset: 0; padding: 26px 20px 140px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; background: radial-gradient(90% 60% at 50% 20%, #1b1630, var(--visor)); }
.bubble { max-width: 82%; padding: 11px 15px; border-radius: 20px; font-size: .95rem; line-height: 1.5; opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .4s, transform .5s var(--ease); }
.bubble.is-in { opacity: 1; transform: none; }
.bubble.me { align-self: flex-end; background: var(--ink); color: #000; border-end-end-radius: 6px; }
.bubble.lona { align-self: flex-start; background: var(--shell-3); color: var(--ink); border-end-start-radius: 6px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--eye-hi); animation: l-dot 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes l-dot { 0%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

/* tile: live */
.wave { position: absolute; z-index: 3; inset-inline: 24px; bottom: 120px; height: 54px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.wave i { width: 5px; border-radius: 4px; background: var(--eye-hi); box-shadow: 0 0 12px rgba(143, 115, 255, .8); animation: l-wave 1.1s ease-in-out infinite; }
@keyframes l-wave { 0%, 100% { height: 12%; } 50% { height: 100%; } }

/* tile: mockup — a design lands on the billboard */
.board { position: absolute; left: 22.4%; top: 14.6%; width: 55.6%; height: 30%; overflow: hidden; display: grid; place-items: center; background: #0b0b0f; box-shadow: 0 0 40px rgba(143, 115, 255, .5); }
.board > div { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .8s; }
.board > div.is-on { opacity: 1; }
.board .poster-a { background: radial-gradient(80% 120% at 50% 100%, #5b3df5, #0b0b0f 70%); font: 700 clamp(1rem, 3vw, 1.7rem) var(--font-display); color: #fff; }
.board .poster-b { background: #f5f5f7; }
.board .poster-b svg { width: 34%; height: auto; }

/* tile: upscaler — drag to compare */
.compare { position: absolute; inset: 0; --pos: 50%; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .low { image-rendering: pixelated; filter: saturate(.85); }
.compare .high { clip-path: inset(0 0 0 var(--pos)); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; background: #fff; transform: translateX(-1px); box-shadow: 0 0 20px rgba(255, 255, 255, .6); pointer-events: none; z-index: 3; }
.compare .handle::after { content: ''; position: absolute; top: 40%; left: 50%; width: 34px; height: 34px; border-radius: 50%; transform: translate(-50%, -50%); background: rgba(0, 0, 0, .55); border: 2px solid #fff; backdrop-filter: blur(6px); }
.compare-ctl { position: absolute; inset: 0 0 38% 0; z-index: 4; }
.compare-ctl input[type=range] { position: absolute; inset: 0; height: 100%; width: 100%; opacity: 0; cursor: ew-resize; margin: 0; direction: ltr; }
.compare-ctl input[type=range]:focus-visible + * , .tile:has(.compare-ctl input:focus-visible) { outline: 2px solid var(--eye); outline-offset: -4px; }
.compare .tag { position: absolute; z-index: 3; top: 16px; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .6); font-size: .78rem; color: var(--ink); }
.compare .tag.l { left: 16px; } .compare .tag.r { right: 16px; }

/* tile: code */
.code-mock { position: absolute; inset: 0; padding: 26px 22px; direction: ltr; text-align: left; font: 400 .86rem/1.75 var(--font-mono); color: #d6d6de; background: radial-gradient(90% 60% at 30% 0%, #17142a, var(--visor)); white-space: pre; overflow: hidden; }
.code-mock .k { color: #c4b5ff; } .code-mock .s { color: #8ee6b8; } .code-mock .c { color: #6c6c78; } .code-mock .f { color: #7cc4ff; }

/* ---------- tools grid ---------- */
.tools { padding: 12vh 0 10vh; }
.tools-head { display: grid; gap: 22px; margin-bottom: 30px; }
.tools-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.tools-search { position: relative; width: min(340px, 100%); }
.tools-search svg { position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--mute); pointer-events: none; }
.tools-search .l-field { padding-inline-start: 46px; border-radius: 999px; min-height: 46px; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tcard { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 20px; text-decoration: none; color: var(--ink); background: var(--shell); border: 1px solid var(--line); transition: background .25s, border-color .25s, transform .35s var(--ease); }
.tcard:hover { background: var(--shell-2); border-color: var(--line-2); transform: translateY(-2px); }
.tcard .ic { width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0; display: grid; place-items: center; background: var(--visor); border: 1px solid var(--line); color: var(--ink-2); transition: color .25s, box-shadow .3s, border-color .25s; }
.tcard .ic svg { width: 22px; height: 22px; }
.tcard:hover .ic { color: var(--eye-hi); border-color: rgba(143, 115, 255, .4); box-shadow: 0 0 24px -6px rgba(143, 115, 255, .7); }
.tcard h3 { font-family: var(--font-ui); font-size: 1.02rem; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tcard p { color: var(--mute); font-size: .9rem; line-height: 1.5; margin-top: 3px; }
.tcard.is-off { opacity: .55; }
.tools-empty { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--mute); }

/* ---------- journal ---------- */
.journal { padding: 6vh 0 10vh; }
.journal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 28px; }
.post { display: block; text-decoration: none; color: var(--ink); border-radius: 24px; overflow: hidden; background: var(--shell); border: 1px solid var(--line); transition: border-color .25s; }
.post:hover { border-color: var(--line-2); }
.post img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--shell-2); }
.post div { padding: 18px 20px 22px; }
.post h3 { font-family: var(--font-ui); font-size: 1.08rem; font-weight: 600; }
.post p { color: var(--mute); font-size: .92rem; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- closing + footer ---------- */
.closing { min-height: 92svh; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; text-align: center; padding: 0 16px 12vh; }
.closing h2 { font-size: clamp(2.6rem, 7vw, 6rem); font-weight: 700; }
.closing .l-actions { justify-content: center; margin-top: 30px; }
.closing .l-actions > * { flex: 0 0 auto; }
.footer { position: relative; z-index: 2; border-top: 1px solid var(--line); padding: 40px 0 120px; color: var(--mute); font-size: .92rem; }
.footer .l-wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between; }
.footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer a { text-decoration: none; color: var(--ink-2); }
.footer a:hover { color: var(--ink); }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .hero { padding-top: calc(var(--topbar-h) + 40vh); }
  .story { height: 480vh; }
  .story-pin { align-items: flex-end; padding-bottom: 12vh; }
  .story-pin .l-wrap { grid-template-columns: 1fr; }
  .story-copy { min-height: 260px; }
  .chapter { justify-content: flex-end; }
  .story-ticks { bottom: -40px; }
  .reel-head { flex-direction: column; align-items: flex-start; }
  .reel-track { grid-auto-columns: 78vw; }
  .composer-modes { order: 2; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .composer .l-btn { margin-inline-start: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chapter, .tile, .bubble, .gen-img { transition: none !important; }
  .wave i, .dots i, .prompt-chip .caret { animation: none !important; }
}
