/* tanso.news — Surreal-Archival News Aesthetic */
/* Forbidden astronomical almanac from a Victorian observatory */

:root {
    --parchment: #f4ece0;
    --paper-overlay: #ede2d0;
    --deep-umber: #2c1e0e;
    --tobacco: #6b5a3e;
    --faded-brass: #8a7a62;
    --star-gold: #c9a84c;
    --observatory-night: #1a1610;
    --celestial-cream: #f9f3e8;
    --rust-marginalia: #9e4a2f;
    --scale-hover-duration: 400ms;
    --scale-hover-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===== RESET & BASE ===== */

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

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

body {
    background-color: var(--parchment);
    color: var(--deep-umber);
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    line-height: 1.72;
    overflow-x: hidden;
    position: relative;
    /* Base noise layer - paper grain via SVG filter */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='4' height='4' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

/* Vignette burn overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(44, 30, 14, 0.08) 100%);
}

/* Foxing spots */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    background:
        radial-gradient(circle 60px at 12% 8%, rgba(201, 168, 76, 0.07) 0%, transparent 100%),
        radial-gradient(circle 90px at 85% 15%, rgba(201, 168, 76, 0.06) 0%, transparent 100%),
        radial-gradient(circle 45px at 25% 45%, rgba(201, 168, 76, 0.08) 0%, transparent 100%),
        radial-gradient(circle 75px at 70% 35%, rgba(201, 168, 76, 0.06) 0%, transparent 100%),
        radial-gradient(circle 50px at 92% 55%, rgba(201, 168, 76, 0.09) 0%, transparent 100%),
        radial-gradient(circle 100px at 8% 72%, rgba(201, 168, 76, 0.07) 0%, transparent 100%),
        radial-gradient(circle 55px at 55% 80%, rgba(201, 168, 76, 0.08) 0%, transparent 100%),
        radial-gradient(circle 80px at 40% 20%, rgba(201, 168, 76, 0.06) 0%, transparent 100%),
        radial-gradient(circle 65px at 78% 68%, rgba(201, 168, 76, 0.07) 0%, transparent 100%),
        radial-gradient(circle 40px at 35% 92%, rgba(201, 168, 76, 0.1) 0%, transparent 100%);
}

/* ===== MARGINALIA ===== */

.marginalia {
    position: fixed;
    z-index: 998;
    pointer-events: none;
}

.marginalia-star {
    color: var(--star-gold);
    opacity: 0.2;
    font-size: 1.2rem;
}

.m1 { top: 8%; left: 2%; }
.m2 { top: 22%; right: 3%; }
.m3 { top: 38%; left: 1.5%; }
.m4 { top: 52%; right: 2.5%; }
.m5 { top: 65%; left: 3%; }
.m6 { top: 78%; right: 1.8%; }
.m7 { top: 15%; right: 4%; font-size: 0.9rem; }
.m8 { top: 88%; left: 2.2%; }

.marginalia-seal {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 1px dashed var(--faded-brass);
    opacity: 0.15;
}

.s1 { top: 30%; left: 1%; }
.s2 { top: 60%; right: 1.5%; }
.s3 { top: 85%; left: 2%; }

.marginalia-hash {
    width: 20px;
    height: 30px;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 3px,
        rgba(138, 122, 98, 0.12) 3px,
        rgba(138, 122, 98, 0.12) 4px
    );
}

.h1 { top: 45%; left: 1%; }
.h2 { top: 70%; right: 2%; }

/* ===== CONSTELLATION SVG ===== */

.constellation-line {
    stroke: var(--faded-brass);
    stroke-width: 1;
    opacity: 0.4;
}

.constellation-star {
    fill: var(--star-gold);
    transition: transform 600ms ease, opacity 600ms ease;
}

.constellation-star:hover {
    opacity: 0.8;
    transform-origin: center;
}

@keyframes starPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; }
}

.star-pulse { animation: starPulse 5s ease-in-out infinite; }
.s-delay-0 { animation-delay: 0s; }
.s-delay-1 { animation-delay: 0.7s; }
.s-delay-2 { animation-delay: 1.4s; }
.s-delay-3 { animation-delay: 2.1s; }
.s-delay-4 { animation-delay: 2.8s; }
.s-delay-5 { animation-delay: 3.5s; }
.s-delay-6 { animation-delay: 4.2s; }
.s-delay-7 { animation-delay: 4.9s; }

/* ===== ZONE 1: OBSERVATORY OPENING ===== */

.zone-observatory {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6vh 8vw;
    overflow: hidden;
}

.dateline {
    position: absolute;
    top: 3vh;
    right: 4vw;
    font-family: 'IM Fell English', serif;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--faded-brass);
}

.observatory-headline {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(2.6rem, 6.5vw, 5.8rem);
    letter-spacing: -0.02em;
    line-height: 0.95;
    color: var(--deep-umber);
    max-width: 70%;
    position: relative;
    z-index: 2;
    animation: headlineEnter 1.2s ease-out 0.5s both;
    transition: color 500ms ease;
}

.observatory-headline:hover {
    color: var(--rust-marginalia);
    text-shadow: 0 0 20px rgba(201, 168, 76, 0.15);
}

@keyframes headlineEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.observatory-subline {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1rem, 2.2vw, 1.5rem);
    letter-spacing: 0.04em;
    color: var(--tobacco);
    margin-top: 2rem;
    position: relative;
    z-index: 2;
    animation: headlineEnter 1.2s ease-out 1s both;
}

.constellation-header {
    position: absolute;
    right: -2vw;
    top: 10%;
    width: 45vw;
    max-width: 500px;
    height: auto;
    z-index: 1;
    opacity: 0.6;
}

.torn-edge-bottom {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 40px;
    z-index: 10;
    clip-path: polygon(
        0% 0%, 2% 45%, 5% 20%, 8% 55%, 12% 15%, 15% 60%, 18% 25%, 22% 70%,
        25% 30%, 28% 65%, 32% 20%, 35% 55%, 38% 35%, 42% 75%, 45% 25%,
        48% 60%, 52% 15%, 55% 50%, 58% 30%, 62% 65%, 65% 20%, 68% 55%,
        72% 35%, 75% 70%, 78% 25%, 82% 60%, 85% 15%, 88% 50%, 92% 30%,
        95% 65%, 98% 20%, 100% 45%, 100% 100%, 0% 100%
    );
    background: var(--parchment);
}

/* ===== ZONE 2: SCATTERED ARCHIVE ===== */

.zone-archive {
    position: relative;
    min-height: 250vh;
    padding: 8vh 5vw 12vh;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0;
    align-content: start;
}

.constellation-archive {
    position: absolute;
    left: 55%;
    top: 8%;
    width: 25vw;
    max-width: 300px;
    opacity: 0.4;
    z-index: 0;
}

/* Article Fragments - broken grid positions */

.fragment {
    position: relative;
    background: var(--paper-overlay);
    padding: 2rem 2.2rem;
    z-index: 1;
    transition:
        transform var(--scale-hover-duration) var(--scale-hover-ease),
        box-shadow var(--scale-hover-duration) var(--scale-hover-ease),
        z-index 0ms;
    box-shadow: 2px 3px 12px rgba(44, 30, 14, 0.08), 0 1px 3px rgba(44, 30, 14, 0.05);
    /* Paper texture on fragments */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='4' height='4' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    background-color: var(--paper-overlay);
    /* Entrance animation */
    animation: fragmentEnter 0.9s ease-out var(--frag-delay) both;
}

@keyframes fragmentEnter {
    from {
        opacity: 0;
        transform: scale(0.92) rotate(-1deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.fragment:hover {
    transform: scale(1.03);
    z-index: 50;
    box-shadow: 4px 8px 28px rgba(44, 30, 14, 0.15), 0 2px 8px rgba(44, 30, 14, 0.1);
}

.fragment:hover ~ .fragment {
    transform: translateX(5px);
}

/* Individual fragment positions on the broken grid */
.fragment-1 {
    grid-column: 1 / 7;
    grid-row: 1;
    margin-top: 2vh;
    margin-right: -20px;
    transform: rotate(-0.5deg);
}
.fragment-1:hover {
    transform: scale(1.03) rotate(-0.5deg);
}

.fragment-2 {
    grid-column: 5 / 12;
    grid-row: 3;
    margin-top: -15px;
    margin-left: 30px;
    transform: rotate(0.8deg);
}
.fragment-2:hover {
    transform: scale(1.03) rotate(0.8deg);
}

.fragment-3 {
    grid-column: 2 / 8;
    grid-row: 4;
    margin-top: 3vh;
    transform: rotate(-0.3deg);
}
.fragment-3:hover {
    transform: scale(1.03) rotate(-0.3deg);
}

.fragment-4 {
    grid-column: 6 / 13;
    grid-row: 5;
    margin-top: 2vh;
    margin-left: -25px;
    transform: rotate(0.5deg);
}
.fragment-4:hover {
    transform: scale(1.03) rotate(0.5deg);
}

.fragment-5 {
    grid-column: 1 / 7;
    grid-row: 6;
    margin-top: 4vh;
    transform: rotate(-0.7deg);
}
.fragment-5:hover {
    transform: scale(1.03) rotate(-0.7deg);
}

.fragment-6 {
    grid-column: 4 / 11;
    grid-row: 7;
    margin-top: 2vh;
    margin-left: 15px;
    transform: rotate(0.4deg);
}
.fragment-6:hover {
    transform: scale(1.03) rotate(0.4deg);
}

.fragment-7 {
    grid-column: 2 / 9;
    grid-row: 8;
    margin-top: 5vh;
    transform: rotate(-1deg);
}
.fragment-7:hover {
    transform: scale(1.03) rotate(-1deg);
}

/* Fragment typography */
.fragment-metadata {
    display: block;
    font-family: 'IM Fell English', serif;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--faded-brass);
    margin-bottom: 0.75rem;
}

.fragment-headline {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: -0.02em;
    line-height: 0.95;
    color: var(--deep-umber);
    margin-bottom: 0.75rem;
    transition: color 500ms ease, text-shadow 500ms ease;
}

.fragment:hover .fragment-headline {
    color: var(--rust-marginalia);
    text-shadow: 0 0 20px rgba(201, 168, 76, 0.15);
}

.fragment-byline {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-style: italic;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    letter-spacing: 0.04em;
    color: var(--tobacco);
    margin-bottom: 0.75rem;
}

.fragment-body {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(0.95rem, 1.4vw, 1.15rem);
    line-height: 1.72;
    color: #3d2e1c;
    max-width: 38em;
}

/* Orbital Rings */
.orbital-ring {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border: 1px solid rgba(107, 90, 62, 0.2);
    border-radius: 50%;
    pointer-events: none;
    animation: orbitalRotate 60s linear infinite;
}

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

/* Crescent Moon Separators */
.crescent-separator {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3vh 0;
    z-index: 2;
}

.sep-1 { grid-row: 2; }
.sep-2 { grid-row: 4; margin-top: -2vh; margin-bottom: 2vh; }

.crescent-line-left,
.crescent-line-right {
    flex: 1;
    height: 1px;
    background: rgba(138, 122, 98, 0.25);
}

.crescent-moon {
    position: relative;
    width: 24px;
    height: 24px;
    margin: 0 1.5rem;
    border-radius: 50%;
    box-shadow: 6px -2px 0 0 var(--star-gold);
    opacity: 0.5;
    transition: transform 600ms ease, opacity 600ms ease;
}

.crescent-moon:hover {
    transform: scale(1.4);
    opacity: 0.8;
}

/* ===== ZONE 3: STAR MAP FOOTER ===== */

.zone-starmap {
    position: relative;
    min-height: 100vh;
    background: var(--observatory-night);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.torn-edge-top {
    position: absolute;
    top: -2px;
    left: 0;
    width: 100%;
    height: 40px;
    z-index: 10;
    clip-path: polygon(
        0% 55%, 3% 80%, 6% 40%, 9% 70%, 13% 35%, 16% 75%, 19% 45%, 23% 80%,
        26% 50%, 29% 70%, 33% 30%, 36% 65%, 39% 45%, 43% 85%, 46% 40%,
        49% 70%, 53% 35%, 56% 60%, 59% 50%, 63% 80%, 66% 35%, 69% 65%,
        73% 45%, 76% 75%, 79% 30%, 83% 70%, 86% 40%, 89% 60%, 93% 50%,
        96% 75%, 99% 40%, 100% 60%, 100% 0%, 0% 0%
    );
    background: var(--parchment);
}

/* Star field */
.star-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: starFieldRotate 120s linear infinite;
}

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

.star-dot {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--star-gold), transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.star-dot.visible {
    opacity: 1;
}

.constellation-footer {
    position: relative;
    width: 50vw;
    max-width: 500px;
    z-index: 2;
    opacity: 0.5;
}

.zone-starmap .constellation-line {
    stroke: rgba(201, 168, 76, 0.3);
}

.starmap-tagline {
    position: relative;
    z-index: 2;
    font-family: 'IM Fell English', serif;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--star-gold);
    opacity: 0;
    margin-top: 4rem;
    transition: opacity 1.5s ease;
}

.starmap-tagline.visible {
    opacity: 0.7;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .zone-archive {
        display: flex;
        flex-direction: column;
        gap: 3vh;
        padding: 6vh 4vw;
    }

    .fragment {
        margin: 0 !important;
        transform: none !important;
    }

    .fragment:hover {
        transform: scale(1.02) !important;
    }

    .observatory-headline {
        max-width: 90%;
    }

    .constellation-header {
        width: 60vw;
        right: -5vw;
        opacity: 0.3;
    }

    .marginalia {
        display: none;
    }
}
