/*
 * Landing v3 · features (sections/loop.blade.php). Static file, every class `f3` prefixed.
 * Brief: manychat-rea-analysis/design/landing-v3-motion-brief.md (ManyChat "Turn comments into
 * conversations that sell": one viewport per chapter, a sticky pattern layer, copy left, tall looping
 * panel right, sticky rail and CTA). Ours: Acid Lime field, a fixed field of small ink dots (the
 * "unread dot" motif), transparent motion panels so the dots run around the card.
 *
 * Layers inside .f3__field (lime, ink type on it):
 *   .f3__pattern  absolute + clip-path, its child position: fixed → the dots never move, even while
 *                 the field's top edge is still rising (ManyChat's grid rides in with the section)
 *   .f3__chrome   absolute over the copy column, its child sticky for one viewport → rail top, CTA bottom
 *   .f3__list     the chapters, one viewport each from 1024 up; each chapter carries a generated photo
 *                 of the person on the other side, passing behind the card
 * .f3--xfade (wide + motion, set by features.js): the list is one grid, chapters are display: contents,
 * every copy block sits in the same sticky cell of the left column and only the current one is visible
 * (cross-fade in place); panels and photos take one 100svh row each in the right column.
 * Below 1024 the chapters stack; the dots and the CTA still hold still, and each copy fades in in place.
 * Use cases (sections/uses.blade.php) live at the end of this file (u4-*).
 */

.f3 { position: relative; }
.f3__head { padding-block: clamp(44px, 6vw, 92px) clamp(28px, 3.5vw, 52px); }
.f3__sub { margin-top: clamp(12px, 1.4vw, 20px); max-width: 42em; }


.f3__field { position: relative; background: var(--nb-accent); color: var(--nb-ink); }

/* Fixed dots: a viewport-fixed layer seen only through the field (clip-path clips fixed descendants).
   The dots hold still from the first pixel of lime: while the field rises into view, while chapters pass,
   and while it leaves. lvh so the layer still covers the screen when mobile browser bars collapse. */
.f3__pattern { position: absolute; inset: 0; pointer-events: none; clip-path: inset(0); }
.f3__dots {
    position: fixed; left: 0; right: 0; top: 0; height: 100vh; height: 100lvh;
    background-image: radial-gradient(circle at center, rgba(17, 17, 19, .16) 0 1.5px, transparent 2px);
    background-size: 24px 24px;
    background-position: center 12px;
}

/* ─── Chapters (stacked: phones and tablets) ─── */
.f3__list { position: relative; z-index: 1; }
.f3-ch {
    display: grid; justify-items: center; gap: 36px;
    padding: 72px var(--gutter) 24px;
}
.f3-ch:first-child { padding-top: 64px; }
.f3-ch:last-child { padding-bottom: 120px; } /* clears the sticky CTA */
.f3-ch__copy { justify-self: stretch; max-width: 620px; }
/* Chapter titles carry the section size (.nb-h2, landing.css): each chapter is a full stage. */
.f3-ch__title { word-break: keep-all; }
.f3-ch__soon {
    display: inline-flex; align-items: center; margin-top: 16px; min-height: 30px; padding: 0 12px;
    border-radius: 999px; background: var(--nb-ink); font-size: 13.5px; font-weight: 700; color: #fff;
}
/* Stacked (and wide without the cross-fade): each copy block fades in where it stands, no slide. */
@media (prefers-reduced-motion: no-preference) {
    .nb-motion .f3:not(.f3--xfade) .f3-ch__copy { transition: opacity 700ms ease; }
    .nb-motion .f3:not(.f3--xfade) .f3-ch__copy:not(.is-in) { opacity: 0; }
}
.f3-ch__body { margin-top: 18px; max-width: 30em; font-size: clamp(16px, .3vw + 15px, 19px); line-height: 1.55; color: rgba(17, 17, 19, .8); word-break: keep-all; }

/* Scene: the person on the other side (generated photo, fictional). Stacked: a full-bleed band the card
   rises over. Wide: bleeds off the right edge behind the card. */
.f3-ch__scene {
    position: relative; z-index: 0; margin: 0 calc(-1 * var(--gutter));
    justify-self: stretch; height: min(96vw, 560px); overflow: hidden; background: rgba(0, 0, 0, .08);
}
.f3-ch__scene img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 40%); }

/* Media: the render is 1200×2128 with the card at x 7%..93%, y 0.4%..91.3%; the band below it holds the caption. */
.f3-ch__media {
    position: relative; margin: 0;
    height: min(70svh, 620px, calc((100vw - var(--gutter) * 2) * 2128 / 1200));
    aspect-ratio: 1200 / 2128;
    z-index: 1; margin-top: calc(-1 * min(46vw, 270px));
}
.f3-ch__frame { position: absolute; inset: 0; }
.f3-ch__poster, .f3-ch__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.f3-ch__video { opacity: 0; transition: opacity var(--nb-dur-2) ease; }
.f3-ch__media.is-playing .f3-ch__video { opacity: 1; }
/* Opaque version (Apple engines, features.js): the loop baked on flat lime. Only its card is shown, clipped to
   the card's own edge (x 84..1116, y 24..1944, radius 72 in the 1200x2128 render), so no lime square is drawn over
   the dots or the photo behind; the poster underneath keeps the card's shadow. */
.f3-ch__media--opaque .f3-ch__video { clip-path: inset(1.13% 7% 8.65% 7% round 6% / 3.38%); }
/* No video base configured: an empty card keeps the layout honest instead of a fake screen. */
.f3-ch__empty { position: absolute; left: 7%; right: 7%; top: .4%; bottom: 8.7%; border-radius: 6.5% / 3.7%; background: rgba(17, 17, 19, .08); }

/* Agent chapter (not shipped): today's work as an HTML card on the dots instead of a motion panel.
   Rows come in one after another when the card is revealed; without motion they are simply there. */
.f3-ch__media--panel { aspect-ratio: auto; height: auto; width: min(100%, 440px); margin-top: 0; }
.f3-agent {
    padding: 22px 20px 20px; border-radius: 28px; background: #fff; color: var(--nb-ink);
    box-shadow: 0 30px 60px -30px rgba(17, 17, 19, .45);
}
.f3-agent__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.f3-agent__head b { font-family: var(--nb-display); font-size: 28px; font-weight: var(--nb-h3-w); letter-spacing: var(--nb-h3-ls); }
.f3-agent__head span { font-size: 13.5px; font-weight: 600; color: var(--nb-ink-3); }
.f3-agent__note {
    display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 12px 14px; border-radius: 16px;
    background: var(--nb-mist); font-size: 15px; font-weight: 600;
}
.f3-agent__note .nb-i { width: 17px; height: 17px; color: var(--nb-ink); }
.f3-agent__tasks { display: grid; gap: 0; margin-top: 8px; }
.f3-agent__task {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
    min-height: 60px; border-bottom: 1px solid var(--nb-line);
}
.f3-agent__task:last-child { border-bottom: 0; }
.f3-agent__tag { padding: 3px 9px; border-radius: 999px; background: var(--nb-mist); font-size: 12.5px; font-weight: 700; color: var(--nb-ink-2); white-space: nowrap; }
.f3-agent__text { font-size: 15px; font-weight: 600; line-height: 1.35; word-break: keep-all; }
.f3-agent__act { padding: 7px 12px; border-radius: 999px; background: var(--nb-ink); color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) {
    .nb-motion .f3-ch__media--panel .f3-agent__note,
    .nb-motion .f3-ch__media--panel .f3-agent__task { transition: opacity var(--nb-dur-3) ease, transform var(--nb-dur-3) var(--nb-ease); }
    .nb-motion .f3-ch__media--panel:not(.is-in) .f3-agent__note,
    .nb-motion .f3-ch__media--panel:not(.is-in) .f3-agent__task { opacity: 0; transform: translateY(10px); }
    .nb-motion .f3-ch__media--panel.is-in .f3-agent__note { transition-delay: 200ms; }
    .nb-motion .f3-ch__media--panel.is-in .f3-agent__task:nth-child(1) { transition-delay: 500ms; }
    .nb-motion .f3-ch__media--panel.is-in .f3-agent__task:nth-child(2) { transition-delay: 700ms; }
    .nb-motion .f3-ch__media--panel.is-in .f3-agent__task:nth-child(3) { transition-delay: 900ms; }
}

/* Step caption: ink bar under the card, "1/2" counter, lime progress on the video's own clock. */
.f3-cap {
    position: absolute; left: 50%; bottom: 0; translate: -50% 0; width: max-content; max-width: 86%; height: 36px;
    display: flex; align-items: center; padding: 0 14px 0 16px;
    border-radius: 999px; background: rgba(17, 17, 19, .9); color: #fff; overflow: hidden;
    box-shadow: 0 8px 18px -10px rgba(17, 17, 19, .5);
    font-size: clamp(13px, .2vw + 12px, 15px); font-weight: 700; letter-spacing: -0.01em;
}
.f3-cap__row { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; }
.f3-cap__steps { display: grid; flex: 1; min-width: 0; }
.f3-cap__step {
    grid-area: 1 / 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    opacity: 0; transform: translateY(6px);
    transition: opacity var(--nb-dur-2) ease, transform var(--nb-dur-3) var(--nb-ease);
}
.f3-cap__step.is-on { opacity: 1; transform: none; }
/* Languages past Korean and English: a step that does not fit the 86% pill ("Solo cuentan los pedidos
   confirmados") wraps to a second line instead of losing its end to an ellipsis. */
:root:not(:lang(ko)):not(:lang(en)) .f3-cap { max-width: 92%; height: auto; min-height: 36px; padding-block: 7px; border-radius: 18px; }
:root:not(:lang(ko)):not(:lang(en)) .f3-cap__step { white-space: normal; text-wrap: balance; line-height: 1.25; }
.f3-cap__count { flex: none; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .62); }
.f3-cap__count b { color: #fff; font-weight: 700; }
.f3-cap__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .14); }
.f3-cap__bar b { display: block; height: 100%; background: var(--nb-accent); transform-origin: 0 50%; transform: scaleX(var(--sp, 0)); }

/* ─── Chrome: rail + CTA. Stacked layout keeps only the CTA, as a bottom bar that rides along. ─── */
.f3__chrome { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.f3__chrome-in {
    position: sticky; top: 0; height: 100vh; height: 100svh;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 0 var(--gutter) max(16px, env(safe-area-inset-bottom));
}
.f3__rail { display: none; }
.f3__cta { pointer-events: auto; width: 100%; max-width: 520px; align-self: center; box-shadow: 0 10px 24px -10px rgba(70, 0, 14, .5); }

/* ─── Wide: one viewport per chapter, copy left, panel right; rail top, CTA bottom ─── */
@media (min-width: 1024px) {
    .f3__dots {
        /* Dots on the panel half only, with a short soft edge: the copy column is clean lime, so the
           rail and CTA bands below can hide passing copy without showing a box. */
        -webkit-mask-image: linear-gradient(90deg, transparent 50%, #000 58%);
        mask-image: linear-gradient(90deg, transparent 50%, #000 58%);
    }

    .f3-ch, .f3-ch:first-child, .f3-ch:last-child {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; justify-items: stretch; gap: 0;
        min-height: 100vh; min-height: 100svh; padding: 0;
    }
    .f3-ch__copy { padding: 0 clamp(32px, 4vw, 72px) 0 var(--edge); max-width: none; }
    .f3-ch__body { margin-top: 24px; max-width: 26em; }
    .f3-ch { position: relative; }
    .f3-ch__media { justify-self: start; margin: 0 0 0 24px; height: min(78svh, 740px); }
    .f3-ch__media--panel { height: auto; align-self: center; width: min(440px, calc(100% - 48px)); }
    /* Card right edge = column start + 24px + 93% of the panel width (1200/2128 of its height);
       the photo starts 88px under the card and runs off the viewport edge. */
    .f3-ch__scene {
        position: absolute; top: 50%; right: 0; translate: 0 -50%; margin: 0;
        left: max(calc(50% + 24px + min(78svh, 740px) * .5639 * .93 - 88px), calc(100% - 600px));
        height: min(66svh, 620px); border-radius: 32px 0 0 32px;
    }

    .f3__chrome { right: 50%; }
    .f3__chrome-in { justify-content: space-between; padding: calc(var(--nav-h) + 28px) 0 40px var(--edge); isolation: isolate; }
    /* Plain lime bands behind the rail and the CTA: copy slides under them instead of through them. */
    .f3__chrome-in::before, .f3__chrome-in::after { content: ""; position: absolute; left: 0; right: 0; z-index: -1; background: var(--nb-accent); }
    .f3__chrome-in::before { top: 0; height: calc(var(--nav-h) + 28px + 52px); }
    .f3__chrome-in::after { bottom: 0; height: 128px; }
    .f3__rail {
        display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px;
        width: min(600px, 100% - 48px); pointer-events: auto;
    }
    .f3__rail a { display: grid; gap: 10px; padding: 6px 0; font-size: 13.5px; font-weight: 700; color: rgba(17, 17, 19, .62); transition: color var(--nb-dur-2) ease; }
    .f3__rail .is-on a { color: var(--nb-ink); }
    .f3__rail i { display: block; height: 3px; border-radius: 2px; background: rgba(17, 17, 19, .16); overflow: hidden; }
    .f3__rail b { display: block; height: 100%; background: var(--nb-ink); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
    .f3__rail .is-done b { transform: none; }
    .f3__rail span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    @media (hover: hover) { .f3__rail a:hover { color: var(--nb-ink); } }
    .f3__cta { width: auto; align-self: flex-start; }
}
@media (min-width: 1180px) {
    .f3__head .nb-line { display: inline; }
}
@media (min-width: 1024px) and (max-width: 1279.98px) {
    .f3__rail { gap: 8px; width: calc(100% - 32px); }
    .f3__rail a { font-size: 12.5px; letter-spacing: -0.01em; }
}
/* ─── Wide + motion: copy cross-fades in one sticky cell, panels scroll through the right column ─── */
@media (min-width: 1024px) and (min-height: 640px) {
    .f3--xfade .f3__list { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-rows: 100vh; grid-auto-rows: 100svh; }
    .f3--xfade .f3-ch { display: contents; }
    .f3--xfade .f3-ch__copy {
        grid-column: 1; grid-row: 1 / 6; align-self: start;
        position: sticky; top: 0; height: 100vh; height: 100svh;
        display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
        opacity: 0; visibility: hidden;
        transition: opacity 450ms ease, visibility 0s linear 450ms;
    }
    .f3--xfade .f3-ch__copy.is-cur { opacity: 1; visibility: visible; transition: opacity 650ms ease 150ms, visibility 0s; }
    .f3--xfade .f3-ch__media { grid-column: 2; grid-row: var(--row); align-self: center; }
    .f3--xfade .f3-ch__scene {
        grid-column: 2; grid-row: var(--row); align-self: center; justify-self: end;
        position: relative; top: auto; right: auto; left: auto; translate: none;
        width: min(600px, calc(100% - 24px - min(78svh, 740px) * .5639 * .93 + 88px));
    }
}
/* Short wide screens: the rail and CTA would crowd the copy; keep them in flow instead of riding along. */
@media (min-width: 1024px) and (max-height: 639.98px) {
    .f3__chrome { position: relative; inset: auto; }
    .f3__chrome-in { position: static; height: auto; padding-top: 40px; padding-bottom: 0; }
    .f3__cta { display: none; }
    .f3__chrome-in::before, .f3__chrome-in::after { display: none; }
    .f3-ch__media { height: min(86svh, 740px); }
    .f3-ch__scene { left: max(calc(50% + 24px + min(86svh, 740px) * .5639 * .93 - 88px), calc(100% - 600px)); }
}
@media (min-width: 1600px) {
    .f3-ch__body { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
    .f3-cap__step, .f3-ch__video, .f3__rail a { transition: none; }
}

/* ═══ Use cases (sections/uses.blade.php): products · classes · brand deals ═══
 * Three cards, no box: a photo of the job (generated, fictional people) with the Instagram moment that
 * starts it laid on the photo, drawn like the iOS app (system type, #737373 meta, Instagram's heart; the
 * brand's DM as an iOS banner), then the label and one line. Photo square on phones (the Instagram piece
 * covers the bottom quarter, not the third, so the hands and the product stay in view), 5:4 on tablets,
 * 4:5 side by side. Each photo is its own place and color under the same hard daytime sun; --pos keeps the
 * subject and the creator's kit (tripod phone, ring light) in the crop. */
.u4 { padding-bottom: calc(var(--sec) * .6); }
.u4__list { display: grid; gap: 48px; margin-top: 48px; }
.u4-card { display: flex; flex-direction: column; min-width: 0; }
.u4-card__media {
    position: relative; margin: 0; aspect-ratio: 5 / 4; overflow: hidden;
    border-radius: var(--r-panel, 24px); background: var(--nb-mist); isolation: isolate;
}
.u4-card__photo { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); }
.u4-card--goods { --pos: 28% 50%; }
.u4-card--class { --pos: 48% 50%; }
.u4-card--collab { --pos: 60% 50%; }
.u4-card__label { margin-top: 24px; }
.u4-card__body {
    margin-top: 10px; max-width: 30em; font-size: clamp(16px, .2vw + 15px, 18px); line-height: 1.55;
    color: var(--nb-ink-2); word-break: keep-all;
}

/* Instagram pieces. System type like the app (SF / Apple SD Gothic Neo on Apple devices). */
.u4-ig {
    position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 1;
    display: flex; gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard Variable", Pretendard, system-ui, sans-serif;
    color: #0c1014; letter-spacing: 0; word-break: keep-all;
}
.u4-ig__body { display: grid; flex: 1; min-width: 0; }
.u4-ig__meta { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 13px; line-height: 1.3; }
.u4-ig__meta b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u4-ig__meta span { flex: none; color: #737373; }
.u4-ig__text { font-size: 14.5px; line-height: 1.34; overflow-wrap: anywhere; }

/* A comment row, lifted off the sheet onto the photo. */
.u4-ig--comment {
    align-items: flex-start; padding: 12px 14px 12px 12px; border-radius: 18px; background: #fff;
    box-shadow: 0 1px 2px rgba(17, 17, 19, .08), 0 14px 32px -14px rgba(17, 17, 19, .45);
}
.u4-ig__av { flex: none; width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.u4-ig__reply { margin-top: 4px; font-size: 12px; font-weight: 600; line-height: 1.3; color: #737373; }
.u4-ig__heart { flex: none; width: 14px; height: 14px; margin-top: 10px; fill: #737373; }

/* The brand's DM as it lands on the lock screen: iOS banner with the Instagram app icon. */
.u4-ig--notice {
    align-items: center; padding: 12px 14px 12px 12px; border-radius: 22px;
    background: rgba(246, 246, 248, .86); -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8);
    box-shadow: 0 14px 32px -14px rgba(17, 17, 19, .45);
}
.u4-ig--notice .u4-ig__meta b { font-size: 14px; color: #000; }
.u4-ig--notice .u4-ig__meta span { margin-left: auto; font-size: 13px; color: rgba(60, 60, 67, .6); }
.u4-ig--notice .u4-ig__text { color: #000; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.u4-ig__app {
    flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px;
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}
.u4-ig__app svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2.1; }
.u4-ig__app .u4-ig__dotfill { fill: #fff; stroke: none; }

@media (max-width: 599.98px) {
    .u4-card__media { aspect-ratio: 1 / 1; }
}
@media (min-width: 900px) {
    .u4__list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
    .u4-card__media { aspect-ratio: 4 / 5; }
}
@media (min-width: 900px) and (max-width: 1199.98px) {
    .u4-ig { left: 10px; right: 10px; bottom: 10px; gap: 10px; }
    .u4-ig__text { font-size: 13.5px; }
}

/* Reveal: the card itself rises with [data-reveal] (landing.css); the photo settles and the Instagram
   piece comes in a beat later, like a notification arriving. */
@media (prefers-reduced-motion: no-preference) {
    .nb-motion .u4-card__photo { transition: transform 1200ms var(--nb-ease); }
    .nb-motion .u4-card:not(.is-in) .u4-card__photo { transform: scale(1.06); }
    .nb-motion .u4-ig { transition: opacity 400ms ease 380ms, transform 500ms var(--nb-ease) 380ms; }
    .nb-motion .u4-card:not(.is-in) .u4-ig { opacity: 0; transform: translateY(14px); }
    .nb-motion .u4-card:nth-child(2) .u4-ig { transition-delay: 500ms; }
    .nb-motion .u4-card:nth-child(3) .u4-ig { transition-delay: 620ms; }
}
