/* Marketing pages */
.hero-section {
    position: relative;
    padding: 7rem 0 5.5rem;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--hero-glow);
    pointer-events: none;
}
.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
    pointer-events: none;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 3.25rem;
    align-items: center;
}
.hero-content { position: relative; z-index: 1; }
.hero-title {
    font-size: clamp(2.4rem, 5.8vw, 3.75rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.05;
    margin: 0 0 1.25rem;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 2rem;
    max-width: 540px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2.5rem; }
.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.5rem;
    max-width: 420px;
}
.hero-stat-value { font-size: 1.45rem; font-weight: 800; color: var(--primary); letter-spacing: -0.03em; }
.hero-stat-label { font-size: 0.75rem; color: var(--text-muted); line-height: 1.35; }

/* System visual */
.system-visual {
    position: relative;
    background:
        linear-gradient(160deg, color-mix(in srgb, var(--primary-soft) 55%, transparent), transparent 45%),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    min-height: 420px;
    box-shadow: var(--shadow);
}
.system-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, transparent 60%, var(--bg) 100%);
    pointer-events: none;
}
.sys-node {
    position: absolute;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    z-index: 2;
    white-space: nowrap;
}
.sys-node:hover, .sys-node.active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}
.sys-node-detail {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-secondary);
    z-index: 3;
    min-height: 3rem;
}
.sys-lines { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.sys-lines line {
    stroke: var(--border-strong);
    stroke-width: 1.5;
    stroke-dasharray: 6 4;
    animation: flowLine 2s linear infinite;
}
@keyframes flowLine { to { stroke-dashoffset: -20; } }
@media (prefers-reduced-motion: reduce) { .sys-lines line { animation: none; } }

/* Workflow timeline */
.workflow-timeline { display: flex; gap: 0; overflow-x: auto; padding-bottom: 0.5rem; }
.workflow-step {
    flex: 1; min-width: 140px; position: relative; padding: 1.25rem 1rem;
    text-align: center; cursor: pointer; transition: var(--duration);
}
.workflow-step::after {
    content: '';
    position: absolute;
    top: 2rem; right: 0; width: 50%; height: 2px;
    background: var(--border);
}
.workflow-step:last-child::after { display: none; }
.workflow-step::before {
    content: '';
    position: absolute;
    top: 2rem; left: 0; width: 50%; height: 2px;
    background: var(--border);
}
.workflow-step:first-child::before { display: none; }
.workflow-step-num {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--surface); border: 2px solid var(--border);
    display: grid; place-items: center; margin: 0 auto 0.75rem;
    font-size: 0.75rem; font-weight: 700; position: relative; z-index: 1;
    transition: var(--duration);
}
.workflow-step.active .workflow-step-num,
.workflow-step:hover .workflow-step-num {
    border-color: var(--primary); background: var(--primary); color: #fff;
}
.workflow-step-title { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.25rem; }
.workflow-step-desc { font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; }
.workflow-detail-panel {
    margin-top: 1.5rem; padding: 1.5rem;
    border-radius: var(--radius); background: var(--surface);
    border: 1px solid var(--border); min-height: 80px;
}

/* Feature accordion */
.feature-category { margin-bottom: 2rem; }
.feature-category-title { font-size: 1.25rem; font-weight: 700; margin: 0 0 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.feature-item {
    border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 0.75rem; overflow: hidden; background: var(--surface);
}
.feature-item-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.25rem; cursor: pointer; user-select: none;
    transition: background var(--duration);
}
.feature-item-header:hover { background: var(--surface-hover); }
.feature-item-header h3 { margin: 0; font-size: 0.95rem; font-weight: 600; }
.feature-chevron { transition: transform var(--duration); color: var(--text-muted); }
.feature-item.open .feature-chevron { transform: rotate(180deg); }
.feature-item-body {
    display: none; padding: 0 1.25rem 1.25rem;
    font-size: 0.875rem; color: var(--text-secondary);
}
.feature-item.open .feature-item-body { display: block; }
.feature-meta { display: grid; gap: 0.75rem; margin-top: 0.5rem; }
.feature-meta dt { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.feature-meta dd { margin: 0.15rem 0 0; line-height: 1.55; }

/* Architecture page */
.arch-canvas {
    position: relative;
    min-height: 520px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    overflow: hidden;
}
.arch-node {
    position: absolute;
    padding: 0.75rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration);
    max-width: 160px;
    text-align: center;
    line-height: 1.3;
}
.arch-node:hover, .arch-node.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
    transform: scale(1.04);
    z-index: 10;
}
.arch-node[data-group="edge"] { border-top: 2px solid var(--info); }
.arch-node[data-group="app"] { border-top: 2px solid var(--primary); }
.arch-node[data-group="data"] { border-top: 2px solid var(--success); }
.arch-node[data-group="external"] { border-top: 2px solid var(--warning); }
.arch-node[data-group="async"] { border-top: 2px solid var(--purple, #a78bfa); }
.arch-inspector {
    padding: 1.5rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
}
.arch-inspector h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.arch-inspector p { margin: 0; color: var(--text-secondary); font-size: 0.9rem; }

/* Layer stack (how it works) */
.layer-stack { display: grid; gap: 0.5rem; max-width: 640px; margin: 0 auto; }
.layer-row {
    display: grid; grid-template-columns: 120px 1fr;
    gap: 1rem; align-items: center;
    padding: 1rem 1.25rem; border-radius: var(--radius-sm);
    background: var(--surface); border: 1px solid var(--border);
    cursor: pointer; transition: var(--duration);
}
.layer-row:hover, .layer-row.active { border-color: var(--primary); background: var(--primary-soft); }
.layer-name { font-weight: 700; font-size: 0.85rem; }
.layer-desc { font-size: 0.85rem; color: var(--text-secondary); }

/* CTA band */
.cta-band {
    padding: 4rem 0;
    text-align: center;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.cta-band h2 { margin: 0 0 0.75rem; font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.cta-band p { color: var(--text-secondary); margin: 0 0 1.5rem; }

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; }
    .system-visual { min-height: 320px; margin-top: 2rem; }
}

/* Interactive flow playground */
.flow-play {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem 1.5rem;
    outline: none;
}
.flow-play:focus-visible { box-shadow: 0 0 0 2px var(--primary-glow); }
.flow-tabs {
    display: flex; flex-wrap: wrap; gap: 0.5rem;
    margin-bottom: 1rem;
}
.flow-tab {
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.flow-tab.active, .flow-tab:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--text);
}
.flow-summary { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.55; margin: 0 0 1.25rem; }
.flow-diagram {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 0.35rem 0.25rem;
    margin-bottom: 1.25rem;
    min-height: 72px;
}
.flow-node {
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    max-width: 11rem;
    text-align: center;
    line-height: 1.3;
}
.flow-node-arrow { color: var(--text-muted); font-size: 1rem; user-select: none; }
.flow-node.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}
.flow-step-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
    padding: 1.15rem 1.25rem;
    min-height: 8.5rem;
}
.flow-step-kicker {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--primary); margin-bottom: 0.35rem;
}
.flow-step-card h3 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.flow-step-meta { margin: 0 0 0.65rem; font-size: 0.85rem; color: var(--text-secondary); }
.flow-step-meta code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: var(--code-bg);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}
.flow-step-card p:last-child { margin: 0; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.55; }
.flow-controls {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem;
    margin-top: 1rem;
}
.flow-dots { display: flex; gap: 0.4rem; flex: 1; justify-content: center; }
.flow-dot {
    width: 10px; height: 10px; border-radius: 50%;
    border: 0; background: var(--border-strong); cursor: pointer; padding: 0;
}
.flow-dot.active { background: var(--primary); }
.flow-hint { margin: 0.85rem 0 0; font-size: 0.75rem; color: var(--text-muted); }

.link-map {
    display: flex; flex-wrap: wrap; gap: 0.6rem;
    margin: 1.25rem 0 1rem;
}
.link-node {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}
.link-node.active, .link-node:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.link-inspector {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 1.25rem 1.4rem;
}
.link-inspector h3 { margin: 0 0 0.4rem; }
.link-connects { color: var(--primary); font-size: 0.85rem; font-weight: 600; }
.link-inspector p { margin: 0.35rem 0 0; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.55; }

@media (max-width: 640px) {
    .layer-row { grid-template-columns: 1fr; }
    .flow-node { max-width: none; flex: 1 1 40%; }
    .flow-node-arrow { display: none; }
}
