/* =====================================================
   YTCaptions — Utility site stylesheet
   ===================================================== */

/* ── Variables ── */
:root {
    --primary:        #1a56db;
    --primary-hover:  #1e429f;
    --primary-light:  #ebf5ff;
    --text:           #111827;
    --text-secondary: #6b7280;
    --bg:             #f9fafb;
    --card:           #ffffff;
    --border:         #e5e7eb;
    --shadow-sm:      0 1px 2px rgba(0,0,0,.05);
    --shadow:         0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
    --shadow-lg:      0 10px 25px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
    --radius:         14px;
    --radius-sm:      8px;
    --error:          #dc2626;
    --error-bg:       #fef2f2;
    --success:        #059669;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Container ── */
.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Utilities ── */
.hidden { display: none !important; }


/* =====================================================
   HEADER
   ===================================================== */
.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo-mark { color: var(--primary); font-size: 1rem; }
.logo strong { font-weight: 700; }

.site-nav { display: flex; gap: 28px; }
.site-nav a {
    font-size: .9rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color .15s;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }


/* =====================================================
   AD SLOTS
   ===================================================== */
.ad-slot {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}
.ad-top, .ad-bottom {
    padding: 12px 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.ad-mid { padding: 32px 0; }

.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 728px;
    height: 90px;
    background: #f3f4f6;
    border: 1px dashed #d1d5db;
    border-radius: var(--radius-sm);
    color: #9ca3af;
    font-size: .7rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.ad-placeholder--rect {
    max-width: 300px;
    height: 250px;
}


/* =====================================================
   HERO SECTION
   ===================================================== */
.hero { padding: 60px 0 48px; }

.hero-copy {
    text-align: center;
    max-width: 620px;
    margin: 0 auto 36px;
}
.hero-copy h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
    margin-bottom: 14px;
}
.hero-sub-h2 {
    font-size: clamp(.95rem, 2vw, 1.15rem);
    font-weight: 600;
    color: var(--primary);
    letter-spacing: -.01em;
    margin-bottom: 10px;
}

.hero-copy p {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto;
}


/* ── USP callout ── */
.usp-callout {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 760px;
    margin: 0 auto 16px;
    padding: 11px 18px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    color: #166534;
    line-height: 1.5;
}
.usp-callout svg { color: #16a34a; flex-shrink: 0; }
.usp-callout strong { font-weight: 700; }
.usp-callout em { font-style: normal; font-weight: 600; }


/* ── Tool Card ── */
.tool-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 28px 24px;
    box-shadow: var(--shadow-lg);
    max-width: 760px;
    margin: 0 auto;
}

/* URL row */
.url-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    left: 14px;
    color: #9ca3af;
    pointer-events: none;
}

#url-input {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 42px;
    font-size: .95rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
#url-input::placeholder { color: #9ca3af; }
#url-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
    background: #fff;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 24px;
    background: var(--primary);
    color: #fff;
    font-size: .95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, transform .1s, box-shadow .15s;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 16px;
    background: var(--card);
    color: var(--text);
    font-size: .875rem;
    font-weight: 500;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.btn-outline:hover { border-color: #9ca3af; background: var(--bg); }
.btn-outline.copied { color: var(--success); border-color: var(--success); }

.btn-sm { height: 36px; padding: 0 16px; font-size: .875rem; }

/* Spinner inside button */
.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .65s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Options row */
.options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.opt-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.opt-group > label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.opt-group select {
    height: 36px;
    padding: 0 10px;
    font-size: .875rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    outline: none;
    cursor: pointer;
    transition: border-color .15s;
}
.opt-group select:focus { border-color: var(--primary); }

.opt-check { flex-direction: row; align-items: center; padding-bottom: 2px; }

.check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: .875rem;
    color: var(--text-secondary);
    user-select: none;
}
.check-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Error message */
.error-msg {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 14px;
    background: var(--error-bg);
    border: 1px solid #fca5a5;
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: .875rem;
}


/* =====================================================
   RESULTS SECTION
   ===================================================== */
.results-section {
    max-width: 760px;
    margin: 24px auto 0;
    animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Metadata card */
.meta-block {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.meta-thumb-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.meta-thumb {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #f3f4f6;
}
.meta-info { flex: 1; min-width: 0; }
.meta-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.meta-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: .8rem;
    color: var(--text-secondary);
}

/* Transcript card */
.results-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.results-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.results-actions { display: flex; gap: 8px; }

#transcript-output {
    width: 100%;
    min-height: 280px;
    max-height: 480px;
    padding: 20px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: .8rem;
    line-height: 1.75;
    color: var(--text);
    background: var(--card);
    border: none;
    resize: vertical;
    outline: none;
}


/* =====================================================
   HOW IT WORKS
   ===================================================== */
.section-how {
    padding: 72px 0;
    background: var(--card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-head {
    text-align: center;
    margin-bottom: 48px;
}
.section-head h2 {
    font-size: clamp(1.4rem, 3vw, 1.875rem);
    font-weight: 700;
    margin-bottom: 8px;
}
.section-head p { color: var(--text-secondary); }

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}
.step-card { text-align: center; padding: 24px 16px; }
.step-num {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.step-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.step-card p { font-size: .875rem; color: var(--text-secondary); line-height: 1.65; }


/* =====================================================
   FEATURES
   ===================================================== */
.section-features { padding: 72px 0; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.feat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s;
}
.feat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.feat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.feat-icon--blue   { background: #dbeafe; color: #1d4ed8; }
.feat-icon--green  { background: #d1fae5; color: #065f46; }
.feat-icon--purple { background: #ede9fe; color: #5b21b6; }
.feat-icon--red    { background: #fee2e2; color: #991b1b; }

.feat-card h3 { font-size: .95rem; font-weight: 700; margin-bottom: 6px; }
.feat-card p { font-size: .85rem; color: var(--text-secondary); line-height: 1.6; }


/* =====================================================
   FAQ
   ===================================================== */
.section-faq {
    padding: 72px 0;
    background: var(--card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.faq-list {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    overflow: hidden;
}
.faq-item summary {
    padding: 16px 20px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background .15s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-secondary);
    transition: transform .2s;
    flex-shrink: 0;
    margin-left: 12px;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item[open] summary { background: var(--card); }
.faq-item p {
    padding: 0 20px 16px;
    font-size: .875rem;
    color: var(--text-secondary);
    line-height: 1.7;
}


/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
    padding: 40px 0;
    background: #1f2937;
    color: #9ca3af;
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
    margin-bottom: 28px;
}
.footer-brand .logo { color: #f9fafb; margin-bottom: 8px; }
.footer-brand .logo-mark { color: #60a5fa; }
.footer-brand p { font-size: .8rem; color: #9ca3af; }

.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a {
    font-size: .85rem;
    color: #9ca3af;
    transition: color .15s;
}
.footer-links a:hover { color: #f9fafb; text-decoration: none; }

.footer-legal {
    font-size: .75rem;
    color: #6b7280;
    border-top: 1px solid #374151;
    padding-top: 20px;
}


/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .site-nav { display: none; }
    .hero { padding: 40px 0 32px; }
    .hero-copy h1 { font-size: 1.75rem; }
    .url-row { flex-direction: column; }
    #transcribe-btn { width: 100%; }
    .tool-card { padding: 20px; }
    .steps-grid { grid-template-columns: 1fr; gap: 20px; }
    .features-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
    .footer-inner { flex-direction: column; gap: 20px; }
    .meta-thumb-row { flex-direction: column; }
    .meta-thumb { width: 100%; height: auto; aspect-ratio: 16/9; }
}

@media (max-width: 480px) {
    .features-grid { grid-template-columns: 1fr; }
    .ad-placeholder { height: 60px; font-size: .65rem; }
}
