/* ============================================
   concepts.news — styles.css
   Palette:
     Vellum White:   #FAFAF8
     Parchment Warm: #F0EDE6
     Ink Navy:       #2D3142
     Ash Stone:      #D4D0C8
     Slate Muted:    #8A8680
     Saffron Accent: #E8C547
     Deep Slate:     #5C6378
     Warm Ivory:     #E8E4DC
   ============================================ */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: #FAFAF8;
    color: #2D3142;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    line-height: 1.75;
    overflow-x: hidden;
    position: relative;
}

/* --- Golden Thread SVG --- */
#golden-thread {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* --- Panels / Sections --- */
.panel {
    position: relative;
    width: 100%;
}

/* --- Fade Reveal Animation --- */
.fade-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.fade-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Section 1: The Foyer
   ============================================ */
#foyer {
    height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background-color: #FAFAF8;
    position: relative;
}

.foyer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
}

.foyer-title {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.15em;
    color: #2D3142;
    opacity: 0;
    margin-bottom: 1rem;
    text-align: center;
}

.foyer-rule {
    width: 80%;
    max-width: 800px;
    height: 2px;
    display: block;
    margin: 0 auto;
}

#foyer-rule-line {
    stroke: #D4D0C8;
    stroke-width: 1;
    transition: none;
}

.foyer-subtitle {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: 1rem;
    letter-spacing: 0.3em;
    color: #8A8680;
    opacity: 0;
    margin-top: 1rem;
    text-transform: uppercase;
}

.foyer-date {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: #8A8680;
    opacity: 0;
    margin-top: 0.75rem;
    text-transform: uppercase;
}

/* ============================================
   Section 2: The Lead Concept
   ============================================ */
#lead-concept {
    min-height: 80vh;
    padding: clamp(2rem, 5vw, 6rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lead-concept-inner {
    display: flex;
    gap: clamp(2rem, 4vw, 4rem);
    max-width: 1100px;
    width: 100%;
    align-items: flex-start;
}

.lead-left {
    flex: 0 0 38.2%;
    position: relative;
    padding-left: 3rem;
}

.category-label-rotated {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: #8A8680;
    text-transform: uppercase;
    position: absolute;
    left: -0.5rem;
    top: 50%;
    transform: rotate(-90deg) translateX(-50%);
    transform-origin: left center;
    white-space: nowrap;
}

.concept-title {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 700;
    font-size: clamp(1.75rem, 3.5vw, 3rem);
    line-height: 1.2;
    color: #2D3142;
    margin-bottom: 1.25rem;
}

.concept-abstract {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.125rem);
    line-height: 1.75;
    color: #5C6378;
}

.lead-right {
    flex: 0 0 61.8%;
}

.concept-diagram-panel {
    background-color: #F0EDE6;
    border: 1px solid #D4D0C8;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.concept-diagram {
    width: 100%;
    max-width: 400px;
    height: auto;
}

/* ============================================
   Section 3: The Taxonomy Strip
   ============================================ */
#taxonomy-strip {
    width: 100%;
    height: 64px;
    background-color: #2D3142;
    display: flex;
    align-items: center;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

#taxonomy-strip::-webkit-scrollbar {
    display: none;
}

.taxonomy-inner {
    display: flex;
    align-items: center;
    gap: clamp(1.5rem, 4vw, 4rem);
    padding: 0 clamp(1.5rem, 4vw, 4rem);
    white-space: nowrap;
    min-width: 100%;
    justify-content: center;
}

.taxonomy-label {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: #F0EDE6;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 300ms ease;
    scroll-snap-align: center;
    padding: 0.25rem 0;
    flex-shrink: 0;
}

.taxonomy-label:hover {
    color: #E8C547;
}

/* ============================================
   Section 4: The Grid of Ideas
   ============================================ */
#grid-of-ideas {
    padding: clamp(3rem, 6vw, 6rem) clamp(1rem, 4vw, 4rem);
    display: flex;
    justify-content: center;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 960px;
    width: 100%;
}

.concept-card {
    border: 1px solid #D4D0C8;
    padding: 2rem;
    background-color: #FAFAF8;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.concept-card.specimen-border {
    border: 1px solid #D4D0C8;
    outline: 1px solid #D4D0C8;
    outline-offset: 4px;
}

.card-glyph {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.card-title {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1.3;
    color: #2D3142;
}

.card-excerpt {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #5C6378;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-category {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: #8A8680;
    text-transform: uppercase;
    margin-top: auto;
    padding-top: 0.5rem;
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.card-category::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 1px;
    background-color: #E8C547;
    transition: width 300ms ease;
}

.card-category:hover::after {
    width: 100%;
}

/* ============================================
   Section 5: The Deep Read
   ============================================ */
#deep-read {
    padding: clamp(3rem, 6vw, 8rem) clamp(1rem, 4vw, 4rem);
    display: flex;
    justify-content: center;
    position: relative;
}

.deep-read-inner {
    max-width: 640px;
    width: 100%;
    position: relative;
    /* Ruled paper lines */
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent calc(1.75rem - 1px),
        rgba(212, 208, 200, 0.08) calc(1.75rem - 1px),
        rgba(212, 208, 200, 0.08) 1.75rem
    );
    background-size: 100% 1.75rem;
}

.deep-read-title {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 700;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    line-height: 1.2;
    color: #2D3142;
    margin-bottom: 2rem;
}

.deep-read-body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.125rem);
    line-height: 1.75;
    color: #2D3142;
    margin-bottom: 1.75rem;
}

.pull-quote {
    margin: 2.5rem 0 2.5rem 3rem;
    padding-left: 1.5rem;
    border-left: 2px solid #E8C547;
    position: relative;
}

.pull-quote p {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    line-height: 1.4;
    color: #2D3142;
    margin-bottom: 0.75rem;
}

.pull-quote cite {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #8A8680;
    font-style: normal;
    display: block;
}

/* Footnotes */
.footnote {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 0.7rem;
    color: #E8C547;
    cursor: pointer;
    transition: transform 200ms ease;
    display: inline-block;
}

.footnote:hover {
    transform: scale(1.2);
}

.footnote-tooltip {
    position: fixed;
    background-color: #2D3142;
    color: #F0EDE6;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 0.7rem;
    line-height: 1.5;
    padding: 0.75rem 1rem;
    max-width: 300px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 200ms ease, transform 200ms ease;
    pointer-events: none;
    z-index: 2000;
}

.footnote-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Marginalia */
.marginalia {
    position: absolute;
    right: -220px;
    top: 0;
    width: 180px;
    height: 100%;
    display: none;
}

@media (min-width: 1200px) {
    .marginalia {
        display: block;
    }
}

.margin-note {
    position: absolute;
    opacity: 0;
    transition: opacity 600ms ease;
}

.margin-note.visible {
    opacity: 1;
}

.margin-text {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 0.65rem;
    line-height: 1.5;
    color: #8A8680;
    display: block;
}

/* ============================================
   Section 6: The Connexion Map
   ============================================ */
#connexion-map {
    height: 100vh;
    background-color: #2D3142;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    clip-path: circle(0% at 50% 50%);
    transition: clip-path 1200ms ease-in-out;
}

#connexion-map.revealed {
    clip-path: circle(150% at 50% 50%);
}

.connexion-inner {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
}

#connexion-svg {
    width: 100%;
    height: auto;
}

.conn-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 400ms ease;
}

.conn-line.drawn {
    stroke-dashoffset: 0;
}

.conn-node {
    opacity: 0;
    transform-origin: center;
    transition: opacity 300ms ease, transform 300ms ease;
}

.conn-node.visible {
    opacity: 1;
}

.conn-node circle {
    transition: filter 200ms ease;
}

.conn-node:hover circle {
    filter: drop-shadow(0 0 8px rgba(232, 197, 71, 0.6));
}

.conn-node:hover {
    transform: scale(1.15);
}

.conn-label {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 8px;
    letter-spacing: 0.1em;
    fill: #F0EDE6;
    opacity: 0;
    transition: opacity 200ms ease;
}

.conn-node:hover .conn-label {
    opacity: 1;
}

.conn-label-visible {
    opacity: 1;
}

/* Pulsing node animation */
.pulsing-node {
    animation: pulse-glow 2s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    0% {
        filter: drop-shadow(0 0 4px rgba(232, 197, 71, 0.4));
    }
    100% {
        filter: drop-shadow(0 0 8px rgba(232, 197, 71, 0.8));
    }
}

/* ============================================
   Section 7: The Colophon
   ============================================ */
#colophon {
    padding: clamp(4rem, 8vw, 8rem) clamp(1rem, 4vw, 4rem);
    display: flex;
    justify-content: center;
    background-color: #FAFAF8;
}

.colophon-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.colophon-name {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 300;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    color: #2D3142;
}

.colophon-rule {
    width: 80px;
    border: none;
    border-top: 1px solid #D4D0C8;
}

.colophon-tagline {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: #8A8680;
    text-transform: none;
    font-variant: small-caps;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .lead-concept-inner {
        flex-direction: column;
    }

    .lead-left {
        flex: 1 1 auto;
        padding-left: 0;
    }

    .category-label-rotated {
        position: static;
        transform: none;
        display: block;
        margin-bottom: 0.75rem;
    }

    .lead-right {
        flex: 1 1 auto;
    }

    .grid-container {
        grid-template-columns: 1fr;
    }

    .taxonomy-inner {
        justify-content: flex-start;
    }

    .marginalia {
        display: none;
    }

    #connexion-map {
        height: auto;
        min-height: 80vh;
    }
}

@media (max-width: 960px) and (min-width: 769px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}
