/* Humble-Brag Generator — dumbshit.app */

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

:root {
    --bg: #09090b;
    --bg-2: #18181b;
    --bg-3: #27272a;
    --border: #3f3f46;
    --text: #fafafa;
    --text-dim: #a1a1aa;
    --text-mute: #71717a;
    --accent: #10b981;
    --accent-hov: #34d399;
    --li-blue: #0a66c2;
}

html, body {
    margin: 0; padding: 0;
    background: var(--bg); color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
kbd {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0 5px;
    font-size: 0.85em;
}

.topbar { padding: 24px 24px 8px; max-width: 900px; margin: 0 auto; }
.back { color: var(--text-mute); text-decoration: none; font-family: ui-monospace, monospace; font-size: 12px; }
.back:hover { color: var(--text); }
.topbar h1 { margin: 12px 0 4px; font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.02em; }
.topbar .sub { margin: 0; color: var(--text-dim); font-size: 15px; }

.app {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 24px 40px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

/* form */
.form {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.lbl {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: ui-monospace, monospace;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    color: var(--text-mute);
}
.lbl em {
    font-style: normal;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 13px;
}
textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    padding: 12px 14px;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.15s;
}
textarea:focus { outline: none; border-color: var(--accent); }
textarea::placeholder { color: var(--text-mute); }
.char-count {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-family: ui-monospace, monospace;
    font-size: 10px;
    color: var(--text-mute);
    pointer-events: none;
}

/* cringe slider */
.cringe-field input[type=range] {
    accent-color: var(--accent);
    width: 100%;
}
.cringe-scale {
    display: flex;
    justify-content: space-between;
    padding: 0 4px;
    font-family: ui-monospace, monospace;
    font-size: 10px;
    color: var(--text-mute);
}

/* tone chips */
.tone-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chip {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.12s;
}
.chip:hover { color: var(--text); border-color: var(--text-mute); }
.chip.is-active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

/* toggles */
.toggles { display: flex; gap: 20px; flex-wrap: wrap; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); cursor: pointer; user-select: none; }
.chk:hover { color: var(--text); }
.chk input { accent-color: var(--accent); width: 16px; height: 16px; }

/* actions */
.actions { display: flex; align-items: center; gap: 12px; }
.btn {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--bg-3);
    color: var(--text);
    font-family: inherit;
    font-weight: 600;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.btn:hover:not(:disabled) { background: var(--border); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    padding: 11px 24px;
    font-size: 14px;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hov); border-color: var(--accent-hov); }
.kbd-hint { color: var(--text-mute); font-size: 11px; font-family: ui-monospace, monospace; }

/* output */
.output-wrap { display: flex; flex-direction: column; gap: 12px; }
.output-status {
    font-family: ui-monospace, monospace;
    font-size: 12px;
    color: var(--text-mute);
    text-align: center;
    min-height: 16px;
}
.output-status.is-loading::after {
    content: '...';
    display: inline-block;
    animation: dots 1.4s infinite;
}
@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}
.output-status.is-error { color: #fecaca; }

/* fake LinkedIn post card */
.li-post {
    background: #ffffff;
    color: #000000e0;
    border-radius: 8px;
    padding: 16px 20px;
    font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    font-size: 14px;
    box-shadow: 0 0 0 1px #00000014, 0 4px 16px #0006;
    max-width: 100%;
}
.li-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.li-avatar {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 18px;
}
.li-meta { flex: 1; min-width: 0; }
.li-name { font-weight: 700; font-size: 14px; color: #000000d9; }
.li-title { font-size: 12px; color: #00000099; line-height: 1.3; }
.li-time { font-size: 11px; color: #00000080; margin-top: 2px; }
.li-more { color: #00000080; font-size: 20px; line-height: 1; }
.li-body {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
    color: #000000d9;
    min-height: 24px;
}
.li-body.is-streaming::after {
    content: '▍';
    color: #0a66c2;
    animation: blink 1s steps(2, end) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.li-actions {
    display: flex;
    justify-content: space-around;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #0000001a;
    font-size: 13px;
    color: #00000088;
    font-weight: 600;
}

/* post-output buttons */
.post-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.post-actions .btn { flex: 0 0 auto; }

.btn-linkedin {
    background: var(--li-blue);
    color: #fff;
    border-color: var(--li-blue);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-linkedin:hover { background: #0958a8; border-color: #0958a8; }
.btn-linkedin .li-mark {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    background: #fff;
    color: var(--li-blue);
    font-weight: 800;
    font-size: 11px;
    border-radius: 3px;
    line-height: 1;
    font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
}
.action-status {
    margin-left: 4px;
    font-family: ui-monospace, monospace;
    font-size: 11px;
    color: var(--text-mute);
}
.action-status.is-ok { color: var(--accent); }
.action-status.is-error { color: #fecaca; }

.foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
    color: var(--text-mute);
    font-family: ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.04em;
}
.bmc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-mute);
    text-decoration: none;
    transition: color 0.15s;
}
.bmc-link:hover { color: #FFDD00; }

/* slow-down modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    display: grid;
    place-items: center;
    z-index: 100;
    padding: 24px;
    animation: modal-fade 0.18s ease-out both;
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 28px 24px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 60px -10px rgba(0, 0, 0, 0.6);
    animation: modal-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes modal-pop {
    0%   { opacity: 0; transform: translateY(14px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 12px;
}
.modal-card h2 {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.modal-card p {
    margin: 0 0 12px;
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.5;
}
.modal-card strong { color: var(--text); }
.modal-card .modal-sub { font-size: 13px; color: var(--text-mute); }
.bmc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #FFDD00;
    color: #0d0c22;
    font-weight: 700;
    padding: 11px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    margin: 12px 0 8px;
    transition: transform 0.12s, box-shadow 0.12s;
    box-shadow: 0 4px 12px -2px rgba(255, 221, 0, 0.4);
}
.bmc-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -2px rgba(255, 221, 0, 0.5); }
.modal-close {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-mute);
    font-family: ui-monospace, monospace;
    font-size: 12px;
    padding: 8px;
    cursor: pointer;
    display: block;
    margin: 0 auto;
}
.modal-close:hover { color: var(--text); }

@media (max-width: 600px) {
    .post-actions { flex-direction: column; align-items: stretch; }
    .post-actions .btn { width: 100%; }
}
