/* ============================================
   reasoner.dev — Styles
   Botanical Thinking Machine
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --deep-earth: #1c1410;
    --aged-parchment: #f4ece1;
    --iron-gall: #3b2a1a;
    --umber-medium: #6b5744;
    --copper-vein: #b87333;
    --fern-dark: #2d5a3d;
    --aurora-violet: #6b4c8a;
    --aurora-teal: #3a8a7a;
    --bone-white: #faf7f2;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Source Serif 4', Georgia, serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--deep-earth);
    color: var(--iron-gall);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.75;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

/* --- Noise Overlay --- */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    mix-blend-mode: multiply;
    filter: url(#noise);
    background: var(--aged-parchment);
}

/* --- HERO SECTION --- */
.hero {
    position: relative;
    min-height: 100vh;
    background: var(--deep-earth);
    display: flex;
    align-items: flex-end;
    padding-bottom: 10vh;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding-left: clamp(2rem, 8vw, 12rem);
    padding-bottom: 4rem;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: -0.03em;
    color: var(--aged-parchment);
    line-height: 1;
}

.hero-subtitle {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: var(--umber-medium);
    margin-top: 1.5rem;
    letter-spacing: 0.01em;
}

.hero-subtitle em {
    font-style: italic;
}

.fern-svg {
    position: absolute;
    bottom: 10vh;
    left: clamp(2rem, 8vw, 12rem);
    z-index: 1;
    opacity: 0.4;
}

.fern-closing {
    bottom: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(180deg);
    opacity: 0.2;
}

/* --- SECTION TRANSITIONS --- */
.section-transition {
    height: 20vh;
    position: relative;
}

.dark-to-light {
    background: linear-gradient(to bottom, var(--deep-earth), var(--aged-parchment));
}

.light-to-dark {
    background: linear-gradient(to bottom, var(--aged-parchment), var(--deep-earth));
}

/* --- CONTENT SECTIONS (Light) --- */
.light-section {
    background: var(--aged-parchment);
    padding: 6rem 2rem;
    position: relative;
}

/* --- GRID CONTAINER (Broken Grid) --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* --- THESIS BLOCK --- */
.thesis-block {
    grid-column: 1 / 8;
    margin-left: clamp(2rem, 8vw, 12rem);
    z-index: 2;
    position: relative;
}

.thesis-block h2 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--iron-gall);
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

.thesis-block .body-text {
    max-width: 720px;
    color: var(--iron-gall);
}

.thesis-block .body-text em {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--copper-vein);
}

.thesis-right {
    grid-column: 4 / 12;
    margin-left: 0;
    margin-right: clamp(2rem, 8vw, 12rem);
    text-align: right;
}

.thesis-right .body-text {
    margin-left: auto;
}

/* --- ANNOTATION BLOCK --- */
.annotation-block {
    grid-column: 6 / 11;
    margin-top: -3rem;
    z-index: 3;
    padding: 2rem;
    border: 1px solid rgba(107, 87, 68, 0.3);
    background: var(--bone-white);
    position: relative;
    transform: translateX(2rem);
}

.annotation-right {
    grid-column: 5 / 11;
    transform: translateX(3rem);
}

.annotation-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.95rem;
    color: var(--umber-medium);
    line-height: 1.7;
}

.annotation-text em {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--copper-vein);
}

/* --- SPECIMEN PANEL --- */
.specimen-panel {
    position: relative;
    min-height: 60vh;
    background: var(--deep-earth);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.specimen-content {
    position: relative;
    z-index: 3;
    text-align: center;
}

.specimen-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--aged-parchment);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.specimen-subtitle {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--umber-medium);
    margin-top: 0.5rem;
}

.specimen-subtitle em {
    font-style: italic;
}

/* Aurora layers */
.aurora-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.aurora-teal {
    background: radial-gradient(ellipse 800px 300px at 30% 40%, rgba(58, 138, 122, 0.10), transparent);
    animation: aurora-drift-right 25s ease-in-out infinite alternate;
}

.aurora-violet {
    background: radial-gradient(ellipse 700px 250px at 70% 30%, rgba(107, 76, 138, 0.08), transparent);
    animation: aurora-drift-left 30s ease-in-out infinite alternate;
}

.aurora-copper {
    background: radial-gradient(ellipse 600px 200px at 50% 60%, rgba(184, 115, 51, 0.05), transparent);
    animation: aurora-drift-vertical 20s ease-in-out infinite alternate;
}

@keyframes aurora-drift-right {
    from { transform: translate3d(-10%, 0, 0); }
    to { transform: translate3d(10%, 5%, 0); }
}

@keyframes aurora-drift-left {
    from { transform: translate3d(10%, 0, 0); }
    to { transform: translate3d(-10%, -5%, 0); }
}

@keyframes aurora-drift-vertical {
    from { transform: translate3d(0, -8%, 0); }
    to { transform: translate3d(0, 8%, 0); }
}

/* Leaf watermark */
.leaf-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.06;
    z-index: 0;
}

/* Root network SVG */
.root-network-svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.3;
    z-index: 2;
}

/* --- PROOF CHAIN --- */
.proof-chain {
    grid-column: 2 / 8;
    background: var(--bone-white);
    padding: 3rem;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(107, 87, 68, 0.2);
}

.proof-chain-wide {
    grid-column: 3 / 11;
}

.premise {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 0.5rem 0;
    color: var(--iron-gall);
    padding-left: 3rem;
    position: relative;
}

.premise-label {
    position: absolute;
    left: 0;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    color: var(--umber-medium);
    font-size: 0.85em;
}

.inference-line {
    border: none;
    border-top: 2px solid var(--copper-vein);
    width: 80%;
    margin: 1rem 0;
    position: relative;
}

.conclusion {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 0.5rem 0;
    color: var(--iron-gall);
    font-weight: 400;
    padding-left: 3rem;
    position: relative;
}

.therefore {
    position: absolute;
    left: 0;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    color: var(--copper-vein);
    font-size: 1.2em;
}

/* --- CLOSING SECTION --- */
.closing-section {
    position: relative;
    min-height: 80vh;
    background: var(--deep-earth);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.closing-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.closing-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(2rem, 6vw, 5rem);
    color: var(--aged-parchment);
    letter-spacing: -0.02em;
}

.closing-title em {
    font-style: italic;
}

.closing-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: var(--umber-medium);
    margin-top: 2rem;
}

/* --- REVEAL ANIMATIONS --- */
.reveal {
    opacity: 0;
    transform: translateY(3rem);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal:nth-child(2) {
    transition-delay: 0.15s;
}

.reveal:nth-child(3) {
    transition-delay: 0.3s;
}

/* --- TILT --- */
[data-tilt] {
    transition: transform 0.15s ease-out;
    will-change: transform;
}

/* --- SVG Path Animation --- */
.svg-draw path {
    stroke-dasharray: var(--path-length, 500);
    stroke-dashoffset: var(--path-length, 500);
    transition: stroke-dashoffset 1.5s ease-out;
}

.svg-draw.drawn path {
    stroke-dashoffset: 0;
}

/* --- RESPONSIVE (mobile heals the grid) --- */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .thesis-block,
    .thesis-right,
    .annotation-block,
    .annotation-right,
    .proof-chain,
    .proof-chain-wide {
        grid-column: 1 / -1;
        margin-left: 0;
        margin-right: 0;
        transform: none;
        text-align: left;
    }

    .thesis-right .body-text {
        margin-left: 0;
    }

    .annotation-block {
        margin-top: 0;
    }

    .hero-content {
        padding-left: 2rem;
    }

    .fern-svg {
        left: 2rem;
    }

    [data-tilt] {
        transform: none !important;
    }
}
