/* doublestandard.xyz - Abstract Glitch Art Tech */
/* Palette: #0d0d0d, #e0e0e0, #ff0040, #00ffff, #ff00ff, #00ff41, #333333 */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

body {
    background: #0d0d0d;
    color: #e0e0e0;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    position: relative;
    overflow-x: hidden;
}

/* ===========================
   SCANLINES OVERLAY
   =========================== */
.scanlines {
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 3px
    );
    pointer-events: none;
    z-index: 1000;
}

/* ===========================
   MIRROR LINE (center vertical)
   =========================== */
.mirror-line {
    position: fixed;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        #ff00ff 20%,
        #00ffff 50%,
        #ff00ff 80%,
        transparent 100%
    );
    opacity: 0.12;
    z-index: 999;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mirror-line.glitching {
    animation: mirrorGlitch 0.15s steps(3) infinite;
    opacity: 0.35;
}

.mirror-line.broken {
    animation: mirrorBreak 0.3s steps(5) infinite;
    opacity: 0.5;
    width: 3px;
    filter: blur(1px);
}

@keyframes mirrorGlitch {
    0% { transform: translateX(0); }
    33% { transform: translateX(-5px); }
    66% { transform: translateX(8px); }
    100% { transform: translateX(-2px); }
}

@keyframes mirrorBreak {
    0% { transform: translateX(0) scaleY(1); opacity: 0.5; }
    20% { transform: translateX(-15px) scaleY(0.95); opacity: 0.8; }
    40% { transform: translateX(20px) scaleY(1.02); opacity: 0.3; }
    60% { transform: translateX(-8px) scaleY(0.98); opacity: 0.7; }
    80% { transform: translateX(12px) scaleY(1.01); opacity: 0.4; }
    100% { transform: translateX(-3px) scaleY(1); opacity: 0.6; }
}

/* ===========================
   CORRUPTED FRAGMENTS (decorative)
   =========================== */
.corrupted-fragments {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 998;
    overflow: hidden;
}

.corrupt-fragment {
    position: absolute;
    font-family: 'Fira Code', monospace;
    font-size: 0.55rem;
    color: #00ff41;
    opacity: 0;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.corrupt-fragment.active {
    opacity: 0.08;
}

/* ===========================
   SIGNAL SECTION (Hero: 0-100vh)
   =========================== */
.signal {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.signal-inner {
    text-align: center;
    position: relative;
    z-index: 2;
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3vw;
    flex-wrap: wrap;
}

.brand-left, .brand-right {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 6vw, 4.5rem);
    color: #e0e0e0;
    letter-spacing: 0.08em;
    display: block;
    line-height: 1.1;
    text-transform: uppercase;
}

.brand-tld-row {
    margin-top: 0.8rem;
}

.brand-tld {
    font-family: 'Fira Code', monospace;
    font-size: clamp(0.7rem, 1.2vw, 1rem);
    color: #00ff41;
    letter-spacing: 0.3em;
}

.mirror {
    transform: scaleX(-1);
    opacity: 0.2;
    filter: blur(1.5px);
    color: #e0e0e0;
}

/* ===========================
   GLITCH TEXT EFFECT
   =========================== */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-family: inherit;
    font-weight: inherit;
    font-size: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    line-height: inherit;
}

.glitch::before {
    color: #ff0040;
    clip-path: inset(0 0 65% 0);
    animation: glitchTop 4s steps(20, end) infinite;
}

.glitch::after {
    color: #00ffff;
    clip-path: inset(65% 0 0 0);
    animation: glitchBottom 4s steps(20, end) infinite;
}

@keyframes glitchTop {
    0%, 87%, 100% { transform: translateX(0); }
    88% { transform: translateX(4px); }
    90% { transform: translateX(-3px); }
    92% { transform: translateX(2px); }
    94% { transform: translateX(-4px); }
    96% { transform: translateX(1px); }
}

@keyframes glitchBottom {
    0%, 87%, 100% { transform: translateX(0); }
    89% { transform: translateX(-3px); }
    91% { transform: translateX(4px); }
    93% { transform: translateX(-2px); }
    95% { transform: translateX(3px); }
    97% { transform: translateX(-1px); }
}

.glitch-mirror::before {
    color: #ff0040;
    clip-path: inset(0 0 65% 0);
    animation: glitchMirrorA 3.5s steps(15, end) infinite;
    opacity: 0.5;
}

.glitch-mirror::after {
    color: #00ffff;
    clip-path: inset(65% 0 0 0);
    animation: glitchMirrorB 3.5s steps(15, end) infinite;
    opacity: 0.5;
}

@keyframes glitchMirrorA {
    0%, 80%, 100% { transform: translateX(0); }
    82% { transform: translateX(-6px); }
    85% { transform: translateX(5px); }
    88% { transform: translateX(-3px); }
    92% { transform: translateX(7px); }
}

@keyframes glitchMirrorB {
    0%, 82%, 100% { transform: translateX(0); }
    84% { transform: translateX(5px); }
    87% { transform: translateX(-7px); }
    90% { transform: translateX(4px); }
    94% { transform: translateX(-5px); }
}

/* ===========================
   ERROR LABEL
   =========================== */
.error-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: #ff0040;
    letter-spacing: 0.15em;
    margin-top: 2.5rem;
}

.error-blink {
    animation: blinkError 1.5s step-end infinite;
}

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

/* ===========================
   SCROLL HINT
   =========================== */
.scroll-hint {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    opacity: 0.4;
    transition: opacity 0.5s ease;
}

.scroll-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

.scroll-hint-text {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: #00ff41;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
}

.scroll-hint-arrow {
    width: 1px;
    height: 20px;
    background: linear-gradient(to bottom, #00ff41, transparent);
    margin: 0 auto;
    animation: scrollArrow 2s ease-in-out infinite;
}

@keyframes scrollArrow {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(8px); opacity: 1; }
}

/* ===========================
   RGB SHIFT (text-shadow)
   =========================== */
.rgb-shift {
    text-shadow: 2px 0 #ff0040, -2px 0 #00ffff;
}

/* Progressive corruption intensity */
.rgb-shift-2 {
    text-shadow: 3px 0 #ff0040, -3px 0 #00ffff;
}

.rgb-shift-3 {
    text-shadow: 4px 1px #ff0040, -4px -1px #00ffff;
}

.rgb-shift-4 {
    text-shadow: 5px 2px #ff0040, -5px -2px #00ffff, 0 0 8px #ff00ff;
}

/* ===========================
   CORRUPTION SECTION (100-300vh)
   =========================== */
.corruption {
    position: relative;
    padding: 6rem 1.5rem 4rem;
}

.corruption-inner {
    max-width: 720px;
    margin: 0 auto;
    position: relative;
}

.glitch-block {
    padding: 2.5rem;
    margin-bottom: 3rem;
    border: 1px solid #333333;
    position: relative;
    background: rgba(13, 13, 13, 0.85);
    overflow: hidden;
}

.glitch-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #333333 30%, #333333 70%, transparent);
}

.glitch-block.intense {
    border-color: #ff0040;
    box-shadow: 0 0 20px rgba(255, 0, 64, 0.06), inset 0 0 30px rgba(255, 0, 64, 0.02);
}

.glitch-block .corrupted-overlay {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 3px,
        rgba(255, 0, 64, 0.02) 3px,
        rgba(255, 0, 64, 0.02) 4px
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.glitch-block.corrupting .corrupted-overlay {
    opacity: 1;
}

.glitch-block .block-noise {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        to right,
        transparent 0%,
        #ff0040 10%,
        transparent 20%,
        #00ffff 40%,
        transparent 50%,
        #ff00ff 70%,
        transparent 80%,
        #00ff41 90%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.5s ease;
}

.glitch-block.corrupting .block-noise {
    opacity: 0.4;
    animation: noiseSlide 2s linear infinite;
}

@keyframes noiseSlide {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(50%); }
}

.error-tag {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: #ff0040;
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.block-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: #e0e0e0;
    margin-bottom: 0.75rem;
}

.block-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #e0e0e0;
    line-height: 1.65;
    opacity: 0.85;
}

/* Corruption divider */
.corruption-divider {
    text-align: center;
    padding: 2rem 0;
    position: relative;
}

.corruption-divider::before,
.corruption-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: #333333;
}

.corruption-divider::before { left: 0; }
.corruption-divider::after { right: 0; }

.divider-text {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: #ff00ff;
    letter-spacing: 0.1em;
    opacity: 0.5;
}

/* ===========================
   GLITCH FLICKER (CSS animation)
   =========================== */
@keyframes glitchFlicker {
    0%, 94%, 100% { transform: translateX(0) skewX(0); }
    95% { transform: translateX(-3px) skewX(-0.5deg); }
    96% { transform: translateX(4px) skewX(0.3deg); }
    97% { transform: translateX(-2px) skewX(-0.2deg); }
    98% { transform: translateX(3px) skewX(0.4deg); }
    99% { transform: translateX(-1px) skewX(0); }
}

.glitch-block[data-corruption="1"] { animation: glitchFlicker 6s steps(1, end) infinite; }
.glitch-block[data-corruption="2"] { animation: glitchFlicker 5s steps(1, end) infinite 0.5s; }
.glitch-block[data-corruption="3"] { animation: glitchFlicker 4s steps(1, end) infinite 0.2s; }
.glitch-block[data-corruption="4"] { animation: glitchFlicker 3s steps(1, end) infinite 0.7s; }

/* ===========================
   BREAKDOWN SECTION (300-370vh)
   =========================== */
.breakdown {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #0d0d0d;
}

.breakdown-inner {
    width: 100%;
    max-width: 900px;
    padding: 3rem 1.5rem;
    text-align: center;
    position: relative;
}

.breakdown-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 4vw, 3rem);
    color: #e0e0e0;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
    position: relative;
}

.glitch-heavy {
    text-shadow: 5px 2px #ff0040, -5px -2px #00ffff, 0 0 15px #ff00ff;
    animation: glitchHeavy 0.5s steps(10, end) infinite;
}

@keyframes glitchHeavy {
    0% { transform: translateX(0) skewX(0); text-shadow: 5px 2px #ff0040, -5px -2px #00ffff, 0 0 15px #ff00ff; }
    10% { transform: translateX(-5px) skewX(-2deg); }
    20% { transform: translateX(8px) skewX(1deg); }
    30% { transform: translateX(-3px) skewX(-1deg); text-shadow: 8px 3px #ff0040, -8px -3px #00ffff, 0 0 25px #ff00ff; }
    40% { transform: translateX(6px) skewX(2deg); }
    50% { transform: translateX(-7px) skewX(-0.5deg); }
    60% { transform: translateX(4px) skewX(1.5deg); text-shadow: 3px 1px #ff0040, -3px -1px #00ffff, 0 0 10px #ff00ff; }
    70% { transform: translateX(-2px) skewX(-1deg); }
    80% { transform: translateX(5px) skewX(0.5deg); }
    90% { transform: translateX(-4px) skewX(-2deg); text-shadow: 6px 2px #ff0040, -6px -2px #00ffff, 0 0 20px #ff00ff; }
    100% { transform: translateX(0) skewX(0); }
}

.glitch-heavy::before,
.glitch-heavy::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-family: inherit;
    font-weight: inherit;
    font-size: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
}

.glitch-heavy::before {
    color: #ff0040;
    clip-path: inset(0 0 50% 0);
    animation: glitchHeavyBefore 0.3s steps(8, end) infinite;
}

.glitch-heavy::after {
    color: #00ffff;
    clip-path: inset(50% 0 0 0);
    animation: glitchHeavyAfter 0.35s steps(8, end) infinite;
}

@keyframes glitchHeavyBefore {
    0% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    50% { transform: translateX(10px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(3px); }
}

@keyframes glitchHeavyAfter {
    0% { transform: translateX(0); }
    25% { transform: translateX(7px); }
    50% { transform: translateX(-9px); }
    75% { transform: translateX(6px); }
    100% { transform: translateX(-4px); }
}

.breakdown-corrupt-lines {
    margin: 1.5rem 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.55rem;
    color: #ff00ff;
    opacity: 0.3;
    line-height: 1.4;
    overflow: hidden;
    max-height: 60px;
}

.breakdown-error-flood {
    margin: 1.5rem 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.5rem;
    color: #ff0040;
    opacity: 0.25;
    line-height: 1.3;
    overflow: hidden;
    max-height: 80px;
}

/* ===========================
   RESOLUTION SECTION (370vh+)
   =========================== */
.resolution {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
}

.resolution-inner {
    position: relative;
    z-index: 2;
}

.resolution-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: #e0e0e0;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.resolution-domain {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: #00ff41;
    letter-spacing: 0.2em;
    display: block;
}

/* ===========================
   FADE IN (Intersection Observer)
   =========================== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===========================
   PROGRESSIVE CORRUPTION CLASSES
   (Applied dynamically via JS based on scroll)
   =========================== */
.corruption-level-1 .glitch-block { border-color: #333333; }
.corruption-level-2 .glitch-block { border-color: #4a4a4a; }
.corruption-level-2 .rgb-shift { text-shadow: 3px 0 #ff0040, -3px 0 #00ffff; }
.corruption-level-3 .glitch-block { border-color: #ff0040; }
.corruption-level-3 .rgb-shift { text-shadow: 4px 1px #ff0040, -4px -1px #00ffff; }
.corruption-level-3 .glitch-block.intense {
    box-shadow: 0 0 30px rgba(255, 0, 64, 0.1), inset 0 0 40px rgba(255, 0, 64, 0.03);
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
    .brand-row {
        flex-direction: column;
        gap: 1rem;
    }

    .brand {
        font-size: clamp(1.5rem, 8vw, 3rem);
    }

    .glitch-block {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    .breakdown-text {
        font-size: clamp(1.2rem, 5vw, 2rem);
    }
}

@media (max-width: 480px) {
    .brand-row {
        gap: 0.5rem;
    }

    .brand-right {
        display: none;
    }

    .glitch-block {
        padding: 1.2rem;
    }
}
