:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-muted: #f1f5f9;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-muted: #475569;
    --text-light: #64748b;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eff6ff;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --success-border: #bbf7d0;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --radius: 12px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 10px -6px rgba(15, 23, 42, 0.05);
}

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

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header & Navigation */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 20px;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.brand:hover {
    text-decoration: none;
}

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 14px;
    font-weight: 500;
}

.nav-links a {
    color: var(--text-muted);
    transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    text-decoration: none;
}

.nav-pill {
    background: var(--primary-soft);
    color: var(--primary) !important;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 600 !important;
}

.nav-pill:hover {
    background: #dbeafe;
}

.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-light);
    background: var(--surface-muted);
    padding: 4px 10px;
    border-radius: 999px;
}

.lang-switcher a {
    color: var(--text-muted);
    font-weight: 500;
}

.lang-switcher strong {
    color: var(--primary);
}

/* Mobile Collapsible Menu Toggle */
.nav-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 9px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
}

.nav-toggle:hover {
    background: var(--surface-muted);
}

.nav-toggle-bars {
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    width: 16px;
    height: 12px;
}

.nav-toggle-bars span {
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

body.is-mobile-nav .header-inner {
    padding: 10px 16px;
}

body.is-mobile-nav .nav-toggle {
    display: inline-flex;
}

body.is-mobile-nav .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

body.is-mobile-nav .nav-links.is-open {
    display: flex;
}

body.is-mobile-nav .nav-links > a {
    padding: 10px 12px;
    border-radius: 8px;
}

body.is-mobile-nav .nav-links > a:not(.nav-pill):hover {
    background: var(--surface-muted);
}

body.is-mobile-nav .nav-links .nav-pill {
    text-align: center;
    padding: 10px 14px;
}

body.is-mobile-nav .nav-links .lang-switcher {
    justify-content: center;
    margin-top: 4px;
    padding: 8px 12px;
}

@media (max-width: 768px) {
    .header-inner {
        padding: 10px 16px;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding-top: 10px;
        border-top: 1px solid var(--border);
    }

    .nav-links.is-open {
        display: flex;
    }

    .nav-links > a {
        padding: 10px 12px;
        border-radius: 8px;
    }

    .nav-links > a:not(.nav-pill):hover {
        background: var(--surface-muted);
    }

    .nav-links .nav-pill {
        text-align: center;
        padding: 10px 14px;
    }

    .nav-links .lang-switcher {
        justify-content: center;
        margin-top: 4px;
        padding: 8px 12px;
    }
}

/* Main Container */
.page-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 36px 20px 64px;
}

.hero {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 28px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 999px;
    margin-bottom: 14px;
}

.hero h1 {
    font-size: clamp(26px, 4.5vw, 38px);
    line-height: 1.2;
    letter-spacing: -0.025em;
    margin: 0 0 12px;
    color: var(--text);
}

.hero p {
    font-size: 16px;
    color: var(--text-muted);
    margin: 0;
}

/* Converter Card */
.converter-card {
    max-width: 680px;
    margin: 0 auto 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow);
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg);
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    position: relative;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.dropzone-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropzone-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 6px;
}

.dropzone-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 14px;
}

.browse-btn {
    display: inline-block;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Selected File List */
.file-list {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-list:empty {
    display: none;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.file-ext-badge {
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 5px;
    flex-shrink: 0;
}

.file-name {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    color: var(--text-light);
    font-size: 12px;
    flex-shrink: 0;
}

.file-remove {
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 6px;
}

.file-remove:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

/* Submit Button */
.btn-primary {
    width: 100%;
    margin-top: 18px;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.15s, transform 0.1s;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

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

.spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    display: none;
}

.btn-primary.loading .spinner {
    display: inline-block;
}

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

/* Status Alerts */
.status-box {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    display: none;
}

.status-box.visible {
    display: block;
}

.status-box.success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: #166534;
}

.status-box.error {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: #991b1b;
}

.status-box.info {
    background: var(--primary-soft);
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* Trust Strip */
.trust-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 24px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

.trust-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Pro / API Banner */
.pro-callout {
    max-width: 680px;
    margin: 0 auto 44px;
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
    color: #fff;
    border-radius: 14px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.pro-callout h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.pro-callout p {
    margin: 0;
    font-size: 14px;
    color: #cbd5e1;
}

.pro-callout .btn-light {
    background: #ffffff;
    color: #0f172a;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.pro-callout .btn-light:hover {
    background: #f1f5f9;
    text-decoration: none;
}

/* Format Tools Grid */
.section-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
    color: var(--text);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 44px;
}

.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    display: block;
}

.tool-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
    text-decoration: none;
}

.tool-card strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--text);
}

.tool-card span {
    font-size: 13px;
    color: var(--text-muted);
}

/* Content Sections */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 44px;
}

.info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}

.info-card h2, .info-card h3 {
    margin-top: 0;
    font-size: 18px;
    color: var(--text);
}

.info-card p, .info-card li {
    color: var(--text-muted);
    font-size: 14.5px;
}

.info-card ul, .info-card ol {
    padding-left: 20px;
    margin-bottom: 0;
}

.faq-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    margin-bottom: 40px;
}

.faq-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.faq-item h3 {
    margin: 0 0 6px;
    font-size: 16px;
    color: var(--text);
}

.faq-item p {
    margin: 0;
    font-size: 14.5px;
    color: var(--text-muted);
}

/* Prose pages (Privacy, Terms, API) */
.prose-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px;
    margin-bottom: 32px;
}

.prose-card h1 {
    margin-top: 0;
    font-size: 28px;
}

.prose-card h2 {
    margin-top: 28px;
    font-size: 20px;
}

.prose-card p, .prose-card li {
    color: var(--text-muted);
    font-size: 15px;
}

/* Pricing Cards & Code Blocks */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin: 24px 0 36px;
}

.pricing-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.pricing-card.featured {
    border: 2px solid var(--primary);
    box-shadow: var(--shadow);
}

.pricing-tier {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
}

.pricing-price {
    font-size: 32px;
    font-weight: 800;
    margin: 8px 0 12px;
    color: var(--text);
}

.pricing-price span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    flex: 1;
}

.pricing-features li {
    font-size: 14px;
    color: var(--text-muted);
    padding: 5px 0;
}

pre.code-block {
    background: #0f172a;
    color: #e2e8f0;
    padding: 18px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.55;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 28px 20px;
    font-size: 14px;
    color: var(--text-light);
}

.footer-inner {
    max-width: 1040px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .converter-card {
        padding: 20px 16px;
    }
    .dropzone {
        padding: 26px 14px;
    }
    .pro-callout {
        padding: 18px;
    }
    .prose-card {
        padding: 22px 18px;
    }
}
