/* ==========================================================================
   depista — landing stylesheet

   Landing-only styles. Load this file after static/css/depista.css.
   Use the tokens of the master file. Do not change the tokens here.
   ========================================================================== */

/* A click on an anchor link scrolls smoothly (for example, the hero caret). */
html { scroll-behavior: smooth; }

.ld-main {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
}

/* Language switch: the flags float at the top right. */
.ld-lang {
    position: absolute;
    top: var(--space-8);
    right: var(--space-8);
    z-index: 10;
    display: flex;
    gap: var(--space-1);
    padding: var(--space-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}
.ld-lang-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--control-h-sm);
    height: var(--control-h-sm);
    border-radius: var(--radius-pill);
    opacity: 0.45;
    filter: grayscale(0.6);
    transition: opacity var(--duration) var(--ease), filter var(--duration) var(--ease), background var(--duration) var(--ease);
}
.ld-lang-link:hover { opacity: 1; filter: none; background: var(--color-surface-muted); }
.ld-lang-link.is-active { opacity: 1; filter: none; background: var(--color-logo-soft); }
.ld-flag {
    display: block;
    width: 22px;
    height: 22px;
    overflow: hidden;
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--color-border);
}
.ld-flag svg { display: block; width: 100%; height: 100%; }

/* The logo floats at the top left. There is no header bar. */
.ld-logo {
    position: absolute;
    top: var(--space-8);
    left: var(--space-8);
    z-index: 10;
}


/* Hero: the title at the center, the product cards around it. */
.ld-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 720px;
}
.ld-hero::before {
    content: "";
    position: absolute;
    inset: 10% 20%;
    z-index: 0;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--color-logo-soft), transparent);
    pointer-events: none;
}

.ld-hero-text {
    position: relative;
    z-index: 2;
    max-width: 600px;
    text-align: center;
}
.ld-hero-text .eyebrow { color: var(--color-logo); }

.ld-hero-title {
    margin: var(--space-3) 0 var(--space-5);
    font-size: var(--text-display);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
}
.ld-accent { color: var(--color-logo); }

.ld-hero-lead {
    max-width: 460px;
    margin: 0 auto;
    color: var(--color-text-muted);
    font-size: var(--text-lg);
    line-height: var(--leading-normal);
}


/* Stage: the layer of the product cards. */
.ld-stage {
    position: absolute;
    inset: 0;
    z-index: 1;
}


/* Product card.
   Three layers:
   1. .ld-card: the position and the float animation.
   2. .ld-card-tilt: the turn to the pointer (the script sets --rx, --ry, --gx, --gy, --glare).
   3. .ld-card-inner: the flip on hover. */
.ld-card {
    position: absolute;
    width: var(--w);
    perspective: 900px;
    animation: ld-float 7s ease-in-out infinite;
    animation-delay: var(--delay);
}
.ld-card:hover { z-index: 3; }

.ld-card-tilt {
    transform-style: preserve-3d;
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 200ms var(--ease);
}

.ld-card-inner {
    position: relative;
    aspect-ratio: 3 / 4;
    transform-style: preserve-3d;
    transform: rotate(var(--rot)) rotateY(0deg) scale(1);
    transition: transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
    cursor: pointer;
}
@media (hover: hover) {
    .ld-card:hover .ld-card-inner { transform: rotate(0deg) rotateY(180deg) scale(1.08); }
}
.ld-card.is-flipped .ld-card-inner { transform: rotate(0deg) rotateY(180deg) scale(1.08); }

.ld-card-face {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.ld-card-front img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* The glare follows the pointer. */
.ld-card-front::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.6), transparent 55%);
    opacity: var(--glare, 0);
    transition: opacity 200ms var(--ease);
    pointer-events: none;
}

.ld-card-back {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    border-color: transparent;
    background: linear-gradient(145deg, var(--color-logo), var(--color-logo-strong));
    color: #ffffff;
    transform: rotateY(180deg);
}
.ld-card-back svg { width: 40%; height: auto; margin-bottom: var(--space-2); }
.ld-card-back-name { font-size: var(--text-lg); font-weight: var(--weight-bold); letter-spacing: -0.02em; }
.ld-card-back-note { font-size: var(--text-xs); font-weight: var(--weight-medium); opacity: 0.8; }


/* Card positions. Four cards at the left, three at the right. No card is below the title. */
.ld-card-1 { --w: 180px; --rot: -8deg; --delay: 0s;    left: 4%;  top: 6%; }
.ld-card-2 { --w: 150px; --rot: 6deg;  --delay: -2.5s; left: 14%; top: 40%; }
.ld-card-3 { --w: 140px; --rot: -4deg; --delay: -4s;   left: 3%;  top: 70%; }
.ld-card-4 { --w: 160px; --rot: 7deg;  --delay: -1.2s; right: 3%;  top: 3%; }
.ld-card-5 { --w: 175px; --rot: -6deg; --delay: -3.4s; right: 14%; top: 36%; }
.ld-card-6 { --w: 145px; --rot: 5deg;  --delay: -5.1s; right: 2%;  top: 70%; }
.ld-card-7 { --w: 120px; --rot: 9deg;  --delay: -6s;   left: 19%; top: 2%; }

@keyframes ld-float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -14px, 0); }
}


/* Scroll caret: below the hero title. It moves down and up to tell the user to scroll. */
.ld-scroll {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--control-h);
    height: var(--control-h);
    margin-top: var(--space-6);
    border-radius: var(--radius-pill);
    color: var(--color-logo);
    animation: ld-wiggle 1.8s var(--ease) infinite;
    transition: background var(--duration) var(--ease);
}
.ld-scroll:hover { background: var(--color-logo-soft); }
.ld-scroll svg { width: 28px; height: 28px; }

@keyframes ld-wiggle {
    0%, 100% { transform: translateY(0); }
    30% { transform: translateY(8px); }
    50% { transform: translateY(2px); }
    65% { transform: translateY(6px); }
}


/* Audience sections: two open columns on desktop, two rows on small screens.
   There is no box. A thin line divides the two sections. */
.ld-audiences {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 1120px;
    margin: var(--space-8) auto 0;
    padding-top: var(--space-12);
    border-top: 1px solid var(--color-border);
    scroll-margin-top: var(--space-8);
}

.ld-audience {
    display: flex;
    flex-direction: column;
    padding: var(--space-4) var(--space-12);
}
.ld-audience:first-child { padding-left: 0; }
.ld-audience:last-child { padding-right: 0; }
.ld-audience + .ld-audience { border-left: 1px solid var(--color-border); }

.ld-audience-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-5);
    border-radius: var(--radius-md);
    background: var(--color-logo-soft);
    color: var(--color-logo);
}
.ld-audience-icon svg { width: 24px; height: 24px; }

.ld-audience .eyebrow { color: var(--color-logo); }

.ld-audience-title {
    margin: var(--space-2) 0 var(--space-3);
    font-size: var(--text-2xl);
}

.ld-audience-text {
    margin: 0 0 var(--space-5);
    color: var(--color-text-muted);
    line-height: var(--leading-normal);
}

.ld-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: 0 0 var(--space-8);
    padding: 0;
    list-style: none;
}
.ld-features li {
    position: relative;
    padding-left: var(--space-8);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    line-height: 20px;
}
.ld-features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-logo-soft);
}
.ld-features li::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 5px;
    width: 6px;
    height: 9px;
    border: solid var(--color-logo);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Waitlist form: the email and the button on one line. */
.ld-waitlist { margin-top: auto; }
.ld-waitlist-row {
    display: flex;
    gap: var(--space-2);
}
.ld-waitlist-field { flex: 1; min-width: 0; }
.ld-waitlist .error-text { display: block; margin-top: var(--space-2); }
.ld-waitlist-done { margin-top: auto; }


/* Medium screens: remove the cards near the title. */
@media (max-width: 1200px) {
    .ld-card-2,
    .ld-card-5,
    .ld-card-7 { display: none; }
    .ld-card-1 { --w: 150px; }
    .ld-card-4 { --w: 140px; }
    .ld-card-3,
    .ld-card-6 { --w: 125px; }
}

/* Tablets: the audience sections go in two rows. */
@media (max-width: 860px) {
    .ld-audiences { grid-template-columns: minmax(0, 1fr); }
    .ld-audience { padding: 0; }
    .ld-audience + .ld-audience {
        margin-top: var(--space-12);
        padding-top: var(--space-12);
        border-left: none;
        border-top: 1px solid var(--color-border);
    }
}

/* Small screens: small cards at the corners only. */
@media (max-width: 720px) {
    .ld-logo { top: var(--space-5); left: var(--space-5); }
    .ld-lang { top: var(--space-4); right: var(--space-4); }
    .ld-main { padding-top: var(--space-12); }
    .ld-hero { min-height: 640px; }
    .ld-hero-text { max-width: 100%; padding: 0 var(--space-2); }
    .ld-hero-lead { font-size: var(--text-base); }
    .ld-card-1,
    .ld-card-3,
    .ld-card-4,
    .ld-card-6 { --w: 92px; }
    .ld-card-1 { left: 0; top: 4%; }
    .ld-card-4 { right: 0; top: 4%; }
    .ld-card-3 { left: 4%; top: auto; bottom: 0; }
    .ld-card-6 { right: 2%; top: auto; bottom: 2%; }
    .ld-audience-title { font-size: var(--text-xl); }
    .ld-waitlist-row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .ld-card,
    .ld-scroll { animation: none; }
    .ld-card-tilt,
    .ld-card-inner,
    .ld-card-front::after { transition: none; }
}
