/* ============================================================
   RRIPPL.com - Fairycore HUD Interface
   Colors: #0a0e1a, #7ec8e3, #c3aed6, #c8d6e5, #4ecdc4, #6c5ce7, #e17055
   Fonts: Space Grotesk, Inter, IBM Plex Mono
   ============================================================ */

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

html, body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #0a0e1a;
    color: #c8d6e5;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    font-feature-settings: 'cv01', 'cv02';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Particle Canvas --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -2;
    opacity: 0.3;
    filter: blur(0.5px);
}

/* --- Ripple Container --- */
#ripple-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 100;
}

.ripple-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid #4ecdc4;
    pointer-events: none;
    animation: rippleExpand 800ms ease-out forwards;
}

@keyframes rippleExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 0.4;
        transform: translate(-50%, -50%);
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
        transform: translate(-50%, -50%);
    }
}

/* --- Floating Info Strips --- */
.info-strip {
    position: fixed;
    z-index: 5;
    opacity: 0;
}

.info-strip-h {
    height: 1px;
    width: 40%;
    left: 30%;
    background: linear-gradient(90deg, transparent, #7ec8e3, transparent);
}

.info-strip-v {
    width: 1px;
    height: 30%;
    top: 35%;
    background: linear-gradient(180deg, transparent, #c3aed6, transparent);
}

.info-strip-top { top: 15%; }
.info-strip-bottom { bottom: 15%; }
.info-strip-left { left: 12%; }
.info-strip-right { right: 12%; }

.info-strip.strip-visible {
    animation: stripPulse 2s ease-out forwards;
}

@keyframes stripPulse {
    0% { opacity: 0; transform: scaleX(0); }
    30% { opacity: 0.6; transform: scaleX(1); }
    100% { opacity: 0; transform: scaleX(1); }
}

.info-strip-v.strip-visible {
    animation: stripPulseV 2s ease-out forwards;
}

@keyframes stripPulseV {
    0% { opacity: 0; transform: scaleY(0); }
    30% { opacity: 0.6; transform: scaleY(1); }
    100% { opacity: 0; transform: scaleY(1); }
}

/* --- Corner HUD Clusters --- */
.hud-corner {
    position: fixed;
    width: 180px;
    height: 120px;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.hud-corner.hud-visible {
    opacity: 1;
}

.hud-top-left { top: 20px; left: 20px; }
.hud-top-right { top: 20px; right: 20px; }
.hud-bottom-left { bottom: 20px; left: 20px; }
.hud-bottom-right { bottom: 20px; right: 20px; }

.hud-corner-frame {
    width: 100%;
    height: 100%;
    padding: 12px 14px;
    position: relative;
    border: 1px solid rgba(126, 200, 227, 0.15);
    background: rgba(126, 200, 227, 0.03);
    animation: hudBorderRotate 12s linear infinite;
}

.hud-corner-frame::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border: 1px solid transparent;
    border-image: linear-gradient(var(--hud-angle, 0deg), #7ec8e3, #c3aed6, #4ecdc4) 1;
    opacity: 0.4;
    animation: hudBorderAngle 12s linear infinite;
}

@keyframes hudBorderAngle {
    0% { border-image: linear-gradient(0deg, #7ec8e3, #c3aed6, #4ecdc4) 1; }
    25% { border-image: linear-gradient(90deg, #7ec8e3, #c3aed6, #4ecdc4) 1; }
    50% { border-image: linear-gradient(180deg, #7ec8e3, #c3aed6, #4ecdc4) 1; }
    75% { border-image: linear-gradient(270deg, #7ec8e3, #c3aed6, #4ecdc4) 1; }
    100% { border-image: linear-gradient(360deg, #7ec8e3, #c3aed6, #4ecdc4) 1; }
}

.hud-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    color: #c8d6e5;
    opacity: 0.5;
    text-transform: uppercase;
    margin-bottom: 2px;
    line-height: 1.4;
}

.hud-data {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.12em;
    color: #7ec8e3;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* --- Central Focus Ring --- */
#focus-ring {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vmin;
    height: 60vmin;
    max-width: 700px;
    max-height: 700px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#focus-ring.ring-visible {
    opacity: 1;
}

#focus-ring-border {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 1px solid #7ec8e3;
    box-shadow: 0 0 40px rgba(126, 200, 227, 0.15), inset 0 0 40px rgba(126, 200, 227, 0.05);
    animation: ringBorderCycle 8s linear infinite, ringBreathe 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 11;
}

@keyframes ringBorderCycle {
    0% { border-color: #7ec8e3; box-shadow: 0 0 40px rgba(126, 200, 227, 0.15), inset 0 0 40px rgba(126, 200, 227, 0.05); }
    33% { border-color: #c3aed6; box-shadow: 0 0 40px rgba(195, 174, 214, 0.15), inset 0 0 40px rgba(195, 174, 214, 0.05); }
    66% { border-color: #7ec8e3; box-shadow: 0 0 40px rgba(126, 200, 227, 0.15), inset 0 0 40px rgba(126, 200, 227, 0.05); }
    100% { border-color: #7ec8e3; box-shadow: 0 0 40px rgba(126, 200, 227, 0.15), inset 0 0 40px rgba(126, 200, 227, 0.05); }
}

@keyframes ringBreathe {
    0%, 100% { border-width: 1px; }
    50% { border-width: 1.5px; }
}

/* --- Sections --- */
.section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-active {
    opacity: 1;
    pointer-events: auto;
}

.section-inner {
    text-align: center;
    padding: 40px;
    max-width: 90%;
}

/* Dissolve effect */
.section-dissolving {
    animation: dissolveOut 600ms ease-out forwards;
}

@keyframes dissolveOut {
    0% { opacity: 1; filter: none; }
    50% { opacity: 0.5; filter: url(#ripple-dissolve); }
    100% { opacity: 0; filter: none; }
}

/* Entry animations per direction */
.section-enter-top {
    animation: enterFromTop 600ms ease-out forwards;
}
.section-enter-right {
    animation: enterFromRight 600ms ease-out forwards;
}
.section-enter-bottom {
    animation: enterFromBottom 600ms ease-out forwards;
}
.section-enter-left {
    animation: enterFromLeft 600ms ease-out forwards;
}

@keyframes enterFromTop {
    0% { opacity: 0; transform: translateY(-40px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes enterFromRight {
    0% { opacity: 0; transform: translateX(40px) scale(0.97); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes enterFromBottom {
    0% { opacity: 0; transform: translateY(40px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes enterFromLeft {
    0% { opacity: 0; transform: translateX(-40px) scale(0.97); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

/* --- Section 1: Hero --- */
.hero-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    filter: drop-shadow(0 4px 12px rgba(78, 205, 196, 0.2));
    animation: iconFloat 4s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.isometric-prism {
    width: 100%;
    height: 100%;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7ec8e3;
    margin-bottom: 16px;
    line-height: 1.1;
}

.hero-title .char {
    display: inline-block;
    opacity: 0;
    animation: charReveal 0.4s ease-out forwards;
}

@keyframes charReveal {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.hero-tagline {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    color: #c3aed6;
    letter-spacing: 0.15em;
    text-transform: lowercase;
    opacity: 0;
}

.hero-tagline.tagline-visible {
    animation: taglineFade 1.2s ease-out forwards;
}

@keyframes taglineFade {
    0% { opacity: 0; }
    100% { opacity: 0.8; }
}

/* --- Section 2: What We Do --- */
.section-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7ec8e3;
    margin-bottom: 30px;
}

.constellation-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.constellation-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.constellation-node.node-visible {
    opacity: 1;
    transform: translateY(0);
}

.iso-icon {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 4px 12px rgba(78, 205, 196, 0.2));
}

.float-icon {
    animation: iconFloat 4s ease-in-out infinite;
}

.constellation-node:nth-child(2) .float-icon { animation-delay: -1s; }
.constellation-node:nth-child(3) .float-icon { animation-delay: -2s; }
.constellation-node:nth-child(4) .float-icon { animation-delay: -3s; }

.node-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.14em;
    color: #c8d6e5;
    opacity: 0.7;
    text-transform: uppercase;
}

.section-body {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #c8d6e5;
    line-height: 1.7;
    opacity: 0.75;
    max-width: 380px;
    margin: 0 auto;
}

/* --- Section 3: Manifesto --- */
.manifesto-lines {
    text-align: left;
    max-width: 420px;
    margin: 0 auto;
}

.manifesto-line {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    color: #c8d6e5;
    line-height: 1.8;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    padding-left: 16px;
    position: relative;
}

.manifesto-line.line-visible {
    opacity: 0.85;
    transform: translateY(0);
}

.manifesto-line::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 8px;
    height: 1px;
    background: #4ecdc4;
    opacity: 0;
    transition: opacity 0.5s ease 0.2s;
}

.manifesto-line.line-visible::before {
    opacity: 0.6;
}

/* --- Section 4: Connect --- */
.section-connect {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.connect-ring {
    width: 120px;
    height: 120px;
    margin: 0 auto 10px;
    animation: iconFloat 5s ease-in-out infinite;
}

.connect-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 16px rgba(126, 200, 227, 0.15));
}

.connect-text {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #c8d6e5;
    opacity: 0.7;
    letter-spacing: 0.04em;
}

.connect-link {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: #7ec8e3;
    text-decoration: none;
    letter-spacing: 0.06em;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.3s ease;
}

.connect-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(135deg, #7ec8e3, #c3aed6, #4ecdc4);
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.connect-link:hover {
    color: #4ecdc4;
}

.connect-link:hover::after {
    opacity: 1;
}

.connect-coordinates {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: #6c5ce7;
    opacity: 0.5;
    margin-top: 8px;
}

.coord-separator {
    margin: 0 8px;
    opacity: 0.3;
}

/* --- Radial Navigation --- */
#nav-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: navHexRotate 20s linear infinite;
}

#nav-trigger.nav-visible {
    opacity: 1;
}

@keyframes navHexRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.nav-hex {
    width: 100%;
    height: 100%;
}

#radial-nav {
    position: fixed;
    bottom: 55px;
    right: 55px;
    width: 0;
    height: 0;
    z-index: 45;
}

.radial-center {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #7ec8e3;
    top: -3px;
    left: -3px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.radial-nav-open .radial-center {
    opacity: 0.6;
}

.radial-node {
    position: absolute;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0) rotate(calc(-1 * var(--angle)));
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    opacity: 0;
    cursor: pointer;
}

.radial-nav-open .radial-node {
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(110px) rotate(calc(-1 * var(--angle)));
    opacity: 0.4;
    transition-delay: var(--delay);
}

.radial-node:nth-child(2) { --angle: -45deg; --delay: 0ms; }
.radial-node:nth-child(3) { --angle: -135deg; --delay: 50ms; }
.radial-node:nth-child(4) { --angle: -225deg; --delay: 100ms; }
.radial-node:nth-child(5) { --angle: -315deg; --delay: 150ms; }

.radial-node.node-active {
    opacity: 1;
}

.radial-node:hover {
    opacity: 0.8;
}

.radial-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #7ec8e3;
    white-space: nowrap;
    padding: 6px 12px;
    border: 1px solid rgba(126, 200, 227, 0.15);
    background: rgba(10, 14, 26, 0.85);
    position: relative;
}

.radial-node.node-active .radial-label {
    border-color: rgba(126, 200, 227, 0.5);
    box-shadow: 0 0 12px rgba(126, 200, 227, 0.15);
}

/* --- Boot Sequence Overlay --- */
#boot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0a0e1a;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease;
}

#boot-overlay.boot-done {
    opacity: 0;
    pointer-events: none;
}

.boot-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.boot-line {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.18em;
    color: #7ec8e3;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-transform: uppercase;
}

.boot-line.boot-line-visible {
    opacity: 0.8;
}

.boot-line:last-child.boot-line-visible {
    color: #4ecdc4;
    opacity: 1;
}

/* --- Glyph Fragments --- */
#glyph-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
}

.glyph-fragment {
    position: absolute;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    color: #7ec8e3;
    opacity: 0;
    animation: glyphDrift 10s ease-in-out forwards;
    pointer-events: none;
}

@keyframes glyphDrift {
    0% { opacity: 0; transform: translateY(0); }
    10% { opacity: 0.08; }
    90% { opacity: 0.08; transform: translateY(-30px); }
    100% { opacity: 0; transform: translateY(-40px); }
}

/* --- Section Transition Filter --- */
.section-with-filter {
    filter: url(#ripple-dissolve);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    #focus-ring {
        width: 85vmin;
        height: 85vmin;
    }

    .hud-corner {
        width: 140px;
        height: 90px;
        opacity: 0;
    }

    .hud-corner-frame {
        padding: 8px 10px;
    }

    .hud-label {
        font-size: 8px;
    }

    .hud-data {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .constellation-grid {
        gap: 16px;
    }

    .iso-icon {
        width: 48px;
        height: 48px;
    }

    #nav-trigger {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }

    #radial-nav {
        bottom: 40px;
        right: 40px;
    }

    .radial-nav-open .radial-node {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(80px) rotate(calc(-1 * var(--angle)));
    }

    .section-inner {
        padding: 20px;
    }

    .manifesto-lines {
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .hud-corner {
        display: none;
    }

    #focus-ring {
        width: 92vmin;
        height: 92vmin;
    }

    .hero-title {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .constellation-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .node-label {
        font-size: 9px;
    }
}
