/* monopole.quest — Anti-design / Broken-grid / Vintage scientific */

:root {
    --carmine: #8B2500;
    --teal: #1B4D5C;
    --ochre: #B8860B;
    --parchment: #F7F3ED;
    --graphite: #1A1A1E;
    --kraft: #D4C5A9;
    --soot: #2A2A2E;
    --slate: #5A5A6E;
    --sienna: #8B4513;
    --faded-blue: #B8C4D8;
    --light-bg: #E8EDF5;
    --spring-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.65;
    color: var(--soot);
    background-color: var(--parchment);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Commissioner', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    line-height: 0.95;
}

.body-text {
    max-width: 52ch;
    margin-bottom: 1.2em;
}

.annotation {
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--sienna);
    display: block;
}

.data-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--slate);
    display: block;
}

/* Handwriting SVG path-draw animation */
.handwriting-svg {
    display: block;
    width: 100%;
    max-width: 420px;
    height: auto;
    margin-top: 0.8rem;
    overflow: visible;
}

.handwriting-text {
    opacity: 0;
    transition: opacity 300ms ease;
}

.handwriting-text.drawn {
    opacity: 1;
}

.handwriting-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s ease;
}

.handwriting-path.drawn {
    stroke-dashoffset: 0;
}

/* Stamps */
.stamp {
    position: absolute;
    width: 90px;
    height: 90px;
    border: 3px solid var(--carmine);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.4;
    transform: rotate(-12deg);
    pointer-events: none;
    z-index: 100;
}

.stamp-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--carmine);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.4;
}

/* ===========================
   SECTION 1: Opening Field
   =========================== */
#opening-field {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: var(--graphite);
    overflow: hidden;
}

#field-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#title-container {
    position: absolute;
    bottom: 15%;
    right: -2%;
    z-index: 10;
    transform: rotate(-3.5deg);
}

#title-canvas {
    position: absolute;
    top: -20px;
    left: -40px;
    width: calc(100% + 80px);
    height: calc(100% + 40px);
    pointer-events: none;
    z-index: 1;
}

#site-title {
    font-size: clamp(3rem, 8vw, 7rem);
    color: var(--parchment);
    letter-spacing: -0.05em;
    opacity: 0;
    position: relative;
    z-index: 2;
}

#site-title.coalescing {
    animation: titleCoalesce 1200ms var(--spring-ease) forwards;
}

@keyframes titleCoalesce {
    0% {
        opacity: 0;
        filter: blur(8px);
        letter-spacing: 0.2em;
    }
    40% {
        opacity: 0.6;
        filter: blur(3px);
        letter-spacing: 0.02em;
    }
    70% {
        opacity: 0.9;
        filter: blur(1px);
        letter-spacing: -0.03em;
    }
    100% {
        opacity: 1;
        filter: blur(0);
        letter-spacing: -0.05em;
    }
}

#site-title.visible {
    opacity: 1;
}

.annotation-title {
    margin-top: 0.5rem;
    text-align: right;
    padding-right: 2rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 600ms ease 400ms, transform 600ms ease 400ms;
}

.annotation-title.visible {
    opacity: 1;
    color: var(--ochre);
    transform: translateY(0);
}

.stamp-01 {
    top: 8%;
    left: 5%;
    transform: rotate(-18deg);
}

/* ===========================
   SECTION 2: Thesis Wall
   =========================== */
#thesis-wall {
    position: relative;
    min-height: 150vh;
    padding: 120px 5% 80px;
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 8px;
    align-items: start;
}

.panel {
    position: relative;
    z-index: 10;
    opacity: 0;
    transition: opacity 700ms var(--spring-ease), transform 700ms var(--spring-ease);
}

.panel.revealed {
    opacity: 1;
    transform: translate(0, 0) !important;
}

.panel-left {
    grid-column: 1 / 8;
    grid-row: 1;
    transform: translateX(-80px) rotate(1.2deg);
    margin-top: 20px;
}

.panel-left.revealed {
    transform: rotate(1.2deg) !important;
}

.panel-center {
    grid-column: 5 / 13;
    grid-row: 1;
    transform: translateY(100px) rotate(-0.8deg);
    margin-top: 180px;
    z-index: 15;
    transition-delay: 200ms;
}

.panel-center.revealed {
    transform: rotate(-0.8deg) !important;
}

.panel-right {
    grid-column: 10 / 17;
    grid-row: 1;
    transform: translateY(-80px) rotate(2.1deg);
    margin-top: 60px;
    transition-delay: 400ms;
}

.panel-right.revealed {
    transform: rotate(2.1deg) !important;
}

.panel-inner {
    padding: 2.5rem 2rem;
    background-color: var(--parchment);
    position: relative;
}

.kraft-bg {
    background-color: var(--kraft);
}

.graph-paper {
    background-color: var(--light-bg);
    background-image:
        linear-gradient(var(--faded-blue) 1px, transparent 1px),
        linear-gradient(90deg, var(--faded-blue) 1px, transparent 1px);
    background-size: 20px 20px;
}

.panel-heading {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: var(--carmine);
    margin-bottom: 1.2rem;
}

/* ===========================
   SECTION 3: Evidence Strip
   =========================== */
#evidence-strip {
    position: relative;
    background-color: var(--graphite);
    padding: 60px 0;
    overflow: hidden;
    min-height: 100vh;
}

.strip-track {
    display: flex;
    gap: 40px;
    padding: 0 60px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.strip-track::-webkit-scrollbar {
    display: none;
}

.evidence-card {
    flex: 0 0 auto;
    width: 400px;
    scroll-snap-align: center;
    position: relative;
}

.evidence-canvas {
    display: block;
    width: 100%;
    height: 300px;
    background-color: var(--parchment);
    border: 1px solid var(--slate);
}

.evidence-label {
    font-family: 'Caveat', cursive;
    font-size: 1rem;
    color: var(--ochre);
    margin-top: 0.5rem;
    display: block;
    opacity: 0;
    transition: opacity 500ms ease;
}

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

.strip-annotations {
    position: absolute;
    bottom: 20px;
    right: 60px;
    text-align: right;
}

.strip-note-1,
.strip-note-2 {
    color: var(--sienna);
    opacity: 0.7;
}

.strip-note-2 {
    margin-top: 0.3rem;
}

/* ===========================
   SECTION 4: Annotation Field
   =========================== */
#annotation-field {
    position: relative;
    min-height: 150vh;
    padding: 100px 5%;
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 8px;
    align-items: start;
}

.field-block {
    position: relative;
    opacity: 0;
    transform: scaleX(0.85) scaleY(1.1);
    transition: opacity 500ms ease, transform 600ms var(--spring-ease), border-radius 8000ms ease;
}

.field-block.revealed {
    opacity: 1;
    transform: scaleX(1) scaleY(1);
}

.block-1 {
    grid-column: 2 / 8;
    grid-row: 1;
    padding: 2rem;
    background-color: var(--parchment);
    border: 1px solid var(--faded-blue);
}

.field-heading {
    font-size: clamp(1.2rem, 2.2vw, 1.8rem);
    color: var(--teal);
    margin-bottom: 0.8rem;
}

.block-2 {
    grid-column: 9 / 16;
    grid-row: 1;
    margin-top: 80px;
    padding: 2rem 1.5rem;
}

.pull-quote {
    position: relative;
    padding: 1rem 0;
    animation: quote-oscillate 12s ease-in-out infinite;
}

@keyframes quote-oscillate {
    0%, 100% { transform: rotate(-0.5deg); }
    50% { transform: rotate(0.5deg); }
}

.quote-mark {
    font-family: 'Commissioner', sans-serif;
    font-weight: 800;
    font-size: 4rem;
    color: var(--carmine);
    opacity: 0.3;
    line-height: 0.5;
    display: block;
}

.quote-mark-end {
    text-align: right;
}

.quote-text {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    line-height: 1.6;
    color: var(--soot);
    padding: 0.5rem 0;
    max-width: 45ch;
}

.block-3 {
    grid-column: 1 / 6;
    grid-row: 2;
    margin-top: 40px;
    text-align: center;
}

.block-3-svg {
    max-width: 300px;
    margin: 0.5rem auto 0;
}

#dot-matrix-canvas {
    display: block;
    width: 100%;
    max-width: 300px;
    height: 300px;
    margin: 0 auto;
}

.block-4 {
    grid-column: 7 / 13;
    grid-row: 2;
    margin-top: 120px;
    padding: 2rem;
    background-color: var(--kraft);
}

.status-list {
    list-style: none;
    margin-top: 0.8rem;
}

.status-list li {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 0.95rem;
    color: var(--soot);
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--faded-blue);
}

.status-list li:last-child {
    border-bottom: none;
}

.block-5 {
    grid-column: 10 / 17;
    grid-row: 2;
    margin-top: 20px;
    padding: 2rem;
    background-color: var(--light-bg);
    background-image:
        linear-gradient(var(--faded-blue) 1px, transparent 1px),
        linear-gradient(90deg, var(--faded-blue) 1px, transparent 1px);
    background-size: 20px 20px;
}

.block-6 {
    grid-column: 3 / 9;
    grid-row: 3;
    margin-top: 60px;
    text-align: center;
    padding: 2rem;
}

.meter-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.meter-svg {
    width: 200px;
    height: 120px;
    margin-bottom: 0.8rem;
}

.stamp-02 {
    bottom: -20px;
    right: -15px;
    transform: rotate(8deg);
}

.stamp-03 {
    top: 30%;
    right: 3%;
    transform: rotate(15deg);
}

/* ===========================
   SECTION 5: Terminal Statement
   =========================== */
#terminal-statement {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--parchment);
    padding: 80px 5%;
    overflow: hidden;
}

.terminal-content {
    max-width: 60ch;
    text-align: center;
    position: relative;
    z-index: 10;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms ease, transform 800ms ease;
}

.terminal-content.revealed {
    opacity: 1;
    transform: translateY(0);
}

.terminal-text {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(1.1rem, 1.6vw, 1.35rem);
    line-height: 1.75;
    color: var(--soot);
}

.terminal-date {
    margin-top: 3rem;
    text-align: center;
    opacity: 0;
    transition: opacity 600ms ease 400ms;
}

.terminal-date.revealed {
    opacity: 1;
}

#orbiting-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: var(--ochre);
    border-radius: 50%;
    z-index: 5;
    top: 50%;
    left: 50%;
    animation: orbit 60s linear infinite;
    box-shadow: 0 0 6px var(--ochre);
}

@keyframes orbit {
    0% { transform: translate(-50%, -50%) rotate(0deg) translateX(200px) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg) translateX(200px) rotate(-360deg); }
}

/* ===========================
   Noise / Grain Overlay
   =========================== */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
}

/* ===========================
   Ruler divider between sections
   =========================== */
.section-divider {
    width: 100%;
    height: 20px;
    position: relative;
    overflow: hidden;
}

/* ===========================
   Responsive: 768px
   =========================== */
@media (max-width: 768px) {
    #thesis-wall {
        display: flex;
        flex-direction: column;
        gap: 30px;
        padding: 60px 4% 60px;
    }

    .panel-left,
    .panel-center,
    .panel-right {
        width: 100%;
        margin-top: 0;
    }

    .panel-center {
        transition-delay: 0ms;
    }

    .panel-right {
        transition-delay: 0ms;
    }

    .panel-left.revealed {
        transform: rotate(1.2deg) !important;
    }

    .panel-center.revealed {
        transform: rotate(-0.8deg) !important;
    }

    .panel-right.revealed {
        transform: rotate(2.1deg) !important;
    }

    #evidence-strip {
        min-height: auto;
        padding: 40px 0;
    }

    .strip-track {
        flex-direction: column;
        padding: 0 4%;
        overflow-x: visible;
        gap: 30px;
    }

    .evidence-card {
        width: 100%;
    }

    .evidence-canvas {
        height: 220px;
    }

    #annotation-field {
        display: flex;
        flex-direction: column;
        gap: 30px;
        padding: 60px 4%;
    }

    .block-1, .block-2, .block-3, .block-4, .block-5, .block-6 {
        margin-top: 0;
    }

    #title-container {
        right: 2%;
        bottom: 10%;
    }

    #site-title {
        font-size: clamp(2.2rem, 10vw, 3.5rem);
    }
}

/* ===========================
   Responsive: 480px
   =========================== */
@media (max-width: 480px) {
    .panel-left.revealed {
        transform: rotate(0.6deg) !important;
    }

    .panel-center.revealed {
        transform: rotate(-0.4deg) !important;
    }

    .panel-right.revealed {
        transform: rotate(1deg) !important;
    }

    .panel-inner {
        padding: 1.5rem 1.2rem;
    }

    .panel-heading {
        font-size: 1.4rem;
    }

    .pull-quote {
        animation: none;
    }

    .quote-text {
        font-size: 1rem;
    }

    #terminal-statement {
        padding: 60px 5%;
    }

    .terminal-text {
        font-size: 1rem;
    }

    #orbiting-dot {
        animation-duration: 40s;
    }

    @keyframes orbit {
        0% { transform: translate(-50%, -50%) rotate(0deg) translateX(120px) rotate(0deg); }
        100% { transform: translate(-50%, -50%) rotate(360deg) translateX(120px) rotate(-360deg); }
    }
}
