/* =========================================================
   concepts.news — Pressed Violets and Foxed Vellum
   A fairycore scholarly press for living ideas
   ========================================================= */

/* --- CSS Custom Properties --- */
/* IBM Plex Mono" Regular sits above as precise body type (Google Fonts)
   IntersectionObserver with a threshold springs the fade-reveal
   Mono's ideas". 0.8rem: cursor-follow */
:root {
    --foxed-vellum: #F5F0E8;
    --petal-cream: #EDE6D8;
    --forest-ink: #2D2A24;
    --faded-graphite: #6B6560;
    --dried-lavender: #7B6B8A;
    --foxglove-pink: #B8849A;
    --moss-ink: #5C7A65;
    --thistle-mist: #C4B5D4;
    --thistle-light: #B8A9C4;
    --honeydew-glow: #E8DFC2;

    --font-body: 'IBM Plex Mono', monospace;
    --font-display: 'Cormorant Garamond', serif;
    --font-accent: 'Noto Serif', serif;

    --column-width: 640px;
    --column-narrow: 480px;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--thistle-mist) var(--foxed-vellum);
}

/* Webkit scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--foxed-vellum);
}
::-webkit-scrollbar-thumb {
    background: var(--thistle-mist);
    border-radius: 3px;
}

/* Text selection */
::selection {
    background: var(--honeydew-glow);
    color: var(--forest-ink);
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.9rem, 1.8vw, 1.05rem);
    line-height: 1.85;
    color: var(--forest-ink);
    background-color: var(--foxed-vellum);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* --- Top Navigation Bar --- */
#top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(245, 240, 232, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#site-name {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--faded-graphite);
}

#moth-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#moth-nav-icon {
    animation: mothPulse 3s infinite ease-in-out;
}

@keyframes mothPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* --- Table of Contents Panel --- */
#toc-panel {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    z-index: 99;
    background: var(--petal-cream);
    border-bottom: 1px solid var(--thistle-mist);
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.4s ease-out;
    max-height: 0;
    opacity: 0;
}

#toc-panel.toc-visible {
    max-height: 400px;
    opacity: 1;
}

#toc-panel.toc-hidden {
    max-height: 0;
    opacity: 0;
}

#toc-inner {
    max-width: var(--column-width);
    margin: 0 auto;
    padding: 24px;
}

.toc-heading {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 1.2rem;
    color: var(--dried-lavender);
    letter-spacing: 0.04em;
    margin-bottom: 16px;
}

#toc-list {
    list-style: none;
}

#toc-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(196, 181, 212, 0.3);
}

#toc-list li:last-child {
    border-bottom: none;
}

#toc-list a {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--moss-ink);
    text-decoration: none;
    transition: color 0.3s ease;
}

#toc-list a:hover {
    color: var(--foxglove-pink);
}

.toc-folio {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 0.85rem;
    color: var(--faded-graphite);
}

/* --- Title Plate --- */
#title-plate {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

#title-plate-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#moth-hero {
    animation: mothPulse 3s infinite ease-in-out;
    margin-bottom: 8px;
}

#site-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(3rem, 10vw, 6rem);
    letter-spacing: 0.04em;
    color: var(--forest-ink);
    line-height: 1.1;
}

#site-subtitle {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    color: var(--faded-graphite);
    margin-top: 8px;
}

/* --- Main Content Column --- */
#journal-column {
    max-width: var(--column-width);
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* --- Specimen Sections --- */
.specimen-section {
    min-height: 80vh;
    padding: 80px 0 40px;
    position: relative;
    border-left: 1px solid #B8A9C4;
    border-right: 1px solid #B8A9C4;
    padding-left: 24px;
    padding-right: 24px;
}

.specimen-illustration {
    text-align: center;
    margin-bottom: 24px;
}

.specimen-illustration svg {
    max-width: 240px;
    height: auto;
}

.classification-label {
    text-align: center;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 300;
    color: var(--faded-graphite);
    letter-spacing: 0.05em;
    margin-bottom: 32px;
}

.classification-label em {
    font-style: italic;
}

.specimen-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.8rem, 4.5vw, 3.2rem);
    letter-spacing: 0.04em;
    color: var(--dried-lavender);
    text-align: center;
    margin-bottom: 40px;
    line-height: 1.2;
}

.specimen-body {
    position: relative;
}

.specimen-body p {
    margin-bottom: 1.5em;
}

/* --- Drop Cap --- */
.drop-cap {
    float: left;
    font-family: var(--font-accent);
    font-weight: 700;
    font-size: 3.6em;
    line-height: 0.8;
    color: var(--dried-lavender);
    text-shadow: 0 0 8px rgba(123, 107, 138, 0.2);
    margin-right: 8px;
    margin-top: 6px;
}

/* --- Pull Quotes --- */
.pull-quote {
    margin: 2em 0 2em -24px;
    padding: 0 0 0 24px;
    position: relative;
}

.pull-quote p {
    font-family: var(--font-display);
    font-weight: 700;
    font-style: italic;
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--forest-ink);
}

.botanical-dingbat {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--moss-ink);
    border-radius: 50% 0 50% 50%;
    transform: rotate(45deg);
    margin-right: 8px;
    opacity: 0.6;
    vertical-align: middle;
    position: relative;
    top: -2px;
}

/* --- Footnotes --- */
.footnote-ref {
    font-size: 0.75em;
    color: var(--foxglove-pink);
    cursor: default;
    vertical-align: super;
    line-height: 0;
}

.footnotes {
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid rgba(196, 181, 212, 0.3);
}

.footnotes p {
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--faded-graphite);
}

.footnotes sup {
    font-size: 0.75em;
    color: var(--foxglove-pink);
    margin-right: 4px;
}

/* --- Folio Numbers --- */
.folio-number {
    text-align: right;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 0.85rem;
    color: var(--faded-graphite);
    margin-top: 32px;
    padding-right: 8px;
}

/* --- Section Dividers --- */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 40px;
    padding: 0 20px;
}

.divider-rule {
    flex: 1;
    border: none;
    border-top: 1px solid var(--thistle-mist);
}

.fleuron {
    color: var(--dried-lavender);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.moth-resting {
    flex-shrink: 0;
    opacity: 0.7;
}

/* --- Annotation Strips --- */
.annotation-strip {
    height: 80px;
    overflow: hidden;
    margin: 0 -24px;
    background: var(--petal-cream);
    display: flex;
    align-items: center;
    position: relative;
}

.strip-pattern {
    width: 100%;
    height: 60px;
    transition: transform 0.3s ease-out;
}

/* --- Marginalia Blocks --- */
.marginalia-block {
    max-width: var(--column-narrow);
    margin: 40px auto 40px 40px;
    padding: 16px 20px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--faded-graphite);
    line-height: 1.7;
    border-left: 1px dashed var(--thistle-mist);
    transform: rotate(-0.5deg);
    background: rgba(237, 230, 216, 0.3);
}

.marginalia-prefix {
    font-weight: 500;
    color: var(--dried-lavender);
    margin-right: 4px;
}

.marginalia-cf {
    display: inline;
    font-style: italic;
    color: var(--moss-ink);
}

/* --- Card Catalog --- */
#card-catalog {
    padding: 80px 0 40px;
    text-align: center;
}

.catalog-heading {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    letter-spacing: 0.04em;
    color: var(--dried-lavender);
    margin-bottom: 8px;
}

.catalog-subtitle {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--faded-graphite);
    letter-spacing: 0.1em;
    margin-bottom: 40px;
}

#catalog-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    margin: 0 auto;
}

.catalog-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--petal-cream);
    border: 1px solid rgba(196, 181, 212, 0.25);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(45, 42, 36, 0.06);
    text-decoration: none;
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}

.catalog-card:hover {
    background: var(--honeydew-glow);
    box-shadow: 0 2px 8px rgba(45, 42, 36, 0.1);
    border-color: var(--foxglove-pink);
}

.card-icon {
    flex-shrink: 0;
}

.card-name {
    flex: 1;
    text-align: left;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--forest-ink);
}

.card-folio {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 0.8rem;
    color: var(--faded-graphite);
    flex-shrink: 0;
}

/* --- Cursor-Following Moth --- */
#cursor-moth {
    position: fixed;
    pointer-events: none;
    z-index: 200;
    opacity: 0.6;
    transition: none;
}

/* --- Footer / Colophon --- */
#colophon {
    max-width: var(--column-width);
    margin: 0 auto;
    padding: 40px 24px 60px;
    text-align: center;
    border-top: 1px solid var(--thistle-mist);
}

#colophon p {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 300;
    color: var(--faded-graphite);
    letter-spacing: 0.1em;
}

.colophon-note {
    margin-top: 8px;
    font-style: italic;
}

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

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

/* --- Links --- */
a {
    color: var(--moss-ink);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--foxglove-pink);
}

/* --- Responsive Adjustments --- */
@media (max-width: 720px) {
    .specimen-section {
        padding-left: 16px;
        padding-right: 16px;
    }

    .marginalia-block {
        margin-left: 16px;
        max-width: 100%;
    }

    .pull-quote {
        margin-left: 0;
    }

    #catalog-cards {
        padding: 0 16px;
    }

    .annotation-strip {
        margin: 0 -16px;
    }
}

@media (max-width: 480px) {
    #site-title {
        font-size: clamp(2.2rem, 10vw, 3.5rem);
    }

    .specimen-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    .specimen-illustration svg {
        max-width: 180px;
    }

    .drop-cap {
        font-size: 2.8em;
    }
}