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

:root {
    /* Color Palette - Monochrome & Minimalist */
    --bg-dark: #050505;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --primary: #ffffff;
    --text-main: #f8fafc;
    --text-muted: #a3a3a3;
    --border-color: rgba(255, 255, 255, 0.1);

    /* Typography */
    --font-sans: 'Outfit', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing & Layout */
    --max-width: 900px;
    /* Narrower for reading */
    --radius-md: 8px;
    --radius-lg: 12px;
    --header-height: 64px;

    /* Animations */
    --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.7;
    /* Increased line-height for readability */
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Typography Overrides */
h1,
h2,
h3,
h4 {
    letter-spacing: -0.01em;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

a:hover {
    color: #fff;
}

/* Header / Nav */
.nav-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(5, 5, 5, 0.85);
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #000;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

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

.nav-link {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-link:hover {
    color: #fff;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-base);
    border: none;
    outline: none;
}

.btn-primary {
    background: #fff;
    color: #000;
}

.btn-primary:hover {
    background: #e5e5e5;
}

/* Page Layout */
.page-content {
    padding-top: calc(var(--header-height) + 60px);
    padding-bottom: 80px;
}

.doc-section {
    margin-bottom: 80px;
}

.doc-title {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    margin-bottom: 24px;
}

.doc-lead {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 720px;
}

.doc-text {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    max-width: 720px;
}

.doc-text strong {
    color: #fff;
    font-weight: 500;
}

/* Visual / Code */
.visual-container {
    margin: 40px 0;
}

.preview-card {
    background: #0a0a0a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
}

.code-window {
    padding: 20px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.flow-arrow-row {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.arrow {
    color: #fff;
}

.syntax-key {
    color: #d4d4d8;
}

.syntax-string {
    color: #a1a1aa;
}

.syntax-num {
    color: #fff;
}

/* Lists & Grids */
.divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 60px 0;
}

.bullet-list {
    list-style: none;
    /* Custom bullets */
    padding: 0;
    display: grid;
    gap: 20px;
    max-width: 720px;
}

.bullet-list li {
    padding-left: 24px;
    position: relative;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.bullet-list li::before {
    content: "•";
    color: #fff;
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1.5rem;
    line-height: 1.5rem;
}

.bullet-list strong {
    color: #fff;
    font-weight: 600;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 32px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 32px;
}

@media (max-width: 768px) {

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.benefit-card {
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: var(--transition-base);
}

.benefit-card:hover {
    background: var(--bg-card);
    border-color: var(--border-color);
}

.benefit-card h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.benefit-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
}

.action-card {
    display: flex;
    gap: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    transition: var(--transition-base);
}

.action-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.action-card .icon {
    font-size: 1.5rem;
}

.action-card h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.action-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    text-align: center;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-text a {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Utils */
.fade-up {
    animation: fadeUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(16px);
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Flow Chart Component */
.flow-container-wrapper {
    margin: 60px 0;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 20px;
    /* Space for scrollbar if needed */
}

.flow-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-width: 600px;
    /* Ensure it doesn't squish too much */
}

.flow-node {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-main);
    font-weight: 500;
    position: relative;
    transition: var(--transition-base);
    min-width: 120px;
}

.flow-node:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: var(--bg-card-hover);
}

.flow-node.mobile-app {
    height: 140px;
    width: 100px;
    justify-content: space-between;
    padding: 16px 12px;
    border-radius: 16px;
    /* Phone-like roundness */
    border-width: 2px;
}

.phone-screen {
    width: 100%;
    height: 80%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    position: relative;
}

.phone-screen::after {
    content: "";
    position: absolute;
    top: 10px;
    left: 10px;
    right: 30%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.flow-node.mini-pill {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    min-width: auto;
}

.flow-node.context {
    border-style: dashed;
}

.flow-arrow-connector {
    color: var(--text-muted);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.flow-subtext {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .flow-container-wrapper {
        justify-content: flex-start;
    }
}