/* ==========================================================================
   monopole.quest // styles.css
   anti-design as precision instrument · analogous palette + violent accent
   ========================================================================== */

:root {
    --c-bg:       #F0EDE6;  /* Bone Ash */
    --c-void:     #1A1A2E;  /* Void Indigo */
    --c-twilight: #3D2C5E;  /* Twilight Violet */
    --c-mauve:    #8E6B82;  /* Dusty Mauve */
    --c-orange:   #E85D26;  /* Burnt Signal Orange */
    --c-graphite: #2C2C3A;  /* Deep Graphite */
    --c-lavender: #6B6B8D;  /* Lavender Gray */

    --f-display: 'Bebas Neue', 'Impact', sans-serif;
    --f-head:    'Space Grotesk', system-ui, sans-serif;
    --f-body:    'IBM Plex Serif', Georgia, serif;
    --f-mono:    'JetBrains Mono', 'Menlo', monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--c-bg);
    color: var(--c-graphite);
    font-family: var(--f-body);
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
}

body {
    position: relative;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
p { margin: 0 0 1.5em 0; }

/* --------------------------------------------------------------------------
   Background field (grid fragments + particle tracks + connecting lines)
   parallax 0.3x
   -------------------------------------------------------------------------- */
.bg-field {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    will-change: transform;
}
.bg-svg {
    width: 110%;
    height: 110%;
    position: absolute;
    top: -5%;
    left: -5%;
}

/* --------------------------------------------------------------------------
   Blob layer — parallax 0.6x
   -------------------------------------------------------------------------- */
.blob-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    will-change: transform;
}

.blob {
    position: absolute;
    will-change: transform;
}

#heroBlob, #conceptBlob, #fieldBlob {
    will-change: d;
    transform-origin: center;
    transform-box: fill-box;
}

.blob-hero {
    top: 6vh;
    left: -4vw;
    width: 58vw;
    height: 90vh;
    animation: heroDrift 14s ease-in-out infinite alternate;
}

@keyframes heroDrift {
    0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
    50%  { transform: translate3d(20px, -10px, 0) rotate(2deg); }
    100% { transform: translate3d(-12px, 14px, 0) rotate(-1.5deg); }
}

.blob-concept {
    top: 110vh;
    right: -6vw;
    width: 36vw;
    height: 60vh;
    animation: heroDrift 18s ease-in-out infinite alternate-reverse;
}

.blob-field {
    top: 410vh;
    left: 28vw;
    width: 52vw;
    height: 80vh;
    animation: heroDrift 20s ease-in-out infinite alternate;
    opacity: 0.85;
}

#heroBlob { animation: morphA 10s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate; }
#conceptBlob { animation: morphB 16s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate; }
#fieldBlob { animation: morphC 18s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate; }
.blob-shadow { animation: morphA 10s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate; }

@keyframes morphA {
    0%   { d: path('M -120 -60 C -160 -130 -60 -190 30 -160 C 130 -130 170 -40 150 50 C 130 140 30 180 -60 150 C -150 120 -180 10 -120 -60 Z'); }
    33%  { d: path('M -100 -80 C -170 -120 -40 -180 50 -150 C 140 -110 160 -20 130 70 C 110 150 0 170 -80 130 C -160 100 -160 0 -100 -80 Z'); }
    66%  { d: path('M -130 -40 C -150 -130 -70 -180 40 -170 C 140 -150 180 -50 160 60 C 140 130 20 170 -50 140 C -140 110 -190 20 -130 -40 Z'); }
    100% { d: path('M -110 -70 C -160 -110 -50 -180 40 -150 C 140 -120 170 -30 140 60 C 120 140 30 170 -70 150 C -150 130 -180 20 -110 -70 Z'); }
}

@keyframes morphB {
    0%   { d: path('M -90 -30 C -110 -90 -30 -130 40 -110 C 110 -90 130 -10 110 60 C 90 120 0 130 -60 110 C -120 90 -130 30 -90 -30 Z'); }
    50%  { d: path('M -80 -50 C -120 -90 -20 -130 50 -100 C 120 -70 130 0 100 70 C 80 130 -10 120 -70 100 C -130 80 -120 20 -80 -50 Z'); }
    100% { d: path('M -100 -20 C -110 -100 -40 -130 30 -120 C 120 -100 140 -20 120 50 C 100 130 10 130 -50 120 C -120 100 -140 30 -100 -20 Z'); }
}

@keyframes morphC {
    0%   { d: path('M -110 -50 C -140 -110 -50 -160 30 -140 C 110 -120 150 -30 130 50 C 110 130 20 160 -60 130 C -140 100 -150 20 -110 -50 Z'); }
    50%  { d: path('M -100 -70 C -150 -100 -40 -170 40 -130 C 130 -100 140 -20 120 60 C 100 140 10 160 -70 120 C -150 90 -140 0 -100 -70 Z'); }
    100% { d: path('M -120 -40 C -130 -120 -60 -150 20 -150 C 120 -130 160 -40 140 40 C 120 130 30 160 -50 140 C -130 110 -160 30 -120 -40 Z'); }
}

/* --------------------------------------------------------------------------
   Page wrapper / sections
   -------------------------------------------------------------------------- */
.page {
    position: relative;
    z-index: 2;
}

.section {
    position: relative;
    min-height: 100vh;
    padding: 9vh 6vw;
    margin-bottom: -64px;            /* 40-80px overlap collision zone */
    transform: rotate(var(--rot, 0deg));
    transform-origin: 50% 0;
    will-change: transform;
}

.section-marker {
    position: absolute;
    top: 18px;
    left: 6vw;
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--c-lavender);
    text-transform: lowercase;
}

/* --------------------------------------------------------------------------
   Display title shared
   -------------------------------------------------------------------------- */
.display-title {
    font-family: var(--f-display);
    color: var(--c-orange);
    margin: 0;
    line-height: 0.85;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    position: relative;
    font-weight: 400;
}

.display-title .title-line {
    display: block;
}
.display-title .title-line--accent {
    color: var(--c-twilight);
    -webkit-text-stroke: 1px var(--c-orange);
}

.title-underline {
    position: absolute;
    left: 0;
    bottom: -10px;
    height: 6px;
    width: 120%;
    pointer-events: none;
    overflow: visible;
}

.overflow-right {
    margin-right: -18%;
}
.overflow-left {
    margin-left: -10%;
}

/* --------------------------------------------------------------------------
   SECTION 1 :: HERO
   right-aligned content, empty left 60%
   -------------------------------------------------------------------------- */
.section-hero {
    background: var(--c-bg);
    padding-right: 0;
    padding-top: 14vh;
    padding-bottom: 12vh;
}

.hero-content {
    width: 42%;
    margin-left: auto;
    text-align: right;
    padding-right: 0;
}

.hero-meta {
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    color: var(--c-lavender);
    text-transform: uppercase;
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.section-hero .display-title {
    font-size: clamp(96px, 16vw, 200px);
    text-align: right;
    overflow: hidden;
}
.section-hero .display-title .title-underline {
    right: -10%;
    left: auto;
    width: 110%;
}

.hero-subtitle {
    font-family: var(--f-body);
    font-size: 19px;
    line-height: 1.65;
    color: var(--c-graphite);
    margin-top: 32px;
    text-align: right;
}

.hero-coords {
    margin-top: 36px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px 22px;
    justify-content: flex-end;
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--c-lavender);
    letter-spacing: 0.1em;
}

/* --------------------------------------------------------------------------
   SECTION 2 :: CONCEPT — 15 / 55 / 30 grid
   -------------------------------------------------------------------------- */
.section-concept {
    background: var(--c-bg);
    color: var(--c-graphite);
    padding-top: 11vh;
}

.concept-grid {
    display: grid;
    grid-template-columns: 15% 55% 30%;
    gap: 0;
    align-items: start;
    margin-top: 40px;
}

.col-label {
    position: relative;
    height: 380px;
}
.vlabel {
    display: inline-block;
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: 0.22em;
    color: var(--c-lavender);
    text-transform: uppercase;
    transform: rotate(-90deg);
    transform-origin: left top;
    position: absolute;
    top: 360px;
    left: 18px;
    white-space: nowrap;
}

.col-text {
    padding-right: 6%;
}
.section-concept .display-title {
    font-size: clamp(72px, 11vw, 150px);
    margin-bottom: 36px;
    color: var(--c-orange);
}

.long-line {
    font-family: var(--f-body);
    font-size: 18px;
    line-height: 1.75;
    max-width: none;          /* deliberately too wide */
    color: var(--c-graphite);
}
.long-line.dim { color: var(--c-twilight); font-style: italic; }

.col-diagrams {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding-left: 18px;
    border-left: 1px solid rgba(107, 107, 141, 0.30);
}

.diagram {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.diagram svg {
    width: 100%;
    height: auto;
    background: rgba(255,255,255,0.35);
    border: 1px solid rgba(107, 107, 141, 0.25);
}
.dlabel {
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--c-lavender);
}
.dnote {
    font-family: var(--f-mono);
    font-size: 10px;
    color: var(--c-mauve);
    letter-spacing: 0.05em;
}

/* --------------------------------------------------------------------------
   SECTION 3 :: EVIDENCE — constellation scatter
   -------------------------------------------------------------------------- */
.section-evidence {
    background: var(--c-void);
    color: var(--c-bg);
    padding-top: 13vh;
    padding-bottom: 10vh;
    overflow: hidden;
}
.section-evidence .section-marker { color: var(--c-mauve); }

.evidence-title {
    font-size: clamp(80px, 12vw, 170px);
    margin-bottom: 40px;
}
.evidence-title .title-line { display: inline; }

.constellation {
    position: relative;
    width: 100%;
    height: 78vh;
    margin-top: 30px;
}

.constellation-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.frag {
    position: absolute;
    left: var(--fx);
    top: var(--fy);
    width: 240px;
    transform: translate(-50%, -50%);
    padding: 12px 14px;
    background: rgba(61, 44, 94, 0.24);
    border-left: 2px solid var(--c-orange);
    backdrop-filter: blur(2px);
}
.frag-meta {
    display: block;
    font-family: var(--f-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--c-orange);
    text-transform: uppercase;
    margin-bottom: 6px;
}
.frag p {
    font-family: var(--f-body);
    font-size: 14px;
    line-height: 1.55;
    color: var(--c-bg);
    margin: 0 0 8px 0;
}
.frag-coord {
    font-family: var(--f-mono);
    font-size: 10px;
    color: var(--c-mauve);
    letter-spacing: 0.08em;
}

.scatter-blobs {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.scatter-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    mix-blend-mode: screen;
}

/* --------------------------------------------------------------------------
   SECTION 4 :: THEORY — narrow paper column
   -------------------------------------------------------------------------- */
.section-theory {
    background: var(--c-bg);
    padding: 14vh 6vw 12vh;
}

.paper-column {
    max-width: 380px;
    margin: 0 auto;
    color: var(--c-graphite);
}

.paper-title {
    font-family: var(--f-display);
    color: var(--c-orange);
    font-size: clamp(56px, 8vw, 110px);
    line-height: 0.9;
    letter-spacing: -0.03em;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    position: relative;
    font-weight: 400;
}

.paper-meta {
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--c-lavender);
    text-transform: uppercase;
    border-top: 1px solid var(--c-lavender);
    border-bottom: 1px solid var(--c-lavender);
    padding: 8px 0;
    margin: 24px 0 32px;
}

.paper-column p {
    font-family: var(--f-body);
    font-size: 17px;
    line-height: 1.75;
    margin-bottom: 1.4em;
}

.paper-pullout {
    font-family: var(--f-head);
    font-weight: 500;
    font-size: 22px;
    line-height: 1.4;
    color: var(--c-twilight);
    border-left: 3px solid var(--c-orange);
    padding: 8px 0 8px 18px;
    margin: 32px -36px 32px 0 !important;     /* overflow right */
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   SECTION 5 :: FIELD — 12-col x 8-row grid, sparse
   -------------------------------------------------------------------------- */
.section-field {
    background: var(--c-twilight);
    color: var(--c-bg);
    padding-top: 13vh;
    padding-bottom: 14vh;
}
.section-field .section-marker { color: var(--c-mauve); }

.field-title {
    color: var(--c-orange);
    font-size: clamp(80px, 12vw, 170px);
    margin-bottom: 50px;
}
.field-title .title-line { display: inline; }

.field-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 110px;
    gap: 16px;
    margin-top: 24px;
}

.cell {
    grid-column: var(--c) / span var(--cs);
    grid-row: var(--r) / span var(--rs);
    padding: 16px 18px;
    border: 1px solid rgba(240, 237, 230, 0.22);
    background: rgba(26, 26, 46, 0.30);
    color: var(--c-bg);
    font-family: var(--f-body);
    font-size: 15px;
    line-height: 1.55;
    overflow: hidden;
}
.cell p { margin: 0 0 0.6em 0; font-size: 15px; }
.cell-tag {
    display: block;
    font-family: var(--f-mono);
    font-size: 10px;
    color: var(--c-orange);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.cell--ink {
    background: var(--c-void);
    border-color: var(--c-orange);
}
.cell--accent {
    background: var(--c-orange);
    color: var(--c-void);
    border-color: var(--c-orange);
}
.cell--accent .cell-tag { color: var(--c-void); }
.cell--mute {
    background: transparent;
    border-color: rgba(240, 237, 230, 0.18);
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--c-mauve);
}
.cell--mute .cell-tag { color: var(--c-lavender); }

/* --------------------------------------------------------------------------
   SECTION 6 :: RESIDUE
   -------------------------------------------------------------------------- */
.section-residue {
    background: var(--c-bg);
    color: var(--c-graphite);
    padding: 16vh 6vw 10vh;
    margin-bottom: 0;
}
.residue-content {
    max-width: 720px;
    margin-left: 12%;
}
.section-residue .display-title {
    font-size: clamp(72px, 11vw, 150px);
    margin-bottom: 30px;
}
.residue-line {
    font-family: var(--f-body);
    font-size: 19px;
    line-height: 1.75;
    color: var(--c-graphite);
    max-width: 620px;
}
.residue-foot {
    margin-top: 60px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--c-lavender);
    text-transform: uppercase;
    border-top: 1px solid var(--c-lavender);
    padding-top: 14px;
}

/* --------------------------------------------------------------------------
   Navigation cluster
   -------------------------------------------------------------------------- */
.nav-cluster {
    position: fixed;
    bottom: 36px;
    left: 28px;
    width: 140px;
    height: 80px;
    z-index: 50;
    pointer-events: none;
}

.nav-dot {
    position: absolute;
    bottom: calc(20px + var(--dy));
    left: calc(0px + var(--dx));
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--c-mauve);
    pointer-events: auto;
    transition: background 240ms ease, transform 240ms ease;
    cursor: pointer;
}
.nav-dot::after {
    content: attr(data-label);
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--f-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--c-graphite);
    background: var(--c-bg);
    padding: 3px 7px;
    border: 1px solid var(--c-lavender);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-50%) translateX(-6px);
    transition: opacity 240ms ease, transform 240ms ease;
    pointer-events: none;
}
.nav-dot:hover {
    background: var(--c-orange);
    transform: scale(1.25);
}
.nav-dot:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.nav-dot.is-active {
    background: var(--c-orange);
}
.nav-dot .dot-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1.5px solid var(--c-orange);
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 320ms ease, transform 600ms cubic-bezier(0.37,0,0.63,1);
}
.nav-dot.is-active .dot-ring {
    opacity: 1;
    transform: scale(1);
}

/* --------------------------------------------------------------------------
   Title underline draw — toggled in JS via .is-drawn
   -------------------------------------------------------------------------- */
.title-underline line {
    transition: stroke-dashoffset 0.8s cubic-bezier(0.37, 0, 0.63, 1);
}
.is-drawn .title-underline line {
    stroke-dashoffset: 0 !important;
}

/* connecting lines in bg */
.connect-line line {
    transition: stroke-dashoffset 1.6s cubic-bezier(0.37, 0, 0.63, 1);
}
.connect-line.is-drawn line {
    stroke-dashoffset: 0;
}

/* fragment fade-up */
.frag {
    opacity: 0;
    transform: translate(-50%, -42%);
    transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.37,0,0.63,1);
}
.frag.is-in {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.cell {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.37,0,0.63,1);
}
.cell.is-in {
    opacity: 1;
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Responsive — keep anti-design but readable on small screens
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .section { padding: 8vh 6vw; }
    .hero-content { width: 88%; }
    .concept-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .col-label { height: auto; }
    .vlabel {
        position: static;
        transform: none;
        display: inline-block;
        margin-bottom: 12px;
    }
    .col-text { padding-right: 0; }
    .col-diagrams { border-left: none; padding-left: 0; }
    .constellation { height: auto; }
    .frag {
        position: relative;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        width: auto;
        margin-bottom: 18px;
    }
    .frag.is-in { transform: none !important; }
    .constellation-lines { display: none; }
    .field-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: auto;
    }
    .cell {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
    }
    .residue-content { margin-left: 0; }
    .paper-pullout { margin-right: 0 !important; }
    .nav-cluster { bottom: 16px; left: 14px; }
    .overflow-right, .overflow-left { margin-right: 0; margin-left: 0; }
}
