@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,wght@0,300;0,400;0,600;1,300&family=DM+Mono:wght@400;500&display=swap');

/* ── Variables ── */
.tpkd-root {
    --black:   #0a0a0a;
    --white:   #f5f3ee;
    --accent:  #ff2d55;
    --accent2: #00c9a7;
    --card-bg: #ffffff;
    --muted:   #888;
    --border:  #e0ddd6;
    --radius:  16px;
    --font-display: 'Bebas Neue', sans-serif;
    --font-body:    'DM Sans', sans-serif;
    --font-mono:    'DM Mono', monospace;

    font-family: var(--font-body);
    background: var(--white);
    color: var(--black);
    max-width: 780px;
    margin: 0 auto;
    padding: 48px 24px 80px;
    box-sizing: border-box;
}

*, *::before, *::after { box-sizing: inherit; }

/* ── Hero ── */
.tpkd-hero {
    text-align: center;
    margin-bottom: 44px;
}

.tpkd-hero-eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--muted);
    background: #f0ede6;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 14px;
    margin-bottom: 20px;
    animation: tpkd-fade-up 0.5s ease both;
}

.tpkd-hero-title {
    font-family: var(--font-display);
    font-size: clamp(72px, 15vw, 130px);
    line-height: 0.9;
    letter-spacing: 0.01em;
    color: var(--black);
    margin: 0 0 20px;
    animation: tpkd-fade-up 0.5s 0.08s ease both;
}

.tpkd-hero-title em {
    font-style: normal;
    color: var(--accent);
    -webkit-text-stroke: 0px;
    display: block;
}

.tpkd-hero-sub {
    font-size: 15px;
    font-weight: 300;
    color: #555;
    max-width: 420px;
    margin: 0 auto;
    line-height: 1.65;
    animation: tpkd-fade-up 0.5s 0.16s ease both;
}

/* ── Card ── */
.tpkd-card {
    background: var(--card-bg);
    border: 2px solid var(--black);
    border-radius: var(--radius);
    padding: 10px 10px 10px 10px;
    display: flex;
    align-items: stretch;
    gap: 10px;
    box-shadow: 6px 6px 0 var(--black);
    animation: tpkd-fade-up 0.5s 0.22s ease both;
    margin-bottom: 16px;
}

/* ── Input ── */
.tpkd-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f7f5f0;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0 14px;
    gap: 10px;
    transition: border-color 0.2s;
}

.tpkd-input-wrap:focus-within {
    border-color: var(--black);
    background: #fff;
}

.tpkd-link-icon {
    color: var(--muted);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

#tpkd-url-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--black);
    padding: 16px 0;
    outline: none;
    min-width: 0;
}

#tpkd-url-input::placeholder { color: #bbb; }

.tpkd-clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 14px;
    padding: 0;
    flex-shrink: 0;
    line-height: 1;
    transition: color 0.15s;
}

.tpkd-clear-btn:hover { color: var(--accent); }

/* ── Submit button ── */
.tpkd-submit-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    padding: 0 28px;
    background: var(--black);
    color: #fff;
    border: 2px solid var(--black);
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s, transform 0.1s;
    min-height: 52px;
    position: relative;
}

.tpkd-submit-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.tpkd-submit-btn:active { transform: scale(0.97); }

.tpkd-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tpkd-btn-arrow {
    font-size: 18px;
    transition: transform 0.2s;
}

.tpkd-submit-btn:hover .tpkd-btn-arrow { transform: translateX(3px); }

/* Loader */
.tpkd-loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tpkd-spin 0.7s linear infinite;
}

.tpkd-submit-btn.loading .tpkd-btn-label,
.tpkd-submit-btn.loading .tpkd-btn-arrow { display: none; }
.tpkd-submit-btn.loading .tpkd-loader { display: block; }

/* ── Error ── */
.tpkd-error {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff2f4;
    border: 1.5px solid var(--accent);
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 13.5px;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 16px;
    animation: tpkd-fade-up 0.3s ease both;
}

/* ── Result card ── */
.tpkd-result {
    background: var(--card-bg);
    border: 2px solid var(--black);
    border-radius: var(--radius);
    box-shadow: 6px 6px 0 var(--black);
    overflow: hidden;
    margin-bottom: 48px;
    animation: tpkd-fade-up 0.45s ease both;
}

.tpkd-result-inner {
    display: flex;
    gap: 0;
}

/* Thumbnail */
.tpkd-thumb-wrap {
    position: relative;
    flex-shrink: 0;
    width: 180px;
    min-height: 240px;
    background: #111;
    overflow: hidden;
}

#tpkd-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tpkd-play-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    background: rgba(0,0,0,0.3);
    pointer-events: none;
}

/* Info section */
.tpkd-result-info {
    flex: 1;
    padding: 24px 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tpkd-result-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--black);
    margin: 0;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tpkd-result-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    margin: 0 0 8px;
}

/* Download buttons */
.tpkd-download-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tpkd-dl-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    text-decoration: none;
    color: var(--black);
    font-size: 13px;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    background: #fafaf8;
}

.tpkd-dl-btn:hover {
    background: var(--black);
    color: #fff;
    border-color: var(--black);
    transform: translateX(3px);
}

.tpkd-dl-btn strong { display: block; font-weight: 600; font-size: 13px; }
.tpkd-dl-btn small  { display: block; font-size: 11px; opacity: 0.6; }

.tpkd-dl-hd:hover  { background: var(--accent);  border-color: var(--accent); }
.tpkd-dl-sd:hover  { background: #333;            border-color: #333; }
.tpkd-dl-mp3:hover { background: var(--accent2);  border-color: var(--accent2); }

.tpkd-dl-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f0ede6;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.15s;
}

.tpkd-dl-btn:hover .tpkd-dl-icon { background: rgba(255,255,255,0.2); }

.tpkd-another-btn {
    margin-top: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    padding: 0;
    text-align: left;
    transition: color 0.15s;
}

.tpkd-another-btn:hover { color: var(--accent); }

/* ── Steps ── */
.tpkd-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    animation: tpkd-fade-up 0.5s 0.3s ease both;
}

.tpkd-step {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tpkd-step-num {
    font-family: var(--font-display);
    font-size: 42px;
    color: #e8e4dc;
    line-height: 1;
    flex-shrink: 0;
}

.tpkd-step-text strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--black);
}

.tpkd-step-text span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.tpkd-step-divider {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #ccc;
    letter-spacing: 0.2em;
}

/* ── Animations ── */
@keyframes tpkd-fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

/* ── Responsive ── */
@media (max-width: 580px) {
    .tpkd-card { flex-direction: column; }
    .tpkd-submit-btn { min-height: 48px; width: 100%; }
    .tpkd-result-inner { flex-direction: column; }
    .tpkd-thumb-wrap { width: 100%; min-height: 200px; }
    .tpkd-steps { flex-direction: column; align-items: flex-start; gap: 20px; }
    .tpkd-step-divider { display: none; }
}
