/* ── Design Tokens ── */
:root {
    --bg-deep:      #100b09;
    --bg:           #1c1310;
    --bg-raised:    #251a15;
    --bg-card:      #2e2018;
    --border:       #3d2b1f;
    --border-hover: #5c3d28;
    --text:         #f4deb8;
    --text-muted:   #e8c28a;
    --text-dim:     #b37a48;
    --accent:       #d4975c;
    --accent-bright:#e8c28a;
    --accent-dim:   rgba(212, 151, 92, 0.14);
    --accent-glow:  rgba(212, 151, 92, 0.08);
    --green:        #4caf7d;
    --red:          #e06c6c;
    --font-serif:   'Lota', Georgia, 'Times New Roman', serif;
    --font-mono:    'Sometype Mono', 'Monaco', 'Courier New', monospace;
    --font-sans:    'DM Sans', system-ui, sans-serif;
    --radius:       10px;
    --transition:   0.2s ease;
    --max-w:        680px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-serif);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* ── Typography ── */

h1, h2, h3 {
    font-family: var(--font-mono);
    font-weight: 600;
    line-height: 1.2;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity var(--transition);
}
a:hover { opacity: 0.75; }

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--bg-raised);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: var(--accent);
    word-break: break-all;
}

/* ── Header ── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0.875rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.25rem;
    color: var(--text);
}
.nav-logo:hover { opacity: 0.6; }

.nav-menu {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.nav-menu a {
    font-size: 0.875rem;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}
.nav-menu a:hover { color: var(--text); opacity: 1; }

.nav-dropdown {
    position: relative;
}
.nav-dropdown details {
    position: relative;
}
.nav-dropdown summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-muted);
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary:hover,
.nav-dropdown details[open] summary {
    color: var(--text);
}
.nav-dropdown .dropdown-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 0.5rem);
    min-width: 220px;
    margin: 0;
    padding: 0.5rem 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
    list-style: none;
    z-index: 200;
    display: none;
}
.nav-dropdown details[open] .dropdown-menu { display: block; }
.nav-dropdown .dropdown-menu li { white-space: nowrap; }
.nav-dropdown .dropdown-menu a,
.nav-dropdown .dropdown-disabled {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}
.nav-dropdown .dropdown-menu a:hover {
    background: rgba(255,255,255,0.04);
    color: var(--text);
}
.nav-dropdown .dropdown-disabled { cursor: default; color: var(--text-dim); }
.nav-dropdown summary:focus { outline: none; }
@media (max-width: 600px) {
    .nav-dropdown .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
    }
}

/* ── Main ── */

.main-content {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Hero ── */

.hero {
    padding: 4rem 0 3rem;
}

.hero-eyebrow {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    letter-spacing: 0.04em;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    color: var(--text);
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.hero-bio {
    font-size: 1.0625rem;
    color: var(--text-muted);
    line-height: 1.8;
    max-width: 560px;
    margin-bottom: 1.5rem;
}

.hero-bio a {
    color: var(--accent);
    border-bottom: 1px solid var(--accent-dim);
    transition: border-color var(--transition), opacity var(--transition);
}
.hero-bio a:hover {
    opacity: 1;
    border-bottom-color: var(--accent);
}

/* ── Sections ── */

.content-section {
    padding: 2.5rem 0;
    border-top: 1px solid var(--border);
}

.section-label {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 1.25rem;
}

/* ── Stats ── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border-hover); }

.stat-icon {
    font-size: 1.1rem;
    color: var(--accent);
    opacity: 0.7;
    margin-bottom: 0.375rem;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 1.375rem;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-value.loading {
    color: var(--text-dim);
    animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse { 0%,100% { opacity: .4; } 50% { opacity: .8; } }

.stat-label {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.2rem;
}

.storage-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color var(--transition);
}
.storage-card:hover { border-color: var(--border-hover); }
.storage-card .stat-icon { margin-bottom: 0; font-size: 1.25rem; flex-shrink: 0; }
.storage-card .stat-value { font-size: 1.25rem; }

/* ── Tabs ── */

.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 2rem;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.75rem 1.125rem;
    cursor: pointer;
    white-space: nowrap;
    margin-bottom: -1px;
    transition: color var(--transition), border-color var(--transition);
    letter-spacing: 0.01em;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-btn i { margin-right: 0.375rem; }

.tab-pane { display: none; padding-bottom: 4rem; }
.tab-pane.active { display: block; }

/* ── Upload tab ── */

.drop-zone {
    display: block;
    border: 1px dashed var(--border-hover);
    border-radius: var(--radius);
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: border-color var(--transition), background var(--transition);
    margin-bottom: 0.875rem;
}
.drop-zone:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}
.drop-zone.drag-over {
    border-color: var(--green);
    background: rgba(76, 175, 125, 0.05);
}
.drop-zone i {
    font-size: 2rem;
    color: var(--accent);
    opacity: 0.6;
    display: block;
    margin-bottom: 0.75rem;
}
.drop-zone input { display: none; }

#file-name {
    font-size: 0.875rem;
    display: block;
    margin-top: 0.25rem;
    font-family: var(--font-sans);
    color: var(--text-muted);
}

.file-info {
    display: none;
    margin-bottom: 0.875rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-family: var(--font-sans);
    color: var(--text-muted);
}
.file-info.show { display: block; }

.progress-wrap { display: none; margin-bottom: 0.875rem; }
.progress-wrap.show { display: block; }

.progress-track {
    height: 4px;
    background: var(--bg-raised);
    border-radius: 999px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--green));
    border-radius: 999px;
    transition: width 0.2s ease;
}
.progress-label {
    text-align: right;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
    margin-top: 0.3rem;
}

.turnstile-wrap {
    margin-bottom: 0.75rem;
}

.cf-turnstile {
    display: flex;
    justify-content: center;
}

.upload-btn {
    display: block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--accent);
    color: var(--bg-deep);
    border: none;
    border-radius: 999px;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity var(--transition), transform var(--transition);
    letter-spacing: 0.01em;
}
.upload-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.upload-btn:active { transform: scale(0.99); }
.upload-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.status-msg {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    min-height: 1.3em;
    color: var(--accent);
}

.result-box {
    display: none;
    margin-top: 1.25rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--green);
    border-radius: var(--radius);
    animation: slideIn 0.25s ease;
}
.result-box.show { display: block; }

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-label {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: 0.625rem;
}

.result-url {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    padding: 0.625rem 0.875rem;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 6px;
    word-break: break-all;
    color: var(--text);
    margin-bottom: 0.875rem;
    line-height: 1.5;
}

.result-actions { display: flex; gap: 0.625rem; flex-wrap: wrap; }

.copy-btn,
.open-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition);
    text-decoration: none;
}
.copy-btn:hover,
.open-btn:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }
.copy-btn.copied { background: var(--green); border-color: var(--green); color: var(--bg-deep); }

/* ── About / Prose ── */

.prose {
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.8;
}
.prose p + p { margin-top: 1rem; }
.prose a { color: var(--accent); border-bottom: 1px solid var(--accent-dim); }
.prose a:hover { border-bottom-color: var(--accent); opacity: 1; }
.prose strong { color: var(--text); font-weight: 600; }

/* ── Steps (How it Works) ── */

.steps {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
}

.step {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.step:last-child { border-bottom: none; }

.step-num {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    margin-top: 0.1rem;
    font-family: var(--font-mono);
}

.step-body h3 {
    font-family: var(--font-serif);
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 0.2rem;
}
.step-body p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ── How-it-works feature grid ── */

.how-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.how-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.125rem;
    transition: border-color var(--transition);
}
.how-card:hover { border-color: var(--border-hover); }

.how-card i {
    font-size: 1.125rem;
    color: var(--accent);
    opacity: 0.8;
    margin-bottom: 0.625rem;
    display: block;
}

.how-card h3 {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.how-card p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ── Limits ── */

.limits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.limit-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    transition: border-color var(--transition);
}
.limit-card:hover { border-color: var(--border-hover); }

.limit-card i {
    font-size: 1.25rem;
    color: var(--accent);
    opacity: 0.7;
    margin-bottom: 0.625rem;
    display: block;
}

.limit-value {
    font-family: var(--font-mono);
    font-size: 1.375rem;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.limit-label {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.limit-note {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
    opacity: 0.7;
}

.limits-note {
    padding: 0.875rem 1.125rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.8375rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 1.75rem;
}
.limits-note strong { color: var(--text); }
.limits-note a { color: var(--accent); }
.limits-note p { margin-top: 0.375rem; }

/* ── Usage bars ── */

.usage-section { margin-top: 1.5rem; }

.usage-item { margin-bottom: 1.25rem; }

.usage-row {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.usage-row span:first-child { color: var(--text); font-weight: 500; }

.usage-track {
    height: 5px;
    background: var(--bg-raised);
    border-radius: 999px;
    overflow: hidden;
}
.usage-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--green));
    transition: width 0.6s cubic-bezier(.4, 0, .2, 1);
}
.usage-fill.warn   { background: linear-gradient(90deg, #c47a30, #d48a40); }
.usage-fill.danger { background: linear-gradient(90deg, var(--red), #c05050); }

.usage-loading {
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    color: var(--text-dim);
    font-style: italic;
}

.divider { border: none; border-top: 1px solid var(--border); margin: 1.75rem 0; }

.file-types {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.8;
}
.file-types strong { color: var(--text); }

/* ── Code Blocks ── */

.code-block {
    margin: 1.5rem 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    overflow: hidden;
}

.code-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-dim);
    background: var(--bg-raised);
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border);
    letter-spacing: 0.05em;
}

.code-block pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.code-block code {
    background: none;
    padding: 0;
    color: inherit;
}

/* ── Footer ── */

.site-footer {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-dim);
    line-height: 1.8;
}

.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); opacity: 1; }

/* ── Responsive ── */

@media (max-width: 600px) {
    .hero { padding: 2.5rem 0 2rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .how-grid,
    .limits-grid { grid-template-columns: 1fr; }
    .nav-menu { display: none; }
}