:root {
    --bg: #07070b;
    --surface: rgba(18, 18, 26, 0.78);
    --surface-2: rgba(255, 255, 255, 0.035);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.15);
    --text: #f4f4f5;
    --text-muted: #a1a1aa;
    --text-dim: #71717a;
    --accent: #a855f7;
    --accent-2: #3b82f6;
    --accent-soft: rgba(168, 85, 247, 0.12);
    --success: #34d399;
    --error: #f87171;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --max: 980px;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
    --shadow: 0 24px 56px -20px rgba(0, 0, 0, 0.65);
}

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

html,
body {
    height: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Background */
.bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.48;
}

.glow-l {
    width: 480px;
    height: 480px;
    top: -8%;
    left: 8%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.5), transparent 70%);
}

.glow-r {
    width: 460px;
    height: 460px;
    top: -6%;
    right: 6%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.42), transparent 70%);
}

.glow-c {
    width: 640px;
    height: 360px;
    bottom: -12%;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.2), transparent 70%);
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 75% 60% at 50% 35%, #000 15%, transparent 75%);
}

/* Shell fills viewport, content spreads */
.shell {
    position: relative;
    z-index: 1;
    width: min(var(--max), calc(100% - 3.5rem));
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 1.5rem;
    padding: 1.75rem 0 1.25rem;
    animation: pageIn 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-mark {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    filter: drop-shadow(0 8px 18px rgba(168, 85, 247, 0.35));
}

.brand-mark svg {
    width: 100%;
    height: 100%;
    display: block;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.03em;
}

.brand-name .dot {
    color: var(--accent);
}

.brand-tag {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    backdrop-filter: blur(10px);
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(52, 211, 153, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
    }
}

/* Main: two-column on desktop, fills height */
.main {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 1.5rem;
    min-height: 0;
    align-items: stretch;
}

/* Left hero panel */
.hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.75rem;
    padding: 0.5rem 0.75rem 0.5rem 0.25rem;
    min-height: 0;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
}

.hero h1 {
    font-size: clamp(2.4rem, 4.2vw, 3.15rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.08;
    background: linear-gradient(135deg, #fff 0%, #d8b4fe 48%, #93c5fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.55;
    max-width: 22rem;
}

.format-pills {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.5rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.pill {
    font-family: var(--mono);
    font-size: 0.82rem;
    font-weight: 500;
    color: #e9d5ff;
    background: rgba(168, 85, 247, 0.14);
    border: 1px solid rgba(168, 85, 247, 0.22);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
}

.pill-sep {
    color: var(--text-dim);
    font-family: var(--mono);
    font-weight: 600;
    font-size: 0.95rem;
}

.hero-points {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hero-points li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(16px);
}

.point-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--accent-soft);
    border: 1px solid rgba(168, 85, 247, 0.2);
    color: #d8b4fe;
}

.hero-points strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
}

.hero-points span {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Right card — grows with viewport */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.5rem 1.35rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.55), rgba(59, 130, 246, 0.5), transparent);
}

.card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
}

.card-title-block h2 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.card-title-block p {
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.4;
}

.card-title-block code {
    font-family: var(--mono);
    font-size: 0.82em;
    color: #d8b4fe;
    background: rgba(168, 85, 247, 0.12);
    padding: 0.1em 0.4em;
    border-radius: 4px;
}

.count-badge {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-dim);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.form-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.drop-zone {
    position: relative;
    flex: 1;
    min-height: 220px;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.35);
    border: 1.5px dashed var(--border-strong);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.08);
}

textarea {
    width: 100%;
    flex: 1;
    min-height: 220px;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 1.15rem 1.25rem;
    font-family: var(--mono);
    font-size: 0.9rem;
    line-height: 1.65;
    resize: none;
}

textarea::placeholder {
    color: var(--text-dim);
}

textarea:focus {
    outline: none;
}

textarea:disabled {
    opacity: 0.7;
}

.drop-overlay {
    position: absolute;
    inset: 0;
    background: rgba(7, 7, 11, 0.88);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    color: var(--accent);
}

.drop-zone.dragover .drop-overlay {
    opacity: 1;
}

.drop-overlay span {
    font-weight: 600;
    font-size: 0.9rem;
}

.card-actions {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    align-items: center;
    flex-shrink: 0;
}

.btn-ghost {
    height: 48px;
    padding: 0 1.1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: var(--surface-2);
}

.btn-primary {
    height: 48px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 50%, #3b82f6 100%);
    background-size: 160% 160%;
    box-shadow: 0 8px 24px -6px rgba(139, 92, 246, 0.5);
    transition: transform 0.2s, box-shadow 0.2s, background-position 0.35s;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    background-position: 100% 50%;
    box-shadow: 0 12px 30px -6px rgba(139, 92, 246, 0.65);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

/* Result */
.result-area {
    padding: 1rem;
    border-radius: var(--radius-md);
    background: rgba(52, 211, 153, 0.06);
    border: 1px solid rgba(52, 211, 153, 0.25);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    flex-shrink: 0;
    animation: fadeUp 0.3s ease-out;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-head {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--success);
    font-weight: 600;
    font-size: 0.88rem;
}

.link-box {
    display: grid;
    grid-template-columns: 1fr 44px 44px;
    gap: 0.5rem;
}

.link-box input {
    width: 100%;
    min-width: 0;
    height: 44px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 0.85rem;
    color: #93c5fd;
    font-family: var(--mono);
    font-size: 0.8rem;
}

.link-box input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
}

.btn-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.btn-icon:hover {
    color: var(--text);
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* Footer */
.site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.55rem;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.site-footer .sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-dim);
    opacity: 0.55;
}

.hidden {
    display: none !important;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    pointer-events: none;
    width: min(420px, calc(100% - 2rem));
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.8rem 1.05rem;
    border-radius: var(--radius-md);
    background: rgba(16, 16, 22, 0.96);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 36px -12px rgba(0, 0, 0, 0.6);
    font-size: 0.88rem;
    font-weight: 500;
    animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success {
    border-color: rgba(52, 211, 153, 0.4);
    color: var(--success);
}

.toast.error {
    border-color: rgba(248, 113, 113, 0.4);
    color: var(--error);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(-6px);
    }
}

.spinner {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Medium screens */
@media (max-width: 900px) {
    :root {
        --max: 720px;
    }

    .main {
        grid-template-columns: 1fr;
        gap: 1.15rem;
    }

    .hero {
        padding: 0;
        gap: 1.1rem;
        justify-content: flex-start;
    }

    .hero-copy {
        align-items: center;
        text-align: center;
    }

    .hero-sub {
        max-width: 28rem;
    }

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

    .hero-points li {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0.75rem 0.5rem;
        gap: 0.5rem;
    }

    .drop-zone,
    textarea {
        min-height: 180px;
    }
}

/* Mobile */
@media (max-width: 600px) {
    body {
        overflow-y: auto;
    }

    .shell {
        width: min(var(--max), calc(100% - 1.5rem));
        min-height: 100dvh;
        gap: 1.1rem;
        padding: 1.15rem 0 1.25rem;
        grid-template-rows: auto auto auto;
    }

    .main {
        display: flex;
        flex-direction: column;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-points {
        grid-template-columns: 1fr;
    }

    .hero-points li {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
        padding: 0.8rem 0.9rem;
    }

    .card {
        padding: 1.15rem;
    }

    .card-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.55rem;
    }

    .card-actions {
        grid-template-columns: 1fr;
    }

    .btn-ghost {
        order: 2;
    }

    .btn-primary {
        order: 1;
    }

    .drop-zone,
    textarea {
        min-height: 160px;
    }
}

/* Short height but wide (laptop) — keep 2-col, tighten a bit */
@media (min-width: 901px) and (max-height: 760px) {
    .shell {
        gap: 1rem;
        padding: 1rem 0 0.85rem;
    }

    .hero {
        gap: 1rem;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-points li {
        padding: 0.65rem 0.85rem;
    }

    .drop-zone,
    textarea {
        min-height: 150px;
    }
}
