/* holos.dev - Anti-Design Neon Carnival */

/* CSS Custom Properties for counter-animate */
@property --count {
    syntax: '<integer>';
    initial-value: 0;
    inherits: false;
}

@property --scroll-progress {
    syntax: '<number>';
    initial-value: 0;
    inherits: true;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0a0a12;
    color: #e8eaf0;
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.25rem);
    line-height: 1.72;
    overflow-x: hidden;
    position: relative;
}

/* ============================================
   CONSTELLATION BACKGROUND LAYER
   ============================================ */
.constellation-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* ============================================
   NEON BACKGROUND TYPOGRAPHY
   ============================================ */
.neon-bg-text {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.neon-char {
    position: absolute;
    font-family: 'Comfortaa', cursive;
    font-weight: 700;
    font-size: clamp(6rem, 15vw, 20rem);
    color: transparent;
    -webkit-text-stroke: 1.5px #8b8ca820;
    opacity: 0.35;
    user-select: none;
}

/* ============================================
   FLOATING ELEMENTS LAYER
   ============================================ */
.floating-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    pointer-events: none;
}

.floater {
    position: absolute;
    pointer-events: none;
    will-change: transform;
    transition: opacity 0.5s ease;
}

.floater-code {
    background: #12121fcc;
    border: 1px solid #00f0ff40;
    border-radius: 4px;
    padding: 8px 12px;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    opacity: 0.6;
    box-shadow: 0 0 8px #00f0ff20, 0 0 24px #00f0ff10;
    animation: floatDrift 60s ease-in-out infinite alternate;
}

.floater-badge {
    background: #12121fdd;
    border: 1px solid #ff2d7b60;
    border-radius: 2px;
    padding: 4px 10px;
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    color: #ff2d7b;
    opacity: 0.5;
    text-shadow: 0 0 10px #ff2d7b80;
    animation: floatDrift 45s ease-in-out infinite alternate-reverse;
}

@keyframes floatDrift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(10px, -15px); }
    50% { transform: translate(-8px, 8px); }
    75% { transform: translate(12px, 12px); }
    100% { transform: translate(-5px, -10px); }
}

/* ============================================
   OPENING SECTION (0-100vh)
   ============================================ */
.opening-section {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    overflow: hidden;
}

.fragmented-name {
    display: flex;
    align-items: baseline;
    gap: 0;
    position: relative;
    z-index: 20;
}

.frag-letter, .frag-dot {
    font-family: 'Comfortaa', cursive;
    font-weight: 700;
    font-size: clamp(2.5rem, 8vw, 7rem);
    letter-spacing: -0.02em;
    display: inline-block;
    color: #e8eaf0;
    opacity: 0;
    position: relative;
    will-change: transform, opacity;
}

.frag-letter.counting {
    color: #00f0ff;
    font-family: 'Fira Code', monospace;
    text-shadow: 0 0 10px #00f0ff, 0 0 30px #00f0ff40;
}

.frag-letter.scattered {
    position: absolute;
    opacity: 1;
}

.frag-letter.assembled, .frag-dot.assembled {
    opacity: 1;
    position: relative;
    transform: none !important;
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.frag-letter.final-glow {
    text-shadow: 0 0 10px #ff2d7b, 0 0 30px #ff2d7b40, 0 0 60px #ff2d7b20;
    color: #e8eaf0;
}

.frag-dot {
    color: #ff2d7b;
    text-shadow: 0 0 10px #ff2d7b, 0 0 30px #ff2d7b40;
}

@keyframes glowCycle {
    0% { text-shadow: 0 0 10px #ff2d7b, 0 0 30px #ff2d7b40, 0 0 60px #ff2d7b20; }
    33% { text-shadow: 0 0 10px #00f0ff, 0 0 30px #00f0ff40, 0 0 60px #00f0ff20; }
    66% { text-shadow: 0 0 10px #b8ff00, 0 0 30px #b8ff0040, 0 0 60px #b8ff0020; }
    100% { text-shadow: 0 0 10px #ff2d7b, 0 0 30px #ff2d7b40, 0 0 60px #ff2d7b20; }
}

.frag-letter.glow-pulse, .frag-dot.glow-pulse {
    animation: glowCycle 1.5s ease-in-out 1;
}

/* Holos Ring */
.holos-ring-container {
    position: absolute;
    width: 300px;
    height: 300px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    opacity: 0.4;
}

.holos-ring-svg {
    width: 100%;
    height: 100%;
}

.ring-outer {
    animation: ringRotateOuter 60s linear infinite;
    transform-origin: center;
}

.ring-mid {
    animation: ringRotateMid 30s linear infinite reverse;
    transform-origin: center;
}

.ring-inner {
    animation: ringRotateInner 15s linear infinite;
    transform-origin: center;
}

@keyframes ringRotateOuter {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes ringRotateMid {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes ringRotateInner {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   MASONRY SECTION
   ============================================ */
.masonry-section {
    position: relative;
    z-index: 10;
    padding: 5vh 5vw;
    min-height: 300vh;
}

.masonry-grid {
    columns: 3;
    column-gap: clamp(16px, 3vw, 40px);
    max-width: 1400px;
    margin: 0 auto;
}

.masonry-block {
    break-inside: avoid;
    margin-bottom: clamp(16px, 2.5vw, 32px);
    background: #12121f;
    padding: 24px;
    position: relative;
    contain: layout style;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.masonry-block.revealed {
    opacity: 1;
    transform: translateY(0);
}

.masonry-block.revealed.block-rotate-neg {
    transform: rotate(-2deg);
}

.masonry-block.revealed.block-rotate-pos {
    transform: rotate(2.5deg);
}

/* Anti-grid: asymmetric borders, mixed corners */
.block-manifesto {
    border-left: 3px solid #00f0ff;
    border-right: 1px dashed #ff2d7b;
    border-radius: 0 24px 0 24px;
    box-shadow: 8px 8px 0 #ff2d7b20;
}

.block-code {
    border: 1px solid #b8ff0040;
    border-radius: 4px;
    background: #0a0a12;
    box-shadow: -6px 6px 0 #00f0ff15;
}

.block-breather {
    background: transparent;
    padding: 0;
}

.block-neon-char {
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.block-ring {
    column-span: all;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    min-height: 350px;
}

.block-ring .ring-large {
    width: 280px;
    height: 280px;
}

.block-gradient-border {
    background: transparent;
    padding: 0;
}

.block-glitch {
    background: #12121f;
    border-radius: 24px 0 24px 0;
    position: relative;
    min-height: 120px;
    border: 1px solid #ff9e2c30;
}

/* Block dimensions overlay (counter-animate) */
.block-dimensions {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #00f0ff;
    text-shadow: 0 0 10px #00f0ff60;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.masonry-block.counting .block-dimensions {
    opacity: 1;
}

.masonry-block.counting .block-content {
    opacity: 0;
}

.block-content {
    position: relative;
    z-index: 3;
    transition: opacity 0.4s ease 0.3s;
}

/* Manifesto Typography */
.block-manifesto h2 {
    font-family: 'Comfortaa', cursive;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: -0.02em;
    color: #e8eaf0;
    margin-bottom: 12px;
    line-height: 1.2;
}

.block-manifesto p {
    color: #8b8ca8;
    font-size: clamp(0.9rem, 1.1vw, 1.1rem);
}

.text-oversized {
    font-size: 200%;
    color: #ff2d7b;
    text-shadow: 0 0 10px #ff2d7b, 0 0 30px #ff2d7b40;
    display: inline;
    line-height: 1;
}

/* Code Blocks */
.block-code pre {
    margin: 0;
    overflow-x: auto;
}

.block-code code {
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
    letter-spacing: 0.04em;
    line-height: 1.6;
    font-feature-settings: 'liga' 1, 'calt' 1;
}

.hl-kw { color: #ff2d7b; }
.hl-fn { color: #b8ff00; }
.hl-str { color: #00f0ff; }
.hl-num { color: #ff9e2c; }
.hl-comment { color: #8b8ca8; font-style: italic; }

/* Decorative Characters */
.deco-char {
    font-family: 'Comfortaa', cursive;
    font-weight: 700;
    font-size: clamp(5rem, 10vw, 10rem);
    -webkit-text-stroke: 1.5px currentColor;
    color: transparent;
    display: block;
    text-align: center;
}

.deco-magenta {
    -webkit-text-stroke-color: #ff2d7b;
    filter: drop-shadow(0 0 10px #ff2d7b80);
}

.deco-cyan {
    -webkit-text-stroke-color: #00f0ff;
    filter: drop-shadow(0 0 10px #00f0ff80);
}

.deco-lime {
    -webkit-text-stroke-color: #b8ff00;
    filter: drop-shadow(0 0 10px #b8ff0080);
}

/* Breather Borders */
.breather-border {
    width: 100%;
    height: 80px;
    border: 2px solid transparent;
    border-radius: 12px;
}

.breather-cyan {
    border-color: #00f0ff;
    box-shadow: 0 0 8px #00f0ff40, inset 0 0 8px #00f0ff20;
    animation: breathPulse 3s ease-in-out infinite;
}

.breather-magenta {
    border-color: #ff2d7b;
    box-shadow: 0 0 8px #ff2d7b40, inset 0 0 8px #ff2d7b20;
    animation: breathPulse 3s ease-in-out infinite 0.5s;
}

.breather-lime {
    border-color: #b8ff00;
    box-shadow: 0 0 8px #b8ff0040, inset 0 0 8px #b8ff0020;
    animation: breathPulse 3s ease-in-out infinite 1s;
}

@keyframes breathPulse {
    0%, 100% { box-shadow: 0 0 8px currentColor, inset 0 0 8px transparent; }
    50% { box-shadow: 0 0 16px currentColor, inset 0 0 16px transparent; }
}

/* Gradient Pulse Box */
.gradient-pulse-box {
    width: 100%;
    height: 120px;
    border: 2px solid transparent;
    border-image: linear-gradient(135deg, #ff2d7b, #00f0ff) 1;
    animation: gradientShift 4s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { border-image: linear-gradient(135deg, #ff2d7b, #00f0ff) 1; }
    50% { border-image: linear-gradient(135deg, #00f0ff, #b8ff00) 1; }
}

/* Glitch Bars */
.glitch-bar {
    position: absolute;
    left: 15%;
    height: 3px;
    animation: glitchFlicker 2s infinite;
}

.glitch-magenta { background: #ff2d7b; box-shadow: 0 0 6px #ff2d7b; }
.glitch-cyan { background: #00f0ff; box-shadow: 0 0 6px #00f0ff; animation-delay: 0.3s; }
.glitch-lime { background: #b8ff00; box-shadow: 0 0 6px #b8ff00; animation-delay: 0.7s; }

@keyframes glitchFlicker {
    0% { opacity: 1; }
    3% { opacity: 0; }
    6% { opacity: 1; }
    48% { opacity: 1; }
    50% { opacity: 0; }
    53% { opacity: 1; }
    100% { opacity: 1; }
}

/* ============================================
   CONVERGENCE SECTION
   ============================================ */
.convergence-section {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10vh 5vw;
}

.convergence-grid {
    display: flex;
    gap: 40px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 80px;
    max-width: 1000px;
}

.conv-block {
    background: #12121f;
    border: 1px solid #8b8ca840;
    border-radius: 8px;
    padding: 32px 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease;
}

.conv-block.revealed {
    opacity: 1;
    transform: translateY(0);
}

.conv-block p {
    font-family: 'Comfortaa', cursive;
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: #e8eaf0;
    text-align: center;
}

.convergence-final {
    text-align: center;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.convergence-final.visible {
    opacity: 1;
    transform: scale(1);
}

.holos-greek {
    font-family: 'Comfortaa', cursive;
    font-weight: 700;
    font-size: clamp(4rem, 12vw, 12rem);
    color: #e8eaf0;
    text-shadow: 0 0 20px #ff2d7b60, 0 0 40px #00f0ff30, 0 0 80px #b8ff0020;
    animation: breathGlow 4s ease-in-out infinite;
    display: inline-block;
}

@keyframes breathGlow {
    0%, 100% {
        text-shadow: 0 0 20px #ff2d7b60, 0 0 40px #00f0ff30, 0 0 80px #b8ff0020;
    }
    50% {
        text-shadow: 0 0 30px #ff2d7b80, 0 0 60px #00f0ff50, 0 0 100px #b8ff0040;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .masonry-grid {
        columns: 2;
    }
    .block-ring {
        column-span: none;
    }
}

@media (max-width: 600px) {
    .masonry-grid {
        columns: 1;
    }
    .block-ring .ring-large {
        width: 200px;
        height: 200px;
    }
    .holos-ring-container {
        width: 200px;
        height: 200px;
    }
    .convergence-grid {
        gap: 20px;
    }
    .conv-block {
        padding: 20px 24px;
    }
    .floater {
        display: none;
    }
}
