/* ===== reasoner.studio — Wabi-Sabi Reasoning ===== */

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

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

body {
    background-color: #f5f0e8;
    color: #2b2926;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    line-height: 1.72;
    overflow-x: hidden;
    cursor: none;
}

/* --- Paper Texture Overlay --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image:
        repeating-radial-gradient(circle at 17% 32%, #2b2926 0.5px, transparent 0.5px),
        repeating-radial-gradient(circle at 63% 68%, #2b2926 0.3px, transparent 0.3px),
        repeating-radial-gradient(circle at 41% 11%, #2b2926 0.4px, transparent 0.4px),
        repeating-radial-gradient(circle at 89% 47%, #2b2926 0.3px, transparent 0.3px);
    background-size: 200px 200px, 150px 150px, 180px 180px, 160px 160px;
}

/* --- Canvas Ink Trail --- */
#ink-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
}

/* --- Cursor Fish --- */
#cursor-fish {
    position: fixed;
    width: 40px;
    height: 25px;
    pointer-events: none;
    z-index: 10001;
    transition: none;
    will-change: transform;
}

#cursor-fish svg {
    width: 100%;
    height: 100%;
}

/* --- Navigation Ticks --- */
#spread-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.nav-tick {
    background: none;
    border: none;
    cursor: none;
    padding: 4px;
    position: relative;
}

.nav-tick span {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #c9c1b4;
    transition: color 0.4s ease;
}

.nav-tick::before {
    content: '';
    position: absolute;
    right: calc(100% + 6px);
    top: 50%;
    width: 12px;
    height: 1px;
    background: #c9c1b4;
    transform: translateY(-50%);
    transition: width 0.3s ease, background 0.3s ease;
}

.nav-tick.active span {
    color: #2b2926;
}

.nav-tick.active::before {
    width: 24px;
    background: #b8943e;
}

/* --- Spreads (General) --- */
.spread {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* --- Spread 1: Opening --- */
.spread-opening {
    height: 100vh;
    display: flex;
    align-items: center;
    background-color: #f5f0e8;
}

.spread-bg-illustration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hero-illustration {
    width: 100%;
    height: 100%;
    opacity: 0.6;
}

.spread-1-content {
    position: relative;
    z-index: 2;
    padding-left: 15%;
    padding-top: 5vh;
}

.hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(3.5rem, 8vw, 7rem);
    letter-spacing: -0.02em;
    line-height: 0.95;
    color: #2b2926;
    transform: rotate(-1.5deg);
}

.hero-dot {
    color: #b8943e;
}

.hero-subtitle {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: #6b6560;
    margin-top: 1.5rem;
    padding-left: 0.3em;
    line-height: 1.4;
}

/* --- Spread 2: Thesis --- */
.spread-thesis {
    display: flex;
    min-height: 100vh;
    padding: 8vh 5% 8vh 5%;
    background-color: #f5f0e8;
    position: relative;
}

.kintsugi-vertical {
    position: absolute;
    left: 38%;
    top: 0;
    height: 100%;
    width: 20px;
    z-index: 3;
}

.kintsugi-path {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 3s ease;
}

.kintsugi-path.revealed {
    stroke-dashoffset: 0;
}

.spread-col-narrow {
    width: 35%;
    padding-right: 5%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2.5rem;
}

.spread-col-wide {
    width: 60%;
    padding-left: 5%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.8rem;
}

.fish-illustration {
    width: 100%;
    max-width: 160px;
    opacity: 0.7;
}

.lionfish {
    margin-bottom: 1rem;
}

/* --- Margin Notes --- */
.margin-note {
    font-family: 'Caveat', cursive;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    line-height: 1.5;
    color: #6b6560;
}

.margin-note-pushback {
    color: #8a9ba8;
    font-style: normal;
}

.margin-note-response {
    color: #b8943e;
}

/* --- Body Text --- */
.body-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    line-height: 1.72;
    max-width: 38em;
    color: #2b2926;
}

/* --- Pull Quote --- */
.pull-quote {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(1.3rem, 2vw, 1.8rem);
    line-height: 1.35;
    color: #2b2926;
    padding: 1.5rem 0;
    border-top: 1px solid #c9c1b4;
    border-bottom: 1px solid #c9c1b4;
    max-width: 32em;
}

/* --- Spread 3: Method --- */
.spread-method {
    min-height: 100vh;
    background-color: #e8e1d5;
    padding: 10vh 5%;
    display: flex;
    align-items: center;
}

.method-columns {
    display: flex;
    width: 100%;
    gap: 4%;
    align-items: flex-start;
}

.method-col {
    flex: 1;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.method-col.visible {
    opacity: 1;
    transform: translateY(0);
}

.method-col-1 {
    margin-top: 0;
    transition-delay: 0s;
}

.method-col-2 {
    margin-top: 8vh;
    transition-delay: 0.2s;
}

.method-col-3 {
    margin-top: 3vh;
    transition-delay: 0.4s;
}

.fish-diagram {
    width: 100%;
    max-width: 200px;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.diagram-label {
    font-family: 'Caveat', cursive;
    font-size: 7px;
    fill: #6b6560;
}

.method-heading {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b6560;
    margin-bottom: 1rem;
}

/* --- Spread 4: Counter-Argument --- */
.spread-counter {
    min-height: 100vh;
    display: flex;
    flex-wrap: wrap;
    padding: 10vh 5%;
    background-color: #f5f0e8;
    position: relative;
    align-items: center;
}

.spread-col-left {
    width: 58%;
    padding-right: 5%;
}

.spread-col-right {
    width: 35%;
    padding-left: 3%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.section-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: #2b2926;
    margin-bottom: 2.5rem;
}

.spread-counter .body-text {
    margin-bottom: 1.5rem;
}

/* --- Tetra School Animation --- */
.tetra-school {
    position: absolute;
    bottom: 8vh;
    left: 0;
    width: 100%;
    overflow: hidden;
    height: 30px;
}

.tetra-group {
    width: 200%;
    height: 100%;
    animation: tetra-drift 80s linear infinite;
}

@keyframes tetra-drift {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- Spread 5: Closing --- */
.spread-closing {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f0e8;
    position: relative;
}

.kintsugi-converge {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.kintsugi-converge-path {
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    transition: stroke-dashoffset 3s ease;
}

.kintsugi-converge-path.revealed {
    stroke-dashoffset: 0;
}

.closing-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.closing-statement {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #2b2926;
    margin-bottom: 3rem;
}

.pufferfish {
    width: 160px;
    height: auto;
    opacity: 0.7;
    margin: 0 auto;
    display: block;
}

/* --- Hyperlink Style --- */
a {
    color: #8a9ba8;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

a:hover {
    border-bottom-color: #8a9ba8;
}

/* --- Horizontal Rules --- */
hr {
    border: none;
    height: 1px;
    background: #c9c1b4;
    margin: 3rem 0;
}

/* --- Shadow / Depth: Deep Kiln #1a1815 --- */
.spread-method {
    box-shadow: 0 -1px 0 #1a1815;
}

/* --- Selection --- */
::selection {
    background: #b8943e;
    color: #f5f0e8;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    body {
        cursor: auto;
    }

    #cursor-fish {
        display: none;
    }

    #ink-trail {
        display: none;
    }

    #spread-nav {
        right: 10px;
        gap: 12px;
    }

    .nav-tick::before {
        width: 8px;
    }

    .nav-tick.active::before {
        width: 16px;
    }

    .spread-1-content {
        padding-left: 8%;
    }

    .hero-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    /* Thesis spread stacks vertically */
    .spread-thesis {
        flex-direction: column;
        padding: 6vh 6%;
    }

    .spread-col-narrow {
        width: 100%;
        padding-right: 0;
        order: 2;
        margin-top: 3rem;
    }

    .spread-col-wide {
        width: 100%;
        padding-left: 0;
    }

    .kintsugi-vertical {
        display: none;
    }

    /* Method columns stack */
    .method-columns {
        flex-direction: column;
        gap: 3rem;
    }

    .method-col {
        margin-top: 0 !important;
    }

    .method-col-2,
    .method-col-3 {
        transition-delay: 0s;
    }

    /* Counter spread stacks */
    .spread-counter {
        flex-direction: column;
    }

    .spread-col-left {
        width: 100%;
        padding-right: 0;
    }

    .spread-col-right {
        width: 100%;
        padding-left: 0;
        margin-top: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .section-heading {
        font-size: 1.8rem;
    }

    .closing-statement {
        font-size: 1.5rem;
    }

    .pull-quote {
        font-size: 1.15rem;
    }

    #spread-nav {
        display: none;
    }
}
