/* VTRIM — quiet editorial dark (ported from the Smoothie Scroll design system) */

:root {
    --bg: #1c1b18;
    --bg-raised: #232220;
    --text: #eceae4;
    --text-muted: #a8a49a;
    --accent: #d97757;
    --accent-hover: #e08a6d;
    --secondary: #9d6bf5;
    --secondary-hover: #ad81f7;
    --border: rgba(255, 255, 255, 0.1);
    --radius: 10px;
    --serif: 'Source Serif 4', Georgia, serif;
    --sans: 'Inter', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

/* WebKit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    border: 3px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    border: 3px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

::-webkit-scrollbar-button {
    display: none;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    /* contain any breakout so it never causes horizontal scroll */
    overflow-x: clip;
}

h1,
h2,
h3 {
    font-family: var(--serif);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin: 0 0 0.5em;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 26px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-primary {
    background: var(--accent);
    color: #1c1108;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #1c1108;
}

.btn-secondary {
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.btn-pro {
    background: var(--secondary);
    color: #160a26;
}

.btn-pro:hover {
    background: var(--secondary-hover);
    color: #160a26;
}

/* Wordmark logo (text/SVG — no image) */
.wordmark {
    display: inline-flex;
    align-items: baseline;
    gap: 0.02em;
    font-family: var(--serif);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1;
}

.wordmark:hover {
    color: var(--text);
}

.wordmark .wm-bracket {
    color: var(--accent);
    font-weight: 600;
}

.wordmark .wm-bracket.out {
    color: var(--secondary);
}

.hero .wordmark {
    font-size: clamp(2.6rem, 9vw, 4.2rem);
    margin-bottom: 22px;
}

.footer-brand .wordmark {
    font-size: 1.5rem;
}

/* Hero */
.hero {
    max-width: 880px;
    margin: 0 auto;
    padding: 90px 24px 0;
    text-align: center;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 5rem);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.15rem;
    max-width: 560px;
    margin: 0 auto 36px;
}

.cta-row {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.release-note {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0 0 56px;
}

/* Demo — "what it is": re-encode vs VTRIM stream-copy.
   Matches the 110px section rhythm above and below. */
.compare {
    margin: 110px 0 0;
    text-align: center;
}

.compare-intro {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 0 0 26px;
}

.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 720px;
    margin: 0 auto;
}

.compare-panel {
    margin: 0;
}

/* Bordered "viewport" screen shared by both demo panels */
.demo-screen {
    position: relative;
    height: 200px;
    overflow: hidden;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-raised);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

/* Left panel: a slow re-encode churn */
.reencode-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.reencode-pct {
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

.bar-track {
    height: 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.22);
}

.reencode .bar-fill {
    animation: reencodeFill 5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.reencode-note {
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.85;
}

@keyframes reencodeFill {
    0% { width: 0; }
    /* stutters and grinds, never quite smooth */
    12% { width: 9%; }
    20% { width: 12%; }
    38% { width: 34%; }
    46% { width: 38%; }
    70% { width: 66%; }
    80% { width: 72%; }
    96% { width: 100%; }
    100% { width: 100%; }
}

/* count the re-encode percentage up in lockstep with the bar */
.reencode-pct::after {
    content: "0%";
    animation: reencodePct 5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes reencodePct {
    0% { content: "0%"; }
    12% { content: "9%"; }
    20% { content: "12%"; }
    38% { content: "34%"; }
    46% { content: "38%"; }
    70% { content: "66%"; }
    80% { content: "72%"; }
    96% { content: "100%"; }
    100% { content: "100%"; }
}

/* Right panel: an instant VTRIM stream-copy trim */
.trimline {
    position: relative;
    display: flex;
    gap: 3px;
    height: 46px;
    padding: 0 2px;
}

.trimline .frame {
    flex: 1;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.10);
}

/* the kept IN/OUT selection lights up */
.trim-sel {
    position: absolute;
    top: -4px;
    bottom: -4px;
    left: 26%;
    right: 22%;
    border: 2px solid var(--accent);
    border-radius: 6px;
    background: rgba(217, 119, 87, 0.14);
}

.trim-sel::before,
.trim-sel::after {
    content: '';
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 6px;
    background: var(--accent);
    border-radius: 3px;
}

.trim-sel::before { left: -4px; }
.trim-sel::after { right: -4px; }

.trim-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.trim-done {
    color: var(--accent);
    font-weight: 500;
    opacity: 0;
    animation: trimDone 5s ease infinite;
}

@keyframes trimDone {
    0%, 30% { opacity: 0; transform: translateY(2px); }
    42%, 92% { opacity: 1; transform: none; }
    100% { opacity: 0; }
}

.panel-cap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding: 0 4px;
}

.cap-name {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.switch {
    position: relative;
    width: 30px;
    height: 17px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    flex-shrink: 0;
}

.switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--text-muted);
}

.switch.on {
    background: var(--accent);
}

.switch.on::after {
    left: auto;
    right: 3px;
    background: #1c1108;
}

@media (prefers-reduced-motion: reduce) {

    .reencode .bar-fill,
    .reencode-pct::after,
    .trim-done {
        animation: none;
    }

    .reencode .bar-fill { width: 72%; }
    .reencode-pct::after { content: "72%"; }
    .trim-done { opacity: 1; }
}

/* Content sections */
.content {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 24px;
}

.content section {
    margin: 110px 0;
}

.features h2,
.plans h2,
.voices h2,
.compare-title {
    text-align: center;
    font-size: clamp(2.1rem, 4.5vw, 3rem);
    margin-bottom: 48px;
}

.compare-title {
    margin-bottom: 14px;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px 56px;
}

.feature h3 {
    font-size: 1.15rem;
    margin-bottom: 0.3em;
}

.feature p {
    color: var(--text-muted);
    margin: 0;
}

.pro-accent {
    color: var(--secondary);
}

.story p {
    font-family: var(--serif);
    font-size: 1.3rem;
    line-height: 1.6;
    text-align: center;
    max-width: 680px;
    margin: 0 auto;
}

/* Plans */
.plans-note {
    color: var(--text-muted);
    text-align: center;
    max-width: 560px;
    margin: -28px auto 48px;
}

.plan-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.plan-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px;
    background: var(--bg-raised);
    display: flex;
    flex-direction: column;
}

.plan-card.plan-pro {
    border-color: rgba(157, 107, 245, 0.4);
    box-shadow: 0 0 0 1px rgba(157, 107, 245, 0.12), 0 18px 50px rgba(0, 0, 0, 0.35);
}

.plan-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.2em;
}

.plan-price {
    color: var(--secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 0 18px;
}

.plan-free .plan-price {
    color: var(--text-muted);
}

.plan-card ul {
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
    flex-grow: 1;
}

.plan-card li {
    padding: 7px 0;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.plan-card li:last-child {
    border-bottom: none;
}

.plan-card li strong {
    color: var(--text);
    font-weight: 500;
}

.plan-card .btn {
    text-align: center;
}

/* Support + footer */
.support p {
    text-align: center;
    color: var(--text-muted);
}

footer {
    border-top: 1px solid var(--border);
    padding: 40px 24px 48px;
    text-align: center;
}

.footer-brand {
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

/* Scroll reveal (script.js adds .reveal-on-scroll / .revealed) */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: none;
}

/* Popups (script.js contract) */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 100;
}

.popup-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    position: relative;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 36px;
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
}

.popup-content h2 {
    font-size: 1.5rem;
    margin-top: 0;
    padding-right: 32px;
}

.popup-body-content {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.popup-body-content h3 {
    color: var(--text);
    font-size: 1.05rem;
}

.popup-body-content strong {
    color: var(--text);
}

.popup-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
}

.popup-close:hover {
    color: var(--text);
}

/* FAQ accordion (inside popup) */
.faq-item {
    border-bottom: 1px solid var(--border);
}

.question {
    padding: 14px 28px 14px 0;
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
    position: relative;
}

.question::after {
    content: '+';
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.question.open::after {
    content: '\2013';
}

.answer {
    display: none;
    padding: 0 0 16px;
    color: var(--text-muted);
}

.answer.open {
    display: block;
}

/* Mobile */
@media (max-width: 640px) {
    .hero {
        padding-top: 64px;
    }

    .content section {
        margin: 72px 0;
    }

    .feature-grid,
    .plan-cards {
        grid-template-columns: 1fr;
    }

    .feature-grid {
        gap: 28px;
    }

    .compare-grid {
        gap: 12px;
    }

    .demo-screen {
        height: 180px;
        padding: 16px 14px;
    }

    .cap-name {
        font-size: 0.78rem;
    }
}
