/* =========================================================
   Video Title Optimizer — "CTR Lab" theme
   Scoped, page-specific stylesheet. Prefix: .vto-
   ========================================================= */

:root {
    --vto-black: #030304;
    --vto-panel: #0a0a0c;
    --vto-panel-alt: #0d1013;
    --vto-panel-solid: #0c0d0f;
    --vto-border: rgba(255, 255, 255, 0.09);
    --vto-border-strong: rgba(255, 255, 255, 0.16);
    --vto-red: #dc2626;
    --vto-red-soft: rgba(220, 38, 38, 0.14);
    --vto-cyan: #22d3ee;
    --vto-cyan-soft: rgba(34, 211, 238, 0.12);
    --vto-teal: #2dd4bf;
    --vto-amber: #fbbf24;
    --vto-warn: #f87171;
    --vto-text: #f4f4f5;
    --vto-text-dim: #a1a1aa;
    --vto-text-faint: #6b7280;
    --vto-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --vto-grid-line: rgba(255, 255, 255, 0.055);
    --vto-r-lg: 28px;
    --vto-r-md: 20px;
    --vto-r-sm: 12px;
}

/* ---------- page canvas ---------- */

.vto-main {
    position: relative;
    background-color: var(--vto-black);
    background-image:
        linear-gradient(var(--vto-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--vto-grid-line) 1px, transparent 1px);
    background-size: 42px 42px;
    overflow: hidden;
}

.vto-main::before,
.vto-main::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
}

.vto-main::before {
    width: 32rem;
    height: 32rem;
    top: -10rem;
    left: -8rem;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.22), transparent 70%);
}

.vto-main::after {
    width: 30rem;
    height: 30rem;
    bottom: -8rem;
    right: -6rem;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.14), transparent 70%);
}

.vto-main > * {
    position: relative;
    z-index: 1;
}

/* ---------- hero ---------- */

.vto-hero {
    padding: 4rem 1.5rem 5rem;
}

.vto-hero-inner {
    max-width: 72rem;
    margin: 0 auto;
    display: grid;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .vto-hero-inner {
        grid-template-columns: 1.15fr 0.85fr;
    }
}

.vto-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid rgba(34, 211, 238, 0.3);
    background: var(--vto-cyan-soft);
    color: #67e8f9;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-family: var(--vto-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.vto-kicker-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--vto-cyan);
    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.6);
    animation: vto-pulse 1.8s ease-out infinite;
}

@keyframes vto-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(34, 211, 238, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}

.vto-hero-title {
    font-size: 2.75rem;
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 1.25rem 0 1rem;
}

@media (min-width: 768px) {
    .vto-hero-title {
        font-size: 3.6rem;
    }
}

.vto-accent-text {
    background: linear-gradient(90deg, var(--vto-red), var(--vto-amber) 55%, var(--vto-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.vto-hero-sub {
    max-width: 38rem;
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--vto-text-dim);
    margin-bottom: 2rem;
}

.vto-hero-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
}

.vto-meta-card {
    border: 1px solid var(--vto-border);
    background: var(--vto-panel);
    border-radius: var(--vto-r-md);
    padding: 1rem 1.1rem;
}

.vto-meta-label {
    display: block;
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--vto-text-faint);
    margin-bottom: 0.5rem;
}

.vto-meta-value {
    display: block;
    font-family: var(--vto-mono);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--vto-text);
}

/* ---------- console (interactive demo) ---------- */

.vto-console {
    position: relative;
    border: 1px solid var(--vto-border-strong);
    background: linear-gradient(180deg, rgba(13, 16, 19, 0.96), rgba(6, 7, 8, 0.98));
    border-radius: var(--vto-r-lg);
    padding: 1.75rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.vto-console::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.35), transparent 30%, transparent 70%, rgba(34, 211, 238, 0.3));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.vto-console-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.vto-console-label {
    display: block;
    font-family: var(--vto-mono);
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--vto-text-faint);
    margin-bottom: 0.25rem;
}

.vto-console-title {
    font-size: 1.4rem;
    font-weight: 700;
}

.vto-console-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--vto-mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6ee7b7;
    border: 1px solid rgba(110, 231, 183, 0.3);
    background: rgba(110, 231, 183, 0.08);
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    white-space: nowrap;
}

.vto-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #6ee7b7;
}

.vto-field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--vto-text-dim);
    margin-bottom: 0.5rem;
}

.vto-input {
    width: 100%;
    border: 1px solid var(--vto-border-strong);
    background: #000;
    color: var(--vto-text);
    border-radius: var(--vto-r-sm);
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    margin-bottom: 1.1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.vto-input::placeholder {
    color: #52525b;
}

.vto-input:focus {
    outline: none;
    border-color: var(--vto-cyan);
    box-shadow: 0 0 0 3px var(--vto-cyan-soft);
}

.vto-output {
    border: 1px solid var(--vto-border);
    background: rgba(0, 0, 0, 0.6);
    background-image:
        linear-gradient(var(--vto-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--vto-grid-line) 1px, transparent 1px);
    background-size: 24px 24px;
    border-radius: var(--vto-r-md);
    padding: 1.1rem;
    min-height: 300px;
    max-height: 480px;
    overflow-y: auto;
}

.vto-output-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.6rem;
    min-height: 260px;
    color: var(--vto-text-faint);
    font-size: 0.9rem;
}

.vto-output-empty i {
    font-size: 1.4rem;
    color: var(--vto-cyan);
    opacity: 0.7;
}

.vto-console-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

@media (min-width: 480px) {
    .vto-console-actions {
        flex-direction: row;
    }
}

.vto-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 999px;
    padding: 0.95rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.vto-btn:active {
    transform: translateY(1px);
}

.vto-btn-primary {
    background: var(--vto-red);
    color: #fff;
}

.vto-btn-primary:hover {
    background: #b91c1c;
}

.vto-btn-ghost {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--vto-border-strong);
    color: var(--vto-text-dim);
}

.vto-btn-ghost:hover {
    border-color: var(--vto-cyan);
    color: var(--vto-text);
}

/* ---------- variant results ---------- */

.vto-variant-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.vto-variant {
    position: relative;
    border: 1px solid var(--vto-border);
    background: var(--vto-panel-alt);
    border-radius: var(--vto-r-md);
    padding: 1rem 1.1rem 1rem 1.35rem;
    border-left: 3px solid var(--vto-gauge-color, var(--vto-text-faint));
}

.vto-variant-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.vto-variant-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.vto-variant-index {
    font-family: var(--vto-mono);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--vto-text-faint);
    border: 1px solid var(--vto-border-strong);
    border-radius: 6px;
    padding: 0.1rem 0.4rem;
    flex-shrink: 0;
}

.vto-variant-label {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--vto-text-faint);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vto-best-badge {
    flex-shrink: 0;
    font-family: var(--vto-mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fca5a5;
    border: 1px solid rgba(220, 38, 38, 0.35);
    background: var(--vto-red-soft);
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
}

.vto-variant-body {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.vto-variant-content {
    flex: 1;
    min-width: 0;
}

.vto-variant-text {
    color: var(--vto-text);
    font-weight: 600;
    font-size: 0.98rem;
    line-height: 1.45;
    margin-bottom: 0.6rem;
}

.vto-factor-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.vto-factor {
    font-family: var(--vto-mono);
    font-size: 0.68rem;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--vto-border);
}

.vto-factor.is-positive {
    color: #5eead4;
    border-color: rgba(45, 212, 191, 0.3);
    background: rgba(45, 212, 191, 0.08);
}

.vto-factor.is-negative {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(248, 113, 113, 0.08);
}

/* ---------- score gauge ---------- */

.vto-gauge {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 999px;
    background: conic-gradient(var(--vto-gauge-color, var(--vto-cyan)) calc(var(--score, 0) * 3.6deg), rgba(255, 255, 255, 0.08) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vto-gauge::before {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 999px;
    background: var(--vto-panel-solid);
}

.vto-gauge-value {
    position: relative;
    z-index: 1;
    font-family: var(--vto-mono);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--vto-text);
}

.vto-gauge-unit {
    font-size: 0.6em;
    color: var(--vto-text-faint);
}

.vto-band-low { --vto-gauge-color: var(--vto-warn); }
.vto-band-mid { --vto-gauge-color: var(--vto-amber); }
.vto-band-high { --vto-gauge-color: var(--vto-teal); }

/* ---------- toast ---------- */

.vto-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--vto-mono);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--vto-text);
    background: var(--vto-panel-solid);
    border: 1px solid rgba(34, 211, 238, 0.35);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
    padding: 0.75rem 1.1rem;
    border-radius: 999px;
    animation: vto-toast-in 0.2s ease-out both;
}

@keyframes vto-toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- supporting sections ---------- */

.vto-section {
    padding: 0 1.5rem 5rem;
}

.vto-section-inner {
    max-width: 72rem;
    margin: 0 auto;
    display: grid;
    gap: 1.75rem;
}

@media (min-width: 1024px) {
    .vto-section-inner.vto-cols-2 {
        grid-template-columns: 0.9fr 1.1fr;
    }
}

.vto-panel {
    border: 1px solid var(--vto-border);
    background: var(--vto-panel);
    border-radius: var(--vto-r-lg);
    padding: 2rem;
}

.vto-panel-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.vto-check-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.vto-check-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    color: var(--vto-text-dim);
    line-height: 1.6;
}

.vto-check-item i {
    color: var(--vto-teal);
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.vto-note {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--vto-border-strong);
    color: var(--vto-text-faint);
    font-size: 0.92rem;
    line-height: 1.6;
}

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

@media (min-width: 640px) {
    .vto-formula-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.vto-formula-chip {
    border: 1px solid var(--vto-border);
    background: var(--vto-panel-solid);
    border-radius: var(--vto-r-sm);
    padding: 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.vto-formula-chip i {
    color: var(--vto-cyan);
    font-size: 0.85rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.vto-formula-chip span {
    font-size: 0.82rem;
    color: var(--vto-text-dim);
    line-height: 1.4;
}

/* ---------- protocol / how it works ---------- */

.vto-protocol {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 1024px) {
    .vto-protocol {
        grid-template-columns: repeat(3, 1fr);
    }
}

.vto-step {
    position: relative;
    border: 1px solid var(--vto-border);
    background: var(--vto-panel);
    border-radius: var(--vto-r-lg);
    padding: 1.75rem;
}

.vto-step-number {
    font-family: var(--vto-mono);
    font-size: 2.25rem;
    font-weight: 800;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.18);
    line-height: 1;
    margin-bottom: 0.75rem;
}

.vto-step h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.vto-step p {
    color: var(--vto-text-dim);
    font-size: 0.92rem;
    line-height: 1.6;
}
