/* ═══════════════════════════════════════════════════════════════════
   YTDOWN — DARK ONYX PREMIUM THEME
   ═══════════════════════════════════════════════════════════════════ */

:root {
    /* Onyx blacks */
    --black-1: #050505;
    --black-2: #0a0a0a;
    --black-3: #0f0f0f;
    --black-4: #141414;
    --black-5: #1a1a1a;
    --black-6: #202020;
    --black-7: #282828;

    /* Text */
    --white: #f0f0f0;
    --gray-1: #b0b0b0;
    --gray-2: #707070;
    --gray-3: #454545;
    --gray-4: #2a2a2a;

    /* Accent */
    --red: #ff2d55;
    --red-dim: rgba(255, 45, 85, 0.12);
    --red-glow: rgba(255, 45, 85, 0.25);
    --blue: #5e8eff;
    --blue-dim: rgba(94, 142, 255, 0.12);
    --green: #34d399;
    --green-dim: rgba(52, 211, 153, 0.12);
    --purple: #a78bfa;
    --purple-dim: rgba(167, 139, 250, 0.12);
    --orange: #fb923c;

    /* Gradients */
    --grad-red: linear-gradient(135deg, #ff2d55, #ff6b35);
    --grad-blue: linear-gradient(135deg, #5e8eff, #a78bfa);
    --grad-surface: linear-gradient(145deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.005));

    /* Misc */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: 250ms cubic-bezier(.4, 0, .2, 1);
    --spring: 500ms cubic-bezier(.34, 1.56, .64, 1);
}

/* ── Reset ─────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-3) var(--black-1);
}

html::-webkit-scrollbar {
    width: 5px;
}

html::-webkit-scrollbar-track {
    background: var(--black-1);
}

html::-webkit-scrollbar-thumb {
    background: var(--gray-3);
    border-radius: 99px;
}

body {
    font-family: var(--font);
    background: var(--black-1);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--red);
    color: #fff;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font: inherit;
    color: inherit;
}

input {
    border: none;
    outline: none;
    font: inherit;
    color: inherit;
    background: transparent;
}

/* ── Animated Background ───────────────────────────────────────────── */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, black 40%, transparent 100%);
}

.particle-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
}

.bg-glow-1 {
    width: 500px;
    height: 500px;
    background: rgba(255, 45, 85, .06);
    top: -150px;
    right: -100px;
    animation: glow 10s ease-in-out infinite;
}

.bg-glow-2 {
    width: 400px;
    height: 400px;
    background: rgba(94, 142, 255, .04);
    bottom: -100px;
    left: -100px;
    animation: glow 14s ease-in-out infinite reverse;
}

@keyframes glow {

    0%,
    100% {
        opacity: .6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

/* ── Header ────────────────────────────────────────────────────────── */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 24px;
    transition: var(--transition);
}

.header.scrolled {
    background: rgba(5, 5, 5, .8);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.logo:hover {
    opacity: .85;
}

.logo-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--grad-red);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -.5px;
}

.logo-accent {
    background: var(--grad-red);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── Hero ──────────────────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 80px;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 620px;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 99px;
    background: var(--red-dim);
    border: 1px solid rgba(255, 45, 85, .15);
    font-size: .7rem;
    font-weight: 700;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 24px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--red);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1)
    }

    50% {
        opacity: .4;
        transform: scale(1.6)
    }
}

.hero-title {
    font-size: clamp(2.2rem, 6vw, 3.8rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -2px;
    margin-bottom: 18px;
}

.text-gradient {
    background: var(--grad-red);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.05rem;
    color: var(--gray-1);
    line-height: 1.7;
    margin-bottom: 28px;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Tab Bar ───────────────────────────────────────────────────────── */
.tab-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
    position: relative;
    background: var(--black-4);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.tab-bar.tabs-3 {
    max-width: 460px;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 9px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--gray-2);
    transition: var(--transition);
    z-index: 2;
    position: relative;
}

.tab-btn:hover {
    color: var(--gray-1);
}

.tab-btn.active {
    color: var(--white);
}

.tab-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--black-6);
    border-radius: 9px;
    transition: var(--spring);
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}

.tabs-3 .tab-slider {
    width: calc(33.333% - 4px);
}

.tab-slider.mid {
    left: calc(33.333%);
}

.tab-slider.right {
    left: calc(66.666%);
}

.tab-content {
    display: none;
    width: 100%;
    animation: fadeIn .3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ── TikTok Quality ────────────────────────────────────────────────── */
.tt-badge {
    background: linear-gradient(135deg, #25F4EE, #FE2C55) !important;
    color: #fff !important;
}

.tt-quality-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tt-q-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 10px;
    border-radius: 12px;
    background: var(--black-4);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.tt-q-btn:hover {
    border-color: rgba(255, 255, 255, .08);
}

.tt-q-btn.selected {
    border-color: var(--red);
    background: var(--red-dim);
}

.tt-q-label {
    font-size: 1.1rem;
    font-weight: 800;
}

.tt-q-btn.selected .tt-q-label {
    color: var(--red);
}

.tt-q-desc {
    font-size: .68rem;
    color: var(--gray-2);
}

.tt-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tt-feat {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--black-4);
    font-size: .72rem;
    font-weight: 600;
    color: var(--green);
}

.tt-feat svg {
    color: var(--green);
}

.tt-optimize-btn {
    background: linear-gradient(135deg, #FE2C55, #ff6b35) !important;
}

/* ── Drop Zone ─────────────────────────────────────────────────────── */
.drop-zone {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 48px 24px;
    border-radius: 16px;
    border: 2px dashed rgba(255, 255, 255, .08);
    background: var(--black-3);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.drop-zone:hover {
    border-color: rgba(255, 255, 255, .15);
    background: rgba(255, 255, 255, .02);
}

.drop-zone.drag-over {
    border-color: var(--red);
    background: var(--red-dim);
    box-shadow: 0 0 40px rgba(255, 45, 85, .08);
}

.drop-icon {
    margin-bottom: 14px;
    color: var(--gray-2);
    transition: var(--transition);
}

.drop-zone:hover .drop-icon {
    color: var(--gray-1);
    transform: translateY(-4px);
}

.drop-text {
    font-size: .92rem;
    color: var(--gray-1);
    margin-bottom: 6px;
}

.drop-link {
    color: var(--red);
    font-weight: 600;
}

.drop-hint {
    font-size: .75rem;
    color: var(--gray-3);
}

/* ── File Info Bar ─────────────────────────────────────────────────── */
.file-info-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--black-4);
    margin-bottom: 20px;
}

.file-icon-wrap {
    flex-shrink: 0;
}

.file-ext-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--red-dim);
    color: var(--red);
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.file-meta {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: .72rem;
    color: var(--gray-2);
    margin-top: 2px;
}

.file-change-btn {
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .06);
    font-size: .75rem;
    font-weight: 600;
    color: var(--gray-1);
    transition: var(--transition);
}

.file-change-btn:hover {
    background: rgba(255, 255, 255, .08);
}

/* ── Convert Grid ──────────────────────────────────────────────────── */
.convert-label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--gray-1);
    margin-bottom: 12px;
}

.convert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}

.convert-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 12px 6px;
    border-radius: 10px;
    background: var(--black-4);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.convert-option:hover {
    border-color: rgba(255, 255, 255, .08);
    transform: translateY(-2px);
}

.convert-option.selected {
    border-color: var(--red);
    background: var(--red-dim);
}

.convert-option .co-ext {
    font-size: .85rem;
    font-weight: 800;
    text-transform: uppercase;
}

.convert-option .co-desc {
    font-size: .58rem;
    color: var(--gray-2);
    text-transform: uppercase;
    letter-spacing: .3px;
}

.convert-option.selected .co-ext {
    color: var(--red);
}

/* ── Search Box ────────────────────────────────────────────────────── */
.search-box {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--black-3);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 16px;
    padding: 5px;
    transition: var(--transition);
}

.search-input-wrap:hover {
    border-color: rgba(255, 255, 255, .1);
}

.search-input-wrap:focus-within {
    border-color: var(--red);
    box-shadow: 0 0 0 4px var(--red-dim), 0 0 40px rgba(255, 45, 85, .06);
}

.search-icon {
    flex-shrink: 0;
    margin: 0 12px;
    color: var(--gray-2);
}

#urlInput {
    flex: 1;
    padding: 14px 0;
    font-size: .95rem;
    color: var(--white);
    min-width: 0;
}

#urlInput::placeholder {
    color: var(--gray-3);
}

.search-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--grad-red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.search-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, .2), transparent 60%);
    opacity: 0;
    transition: var(--transition);
}

.search-btn:hover::before {
    opacity: 1;
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px var(--red-glow);
}

.search-btn:active {
    transform: scale(.97);
}

.search-btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Result Card ───────────────────────────────────────────────────── */
.result-section {
    padding: 0 24px 60px;
    position: relative;
    z-index: 1;
}

.result-section.hidden {
    display: none;
}

.result-card {
    max-width: 580px;
    margin: 0 auto;
    background: var(--grad-surface);
    border: 1px solid rgba(255, 255, 255, .05);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: cardIn .5s var(--spring);
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(.97)
    }

    to {
        opacity: 1;
        transform: none
    }
}

/* Video Preview */
.video-preview {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.thumb-wrap {
    width: 200px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: var(--black-4);
}

.thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, .85);
    color: #fff;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .3px;
}

.video-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.video-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-channel {
    font-size: .82rem;
    color: var(--gray-1);
    margin-bottom: 2px;
}

.video-views {
    font-size: .78rem;
    color: var(--gray-2);
}

/* Format Toggle */
.format-toggle-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.format-toggle {
    display: flex;
    position: relative;
    background: var(--black-4);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.format-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    border-radius: 9px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--gray-2);
    transition: var(--transition);
    z-index: 2;
    position: relative;
}

.format-btn:hover {
    color: var(--gray-1);
}

.format-btn.active {
    color: var(--white);
}

.toggle-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--black-6);
    border-radius: 9px;
    transition: var(--spring);
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}

.toggle-slider.right {
    left: calc(50%);
}

/* Quality Grid */
.quality-section {
    margin-bottom: 20px;
}

.quality-section.hidden {
    display: none;
}

.quality-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.quality-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 14px 8px;
    border-radius: 12px;
    background: var(--black-4);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.quality-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--grad-red);
    opacity: 0;
    transition: var(--transition);
}

.quality-card:hover {
    border-color: rgba(255, 255, 255, .08);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}

.quality-card.selected {
    border-color: var(--red);
    background: var(--red-dim);
}

.quality-card.selected::before {
    opacity: .04;
}

.quality-card .q-label {
    font-size: .95rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
}

.quality-card .q-tag {
    font-size: .65rem;
    color: var(--gray-2);
    position: relative;
    z-index: 1;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.quality-card.selected .q-label {
    color: var(--red);
}

.quality-card.selected .q-tag {
    color: var(--red);
    opacity: .7;
}

.q-best-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 2px 5px;
    font-size: .55rem;
    font-weight: 800;
    background: var(--grad-red);
    color: #fff;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
    z-index: 1;
}

/* Download Button */
.dl-btn {
    width: 100%;
    padding: 16px;
    background: var(--grad-red);
    color: #fff;
    font-size: .92rem;
    font-weight: 700;
    border-radius: 14px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.dl-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, .15), transparent 50%);
    opacity: 0;
    transition: var(--transition);
}

.dl-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--red-glow);
}

.dl-btn:not(:disabled):hover::before {
    opacity: 1;
}

.dl-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    background: var(--black-5);
}

.dl-btn-idle,
.dl-btn-busy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dl-btn-busy.hidden {
    display: none;
}

.dl-btn.loading .dl-btn-idle {
    display: none;
}

.dl-btn.loading .dl-btn-busy {
    display: flex;
}

/* Progress */
.progress-wrap {
    margin-top: 16px;
}

.progress-wrap.hidden {
    display: none;
}

.progress-track {
    width: 100%;
    height: 4px;
    background: var(--black-4);
    border-radius: 99px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--grad-red);
    border-radius: 99px;
    transition: width .4s ease;
}

.progress-text {
    font-size: .78rem;
    color: var(--gray-2);
    text-align: center;
    margin-top: 8px;
}

/* ── Features ──────────────────────────────────────────────────────── */
.features {
    padding: 80px 24px;
    position: relative;
    z-index: 1;
}

.features-grid {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.feat-card {
    padding: 24px 18px;
    border-radius: 16px;
    background: var(--grad-surface);
    border: 1px solid rgba(255, 255, 255, .04);
    transition: var(--transition);
}

.feat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, .08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .4);
}

.feat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.feat-icon.red {
    background: var(--red-dim);
    color: var(--red);
}

.feat-icon.blue {
    background: var(--blue-dim);
    color: var(--blue);
}

.feat-icon.green {
    background: var(--green-dim);
    color: var(--green);
}

.feat-icon.purple {
    background: var(--purple-dim);
    color: var(--purple);
}

.feat-card h3 {
    font-size: .9rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.feat-card p {
    font-size: .78rem;
    color: var(--gray-2);
    line-height: 1.6;
}

/* ── Footer ────────────────────────────────────────────────────────── */
.footer {
    padding: 32px 24px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, .03);
    position: relative;
    z-index: 1;
}

.footer p {
    font-size: .78rem;
    color: var(--gray-3);
}

.footer strong {
    color: var(--gray-2);
}

/* ── Toasts ────────────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    min-width: 260px;
    background: var(--black-5);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
    font-size: .82rem;
    backdrop-filter: blur(16px);
    animation: toastIn .4s var(--spring);
}

.toast.error {
    border-color: rgba(255, 69, 58, .25);
}

.toast.success {
    border-color: rgba(52, 211, 153, .25);
}

.toast-exit {
    animation: toastOut .25s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(60px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(60px)
    }
}

/* ── Animations ────────────────────────────────────────────────────── */
.anim-up {
    opacity: 0;
    transform: translateY(25px);
    animation: animUp .65s var(--spring) forwards;
}

.d1 {
    animation-delay: .08s;
}

.d2 {
    animation-delay: .16s;
}

.d3 {
    animation-delay: .24s;
}

@keyframes animUp {
    to {
        opacity: 1;
        transform: none
    }
}

.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .55s ease, transform .55s var(--spring);
}

.scroll-reveal.visible {
    opacity: 1;
    transform: none;
}

.hidden {
    display: none !important;
}

/* Mini spinner */
.mini-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, .2);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.mini-spinner.white {
    border-top-color: #fff;
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

/* Shake */
.shake {
    animation: shake .45s ease;
}

@keyframes shake {

    10%,
    90% {
        transform: translateX(-2px)
    }

    20%,
    80% {
        transform: translateX(3px)
    }

    30%,
    50%,
    70% {
        transform: translateX(-4px)
    }

    40%,
    60% {
        transform: translateX(4px)
    }
}

/* ── Discord FAB ───────────────────────────────────────────────────── */
.discord-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--black-4);
    border: 1px solid rgba(255, 255, 255, .06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-1);
    transition: var(--spring);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .4);
    text-decoration: none;
}

.discord-fab:hover {
    background: #5865F2;
    color: #fff;
    border-color: #5865F2;
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 28px rgba(88, 101, 242, .35);
}

.discord-fab:active {
    transform: scale(1) translateY(0);
}

.discord-fab svg {
    transition: var(--transition);
}

.discord-fab:hover svg {
    transform: scale(1.05);
}

@media(max-width:768px) {
    .hero-title {
        letter-spacing: -1px;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .video-preview {
        flex-direction: column;
    }

    .thumb-wrap {
        width: 100%;
        max-height: 180px;
    }

    .quality-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width:480px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .quality-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .format-btn {
        padding: 10px 16px;
        font-size: .78rem;
    }

    .search-input-wrap {
        border-radius: 14px;
    }
}