/* =========================================
   simidiot.com - Nordic Celestial Opulence
   ========================================= */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: #0a1628;
    color: #e8dfd0;
    font-family: 'Lora', serif;
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    line-height: 1.78;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Ink Grain Texture Overlay --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23g)' opacity='0.04'/%3E%3C/svg%3E");
    opacity: 0.4;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Cormorant Garamond', serif;
}

.section-heading {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    font-weight: 400;
    letter-spacing: 0.06em;
    font-variant: small-caps;
    color: #e8dfd0;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.body-text {
    font-family: 'Lora', serif;
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    line-height: 1.78;
    letter-spacing: 0.01em;
    color: #e8dfd0;
    margin-bottom: 1.25rem;
}

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

.caveat-note {
    font-family: 'Caveat', cursive;
    font-size: clamp(0.8rem, 1.2vw, 1rem);
    color: #c9a84c;
    opacity: 0.7;
    white-space: nowrap;
}

/* --- Entry Screen --- */
.entry-screen {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #0a1628;
    overflow: hidden;
    z-index: 10;
}

.entry-wave {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 100px;
    transform: translateY(-50%);
    z-index: 1;
}

.entry-ripples {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    pointer-events: none;
    z-index: 2;
}

.entry-ripples circle {
    fill: none;
    stroke: #4a7a8a;
    stroke-width: 1;
}

.entry-title {
    position: relative;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.8rem, 7vw, 6rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #e8dfd0;
    z-index: 3;
    opacity: 0;
    transform: translateY(15px);
    margin-top: 30px;
}

.entry-title.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1200ms ease-out, transform 1200ms ease-out;
}

.entry-scroll-hint {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 800ms ease-out;
    z-index: 3;
}

.entry-scroll-hint.visible {
    opacity: 0.6;
}

.scroll-hint-text {
    font-family: 'Caveat', cursive;
    font-size: 0.9rem;
    color: #c9a84c;
    letter-spacing: 0.05em;
}

.scroll-hint-arrow {
    animation: hint-bob 2s ease-in-out infinite;
}

@keyframes hint-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* --- Spine Navigation --- */
.spine-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 48px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 600ms ease-out;
}

.spine-nav.visible {
    opacity: 1;
    pointer-events: auto;
}

.spine-line-bg {
    position: absolute;
    left: 50%;
    top: 15%;
    width: 1px;
    height: 70%;
    background-color: #2a3a5e;
    opacity: 0.4;
    transform: translateX(-50%);
}

.spine-line-progress {
    position: absolute;
    left: 50%;
    top: 15%;
    width: 1px;
    height: 0%;
    background-color: #c9a84c;
    transform: translateX(-50%);
    transition: height 100ms linear;
}

.spine-label {
    position: relative;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.7rem;
    font-variant: small-caps;
    letter-spacing: 0.1em;
    color: #c8d4e2;
    opacity: 0.5;
    text-decoration: none;
    padding: 12px 0;
    cursor: pointer;
    transition: opacity 300ms ease, transform 300ms ease;
    z-index: 2;
}

.spine-label:hover {
    opacity: 0.9;
}

.spine-label.active {
    opacity: 1;
    color: #c9a84c;
    transform: scale(1.08);
}

/* --- Breathing Zones --- */
.breathing-zone {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: #0a1628;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.breathing-zone-final {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ocean-swell {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.closing-inscription {
    position: relative;
    z-index: 2;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 2vw, 1.4rem);
    font-variant: small-caps;
    letter-spacing: 0.1em;
    color: #c9a84c;
    opacity: 0.5;
}

/* --- Content Sections --- */
.content-section {
    position: relative;
    width: 100%;
    min-height: 80vh;
    padding: clamp(4rem, 8vw, 8rem) clamp(2rem, 5vw, 6rem);
    padding-left: 64px;
    background-color: #0a1628;
    overflow: hidden;
}

.section-grid {
    display: grid;
    gap: clamp(2rem, 4vw, 5rem);
    max-width: 1200px;
    margin: 0 auto;
    align-items: start;
}

.section-even .section-grid {
    grid-template-columns: 1fr 1.618fr;
}

.section-odd .section-grid {
    grid-template-columns: 1.618fr 1fr;
}

/* --- Content Frames --- */
.content-frame {
    position: relative;
    background-color: #142240;
    border: 1px solid rgba(42, 58, 94, 0.4);
    padding: clamp(2rem, 3vw, 4rem);
    opacity: 0;
    transition: opacity 900ms ease-out, transform 900ms ease-out;
}

.content-frame.revealed {
    opacity: 1;
}

.frame-rot-pos {
    transform: translateX(-40px) rotate(-0.5deg);
}

.frame-rot-pos.revealed {
    transform: translateX(0) rotate(0.3deg);
}

.frame-rot-neg {
    transform: translateX(40px) rotate(0.5deg);
}

.frame-rot-neg.revealed {
    transform: translateX(0) rotate(-0.3deg);
}

/* Sound wave border decoration */
.sound-wave-border {
    position: absolute;
    top: -1px;
    left: 10%;
    right: 10%;
    height: 3px;
    overflow: hidden;
}

.sound-wave-border::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        #2a3a5e 0px,
        #2a3a5e 4px,
        transparent 4px,
        transparent 8px
    );
    filter: url(#hand-wobble);
}

/* --- Marginalia --- */
.marginalia-column {
    position: relative;
    min-height: 300px;
}

.marginalia-item {
    position: absolute;
    opacity: 0;
    transition: opacity 1200ms ease-in-out, transform 1200ms ease-in-out;
}

.marginalia-item.revealed {
    opacity: 1;
}

.marginalia-left .marginalia-item {
    transform: translateX(-25px);
}

.marginalia-left .marginalia-item.revealed {
    transform: translateX(0);
}

.marginalia-right .marginalia-item {
    transform: translateX(25px);
}

.marginalia-right .marginalia-item.revealed {
    transform: translateX(0);
}

/* --- Compass Rose --- */
.compass-rose {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1500ms ease-out, transform 1500ms ease-out;
}

.compass-rose.visible {
    opacity: 0.25;
}

.compass-rose-right {
    right: -60px;
    top: 50%;
    transform: translateY(-50%) rotate(-7.5deg);
}

.compass-rose-right.visible {
    transform: translateY(-50%) rotate(7.5deg);
}

.compass-rose-left {
    left: 40px;
    bottom: -40px;
    transform: rotate(-7.5deg);
}

.compass-rose-left.visible {
    transform: rotate(7.5deg);
}

.compass-rose-bottom {
    right: 10%;
    bottom: -20px;
    transform: rotate(-7.5deg);
}

.compass-rose-bottom.visible {
    transform: rotate(7.5deg);
}

.compass-letter {
    font-family: 'Cormorant Garamond', serif;
    font-variant: small-caps;
    font-size: 0.7rem;
    fill: #c9a84c;
}

.compass-s {
    fill: #8a2a3a;
}

.compass-lines line {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1200ms ease-out;
}

.compass-rose.visible .compass-lines line {
    stroke-dashoffset: 0;
}

.compass-lines line:nth-child(2) { transition-delay: 100ms; }
.compass-lines line:nth-child(3) { transition-delay: 200ms; }
.compass-lines line:nth-child(4) { transition-delay: 300ms; }

/* --- Ripple Effects --- */
.ripple-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.ripple-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid #4a7a8a;
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

.ripple-ring.active {
    animation: ripple-expand 800ms ease-out forwards;
}

.ripple-ring.click-ripple {
    border-color: #c9a84c;
    animation: ripple-expand-fast 400ms ease-out forwards;
}

@keyframes ripple-expand {
    0% {
        transform: scale(0);
        opacity: 0.6;
        border-width: 1px;
    }
    100% {
        transform: scale(1);
        opacity: 0;
        border-width: 0.5px;
    }
}

@keyframes ripple-expand-fast {
    0% {
        transform: scale(0);
        opacity: 0.8;
        border-width: 1.5px;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
        border-width: 0.5px;
    }
}

/* --- Links & Interactive Elements --- */
a {
    color: #4a7a8a;
    text-decoration: none;
    transition: color 300ms ease;
    position: relative;
}

a:hover {
    color: #c9a84c;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .section-even .section-grid,
    .section-odd .section-grid {
        grid-template-columns: 1fr;
    }

    .marginalia-column {
        display: none;
    }

    .content-section {
        padding-left: 20px;
        padding-right: 20px;
    }

    .spine-nav {
        display: none;
    }

    .compass-rose {
        display: none;
    }

    .frame-rot-pos,
    .frame-rot-pos.revealed,
    .frame-rot-neg,
    .frame-rot-neg.revealed {
        transform: none;
    }

    .content-frame {
        transform: translateY(20px);
    }

    .content-frame.revealed {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .entry-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .breathing-zone {
        height: 60vh;
    }
}
