/* ── Design tokens ────────────────────────────────────── */

:root {
    --fg: #fafafa;
    --fg-secondary: #a3a3a3;
    --fg-muted: #737373;
    --bg: #0a0a0a;
    --bg-card: #141414;
    --bg-elevated: #1a1a1a;
    --border: #262626;
    --border-subtle: #1f1f1f;
    --gold: #c9b896;
    --lavender: #a78bfa;

    --font-body: 'IBM Plex Sans', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

/* ── Reset ───────────────────────────────────────────── */

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--fg);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* ── Start screen ────────────────────────────────────── */

#start-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    transition: opacity 0.4s ease;
}

#start-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.start-inner {
    text-align: center;
}

.start-title {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.start-subtitle {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fg-muted);
    margin-bottom: 2rem;
}

#start-btn {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.75rem 2rem;
    color: var(--bg);
    background: var(--gold);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

#start-btn:hover {
    background: #d4c4a0;
    transform: translateY(-1px);
}

#start-btn:active {
    transform: translateY(0);
}

#start-btn:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

/* ── Session layout ──────────────────────────────────── */

#session {
    display: flex;
    height: 100%;
    opacity: 1;
    transition: opacity 0.4s ease 0.2s;
}

#session.hidden {
    display: none;
}

.pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pane-divider {
    width: 1px;
    background: var(--border);
}

.pane-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.pane-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fg-muted);
}

.pane-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

/* Subtle scrollbar */
.pane-body::-webkit-scrollbar {
    width: 4px;
}

.pane-body::-webkit-scrollbar-track {
    background: transparent;
}

.pane-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* ── Dashboard: task list ────────────────────────────── */

.placeholder {
    color: var(--fg-muted);
    font-style: italic;
    padding-top: 2rem;
    text-align: center;
}

.task-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-subtle);
    animation: task-in 0.3s ease both;
}

.task-item:last-child {
    border-bottom: none;
}

.task-number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--fg-muted);
    min-width: 1.5rem;
    padding-top: 0.1rem;
    text-align: right;
    flex-shrink: 0;
}

.task-content {
    flex: 1;
    min-width: 0;
}

.task-name {
    font-weight: 400;
    line-height: 1.5;
}

.task-detail {
    font-style: italic;
    color: var(--fg-secondary);
    font-size: 0.8125rem;
    margin-top: 0.2rem;
    line-height: 1.4;
}

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

/* Stagger animation for each task */
.task-item:nth-child(1)  { animation-delay: 0s; }
.task-item:nth-child(2)  { animation-delay: 0.04s; }
.task-item:nth-child(3)  { animation-delay: 0.08s; }
.task-item:nth-child(4)  { animation-delay: 0.12s; }
.task-item:nth-child(5)  { animation-delay: 0.16s; }
.task-item:nth-child(6)  { animation-delay: 0.2s; }
.task-item:nth-child(7)  { animation-delay: 0.24s; }
.task-item:nth-child(8)  { animation-delay: 0.28s; }
.task-item:nth-child(9)  { animation-delay: 0.32s; }
.task-item:nth-child(10) { animation-delay: 0.36s; }

/* ── Chat: transcript ────────────────────────────────── */

#transcript {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-msg {
    line-height: 1.5;
}

.chat-label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gold);
    display: block;
    margin-bottom: 0.15rem;
}

.chat-text {
    color: var(--fg);
}

.chat-msg.interim .chat-text {
    color: var(--fg-muted);
}

.chat-msg.status-msg {
    text-align: center;
}

.chat-msg.status-msg .chat-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--fg-muted);
    font-style: italic;
}

/* ── Status indicator ────────────────────────────────── */

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fg-muted);
    display: none;
}

.status-dot.listening {
    display: block;
    background: var(--gold);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 640px) {
    #session {
        flex-direction: column;
    }

    .pane {
        flex: 1;
        min-height: 0;
    }

    .pane-divider {
        width: 100%;
        height: 1px;
    }
}
