/* resar.one - Swiss Typography meets Terminal */

:root {
    --proof-paper: #fafafa;
    --structure: #e0e0e0;
    --assertion: #d42020;
    --ink: #1a1a1a;
    --terminal-tint: #f4f4f4;
    --footnote: #888888;
    --rule: #cccccc;
    --weight: #2a2a2a;
    --grid-unit: 8px;
}

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

body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    color: var(--ink);
    background-color: var(--proof-paper);
    overflow-x: hidden;
    line-height: 1.8;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    cursor: crosshair;

    /* Visible grid lines */
    background-image:
        repeating-linear-gradient(
            90deg,
            var(--structure) 0,
            var(--structure) 1px,
            transparent 1px,
            transparent calc(100vw / 12)
        ),
        repeating-linear-gradient(
            0deg,
            rgba(224, 224, 224, 0.1) 0,
            rgba(224, 224, 224, 0.1) 1px,
            transparent 1px,
            transparent var(--grid-unit)
        );
    background-size: 100% 100%, 100% var(--grid-unit);
}

h2 {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 2vw, 1.8rem);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    color: var(--weight);
}

/* Grid Container - 12 column Swiss grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0 calc(var(--grid-unit) * 2);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 calc(var(--grid-unit) * 2);
}

/* Section 1: Thesis */
#thesis {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: calc(var(--grid-unit) * 8) 0;
}

.thesis-title {
    grid-column: 2 / 9;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--ink);
    line-height: 0.95;
    opacity: 0;
    animation: titleAppear 0.6s ease 0.5s forwards;
}

.thesis-statement {
    grid-column: 2 / 9;
    margin-top: calc(var(--grid-unit) * 3);
    opacity: 0;
    animation: fadeIn 0.6s ease 1s forwards;
    max-width: 50ch;
}

@keyframes titleAppear {
    from { opacity: 0; letter-spacing: 0.05em; }
    to { opacity: 1; letter-spacing: -0.01em; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Section 2: Argument */
#argument {
    min-height: 200vh;
    padding: calc(var(--grid-unit) * 12) 0;
}

#argument .grid-container {
    display: flex;
    flex-direction: column;
    gap: calc(var(--grid-unit) * 8);
}

.argument-block {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0 calc(var(--grid-unit) * 2);
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.argument-block.visible {
    opacity: 1;
    transform: translateX(0);
}

.arg-marker {
    grid-column: 1 / 2;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--assertion);
    padding-top: 0.2em;
}

.arg-content {
    grid-column: 2 / 9;
}

.arg-content p {
    max-width: 55ch;
}

/* Section 3: Proof */
#proof {
    min-height: 100vh;
    padding: calc(var(--grid-unit) * 12) 0;
}

.proof-block {
    grid-column: 1 / 13;
    background-color: var(--terminal-tint);
    position: relative;
    padding: calc(var(--grid-unit) * 4) calc(var(--grid-unit) * 5);
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.proof-block.visible {
    opacity: 1;
    transform: translateX(0);
}

.proof-border {
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 0;
    background-color: var(--assertion);
    transition: height 0.6s ease 0.2s;
}

.proof-block.visible .proof-border {
    height: 100%;
}

.proof-code {
    font-family: 'Fira Code', monospace;
    font-size: clamp(0.85rem, 1vw, 1rem);
    line-height: 1.6;
    color: var(--ink);
    white-space: pre;
    overflow-x: auto;
}

/* Section 4: Axiom */
#axiom {
    min-height: 50vh;
    padding: calc(var(--grid-unit) * 12) 0;
    display: flex;
    align-items: center;
}

.axiom-text {
    grid-column: 1 / 13;
    text-align: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: var(--ink);
    opacity: 0;
    transition: opacity 0.8s ease-in;
}

.axiom-text.visible {
    opacity: 1;
}

.axiom-rule {
    grid-column: 1 / 13;
    height: 1px;
    background-color: var(--rule);
    margin-top: calc(var(--grid-unit) * 4);
    width: 0;
    transition: width 0.6s ease 0.3s;
}

.axiom-rule.visible {
    width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .arg-content {
        grid-column: 2 / 12;
    }

    .thesis-title {
        grid-column: 1 / 12;
    }

    .thesis-statement {
        grid-column: 1 / 12;
    }

    .proof-block {
        padding: calc(var(--grid-unit) * 2) calc(var(--grid-unit) * 3);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .thesis-title,
    .thesis-statement,
    .argument-block,
    .proof-block,
    .axiom-text {
        opacity: 1 !important;
        transform: none !important;
    }

    .proof-border {
        height: 100% !important;
    }

    .axiom-rule {
        width: 100% !important;
    }
}
