:root {
    --bg: #f4f7fb;
    --bg-soft: #eef3f8;
    --surface: #ffffff;
    --surface-muted: #f8fbff;
    --line: #d7e0ea;
    --text: #102033;
    --muted: #53657b;
    --accent: #245eea;
    --accent-soft: #e8f0ff;
    --success: #1d8f55;
    --success-soft: #edf9f2;
    --header-bg: rgba(255, 255, 255, 0.92);
    --footer-bg: #ffffff;
    --tooltip-bg: #ffffff;
    --drag-bg: #f1f6ff;
    --progress-bg: #d9e4ef;
    --shadow: 0 16px 32px rgba(16, 32, 51, 0.08);
    --shadow-soft: 0 10px 20px rgba(16, 32, 51, 0.06);
    --radius: 18px;
    --radius-sm: 14px;
    --font-main: Vazir, Vazirmatn, Tahoma, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
    --bg: #0f1722;
    --bg-soft: #131d2a;
    --surface: #182434;
    --surface-muted: #0f1b2a;
    --line: #2a3a4d;
    --text: #edf3fb;
    --muted: #9db0c5;
    --accent: #78a6ff;
    --accent-soft: rgba(120, 166, 255, 0.16);
    --success: #63d19b;
    --success-soft: rgba(99, 209, 155, 0.18);
    --header-bg: rgba(15, 23, 34, 0.9);
    --footer-bg: #101927;
    --tooltip-bg: #1b2a3b;
    --drag-bg: #132338;
    --progress-bg: #233447;
    --shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
    --shadow-soft: 0 10px 20px rgba(0, 0, 0, 0.22);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    transition: background 0.2s ease, color 0.2s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

[hidden] {
    display: none !important;
}

main {
    min-height: calc(100vh - 160px);
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
}

h1 {
    font-size: clamp(2.2rem, 5vw, 4.4rem);
    line-height: 1.08;
    margin-bottom: 14px;
}

h2 {
    font-size: 1.55rem;
    margin-bottom: 8px;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 6px;
}

p,
li,
small,
span {
    color: var(--muted);
}

button,
select,
input[type="text"],
input[type="file"],
textarea,
.button-link,
#downloadLink {
    font: inherit;
    border-radius: var(--radius-sm);
}

select,
input[type="text"],
input[type="file"],
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
}

textarea {
    min-height: 130px;
    resize: vertical;
}

button,
#downloadLink,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button,
#downloadLink,
.button-link-primary {
    width: 100%;
    padding: 15px 18px;
    border: 0;
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
}

.button-link-secondary {
    padding: 14px 18px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
}

button:hover:not(:disabled),
#downloadLink:hover,
.button-link:hover {
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pill {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
}

.pill-alt {
    background: var(--success-soft);
    color: var(--success);
}

.reveal {
    opacity: 1;
    transform: none;
}

.reveals-active .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveals-active .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 920px) {
    .container {
        width: min(1120px, calc(100% - 24px));
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
    .reveal {
        opacity: 1;
        transform: none;
    }
}
