/* ============================================================
   AI Persona Lab Community
   Google Antigravity-inspired — exact same base as front-beauty
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #000000;
    --color-secondary: #ffffff;
    --color-text: #000000;
    --color-text-secondary: #5f6368;
    --color-text-muted: #9aa0a6;
    --color-border: #e0e0e0;
    --color-border-light: #f0f0f0;
    --color-accent: #1a73e8;
    --color-accent-bg: rgba(26, 115, 232, 0.06);
    --color-warn: #ea8600;
    --color-warn-bg: rgba(234, 134, 0, 0.06);
    --font-sans: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --max-width: 860px;
    --radius: 16px;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-secondary);
    color: var(--color-text);
    line-height: 1.6;
}

/* ========== Custom Scrollbars ========== */

/* Webkit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.32);
}

/* Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}

/* ========== Particle Canvas ========== */

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ========== Navigation — identical to front-beauty ========== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    width: 24px;
    height: 24px;
    color: var(--color-primary);
}

.nav-center {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
    padding: 0.5rem 0;
}

.nav-link:hover {
    opacity: 0.6;
}

.nav-link.active {
    opacity: 0.6;
}

.nav-cta {
    background-color: var(--color-primary);
    color: var(--color-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 24px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--color-text);
}

.nav-toggle svg {
    width: 24px;
    height: 24px;
}

/* ========== Hero Section — identical to front-beauty ========== */

.hero-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 2rem;
    z-index: 10;
}

.hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    background: rgba(0, 0, 0, 0.04);
    padding: 6px 18px;
    border-radius: 20px;
    margin-bottom: 28px;
    letter-spacing: 0.02em;
}

.hero-badge a {
    color: var(--color-accent);
    text-decoration: none;
}

.hero-badge a:hover {
    text-decoration: underline;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 450;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--color-text);
    word-spacing: 0.05em;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

/* ========== Buttons — identical to front-beauty ========== */

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    font-family: var(--font-sans);
    border: none;
    border-radius: 28px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-secondary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text);
    border: 1.5px solid var(--color-text);
}

.btn-secondary:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.btn-secondary:active {
    background-color: rgba(0, 0, 0, 0.1);
}

/* ========== Landing Content (below hero) ========== */

.landing-content {
    position: relative;
    z-index: 10;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem 100px;
}

.landing-content h2 {
    font-size: 1.8rem;
    font-weight: 450;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    color: var(--color-text);
}

.landing-content p {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.landing-content a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s;
}

.landing-content a:hover {
    text-decoration: underline;
}

.landing-content ul {
    margin-bottom: 16px;
    padding-left: 24px;
}

.landing-content li {
    margin-bottom: 8px;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.section-divider {
    height: 1px;
    background: var(--color-border);
    margin: 56px 0;
}

/* ========== Cards ========== */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 32px 0;
}

.card {
    background: var(--color-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 32px 28px;
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.3s ease;
    display: block;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

.card-icon {
    font-size: 1.6rem;
    margin-bottom: 14px;
    display: block;
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.card p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* ========== Content Pages ========== */

.page-container {
    position: relative;
    z-index: 10;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 112px 32px 100px;
}

/* ========== Sidebar Layout ========== */

.page-with-sidebar {
    position: relative;
    z-index: 10;
    max-width: 1140px;
    margin: 0 auto;
    padding: 112px 32px 100px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0 40px;
}

.sidebar-nav {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    align-self: start;
    padding: 16px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.sidebar-nav .toc-title {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    padding: 0 12px;
    margin-bottom: 12px;
}

.sidebar-nav .toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav .toc-item {
    margin: 0;
}

.sidebar-nav .toc-link {
    display: block;
    padding: 6px 12px;
    font-size: 0.82rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s ease;
    line-height: 1.4;
    border-left: 2px solid transparent;
}

.sidebar-nav .toc-link:hover {
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.03);
}

.sidebar-nav .toc-link.active {
    color: var(--color-accent);
    background: var(--color-accent-bg);
    border-left-color: var(--color-accent);
    font-weight: 500;
}

.sidebar-nav .toc-link.toc-h3 {
    padding-left: 24px;
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.sidebar-nav .toc-link.toc-h3:hover {
    color: var(--color-text-secondary);
}

.sidebar-nav .toc-link.toc-h3.active {
    color: var(--color-accent);
    background: var(--color-accent-bg);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--color-accent);
}

.breadcrumb .sep {
    font-size: 0.7rem;
}

/* ========== Content Typography ========== */

.content {
    animation: contentFadeIn 0.6s ease-out both;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content h1 {
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 450;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
    line-height: 1.2;
    color: var(--color-text);
}

.content h2 {
    font-size: 1.5rem;
    font-weight: 450;
    margin-top: 56px;
    margin-bottom: 16px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
    letter-spacing: -0.01em;
    color: var(--color-text);
}

.content h2:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 32px;
}

.content h3 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-top: 36px;
    margin-bottom: 12px;
    color: var(--color-text);
}

.content h4 {
    font-size: 1.05rem;
    font-weight: 500;
    margin-top: 28px;
    margin-bottom: 10px;
    color: var(--color-text);
}

.content p {
    margin-bottom: 16px;
    color: var(--color-text);
    line-height: 1.75;
}

.content a {
    color: var(--color-accent);
    text-decoration: none;
    transition: all 0.2s;
}

.content a:hover {
    text-decoration: underline;
}

.content ul, .content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.content li {
    margin-bottom: 8px;
    line-height: 1.75;
}

.content li::marker {
    color: var(--color-text-muted);
}

.content strong {
    font-weight: 600;
    color: var(--color-text);
}

.content em {
    font-style: italic;
    color: var(--color-text-secondary);
}

.content blockquote {
    border-left: 3px solid var(--color-accent);
    background: var(--color-accent-bg);
    padding: 16px 24px;
    margin: 24px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

.content blockquote p:last-child {
    margin-bottom: 0;
}

.content pre {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 20px 24px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 24px 0;
    font-size: 0.88rem;
    line-height: 1.6;
}

.content code {
    background: rgba(0, 0, 0, 0.06);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.88em;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: inherit;
}

.content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 16px 0;
    border: 1px solid var(--color-border);
}

/* ========== Tables ========== */

.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.92rem;
    background: var(--color-secondary);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.content thead th {
    background: rgba(0, 0, 0, 0.03);
    font-weight: 500;
    text-align: left;
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.82rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.content tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: top;
}

.content tbody tr:last-child td {
    border-bottom: none;
}

.content tbody tr {
    transition: background 0.15s ease;
}

.content tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* ========== Details/Summary ========== */

.content details {
    background: var(--color-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px 24px;
    margin: 20px 0;
    transition: box-shadow 0.2s ease;
}

.content details:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.content details summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--color-accent);
    user-select: none;
}

.content details[open] summary {
    margin-bottom: 14px;
}

/* ========== Callout Boxes ========== */

.callout {
    border-left: 3px solid var(--color-warn);
    background: var(--color-warn-bg);
    padding: 18px 24px;
    margin: 24px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.callout-title {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--color-warn);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========== Instructions Link Grid ========== */

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin: 32px 0;
}

.link-grid a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 26px;
    background: var(--color-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.95rem;
    font-weight: 450;
    transition: all 0.3s ease;
}

.link-grid a:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

.link-grid .icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* ========== Mermaid Diagram ========== */

.mermaid-container {
    background: linear-gradient(135deg, rgba(26, 115, 232, 0.03) 0%, rgba(142, 68, 173, 0.03) 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 48px 32px;
    margin: 32px 0;
    overflow-x: auto;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.mermaid-container::-webkit-scrollbar {
    height: 6px;
}

.mermaid-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

.mermaid-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

.mermaid-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1a73e8, #8e44ad, #ff6b6b, #ffc900);
    border-radius: var(--radius) var(--radius) 0 0;
    opacity: 0.7;
}

.mermaid {
    display: flex;
    justify-content: center;
}

/* Mermaid SVG overrides */
.mermaid .node rect,
.mermaid .node polygon {
    rx: 12 !important;
    ry: 12 !important;
    stroke-width: 1.5px !important;
}

.mermaid .edgeLabel {
    font-size: 0.8rem;
}

.mermaid .label {
    font-family: var(--font-sans) !important;
}

.mermaid .flowchart-link {
    stroke-width: 1.5px !important;
}

/* ========== Footer ========== */

.footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 40px 24px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--color-border);
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--color-text);
}

/* ========== Responsive ========== */

@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
    }

    .nav-center {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 16px 24px;
        border-bottom: 1px solid var(--color-border);
        gap: 4px;
    }

    .nav-center.open {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .hero-title {
        font-size: clamp(1.75rem, 6vw, 3.5rem);
        margin-bottom: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .content h1 {
        font-size: 1.75rem;
    }

    .content h2 {
        font-size: 1.25rem;
    }

    .cta-buttons {
        gap: 1rem;
    }

    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .page-container {
        padding: 96px 16px 60px;
    }

    .page-with-sidebar {
        display: block;
        padding: 96px 16px 60px;
    }

    .sidebar-nav {
        display: none;
    }

    .landing-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .content table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0.75rem 0;
    }

    .logo {
        font-size: 1rem;
    }

    .nav-cta {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }

    .hero-section {
        padding: 5rem 1rem 1rem;
        min-height: auto;
    }

    .hero-title {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
        margin-bottom: 1rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .link-grid {
        grid-template-columns: 1fr;
    }
}

/* Toast notification for disabled links */
.nav-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 9999;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s;
    pointer-events: none;
    white-space: nowrap;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}
