/* ============================================================
   tsundere.review — Styles
   Palette: sepia-nostalgic + neon intrusions
   Typography: eclectic hybrid (Bebas Neue / Lora / Space Mono / Fraunces)
   Layout: ma-negative-space
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    --parchment: #F5E6C8;
    --cream: #E8D5A3;
    --sepia-dark: #3D2B1F;
    --amber-dark: #8B5A2B;
    --amber-burnt: #C4783A;
    --amber-faded: #A67C52;
    --espresso: #2A1A0E;
    --intrusion: #FF6B1A;
    --gold: #D4AF37;

    --font-display: 'Bebas Neue', sans-serif;
    --font-body: 'Lora', serif;
    --font-mono: 'Space Mono', monospace;
    --font-accent: 'Fraunces', serif;

    --margin-left: 20vw;
    --content-max: 48ch;
    --transition-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--parchment);
    color: var(--sepia-dark);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.8;
    overflow-x: hidden;
    cursor: none;
    position: relative;
}

/* ---------- Custom Cursor ---------- */
.cursor {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--amber-dark);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background 0.2s;
    mix-blend-mode: multiply;
}

.cursor-trail {
    position: fixed;
    width: 32px;
    height: 32px;
    border: 1px solid var(--amber-faded);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: transform 0.12s var(--transition-soft), opacity 0.2s;
    opacity: 0.5;
}

/* ---------- Crack SVG Overlay ---------- */
.crack-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.crack-line {
    fill: none;
    stroke: var(--amber-dark);
    stroke-width: 1;
    opacity: 0.15;
    stroke-linecap: round;
}

/* ---------- Strata Lines ---------- */
.strata-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.stratum {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--amber-faded);
    opacity: 0.3;
}

/* ---------- Side Navigation ---------- */
.side-nav {
    position: fixed;
    left: calc(var(--margin-left) * 0.35);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 24px;
    z-index: 100;
}

.side-nav-item {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--amber-faded);
    text-decoration: none;
    letter-spacing: 0.1em;
    transition: color 0.3s;
    writing-mode: horizontal-tb;
}

.side-nav-item.active,
.side-nav-item:hover {
    color: var(--amber-dark);
}

.side-nav-item::before {
    content: '—';
    margin-right: 4px;
    opacity: 0;
    transition: opacity 0.3s;
}

.side-nav-item.active::before {
    opacity: 1;
}

/* ---------- Sections Base ---------- */
.section {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ---------- Section 1: Entry Chamber ---------- */
.section--entry {
    min-height: 100vh;
    background: var(--parchment);
    display: flex;
    align-items: flex-start;
    padding-top: 14vh;
}

.entry-content {
    width: 100%;
    padding-left: var(--margin-left);
    position: relative;
}

.entry-title-block {
    position: relative;
    z-index: 10;
}

.main-title {
    font-family: var(--font-display);
    font-size: clamp(64px, 11vw, 160px);
    color: var(--amber-dark);
    letter-spacing: -0.02em;
    line-height: 0.9;
    text-transform: uppercase;
    user-select: none;
    display: block;
    will-change: transform;
}

.tagline {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 400;
    color: var(--amber-faded);
    letter-spacing: 0.08em;
    margin-top: 16px;
    will-change: transform;
}

.entry-silence {
    height: 36vh;
}

.crystal-container--entry {
    position: absolute;
    right: 8vw;
    bottom: 8vh;
    width: 320px;
    height: 320px;
    z-index: 5;
}

.crystal-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.crystal-container {
    position: relative;
}

/* Specimen Labels */
.specimen-label {
    position: absolute;
    bottom: -32px;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.label-text {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.15em;
    border: 1px solid var(--gold);
    padding: 2px 8px;
    display: inline-block;
    background: rgba(245, 230, 200, 0.7);
}

.label-meta {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 400;
    color: var(--amber-faded);
    letter-spacing: 0.05em;
    padding-left: 4px;
}

/* ---------- Section 2: Judgment Floor ---------- */
.section--judgment {
    min-height: 120vh;
    background: var(--parchment);
    position: relative;
    padding-left: var(--margin-left);
    padding-top: 12vh;
    padding-bottom: 8vh;
}

.judgment-crystal-zone {
    position: absolute;
    top: 10vh;
    left: var(--margin-left);
    width: 45vw;
    height: 50vh;
    z-index: 5;
}

.crystal-container--judgment {
    width: 100%;
    height: 100%;
}

.crystal-halo {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 3;
}

.crystal-halo--judgment {
    width: 500px;
    height: 500px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(196, 120, 58, 0.18) 0%, transparent 70%);
}

.crystal-halo--small {
    width: 240px;
    height: 240px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(196, 120, 58, 0.15) 0%, transparent 70%);
}

.judgment-text-zone {
    position: absolute;
    right: 8vw;
    top: 30vh;
    width: 36vw;
    max-width: 580px;
    z-index: 10;
}

.specimen-label--judgment {
    position: relative;
    bottom: unset;
    left: unset;
    margin-bottom: 24px;
}

.review-title-block {
    margin-bottom: 32px;
    will-change: transform;
}

.review-title {
    font-family: var(--font-display);
    font-size: clamp(40px, 5vw, 72px);
    color: var(--sepia-dark);
    letter-spacing: -0.02em;
    line-height: 1;
    text-transform: uppercase;
}

.review-subtitle {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--amber-faded);
    letter-spacing: 0.08em;
    margin-top: 8px;
}

.review-body {
    will-change: transform;
}

.review-text {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.8;
    color: var(--sepia-dark);
    margin-bottom: 20px;
    max-width: var(--content-max);
}

/* Judgment Score */
.judgment-score {
    position: absolute;
    bottom: -6vh;
    right: 0;
    z-index: 20;
    overflow: visible;
}

.score-numeral {
    font-family: var(--font-display);
    font-size: 200px;
    color: var(--intrusion);
    letter-spacing: -0.04em;
    line-height: 0.85;
    user-select: none;
    opacity: 0.9;
}

.strata-lines--judgment {
    position: absolute;
    bottom: 20%;
    left: 0;
    right: 0;
    height: 80px;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 24px,
        rgba(166, 124, 82, 0.25) 24px,
        rgba(166, 124, 82, 0.25) 25px
    );
}

/* ---------- Section 3: Specimen Archive ---------- */
.section--archive {
    min-height: auto;
    background: var(--cream);
    padding-left: var(--margin-left);
    padding-top: 10vh;
    padding-bottom: 10vh;
}

.archive-header {
    display: flex;
    align-items: baseline;
    gap: 32px;
    margin-bottom: 8vh;
    padding-right: 8vw;
}

.archive-label {
    font-family: var(--font-display);
    font-size: 48px;
    color: var(--amber-dark);
    letter-spacing: -0.02em;
    text-transform: uppercase;
    will-change: transform;
}

.archive-count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--amber-faded);
    letter-spacing: 0.12em;
    margin-top: 4px;
}

/* Archive Strips */
.archive-strip {
    display: grid;
    grid-template-columns: 20vw 40vw 1fr;
    align-items: center;
    min-height: 80vh;
    border-top: 1px solid rgba(166, 124, 82, 0.2);
    position: relative;
    cursor: default;
}

.archive-strip:last-child {
    border-bottom: 1px solid rgba(166, 124, 82, 0.2);
}

.strip-crystal-zone {
    position: relative;
    height: 200px;
    width: 200px;
    justify-self: end;
}

.crystal-canvas--small {
    width: 200px;
    height: 200px;
}

.strip-void {
    /* intentional emptiness — the ma */
}

.strip-content {
    padding-right: 8vw;
    will-change: transform;
}

.specimen-label--strip {
    position: relative;
    bottom: unset;
    left: unset;
    margin-bottom: 16px;
}

.strip-title {
    font-family: var(--font-display);
    font-size: clamp(28px, 3.5vw, 52px);
    color: var(--sepia-dark);
    letter-spacing: -0.02em;
    text-transform: uppercase;
    line-height: 0.95;
    margin-bottom: 12px;
}

.strip-excerpt {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    color: var(--amber-faded);
    max-width: 40ch;
    margin-bottom: 16px;
}

.strip-score {
    font-family: var(--font-display);
    font-size: 72px;
    color: var(--amber-dark);
    letter-spacing: -0.04em;
    line-height: 1;
    display: block;
    opacity: 0.7;
    transition: opacity 0.3s, color 0.3s;
}

.archive-strip:hover .strip-score {
    opacity: 1;
    color: var(--amber-burnt);
}

/* ---------- Section 4: Contradiction Hall ---------- */
.section--contradiction {
    min-height: 100vh;
    background: var(--espresso);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.contradiction-crystal-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(196, 120, 58, 0.25) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 50%, rgba(139, 90, 43, 0.15) 0%, transparent 50%);
    z-index: 1;
}

.crystal-canvas--bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vmin;
    height: 80vmin;
    z-index: 2;
    opacity: 0.3;
    pointer-events: none;
}

.contradiction-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 10vw;
}

.contradiction-quote {
    font-family: var(--font-accent);
    font-style: italic;
    font-size: clamp(28px, 5vw, 64px);
    color: var(--intrusion);
    line-height: 1.2;
    font-weight: 400;
    max-width: 800px;
    margin: 0 auto;
    letter-spacing: -0.01em;
}

.quote-mark {
    font-size: 1.2em;
    color: var(--gold);
    opacity: 0.7;
}

.contradiction-silence {
    height: 20vh;
}

/* ---------- Section 5: Terminal Panel ---------- */
.section--terminal {
    min-height: 100vh;
    background: var(--espresso);
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.terminal-lattice {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    z-index: 1;
    pointer-events: none;
}

.terminal-content {
    position: relative;
    z-index: 10;
    padding-left: var(--margin-left);
    padding-right: 8vw;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 60px;
    align-items: start;
}

.terminal-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    will-change: transform;
}

.nav-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--amber-faded);
    margin-bottom: 8px;
    opacity: 0.6;
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--amber-faded);
    text-decoration: none;
    letter-spacing: 0.06em;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--amber-burnt);
}

.terminal-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.terminal-line {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--amber-faded);
    letter-spacing: 0.04em;
}

.terminal-line--timestamp {
    color: var(--amber-dark);
    font-size: 11px;
    opacity: 0.6;
    margin-top: 16px;
}

.terminal-stratum {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 24px;
    opacity: 0.3;
}

.stratum-line {
    flex: 1;
    height: 1px;
    background: var(--amber-faded);
}

.stratum-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--amber-faded);
    letter-spacing: 0.2em;
    white-space: nowrap;
}

/* ---------- Crystal Lattice Texture (background texture) ---------- */
.section--archive::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(60deg, rgba(166, 124, 82, 0.04) 0px, rgba(166, 124, 82, 0.04) 1px, transparent 1px, transparent 40px),
        repeating-linear-gradient(-60deg, rgba(166, 124, 82, 0.04) 0px, rgba(166, 124, 82, 0.04) 1px, transparent 1px, transparent 40px);
    pointer-events: none;
    z-index: 0;
}

/* ---------- Magnetic Element Base ---------- */
.repel-text {
    will-change: transform;
    transition: transform 0.4s var(--transition-spring);
}

[data-magnetic="attract"] {
    will-change: transform;
}

/* ---------- Scrollbar Styling ---------- */
::-webkit-scrollbar {
    width: 3px;
}

::-webkit-scrollbar-track {
    background: var(--parchment);
}

::-webkit-scrollbar-thumb {
    background: var(--amber-faded);
    border-radius: 2px;
}

/* ---------- Selection ---------- */
::selection {
    background: var(--amber-dark);
    color: var(--parchment);
}

/* ---------- Link base ---------- */
a {
    color: inherit;
    text-decoration: none;
}

/* ---------- Lattice overlay on archive section ---------- */
.section--archive::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(166, 124, 82, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(166, 124, 82, 0.08) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

/* ---------- Archive strip relative positioning fix ---------- */
.archive-strip > * {
    position: relative;
    z-index: 5;
}

/* ---------- Judgment crystal canvas absolute position ---------- */
.crystal-container--judgment .crystal-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ---------- Pull-quote on contradiction section ---------- */
.quote-text {
    display: inline;
}

/* ---------- Entry crystal canvas positioning ---------- */
.crystal-container--entry .crystal-canvas {
    width: 320px;
    height: 320px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    :root {
        --margin-left: 8vw;
    }

    .archive-strip {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        padding: 40px 0;
        min-height: unset;
    }

    .strip-crystal-zone {
        justify-self: start;
        margin-bottom: 24px;
    }

    .strip-void {
        display: none;
    }

    .strip-content {
        padding-right: 8vw;
    }

    .judgment-crystal-zone {
        position: relative;
        top: unset;
        left: unset;
        width: 100%;
        height: 40vh;
        margin-bottom: 32px;
    }

    .judgment-text-zone {
        position: relative;
        right: unset;
        top: unset;
        width: 100%;
        max-width: none;
        padding-left: var(--margin-left);
        padding-right: 8vw;
    }

    .judgment-score {
        position: relative;
        bottom: unset;
    }

    .section--judgment {
        display: flex;
        flex-direction: column;
    }

    .side-nav {
        display: none;
    }

    .terminal-content {
        grid-template-columns: 1fr;
    }
}
