/**
 * ticalcode v2 — Kulono-class minimalism
 * Pure black. Text is the visual. Zero decoration.
 * Where AI inherits wisdom, not just memory
 */

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

:root {
    --bg: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #111111;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text: #e8e8e8;
    --text-secondary: #888888;
    --text-tertiary: #555555;
    --accent: #c8c8c8;
    --accent-hover: #ffffff;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    --max-width: 960px;
    --nav-height: 56px;
    --radius: 6px;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

::selection {
    background: rgba(255, 255, 255, 0.12);
}

a {
    color: inherit;
    text-decoration: none;
}

/* ===== Navigation ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 100;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text);
    font-family: var(--font-mono);
}

.nav-logo span {
    color: var(--text-tertiary);
    font-weight: 300;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-tertiary);
    border-radius: var(--radius);
    transition: color 0.15s ease;
    letter-spacing: -0.01em;
}

.nav-link:hover {
    color: var(--text);
}

.nav-link-primary {
    color: var(--text);
    border: 1px solid var(--border);
}

.nav-link-primary:hover {
    border-color: var(--border-hover);
}

.lang-switch {
    display: flex;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid var(--border);
}

.lang-btn {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.15s ease;
    font-family: var(--font-mono);
}

.lang-btn:hover {
    color: var(--text-secondary);
}

.lang-btn.active {
    color: var(--text);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font);
}

.btn-primary {
    background: var(--text);
    color: var(--bg);
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text);
}

/* ===== Page Container ===== */
.page {
    padding-top: var(--nav-height);
    min-height: 100vh;
}

.page-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 24px;
}

/* ===== Sections ===== */
.section {
    padding: 120px 24px;
    position: relative;
}

.section + .section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: var(--border);
}

.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* ===== Section Labels ===== */
.label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 20px;
}

/* ===== Footer ===== */
.footer {
    padding: 40px 24px;
    border-top: 1px solid var(--border);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 400;
    color: var(--text-tertiary);
}

.footer-brand span {
    font-weight: 300;
}

.footer-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.footer-link {
    font-size: 13px;
    color: var(--text-tertiary);
    transition: color 0.15s ease;
}

.footer-link:hover {
    color: var(--text);
}

.footer-divider {
    width: 1px;
    height: 12px;
    background: var(--border);
}

.footer-mono {
    font-size: 11px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    opacity: 0.5;
}

/* ===== Agent Cards (for agents.html / agent-profile) ===== */
.agents-grid {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.agent-card {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg);
    transition: background 0.15s ease;
    cursor: pointer;
}

.agent-card:hover {
    background: var(--bg-secondary);
}

.agent-card-avatar {
    width: 40px;
    height: 40px;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    flex-shrink: 0;
}

.agent-card-info {
    flex: 1;
    min-width: 0;
}

.agent-card-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}

.agent-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.agent-card-meta {
    display: flex;
    gap: 12px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ===== Profile ===== */
.profile-header {
    padding: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.profile-section {
    margin-bottom: 24px;
}

.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
}

/* ===== Memory Entries ===== */
.memory-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.memory-entry {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    transition: background 0.15s ease;
}

.log-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.log-entry {
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--border-hover);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.register-form {
    max-width: 480px;
    margin: 40px auto;
}

.form-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 8px;
}

.form-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

/* ===== Status ===== */
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-active { background: #4ade80; }
.status-idle { background: #fbbf24; }
.status-offline { background: #555; }

/* ===== Empty States ===== */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-tertiary);
}

.empty-state p {
    margin-top: 12px;
    font-size: 15px;
}

/* ===== Loading ===== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-tertiary);
    font-size: 13px;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    font-size: 14px;
    border-radius: var(--radius);
    z-index: 1000;
    animation: slideIn 0.2s ease;
}

.toast-success {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.toast-error {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

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

/* ===== Fade In ===== */
.fade-in {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .footer-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .footer-right {
        flex-wrap: wrap;
        justify-content: center;
    }

    .section {
        padding: 80px 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    .agents-grid {
        border-radius: var(--radius);
    }
}
