/* ============================================
   graphers.dev - Goblincore Graph Aesthetics
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #2C2416;
    color: #E8E0D4;
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.1vw, 18px);
    line-height: 1.8;
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    letter-spacing: -0.03em;
}

h2 {
    font-size: clamp(24px, 3.5vw, 48px);
    margin-bottom: 0.6em;
    color: #E8E0D4;
}

h3 {
    font-size: clamp(18px, 2vw, 28px);
    margin-bottom: 0.4em;
    color: #D4A84B;
}

code, .graph-notation {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: #C0C0C0;
}

a {
    color: #C0C0C0;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #D4A84B;
}

/* --- Watermarks --- */
.watermark {
    position: absolute;
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(80px, 15vw, 200px);
    color: #E8E0D4;
    opacity: 0.04;
    pointer-events: none;
    user-select: none;
    letter-spacing: -0.03em;
    z-index: 0;
}

#graph-watermark {
    bottom: 10%;
    right: 5%;
}

#concepts-watermark {
    top: 5%;
    left: -2%;
}

/* ============================================
   SECTION 1: Hero
   ============================================ */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background: #2C2416;
    overflow: hidden;
    display: flex;
    align-items: center;
}

#graph-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#hero-graph {
    width: 100%;
    height: 100%;
}

#hero-content {
    position: relative;
    z-index: 2;
    padding-left: 38%;
    max-width: 900px;
}

#logotype-wrapper {
    position: relative;
    display: inline-block;
    padding: 16px 28px;
}

#logotype-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid #C0C0C0;
    pointer-events: none;
    clip-path: inset(0 100% 100% 0);
    transition: clip-path 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

#logotype-border.animate {
    clip-path: inset(0 0 0 0);
}

#logotype {
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(36px, 6vw, 88px);
    font-weight: 400;
    letter-spacing: -0.03em;
    color: #E8E0D4;
    opacity: 0;
    transition: opacity 0.6s ease 1.5s;
    line-height: 1.1;
}

#logotype.visible {
    opacity: 1;
}

#hero-tagline {
    margin-top: 16px;
    font-family: 'Work Sans', sans-serif;
    font-size: clamp(14px, 1.2vw, 20px);
    color: #C0C0C0;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease 2.2s, transform 0.8s ease 2.2s;
}

#hero-tagline.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Graph Nodes & Edges */
#hero-graph .graph-node {
    fill: #7B8C3E;
    transition: r 0.3s ease, fill-opacity 0.3s ease;
}

#hero-graph .graph-node.hovered {
    fill: #D4A84B;
}

#hero-graph .graph-edge {
    stroke: #C0C0C0;
    stroke-opacity: 0.3;
    stroke-width: 1;
    transition: stroke 0.3s ease, stroke-opacity 0.3s ease;
}

#hero-graph .graph-edge.glow {
    stroke: #D4A84B;
    stroke-opacity: 0.8;
}

/* ============================================
   Mycelium Dividers
   ============================================ */
.mycelium-divider {
    width: 100%;
    padding: 0;
    overflow: hidden;
}

.mycelium-divider svg {
    display: block;
    width: 100%;
    height: 60px;
}

.mycelium-path {
    fill: none;
    stroke: #7B8C3E;
    stroke-width: 2;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2s ease;
}

.mycelium-divider.animated .mycelium-path {
    stroke-dashoffset: 0;
}

.mycelium-node {
    fill: #7B8C3E;
    opacity: 0;
    transition: opacity 0.5s ease 1.5s;
}

.mycelium-divider.animated .mycelium-node {
    opacity: 1;
}

/* ============================================
   SECTION 2: Content Cards
   ============================================ */
#concepts {
    position: relative;
    padding: 80px 5% 80px;
    background: #2C2416;
    overflow: hidden;
}

.card-grid {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: nowrap;
}

.concept-card {
    background: rgba(26, 18, 8, 0.6);
    border: 2px solid #A0522D;
    padding: 32px 28px;
    position: relative;
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.concept-card.card-large {
    width: 40%;
    clip-path: polygon(0% 0%, 100% 0.5%, 99.5% 99%, 0.5% 100%);
    transform: translateX(-60px);
}

.concept-card.card-small {
    width: 25%;
    clip-path: polygon(0.5% 0%, 99.5% 0%, 100% 99.5%, 0% 100.5%);
    transform: translateY(60px);
}

.concept-card.card-medium {
    width: 35%;
    clip-path: polygon(0% 0.5%, 99% 0%, 100% 100%, 0.5% 99.5%);
    transform: translateX(60px);
}

.concept-card.visible {
    opacity: 1;
    transform: translate(0, 0);
}

.concept-card h3 {
    color: #D4A84B;
}

.concept-card p {
    color: #E8E0D4;
    margin-bottom: 12px;
}

.concept-card .graph-notation {
    display: block;
    margin-top: 16px;
    padding: 8px 12px;
    background: rgba(44, 36, 22, 0.8);
    border-left: 3px solid #7B8C3E;
    font-size: 13px;
}

.card-icon {
    margin-bottom: 20px;
}

.card-svg {
    width: 60px;
    height: 60px;
}

.card-svg circle {
    fill: #7B8C3E;
    stroke: none;
}

.card-svg line {
    stroke: #C0C0C0;
    stroke-width: 1.5;
    stroke-opacity: 0.5;
}

.card-svg ellipse {
    stroke: #C0C0C0;
    stroke-opacity: 0.3;
}

/* ============================================
   SECTION 3: Timeline
   ============================================ */
#timeline {
    background: #1A1208;
    padding: 60px 5% 60px;
    overflow: hidden;
}

.section-title {
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(20px, 2.5vw, 36px);
    color: #E8E0D4;
    margin-bottom: 32px;
    letter-spacing: -0.03em;
}

#timeline-scroll {
    display: flex;
    gap: 28px;
    overflow-x: auto;
    padding-bottom: 20px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

#timeline-scroll::-webkit-scrollbar {
    height: 6px;
}

#timeline-scroll::-webkit-scrollbar-track {
    background: #2C2416;
    border-radius: 3px;
}

#timeline-scroll::-webkit-scrollbar-thumb {
    background: #7B8C3E;
    border-radius: 3px;
}

.timeline-item {
    flex: 0 0 180px;
    scroll-snap-align: center;
    text-align: center;
    padding: 16px;
    border: 1px solid rgba(192, 192, 192, 0.15);
    background: rgba(44, 36, 22, 0.5);
    transition: border-color 0.3s ease, background 0.3s ease;
}

.timeline-item:hover,
.timeline-item.active {
    border-color: #D4A84B;
    background: rgba(44, 36, 22, 0.8);
}

.timeline-graph {
    width: 120px;
    height: 120px;
    margin: 0 auto 12px;
    display: block;
}

.tl-node {
    fill: #7B8C3E;
    fill-opacity: 0.6;
    transition: fill-opacity 0.3s ease, fill 0.3s ease, r 0.2s ease;
}

.timeline-item:hover .tl-node,
.timeline-item.active .tl-node {
    fill-opacity: 1;
}

.timeline-item.active .tl-node:nth-child(1) {
    fill: #D4A84B;
}

.tl-edge {
    stroke: #C0C0C0;
    stroke-opacity: 0.25;
    stroke-width: 1;
    transition: stroke-opacity 0.3s ease, stroke 0.3s ease;
}

.timeline-item:hover .tl-edge,
.timeline-item.active .tl-edge {
    stroke-opacity: 0.6;
}

.timeline-author {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #7B8C3E;
    margin-bottom: 4px;
}

.timeline-label {
    display: block;
    font-family: 'Work Sans', sans-serif;
    font-size: 13px;
    color: #C0C0C0;
}

/* ============================================
   SECTION 4: Explore (Two Column)
   ============================================ */
#explore {
    display: flex;
    gap: 5%;
    padding: 80px 5%;
    background: #2C2416;
    position: relative;
}

#explore-content {
    width: 55%;
}

.content-block {
    position: relative;
    padding-left: 20px;
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.content-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.content-block .accent-line {
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 0;
    background: #7B8C3E;
    transition: height 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.content-block.visible .accent-line {
    height: 100%;
}

.content-block h2 {
    font-size: clamp(20px, 2.5vw, 36px);
    margin-bottom: 16px;
}

.content-block p {
    margin-bottom: 16px;
    color: #E8E0D4;
}

.content-block code {
    background: rgba(26, 18, 8, 0.6);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 14px;
    color: #D4A84B;
}

/* Sidebar */
#sidebar {
    width: 35%;
}

#sidebar-sticky {
    position: sticky;
    top: 40px;
    padding: 24px;
    border: 2px solid rgba(192, 192, 192, 0.2);
    background: rgba(26, 18, 8, 0.5);
}

#sidebar-sticky h3 {
    font-size: clamp(16px, 1.5vw, 22px);
    margin-bottom: 16px;
    color: #D4A84B;
}

#sidebar-graph {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 12px;
}

#sidebar-graph .sb-node {
    fill: #7B8C3E;
    transition: fill 0.3s ease, r 0.3s ease, fill-opacity 0.3s ease;
    cursor: pointer;
}

#sidebar-graph .sb-node:hover {
    fill: #D4A84B;
}

#sidebar-graph .sb-node.highlight {
    fill: #D4A84B;
    fill-opacity: 1;
}

#sidebar-graph .sb-edge {
    stroke: #C0C0C0;
    stroke-opacity: 0.2;
    stroke-width: 1;
    transition: stroke 0.3s ease, stroke-opacity 0.3s ease;
}

#sidebar-graph .sb-edge.highlight {
    stroke: #D4A84B;
    stroke-opacity: 0.7;
}

#sidebar-label {
    font-size: 13px;
    color: #C0C0C0;
    font-family: 'JetBrains Mono', monospace;
}

/* ============================================
   Root Divider
   ============================================ */
.root-divider {
    width: 100%;
    overflow: hidden;
}

.root-divider svg {
    display: block;
    width: 100%;
    height: 30px;
}

.root-path {
    fill: none;
    stroke: #A0522D;
    stroke-width: 1.5;
    stroke-opacity: 0.6;
}

/* ============================================
   FOOTER
   ============================================ */
#footer {
    background: #1A1208;
    padding: 40px 5%;
    text-align: center;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.footer-links a {
    font-family: 'Work Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #C0C0C0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #D4A84B;
}

.footer-mushroom {
    display: inline-block;
    margin: 20px 0;
    cursor: pointer;
}

.mushroom-svg {
    width: 50px;
    height: 60px;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    transform-origin: bottom center;
}

.footer-mushroom:hover .mushroom-svg {
    transform: scaleY(1.15) scaleX(1.05);
}

.footer-copy {
    font-size: 13px;
    color: #C0C0C0;
    opacity: 0.6;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
    #hero-content {
        padding-left: 8%;
        padding-right: 8%;
    }

    .card-grid {
        flex-direction: column;
    }

    .concept-card.card-large,
    .concept-card.card-small,
    .concept-card.card-medium {
        width: 100%;
    }

    #explore {
        flex-direction: column;
    }

    #explore-content {
        width: 100%;
    }

    #sidebar {
        width: 100%;
    }

    #sidebar-sticky {
        position: relative;
        top: 0;
    }
}
