/* rational.business - Victorian Observatory Anarchist Aesthetic */

:root {
    --violet: #2d1b69;
    --gold: #d4a017;
    --teal: #17a2b8;
    --cosmos: #0e0b1e;
    --ivory: #e8dcc8;
    --star: #f5f0e6;
    --rebel: #c0392b;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--cosmos);
    color: var(--ivory);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* ============ NAVIGATION ============ */

.nav-trigger {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
}

.nav-checkbox {
    display: none;
}

.nav-icon {
    display: block;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

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

.nav-icon svg {
    display: block;
}

.radial-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
}

.radial-link {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--violet);
    border: 1px solid var(--gold);
    color: var(--gold);
    text-decoration: none;
    font-family: 'Spectral', serif;
    font-variant: small-caps;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(0px);
    transition: opacity 0.3s ease var(--delay), transform 0.4s ease var(--delay);
    pointer-events: none;
}

.radial-link:hover {
    background: var(--gold);
    color: var(--cosmos);
}

.nav-checkbox:checked ~ .radial-menu .radial-link {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-70px) rotate(calc(-1 * var(--angle)));
    pointer-events: all;
}

/* ============ OPENING SECTION ============ */

.opening {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--cosmos);
    overflow: hidden;
}

.constellation-libra-opening {
    opacity: 0;
    animation: fadeIn 1.5s ease 0.5s forwards;
}

.star {
    animation: pulse 4s ease-in-out infinite alternate;
}

.star-1 { animation-delay: 0s; }
.star-2 { animation-delay: 0.5s; }
.star-3 { animation-delay: 1s; }
.star-4 { animation-delay: 1.5s; }
.star-5 { animation-delay: 2s; }
.star-6 { animation-delay: 2.5s; }
.star-7 { animation-delay: 3s; }
.star-8 { animation-delay: 3.5s; }

@keyframes pulse {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

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

.title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--star);
    letter-spacing: 0.02em;
    line-height: 1.1;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.08);
    margin-top: 2rem;
    opacity: 0;
    animation: fadeIn 1s ease 1.3s forwards;
}

.title .char {
    display: inline-block;
    opacity: 0;
    animation: charFadeIn 0.4s ease forwards;
}

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

.subtitle {
    font-family: 'Spectral', serif;
    font-variant: small-caps;
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    color: var(--gold);
    margin-top: 1.5rem;
    opacity: 0;
    animation: fadeIn 1s ease 2.5s forwards;
}

/* ============ LENS FLARE ============ */

.lens-flare {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.5s ease-in;
}

.lens-flare-opening {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    background: radial-gradient(circle at center, rgba(212,160,23,0.3) 0%, transparent 60%);
    box-shadow: 0 0 80px 20px rgba(23,162,184,0.15);
    animation: flareBloom 2s ease 2s forwards;
}

.lens-flare-section {
    top: 0;
    right: -100px;
    background: radial-gradient(circle at center, rgba(212,160,23,0.2) 0%, transparent 60%);
    box-shadow: 0 0 60px 15px rgba(23,162,184,0.1);
}

.lens-flare-closing {
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at center, rgba(212,160,23,0.3) 0%, transparent 60%);
    box-shadow: 0 0 80px 20px rgba(23,162,184,0.15);
}

.lens-flare-section.visible,
.lens-flare-closing.visible {
    opacity: 1;
}

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

/* ============ CONTENT WRAPPER ============ */

.content-wrapper {
    display: flex;
    position: relative;
    min-height: 100vh;
}

/* ============ ANNOTATION RAIL ============ */

.annotation-rail {
    position: sticky;
    top: 0;
    width: 20%;
    min-width: 160px;
    max-width: 280px;
    height: 100vh;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    overflow: hidden;
}

.rail-element {
    opacity: 0.7;
    transition: opacity 0.6s ease;
}

.rail-element:hover {
    opacity: 1;
}

.rail-svg {
    display: block;
}

.rail-svg.rotating {
    animation: rotate 120s linear infinite;
}

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

.marginal-note {
    font-family: 'EB Garamond', Georgia, serif;
    font-style: italic;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--teal);
    opacity: 0.8;
}

.bracket {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 4rem;
    line-height: 1;
    color: var(--teal);
    opacity: 0.3;
    display: block;
    transition: opacity 0.6s ease;
}

.bracket:hover {
    opacity: 0.5;
}

/* ============ EDITORIAL COLUMN ============ */

.editorial-column {
    flex: 1;
    max-width: 44rem;
    padding: 4rem 2rem 6rem 3rem;
}

.content-section {
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.content-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.content-section h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    color: var(--star);
    letter-spacing: 0.02em;
    line-height: 1.1;
    margin-bottom: 2rem;
}

.content-section p {
    margin-bottom: 1.5rem;
    text-indent: 2em;
}

.content-section p:first-of-type {
    text-indent: 0;
}

.content-section p em {
    font-weight: 600;
    color: var(--gold);
}

/* ============ ORNAMENTAL DIVIDERS ============ */

.ornamental-divider {
    margin-bottom: 2.5rem;
    width: 100%;
    overflow: visible;
}

.divider-svg {
    width: 100%;
    height: 30px;
    overflow: visible;
}

.divider-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.2s ease;
}

.content-section.visible .divider-line {
    stroke-dashoffset: 0;
}

.ornamental-divider:hover .divider-svg {
    filter: drop-shadow(0 0 6px rgba(212,160,23,0.4));
}

/* Ripple on ornamental elements */
.ornamental-divider {
    position: relative;
    cursor: default;
}

.ornamental-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid var(--teal);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
}

.ornamental-divider:hover::after {
    animation: ripple 0.8s ease forwards;
}

@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(20);
        opacity: 0;
    }
}

/* ============ BREATHING SPACES ============ */

.breathing-space {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    padding: 4rem 0;
}

.breathing-quote {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    color: var(--gold);
    text-align: center;
    line-height: 1.3;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

.breathing-space.visible .breathing-quote {
    opacity: 1;
    transform: translateY(0);
}

.breathing-constellation {
    opacity: 0.6;
    transition: opacity 0.6s ease;
}

.breathing-constellation:hover {
    opacity: 1;
}

.breathing-constellation.rotating {
    animation: rotate 120s linear infinite;
}

/* ============ CLOSING SECTION ============ */

.closing {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--cosmos);
    overflow: hidden;
    padding: 4rem 2rem;
}

.constellation-libra-closing {
    opacity: 0;
    transition: opacity 1.5s ease;
}

.closing.visible .constellation-libra-closing {
    opacity: 1;
}

.closing-statement {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--star);
    text-align: center;
    line-height: 1.2;
    margin-top: 3rem;
    max-width: 44rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease 0.3s, transform 1.2s ease 0.3s;
}

.closing.visible .closing-statement {
    opacity: 1;
    transform: translateY(0);
}

/* ============ RAIL SVG RIPPLE ============ */

.rail-svg {
    position: relative;
    cursor: default;
}

.rail-constellation {
    position: relative;
}

.rail-constellation::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid var(--gold);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
}

.rail-constellation:hover::after {
    animation: rippleGold 0.8s ease forwards;
}

@keyframes rippleGold {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
        border-color: var(--gold);
    }
    100% {
        transform: translate(-50%, -50%) scale(10);
        opacity: 0;
        border-color: var(--gold);
    }
}

/* ============ LINKS ============ */

a {
    color: var(--teal);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--gold);
}

/* ============ BACKGROUND WATERMARK ============ */

.opening::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(45,27,105,0.3) 0%, transparent 70%);
    pointer-events: none;
}

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

@media (max-width: 768px) {
    .annotation-rail {
        display: none;
    }

    .editorial-column {
        padding: 3rem 1.5rem 4rem;
        max-width: 100%;
    }

    .content-wrapper {
        flex-direction: column;
    }

    .nav-trigger {
        top: 16px;
        right: 16px;
    }

    .constellation-libra-opening,
    .constellation-libra-closing {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 480px) {
    .breathing-space {
        min-height: 180px;
        padding: 2rem 0;
    }

    .title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .closing-statement {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }
}

/* ============ SELECTION ============ */

::selection {
    background: var(--violet);
    color: var(--gold);
}

/* ============ SCROLLBAR ============ */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--cosmos);
}

::-webkit-scrollbar-thumb {
    background: var(--violet);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}
