:root {
    --night-ink: #1a1a2e;
    --graph-blue: #b8cfe0;
    --cream-stock: #faf8f2;
    --reading-ink: #3a3a4a;
    --annotation: #6a7a8a;
    --climax-red: #d64545;
    --resolution-teal: #2a9d8f;
    --rising-gold: #d4a843;
}

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

body {
    font-family: 'Source Sans 3', sans-serif;
    background: var(--cream-stock);
    color: var(--reading-ink);
    overflow-x: hidden;
    position: relative;
}

/* Graph Paper Background */
.graph-paper {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 19.4px, var(--graph-blue) 19.4px, var(--graph-blue) 20px),
        repeating-linear-gradient(90deg, transparent, transparent 19.4px, var(--graph-blue) 19.4px, var(--graph-blue) 20px),
        repeating-linear-gradient(0deg, transparent, transparent 99px, rgba(184, 207, 224, 0.6) 99px, rgba(184, 207, 224, 0.6) 100px),
        repeating-linear-gradient(90deg, transparent, transparent 99px, rgba(184, 207, 224, 0.6) 99px, rgba(184, 207, 224, 0.6) 100px);
    opacity: 0.3;
}

/* Central Plot Axis */
.plot-axis {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.axis-progress {
    transition: y2 0.1s linear;
}

/* Sidebar */
.sidebar {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.sidebar-annotation {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.sidebar-annotation.active {
    opacity: 1;
}

.annotation-marker {
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    font-size: 0.75rem;
    color: var(--climax-red);
    min-width: 1.2rem;
    text-align: right;
}

.annotation-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: var(--annotation);
    text-transform: uppercase;
}

/* Content */
.content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Section Base */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.section-inner {
    position: relative;
    max-width: 480px;
    padding: 3rem 0;
}

.section-inner.left-aligned {
    margin-right: auto;
    padding-left: 3rem;
}

.section-inner.right-aligned {
    margin-left: auto;
    padding-right: 3rem;
}

/* Axis Dots */
.axis-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--climax-red);
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.left-aligned .axis-dot {
    right: -5px;
}

.right-aligned .axis-dot {
    left: -5px;
}

.section.visible .axis-dot {
    opacity: 1;
}

.climax-dot {
    width: 14px;
    height: 14px;
    background: var(--climax-red);
    box-shadow: 0 0 20px rgba(214, 69, 69, 0.4);
}

/* Typography */
.site-title {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--night-ink);
    margin-bottom: 0.5rem;
}

.site-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1rem;
    font-weight: 300;
    color: var(--annotation);
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
}

.section-title {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--night-ink);
    margin-bottom: 1.5rem;
}

.section-body {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.75;
    color: var(--reading-ink);
    margin-bottom: 1rem;
}

/* SVG Labels */
.axis-label-svg {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 8px;
    fill: var(--annotation);
    letter-spacing: 2px;
}

.arc-label-svg {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 7px;
    fill: var(--annotation);
    letter-spacing: 1px;
}

/* Plot Preview */
.plot-preview {
    margin: 1rem 0;
    background: rgba(250, 248, 242, 0.8);
    border: 1px solid var(--graph-blue);
    padding: 1.5rem;
}

.story-arc-preview {
    width: 100%;
    height: auto;
}

.arc-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 2s ease-in-out;
}

.section.visible .arc-path {
    stroke-dashoffset: 0;
}

/* Arc Examples */
.arc-examples {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.arc-example {
    border: 1px solid var(--graph-blue);
    padding: 0.75rem;
    background: rgba(250, 248, 242, 0.6);
    transition: border-color 0.3s ease;
}

.arc-example:hover {
    border-color: var(--rising-gold);
}

.mini-arc {
    width: 100%;
    height: auto;
}

.draw-path {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 1.5s ease-in-out;
}

.section.visible .draw-path {
    stroke-dashoffset: 0;
}

/* Tension Meter */
.tension-meter {
    margin: 1.5rem 0;
}

.tension-bar {
    width: 100%;
    height: 6px;
    background: var(--graph-blue);
    position: relative;
    overflow: hidden;
}

.tension-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--rising-gold), var(--climax-red));
    transition: width 1.5s ease-in-out;
}

.section.visible .tension-fill {
    width: 87%;
}

.tension-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--annotation);
    display: block;
    margin-top: 0.4rem;
}

/* Climax Data */
.climax-data {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--graph-blue);
}

.data-point {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.data-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--annotation);
}

.data-value {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--night-ink);
}

/* Footer */
.footer-graph {
    margin: 1.5rem 0;
    border: 1px solid var(--graph-blue);
    padding: 1rem;
    background: rgba(250, 248, 242, 0.6);
}

.resolution-arc {
    width: 100%;
    height: auto;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: 1rem;
    border-top: 1px solid var(--graph-blue);
    margin-top: 2rem;
}

.footer-domain {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--night-ink);
}

.footer-tag {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.75rem;
    font-weight: 300;
    font-style: italic;
    color: var(--annotation);
}

/* Reveal Animations */
.section-inner > *:not(.axis-dot) {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.visible .section-inner > *:not(.axis-dot) {
    opacity: 1;
    transform: translateY(0);
}

.section.visible .section-inner > *:nth-child(2) { transition-delay: 0.1s; }
.section.visible .section-inner > *:nth-child(3) { transition-delay: 0.2s; }
.section.visible .section-inner > *:nth-child(4) { transition-delay: 0.3s; }
.section.visible .section-inner > *:nth-child(5) { transition-delay: 0.4s; }
.section.visible .section-inner > *:nth-child(6) { transition-delay: 0.5s; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .section-inner.left-aligned,
    .section-inner.right-aligned {
        margin: 0 auto;
        padding: 2rem 1rem;
    }

    .arc-examples {
        grid-template-columns: 1fr;
    }

    .climax-data {
        grid-template-columns: 1fr;
    }
}
