/* ==========================================================================
   Landing page (/) — loaded only on the home page, via HomeController's
   pageStyles. Everything here is scoped under .home (or under
   body:has(.home) for the shared chrome) so nothing leaks into the app's
   other pages, which keep app.css alone.

   Direction: the page alternates night and daylight bands — hero, showcase
   and closer sit in a deep plum field, the explanatory sections in paper
   between them — so it reads as a rhythm rather than one long slab. The
   recurring device is a pink-to-blue seam: the two answers a reveal can
   have, used as the heading accent and as the connector through the steps.

   The hero's subject is the product's own mechanic — a real, playable
   scratch card (see home-scratch.js) — with the smoke shot demoted to
   full-bleed atmosphere behind the whole band. An earlier version framed
   that photo in the right-hand column and tried to dissolve its edges with
   a radial mask; the smoke runs bright to the picture's own edges, so a
   straight edge always survived and it read as a rounded rectangle. Making
   it the background removes the frame instead of hiding it.
   ========================================================================== */

/* The --h-* palette and the shared night chrome live in brand.css, which
   HomeController loads immediately before this file — the auth pages use the
   same field, and a copy of the palette in each file would have drifted. */

body:has(.home) {
    /* Full-bleed bands have to escape <main class="container">, which is capped
       at 880px. overflow-x: clip stops the 100vw width from producing a
       horizontal scrollbar — clip rather than hidden, so it creates no scroll
       container and nothing sticky breaks. */
    overflow-x: clip;
    background: var(--h-paper);
}

.home {
    font-family: var(--h-body);
    color: var(--h-ink);
}

/* --------------------------------------------------------------------------
   Bands
   -------------------------------------------------------------------------- */

.home .band {
    margin-inline: calc(50% - 50vw);
    width: 100vw;
    /* Tighter than it was: at 7vw the gap between two sections came to ~180px
       of unexplained cream, which read as the page having run out rather than
       as breathing room. */
    padding-block: clamp(3.25rem, 5.4vw, 5rem);
}

.home .band-inner {
    max-width: var(--content-home);
    margin: 0 auto;
    padding-inline: var(--content-gutter);
}

.home .band--paper {
    background: var(--h-paper);
}

.home .band--night {
    background:
        radial-gradient(66% 70% at 88% 12%, rgba(88, 167, 232, 0.18), transparent 62%),
        radial-gradient(60% 70% at 6% 92%, rgba(242, 120, 159, 0.18), transparent 62%),
        linear-gradient(162deg, var(--h-night-2), var(--h-night) 68%);
    color: var(--h-cream);
}

.home h1,
.home h2,
.home h3 {
    font-family: var(--h-display);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* The third type role: Rubik used quietly, at utility size. The eyebrows name
   whose point of view each section takes — the couple's or the guests' —
   which is a real axis in the content, not a decorative label. */
.home .eyebrow {
    margin: 0 0 0.8rem;
    font-family: var(--h-display);
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.17em;
    text-transform: uppercase;
    color: var(--h-muted);
}

.home .band--night .eyebrow {
    color: var(--h-dim);
}

/* Section headings sit left, with the seam beneath — the page reads as an
   editorial column rather than a stack of centred cards. */
.home .sec-head {
    font-size: clamp(1.9rem, 3.4vw, 2.6rem);
    line-height: 1.1;
    margin: 0;
    color: var(--h-ink);
}

.home .band--night .sec-head {
    color: var(--h-cream);
}

.home .sec-head::after {
    content: '';
    display: block;
    width: 64px;
    height: 5px;
    margin-top: 0.9rem;
    border-radius: 999px;
    background: var(--h-seam);
}

.home .sec-sub {
    margin: 1.1rem 0 0;
    max-width: 52ch;
    font-size: 1.02rem;
    line-height: 1.65;
    color: var(--h-muted);
}

.home .band--night .sec-sub {
    color: var(--h-dim);
}

/* --------------------------------------------------------------------------
   Hero — the smoke shot is the band's atmosphere; the subject is the card.
   -------------------------------------------------------------------------- */

.home .hero {
    position: relative;
    margin-inline: calc(50% - 50vw);
    width: 100vw;
    /* app.css still centres the shared .hero band for the guest vote page;
       the landing hero is an editorial column, so it starts at the inline edge
       (start, not left, so Hebrew flips correctly). */
    text-align: start;
    padding: clamp(3.5rem, 6vw, 5.5rem) 0 clamp(4rem, 7vw, 6rem);
    background: linear-gradient(168deg, var(--h-night-3), var(--h-night) 72%);
    color: var(--h-cream);
    overflow: hidden;
    isolation: isolate;
}

.home .hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.home .hero-bg-media {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 42%;
    /* Thrown out of focus on purpose. Sharp, the couple read as a second
       subject — a face landing right at the card's edge, and type sitting over
       features. Blurred, the same frame gives what it's actually here for:
       the colour and drift of the smoke. The slight scale hides the soft edge
       blur leaves at the boundary. */
    opacity: 0.5;
    filter: blur(3px) saturate(1.18);
    transform: scale(1.05);
}

.home .hero-video {
    opacity: 0;
    transition: opacity 700ms linear;
}

.home .hero-video.is-active {
    opacity: 0.5;
}

/* Top layer holds the seam with the masthead: solid --h-night-3 at the very
   top edge, fading out by 22%, so the header and hero meet invisibly. The
   bottom stop closes the band into --h-night before the paper begins. */
.home .hero-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(180deg, var(--h-night-3) 0%, rgba(29, 22, 38, 0) 22%, rgba(23, 18, 30, 0) 58%, var(--h-night) 100%),
        linear-gradient(96deg, rgba(23, 18, 30, 0.92) 0%, rgba(23, 18, 30, 0.78) 36%, rgba(23, 18, 30, 0.28) 62%, rgba(23, 18, 30, 0.5) 100%),
        radial-gradient(58% 68% at 6% 86%, rgba(242, 120, 159, 0.26), transparent 62%),
        radial-gradient(58% 66% at 94% 14%, rgba(88, 167, 232, 0.24), transparent 62%);
}

.home .hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 0.82fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
    max-width: var(--content-home);
    margin: 0 auto;
    padding-inline: var(--content-gutter);
}

.home .hero-title {
    margin: 0;
    max-width: 17ch;
    text-wrap: balance;
    font-size: clamp(2.3rem, 4.4vw, 3.7rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.03em;
    color: var(--h-cream);
}

.home .hero-subtitle {
    margin: 1.35rem 0 0;
    max-width: 44ch;
    font-size: clamp(1rem, 1.1vw, 1.12rem);
    line-height: 1.68;
    color: var(--h-dim);
}

.home .hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 2rem;
}

.home .btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.95rem 1.7rem;
    border-radius: var(--radius-pill);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

/* Dark ink on blush, not white — white on this pink is about 2.6:1 and fails
   contrast, while the ink pairing clears 8:1 and looks more deliberate. */
.home .btn-cta--solid {
    background: var(--h-blush);
    color: var(--h-night);
}

.home .btn-cta--solid:hover {
    background: #f58fae;
    transform: translateY(-2px);
}

.home .btn-cta--ghost {
    border: 1px solid rgba(247, 241, 236, 0.3);
    color: var(--h-cream);
}

.home .btn-cta--ghost:hover {
    border-color: rgba(247, 241, 236, 0.6);
    transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   The hero card — the reveal mechanic itself, playable. Structure and classes
   match the guest reveal page (.card-zones / .card-zone--heart carry their
   heart mask from app.css) so the demo is the real thing, not a mock-up.
   -------------------------------------------------------------------------- */

.home .demo-card {
    position: relative;
    width: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 30px 70px rgba(8, 4, 14, 0.55),
        0 0 0 1px rgba(247, 241, 236, 0.14);
}

/* Every card picture leaves its lower third blank on purpose — that band is
   where the foil goes. Drawn here even when nothing is interactive, so a card
   never appears half-finished. */
.home .card-zone--heart {
    background: var(--h-foil);
}

.home .demo-zone .zone-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    /* Without this a touch-drag scrolls the page instead of scratching. */
    touch-action: none;
    cursor: crosshair;
}

.home .demo-hint {
    margin: 1.05rem 0 0;
    text-align: center;
    font-family: var(--h-display);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--h-dim);
    transition: color 300ms ease;
}

.home .demo-hint.is-done {
    color: var(--h-cream);
}

/* --------------------------------------------------------------------------
   Steps — a real sequence, so it gets an <ol> and a connector that walks the
   marker colour from blush to sky as the guess resolves into an answer.
   -------------------------------------------------------------------------- */

.home .steps-track {
    position: relative;
    counter-reset: step;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(1.25rem, 2.4vw, 2rem);
    margin: 2.5rem 0 0;
    padding: 0;
    list-style: none;
}

.home .steps-track::before {
    content: '';
    position: absolute;
    top: 1.45rem;
    left: 10%;
    right: 10%;
    height: 3px;
    border-radius: 999px;
    background: var(--h-seam);
    opacity: 0.34;
}

.home .step {
    position: relative;
    counter-increment: step;
}

.home .step-num {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 2.9rem;
    height: 2.9rem;
    margin-bottom: 1.1rem;
    border-radius: 999px;
    font-family: var(--h-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--h-night);
    box-shadow: 0 0 0 6px var(--h-paper);
}

.home .step-num::before {
    content: counter(step);
}

.home .step:nth-child(1) .step-num { background: var(--h-step-1); }
.home .step:nth-child(2) .step-num { background: var(--h-step-2); }
.home .step:nth-child(3) .step-num { background: var(--h-step-3); }
.home .step:nth-child(4) .step-num { background: var(--h-step-4); }

.home .step h3 {
    margin: 0 0 0.45rem;
    font-size: 1.08rem;
}

.home .step p {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.6;
    color: var(--h-muted);
}

/* --------------------------------------------------------------------------
   Template marquee — the card designs are the product's eye candy, so they run
   edge to edge instead of sitting in a 3-up grid. On the night field: the
   artwork is pale watercolour, which dissolved into paper when this band was
   light and left the cards looking like they had no edges.
   -------------------------------------------------------------------------- */

.home .marquee {
    margin-top: 2.5rem;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.home .marquee-row {
    display: flex;
    gap: clamp(0.9rem, 1.8vw, 1.5rem);
    width: max-content;
    margin: 0;
    padding: 0.5rem 0;
    list-style: none;
    animation: home-marquee 64s linear infinite;
}

/* The row holds the cards twice, so translating by exactly half its width
   lands on an identical frame and the loop is invisible. */
@keyframes home-marquee {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-50%, 0, 0); }
}

.home .marquee:hover .marquee-row,
.home .marquee:focus-within .marquee-row {
    animation-play-state: paused;
}

.home .marq-item {
    flex: 0 0 clamp(200px, 25vw, 290px);
}

.home .marq-card {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    box-shadow:
        0 18px 40px rgba(8, 4, 14, 0.5),
        0 0 0 1px rgba(247, 241, 236, 0.12);
    transition: transform 220ms ease;
}

.home .marq-card img {
    display: block;
    width: 100%;
    /* height: auto or the height="1006" attribute pins the box and the
       aspect-ratio below is ignored — same trap as the hero photo had. */
    height: auto;
    aspect-ratio: 1563 / 1006;
    object-fit: cover;
}

.home .marq-item:hover .marq-card {
    transform: translateY(-6px);
}

.home .marq-item span {
    display: block;
    margin-top: 0.7rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--h-dim);
}

/* --------------------------------------------------------------------------
   Features
   -------------------------------------------------------------------------- */

.home .feat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(1rem, 2vw, 1.5rem);
    margin-top: 2.5rem;
}

.home .feat {
    padding: 1.7rem 1.45rem;
    border: 1px solid rgba(32, 26, 41, 0.07);
    border-radius: 22px;
    background: #fff;
}

/* Flat two-tone glyphs drawn in currentColor, alternating between the two
   answers so the feature row carries the duality too. They replaced emoji,
   which were the one thing here that belonged to no particular product. */
.home .feat-icon {
    display: block;
    width: 2.15rem;
    height: 2.15rem;
    margin-bottom: 1rem;
}

.home .feat:nth-child(odd) .feat-icon { color: var(--h-blush); }
.home .feat:nth-child(even) .feat-icon { color: var(--h-sky); }

.home .feat h3 {
    margin: 0 0 0.45rem;
    font-size: 1.02rem;
}

.home .feat p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--h-muted);
}

/* --------------------------------------------------------------------------
   Closing CTA — the night field returns full-bleed to bookend the page. It
   used to be an inset dark card on paper, which read as a stray box once the
   showcase band above it went dark too.
   -------------------------------------------------------------------------- */

.home .band--closer {
    position: relative;
    overflow: hidden;
}

.home .closer {
    position: relative;
}

.home .closer-content {
    position: relative;
    z-index: 1;
    max-width: 34rem;
}

.home .closer h2 {
    margin: 0;
    font-size: clamp(1.7rem, 3.2vw, 2.4rem);
    line-height: 1.14;
    color: var(--h-cream);
}

.home .closer p {
    margin: 1rem 0 2rem;
    font-size: 1.02rem;
    line-height: 1.6;
    color: var(--h-dim);
}

.home .closer-decor {
    position: absolute;
    right: -4rem;
    bottom: -7rem;
    z-index: 0;
    width: clamp(220px, 32vw, 340px);
    height: auto;
    opacity: 0.5;
    pointer-events: none;
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 42%, transparent 76%);
    mask-image: radial-gradient(circle at 50% 50%, #000 42%, transparent 76%);
}

/* --------------------------------------------------------------------------
   Scroll reveals — home-motion.js adds .is-in as each block enters view.
   -------------------------------------------------------------------------- */

.home [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 620ms ease, transform 620ms ease;
}

.home [data-reveal].is-in {
    opacity: 1;
    transform: none;
}

.home a:focus-visible,
.home .btn-cta:focus-visible {
    outline: 2px solid var(--focus-color);
    outline-offset: 3px;
    border-radius: 999px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 960px) {
    /* The card follows the copy here rather than leading it: the smoke is now
       the background of the whole band, so the hero still opens on an image
       and the headline can come first. */
    .home .hero-inner { grid-template-columns: 1fr; }
    .home .hero-demo { max-width: 520px; width: 100%; margin-top: 0.5rem; }
    .home .hero-subtitle { max-width: none; }
    .home .steps-track { grid-template-columns: repeat(2, 1fr); row-gap: 2.25rem; }
    .home .steps-track::before { display: none; }
    .home .feat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .home .band { padding-block: 3rem; }
    .home .hero { padding-block: 3rem 4rem; }
    .home .steps-track,
    .home .feat-grid { grid-template-columns: 1fr; }
    .home .hero-cta .btn-cta { flex: 1 1 100%; }
    .home .closer-decor { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    /* hero-video.js already declines to load the video here. Stop the marquee
       and show revealed blocks outright — the marquee becomes a normal
       scrollable row so its content stays reachable. The scratch card is left
       alone: it moves only in response to the visitor's own pointer, which is
       not what this setting is about. */
    .home .marquee-row { animation: none; }
    .home .marquee { overflow-x: auto; }
    .home [data-reveal] { opacity: 1; transform: none; transition: none; }
    .home .btn-cta,
    .home .marq-card,
    .home .demo-hint { transition: none; }
}
