:root {
    --bg: #000000;
    --fg: #ffffff;
    --dim: #888888;
    --border: #333333;
    --sans: 'Inter', -apple-system, system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--fg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

img, video { max-width: 100%; display: block; }

/* ─── Layout ─────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
section { padding: 8rem 0; border-bottom: 1px solid var(--border); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }

/* ─── Typography ─────────────────────────────────── */
h1 {
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 1.5rem;
    color: var(--fg);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--fg);
}

h3 {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--fg);
}

p {
    font-size: 1.125rem;
    font-weight: 300;
    color: var(--dim);
    line-height: 1.65;
}

.large-lead {
    font-size: 1.375rem;
    font-weight: 300;
    color: var(--fg);
    max-width: 36ch;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.section-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--dim);
    margin-bottom: 1rem;
    font-weight: 500;
}

/* ─── Links ──────────────────────────────────────── */
a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.2s;
}
a:hover { border-color: var(--fg); }
a.no-underline { border-bottom: none; }

/* ─── Navigation ─────────────────────────────────── */
nav {
    padding: 0 clamp(1rem, 4vw, 3rem);
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    left: 0; right: 0; top: 0;
    z-index: 100;
    background: rgba(10, 12, 16, 0.55);
    border-bottom: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    transition: background 0.25s ease, box-shadow 0.25s ease;
}
nav.scrolled {
    background: rgba(10, 12, 16, 0.88);
    box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}

.nav-logo {
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: none;
    letter-spacing: -0.01em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    font-size: 0.85rem;
}

.nav-links a {
    border-bottom: none;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.nav-links a:hover { opacity: 1; }

.nav-links a.btn-download {
    opacity: 1;
    border: 1px solid var(--border);
    padding: 0.5rem 1.25rem;
    font-size: 0.8rem;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.nav-links a.btn-download:hover {
    border-color: var(--fg);
    background: var(--fg);
    color: var(--bg);
}

/* ─── Hero ───────────────────────────────────────── */
/* Hero is a cinematic full-bleed video stage with a glass caption strip
   at the bottom. Nav floats fixed above; copy lives in the strip. */
.hero {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    padding: 0;
    border-bottom: 1px solid var(--border);
    display: block;
}
.hero-bg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 0;
    /* Grayscale + contrast + brightness are baked into the source file
       (see ffmpeg encode), so we don't pay per-frame CSS filter cost. */
}
/* Two sources: wide 16:9 for desktop, portrait 4:5 for mobile so the
   architectural content crops vertically (not just shows the top half). */
.hero-bg-portrait { display: none; }
@media (max-width: 768px) {
    .hero-bg-wide { display: none; }
    .hero-bg-portrait { display: block; }
}
/* Halftone dots over the entire video. */
.hero::before {
    content: '';
    position: absolute; inset: 0; z-index: 1;
    background-image: radial-gradient(circle at center, rgba(0,0,0,0.85) 0.9px, transparent 1.6px);
    background-size: 4px 4px;
    mix-blend-mode: multiply;
    pointer-events: none;
}
/* Optional vignette + slight bottom darken so the strip melts in. */
.hero-bg-veil {
    position: absolute; inset: 0; z-index: 2;
    pointer-events: none;
    background:
      radial-gradient(80% 100% at 50% 30%, rgba(0,0,0,0) 0%, rgba(0,0,0,0.25) 100%),
      linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.35) 100%);
}

/* Bottom caption strip — solid glass band that holds the headline + CTA
   and gives them their own legible surface against the moving video. */
.hero-strip {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
    background: rgba(10, 12, 16, 0.78);
    border-top: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    padding: clamp(1.75rem, 4vh, 3rem) clamp(1rem, 4vw, 4rem);
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 4rem);
    align-items: center;
}
.hero-strip .strip-left  { min-width: 0; }
.hero-strip .strip-right {
    display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.hero-strip h1 {
    margin: 0.5rem 0 0.5rem;
    font-size: clamp(2rem, 4.4vw, 3.4rem);
    line-height: 1.02;
}
.hero-strip .large-lead {
    font-size: 1rem;
    max-width: 520px;
    margin: 0;
    color: rgba(245,245,247,0.78);
}

/* Callout band — short slogan between content sections. Center-aligned,
   large type, no clutter. The em-tag inside picks up the brand blue. */
.callout-band { padding: 5rem 0; border-bottom: 1px solid var(--border); }
.callout-band .container { text-align: center; }
.callout-band p {
    margin: 0; font-weight: 500;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
    letter-spacing: -0.025em;
    max-width: 22ch;
    margin-inline: auto;
}
.callout-band em { font-style: normal; color: #4a9eff; }

.hero-actions {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.hero-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 4rem;
}

.hero-pair-half { margin: 0; }

.hero-pair-half img {
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.hero-pair-half figcaption {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--dim);
    margin-top: 0.75rem;
    font-weight: 500;
}

.hero-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4rem;
    align-items: center;
}
.hero-text { min-width: 0; }

.hero-montage {
    position: relative;
    margin: 0;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #000;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
}
.hero-montage video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Stylized: high-contrast grayscale + slight darken so the halftone
       dot pattern overlay reads like print. Matches the sign-in modal. */
    filter: grayscale(0.85) contrast(1.18) brightness(0.82);
}
/* Halftone dot pattern multiplied onto the video. */
.hero-montage::before {
    content: '';
    position: absolute; inset: 0; z-index: 2;
    background-image: radial-gradient(circle at center, rgba(0,0,0,0.85) 0.9px, transparent 1.6px);
    background-size: 4px 4px;
    mix-blend-mode: multiply;
    pointer-events: none;
}
/* Subtle blue tint + vignette for depth. */
.hero-montage::after {
    content: '';
    position: absolute; inset: 0; z-index: 3;
    background:
      radial-gradient(70% 80% at 50% 50%, rgba(74, 158, 255, 0.08), transparent 70%),
      linear-gradient(180deg, rgba(10, 25, 50, 0) 60%, rgba(10, 25, 50, 0.25) 100%);
    pointer-events: none;
}

.btn-primary, a.btn-primary {
    display: inline-block;
    border: none;
    color: #ffffff;
    padding: 0.875rem 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--sans);
    cursor: pointer;
    background: linear-gradient(180deg, #4a9eff 0%, #65adff 100%);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(74, 158, 255, 0.35);
    transition: filter 0.2s, transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.btn-primary:hover, a.btn-primary:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(74, 158, 255, 0.48);
}
.btn-primary:active, a.btn-primary:active { transform: translateY(0); }

.btn-secondary-text {
    font-size: 0.875rem;
    color: var(--dim);
    font-weight: 300;
    border-bottom: none;
}

/* ─── Showcase media ─────────────────────────────── */
.showcase .media-frame {
    margin-top: 4rem;
    border: 1px solid var(--border);
    background: #0a0a0a;
}

.showcase .media-frame img,
.showcase .media-frame video {
    width: 100%;
    height: auto;
    display: block;
}

.showcase .media-frame figcaption {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--dim);
    font-weight: 300;
}

/* ─── Split text / media showcase ────────────────── */
/* Used where the clip is low-res — keeps it at native size beside the
   copy instead of upscaling it across the full content width. */
.showcase-split .split {
    display: grid;
    grid-template-columns: 1fr 556px;
    gap: 3.5rem;
    align-items: center;
}
.showcase-split .split-text { min-width: 0; }
.showcase-split .split-text p { margin-top: 1.25rem; max-width: 46ch; }
.showcase-split .media-frame { margin-top: 0; }

@media (max-width: 900px) {
    .showcase-split .split {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .showcase-split .media-frame { max-width: 556px; }
}

/* ─── Cycling gallery ────────────────────────────── */
.gallery {
    margin-top: 4rem;
    border: 1px solid var(--border);
    background: #0a0a0a;
}
.gallery-stack {
    position: relative;
    width: 100%;
    aspect-ratio: 1919 / 919;
    overflow: hidden;
}
.gallery-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}
.gallery-slide.active {
    opacity: 1;
    pointer-events: auto;
}
.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gallery-caption {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--dim);
    font-weight: 300;
    min-height: 2.6em;
    line-height: 1.5;
}
.gallery-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem;
    border-top: 1px solid var(--border);
}
.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}
.gallery-dot.active {
    background: var(--fg);
    transform: scale(1.3);
}
.gallery-dot:hover { background: var(--dim); }

/* ─── Feature Items ──────────────────────────────── */
.feature-item {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.feature-item p {
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* ─── Mode Cards ─────────────────────────────────── */
.mode-card {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    padding-right: 1rem;
}

.mode-card .mode-name {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--fg);
}

.mode-card .mode-shortcut {
    font-size: 0.75rem;
    color: var(--dim);
    font-family: 'Courier New', monospace;
    margin-bottom: 0.6rem;
    display: block;
}

.mode-card p { font-size: 0.9rem; }

/* ─── Tutorial-style footer row ──────────────────── */
.tutorial-footer {
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 3rem;
    justify-content: center;
    flex-wrap: wrap;
}

.tutorial-footer span { font-size: 0.8rem; color: var(--dim); }
.tutorial-footer span strong { color: var(--fg); font-weight: 500; }

/* ─── Signup form ────────────────────────────────── */
.signup { margin-top: 2rem; }

.signup-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    max-width: 32rem;
}

.signup-form input[type="email"] {
    flex: 1 1 16rem;
    min-width: 12rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg);
    font-family: var(--sans);
    font-size: 0.95rem;
    padding: 0.875rem 1rem;
    transition: border-color 0.2s;
}

.signup-form input[type="email"]:focus {
    outline: none;
    border-color: var(--fg);
}

.signup-form input[type="email"]::placeholder { color: var(--dim); }

.signup-form .btn-primary { padding: 0.875rem 1.5rem; }

.signup-msg {
    flex-basis: 100%;
    font-size: 0.85rem;
    color: var(--dim);
    min-height: 1.2em;
}
.signup-msg[data-state="ok"]  { color: #7fd97f; }
.signup-msg[data-state="err"] { color: #e88; }

/* ─── Footer ─────────────────────────────────────── */
.footer-inner {
    padding: 4rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 0.85rem;
    color: var(--dim);
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 2rem;
    border-top: 1px solid var(--border);
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-inner a {
    color: var(--dim);
    border-bottom: none;
    transition: color 0.2s;
}

.footer-inner a:hover { color: var(--fg); }

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 900px) {
    .grid-3 { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 600px) {
    .container { padding: 0 1.25rem; }
    section { padding: 5rem 0; }
    /* Keep the nav as a single row on mobile so it stays 64px tall and the
       fixed positioning lines up with the hero strip below. */
    nav { padding: 0 1rem; flex-direction: row; align-items: center; gap: 0; height: 56px; }
    .nav-logo { font-size: 0.85rem; }
    .nav-links { gap: 0.75rem; font-size: 0.8rem; }
    .nav-links a.btn-download { padding: 0.4rem 0.9rem; font-size: 0.75rem; }
    .nav-signin { font-size: 0.78rem; }
    .hero { min-height: 100vh; }
    /* Mobile: drop the opaque glass band — instead, fade the bottom of the
       hero to dark with a gradient so the video is visible right up to the
       headline. Strip content stays compact (label, h1, CTA only). */
    .hero-strip {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 5rem 1.25rem 1.5rem;   /* extra top padding for the gradient ramp */
        background: linear-gradient(180deg, rgba(10,12,16,0) 0%, rgba(10,12,16,0.55) 35%, rgba(10,12,16,0.92) 100%);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-top: none;
    }
    .hero-strip .section-label { padding: 4px 10px; font-size: 10px; }
    .hero-strip h1 {
        margin: 0.35rem 0 0.35rem;
        font-size: clamp(1.6rem, 6.5vw, 2rem);
        line-height: 1.05;
    }
    .hero-strip .large-lead { display: none; }
    .hero-strip .strip-right {
        flex-direction: row; align-items: center;
        gap: 0.75rem; flex-wrap: wrap;
        margin-top: 0.4rem;
    }
    .hero-strip .btn-primary { padding: 0.7rem 1.25rem; font-size: 0.85rem; }
    .hero-strip .btn-secondary-text { font-size: 0.78rem; }
    /* The portrait file is naturally a better fit on a phone screen. */
    .hero-bg-portrait { object-position: center 55%; }
    .hero-pair { grid-template-columns: 1fr; gap: 1rem; margin-top: 3rem; }
    .hero-pair-half img { aspect-ratio: 16 / 10; object-fit: cover; }
    .footer-inner { flex-direction: column; padding: 3rem 1.25rem; }
    .tutorial-footer { flex-direction: column; gap: 0.75rem; padding: 1rem 1.25rem; }
}
