/* ============================================
   chloe.cx — Digital Darkroom
   Muted-vintage dark-mode personal creative space
   ============================================ */

/* CSS Custom Properties */
:root {
    --bg-primary: #1a1720;
    --bg-secondary: #231f2b;
    --text-primary: #d4c8b8;
    --text-display: #e8ddd0;
    --accent-gold: #c2a67d;
    --accent-rose: #a87c84;
    --accent-teal: #5e8a87;
    --border-violet: #4a4358;
    --glow-warm: #c2a67d33;
    --meta-gray: #8a7e72;

    --font-body: 'Instrument Serif', Georgia, serif;
    --font-display: 'Syne', sans-serif;
    --font-meta: 'DM Sans', sans-serif;
}

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

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   Opening Experience
   ============================================ */

.opening-curve {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 100vh;
    z-index: 1000;
    pointer-events: none;
    opacity: 1;
    transition: opacity 1.5s ease 3s;
}

.opening-curve.fade-out {
    opacity: 0;
}

.opening-path {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    animation: drawCurve 2s ease-in-out 0.4s forwards;
}

@keyframes drawCurve {
    to {
        stroke-dashoffset: 0;
    }
}

/* Hero */
.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    z-index: 10;
}

.hero-blob {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
    background: radial-gradient(ellipse at center, var(--accent-gold), var(--accent-rose));
    opacity: 0;
    filter: blur(80px);
    animation: heroBlob 8s ease-in-out infinite alternate, heroBlobAppear 1.5s ease-out 1.8s forwards;
    z-index: -1;
}

@keyframes heroBlobAppear {
    to {
        opacity: 0.12;
    }
}

@keyframes heroBlob {
    0% {
        border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
    }
    50% {
        border-radius: 45% 55% 40% 60% / 55% 45% 60% 40%;
    }
    100% {
        border-radius: 55% 45% 50% 50% / 40% 55% 45% 55%;
    }
}

.hero-wordmark {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--text-display);
    font-variation-settings: 'wght' 400;
    opacity: 0;
    animation: wordmarkAppear 0.8s ease-out 2s forwards, wordmarkBold 0.8s ease 2.4s forwards;
    letter-spacing: -0.02em;
}

@keyframes wordmarkAppear {
    to {
        opacity: 1;
    }
}

@keyframes wordmarkBold {
    to {
        font-variation-settings: 'wght' 700;
    }
}

.hero-tagline {
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: var(--meta-gray);
    opacity: 0;
    animation: fadeIn 0.8s ease-out 3.2s forwards;
    margin-top: 1rem;
}

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

/* ============================================
   Flowing Curves (persistent background)
   ============================================ */

.flowing-curves {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
}

/* ============================================
   Content Frames
   ============================================ */

.content-frame {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4rem);
    border: 1px solid var(--border-violet);
    border-radius: 16px;
    background: var(--bg-secondary);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    z-index: 10;
    /* Reveal animation initial state */
    opacity: 0;
    transform: translateY(30px);
    filter: blur(4px);
    transition: opacity 0.6s ease, transform 0.6s ease, filter 0.6s ease;
}

.content-frame.revealed {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.frame-wide {
    max-width: 1100px;
}

.frame-left p,
.frame-left .journal-entries,
.frame-left .contact-links {
    text-align: left;
}

.frame-right p,
.frame-right .journal-entries {
    text-align: right;
}

/* Metadata labels */
.meta-label {
    display: inline-block;
    font-family: var(--font-meta);
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--meta-gray);
    margin-bottom: 1.5rem;
}

/* Section headings with variable weight morph */
.section-heading {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--text-display);
    font-variation-settings: 'wght' 400;
    transition: font-variation-settings 0.6s ease;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.section-heading.weight-morphed {
    font-variation-settings: 'wght' 700;
}

.content-frame p {
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.content-frame p:last-of-type {
    margin-bottom: 0;
}

/* ============================================
   Text Links
   ============================================ */

.text-link {
    display: inline-block;
    color: var(--accent-gold);
    text-decoration: none;
    font-family: var(--font-body);
    background-image: linear-gradient(var(--accent-gold), var(--accent-gold));
    background-size: 0% 2px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease-out;
    margin-top: 1.5rem;
}

.text-link:hover {
    background-size: 100% 2px;
}

/* ============================================
   Gallery Grid
   ============================================ */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1rem, 2vw, 2rem);
    margin-top: 2rem;
}

.duotone-image {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.image-placeholder {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: var(--accent-rose);
}

.image-placeholder svg {
    display: block;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.image-placeholder.developed svg {
    opacity: 1;
}

/* Duotone overlay */
.image-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-rose) 0%, var(--accent-gold) 100%);
    mix-blend-mode: multiply;
    opacity: 0.6;
    transition: opacity 1.5s ease;
    pointer-events: none;
}

.duotone-image:hover .image-placeholder::after {
    opacity: 0.3;
}

.image-caption {
    display: block;
    font-family: var(--font-meta);
    font-size: clamp(0.7rem, 0.8vw, 0.8rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--meta-gray);
    margin-top: 0.75rem;
    text-align: center;
}

/* ============================================
   Journal Entries
   ============================================ */

.journal-entries {
    margin-top: 1.5rem;
}

.journal-entry {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-violet);
}

.journal-entry:last-child {
    border-bottom: none;
}

.entry-date {
    display: inline-block;
    font-family: var(--font-meta);
    font-size: clamp(0.7rem, 0.8vw, 0.8rem);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}

.journal-entry p {
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 0;
}

/* ============================================
   Contact Links
   ============================================ */

.contact-links {
    margin-top: 1.5rem;
}

.contact-links .text-link {
    font-size: clamp(1.1rem, 1.5vw, 1.3rem);
}

/* ============================================
   Breathing Gaps
   ============================================ */

.breathing-gap {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    overflow: hidden;
}

.breathing-gap-final {
    flex-direction: column;
    gap: 2rem;
}

.footer-whisper {
    font-family: var(--font-meta);
    font-size: clamp(0.7rem, 0.8vw, 0.8rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--meta-gray);
    opacity: 0.5;
    z-index: 10;
}

/* Morphing Blobs */
.morphing-blob {
    position: absolute;
    width: clamp(300px, 50vw, 600px);
    height: clamp(300px, 50vw, 600px);
    opacity: 0.15;
    filter: blur(60px);
    border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
}

.blob-1 {
    background: radial-gradient(ellipse at 40% 40%, var(--accent-gold), var(--accent-rose) 70%, transparent);
    animation: blobMorph1 8s ease-in-out infinite alternate;
}

.blob-2 {
    background: radial-gradient(ellipse at 60% 50%, var(--accent-rose), var(--accent-teal) 70%, transparent);
    animation: blobMorph2 10s ease-in-out infinite alternate;
}

.blob-3 {
    background: radial-gradient(ellipse at 50% 60%, var(--accent-teal), var(--accent-gold) 70%, transparent);
    animation: blobMorph3 9s ease-in-out infinite alternate;
}

.blob-4 {
    background: radial-gradient(ellipse at 45% 45%, var(--accent-gold), var(--accent-rose) 60%, transparent);
    animation: blobMorph1 12s ease-in-out infinite alternate;
}

@keyframes blobMorph1 {
    0% {
        border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
        transform: translate(0, 0) scale(1);
    }
    33% {
        border-radius: 45% 55% 40% 60% / 55% 45% 60% 40%;
    }
    66% {
        border-radius: 50% 50% 45% 55% / 60% 40% 55% 45%;
    }
    100% {
        border-radius: 40% 60% 50% 50% / 45% 55% 50% 50%;
        transform: translate(20px, -10px) scale(1.05);
    }
}

@keyframes blobMorph2 {
    0% {
        border-radius: 50% 50% 45% 55% / 55% 45% 50% 50%;
        transform: translate(0, 0) scale(1);
    }
    50% {
        border-radius: 55% 45% 60% 40% / 40% 60% 45% 55%;
    }
    100% {
        border-radius: 45% 55% 50% 50% / 60% 40% 55% 45%;
        transform: translate(-15px, 15px) scale(1.08);
    }
}

@keyframes blobMorph3 {
    0% {
        border-radius: 55% 45% 50% 50% / 45% 55% 50% 50%;
        transform: translate(0, 0);
    }
    50% {
        border-radius: 40% 60% 55% 45% / 50% 50% 45% 55%;
    }
    100% {
        border-radius: 50% 50% 40% 60% / 55% 45% 55% 45%;
        transform: translate(10px, 20px);
    }
}

/* Gap SVG curve */
.gap-curve {
    position: absolute;
    width: 200px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 0.6;
}

/* ============================================
   Radial Navigation
   ============================================ */

.radial-nav {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.nav-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-gold);
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 10;
    animation: navPulse 3s ease-in-out infinite, fadeIn 0.5s ease-out 3.5s both;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-indicator:hover {
    transform: scale(1.3);
    box-shadow: 0 0 20px var(--glow-warm);
}

.nav-dot {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent-gold);
}

@keyframes navPulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.nav-bloom {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-bloom.active {
    pointer-events: all;
    opacity: 1;
}

.nav-item {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-violet);
    color: var(--text-display);
    text-decoration: none;
    font-family: var(--font-meta);
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0;
    transform: translate(-50%, 0) scale(0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: calc(var(--i) * 50ms);
}

.nav-bloom.active .nav-item {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

/* Position nav items in semicircle */
.nav-item[style*="--i:0"] {
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 0) scale(0.5);
}
.nav-bloom.active .nav-item[style*="--i:0"] {
    transform: translate(-50%, 0) scale(1);
    left: 50%;
    bottom: 60px;
}

.nav-item[style*="--i:1"] {
    left: 50%;
    bottom: 0;
}
.nav-bloom.active .nav-item[style*="--i:1"] {
    left: calc(50% - 55px);
    bottom: 50px;
    transform: translate(-50%, 0) scale(1);
}

.nav-item[style*="--i:2"] {
    left: 50%;
    bottom: 0;
}
.nav-bloom.active .nav-item[style*="--i:2"] {
    left: calc(50% - 85px);
    bottom: 20px;
    transform: translate(-50%, 0) scale(1);
}

.nav-item[style*="--i:3"] {
    left: 50%;
    bottom: 0;
}
.nav-bloom.active .nav-item[style*="--i:3"] {
    left: calc(50% + 55px);
    bottom: 50px;
    transform: translate(-50%, 0) scale(1);
}

.nav-item[style*="--i:4"] {
    left: 50%;
    bottom: 0;
}
.nav-bloom.active .nav-item[style*="--i:4"] {
    left: calc(50% + 85px);
    bottom: 20px;
    transform: translate(-50%, 0) scale(1);
}

.nav-item:hover {
    background: var(--accent-gold);
    color: var(--bg-primary);
    box-shadow: 0 0 16px var(--glow-warm);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .content-frame {
        margin: 0 1rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .frame-right p,
    .frame-right .journal-entries {
        text-align: left;
    }

    .hero-blob {
        width: 300px;
        height: 300px;
    }
}

@media (max-width: 480px) {
    .content-frame {
        padding: 1.5rem;
    }

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

/* ============================================
   Prefers Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .content-frame {
        opacity: 1;
        transform: none;
        filter: none;
    }

    .image-placeholder svg {
        opacity: 1;
    }

    .hero-wordmark {
        opacity: 1;
        font-variation-settings: 'wght' 700;
    }

    .hero-tagline {
        opacity: 1;
    }

    .hero-blob {
        opacity: 0.12;
    }

    .opening-curve {
        display: none;
    }
}
