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

:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-muted: #64748b;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-soft: #eef2ff;
    --success: #16a34a;
    --error: #dc2626;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 820px;
    margin: 0 auto;
    padding: 3rem 1.25rem 4rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Hero */
.hero {
    text-align: left;
    margin-bottom: 2.5rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.75rem;
    line-height: 1.15;
}

.hero .lede {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 60ch;
}

.hero .lede strong {
    color: var(--text);
    font-weight: 600;
}

/* Tool card */
.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem;
    margin-bottom: 2.5rem;
}

.drop-zone {
    display: block;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease;
    background: #fafbfc;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.is-dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
    outline: none;
}

.drop-zone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.drop-icon {
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.drop-text {
    font-size: 1rem;
    color: var(--text);
}

.link-like {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.drop-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* File info */
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    padding: 0.9rem 1rem;
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.file-meta {
    min-width: 0;
}

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

.file-size {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Convert row */
.convert-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.direction {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.direction-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.segmented {
    display: inline-flex;
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

.seg-btn {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0.5rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 7px;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}

.seg-btn:hover {
    color: var(--text);
}

.seg-btn[aria-checked="true"] {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* Buttons */
.btn-primary,
.btn-ghost {
    appearance: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    border-radius: 10px;
    transition: background 120ms ease, color 120ms ease;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    padding: 0.7rem 1.25rem;
    font-size: 0.95rem;
}

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

.btn-primary:disabled {
    background: var(--border-strong);
    cursor: not-allowed;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

.btn-ghost:hover {
    color: var(--text);
    background: #e2e8f0;
}

/* Status */
.status {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.status.is-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.status.is-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status.is-info {
    background: var(--accent-soft);
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.feature h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.feature p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* FAQ */
.faq {
    margin-bottom: 2.5rem;
}

.faq h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

.faq details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.6rem;
}

.faq details[open] {
    border-color: var(--border-strong);
}

.faq summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
    list-style: none;
    padding-right: 1.5rem;
    position: relative;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: 400;
}

.faq details[open] summary::after {
    content: "–";
}

.faq p {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Footer */
footer {
    text-align: left;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

footer a {
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
}

footer a:hover {
    color: var(--text);
}

@media (max-width: 600px) {
    .container {
        padding: 2rem 1rem 3rem;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .tool-card {
        padding: 1.25rem;
    }
    .drop-zone {
        padding: 2rem 1rem;
    }
    .convert-row {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-primary {
        width: 100%;
    }
}
