/* CFLOWS Explore v2 (proposal, Dec 2026): the title sequence stays; each app becomes a feature reel.
   A reel is a strip of film: as you scroll down it slides sideways, one real screen per frame, under a light that
   follows the pointer. Transforms and opacity only; one scroll loop (v2.js). Under 821px it is a swipeable row. */

.fx { position: relative; padding: clamp(80px, 11vw, 160px) 0 0; color: var(--text); overflow-x: clip; }

.fx-head { display: grid; gap: 18px; }
.fx-app { display: flex; align-items: center; gap: 16px; }
.fx-icon { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--accent) 80%, transparent); }
.fx-app > span { display: grid; gap: 6px; }
.fx-app .mono { font-size: 13px; letter-spacing: .04em; color: var(--accent); }
.fx-night .fx-app .mono { color: color-mix(in srgb, var(--accent) 55%, #fff); }
.fx-app small { color: var(--text-2); font-size: 12px; }
.fx-h { font: 800 clamp(44px, 7vw, 104px)/.92 var(--display, "Inter Tight", sans-serif); letter-spacing: -.045em; margin: 6px 0 0; max-width: 13ch; text-wrap: balance; }
.fx-sub { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; }
.fx-sub .lede { margin: 0; max-width: 36ch; }

/* The pinned stage */
.fx-pin { position: relative; height: calc(100vh + (var(--n) - 1) * 40vh); margin-top: clamp(32px, 5vw, 64px); }
.fx-stick { position: sticky; top: 0; height: 100vh; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; align-content: center; padding: 84px 0 28px; }
.fx-light { position: absolute; left: 0; top: 0; width: 70vmax; height: 70vmax; margin: -35vmax 0 0 -35vmax; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 34%, transparent), transparent 70%);
  opacity: 0; transition: opacity .6s; pointer-events: none; will-change: transform; z-index: 0; }
.fx-day .fx-light { background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%); }
.fx.lit .fx-light { opacity: 1; }

.fx-rail { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; width: 100%; position: relative; z-index: 2; }
.fx-dot { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-2); font: 500 14px var(--sans, Inter, sans-serif); cursor: pointer; transition: color .25s, background .25s, border-color .25s; }
.fx-dot .mono { font-size: 11px; opacity: .7; }
.fx-dot:hover { color: var(--text); }
.fx-dot.on { color: var(--text); border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

.fx-view { min-width: 0; position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.fx-holes { display: block; height: 10px; margin: 0 -2vw; opacity: .5;
  background-image: repeating-linear-gradient(90deg, var(--border) 0 14px, transparent 14px 34px); background-size: 100% 8px; background-repeat: no-repeat; background-position: 0 center; will-change: transform; }
.fx-track { display: flex; gap: clamp(20px, 3vw, 44px); list-style: none; margin: 14px 0; padding: 0 calc((100vw - min(64vw, 1060px)) / 2); will-change: transform; }

.fx-card { flex: 0 0 min(64vw, 1060px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; transform: scale(.9); opacity: .38; transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .5s; }
.fx-card.on { transform: none; opacity: 1; }
.fx-shot { margin: 0; perspective: 1400px; }
.fx-pic { position: relative; aspect-ratio: 16 / 10; max-height: 56vh; margin: 0 auto; border-radius: 16px; overflow: hidden; background: var(--surface);
  box-shadow: 0 40px 90px -40px rgba(0,0,0,.55), 0 0 0 1px var(--border); transform-style: preserve-3d; transition: transform .25s ease-out; }
.fx-night .fx-pic { background: #151417; box-shadow: 0 40px 90px -40px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.08); }
.fx-pic > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.fx-card .fx-d { display: none; }
[data-theme="dark"] .fx-card .fx-d { display: block; } [data-theme="dark"] .fx-card .fx-l { display: none; }
.fx-glare { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(600px circle at var(--gx, 50%) var(--gy, 0%), rgba(255,255,255,.22), transparent 45%); mix-blend-mode: soft-light; }
.fx-pic:hover .fx-glare { opacity: 1; }

/* iPhone 18 Pro Max frame (Black). Body 78.0 x 163.4 mm; screen 440 x 956 pt inset about 3.4% at the sides;
   status bar, a Dynamic Island about a third narrower than the 17's, and the home indicator, all drawn in CSS. */
.fx-phone { position: absolute; z-index: 2; height: 90%; aspect-ratio: 78 / 163.4; right: 5%; top: 5%;
  transform: translateZ(40px) translateY(6%); transition: transform .9s cubic-bezier(.2,.8,.2,1) .15s; filter: drop-shadow(0 30px 40px rgba(0,0,0,.45)); }
.fx-card.on .fx-phone { transform: translateZ(40px); }
/* over a laptop shot: smaller, hanging off the bottom-right corner so the shot's main panel stays clear */
.has-phone:not(.phone-only) .fx-phone { height: 78%; top: auto; bottom: -9%; right: -2.5%; }
.ip { position: absolute; inset: 0; border-radius: 15.6% / 7.45%; container-type: inline-size;
  background: linear-gradient(140deg, #4a4a4f 0%, #1a1a1c 14%, #0b0b0c 50%, #1d1d20 86%, #4a4a4f 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), inset 0 0 0 2.5px #050506; }
.ip::before, .ip::after { content: ""; position: absolute; width: 1.6%; border-radius: 2px; background: linear-gradient(90deg, #2a2a2d, #4a4a4f); }
.ip::before { right: -1.3%; top: 25%; height: 13%; }
.ip::after { left: -1.3%; top: 16%; height: 25%; background: linear-gradient(#3a3a3e 0 16%, transparent 16% 30%, #3a3a3e 30% 60%, transparent 60% 70%, #3a3a3e 70% 100%); }
.ip-screen { position: absolute; left: 3.6%; right: 3.6%; top: 1.75%; bottom: 1.75%; border-radius: 12.6% / 5.9%; overflow: hidden;
  background: var(--sb, #0E0D11); display: flex; flex-direction: column; container-type: inline-size; }
.ip-sb { flex: none; height: 12.3cqw; display: flex; align-items: center; justify-content: space-between; padding: 2cqw 7.5cqw 0 9.5cqw; color: var(--si, #fff);
  font: 600 4cqw/1 -apple-system, "SF Pro Text", Inter, system-ui, sans-serif; letter-spacing: -.01em; }
.ip-ic { width: 17cqw; height: auto; fill: currentColor; color: var(--si, #fff); }
.ip-screen img { flex: 1; min-height: 0; width: 100%; object-fit: cover; object-position: top center; display: block; }
.ip-island { position: absolute; left: 50%; top: 2.85%; width: 19%; height: 3.25%; transform: translateX(-50%); border-radius: 999px; background: #000;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.ip-home { position: absolute; left: 33%; right: 33%; bottom: 1.1%; height: .55%; min-height: 3px; border-radius: 99px; background: var(--si, #fff); opacity: .7; }
.has-phone .fx-pic { overflow: visible; }
.has-phone .fx-pic > img { border-radius: 16px; }
.phone-only .fx-pic { overflow: hidden; background:
  radial-gradient(70% 90% at 50% 30%, color-mix(in srgb, var(--accent) 26%, #fff) 0%, color-mix(in srgb, var(--accent) 8%, #F7F5F2) 70%); }
[data-theme="dark"] .phone-only .fx-pic, .fx-night .phone-only .fx-pic { background: radial-gradient(70% 90% at 50% 30%, color-mix(in srgb, var(--accent) 40%, #1b1a1d), #121113 75%); }
.phone-only .fx-phone { right: auto; left: 50%; top: 5%; height: 90%; transform: translateX(-50%) translateZ(40px) translateY(6%); }
.phone-only.on .fx-phone { transform: translateX(-50%) translateZ(40px); }

.fx-cap { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 18px; align-items: baseline; max-width: 760px; }
.fx-cap .fx-k { grid-row: span 2; color: var(--accent); font-size: 12px; padding-top: 6px; }
.fx-night .fx-cap .fx-k { color: color-mix(in srgb, var(--accent) 55%, #fff); }
.fx-cap h3 { margin: 0; font: 700 clamp(22px, 2.2vw, 30px)/1.1 var(--display, "Inter Tight", sans-serif); letter-spacing: -.02em; }
.fx-cap p { margin: 6px 0 0; color: var(--text-2); max-width: 52ch; }

.fx-meter { height: 2px; position: relative; z-index: 2; }
.fx-meter::before { content: ""; position: absolute; inset: 0; background: var(--border); }
.fx-meter i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(0); will-change: transform; }

/* Sunrise into Cine Lab. The band is the first thing in the night zone: its top fades from the day page, the sun
   comes up as it crosses the screen, and one warm glow runs from the horizon over the water into Cine Lab (v2.js sets --p). */
:root { --day-bg: var(--bg); }
.fx-dusk { position: relative; height: clamp(230px, 24vw, 340px); --p: 0; }
.fx-skybox { position: absolute; inset: 0 0 30% 0; overflow: hidden; }
.fx-sky, .fx-sky2 { position: absolute; inset: 0; }
.fx-sky { background: linear-gradient(#0E0D11 0%, #1D1526 55%, #3A2036 100%); }
.fx-sky2 { background: linear-gradient(#2A2440 0%, #8E4F6A 38%, #F0956A 74%, #FFD39A 100%); opacity: var(--p); }
.fx-fade { position: absolute; left: 0; right: 0; top: -1px; height: 34%; background: linear-gradient(var(--day-bg), transparent); pointer-events: none; }
.fx-sun { position: absolute; left: 50%; bottom: 0; width: clamp(84px, 9vw, 132px); aspect-ratio: 1; margin-left: calc(clamp(84px, 9vw, 132px) / -2); border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #FFF4DA, #FFBE6E 60%, #F2853F);
  transform: translate3d(0, calc(92% - var(--p) * 190%), 0); will-change: transform; animation: fx-glow 2.8s ease-in-out infinite alternate; }
@keyframes fx-glow { from { box-shadow: 0 0 40px 14px rgba(255,180,100,.5), 0 0 140px 60px rgba(255,140,70,.22); } to { box-shadow: 0 0 56px 20px rgba(255,190,110,.65), 0 0 190px 80px rgba(255,140,70,.3); } }
.fx-water { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; overflow: hidden;
  background: linear-gradient(#24182A, transparent); box-shadow: 0 -1px 0 rgba(255,214,166,calc(.15 + var(--p) * .55)); }
.fx-ref { position: absolute; left: 50%; top: 0; width: clamp(110px, 12vw, 190px); height: 100%; margin-left: calc(clamp(110px, 12vw, 190px) / -2);
  background: repeating-linear-gradient(to bottom, rgba(255,200,132,.95) 0 2px, transparent 2px 7px);
  -webkit-mask: radial-gradient(50% 90% at 50% 0, #000 30%, transparent 75%); mask: radial-gradient(50% 90% at 50% 0, #000 30%, transparent 75%);
  opacity: calc(.12 + var(--p) * .88); animation: fx-shimmer 2.2s ease-in-out infinite alternate; transform-origin: 50% 0; z-index: 1; }
@keyframes fx-shimmer { from { transform: scaleX(.75); } to { transform: scaleX(1.25); } }
/* the light on the ground: starts at the horizon, lights the water, and carries on into the top of Cine Lab */
.fx-floor { position: absolute; left: 0; right: 0; top: 70%; height: calc(30% + 85vh); pointer-events: none; z-index: 0;
  background:
    radial-gradient(38% 22% at 50% 0, rgba(255,206,140,.55), transparent 70%),
    radial-gradient(70% 60% at 50% 0, rgba(255,166,98,.32), rgba(255,140,80,.10) 55%, transparent 80%);
  opacity: var(--p); mix-blend-mode: screen; }
.fx-dusk .mono { position: absolute; right: max(5vw, 16px); bottom: 14px; color: rgba(243,240,236,.75); font-size: 12px; z-index: 1; }
.fx > .container, .fx-pin { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .fx-dusk { --p: .8; } .fx-sun, .fx-ref { animation: none; } }

/* Phones and small screens: no pinning; the reel is a row you swipe */
@media (max-width: 820px) {
  .has-phone:not(.phone-only) .fx-phone { right: 3%; bottom: -6%; height: 74%; }
  .fx-pin { height: auto; }
  .fx-stick { position: relative; height: auto; overflow: visible; padding: 8px 0 0; display: block; }
  .fx-light, .fx-holes, .fx-meter { display: none; }
  .fx-rail { display: none; }
  .fx-view { display: block; }
  .fx-track { overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px max(5vw, 16px) 24px; gap: 14px; margin: 0; scrollbar-width: none; transform: none !important; }
  .fx-track::-webkit-scrollbar { display: none; }
  .fx-card { flex-basis: 86vw; scroll-snap-align: center; transform: none; opacity: 1; }
  .fx-pic { max-height: none; }
  .fx-cap { grid-template-columns: minmax(0, 1fr); }
  .fx-cap .fx-k { grid-row: auto; padding: 0 0 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-card, .fx-phone, .fx-pic { transition: none !important; }
  .fx-pin { height: auto; } .fx-stick { position: relative; height: auto; overflow: visible; }
  .fx-track { overflow-x: auto; scroll-snap-type: x mandatory; transform: none !important; }
  .fx-card { transform: none; opacity: 1; scroll-snap-align: center; }
}

/* Explore editor demo-video slot: shown only once a video is added */
.fx-vid { display: none; margin-top: 40px; }
.fx-vid:has(source), .fx-vid:has(video[src]) { display: block; }
.fx-vid video { display: block; width: 100%; height: auto; border-radius: 18px; background: #000; box-shadow: 0 40px 80px -40px rgba(0,0,0,.7); }
