/* toron.day — Scandinavian Rebellious Design */

/* ===== CSS Custom Properties ===== */
:root {
    --bg-ash-fog: #e8e6e1;
    --bg-slate-breath: #2c2f33;
    --text-charcoal-ink: #1a1a1e;
    --text-stone-whisper: #6b6e73;
    --accent-burnt-signal: #c43e2a;
    --accent-fjord-steel: #5a7d8c;
    --divider-birch-gray: #c9c5bc;
    --wash-frost-veil: #f4f2ee;

    --font-primary: 'Space Grotesk', sans-serif;
    --font-secondary: 'Libre Baskerville', Georgia, serif;
    --font-accent: 'Caveat', cursive;

    --reading-width: 680px;
}

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

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-ash-fog);
    color: var(--text-charcoal-ink);
    font-family: var(--font-secondary);
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== Paper Texture Overlay ===== */
.paper-texture {
    position: fixed;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.04;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(26, 26, 30, 0.03) 2px,
            rgba(26, 26, 30, 0.03) 3px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 3px,
            rgba(26, 26, 30, 0.02) 3px,
            rgba(26, 26, 30, 0.02) 4px
        );
    background-size: 5px 5px, 7px 7px;
    mix-blend-mode: multiply;
}

/* ===== Compass Navigation ===== */
.compass-nav {
    position: fixed;
    top: 32px;
    left: 32px;
    z-index: 999;
    cursor: pointer;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.compass-nav:hover {
    transform: scale(1.1);
}

.compass-cross {
    animation: compass-rotate 30s linear infinite;
}

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

.compass-nav.is-active .compass-cross {
    animation-play-state: paused;
}

/* ===== Radial Navigation Overlay ===== */
.radial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 998;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.radial-overlay.is-open {
    pointer-events: all;
    opacity: 1;
}

.radial-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(232, 230, 225, 0.95);
    backdrop-filter: blur(8px);
}

.radial-menu {
    position: absolute;
    top: 32px;
    left: 32px;
    width: 300px;
    height: 300px;
}

.radial-link {
    position: absolute;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 0.02em;
    color: var(--text-charcoal-ink);
    text-decoration: none;
    padding: 8px 16px;
    transform: translate(-50%, -50%);
    transition: color 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

.radial-overlay.is-open .radial-link {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.radial-link[data-index="0"] { top: 50px; left: 180px; transition-delay: 0.05s; }
.radial-link[data-index="1"] { top: 110px; left: 260px; transition-delay: 0.1s; }
.radial-link[data-index="2"] { top: 200px; left: 230px; transition-delay: 0.15s; }
.radial-link[data-index="3"] { top: 200px; left: 100px; transition-delay: 0.2s; }
.radial-link[data-index="4"] { top: 110px; left: 60px; transition-delay: 0.25s; }

.radial-link:hover {
    color: var(--accent-burnt-signal);
    transform: translate(-50%, -50%) scale(1) skewX(-2deg);
}

.radial-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 16px;
    width: 0;
    height: 2px;
    background: var(--accent-burnt-signal);
    transition: width 0.3s ease;
}

.radial-link:hover::after {
    width: calc(100% - 32px);
}

/* ===== Scroll Container ===== */
.scroll-container {
    width: 100%;
}

/* ===== Sections ===== */
.section {
    min-height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    overflow: hidden;
}

.section--light {
    background-color: var(--bg-ash-fog);
}

.section--dark {
    background-color: var(--bg-slate-breath);
    position: relative;
}

/* ===== Circle Reveal for Dark Section ===== */
.circle-reveal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-slate-breath);
    clip-path: circle(0% at 50% 50%);
    transition: clip-path 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 0;
}

.circle-reveal.is-revealed {
    clip-path: circle(150% at 50% 50%);
}

.section--dark .section-content,
.section--dark .ink-splatter {
    position: relative;
    z-index: 1;
}

/* ===== Section Content ===== */
.section-content {
    max-width: var(--reading-width);
    width: 100%;
    position: relative;
}

.section-content--offset-left {
    transform: translateX(-12%);
}

/* ===== Typography ===== */
.headline {
    font-family: var(--font-primary);
    font-weight: 700;
    color: var(--text-charcoal-ink);
    margin-bottom: 32px;
    letter-spacing: -0.03em;
    line-height: 1.1;
    font-size: 42px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.headline.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.headline--display {
    font-size: 72px;
    letter-spacing: -0.03em;
}

.headline--inverted {
    color: var(--wash-frost-veil);
}

.accent-dot {
    color: var(--accent-burnt-signal);
}

.body-text {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.body-text.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.body-text p {
    margin-bottom: 1.4em;
    color: var(--text-charcoal-ink);
}

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

.body-text--inverted p {
    color: var(--divider-birch-gray);
}

/* ===== Marginalia ===== */
.marginalia {
    position: absolute;
    width: 180px;
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.marginalia.is-visible {
    opacity: 1;
}

.marginalia--right {
    right: -220px;
    top: 50%;
    transform: translateY(-50%);
}

.marginalia--left {
    left: -220px;
    top: 50%;
    transform: translateY(-50%);
}

.marginalia-text {
    font-family: var(--font-accent);
    font-size: 16px;
    font-weight: 400;
    color: var(--text-stone-whisper);
    display: block;
    transform: rotate(-1.5deg);
    line-height: 1.4;
}

.marginalia--inverted .marginalia-text {
    color: var(--accent-fjord-steel);
}

/* ===== Section Rules (Hand-drawn lines) ===== */
.section-rule {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: var(--reading-width);
    max-width: calc(100% - 48px);
}

.hand-drawn-rule {
    width: 100%;
    height: 4px;
    display: block;
}

.rule-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.rule-path.is-drawn {
    stroke-dashoffset: 0;
}

/* ===== Nature Illustrations ===== */
.full-bleed-breakout {
    width: 100vw;
    display: flex;
    justify-content: center;
    margin-bottom: 48px;
}

.nature-illustration {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.nature-illustration.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.nature-illustration--inline {
    margin-bottom: 32px;
}

.nature-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 2s cubic-bezier(0.65, 0, 0.35, 1);
}

.nature-path.is-drawn {
    stroke-dashoffset: 0;
}

/* ===== Ink Splatters ===== */
.ink-splatter {
    position: absolute;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ink-splatter.is-visible {
    opacity: 1;
    transform: scale(1);
}

.ink-splatter[data-position="bottom-right"] {
    bottom: 60px;
    right: 10%;
}

.ink-splatter[data-position="top-left"] {
    top: 60px;
    left: 8%;
}

@keyframes splatter-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.ink-splatter.is-visible svg {
    animation: splatter-pulse 4s ease-in-out infinite;
}

/* ===== Torn Card ===== */
.torn-card {
    margin-top: 40px;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.torn-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.torn-card-inner {
    background: var(--wash-frost-veil);
    padding: 32px 40px;
    position: relative;
    clip-path: polygon(
        0% 3%, 5% 0%, 12% 4%, 20% 1%, 28% 3%, 35% 0%, 42% 2%, 50% 0%, 58% 3%, 65% 1%, 72% 4%, 80% 0%, 88% 3%, 95% 1%, 100% 4%,
        100% 97%, 95% 100%, 88% 96%, 80% 100%, 72% 97%, 65% 100%, 58% 97%, 50% 100%, 42% 97%, 35% 100%, 28% 96%, 20% 100%, 12% 97%, 5% 100%, 0% 96%
    );
}

.torn-card-text {
    font-family: var(--font-secondary);
    font-style: italic;
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-charcoal-ink);
}

/* ===== Section Footer ===== */
.section-footer {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.compass-small svg {
    animation: compass-rotate 30s linear infinite;
}

.footer-text {
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.02em;
    color: var(--text-stone-whisper);
}

/* ===== Link Hover Effects ===== */
a {
    color: var(--accent-fjord-steel);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease, transform 0.3s ease;
}

a:hover {
    color: var(--accent-burnt-signal);
    transform: skewX(-2deg);
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
    .marginalia {
        position: relative;
        right: auto;
        left: auto;
        top: auto;
        transform: none;
        width: 100%;
        margin-top: 24px;
    }

    .marginalia--right,
    .marginalia--left {
        right: auto;
        left: auto;
        top: auto;
        transform: none;
    }

    .section-content--offset-left {
        transform: none;
    }
}

@media (max-width: 768px) {
    .headline {
        font-size: 32px;
    }

    .headline--display {
        font-size: 48px;
    }

    body {
        font-size: 16px;
    }

    .section {
        padding: 60px 20px;
    }

    .compass-nav {
        top: 20px;
        left: 20px;
    }

    .compass-nav svg {
        width: 44px;
        height: 44px;
    }

    .radial-link {
        font-size: 14px;
    }

    .radial-link[data-index="0"] { top: 40px; left: 140px; }
    .radial-link[data-index="1"] { top: 90px; left: 200px; }
    .radial-link[data-index="2"] { top: 160px; left: 180px; }
    .radial-link[data-index="3"] { top: 160px; left: 80px; }
    .radial-link[data-index="4"] { top: 90px; left: 50px; }

    .torn-card-inner {
        padding: 24px 28px;
    }
}

@media (max-width: 480px) {
    .headline--display {
        font-size: 36px;
    }

    .headline {
        font-size: 26px;
    }

    .full-bleed-breakout svg {
        width: 280px;
        height: auto;
    }
}
