/* ============================================================================
   supremacy.plus - Luminescent Void Design
   ============================================================================ */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0a0a0a;
    color: #e8e8e8;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    line-height: 1.8;
    overflow-x: hidden;
    position: relative;
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00ff88 0%, #001a4d 100%);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00ff88;
}

/* Main Experience Container */
.experience {
    width: 100%;
    min-height: 100vh;
    position: relative;
    background-color: #0a0a0a;
}

/* Section Base Styles */
.section {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #0a0a0a;
}

/* ============================================================================
   SVG and Visual Elements
   ============================================================================ */

/* SVG Base */
svg.central-svg,
svg.spiral-svg,
svg.final-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Resonance Rings - Void Section */
.resonance-ring {
    stroke: #00ff88;
    fill: none;
    opacity: 0.15;
    stroke-width: 1;
}

.ring-1 {
    opacity: 0.1;
    stroke-dasharray: 314;
    stroke-dashoffset: 314;
}

.ring-2 {
    opacity: 0.12;
    stroke-dasharray: 628;
    stroke-dashoffset: 628;
}

.ring-3 {
    opacity: 0.14;
    stroke-dasharray: 942;
    stroke-dashoffset: 942;
}

.ring-4 {
    opacity: 0.16;
    stroke-dasharray: 1256;
    stroke-dashoffset: 1256;
}

.ring-5 {
    opacity: 0.18;
    stroke-dasharray: 1570;
    stroke-dashoffset: 1570;
}

/* Origin Point */
.origin-point {
    fill: #00ff88;
    filter: drop-shadow(0 0 8px 2px #00ff88);
    opacity: 0;
}

/* Spiral Path */
.spiral-path {
    stroke: #00ff88;
    stroke-width: 1;
    fill: none;
    opacity: 0.15;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
}

/* Spiral Nodes */
.node {
    fill: #00ff88;
    opacity: 0.3;
    filter: drop-shadow(0 0 6px 1px #00ff88);
}

.node:nth-child(1) {
    opacity: 0.2;
}

.node:nth-child(2) {
    opacity: 0.3;
}

.node:nth-child(3) {
    opacity: 0.4;
}

/* Final Point */
.final-point {
    fill: #00ff88;
    filter: drop-shadow(0 0 12px 4px #00ff88);
    opacity: 1;
}

.final-glow-1 {
    fill: none;
    stroke: #00ff88;
    stroke-width: 1;
    opacity: 0.3;
    filter: drop-shadow(0 0 20px 5px #00ff88);
}

.final-glow-2 {
    fill: none;
    stroke: #00ff88;
    stroke-width: 0.5;
    opacity: 0.15;
    filter: drop-shadow(0 0 30px 8px #00ff88);
}

/* ============================================================================
   Section Content
   ============================================================================ */

/* Void Section Content */
.void-section {
    background: radial-gradient(circle at center, #1a1a1a 0%, #0a0a0a 100%);
}

.void-content {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    transition: opacity 1.2s ease-out 0.8s;
}

.void-section.active .void-content {
    opacity: 1;
}

/* Spiral Section Content */
.spiral-section {
    background-color: #0a0a0a;
}

.spiral-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 100px,
        #00ff88 100px,
        #00ff88 101px
    );
    opacity: 0.02;
    z-index: 0;
    pointer-events: none;
}

.section-content {
    position: relative;
    z-index: 2;
    text-align: center;
    pointer-events: auto;
    max-width: 600px;
    padding: 2rem;
}

/* Return Section */
.return-section {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    flex-direction: column;
}

.return-content {
    position: relative;
    z-index: 2;
    text-align: center;
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.return-section.active .return-content {
    opacity: 1;
}

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

/* Section Numbers */
.section-number {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(1.2rem, 4vw, 2.5rem);
    color: #00ff88;
    opacity: 0.3;
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
    transition: opacity 0.6s ease;
}

.section.active .section-number {
    opacity: 0.8;
}

/* Section Text */
.section-text {
    font-family: 'Space Mono', monospace;
    font-size: clamp(1.8rem, 6vw, 3.5rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    color: #e8e8e8;
    margin: 1rem 0;
    line-height: 1.4;
    text-transform: lowercase;
    opacity: 0;
    transition: opacity 0.8s ease-out 0.2s;
}

.section.active .section-text {
    opacity: 1;
}

/* Section Detail Text */
.section-detail {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    font-weight: 300;
    color: #b8b8b8;
    margin-top: 1rem;
    opacity: 0;
    transition: opacity 0.8s ease-out 0.4s;
    line-height: 1.8;
}

.section.active .section-detail {
    opacity: 0.8;
}

/* Domain Name */
.domain-name {
    font-family: 'Space Mono', monospace;
    font-size: clamp(3rem, 12vw, 7rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #00ff88;
    text-shadow: 0 0 20px #00ff88, 0 0 40px rgba(0, 255, 136, 0.5);
    margin-bottom: 1.5rem;
    opacity: 0;
    transition: opacity 1s ease-out;
    text-transform: lowercase;
}

.return-section.active .domain-name {
    opacity: 1;
}

/* Return Text */
.return-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    color: #e8e8e8;
    margin: 1rem 0;
    opacity: 0;
    transition: opacity 1s ease-out 0.2s;
    font-weight: 300;
}

.return-section.active .return-text {
    opacity: 0.9;
}

/* Return Subtext */
.return-subtext {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    color: #00ff88;
    opacity: 0;
    transition: opacity 1s ease-out 0.4s;
    letter-spacing: 0.08em;
    margin-top: 1rem;
}

.return-section.active .return-subtext {
    opacity: 0.8;
}

/* ============================================================================
   Progress Indicator
   ============================================================================ */

.progress-indicator {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    color: #00ff88;
    opacity: 0.3;
    transition: opacity 0.3s ease;
    z-index: 100;
    letter-spacing: 0.05em;
    pointer-events: none;
}

/* ============================================================================
   Animations and Transitions
   ============================================================================ */

/* Fade in animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 8px 2px #00ff88);
    }
    50% {
        filter: drop-shadow(0 0 12px 3px #00ff88);
    }
}

@keyframes spiralDraw {
    from {
        stroke-dashoffset: 2000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

.origin-point {
    animation: glowPulse 3s ease-in-out 0.8s forwards;
}

/* Ring animations for void section */
.resonance-ring {
    transition: stroke-dashoffset 0.3s ease-out;
}

.void-section.active .resonance-ring {
    stroke-dashoffset: 0;
}

/* Spiral animations */
.spiral-path {
    transition: stroke-dashoffset 0.1s linear, opacity 0.6s ease;
}

.spiral-section.active .spiral-path {
    opacity: 0.35;
}

.node {
    transition: opacity 0.6s ease, filter 0.6s ease;
}

.spiral-section.active .node {
    opacity: 1;
    filter: drop-shadow(0 0 10px 2px #00ff88);
}

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

@media (max-width: 768px) {
    .section {
        height: 70vh;
    }

    .section-content {
        max-width: 90%;
        padding: 1.5rem;
    }

    .section-number {
        margin-bottom: 1rem;
    }

    .progress-indicator {
        bottom: 1rem;
        right: 1rem;
        font-size: 0.8rem;
    }

    /* Simplify spiral for mobile */
    svg.spiral-svg {
        opacity: 0.5;
    }

    .spiral-path {
        stroke-width: 1.5;
    }

    .node {
        r: 2;
    }

    /* Adjust text sizes for mobile */
    .section-text {
        font-size: clamp(1.4rem, 5vw, 2.5rem);
    }

    .section-detail {
        font-size: clamp(0.85rem, 1vw, 0.95rem);
    }

    .domain-name {
        font-size: clamp(2rem, 10vw, 4rem);
    }

    .return-text {
        font-size: clamp(1rem, 1.8vw, 1.2rem);
    }
}

@media (max-width: 480px) {
    .section {
        height: 60vh;
    }

    .section-content {
        max-width: 95%;
        padding: 1rem;
    }

    .progress-indicator {
        opacity: 0.2;
    }

    .void-content {
        opacity: 1;
    }

    .section-number {
        font-size: clamp(1rem, 3vw, 1.5rem);
    }

    .section-text {
        font-size: clamp(1.2rem, 4vw, 2rem);
        margin: 0.5rem 0;
    }

    .section-detail {
        font-size: 0.85rem;
        margin-top: 0.5rem;
    }

    .node {
        r: 2;
    }

    /* SVG simplification */
    .ring-3, .ring-4, .ring-5 {
        display: none;
    }

    svg.spiral-svg {
        opacity: 0.3;
    }
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
    .progress-indicator {
        display: none;
    }

    .section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ============================================================================
   Accessibility - High Contrast Mode
   ============================================================================ */

@media (prefers-contrast: more) {
    :root {
        --accent: #00ff99;
        --text: #ffffff;
        --bg: #000000;
    }

    body {
        background-color: #000000;
        color: #ffffff;
    }

    .section-number,
    .domain-name,
    .return-subtext {
        color: #00ff99;
    }

    .origin-point,
    .spiral-path,
    .node,
    .final-point,
    .final-glow-1,
    .final-glow-2 {
        stroke: #00ff99;
        fill: #00ff99;
    }
}

/* ============================================================================
   Dark Mode / Light Mode Toggle (if needed)
   ============================================================================ */

@media (prefers-color-scheme: light) {
    /* Keep dark theme as default for this design */
    /* supremacy.plus is fundamentally dark */
}

/* ============================================================================
   Animation Performance
   ============================================================================ */

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

    .origin-point {
        animation: none;
    }
}

/* ============================================================================
   Edge Cases and Overflow Handling
   ============================================================================ */

.experience {
    max-width: 100vw;
    overflow: hidden;
}

/* Ensure SVGs don't overflow */
svg {
    max-width: 100%;
    height: auto;
}

/* Prevent text selection on interactive elements */
.section-number,
.section-text,
.domain-name {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
