/* ============================================
   relativity.studio - Styles
   Palette (Analogous):
     Studio Teal:    #2EC4B6
     Deep Indigo:    #3D348B
     Soft Cerulean:  #7678ED
     Warm Lavender:  #A8A4CE
     Crystal White:  #F0F2F4
     Watercolor Blue:#64B5F6
     Prism Pink:     #E8A0BF
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.8;
    color: #A8A4CE;
    background-color: #3D348B;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    color: #F0F2F4;
}

h2 {
    font-size: clamp(28px, 4vw, 56px);
    font-weight: 700;
}

h3 {
    font-size: clamp(20px, 2.5vw, 28px);
    margin-bottom: 12px;
}

code {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 14px;
}

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

/* --- Watercolor Wash (shared) --- */
.watercolor-wash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   STUDIO ENTRANCE (Hero)
   ============================================ */
#studio-entrance {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #3D348B;
}

.wash-entrance {
    background:
        radial-gradient(ellipse at 20% 30%, rgba(61,52,139,0.9) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 70%, rgba(46,196,182,0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(118,120,237,0.4) 0%, transparent 60%),
        radial-gradient(ellipse at 30% 80%, rgba(100,181,246,0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 20%, rgba(232,160,191,0.15) 0%, transparent 45%),
        linear-gradient(160deg, #3D348B 0%, #7678ED 40%, #2EC4B6 70%, #3D348B 100%);
    background-size: 200% 200%;
    animation: washShift 20s ease infinite;
    opacity: 0.85;
}

@keyframes washShift {
    0%   { background-position: 0% 0%; }
    25%  { background-position: 50% 30%; }
    50%  { background-position: 100% 50%; }
    75%  { background-position: 50% 80%; }
    100% { background-position: 0% 0%; }
}

/* Crystalline Prisms */
.crystals-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.crystal {
    position: absolute;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.crystal.visible {
    opacity: 1;
    transform: scale(1);
}

.crystal-1 {
    top: 8%;
    left: 10%;
    width: 100px;
}

.crystal-2 {
    top: 15%;
    right: 12%;
    width: 70px;
}

.crystal-3 {
    bottom: 20%;
    left: 18%;
    width: 85px;
}

.crystal-4 {
    top: 40%;
    right: 8%;
    width: 55px;
}

.crystal-5 {
    bottom: 10%;
    right: 25%;
    width: 90px;
}

.crystal-6 {
    top: 60%;
    left: 5%;
    width: 65px;
}

/* Entrance Content */
.entrance-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.wordmark {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(36px, 6vw, 80px);
    color: #F0F2F4;
    letter-spacing: 0.02em;
    min-height: 1.2em;
    position: relative;
    display: inline-block;
}

.wordmark .cursor {
    display: inline-block;
    width: 3px;
    height: 0.9em;
    background: #2EC4B6;
    margin-left: 2px;
    vertical-align: baseline;
    animation: blink 0.8s step-end infinite;
}

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

.entrance-subtitle {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: clamp(14px, 2vw, 22px);
    color: #A8A4CE;
    margin-top: 16px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease 2s, transform 0.8s ease 2s;
}

.entrance-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, transparent, #2EC4B6);
    animation: scrollPulse 2s ease infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50%      { opacity: 1; transform: scaleY(1); }
}

/* ============================================
   CONCEPT DASHBOARD
   ============================================ */
#concept-dashboard {
    position: relative;
    padding: 100px 40px;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(118,120,237,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 0% 100%, rgba(46,196,182,0.1) 0%, transparent 40%),
        #3D348B;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    color: #F0F2F4;
}

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

/* Concept Panel */
.concept-panel {
    position: relative;
    border-radius: 12px;
    padding: 32px;
    overflow: hidden;
    background: rgba(61,52,139,0.6);
    border: 1px solid transparent;
    background-clip: padding-box;
    transform: perspective(800px) rotateY(0deg);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    opacity: 0;
    transform: translateY(30px);
}

.concept-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.concept-panel:hover {
    transform: perspective(800px) rotateY(2deg) rotateX(-1deg) translateY(-4px);
    box-shadow: 0 12px 40px rgba(46,196,182,0.15);
}

.panel-watercolor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.concept-panel:nth-child(1) .panel-watercolor {
    background: radial-gradient(ellipse at 30% 40%, rgba(46,196,182,0.4) 0%, transparent 70%);
}

.concept-panel:nth-child(2) .panel-watercolor {
    background: radial-gradient(ellipse at 70% 30%, rgba(118,120,237,0.4) 0%, transparent 70%);
}

.concept-panel:nth-child(3) .panel-watercolor {
    background: radial-gradient(ellipse at 50% 60%, rgba(232,160,191,0.3) 0%, transparent 70%);
}

.concept-panel:nth-child(4) .panel-watercolor {
    background: radial-gradient(ellipse at 40% 70%, rgba(100,181,246,0.35) 0%, transparent 70%);
}

.concept-panel:nth-child(5) .panel-watercolor {
    background: radial-gradient(ellipse at 60% 40%, rgba(168,164,206,0.3) 0%, transparent 70%);
}

.concept-panel:nth-child(6) .panel-watercolor {
    background: radial-gradient(ellipse at 30% 60%, rgba(46,196,182,0.3) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 30%, rgba(232,160,191,0.2) 0%, transparent 60%);
}

/* Prismatic border */
.panel-crystal-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, rgba(46,196,182,0.3), rgba(118,120,237,0.2), rgba(232,160,191,0.3)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}

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

.panel-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
}

.panel-icon svg {
    width: 100%;
    height: 100%;
}

.concept-panel h3 {
    color: #F0F2F4;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
}

.concept-panel p {
    color: #A8A4CE;
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    margin-bottom: 16px;
    min-height: 5em;
}

.equation {
    background: rgba(61,52,139,0.5);
    border-left: 3px solid #2EC4B6;
    padding: 10px 16px;
    border-radius: 0 6px 6px 0;
    display: inline-block;
}

.equation code {
    color: #64B5F6;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
}

/* ============================================
   EXPERIMENT CANVAS
   ============================================ */
#experiment-canvas {
    position: relative;
    padding: 120px 40px;
    overflow: hidden;
    background: #3D348B;
}

.wash-experiment {
    background:
        radial-gradient(ellipse at 30% 20%, rgba(100,181,246,0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(46,196,182,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(118,120,237,0.1) 0%, transparent 60%);
}

.experiment-crystals {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.exp-crystal-1 {
    position: absolute;
    top: 5%;
    right: 5%;
    width: 140px;
    opacity: 0.4;
}

.exp-crystal-2 {
    position: absolute;
    bottom: 10%;
    left: 3%;
    width: 100px;
    opacity: 0.3;
}

.experiment-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.experiment-content h2 {
    margin-bottom: 50px;
    color: #F0F2F4;
}

.experiment-illustration {
    margin: 0 auto 50px;
    max-width: 700px;
}

.spacetime-grid {
    width: 100%;
    height: auto;
    border-radius: 12px;
    background: rgba(61,52,139,0.4);
    padding: 10px;
}

.light-ray {
    animation: dashFlow 3s linear infinite;
}

@keyframes dashFlow {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -24; }
}

.experiment-text {
    text-align: left;
}

.experiment-text p {
    color: #A8A4CE;
    margin-bottom: 30px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    line-height: 1.8;
}

.experiment-equation {
    background: rgba(61,52,139,0.5);
    border-left: 3px solid #E8A0BF;
    padding: 16px 24px;
    border-radius: 0 8px 8px 0;
    margin: 30px 0;
    overflow-x: auto;
}

.experiment-equation code {
    color: #64B5F6;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    white-space: nowrap;
}

/* ============================================
   STUDIO ARCHIVE FOOTER
   ============================================ */
#studio-archive {
    position: relative;
    padding: 80px 40px;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 100%, rgba(61,52,139,1) 0%, transparent 60%),
        linear-gradient(180deg, #3D348B 0%, #2a2460 100%);
}

.wash-footer {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(46,196,182,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(118,120,237,0.06) 0%, transparent 50%);
}

.footer-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.footer-star {
    position: absolute;
    border-radius: 50%;
    animation: starTwinkle 3s ease-in-out infinite;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50%      { opacity: 1; transform: scale(1.2); }
}

.footer-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.footer-wordmark {
    margin-bottom: 16px;
}

.footer-logo {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(20px, 3vw, 32px);
    color: #F0F2F4;
}

.footer-cursor {
    display: inline-block;
    width: 2px;
    height: 0.9em;
    background: #2EC4B6;
    margin-left: 4px;
    vertical-align: baseline;
    animation: blink 0.8s step-end infinite;
}

.footer-tagline {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    color: #A8A4CE;
    font-size: clamp(14px, 1.5vw, 16px);
    margin-bottom: 24px;
}

.footer-divider {
    margin: 0 auto 24px;
    width: 200px;
}

.footer-divider svg {
    width: 100%;
    height: auto;
}

.footer-note {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: #7678ED;
    letter-spacing: 0.05em;
}

/* ============================================
   TYPEWRITER TEXT
   ============================================ */
.typewriter-text {
    position: relative;
}

.typewriter-text .tw-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #2EC4B6;
    margin-left: 1px;
    vertical-align: text-bottom;
    animation: blink 0.8s step-end infinite;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

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

    #concept-dashboard {
        padding: 60px 20px;
    }

    #experiment-canvas {
        padding: 60px 20px;
    }

    .concept-panel p {
        min-height: auto;
    }

    .crystal-1, .crystal-4, .crystal-6 {
        display: none;
    }
}

@media (max-width: 480px) {
    #studio-entrance {
        min-height: 500px;
    }

    .wordmark {
        font-size: clamp(28px, 8vw, 48px);
    }

    .crystal {
        display: none;
    }
}
