/* ═══ Reset & Base — matching Rune Dashboard theme ═══ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-main: #FAFAFA;
    --bg-white: #FFFFFF;
    --text-main: #171717;
    --text-muted: #737373;
    --text-dimmer: #A3A3A3;
    --border: #E5E5E5;
    --border-hover: #D4D4D4;
    --primary: #18181B;
    --primary-hover: #3F3F46;
    --danger: #18181B;
    --success: #18181B;
    --accent: #18181B;
    --radius: 8px;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.08);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: ui-monospace, Menlo, Monaco, Consolas, monospace;
    --max-width: 1060px;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    background: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

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

code {
    font-family: var(--mono);
    font-size: 0.8125rem;
    background: #F4F4F5;
    padding: 1px 5px;
    border-radius: 4px;
}

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

/* ═══ Nav ═══ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transition: all 0.2s;
}

.nav.scrolled {
    box-shadow: var(--shadow);
}

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

.nav-logo {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 22px;
    height: 22px;
}

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

.nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.15s;
}

.nav-links a:hover {
    color: var(--text-main);
}

.nav-github {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    transition: color 0.15s;
}

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

/* ═══ Hero ═══ */
.hero {
    position: relative;
    padding: 140px 24px 80px;
    text-align: center;
    background: linear-gradient(180deg, #FFFFFF 0%, var(--bg-main) 100%);
    border-bottom: 1px solid var(--border);
}

.hero-glow,
.hero-grid {
    display: none;
}

.hero-content {
    max-width: 680px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    padding: 5px 14px;
    background: #F4F4F5;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 24px;
    letter-spacing: 0.02em;
}

.hero-title {
    font-size: clamp(2.2rem, 5.5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--primary);
    margin-bottom: 18px;
}

.gradient-text {
    color: var(--primary);
    /* No gradient on light theme — stays solid */
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

/* Terminal */
.hero-terminal {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-align: left;
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #FAFAFA;
    border-bottom: 1px solid var(--border);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-dot.red {
    background: #A3A3A3;
    opacity: 0.6;
}

.terminal-dot.yellow {
    background: #737373;
    opacity: 0.6;
}

.terminal-dot.green {
    background: #525252;
    opacity: 0.6;
}

.terminal-title {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-dimmer);
    font-family: var(--mono);
}

.terminal-code {
    padding: 20px 24px;
    font-family: var(--mono);
    font-size: 0.8rem;
    line-height: 1.8;
    overflow-x: auto;
    color: var(--text-main);
}

.terminal-code .kw {
    color: #18181B;
    font-weight: 600;
}

.terminal-code .str {
    color: #525252;
}

.terminal-code .fn {
    color: #171717;
}

.terminal-code .var {
    color: #404040;
}

.terminal-code .cmt {
    color: var(--text-dimmer);
    font-style: italic;
}

/* Hero CTA */
.hero-cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 44px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font);
    transition: all 0.15s;
    cursor: pointer;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

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

.btn-outline {
    background: var(--bg-white);
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--bg-main);
    border-color: var(--border-hover);
}

.btn-large {
    padding: 14px 32px;
    font-size: 0.9375rem;
    height: 48px;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-dimmer);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

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

/* ═══ Features ═══ */
.features {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #F4F4F5;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}

.section-header h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--primary);
}

.section-desc {
    color: var(--text-muted);
    margin-top: 10px;
    font-size: 1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.feature-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    transition: all 0.15s;
    box-shadow: var(--shadow);
}

.feature-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: #F4F4F5;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.feature-icon svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.feature-card h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.feature-card p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ═══ How It Works ═══ */
.how-it-works {
    padding: 100px 0;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.graph-demo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.graph-container {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.graph-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 14px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 80px;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.graph-node.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08);
}

.node-emoji {
    font-size: 1.3rem;
}

.node-label {
    font-size: 0.6rem;
    font-family: var(--mono);
    color: var(--text-muted);
    white-space: nowrap;
}

.graph-edge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0 4px;
}

.edge-line {
    width: 28px;
    height: 2px;
    background: var(--border-hover);
    border-radius: 2px;
    position: relative;
}

.edge-line::after {
    content: '▸';
    position: absolute;
    right: -8px;
    top: -9px;
    color: var(--text-dimmer);
    font-size: 0.8rem;
}

.edge-label {
    font-size: 0.55rem;
    color: var(--text-dimmer);
    font-family: var(--mono);
}

.graph-result {
    margin-left: 12px;
}

.result-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--mono);
}

.result-badge.allow {
    background: #F4F4F5;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.graph-explanation {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.explanation-card {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}

.explanation-card h4 {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dimmer);
    font-weight: 500;
    margin-bottom: 6px;
}

.explanation-card p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.explanation-card .mono {
    font-family: var(--mono);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    background: none;
    padding: 0;
}

.allow-text {
    color: var(--text-main);
    font-weight: 700;
}

.mini-code {
    font-family: var(--mono);
    font-size: 0.7rem;
    line-height: 1.6;
    color: var(--text-muted);
    overflow-x: auto;
    background: var(--bg-white);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* ═══ Relations ═══ */
.relations {
    padding: 100px 0;
}

.table-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

.relations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.relations-table th,
.relations-table td {
    padding: 12px 20px;
    text-align: center;
    border-bottom: 1px solid #F4F4F5;
}

.relations-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 500;
    background: #FAFAFA;
    border-bottom: 1px solid var(--border);
}

.relations-table td:first-child {
    text-align: left;
}

.relations-table code {
    padding: 2px 8px;
    background: #F4F4F5;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-main);
    font-weight: 500;
}

.relations-table .yes {
    color: var(--success);
    font-weight: 600;
}

.relations-table .no {
    color: var(--danger);
    opacity: 0.4;
}

.relations-table .traverse {
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 0.85rem;
}

.table-note {
    margin-top: 14px;
    font-size: 0.78rem;
    color: var(--text-dimmer);
    text-align: center;
}

/* ═══ Quickstart ═══ */
.quickstart {
    padding: 100px 0;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.steps {
    max-width: 620px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    margin-top: 2px;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.step-code {
    background: #FAFAFA;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.7;
    overflow-x: auto;
    color: var(--text-main);
}

.step-code .kw {
    color: #18181B;
    font-weight: 600;
}

.step-code .str {
    color: #525252;
}

.step-code .fn {
    color: #171717;
}

.step-code .var {
    color: #404040;
}

.step-code .cmt {
    color: var(--text-dimmer);
    font-style: italic;
}

/* ═══ CTA ═══ */
.cta-section {
    padding: 100px 0;
    text-align: center;
    position: relative;
}

.cta-glow {
    display: none;
}

.cta-section h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.25rem);
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary);
}

.cta-section p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 32px;
}

.cta-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ═══ Footer ═══ */
.footer {
    padding: 48px 24px 32px;
    border-top: 1px solid var(--border);
    background: var(--bg-white);
}

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

.footer-brand {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
    color: var(--primary);
}

.footer-tagline {
    font-weight: 400;
    font-size: 0.8125rem;
    color: var(--text-dimmer);
    margin-left: 8px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 36px;
}

.footer-col h4 {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dimmer);
    font-weight: 500;
    margin-bottom: 10px;
}

.footer-col a {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    transition: color 0.15s;
}

.footer-col a:hover {
    color: var(--text-main);
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-dimmer);
}

/* ═══ Responsive ═══ */
@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .graph-demo {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .nav-links a:not(.nav-github) {
        display: none;
    }

    .hero {
        padding: 120px 16px 60px;
    }

    .hero-stats {
        gap: 16px;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .hero-terminal {
        margin-left: -8px;
        margin-right: -8px;
    }

    .graph-container {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding-bottom: 12px;
    }

    .features,
    .relations,
    .quickstart,
    .how-it-works,
    .cta-section {
        padding: 60px 0;
    }

    .section-header {
        margin-bottom: 32px;
    }
}

/* ═══ Animations ═══ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

.hero-badge,
.hero-title,
.hero-subtitle,
.hero-terminal,
.hero-cta,
.hero-stats {
    animation: fadeInUp 0.5s ease-out both;
}

.hero-title {
    animation-delay: 0.05s;
}

.hero-subtitle {
    animation-delay: 0.1s;
}

.hero-terminal {
    animation-delay: 0.15s;
}

.hero-cta {
    animation-delay: 0.2s;
}

.hero-stats {
    animation-delay: 0.25s;
}