/* =====================================================================
   graphers.dev — isometric technical docs
   Palette:
     #0d1b2a Blueprint Midnight
     #f8f9fb Graph Paper White
     #00d4aa Node Cyan
     #ff6b35 Edge Orange
     #7b5ea7 Vertex Purple
     #1b3a5c Grid Line Blue
     #6b7b8d Label Gray
   Type: Space Grotesk / IBM Plex Sans / JetBrains Mono
   ===================================================================== */

:root {
    --c-midnight: #0d1b2a;
    --c-paper: #f8f9fb;
    --c-cyan: #00d4aa;
    --c-orange: #ff6b35;
    --c-purple: #7b5ea7;
    --c-grid: #1b3a5c;
    --c-label: #6b7b8d;

    --f-display: 'Space Grotesk', system-ui, sans-serif;
    --f-body: 'IBM Plex Sans', system-ui, sans-serif;
    --f-mono: 'JetBrains Mono', ui-monospace, monospace;

    --nav-h: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
    background: var(--c-midnight);
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

body {
    font-family: var(--f-body);
    font-size: 16px;
    line-height: 1.75;
    color: var(--c-paper);
    background: var(--c-midnight);
    overflow-x: hidden;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }

/* =================== Blueprint grid background =================== */
.blueprint-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(to right, rgba(27, 58, 92, 0.20) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(27, 58, 92, 0.20) 1px, transparent 1px),
        linear-gradient(to right, rgba(27, 58, 92, 0.10) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(27, 58, 92, 0.10) 1px, transparent 1px);
    background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
    opacity: 0;
    transition: opacity 600ms ease-out;
}
.blueprint-grid.is-revealed { opacity: 1; }

/* =================== Top navigation =================== */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    z-index: 100;
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    background: rgba(13, 27, 42, 0.62);
    border-bottom: 1px solid rgba(27, 58, 92, 0.5);
}
.topbar-inner {
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    padding: 0 28px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}

.logotype {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--f-mono);
    font-size: 14px;
    font-weight: 500;
    color: var(--c-paper);
    letter-spacing: -0.01em;
}
.logo-mark {
    width: 16px; height: 16px;
    background: var(--c-cyan);
    transform: rotate(45deg);
    box-shadow: 0 0 0 1px var(--c-cyan), 0 0 12px rgba(0, 212, 170, 0.6);
}
.logo-text { white-space: nowrap; }
.logo-cursor {
    color: var(--c-cyan);
    margin-left: -2px;
    animation: blink 1.05s steps(2, end) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.nav-links {
    display: flex;
    gap: 28px;
    justify-content: center;
    font-family: var(--f-mono);
    font-size: 13px;
    color: var(--c-label);
}
.nav-links a {
    transition: color 200ms ease;
    position: relative;
}
.nav-links a:hover { color: var(--c-cyan); }
.nav-links a:hover::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -6px;
    height: 1px;
    background: var(--c-cyan);
}

.github-link {
    justify-self: end;
    color: var(--c-label);
    display: inline-flex;
    align-items: center;
    transition: color 200ms ease;
}
.github-link:hover { color: var(--c-cyan); }

/* =================== Hero =================== */
.hero {
    position: relative;
    min-height: 100vh;
    padding: calc(var(--nav-h) + 40px) 32px 80px;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    gap: 60px;
    max-width: 1500px;
    margin: 0 auto;
    z-index: 1;
}

.hero-stage {
    position: relative;
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 640px;
    justify-self: center;
    order: 2;
}

.iso-plane {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    perspective: 1400px;
}

.edges-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}
.edges-svg .edge {
    fill: none;
    stroke: var(--c-cyan);
    stroke-width: 1.5;
    stroke-dasharray: 6 4;
    opacity: 0;
    stroke-linecap: round;
}
.edges-svg .edge.is-drawn {
    opacity: 0.55;
    animation: edgeFlow 18s linear infinite;
}
@keyframes edgeFlow { to { stroke-dashoffset: -200; } }

.iso-nodes {
    position: absolute;
    inset: 0;
}
.iso-node {
    position: absolute;
    width: 56px; height: 56px;
    transform: translate(-50%, -50%) rotateX(55deg) rotateZ(45deg) scale(0.4);
    transform-style: preserve-3d;
    opacity: 0;
    transition: transform 800ms cubic-bezier(.22, 1.2, .3, 1), opacity 600ms ease-out;
}
.iso-node.is-landed {
    transform: translate(-50%, -50%) rotateX(55deg) rotateZ(45deg) scale(1);
    opacity: 1;
}
.iso-node:hover {
    transform: translate(-50%, calc(-50% - 8px)) rotateX(55deg) rotateZ(45deg) scale(1.04);
}
.node-top, .node-side-left, .node-side-right {
    position: absolute;
    inset: 0;
}
.node-top {
    background: var(--c-cyan);
    border: 1px solid #0d1b2a;
    box-shadow: 0 0 12px rgba(0, 212, 170, 0.4);
}
.iso-node::before, .iso-node::after {
    content: '';
    position: absolute;
    width: 56px; height: 16px;
    background: var(--c-grid);
    border: 1px solid #0d1b2a;
}
.iso-node::before {
    bottom: -16px; left: 0;
    transform-origin: top left;
    transform: skewX(-45deg);
    background: linear-gradient(180deg, #1b3a5c 0%, #0d1b2a 100%);
}
.iso-node::after {
    top: 0; right: -16px;
    width: 16px; height: 56px;
    transform-origin: top left;
    transform: skewY(-45deg);
    background: linear-gradient(90deg, #244a72 0%, #0d1b2a 100%);
}
.iso-node.node-orange .node-top { background: var(--c-orange); box-shadow: 0 0 14px rgba(255, 107, 53, 0.45); }
.iso-node.node-purple .node-top { background: var(--c-purple); box-shadow: 0 0 14px rgba(123, 94, 167, 0.45); }

.hero-content {
    position: relative;
    order: 1;
    max-width: 580px;
    z-index: 2;
}
.hero-tag {
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--c-cyan);
    letter-spacing: 0.04em;
    margin-bottom: 22px;
    opacity: 0;
    transform: translateY(8px);
    animation: fadeUp 800ms 1500ms forwards ease-out;
}
.hero-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(2.4rem, 5.4vw, 4.6rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
    color: var(--c-paper);
    margin-bottom: 28px;
}
.hero-title span { display: inline-block; }
.accent-cyan { color: var(--c-cyan); }
.accent-orange { color: var(--c-orange); }
.accent-purple { color: var(--c-purple); }

.hero-sub {
    font-size: 17px;
    color: #c5cdd6;
    line-height: 1.65;
    max-width: 520px;
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(8px);
    animation: fadeUp 800ms 1700ms forwards ease-out;
}
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(8px);
    animation: fadeUp 800ms 1900ms forwards ease-out;
}
.btn-primary, .btn-ghost {
    font-family: var(--f-mono);
    font-size: 13px;
    padding: 14px 22px;
    display: inline-flex;
    align-items: center;
    transition: all 200ms ease;
    border: 1px solid transparent;
}
.btn-primary {
    background: var(--c-cyan);
    color: var(--c-midnight);
    font-weight: 500;
    border-color: var(--c-cyan);
}
.btn-primary:hover {
    background: transparent;
    color: var(--c-cyan);
    box-shadow: 0 0 0 2px var(--c-cyan), 0 6px 24px rgba(0, 212, 170, 0.25);
    transform: translateY(-2px);
}
.btn-ghost {
    color: var(--c-paper);
    border-color: var(--c-grid);
}
.btn-ghost:hover {
    border-color: var(--c-cyan);
    color: var(--c-cyan);
    transform: translateY(-2px);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--c-label);
    opacity: 0;
    animation: fadeUp 800ms 2100ms forwards ease-out;
}
.meta-item b { color: var(--c-paper); font-weight: 500; }
.meta-divider { width: 1px; height: 12px; background: var(--c-grid); }

.scroll-indicator {
    position: absolute;
    left: 32px;
    bottom: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--c-label);
    opacity: 0;
    animation: fadeUp 800ms 2300ms forwards ease-out;
}
.scroll-line {
    width: 60px; height: 1px;
    background: linear-gradient(to right, var(--c-cyan), transparent);
    animation: scrollPulse 2.4s ease-in-out infinite;
}
@keyframes scrollPulse {
    0%, 100% { transform: scaleX(0.4); transform-origin: left; opacity: 0.3; }
    50% { transform: scaleX(1); opacity: 1; }
}

/* =================== Sections / clip-path =================== */
.section {
    position: relative;
    padding: 120px 32px;
    z-index: 1;
}
.section-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.section-light {
    background: var(--c-paper);
    color: var(--c-midnight);
}
.section-light .blueprint-grid-overlay { display: none; }

.section-dark {
    background: var(--c-midnight);
    color: var(--c-paper);
}

/* Diagonal section dividers (3 deg) — alternating */
.section-clip-down {
    clip-path: polygon(0 3%, 100% 0, 100% 100%, 0 97%);
    margin-top: -3vw;
    padding-top: calc(120px + 3vw);
    padding-bottom: calc(120px + 3vw);
}
.section-clip-up {
    clip-path: polygon(0 0, 100% 3%, 100% 97%, 0 100%);
    margin-top: -3vw;
    padding-top: calc(120px + 3vw);
    padding-bottom: calc(120px + 3vw);
}
.section-clip-down-rev {
    clip-path: polygon(0 0, 100% 3%, 100% 100%, 0 97%);
    margin-top: -3vw;
    padding-top: calc(120px + 3vw);
    padding-bottom: calc(120px + 3vw);
}
.section-clip-up-rev {
    clip-path: polygon(0 3%, 100% 0, 100% 97%, 0 100%);
    margin-top: -3vw;
    padding-top: calc(120px + 3vw);
    padding-bottom: calc(120px + 3vw);
}

/* Section headers */
.section-header {
    margin-bottom: 64px;
    max-width: 760px;
}
.section-num {
    font-family: var(--f-mono);
    font-size: 13px;
    letter-spacing: 0.06em;
    color: var(--c-label);
    display: block;
    margin-bottom: 16px;
}
.section-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(2rem, 4.4vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 18px;
}
.section-light .section-title { color: var(--c-midnight); }
.section-dark .section-title { color: var(--c-paper); }
.section-lede {
    font-size: 18px;
    line-height: 1.65;
    color: var(--c-label);
    max-width: 620px;
}
.section-dark .section-lede { color: #a8b2bd; }

/* =================== Bento boxes =================== */
.bento {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2px;
    background: var(--c-grid);
    border: 1px solid var(--c-grid);
}

.box {
    background: var(--c-paper);
    padding: 32px;
    grid-column: span 4;
    position: relative;
    transition: transform 220ms ease, box-shadow 220ms ease;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    min-height: 220px;
    opacity: 0;
    transform: translateY(24px);
}
.box.is-revealed { opacity: 1; transform: translateY(0); transition: opacity 600ms ease, transform 600ms ease, border-color 200ms ease; }
.box:hover {
    transform: translateY(-2px);
    border-color: var(--c-cyan);
    box-shadow: 0 0 0 1px var(--c-cyan), 0 14px 40px rgba(0, 212, 170, 0.10);
    z-index: 2;
}
.box-dark { background: var(--c-midnight); color: var(--c-paper); }
.box-dark:hover { box-shadow: 0 0 0 1px var(--c-cyan), 0 14px 40px rgba(0, 212, 170, 0.18); }

.box-span-2 { grid-column: span 8; }
.box-tall { min-height: 360px; }

.box-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 12px;
}
.box-label {
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--c-label);
    letter-spacing: 0.04em;
}
.box-tag {
    font-family: var(--f-mono);
    font-size: 11px;
    padding: 3px 9px;
    background: rgba(13, 27, 42, 0.06);
    border: 1px solid var(--c-grid);
    color: var(--c-grid);
    border-radius: 3px;
}
.box-dark .box-tag {
    background: rgba(0, 212, 170, 0.1);
    color: var(--c-cyan);
    border-color: rgba(0, 212, 170, 0.3);
}
.tag-orange { color: var(--c-orange) !important; border-color: var(--c-orange) !important; background: rgba(255, 107, 53, 0.08) !important; }
.tag-cyan { color: var(--c-cyan) !important; border-color: var(--c-cyan) !important; }
.tag-purple { color: var(--c-purple) !important; border-color: var(--c-purple) !important; background: rgba(123, 94, 167, 0.1) !important; }

.box-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 24px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    color: inherit;
}
.box-feature .box-title { font-size: 30px; }
.box-body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--c-label);
}
.box-dark .box-body { color: #a8b2bd; }
.box-list {
    margin-top: 6px;
    font-family: var(--f-mono);
    font-size: 13px;
    color: var(--c-grid);
}
.box-list li {
    padding: 6px 0;
    border-bottom: 1px dashed rgba(27, 58, 92, 0.25);
}
.box-list li:last-child { border-bottom: none; }

.code-block {
    font-family: var(--f-mono);
    font-size: 13px;
    line-height: 1.7;
    background: rgba(13, 27, 42, 0.06);
    border-left: 2px solid var(--c-cyan);
    color: var(--c-midnight);
    padding: 14px 16px;
    margin-top: 16px;
    overflow-x: auto;
    border-radius: 0 3px 3px 0;
    white-space: pre;
}
.box-dark .code-block {
    background: rgba(0, 212, 170, 0.06);
    color: var(--c-paper);
}
.cd-k { color: var(--c-purple); font-weight: 500; }
.cd-fn { color: var(--c-cyan); }
.cd-s { color: var(--c-orange); }
.cd-n { color: var(--c-orange); }
.cd-p { color: var(--c-grid); }
.box-dark .cd-p { color: #a8b2bd; }
.cd-c { color: var(--c-label); font-style: italic; }

.box-graph-demo {
    margin-top: auto;
    padding-top: 16px;
    height: 140px;
    position: relative;
}
.box-demo-large { height: 260px; }
.box-demo-wide { height: 180px; }
.box-graph-demo svg { width: 100%; height: 100%; display: block; }

.box-stat { justify-content: center; align-items: flex-start; }
.stat-num {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 56px;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--c-cyan);
    margin-bottom: 10px;
}
.stat-label {
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--c-label);
    line-height: 1.5;
}

.box-quote { background: var(--c-midnight); color: var(--c-paper); }
.box-quote .box-title { display: none; }
.quote-text {
    font-family: var(--f-display);
    font-size: 22px;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: -0.01em;
    margin-bottom: 18px;
    color: var(--c-paper);
}
.quote-text::before {
    content: '“';
    color: var(--c-cyan);
    margin-right: 4px;
    font-size: 28px;
}
.quote-cite {
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--c-label);
}

/* Demo svg styling */
.demo-edge { stroke: var(--c-grid); stroke-width: 1.4; opacity: 0.6; }
.box-dark .demo-edge { stroke: var(--c-cyan); opacity: 0.45; }
.demo-edge.hot { stroke: var(--c-orange); opacity: 0.9; }
.demo-node { cursor: grab; transition: r 200ms ease, fill 200ms ease; }
.demo-node:active { cursor: grabbing; }
.demo-node.n-cyan { fill: var(--c-cyan); }
.demo-node.n-orange { fill: var(--c-orange); }
.demo-node.n-purple { fill: var(--c-purple); }
.demo-node.n-grid { fill: var(--c-grid); }

/* =================== Docs bento =================== */
.bento-docs .box-doc {
    background: var(--c-paper);
    padding: 28px;
    min-height: 200px;
    grid-column: span 4;
}
.doc-chapter {
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--c-purple);
    display: block;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}
.doc-link {
    margin-top: auto;
    padding-top: 14px;
    font-family: var(--f-mono);
    font-size: 13px;
    color: var(--c-cyan);
    transition: color 200ms ease, transform 200ms ease;
    display: inline-block;
}
.doc-link:hover { color: var(--c-orange); transform: translateX(4px); }

/* =================== Principles =================== */
.principles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 56px 80px;
    max-width: 1200px;
}
.principle {
    position: relative;
    padding-left: 76px;
    opacity: 0;
    transform: translateY(20px);
}
.principle.is-revealed { opacity: 1; transform: translateY(0); transition: opacity 700ms ease, transform 700ms ease; }
.principle-num {
    position: absolute;
    left: 0; top: -8px;
    font-family: var(--f-mono);
    font-size: 13px;
    color: var(--c-cyan);
    padding: 2px 8px;
    border: 1px solid var(--c-cyan);
}
.principle h4 {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin-bottom: 12px;
    color: var(--c-paper);
}
.principle p {
    font-size: 15px;
    line-height: 1.7;
    color: #a8b2bd;
}

/* =================== Footer =================== */
.footer {
    position: relative;
    background: var(--c-midnight);
    padding: 100px 32px 30px;
    border-top: 1px solid var(--c-grid);
    overflow: hidden;
}
.footer-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(27, 58, 92, 0.4) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(27, 58, 92, 0.4) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: perspective(800px) rotateX(60deg) scale(1.4);
    transform-origin: center top;
    opacity: 0.6;
    mask-image: linear-gradient(to bottom, var(--c-midnight) 0%, transparent 80%);
    -webkit-mask-image: linear-gradient(to bottom, var(--c-midnight) 0%, transparent 80%);
}
.footer-inner {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 2fr;
    gap: 80px;
    z-index: 1;
}
.footer-brand { display: flex; flex-direction: column; gap: 16px; }
.footer-brand .logo-mark { width: 18px; height: 18px; }
.footer-logo {
    font-family: var(--f-mono);
    font-size: 15px;
    font-weight: 500;
    color: var(--c-paper);
}
.footer-tag {
    font-size: 14px;
    color: var(--c-label);
    line-height: 1.6;
    max-width: 320px;
}
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.footer-col h5 {
    font-family: var(--f-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--c-cyan);
    margin-bottom: 14px;
}
.footer-col a {
    display: block;
    font-family: var(--f-body);
    font-size: 14px;
    color: var(--c-label);
    padding: 5px 0;
    transition: color 180ms ease, transform 180ms ease;
}
.footer-col a:hover {
    color: var(--c-paper);
    transform: translateX(4px);
}

.footer-bottom {
    position: relative;
    max-width: 1400px;
    margin: 80px auto 0;
    padding-top: 24px;
    border-top: 1px dashed var(--c-grid);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--c-label);
    z-index: 1;
}

/* =================== Responsive =================== */
@media (max-width: 980px) {
    .hero {
        grid-template-columns: 1fr;
        padding-top: calc(var(--nav-h) + 24px);
        gap: 40px;
    }
    .hero-stage { order: 2; max-width: 480px; }
    .hero-content { order: 1; }
    .nav-links { display: none; }
    .topbar-inner { grid-template-columns: 1fr auto; }

    .bento { grid-template-columns: repeat(6, 1fr); }
    .box, .box-span-2 { grid-column: span 6; }

    .principles { grid-template-columns: 1fr; gap: 40px; }
    .footer-inner { grid-template-columns: 1fr; gap: 50px; }
}

@media (max-width: 600px) {
    .section { padding: 80px 18px; }
    .hero { padding: calc(var(--nav-h) + 24px) 18px 60px; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-meta { font-size: 11px; gap: 10px; }
    .footer-cols { grid-template-columns: repeat(2, 1fr); }
    .footer-bottom { flex-direction: column; }
    .scroll-indicator { left: 18px; }
}
