/* ─────────────────────────────────────────────
   TOKENS
───────────────────────────────────────────── */
:root {
    --bg:     #171722;
    --border: rgba(255, 255, 255, 0.08);

    --text:  #e8edf5;
    --muted: #9aa8bc;
    --dim:   #5c6b82;

    /* Brand accent (links, feature icons, carousel chrome, CTA fill) */
    --accent:      #f59e0b;
    --accent-hover:#fbbf24;
    --accent-soft: rgba(245, 158, 11, 0.1);
    --accent-line: rgba(245, 158, 11, 0.15);
    --accent-faint: rgba(245, 158, 11, 0.03);

    --radius:    10px;
    --radius-lg: 16px;
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --copy-body: clamp(0.82rem, 1.6vw, 0.92rem);
}

/* ─────────────────────────────────────────────
   SHELL
───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    min-height: 100%;
    overflow-x: hidden;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.page {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: clamp(1rem, 2.5vh, 1.6rem) clamp(1rem, 2.5vw, 1.85rem);
    gap: clamp(0.6rem, 1.8vh, 1.1rem);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─────────────────────────────────────────────
   SITE HEADER — banner, tagline, shields
───────────────────────────────────────────── */
.site-header {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.45rem, 1.2vh, 0.75rem);
    padding-bottom: clamp(0.85rem, 2.4vh, 1.5rem);
    width: min(1100px, 100%);
    margin-inline: auto;
}

.brand-banner {
    display: block;
    height: clamp(3.2rem, 10vh, 6rem);
    width: auto;
    max-width: min(580px, 86vw);
    object-fit: contain;
}

/* One-line hero line; horizontal scroll on narrow viewports instead of wrapping. */
.site-tagline {
    margin: 0;
    width: 100%;
    max-width: 100%;
    padding-inline: 0;
    box-sizing: border-box;
    text-align: center;
    font-family: var(--font);
    font-size: clamp(0.8rem, 1.7vw, 0.95rem);
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.shield-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.45rem 0.55rem;
    margin-top: clamp(0.35rem, 0.9vh, 0.7rem);
}

.shield-link,
.shield-wrap {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    text-decoration: none;
    opacity: 0.92;
    transition: opacity 0.2s, filter 0.2s;
}
.shield-link:hover {
    opacity: 1;
    filter: brightness(1.08);
}

.shield-img {
    height: 22px;
    width: auto;
    display: block;
    border-radius: 3px;
}

/* ─────────────────────────────────────────────
   MAIN — 2×2 grid (features + CTA | carousel + caption)
───────────────────────────────────────────── */
.site-main {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.62fr);
    grid-template-rows: auto auto;
    align-items: stretch;
    column-gap: clamp(1.25rem, 3.5vw, 2.25rem);
    row-gap: clamp(0.45rem, 1.2vh, 0.65rem);
    width: 100%;
    max-width: min(1400px, 100%);
    margin-inline: auto;
    margin-top: clamp(0.35rem, 1.2vh, 0.85rem);
}

/* Grid: (1,1) features, (2,1) slides, (1,2) CTA, (2,2) caption */
.info-features {
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: clamp(0.7rem, 1.8vh, 1.1rem);
}

.eyebrow {
    font-size: clamp(0.58rem, 1.1vw, 0.66rem);
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
}

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: clamp(0.7rem, 1.8vh, 1.05rem);
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.feat-icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin-top: 0.08rem;
}

.feat-icon svg {
    width: 14px;
    height: 14px;
    display: block;
}

.feature-list strong {
    display: block;
    font-size: clamp(0.74rem, 1.5vw, 0.86rem);
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 0.15rem;
}

.feature-list p {
    font-size: var(--copy-body);
    color: var(--muted);
    line-height: 1.5;
}

/* Download + repo — grid cell (1,2), centered in column */
.info-actions {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(0.55rem, 1.4vh, 0.8rem);
    width: 100%;
    min-width: 0;
    align-self: stretch;
}

/* Row 1: slide viewport; row 2: dots + title + description */
.slide-stage {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-caption {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: clamp(0.45rem, 1.2vh, 0.65rem);
    min-width: 0;
    width: 100%;
}

/* ─────────────────────────────────────────────
   CAROUSEL
───────────────────────────────────────────── */
.slide-frame {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1870 / 1080;
    height: auto;
    flex: 0 1 auto;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.09),
        0 12px 40px rgba(0,0,0,0.5),
        0 0 48px var(--accent-faint);
}

/* Each slide fills the frame. Default hidden until JS sets data-state (first = active). */
.slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1c1c2a;
    opacity: 0;
    transform: translateY(5px);
    pointer-events: none;
    transition:
        opacity 0.38s ease,
        transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

/* active — visible and centered */
.slide[data-state="active"] {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    z-index: 2;
}

/* entering from right (going next) */
.slide[data-state="enter"] {
    opacity: 0;
    transform: translateX(3%) scale(0.98);
    z-index: 1;
}

/* entering from left (going prev) */
.slide[data-state="enter-back"] {
    opacity: 0;
    transform: translateX(-3%) scale(0.98);
    z-index: 1;
}

/* exiting to left */
.slide[data-state="exit"] {
    opacity: 0;
    transform: translateX(-3%) scale(0.98);
    z-index: 1;
}

/* exiting to right */
.slide[data-state="exit-back"] {
    opacity: 0;
    transform: translateX(3%) scale(0.98);
    z-index: 1;
}

.slide img,
.slide .slide-placeholder {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.slide .slide-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dim);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
}

/* ── slide caption ── */
.slide-meta {
    flex: 0 0 auto;
    width: 100%;
}

.slide-title {
    font-size: clamp(0.8rem, 1.7vw, 0.95rem);
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
    margin-bottom: 0.2rem;
    /* Reserve two lines so single-line titles match a wrapped title height. */
    min-height: calc(2 * 1.2em);
}

.slide-desc {
    font-size: var(--copy-body);
    color: var(--muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Match -webkit-line-clamp so 1–4 visible lines keep the same footprint. */
    min-height: calc(4 * 1.5em);
}

.slide-dots-row {
    display: flex;
    justify-content: center;
    width: 100%;
    padding-block: 0.2rem 0.1rem;
}

.nav-btn {
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

/* Side arrows overlaid on the slide */
.nav-btn--overlay {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    width: 36px;
    height: 36px;
    background: rgba(12, 12, 20, 0.58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.nav-btn--overlay:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(12, 12, 20, 0.72);
}
.nav-btn--overlay:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.nav-btn--prev {
    left: clamp(0.4rem, 1.8vw, 0.85rem);
}
.nav-btn--next {
    right: clamp(0.4rem, 1.8vw, 0.85rem);
}

.nav-dots {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: var(--dim);
    cursor: pointer;
    transition: background 0.25s, width 0.28s;
}
.dot.active {
    background: var(--accent);
    width: 18px;
    border-radius: 3px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: clamp(0.6rem, 1.6vh, 0.8rem) clamp(1.5rem, 4vw, 2.5rem);
    background: var(--accent);
    border: none;
    color: #09090f;
    font-family: var(--font);
    font-weight: 700;
    font-size: clamp(0.85rem, 1.7vw, 0.95rem);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.btn-download:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* ─────────────────────────────────────────────
   RESPONSIVE — stack vertically on narrow screens
───────────────────────────────────────────── */
@media (max-width: 850px) {
    .site-main {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 1.5rem;
    }
    .info-features,
    .info-actions,
    .slide-stage,
    .carousel-caption {
        grid-column: 1 / -1;
        grid-row: auto;
    }
    /* Reorder for optimal mobile reading flow: Carousel -> Caption -> Features -> CTA */
    .slide-stage { order: 1; }
    .carousel-caption { order: 2; }
    .info-features { order: 3; }
    .info-actions { order: 4; }

    /* Allow tagline to wrap naturally instead of forcing horizontal scroll */
    .site-tagline {
        white-space: normal;
        overflow-x: visible;
    }
}
