/* relative.quest - Japanese-Minimal Celestial Design */
/* Palette: Creamy Pastel Constellation */

:root {
    --deep-sky: #1c1b2e;
    --dawn-cream: #f5f0e6;
    --star-gold: #b8a88a;
    --twilight-mauve: #9b8fa8;
    --horizon-rose: #d4b8a8;
    --nebula-soft: #c4c0d8;
    --ink-dark: #2a2940;
    --paper-warm: #ebe3d4;
    --space-unit: clamp(1rem, 2vw, 2rem);
    --ease-meditative: cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--deep-sky);
    color: var(--dawn-cream);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Washi Paper Grain Overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    filter: url(#washi-grain);
    opacity: 1;
}

.grain-overlay::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: transparent;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

.display-headline {
    font-family: 'Poiret One', cursive;
    font-weight: 400;
    font-size: clamp(2.8rem, 6vw, 5.6rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--star-gold);
    line-height: 1.1;
}

.body-text {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.3vw, 1.15rem);
    line-height: 1.85;
    letter-spacing: 0.02em;
    color: var(--dawn-cream);
    max-width: 38ch;
}

.body-dark {
    color: var(--ink-dark);
}

.accent-label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--twilight-mauve);
    display: block;
    margin-bottom: calc(var(--space-unit) * 0.5);
}

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

.diagonal-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.nav-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 141%;
    height: 1px;
    background: var(--star-gold);
    opacity: 0.3;
    transform-origin: 0 0;
    transform: rotate(5.5deg);
}

.nav-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--star-gold);
    background: transparent;
    cursor: pointer;
    pointer-events: all;
    opacity: 0;
    transition: opacity 0.5s var(--ease-meditative), background 0.3s var(--ease-meditative), transform 0.3s var(--ease-meditative);
    padding: 0;
}

.diagonal-nav:hover .nav-dot {
    opacity: 1;
}

.nav-dot:hover {
    background: var(--horizon-rose);
    transform: scale(1.5);
}

.nav-dot.active {
    background: var(--horizon-rose);
    opacity: 1;
}

/* Position nav dots along the diagonal line */
.nav-dot:nth-child(2) { top: 3.5%; left: 5%; }
.nav-dot:nth-child(3) { top: 7.5%; left: 22%; }
.nav-dot:nth-child(4) { top: 11.5%; left: 39%; }
.nav-dot:nth-child(5) { top: 15.5%; left: 56%; }
.nav-dot:nth-child(6) { top: 19.5%; left: 73%; }

.nav-label {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--star-gold);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s var(--ease-meditative);
    pointer-events: none;
}

.nav-dot:hover .nav-label {
    opacity: 1;
}

/* ========================================
   DIAGONAL SECTIONS
   ======================================== */

.diagonal-section {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.section-odd {
    background: var(--deep-sky);
    clip-path: polygon(0 0, 100% 4vw, 100% 100%, 0 calc(100% - 4vw));
}

.section-even {
    background: var(--dawn-cream);
    clip-path: polygon(0 4vw, 100% 0, 100% calc(100% - 4vw), 0 100%);
    margin-top: -8vw;
}

.section-odd + .section-odd {
    margin-top: -8vw;
}

/* Diagonal background pattern */
.section-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.section-odd .section-bg-pattern {
    background: repeating-linear-gradient(
        5.5deg,
        transparent,
        transparent 60px,
        rgba(184, 168, 138, 0.03) 60px,
        rgba(184, 168, 138, 0.03) 61px
    );
}

.section-even .section-bg-pattern {
    background: repeating-linear-gradient(
        -3deg,
        transparent,
        transparent 60px,
        rgba(155, 143, 168, 0.06) 60px,
        rgba(155, 143, 168, 0.06) 61px
    );
}

/* Diagonal divider lines */
.section-odd::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--star-gold);
    opacity: 0.15;
    transform-origin: 0 100%;
    transform: rotate(-5.5deg);
}

.section-even::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--star-gold);
    opacity: 0.15;
    transform-origin: 0 100%;
    transform: rotate(3deg);
}

/* ========================================
   SECTION CONTENT POSITIONING
   ======================================== */

.section-content {
    position: relative;
    z-index: 2;
    padding: calc(var(--space-unit) * 3);
    width: 100%;
}

.content-lower-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    min-height: 80vh;
    padding-bottom: calc(var(--space-unit) * 5);
    padding-right: calc(var(--space-unit) * 4);
    text-align: right;
}

.content-upper-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 80vh;
    padding-top: calc(var(--space-unit) * 6);
    padding-left: calc(var(--space-unit) * 4);
}

.content-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-height: 80vh;
    padding-right: calc(var(--space-unit) * 4);
    text-align: right;
}

.content-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90vh;
    text-align: center;
}

.display-headline {
    margin-bottom: calc(var(--space-unit) * 1.5);
}

/* ========================================
   CONSTELLATIONS
   ======================================== */

.constellation {
    position: absolute;
    opacity: 0.4;
    z-index: 1;
    pointer-events: none;
}

.constellation-origin {
    width: 350px;
    height: 350px;
    top: 15%;
    left: 10%;
    opacity: 0;
    animation: constellationFadeIn 3s var(--ease-meditative) 0.5s forwards;
}

.constellation-distance {
    width: 200px;
    height: 200px;
    bottom: 15%;
    right: 10%;
}

.constellation-perspective {
    width: 400px;
    height: 400px;
    top: 50%;
    left: 15%;
    transform: translateY(-50%);
}

.constellation-connection-left {
    width: 120px;
    height: 120px;
    top: 15%;
    left: 8%;
}

.constellation-connection-right {
    width: 120px;
    height: 120px;
    bottom: 15%;
    right: 8%;
}

/* Connection line SVG */
.connection-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.draw-line {
    transition: stroke-dashoffset 5s var(--ease-meditative);
}

.draw-line.animate {
    stroke-dashoffset: 0;
}

/* Pulsing stars */
.pulse-star {
    animation: pulse 4s ease-in-out infinite;
}

.pulse-delay-1 {
    animation-delay: 1.3s;
}

.pulse-delay-2 {
    animation-delay: 2.6s;
}

/* ========================================
   SECTION SPECIFIC STYLES
   ======================================== */

/* Section 1: Origin */
.section-origin {
    z-index: 5;
}

.headline-origin {
    font-size: clamp(4rem, 8vw, 7rem);
}

/* Section 2: Distance */
.section-distance {
    z-index: 4;
}

.headline-distance {
    color: var(--ink-dark);
}

/* Section 3: Perspective */
.section-perspective {
    z-index: 3;
}

/* Section 4: Connection */
.section-connection {
    z-index: 2;
    background: var(--paper-warm);
}

.headline-connection {
    color: var(--ink-dark);
}

/* Section 5: Silence */
.section-silence {
    z-index: 1;
}

.headline-silence {
    font-size: clamp(5rem, 12vw, 10rem);
    color: var(--star-gold);
    opacity: 0.2;
}

.silence-pulse {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--horizon-rose);
    animation: silencePulse 4s ease-in-out infinite;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes constellationFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.4;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes silencePulse {
    0%, 100% {
        opacity: 0.4;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.3);
    }
}

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

.fade-in {
    opacity: 0;
}

.fade-in.visible {
    animation: fadeIn 1.5s var(--ease-meditative) both;
}

.fade-in.visible:nth-child(2) {
    animation-delay: 0.3s;
}

.fade-in.visible:nth-child(3) {
    animation-delay: 0.6s;
}

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

@media (max-width: 768px) {
    .content-lower-right {
        padding-right: calc(var(--space-unit) * 2);
        padding-bottom: calc(var(--space-unit) * 3);
        align-items: flex-start;
        text-align: left;
    }

    .content-upper-left {
        padding-left: calc(var(--space-unit) * 2);
        padding-top: calc(var(--space-unit) * 4);
    }

    .content-right {
        padding-right: calc(var(--space-unit) * 2);
        align-items: flex-start;
        text-align: left;
    }

    .constellation-origin {
        width: 200px;
        height: 200px;
    }

    .constellation-perspective {
        width: 250px;
        height: 250px;
        left: 5%;
    }

    .constellation-distance {
        width: 140px;
        height: 140px;
    }

    .diagonal-nav {
        display: none;
    }

    .headline-origin {
        font-size: clamp(3rem, 10vw, 5rem);
    }

    .headline-silence {
        font-size: clamp(3.5rem, 14vw, 7rem);
    }
}
