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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0b1a3d;
    color: #d4d8e0;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    line-height: 1.75;
    overflow-x: hidden;
    position: relative;
}

/* Deep recessed areas */
.editorial-section {
    background-color: transparent;
}

/* Cinnabar emphasis class */
.emphasis-mark {
    color: #c44b3f;
}

/* Midnight ink for recessed panels */
.recessed-panel {
    background-color: #061029;
}

/* Grid line reference color: #2a3a5c used in JS canvas */

/* === Paper Grain Overlay === */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    mix-blend-mode: multiply;
}

/* === Isometric Grid Canvas === */
#iso-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.15;
}

/* === Hero Section === */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 4rem 5%;
    gap: 2rem;
}

.hero-text {
    flex: 0 0 58%;
    max-width: 58%;
}

.hero-headline {
    display: flex;
    flex-direction: column;
    gap: 0.2em;
}

.hero-line {
    display: block;
    font-family: 'Poiret One', 'Josefin Sans', sans-serif;
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #c9a84c;
    opacity: 0;
    position: relative;
    padding-bottom: 0.15em;
}

.hero-line::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #c9a84c;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-line.revealed {
    opacity: 1;
    transition: opacity 0.6s ease;
}

.hero-line.revealed::after {
    transform: scaleX(1);
}

.hero-subtitle {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 1.1rem;
    color: #8a7d5a;
    letter-spacing: 0.08em;
    margin-top: 2rem;
    opacity: 0;
    transition: opacity 1s ease 1.8s;
}

.hero-subtitle.revealed {
    opacity: 1;
}

.hero-illustration {
    flex: 0 0 40%;
    max-width: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-svg {
    width: 100%;
    max-width: 500px;
}

/* === SVG Isometric Styles === */
.iso-path {
    fill: none;
    stroke: #c9a84c;
    stroke-width: 1;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s ease;
}

.iso-path.bracket {
    stroke-width: 1.5;
}

.iso-node {
    fill: none;
    stroke: #c9a84c;
    stroke-width: 1;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 2s ease;
}

.hub-node {
    stroke-width: 1.5;
}

.bracket-diamond {
    fill: #c9a84c;
    stroke: none;
    opacity: 0;
    transition: opacity 1s ease 2s;
}

.arrow-node {
    fill: #c9a84c;
    stroke: none;
    opacity: 0;
    transition: opacity 1s ease 1.5s;
}

.iso-diagram.drawn .iso-path,
.iso-diagram.drawn .iso-node {
    stroke-dashoffset: 0;
}

.iso-diagram.drawn .bracket-diamond,
.iso-diagram.drawn .arrow-node {
    opacity: 1;
}

/* Watercolor washes in SVGs */
.wash {
    opacity: 0;
    transition: opacity 2s ease 1.5s, r 2s ease 1.5s;
}

.wash-cobalt {
    fill: #2c4a8a;
    filter: url(#blur-wash);
}

.wash-cobalt-2 {
    fill: #2c4a8a;
    filter: url(#blur-wash);
}

.wash-ochre {
    fill: #d4a53c;
    filter: url(#blur-wash);
}

.iso-diagram.drawn .wash {
    opacity: 0.25;
}

/* === Watercolor Dividers === */
.wc-divider {
    position: relative;
    z-index: 1;
    height: 120px;
    overflow: hidden;
}

.wc-layer {
    position: absolute;
    width: 60%;
    height: 100%;
    border-radius: 50%;
    opacity: 0;
    filter: blur(80px);
    transition: opacity 1.5s ease, filter 1.5s ease;
}

.wc-divider.visible .wc-layer {
    filter: blur(40px);
}

.wc-cobalt-1 { background: #2c4a8a; left: 10%; top: -20px; }
.wc-ochre-1  { background: #d4a53c; left: 30%; top: 10px; }
.wc-cobalt-2 { background: #2c4a8a; left: 50%; top: -10px; }
.wc-ochre-2  { background: #d4a53c; left: 5%; top: 20px; }
.wc-cobalt-3 { background: #2c4a8a; left: 40%; top: -15px; }
.wc-ochre-3  { background: #d4a53c; left: 60%; top: 5px; }
.wc-cobalt-4 { background: #2c4a8a; left: 20%; top: 0; }
.wc-ochre-4  { background: #d4a53c; left: 45%; top: -20px; }
.wc-cobalt-5 { background: #2c4a8a; left: 70%; top: 10px; }
.wc-ochre-5  { background: #d4a53c; left: 15%; top: -10px; }
.wc-cobalt-6 { background: #2c4a8a; left: 55%; top: 15px; }

.wc-divider.visible .wc-cobalt-1,
.wc-divider.visible .wc-cobalt-2,
.wc-divider.visible .wc-cobalt-3,
.wc-divider.visible .wc-cobalt-4,
.wc-divider.visible .wc-cobalt-5,
.wc-divider.visible .wc-cobalt-6 { opacity: 0.35; }

.wc-divider.visible .wc-ochre-1,
.wc-divider.visible .wc-ochre-2,
.wc-divider.visible .wc-ochre-3,
.wc-divider.visible .wc-ochre-4,
.wc-divider.visible .wc-ochre-5 { opacity: 0.5; }

/* === Editorial Sections === */
.editorial-section {
    position: relative;
    z-index: 1;
    padding: 4rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

/* === Text Blocks (Serpentine Flow) === */
.text-block {
    max-width: 38rem;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.text-block.text-left {
    margin-left: 15%;
}

.text-block.text-right {
    margin-left: 40%;
}

.text-block p {
    margin-bottom: 1.25em;
}

/* === Section Titles === */
.section-title {
    font-family: 'Poiret One', 'Josefin Sans', sans-serif;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #c9a84c;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
    padding-bottom: 0.2em;
}

.underline-draw::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1.5px;
    background: #c9a84c;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.underline-draw.drawn::after {
    transform: scaleX(1);
}

/* === Margin Annotations === */
.margin-annotation {
    max-width: 18rem;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.margin-annotation.visible {
    opacity: 0.6;
    transform: translateY(0);
}

.annotation-label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: #c9a84c;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.3rem;
}

.margin-annotation::after {
    content: attr(data-annotation);
    display: block;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    color: #7b9e87;
    letter-spacing: 0.04em;
    line-height: 1.5;
}

.annotation-right {
    margin-left: 70%;
}

.annotation-left {
    margin-left: 5%;
}

/* === Diagram Floats === */
.diagram-float {
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.diagram-float.visible {
    opacity: 1;
    transform: translateY(0);
}

.diagram-float .iso-diagram {
    width: 100%;
    max-width: 400px;
}

.diagram-right {
    margin-left: 55%;
}

.diagram-left {
    margin-left: 5%;
}

/* === Recessed Depth Zones === */
.wc-divider {
    background-color: #061029;
}

/* Isometric grid line color reference: #2a3a5c */
#iso-grid {
    border-color: #2a3a5c;
}

/* === Footer === */
.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 6rem 5% 4rem;
}

.footer-brackets {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.footer-bracket-svg {
    width: 40px;
    height: 40px;
}

.footer-text {
    font-family: 'Poiret One', 'Josefin Sans', sans-serif;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #c9a84c;
    margin-bottom: 0.5rem;
}

.footer-meta {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    color: #8a7d5a;
    letter-spacing: 0.08em;
}

/* === Responsive === */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        padding: 2rem 5%;
    }

    .hero-text,
    .hero-illustration {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .text-block.text-left,
    .text-block.text-right {
        margin-left: 5%;
        max-width: 90%;
    }

    .annotation-right,
    .annotation-left {
        margin-left: 5%;
    }

    .diagram-right,
    .diagram-left {
        margin-left: 5%;
    }

    #iso-grid {
        display: none;
    }
}
