/* ─── Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600&display=swap');

/* ─── Variables ─────────────────────────────────────────── */
:root {
    --color-bg:             #131316;
    --color-bg0:            #18181b;
    --color-bg1:            #1e1e22;
    --color-bg2:            #27272a;
    --color-bg3:            #303034;
    --color-fg:             #e8e8ea;
    --color-fg1:            #c5c5c8;
    --color-fg2:            #a1a1a6;
    --color-fg3:            #71717a;
    --color-fg4:            #52525b;
    --color-border:         #27272a;
    --color-border-subtle:  #1e1e22;
    --color-yellow:         #feca00;
    --color-blue:           #008df4;
    --radius-2:             2px;
    color-scheme: dark;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco,
                 Consolas, 'Liberation Mono', monospace;
    font-size: 12px;
    line-height: 18px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--color-bg);
    color: var(--color-fg);
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #root { min-height: 100%; }
body { background: var(--color-bg); color: var(--color-fg); }

::selection { background: #ff0; color: #000; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
input, textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--color-border);
    background: var(--color-bg0);
    color: var(--color-fg);
    border-radius: var(--radius-2);
}
input:focus, textarea:focus { outline: none; border-color: var(--color-fg3); }
textarea { resize: vertical; }
strong { font-weight: 600; }

/* ─── Accent ─────────────────────────────────────────────── */
.accent { color: var(--color-blue); }

/* ─── App Shell ──────────────────────────────────────────── */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ─── Header ─────────────────────────────────────────────── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px dashed var(--color-border);
}
.header-brand { display: flex; flex-direction: column; gap: 2px; }
.header-brand-name {
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-fg);
    text-decoration: none;
}
.header-brand-name:hover { text-decoration: underline; }
.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-fg2);
}
.header-nav a {
    color: var(--color-fg1);
    padding: 4px 6px;
    text-decoration: none;
}
.header-nav a:hover { color: var(--color-fg); text-decoration: underline; }
.header-nav .bracket { color: var(--color-fg4); }

/* ─── Shell / Layout ─────────────────────────────────────── */
.shell {
    width: min(720px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 14px 0 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ─── Primitives ─────────────────────────────────────────── */
.stack    { display: flex; flex-direction: column; gap: 10px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.row      { display: flex; align-items: center; }
.wrap     { flex-wrap: wrap; }
.gap-sm   { gap: 6px; }
.align-start { align-items: start; }

.label, .meta-label {
    text-transform: uppercase;
    letter-spacing: .1em;
    font-size: 11px;
    color: var(--color-fg3);
}
.muted  { color: var(--color-fg3); }
.title  {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    word-break: break-word;
    color: var(--color-fg);
}
.mt38 { margin-top: 38px; }

.separator {
    border: none;
    border-top: 1px dashed var(--color-border);
    margin: 2px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

/* ─── Panel ──────────────────────────────────────────────── */
.panel {
    border: 1px solid var(--color-border);
    background: var(--color-bg0);
    padding: 10px 12px;
    border-radius: var(--radius-2);
}
.panel-tight { padding: 7px 9px; }

/* ─── Grid ───────────────────────────────────────────────── */
.grid   { display: grid; gap: 8px; }
.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-two { grid-column: span 2; }

/* ─── Stat Box ───────────────────────────────────────────── */
.stat-box {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2);
    background: var(--color-bg);
    padding: 8px;
    min-height: 52px;
}

/* ─── Buttons ────────────────────────────────────────────── */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2);
    background: var(--color-bg0);
    color: var(--color-fg1);
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-decoration: none;
    transition: border-color .15s, color .15s;
    cursor: pointer;
}
.button:hover { border-color: var(--color-fg4); color: var(--color-fg); text-decoration: none; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button-primary {
    border-color: var(--color-fg3);
    background: var(--color-bg1);
    color: var(--color-fg);
}
.button-primary:hover { border-color: var(--color-fg2); }
.button-small { min-height: 22px; padding: 0 8px; font-size: 10px; }

/* active tab button state */
.active-tab-btn {
    border-color: var(--color-fg3);
    background: var(--color-bg1);
    color: var(--color-fg);
}

/* ─── ASCII Orb ──────────────────────────────────────────── */
.auth-hero      { align-items: center; }
.auth-copy,
.auth-orb-panel { min-width: 0; }
.auth-orb-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.auth-orb-stage {
    min-height: 0;
    width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}
.ascii-orb-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    -webkit-user-select: none;
    user-select: none;
    border-radius: 50%;
    line-height: 0;
}
.ascii-orb-wrap:focus-visible {
    outline: 1px solid var(--color-fg4);
    outline-offset: 4px;
}
.ascii-orb {
    display: block;
    margin: -55px;
    white-space: pre;
    font-size: clamp(8px, 1.2vw, 12px);
    line-height: .9;
    letter-spacing: 0;
    color: var(--color-blue);
    text-align: left;
    text-shadow:
        0 0 10px rgba(0,141,244,.18),
        0 0 24px rgba(0,141,244,.08);
    -webkit-user-select: none;
    user-select: none;
}

/* ─── Workspace / Thread rows (projects / experience) ───── */
.workspace-list { display: flex; flex-direction: column; gap: 4px; }
.workspace-row {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: border-color .15s;
}
.workspace-row:hover { border-color: var(--color-fg4); }
.workspace-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.thread-card { align-items: stretch; flex-direction: column; }
.thread-row-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.thread-title-link { flex: 1 1 auto; min-width: 0; }
.thread-title-link strong { display: block; color: var(--color-fg); }
.thread-actions { flex: 0 0 auto; }

/* ─── Tabs ───────────────────────────────────────────────── */
.tab-panel          { display: none; }
.tab-panel.active-panel { display: block; }

/* ─── Forms ──────────────────────────────────────────────── */
#form-msg { font-size: 11px; }

/* ─── Footer ─────────────────────────────────────────────── */
.footer {
    margin-top: auto;
    padding: 10px 16px;
    border-top: 1px dashed var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: var(--color-fg4);
    letter-spacing: .06em;
}
.footer a { color: var(--color-fg3); }
.footer a:hover { color: var(--color-fg); }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 760px) {
    .two-up { grid-template-columns: 1fr; }
    .span-two { grid-column: span 1; }
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 8px 12px;
    }
    .header-nav { flex-wrap: wrap; }
    .shell {
        width: min(720px, calc(100vw - 20px));
        padding-top: 10px;
    }
    .workspace-row { align-items: flex-start; }
    .thread-row-header { align-items: flex-start; flex-direction: column; }
    .footer { flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px 12px; }
}
@media (max-width: 640px) {
    .ascii-orb { font-size: clamp(7px, 2.6vw, 10px); }
}
