/* ============================================================
   tsundere.bar — Y2K Futurism × Ma-Negative-Space
   Palette: analogous indigo-violet-lavender + blush reveal
   ============================================================ */

/* --- Variables --- */
:root {
    --void:         #0d0b1e;
    --indigo-deep:  #1a1640;
    --indigo-mid:   #2d2870;
    --violet:       #6b5fc0;
    --lavender:     #a89de8;
    --pale-violet:  #c4b8f0;
    --near-white:   #e8e2ff;
    --lightest:     #f0eeff;
    --chrome:       #d4d0e8;
    --blush:        #f0c8e8;
    --text-muted:   #b8b0d8;
    --text-micro:   #7a72a8;

    --font: 'Nunito', 'Space Grotesk', sans-serif;
}

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

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

body {
    font-family: var(--font);
    font-weight: 300;
    font-size: 16px;
    line-height: 1.9;
    color: var(--text-muted);
    background: radial-gradient(ellipse at 50% 40%, var(--indigo-deep) 0%, var(--void) 70%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- Data Stream: vertical micro-text columns --- */
.data-stream {
    position: fixed;
    top: 0;
    font-size: 9px;
    color: rgba(168, 157, 232, 0.08);
    writing-mode: vertical-lr;
    animation: drift-up 20s linear infinite;
    user-select: none;
    pointer-events: none;
    z-index: 0;
    white-space: nowrap;
    letter-spacing: 0.3em;
    font-family: var(--font);
    font-weight: 400;
}

.data-stream--left {
    left: 3vw;
    animation-duration: 22s;
    animation-delay: -8s;
}

.data-stream--mid {
    left: 12vw;
    animation-duration: 18s;
    animation-delay: -3s;
    opacity: 0.6;
}

@keyframes drift-up {
    from { transform: translateY(100vh); }
    to   { transform: translateY(-100vh); }
}

/* --- Spine Navigation --- */
.spine-nav {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    transform-origin: right center;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
    padding: 0 2rem;
    white-space: nowrap;
}

.spine-nav__item {
    font-family: var(--font);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.25em;
    color: var(--text-micro);
    text-transform: uppercase;
    transition: color 0.4s ease;
    cursor: default;
}

.spine-nav__item:hover {
    color: var(--pale-violet);
}

.spine-nav__separator {
    font-size: 10px;
    color: var(--indigo-mid);
    letter-spacing: 0;
}

/* ============================================================
   SECTION: HERO
   ============================================================ */

.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    align-items: center;
    justify-items: center;
    overflow: hidden;
}

.hero__name {
    position: absolute;
    top: 8vh;
    left: 6vw;
    z-index: 10;
}

.hero__title {
    font-family: var(--font);
    font-weight: 800;
    font-size: clamp(3.5rem, 13vw, 14rem);
    color: var(--near-white);
    letter-spacing: -0.02em;
    line-height: 0.9;
    text-shadow:
        0 0 80px rgba(107, 95, 192, 0.3),
        0 0 160px rgba(107, 95, 192, 0.1);
    transition: text-shadow 0.6s ease;
}

.hero__title:hover {
    text-shadow:
        0 0 80px rgba(240, 200, 232, 0.25),
        0 0 160px rgba(240, 200, 232, 0.1);
}

.hero__tld {
    color: var(--violet);
    opacity: 0.7;
}

/* Hero 3D scene — centered object in void */
.hero__scene {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero__ambient-glow {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60vw;
    height: 40vh;
    background: radial-gradient(ellipse at 50% 100%,
        rgba(107, 95, 192, 0.08) 0%,
        transparent 70%);
    pointer-events: none;
}

/* ============================================================
   RENDER CONTAINERS — skeleton + 3D objects
   ============================================================ */

.render-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.render-container--hero {
    width: 420px;
    height: 420px;
}

.render-container--sphere {
    width: 520px;
    height: 520px;
    transform: translateX(30%);
}

.render-container--mobius {
    width: 620px;
    height: 420px;
}

/* --- Skeleton Loaders --- */
.skeleton {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
    border: 1px solid var(--violet);
    box-shadow: 0 0 20px var(--violet), 0 0 40px rgba(107, 95, 192, 0.2);
    animation: skeleton-shimmer 2s ease-in-out infinite, skeleton-pulse 2s ease-in-out infinite;
    z-index: 10;
    transition: opacity 1s ease;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(107, 95, 192, 0.15) 40%,
        rgba(212, 208, 232, 0.25) 50%,
        rgba(107, 95, 192, 0.15) 60%,
        transparent 100%
    );
    animation: skeleton-sweep 2s linear infinite;
}

@keyframes skeleton-shimmer {
    0%, 100% { box-shadow: 0 0 20px var(--violet), 0 0 40px rgba(107, 95, 192, 0.2); }
    50%       { box-shadow: 0 0 35px var(--violet), 0 0 70px rgba(107, 95, 192, 0.35); }
}

@keyframes skeleton-pulse {
    0%, 100% { border-color: var(--violet); }
    50%       { border-color: var(--chrome); }
}

@keyframes skeleton-sweep {
    from { left: -100%; }
    to   { left: 100%; }
}

.skeleton--torus {
    width: 340px;
    height: 130px;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.skeleton--sphere {
    width: 380px;
    height: 380px;
    border-radius: 50%;
}

.skeleton--mobius {
    width: 500px;
    height: 120px;
    border-radius: 60px;
    transform: translate(-50%, -50%) skewY(-8deg);
}

/* Loaded state — skeleton fades, render blooms in */
.render-container.loaded .skeleton {
    animation: skeleton-bloom 1s ease forwards;
}

@keyframes skeleton-bloom {
    0%   { opacity: 1; box-shadow: 0 0 40px var(--violet); }
    50%  { opacity: 0.3; box-shadow: 0 0 80px var(--chrome), 0 0 120px rgba(240, 200, 232, 0.3); }
    100% { opacity: 0; box-shadow: none; pointer-events: none; }
}

.render-3d {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0s;
}

.render-container.loaded .render-3d {
    opacity: 1;
    transition: opacity 1.2s ease 0.6s;
}

/* --- 3D SVG Objects --- */
.torus-svg {
    width: 360px;
    height: 360px;
    animation: orbit-y 20s linear infinite;
    filter: drop-shadow(0 0 30px rgba(107, 95, 192, 0.5));
    transition: filter 0.6s ease, animation-play-state 0.3s;
}

.sphere-svg {
    width: 440px;
    height: 440px;
    animation: orbit-y 24s linear infinite;
    filter: drop-shadow(0 0 40px rgba(107, 95, 192, 0.4));
    transition: filter 0.6s ease, animation-play-state 0.3s;
}

.mobius-svg {
    width: 580px;
    height: 380px;
    animation: orbit-y 18s linear infinite;
    filter: drop-shadow(0 0 25px rgba(107, 95, 192, 0.35));
    transition: filter 0.6s ease, animation-play-state 0.3s;
}

@keyframes orbit-y {
    from { transform: translate(-50%, -50%) rotateY(0deg); }
    to   { transform: translate(-50%, -50%) rotateY(360deg); }
}

/* --- Orbital Rings --- */
.orbital-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(107, 95, 192, 0.4);
    pointer-events: none;
    transition: border-color 0.6s ease;
}

.orbital-ring--1 {
    width: 500px;
    height: 180px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateX(75deg) rotateZ(0deg);
    animation: ring-orbit 30s linear infinite;
}

.orbital-ring--2 {
    width: 600px;
    height: 220px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateX(70deg) rotateZ(0deg);
    animation: ring-orbit 45s linear infinite reverse;
    border-color: rgba(107, 95, 192, 0.2);
}

.orbital-ring--sphere-1 {
    width: 520px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateX(72deg) rotateZ(20deg);
    animation: ring-orbit 35s linear infinite;
}

@keyframes ring-orbit {
    from { transform: translate(-50%, -50%) rotateX(75deg) rotateZ(0deg); }
    to   { transform: translate(-50%, -50%) rotateX(75deg) rotateZ(360deg); }
}

/* ============================================================
   TSUNDERE REVEAL — the signature interaction
   ============================================================ */

.tsundere-element {
    transition: box-shadow 0.6s ease, filter 0.6s ease;
    cursor: pointer;
}

.tsundere-element:hover {
    box-shadow:
        0 0 60px rgba(240, 200, 232, 0.3),
        0 0 120px rgba(240, 200, 232, 0.1);
    filter: drop-shadow(0 0 20px rgba(240, 200, 232, 0.4));
}

.tsundere-element:hover .torus-svg,
.tsundere-element:hover .sphere-svg,
.tsundere-element:hover .mobius-svg {
    animation-play-state: paused;
    filter: drop-shadow(0 0 30px rgba(240, 200, 232, 0.6));
}

.tsundere-element:hover .orbital-ring {
    border-color: rgba(240, 200, 232, 0.4);
}

/* ============================================================
   SECTION: VOID SPACES
   ============================================================ */

.void {
    position: relative;
    width: 100%;
    height: 35vh;
    overflow: hidden;
}

/* Grid horizon: perspective-receding grid in void-1 */
.grid-horizon {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) perspective(600px) rotateX(70deg);
    width: 200%;
    height: 200px;
    background-image:
        linear-gradient(rgba(45, 40, 112, 0.4) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45, 40, 112, 0.4) 1px, transparent 1px);
    background-size: 60px 60px;
    transform-origin: bottom center;
    opacity: 0.6;
    mask-image: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
}

/* ============================================================
   SECTION: PANEL 2 — sphere + asymmetric text
   ============================================================ */

.panel {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.panel__title {
    font-family: var(--font);
    font-weight: 800;
    font-size: clamp(2rem, 6vw, 7rem);
    color: var(--near-white);
    letter-spacing: -0.02em;
    line-height: 1.0;
    margin-bottom: 2rem;
}

.panel__title--warm {
    color: var(--blush);
    opacity: 0.85;
}

.panel__title--micro {
    font-size: 0.35em;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: var(--text-micro);
    display: block;
    margin-top: 0.5rem;
}

.panel__body {
    font-size: 16px;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.9;
    max-width: 360px;
}

.panel__micro {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--text-micro);
    margin-top: 2.5rem;
    font-family: var(--font);
}

/* Panel 2 layout: text left 30%, sphere right */
.panel-2 {
    justify-content: flex-start;
    padding-left: 8vw;
}

.panel-2__text {
    position: relative;
    z-index: 10;
    max-width: 32vw;
    min-width: 280px;
}

.render-container--sphere {
    position: absolute;
    right: -5vw;
    top: 50%;
    transform: translateY(-50%);
}

/* ============================================================
   SECTION: PANEL 3 — frosted glass panels
   ============================================================ */

.panel-3 {
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding-left: 8vw;
    gap: 4vh;
}

.panel-3__content {
    width: 100%;
}

.panel-3__void {
    flex: 1;
}

.glass-panels {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 3rem;
    max-width: 420px;
}

.glass-panel {
    background: rgba(26, 22, 64, 0.4);
    border: 1px solid rgba(107, 95, 192, 0.35);
    border-radius: 12px;
    padding: 1.2rem 2rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 0 0 1px rgba(212, 208, 232, 0.08) inset,
        0 4px 40px rgba(13, 11, 30, 0.6);
    transition: box-shadow 0.6s ease, border-color 0.6s ease, filter 0.6s ease;
}

.glass-panel:hover {
    border-color: rgba(240, 200, 232, 0.4);
    box-shadow:
        0 0 0 1px rgba(240, 200, 232, 0.15) inset,
        0 0 60px rgba(240, 200, 232, 0.2),
        0 0 120px rgba(240, 200, 232, 0.08);
}

.glass-panel--1 { transform: translateX(0); }
.glass-panel--2 { transform: translateX(2rem); }
.glass-panel--3 { transform: translateX(4rem); }

.glass-panel__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.glass-panel__label {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.3em;
    color: var(--text-micro);
    text-transform: uppercase;
    font-family: var(--font);
}

.glass-panel__value {
    font-size: 14px;
    font-weight: 400;
    color: var(--pale-violet);
    letter-spacing: 0.3em;
}

/* ============================================================
   SECTION: PANEL 4 — Möbius ribbon + minimal text
   ============================================================ */

.panel-4 {
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 6vh;
}

.panel-4__scene {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.panel-4__text {
    text-align: center;
    max-width: 600px;
    padding: 0 2rem;
}

.panel-4__text .panel__body {
    max-width: 100%;
    text-align: center;
    margin: 0 auto;
}

/* Skeleton overrides for Möbius container */
.render-container--mobius .skeleton--mobius {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) skewY(-8deg);
}

/* ============================================================
   ANIMATIONS — entrance / glow
   ============================================================ */

/* Slow ambient glow pulse on body background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 50% 40%,
        rgba(107, 95, 192, 0.04) 0%,
        transparent 60%);
    pointer-events: none;
    animation: ambient-breathe 8s ease-in-out infinite;
    z-index: 0;
}

@keyframes ambient-breathe {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 1; }
}

/* Ensure content sits above ambient layer */
.hero, .void, .panel, .spine-nav {
    position: relative;
    z-index: 1;
}

/* ============================================================
   RESPONSIVE — minimal adjustments
   ============================================================ */

@media (max-width: 900px) {
    .render-container--sphere {
        right: -15vw;
        top: auto;
        bottom: 5vh;
        transform: scale(0.7) translateX(10%);
    }

    .panel-2 {
        align-items: flex-start;
        padding-top: 8vh;
    }

    .panel-2__text {
        max-width: 60vw;
    }

    .render-container--hero {
        width: 300px;
        height: 300px;
    }

    .torus-svg { width: 280px; height: 280px; }
    .skeleton--torus { width: 260px; height: 100px; }
    .orbital-ring--1 { width: 370px; height: 140px; }
    .orbital-ring--2 { width: 440px; height: 165px; }
}

@media (max-width: 600px) {
    .spine-nav { display: none; }

    .panel-4 {
        padding: 0 1rem;
    }

    .mobius-svg {
        width: 360px;
        height: 240px;
    }
}
