/* ============================================================
   Unstamp — styles
   Design: modern bento layout, emerald/mint accent, dark base
   ============================================================ */

:root {
    --bg: #0b0b14;
    --bg-soft: #10101d;
    --surface: #161629;
    --surface-2: #1e1e36;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.13);
    --primary: #6366f1;           /* indigo-500 */
    --primary-deep: #4f46e5;      /* indigo-600 */
    --accent: #a78bfa;            /* violet-400 */
    --accent-soft: rgba(167, 139, 250, 0.14);
    --accent-glow: rgba(99, 102, 241, 0.55);
    --on-primary: #ffffff;
    --text: #f2f1ff;
    --text-dim: #a9a8c6;
    --text-faint: #6c6b8a;
    --error: #f87171;
    --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.55);
    --shadow-md: 0 10px 25px -10px rgba(0, 0, 0, 0.45);
    --radius: 16px;
    --radius-sm: 10px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg);
    background-image:
        radial-gradient(1200px 600px at 20% -10%, rgba(99, 102, 241, 0.12), transparent 60%),
        radial-gradient(1000px 500px at 100% 10%, rgba(167, 139, 250, 0.08), transparent 60%);
    min-height: 100vh;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent-soft); color: var(--text); }

/* ---------- Top nav ---------- */
.topnav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 22px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: -0.01em;
    font-size: 1.05rem;
}

.wordmark-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 0 12px var(--accent-glow);
}

.topnav-links {
    display: inline-flex;
    gap: 22px;
}

.topnav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s;
}

.topnav-links a:hover { color: var(--text); }

@media (max-width: 540px) {
    .topnav-links { display: none; }
}

/* ---------- Layout ---------- */
.main-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 28px 80px;
}

/* ---------- Hero ---------- */
.hero {
    text-align: center;
    padding: 48px 0 56px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid rgba(167, 139, 250, 0.3);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 22px;
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.025em;
    margin-bottom: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #c7b8ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-dim);
    max-width: 580px;
    margin: 0 auto;
}

/* ---------- Tool card ---------- */
.tool-card {
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    padding: 20px;
    box-shadow: var(--shadow-lg);
}

.source-callout {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
}

.source-callout-img {
    flex: 0 0 auto;
    width: 96px;
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: block;
}

.source-callout-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    line-height: 1.45;
}

.source-callout-body strong {
    color: var(--text);
    font-weight: 600;
}

.source-callout-body span {
    color: var(--text-dim);
}

@media (max-width: 520px) {
    .source-callout {
        flex-direction: column;
        align-items: flex-start;
    }
    .source-callout-img {
        width: 120px;
    }
}

.upload-placeholder {
    position: relative;
    border: 1.5px dashed rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    padding: 48px 24px;
    background:
        radial-gradient(600px 200px at 50% 0%, rgba(99, 102, 241, 0.08), transparent 70%),
        rgba(0, 0, 0, 0.2);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.upload-placeholder:hover,
.upload-placeholder:focus-visible {
    border-color: var(--primary);
    outline: none;
}

.upload-placeholder.dragover {
    border-color: var(--accent);
    background: rgba(167, 139, 250, 0.12);
    transform: scale(1.005);
}

.upload-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 14px;
}

.uploadInner h3 {
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}

.uploadInner p {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.uploadMeta {
    color: var(--text-faint);
    font-size: 0.8rem;
    margin-top: 4px;
    margin-bottom: 16px;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    background: linear-gradient(135deg, var(--primary-deep), var(--primary));
    border: none;
    border-radius: 10px;
    color: var(--on-primary);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 6px 20px -8px var(--accent-glow);
}

.upload-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px -8px var(--accent-glow);
}

/* Status */
.status {
    margin-top: 14px;
    padding: 0 6px;
    min-height: 20px;
    color: var(--text-dim);
    font-size: 0.9rem;
    text-align: left;
    white-space: pre-line;
}

.status.error { color: var(--error); }

/* Batch bar */
.batchBar {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 18px;
    background: var(--surface-2);
    border-radius: 14px;
    border: 1px solid var(--border);
}

.batchLeft {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.progressText {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
}

.field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fieldLabel {
    font-size: 0.78rem;
    color: var(--text-faint);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.select {
    appearance: none;
    background: rgba(0, 0, 0, 0.35) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23a9a8c6' d='M6 8L0 0h12z'/></svg>") no-repeat right 12px center;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 8px 32px 8px 12px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    font-family: inherit;
}

.select:focus-visible {
    outline: none;
    border-color: var(--accent);
}

.formatGroup {
    border: 0;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.formatRadios {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.formatLabel {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.formatLabel input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.formatLabel:has(input:checked) {
    background: var(--accent-soft);
    color: var(--accent);
}

.batchActions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Buttons */
.btn {
    appearance: none;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-radius: 9px;
    padding: 9px 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
    transition: background 0.15s, transform 0.15s;
}

.btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.09);
}

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

.btn.primary {
    border: none;
    background: linear-gradient(135deg, var(--primary-deep), var(--primary));
    color: var(--on-primary);
    box-shadow: 0 6px 16px -8px var(--accent-glow);
}

.btn.primary:hover:not(:disabled) {
    transform: translateY(-1px);
}

/* Thumbnail grid */
.thumbGrid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 760px) {
    .thumbGrid { grid-template-columns: 1fr 1fr; }
}

.thumbCard {
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface-2);
}

.thumbHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.thumbName {
    font-weight: 600;
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}

.thumbStatus {
    color: var(--text-dim);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.thumbStatus.error {
    color: var(--error);
    background: rgba(248, 113, 113, 0.12);
}

.thumbBody {
    padding: 14px;
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

@media (min-width: 760px) {
    .thumbBody { grid-template-columns: 1fr 1fr; align-items: start; }
}

.thumbBody > .thumbRowLabel {
    grid-column: 1 / -1;
    margin-top: -2px;
}

.thumbBadge {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    align-self: start;
    width: fit-content;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid rgba(167, 139, 250, 0.22);
}

.thumbBadge.hidden { display: none; }

p.thumbRowLabel {
    font-size: 0.72rem;
    color: var(--text-faint);
    margin: 0 0 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.thumbImg {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
}

.thumbFooter {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
}

.hidden { display: none !important; }

/* ---------- Info grid (bento) ---------- */
.info-grid {
    margin-top: 80px;
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

@media (min-width: 820px) {
    .info-grid { grid-template-columns: 1fr 1fr; }
}

.info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.info-kicker {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
}

.info-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin-bottom: 16px;
    color: var(--text);
}

.info-card p {
    color: var(--text-dim);
    font-size: 0.98rem;
    margin-bottom: 14px;
}

.info-card p:last-child { margin-bottom: 0; }

.formula {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 4px 0 16px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.88rem;
    color: var(--accent);
    line-height: 1.5;
}

/* Steps list */
.steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0;
}

.steps li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    color: var(--text-dim);
    font-size: 0.95rem;
}

.step-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.steps li strong {
    display: block;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 2px;
}

.steps li span { display: block; font-size: 0.9rem; }

/* ---------- Notes ---------- */
.notes-card {
    margin-top: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
}

.notes-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 18px;
    color: var(--text);
}

.notes-card details {
    border-top: 1px solid var(--border);
    padding: 14px 0;
}

.notes-card details:last-child { padding-bottom: 0; }

.notes-card summary {
    cursor: pointer;
    color: var(--text);
    font-weight: 600;
    font-size: 0.98rem;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

.notes-card summary::after {
    content: "+";
    color: var(--text-faint);
    font-weight: 400;
    font-size: 1.3rem;
    line-height: 1;
    transition: transform 0.2s;
}

.notes-card details[open] summary::after { content: "−"; }

.notes-card details p {
    margin-top: 10px;
    color: var(--text-dim);
    font-size: 0.92rem;
}

.notes-card code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.85em;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 4px;
    color: var(--accent);
}

/* ---------- Footer ---------- */
.site-footer {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 28px 40px;
    border-top: 1px solid var(--border);
    color: var(--text-faint);
    font-size: 0.82rem;
    text-align: center;
}
