/* ===========================
   rinji.org - Styles
   Luxury-Premium Ephemeral Design
   =========================== */

:root {
    --charcoal-deep: #14141A;
    --neon-violet: #8B5CF6;
    --electric-cyan: #22D3EE;
    --pulse-magenta: #EC4899;
    --soft-cream: #F5F0E8;
    --blob-lavender: #C4B5E0;
    --data-silver: #94A3B8;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--charcoal-deep);
    color: var(--soft-cream);
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.8;
    overflow-x: hidden;
}

/* ===========================
   Typography
   =========================== */

h1, h2, h3, h4 {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.data-label,
.card-label,
.chart-axis-label,
.radial-label,
.radial-sublabel,
.timeline-label,
.bar-value,
.legend-item {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
}

/* ===========================
   Split Section Layout
   =========================== */

.split-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.split-left,
.split-right {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    overflow: hidden;
}

/* ===========================
   Grand Foyer
   =========================== */

.foyer-left {
    background-color: var(--charcoal-deep);
    flex-direction: column;
}

.wordmark-container {
    text-align: center;
    z-index: 2;
}

.wordmark {
    font-family: 'Josefin Sans', sans-serif;
    font-size: clamp(36px, 5.5vw, 72px);
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--soft-cream);
    animation: pulse-glow 3s ease-in-out infinite;
    opacity: 0;
    animation-delay: 0.5s;
    animation-fill-mode: forwards;
}

.wordmark-subtitle {
    font-family: 'Josefin Sans', sans-serif;
    font-size: clamp(20px, 3vw, 40px);
    font-weight: 600;
    color: var(--neon-violet);
    letter-spacing: 0.15em;
    margin-top: 8px;
    opacity: 0;
    animation: fade-in-up 1s ease-out 0.7s forwards;
}

.wordmark-tagline {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(13px, 1.2vw, 16px);
    color: var(--data-silver);
    letter-spacing: 0.08em;
    margin-top: 16px;
    text-transform: uppercase;
    opacity: 0;
    animation: fade-in-up 1s ease-out 0.9s forwards;
}

.foyer-accent {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, var(--neon-violet), var(--electric-cyan));
    opacity: 0;
    animation: fade-in-up 1s ease-out 1s forwards;
}

.foyer-right {
    background: linear-gradient(135deg, rgba(196, 181, 224, 0.08) 0%, rgba(139, 92, 246, 0.05) 100%);
}

/* Radial Chart */
.radial-chart-container {
    position: relative;
    z-index: 2;
    width: clamp(220px, 22vw, 320px);
    height: clamp(220px, 22vw, 320px);
}

.radial-chart {
    width: 100%;
    height: 100%;
}

.radial-track,
.radial-track-inner,
.radial-track-innermost {
    fill: none;
    stroke: rgba(148, 163, 184, 0.1);
    stroke-width: 3;
}

.radial-progress {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
}

.radial-progress-1 {
    stroke: var(--electric-cyan);
    stroke-dasharray: 754;
    stroke-dashoffset: 754;
}

.radial-progress-2 {
    stroke: var(--neon-violet);
    stroke-dasharray: 565;
    stroke-dashoffset: 565;
}

.radial-progress-3 {
    stroke: var(--pulse-magenta);
    stroke-dasharray: 377;
    stroke-dashoffset: 377;
}

.radial-label {
    fill: var(--soft-cream);
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
}

.radial-sublabel {
    fill: var(--electric-cyan);
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.08em;
}

/* ===========================
   Organic Blobs
   =========================== */

.blob {
    position: absolute;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    background: var(--blob-lavender);
    opacity: 0.15;
    animation: blob-morph 8s ease-in-out infinite;
}

.blob-foyer {
    width: 400px;
    height: 400px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.blob-narrative-1 {
    width: 350px;
    height: 350px;
    top: 10%;
    right: -50px;
    animation-delay: -2s;
}

.blob-narrative-2 {
    width: 300px;
    height: 300px;
    bottom: 10%;
    left: -30px;
    animation-delay: -4s;
}

.blob-footer-1 {
    width: 250px;
    height: 250px;
    top: -80px;
    left: 10%;
    opacity: 0.08;
    animation-delay: -1s;
}

.blob-footer-2 {
    width: 200px;
    height: 200px;
    bottom: -60px;
    right: 15%;
    opacity: 0.08;
    animation-delay: -5s;
}

/* ===========================
   Narrative Sections
   =========================== */

.narrative {
    min-height: 90vh;
}

.narrative-reverse {
    direction: rtl;
}

.narrative-reverse > * {
    direction: ltr;
}

.narrative-data {
    background-color: var(--charcoal-deep);
}

.narrative-editorial {
    background: linear-gradient(135deg, rgba(196, 181, 224, 0.05) 0%, rgba(20, 20, 26, 1) 100%);
}

.data-panel {
    width: 100%;
    max-width: 440px;
}

.data-label {
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--electric-cyan);
    margin-bottom: 32px;
    text-transform: uppercase;
}

/* Timeline / Bar Chart */
.timeline-viz {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.timeline-row {
    display: grid;
    grid-template-columns: 140px 1fr 60px;
    align-items: center;
    gap: 12px;
}

.timeline-label {
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--data-silver);
    text-transform: uppercase;
}

.bar-container {
    height: 6px;
    background: rgba(148, 163, 184, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.bar {
    height: 100%;
    border-radius: 3px;
    width: 0;
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-cyan {
    background: var(--electric-cyan);
}

.bar-violet {
    background: var(--neon-violet);
}

.bar-magenta {
    background: var(--pulse-magenta);
}

.bar-value {
    font-size: 11px;
    color: var(--data-silver);
    text-align: right;
}

.timeline-dots {
    display: flex;
    gap: 8px;
    margin-top: 24px;
    justify-content: center;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.2);
}

.dot-active {
    background: var(--neon-violet);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

/* Editorial Content */
.editorial-content {
    position: relative;
    z-index: 2;
    max-width: 440px;
}

.section-heading {
    font-size: clamp(28px, 4.5vw, 48px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 24px;
    color: var(--soft-cream);
}

.editorial-text {
    color: var(--data-silver);
    margin-bottom: 16px;
    font-weight: 400;
}

/* ===========================
   Impact Chart (Narrative 2)
   =========================== */

.impact-chart {
    width: 100%;
    max-width: 400px;
    margin-bottom: 16px;
}

.grid-line {
    stroke: rgba(148, 163, 184, 0.15);
    stroke-width: 1;
}

.impact-line {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 2s ease-out;
}

.impact-line-1 {
    stroke: var(--electric-cyan);
}

.impact-line-2 {
    stroke: var(--neon-violet);
}

.impact-dot {
    fill: var(--electric-cyan);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.impact-dot.dot-magenta {
    fill: var(--pulse-magenta);
}

.chart-axis-label {
    fill: var(--data-silver);
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.impact-legend {
    display: flex;
    gap: 24px;
}

.legend-item {
    font-size: 11px;
    color: var(--data-silver);
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-swatch {
    width: 12px;
    height: 3px;
    border-radius: 2px;
    display: inline-block;
}

.swatch-cyan {
    background: var(--electric-cyan);
}

.swatch-violet {
    background: var(--neon-violet);
}

/* ===========================
   Temporal Dashboard
   =========================== */

.dashboard-section {
    padding: 100px 40px;
    text-align: center;
    background: linear-gradient(180deg, var(--charcoal-deep) 0%, rgba(139, 92, 246, 0.03) 50%, var(--charcoal-deep) 100%);
}

.dashboard-title {
    font-size: clamp(28px, 4.5vw, 56px);
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--soft-cream);
}

.dashboard-subtitle {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.18em;
    color: var(--data-silver);
    text-transform: uppercase;
    margin-bottom: 64px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.glass-card {
    background: rgba(148, 163, 184, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 16px;
    padding: 36px 28px;
    backdrop-filter: blur(10px);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.glass-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.08);
}

.card-label {
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--electric-cyan);
    margin-bottom: 24px;
    text-transform: uppercase;
}

.card-metric {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.mini-radial {
    width: 90px;
    height: 90px;
}

.mini-track {
    fill: none;
    stroke: rgba(148, 163, 184, 0.1);
    stroke-width: 4;
}

.mini-progress {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
    stroke-dasharray: 251;
    stroke-dashoffset: 251;
    transition: stroke-dashoffset 1.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.mini-progress-1 { stroke: var(--electric-cyan); }
.mini-progress-2 { stroke: var(--neon-violet); }
.mini-progress-3 { stroke: var(--pulse-magenta); }
.mini-progress-4 { stroke: var(--electric-cyan); }
.mini-progress-5 { stroke: var(--neon-violet); }
.mini-progress-6 { stroke: var(--blob-lavender); }

.mini-value {
    fill: var(--soft-cream);
    font-family: 'Josefin Sans', sans-serif;
    font-size: 22px;
    font-weight: 700;
}

.card-description {
    font-size: 13px;
    color: var(--data-silver);
    line-height: 1.7;
}

/* ===========================
   Ephemeral Footer
   =========================== */

#ephemeral-footer {
    position: relative;
    padding: 80px 40px 60px;
    background-color: var(--charcoal-deep);
    text-align: center;
    overflow: hidden;
}

.footer-blobs {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.footer-content {
    position: relative;
    z-index: 2;
}

.footer-wordmark {
    font-family: 'Josefin Sans', sans-serif;
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--soft-cream);
    margin-bottom: 4px;
}

.footer-kanji {
    font-family: 'Josefin Sans', sans-serif;
    font-size: clamp(16px, 2vw, 22px);
    font-weight: 600;
    color: var(--neon-violet);
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.footer-tagline {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--data-silver);
    letter-spacing: 0.04em;
    font-style: italic;
}

.footer-border-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-violet), var(--electric-cyan), var(--neon-violet), transparent);
    opacity: 0.4;
}

/* ===========================
   Animations
   =========================== */

@keyframes pulse-glow {
    0% {
        opacity: 1;
        text-shadow: 0 0 5px rgba(139, 92, 246, 0.3);
    }
    50% {
        opacity: 1;
        text-shadow: 0 0 20px rgba(139, 92, 246, 0.6), 0 0 40px rgba(139, 92, 246, 0.2);
    }
    100% {
        opacity: 1;
        text-shadow: 0 0 5px rgba(139, 92, 246, 0.3);
    }
}

@keyframes fade-in-up {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blob-morph {
    0%, 100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
    25% {
        border-radius: 58% 42% 36% 64% / 52% 68% 32% 48%;
    }
    50% {
        border-radius: 42% 58% 64% 36% / 68% 32% 68% 32%;
    }
    75% {
        border-radius: 64% 36% 42% 58% / 36% 64% 36% 64%;
    }
}

/* ===========================
   Scroll-triggered animations
   =========================== */

.narrative-data .data-panel,
.narrative-editorial .editorial-content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.narrative-data.in-view .data-panel,
.narrative-editorial.in-view .editorial-content {
    opacity: 1;
    transform: translateY(0);
}

.glass-card {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, border-color 0.4s ease, box-shadow 0.4s ease;
}

.glass-card.in-view {
    opacity: 1;
    transform: translateY(0);
}

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

@media (max-width: 900px) {
    .split-section {
        grid-template-columns: 1fr;
    }

    .split-left,
    .split-right {
        min-height: 70vh;
        padding: 40px 24px;
    }

    .narrative-reverse {
        direction: ltr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }

    .timeline-row {
        grid-template-columns: 100px 1fr 50px;
    }
}

@media (max-width: 600px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .split-left,
    .split-right {
        padding: 32px 20px;
    }

    .timeline-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .bar-value {
        text-align: left;
    }
}
