/* ============================================
   relativity.studio — styles
   Palette: Deep Sapphire #1e2a4a, Weathered Emerald #1a3d2e, 
            Aged Amethyst #352a4a, Tumbled Ruby #8b3a4a,
            River Topaz #b08a4e, Kiln Cream #e8e0d0,
            Ash #9a9488, Void #0e0e12
   Fonts: Nunito (body), Varela Round (display), DM Mono (accent)
   ============================================ */

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

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

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw + 0.6rem, 1.2rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: #e8e0d0;
    background: #0e0e12;
    overflow-x: hidden;
    position: relative;
}

/* Scroll-aware background gradient - set via JS based on document height */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    background: linear-gradient(
        to bottom,
        #0e0e12 0%,
        #1e2a4a 15%,
        #1e2a4a 30%,
        #1a3d2e 45%,
        #1a3d2e 55%,
        #352a4a 70%,
        #352a4a 82%,
        #0e0e12 100%
    );
    background-attachment: fixed;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ---- Navigation ---- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
}

.nav-logo {
    font-family: 'Varela Round', sans-serif;
    font-size: 14px;
    color: #e8e0d0;
    text-transform: lowercase;
    opacity: 0;
    animation: fadeInSlow 2s 2.5s forwards;
    pointer-events: auto;
}

.nav-index {
    font-family: 'DM Mono', monospace;
    font-weight: 300;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b08a4e;
    cursor: pointer;
    position: relative;
    pointer-events: auto;
    opacity: 0;
    animation: fadeInSlow 2s 2.5s forwards;
}

.nav-overlay {
    position: absolute;
    top: 100%;
    right: 0;
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.nav-index:hover .nav-overlay {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-overlay a {
    font-family: 'Varela Round', sans-serif;
    font-size: 14px;
    color: #e8e0d0;
    text-decoration: none;
    text-transform: lowercase;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.nav-overlay a:hover {
    color: #b08a4e;
}

/* ---- Opening Sequence ---- */
.opening {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.hero-circle {
    width: 200px;
    height: 200px;
    opacity: 0;
    animation: circleAppear 1.8s 0.6s forwards;
}

@keyframes circleAppear {
    0% {
        opacity: 0;
        width: 200px;
        height: 200px;
    }
    30% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        width: 300px;
        height: 300px;
    }
}

.hero-title {
    font-family: 'Varela Round', sans-serif;
    font-size: 14px;
    font-weight: 400;
    text-transform: lowercase;
    letter-spacing: 0.05em;
    color: #e8e0d0;
    margin-top: 2rem;
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    animation: typeIn 2s 1.8s steps(18) forwards;
}

@keyframes typeIn {
    to {
        width: 11em;
    }
}

/* ---- Content Sections ---- */
.content-section {
    position: relative;
    min-height: 200vh;
    padding: 10vh 0;
    z-index: 1;
}

.reading-column {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (min-width: 1200px) {
    .reading-column {
        margin-left: 12vw;
        margin-right: auto;
    }
}

/* ---- Prose Blocks ---- */
.prose-block {
    margin-bottom: 3rem;
}

.prose-block p {
    margin-bottom: 1.5rem;
}

.section-heading {
    font-family: 'Varela Round', sans-serif;
    font-weight: 400;
    font-size: clamp(2rem, 4vw + 1rem, 4rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-transform: lowercase;
    color: #e8e0d0;
    margin-bottom: 2rem;
}

.caption-text {
    font-family: 'DM Mono', monospace;
    font-weight: 300;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9a9488;
}

.contact-line {
    margin-top: 0.5rem;
    color: #b08a4e;
}

/* ---- Fade In ---- */
.fade-in {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Breath / Spacing ---- */
.breath {
    height: 12vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.breath-large {
    height: 18vh;
}

.breath-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9a9488;
    opacity: 0.5;
}

.breath-dot-gold {
    background: #b08a4e;
}

.breath-line {
    width: 40px;
    height: 1px;
    background: rgba(232, 224, 208, 0.2);
}

.imperfect-circles {
    width: 200px;
    height: 200px;
}

.imperfect-circles svg {
    width: 100%;
    height: 100%;
}

/* ---- Blobs ---- */
.blob {
    position: absolute;
    border-radius: 30% 70% 60% 40% / 50% 40% 70% 60%;
    z-index: -1;
    pointer-events: none;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: rgba(26, 61, 46, 0.08);
    top: 10%;
    right: 5%;
    animation: blobMorph1 40s ease-in-out infinite, blobDrift1 25s ease-in-out infinite;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: rgba(53, 42, 74, 0.1);
    top: 20%;
    left: -5%;
    animation: blobMorph2 40s ease-in-out infinite, blobDrift2 33s ease-in-out infinite;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: rgba(139, 58, 74, 0.06);
    bottom: 15%;
    right: 10%;
    animation: blobMorph3 40s ease-in-out infinite, blobDrift1 30s ease-in-out infinite;
}

@keyframes blobMorph1 {
    0%   { border-radius: 30% 70% 60% 40% / 50% 40% 70% 60%; }
    25%  { border-radius: 50% 50% 40% 60% / 40% 60% 50% 50%; }
    50%  { border-radius: 40% 60% 70% 30% / 60% 30% 40% 70%; }
    75%  { border-radius: 60% 40% 50% 50% / 30% 70% 60% 40%; }
    100% { border-radius: 30% 70% 60% 40% / 50% 40% 70% 60%; }
}

@keyframes blobMorph2 {
    0%   { border-radius: 50% 50% 40% 60% / 60% 40% 50% 50%; }
    25%  { border-radius: 30% 70% 60% 40% / 50% 40% 70% 60%; }
    50%  { border-radius: 60% 40% 50% 50% / 30% 70% 60% 40%; }
    75%  { border-radius: 40% 60% 70% 30% / 60% 30% 40% 70%; }
    100% { border-radius: 50% 50% 40% 60% / 60% 40% 50% 50%; }
}

@keyframes blobMorph3 {
    0%   { border-radius: 40% 60% 70% 30% / 60% 30% 40% 70%; }
    25%  { border-radius: 60% 40% 50% 50% / 30% 70% 60% 40%; }
    50%  { border-radius: 30% 70% 60% 40% / 50% 40% 70% 60%; }
    75%  { border-radius: 50% 50% 40% 60% / 40% 60% 50% 50%; }
    100% { border-radius: 40% 60% 70% 30% / 60% 30% 40% 70%; }
}

@keyframes blobDrift1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33%      { transform: translate(20px, -15px) rotate(5deg); }
    66%      { transform: translate(-10px, 10px) rotate(-3deg); }
}

@keyframes blobDrift2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33%      { transform: translate(-15px, 20px) rotate(-4deg); }
    66%      { transform: translate(12px, -8px) rotate(6deg); }
}

/* ---- Ambient Layer ---- */
.ambient-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -5;
    pointer-events: none;
    overflow: hidden;
}

.ambient-blob {
    position: absolute;
    border-radius: 40% 60% 50% 50% / 50% 50% 60% 40%;
    opacity: 0.06;
    pointer-events: none;
}

.ab-1 {
    width: 500px;
    height: 500px;
    background: #1e2a4a;
    top: -10%;
    left: -5%;
    animation: blobMorph1 45s ease-in-out infinite, ambientDrift1 60s linear infinite;
}

.ab-2 {
    width: 350px;
    height: 350px;
    background: #8b3a4a;
    top: 30%;
    right: -8%;
    animation: blobMorph2 50s ease-in-out infinite, ambientDrift2 47s linear infinite;
}

.ab-3 {
    width: 400px;
    height: 400px;
    background: #1a3d2e;
    bottom: 10%;
    left: 10%;
    animation: blobMorph3 55s ease-in-out infinite, ambientDrift3 53s linear infinite;
}

.ab-4 {
    width: 250px;
    height: 250px;
    background: #352a4a;
    top: 60%;
    left: 50%;
    animation: blobMorph1 38s ease-in-out infinite, ambientDrift2 41s linear infinite;
}

.ab-5 {
    width: 300px;
    height: 300px;
    background: #b08a4e;
    top: 10%;
    right: 20%;
    opacity: 0.03;
    animation: blobMorph2 42s ease-in-out infinite, ambientDrift1 37s linear infinite;
}

@keyframes ambientDrift1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25%      { transform: translate(30px, -40px) rotate(10deg); }
    50%      { transform: translate(-20px, 20px) rotate(-5deg); }
    75%      { transform: translate(15px, 35px) rotate(8deg); }
}

@keyframes ambientDrift2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25%      { transform: translate(-25px, 30px) rotate(-8deg); }
    50%      { transform: translate(35px, -10px) rotate(12deg); }
    75%      { transform: translate(-15px, -25px) rotate(-3deg); }
}

@keyframes ambientDrift3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25%      { transform: translate(20px, 25px) rotate(6deg); }
    50%      { transform: translate(-30px, -15px) rotate(-10deg); }
    75%      { transform: translate(10px, -30px) rotate(4deg); }
}

/* ---- Constellation Lines ---- */
.constellation {
    position: absolute;
    width: 100%;
    height: 600px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: -1;
    pointer-events: none;
}

.constellation line {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 2s ease;
}

.constellation.drawn line {
    stroke-dashoffset: 0;
}

/* ---- Kintsugi Lines ---- */
.kintsugi-container {
    position: relative;
    height: 100px;
    z-index: 2;
    overflow: hidden;
}

.kintsugi-svg {
    width: 100%;
    height: 100%;
}

.kintsugi-svg path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.2s ease-out;
}

.kintsugi-container.drawn .kintsugi-svg path {
    stroke-dashoffset: 0;
}

/* ---- Time Markers ---- */
.time-markers {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 4rem;
    pointer-events: none;
}

.time-marker {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
}

.marker-label {
    font-family: 'DM Mono', monospace;
    font-weight: 300;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9a9488;
    opacity: 0.6;
}

.marker-value {
    font-family: 'DM Mono', monospace;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.05em;
    color: #9a9488;
}

@media (max-width: 900px) {
    .time-markers {
        display: none;
    }
}

/* ---- General Animations ---- */
@keyframes fadeInSlow {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---- Selection Color ---- */
::selection {
    background: rgba(176, 138, 78, 0.3);
    color: #e8e0d0;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #0e0e12;
}

::-webkit-scrollbar-thumb {
    background: #352a4a;
    border-radius: 2px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .nav {
        padding: 1rem 1.5rem;
    }

    .reading-column {
        padding: 0 1.5rem;
    }

    .blob {
        display: none;
    }
}
