/* === CSS Custom Properties === */
:root {
    --bg-primary: #2a2a2e;
    --bg-deep: #1e1e22;
    --text-primary: #d4c9b0;
    --text-display: #c4a35a;
    --aurora-green: #7aad8b;
    --aurora-violet: #9b7aad;
    --aurora-teal: #6a9ea8;
    --muted: #5a5a60;
    --gold: #b89a4a;
    --font-display: 'Bebas Neue', sans-serif;
    --font-body: 'Source Serif 4', serif;
    --font-mono: 'IBM Plex Mono', monospace;
    --band-bg-0: #2a2a2e;
    --band-bg-1: #2e2a28;
    --band-bg-2: #282a2e;
    --band-bg-3: #2a2e2c;
    --band-bg-4: #2e2a2d;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow: hidden;
}

/* === Scroll Container === */
#scroll-container {
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
}

/* === Sections === */
.section {
    position: relative;
    height: 100vh;
    scroll-snap-align: start;
    overflow: hidden;
}

.section-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* === Scan Lines Overlay === */
.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.06) 2px,
        rgba(0, 0, 0, 0.06) 4px
    );
    pointer-events: none;
    z-index: 10;
}

/* === Section Entry Animation === */
.section-content {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 400ms ease, transform 400ms ease;
}

.section-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Aurora Gradient Keyframes === */
@keyframes aurora-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* === Block Cursor === */
@keyframes cursor-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.block-cursor {
    display: inline-block;
    width: 12px;
    height: 1.3em;
    background: var(--gold);
    vertical-align: text-bottom;
    animation: cursor-blink 1s steps(1) infinite;
    margin-left: 2px;
}

/* ============================================
   SECTION 0: BOOT SEQUENCE
   ============================================ */
#section-boot {
    background: var(--bg-deep);
}

.boot-content {
    justify-content: flex-start;
    align-items: flex-start;
    padding: 2rem;
}

#terminal-output {
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 1.2vw, 0.95rem);
    letter-spacing: 0.05em;
    line-height: 1.55;
    color: var(--aurora-green);
    white-space: pre-wrap;
    min-height: 8em;
}

.boot-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    opacity: 0;
}

.boot-title.show {
    animation: title-fade-in 1.2s ease forwards;
}

@keyframes title-fade-in {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 10px));
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.site-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 400;
    letter-spacing: 0.12em;
    line-height: 1.0;
    color: var(--text-display);
}

.aurora-lines {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: -1;
}

.aurora-line {
    display: block;
    height: 1px;
    background: linear-gradient(135deg, var(--aurora-green) 0%, var(--aurora-teal) 35%, var(--aurora-violet) 70%, var(--aurora-green) 100%);
    background-size: 200% 200%;
    animation: aurora-shift 12s ease infinite;
    transform: scaleX(0);
    transform-origin: center;
}

.aurora-line.draw {
    animation: line-draw 0.8s ease forwards, aurora-shift 12s ease infinite;
}

@keyframes line-draw {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.boot-prompt {
    position: absolute;
    bottom: 3rem;
    left: 2rem;
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 1.2vw, 0.95rem);
    letter-spacing: 0.05em;
    color: var(--muted);
    opacity: 0;
}

.boot-prompt.show {
    opacity: 1;
    transition: opacity 0.6s ease;
}

/* ============================================
   SECTION 1: THESIS ABSTRACT
   ============================================ */
#section-thesis {
    background: var(--bg-primary);
}

.thesis-content {
    position: relative;
}

.aurora-border-left {
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(135deg, var(--aurora-green) 0%, var(--aurora-teal) 35%, var(--aurora-violet) 70%, var(--aurora-green) 100%);
    background-size: 200% 200%;
    animation: aurora-shift 12s ease infinite;
}

.thesis-text {
    max-width: 48ch;
    padding: 2rem;
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    color: var(--text-primary);
}

.thesis-text p {
    margin-bottom: 1.5em;
}

.thesis-text p:last-child {
    margin-bottom: 0;
}

.thesis-text em {
    font-style: italic;
    color: var(--text-display);
}

.thesis-text strong {
    font-weight: 600;
    color: var(--text-display);
}

/* ============================================
   SECTION 2: THE ARCHIVE
   ============================================ */
#section-archive {
    background: var(--bg-primary);
}

.archive-content {
    flex-direction: column;
    padding: 0;
}

.archive-band {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow: hidden;
    transition: flex 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    position: relative;
}

.archive-band[data-band="0"] { background: var(--band-bg-0); }
.archive-band[data-band="1"] { background: var(--band-bg-1); }
.archive-band[data-band="2"] { background: var(--band-bg-2); }
.archive-band[data-band="3"] { background: var(--band-bg-3); }
.archive-band[data-band="4"] { background: var(--band-bg-4); }

.band-keyword {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-weight: 400;
    letter-spacing: 0.12em;
    line-height: 1.0;
    color: var(--text-display);
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.band-text {
    max-width: 48ch;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.4s ease 0.2s, max-height 0.6s ease;
    padding: 0 2rem;
    text-align: center;
}

.band-text p {
    font-family: var(--font-body);
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    color: var(--text-primary);
}

.archive-band.expanded {
    flex: 5;
}

.archive-band.compressed {
    flex: 0.5;
}

.archive-band.expanded .band-text {
    opacity: 1;
    max-height: 300px;
}

.archive-band.compressed .band-keyword {
    transform: scale(0.6);
}

/* ============================================
   SECTION 3: THE PROOF
   ============================================ */
#section-proof {
    background: var(--bg-deep);
}

.proof-content {
    position: relative;
}

.dissolving-figure {
    width: min(60vw, 500px);
    height: min(60vh, 500px);
    position: relative;
}

.dissolving-figure canvas {
    width: 100%;
    height: 100%;
}

/* Quote orbit ring */
.quote-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    animation: quote-orbit 90s linear infinite;
}

@keyframes quote-orbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.orbit-quote {
    position: absolute;
    font-family: var(--font-mono);
    font-size: clamp(0.6rem, 0.9vw, 0.75rem);
    color: var(--muted);
    white-space: nowrap;
    letter-spacing: 0.05em;
    --angle: calc(var(--i) * 45deg);
    --radius: min(35vw, 300px);
    left: calc(cos(var(--angle)) * var(--radius));
    top: calc(sin(var(--angle)) * var(--radius));
    transform: rotate(calc(var(--angle) + 90deg));
    transform-origin: center;
}

/* ============================================
   SECTION 4: COLOPHON
   ============================================ */
#section-colophon {
    background: var(--bg-deep);
}

.colophon-content {
    position: relative;
}

.colophon-aurora-top,
.colophon-aurora-bottom {
    position: absolute;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(135deg, var(--aurora-green) 0%, var(--aurora-teal) 35%, var(--aurora-violet) 70%, var(--aurora-green) 100%);
    background-size: 200% 200%;
    animation: aurora-shift 12s ease infinite;
    pointer-events: none;
}

.colophon-aurora-top {
    top: 0;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.15), transparent);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.15), transparent);
}

.colophon-aurora-bottom {
    bottom: 0;
    mask-image: linear-gradient(to top, rgba(0,0,0,0.15), transparent);
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.15), transparent);
}

.colophon-body {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.session-meta {
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 1.2vw, 0.95rem);
    letter-spacing: 0.05em;
    color: var(--aurora-green);
}

.colophon-statement {
    max-width: 48ch;
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    color: var(--text-primary);
    padding: 0 2rem;
}

.ascii-art {
    font-family: var(--font-mono);
    font-size: clamp(0.45rem, 0.9vw, 0.7rem);
    line-height: 1.3;
    color: var(--text-display);
    letter-spacing: 0.02em;
    white-space: pre;
}

.colophon-domain {
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 1.2vw, 0.95rem);
    letter-spacing: 0.05em;
    color: var(--muted);
}

/* === Responsive adjustments === */
@media (max-width: 600px) {
    .thesis-text {
        max-width: 100%;
        padding: 1.5rem;
    }

    .band-text {
        padding: 0 1rem;
    }

    .orbit-quote {
        display: none;
    }

    .ascii-art {
        font-size: 0.35rem;
    }
}
