/* graphers.dev - Graph traversal experience */

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

/* Palette:
   Background:      #FAFBFE
   Surface:         #F0F3F9
   Text Primary:    #1A2744
   Text Body:       #2D3B52
   Text Muted:      #6B7A8D
   Node Blue:       #4A6FA5
   Edge Gray:       #94A3B8
   Accent Teal:     #2D9CDB
   Accent Orange:   #E8825C
   Code Background: #F0F3F9
*/

html {
    scroll-behavior: smooth;
}

body {
    background-color: #FAFBFE;
    color: #2D3B52;
    font-family: 'Source Serif 4', serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.75;
    overflow-x: hidden;
    position: relative;
}

/* Graph paper underlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        repeating-linear-gradient(to right, rgba(148, 163, 184, 0.04) 0px, rgba(148, 163, 184, 0.04) 1px, transparent 1px, transparent 40px),
        repeating-linear-gradient(to bottom, rgba(148, 163, 184, 0.04) 0px, rgba(148, 163, 184, 0.04) 1px, transparent 1px, transparent 40px);
}

/* Central spine line */
.spine-line {
    position: fixed;
    left: 50%;
    top: 0;
    width: 2px;
    height: 100vh;
    background-color: rgba(74, 111, 165, 0.3);
    transform: translateX(-50%);
    z-index: 1;
    pointer-events: none;
}

/* Typography */
h1, h2, h3 {
    font-family: 'IBM Plex Sans', sans-serif;
    color: #1A2744;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.hero-title {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 700;
}

.hero-subtitle {
    font-size: 16px;
    color: #6B7A8D;
    margin-top: 12px;
    font-family: 'Source Serif 4', serif;
}

.hero-notation {
    margin-top: 16px;
}

.hero-notation code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: #4A6FA5;
    background: #F0F3F9;
    padding: 4px 10px;
    border-radius: 3px;
}

.section-title {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Inline code */
.inline-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #4A6FA5;
    background: #F0F3F9;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Code block */
.code-block {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #4A6FA5;
    background: #F0F3F9;
    border-left: 2px solid #4A6FA5;
    padding: 16px;
    margin-bottom: 24px;
    border-radius: 0 4px 4px 0;
    overflow-x: auto;
    white-space: pre;
}

/* Nodes / Sections */
.node {
    position: relative;
    z-index: 2;
}

/* Node 0: Root */
.node-root {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.graph-constellation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    max-width: 800px;
    height: auto;
    z-index: 0;
    pointer-events: none;
}

.graph-edge {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.graph-edge.drawn {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 2s ease;
}

.graph-node {
    opacity: 0;
}

.graph-node.visible {
    opacity: 1;
    transition: opacity 400ms ease;
}

.node-root-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

/* Content nodes - zigzag layout */
.node-left,
.node-right {
    padding: 80px 0;
    position: relative;
    display: flex;
    align-items: flex-start;
}

.node-left {
    justify-content: flex-start;
}

.node-right {
    justify-content: flex-end;
}

.node-content {
    max-width: 440px;
    position: relative;
}

.node-left .node-content {
    margin-right: 52%;
    margin-left: 40px;
    border-right: 2px solid rgba(74, 111, 165, 0.15);
    padding-right: 24px;
}

.node-right .node-content {
    margin-left: 52%;
    margin-right: 40px;
    border-left: 2px solid rgba(74, 111, 165, 0.15);
    padding-left: 24px;
}

.node-content p {
    margin-bottom: 16px;
}

.node-content p:last-of-type {
    margin-bottom: 0;
}

/* Node connector (dot + horizontal line) */
.node-connector {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    z-index: 3;
}

.node-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #4A6FA5;
    box-shadow: 0 0 8px rgba(74, 111, 165, 0.2);
    flex-shrink: 0;
}

.connector-line {
    position: absolute;
    top: 50%;
    height: 1px;
    background-color: rgba(74, 111, 165, 0.3);
    transform: translateY(-50%);
}

.node-left .connector-line-left {
    right: 4px;
    width: calc(50vw - 52% + 24px);
    max-width: 200px;
}

.node-right .connector-line-right {
    left: 4px;
    width: calc(50vw - 52% + 24px);
    max-width: 200px;
}

/* Directed edge arrows */
.directed-arrow {
    margin-top: 24px;
}

.directed-arrow-right {
    text-align: right;
    padding-right: 8px;
}

.directed-arrow-left {
    text-align: left;
    padding-left: 8px;
}

/* Inline subgraph */
.inline-subgraph {
    display: block;
    margin: 16px 0;
}

/* Pull quote */
.pull-quote {
    border: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.pull-quote p {
    font-family: 'Source Serif 4', serif;
    font-style: italic;
    font-size: 20px;
    color: #1A2744;
    line-height: 1.6;
}

.pull-quote-attribution {
    font-size: 14px;
    color: #6B7A8D;
    font-style: italic;
}

/* Node 5: Sink */
.node-sink {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
}

.sink-node-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #4A6FA5;
    box-shadow: 0 0 10px rgba(74, 111, 165, 0.25);
    margin-bottom: 24px;
}

.sink-line {
    width: 120px;
    height: 1px;
    background-color: rgba(148, 163, 184, 0.2);
    margin-bottom: 24px;
}

.sink-domain {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: #6B7A8D;
}

/* Fade reveal */
.fade-reveal {
    opacity: 0;
    transition: opacity 600ms ease;
}

.fade-reveal.revealed {
    opacity: 1;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .spine-line {
        left: 8px;
        transform: none;
    }

    .node-left .node-content,
    .node-right .node-content {
        margin-left: 32px;
        margin-right: 24px;
        border-left: 2px solid rgba(74, 111, 165, 0.15);
        border-right: none;
        padding-left: 20px;
        padding-right: 0;
        max-width: none;
    }

    .node-left,
    .node-right {
        justify-content: flex-start;
    }

    .node-connector {
        left: 8px;
        transform: none;
    }

    .connector-line {
        display: none;
    }

    .graph-constellation {
        width: 90%;
    }

    .hero-title {
        font-size: clamp(28px, 8vw, 44px);
    }

    .node-left .node-content,
    .node-right .node-content {
        margin-left: 32px;
    }

    .code-block {
        font-size: 12px;
    }
}
