/* MasqproT.com - Digital Masquerade Protocol */

:root {
    --void-black: #08080f;
    --mask-charcoal: #14141f;
    --electric-cyan: #00f0ff;
    --electric-magenta: #ff003c;
    --ultraviolet: #7b2fff;
    --phantom-silver: #c8c8d4;
    --wire-gold: #d4a017;
    --glitch-white: #eafaff;
}

/* ========== RESET & BASE ========== */

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

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

body {
    background-color: var(--void-black);
    color: var(--phantom-silver);
    font-family: 'Exo 2', sans-serif;
    font-weight: 300;
    font-size: 1.05rem;
    line-height: 1.75;
    overflow-x: hidden;
}

/* ========== LAYER SYSTEM ========== */

.layer-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.layer-content {
    position: relative;
    z-index: 1;
}

.layer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* ========== BACKGROUND GRID ========== */

#bg-grid {
    opacity: 0;
    transition: opacity 1.5s ease;
}

#bg-grid.visible {
    opacity: 1;
}

#grid-canvas {
    width: 100%;
    height: 100%;
}

/* ========== SCANLINE OVERLAY ========== */

#scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 1px,
        rgba(0, 0, 0, 0.15) 1px,
        rgba(0, 0, 0, 0.15) 2px
    );
}

/* ========== NAVIGATION ========== */

#main-nav {
    position: fixed;
    top: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 10;
    pointer-events: all;
}

.nav-diamond {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-direction: row-reverse;
}

.diamond-shape {
    width: 14px;
    height: 14px;
    background: transparent;
    border: 1px solid var(--electric-cyan);
    transform: rotate(45deg);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.nav-diamond:hover .diamond-shape,
.nav-diamond.active .diamond-shape {
    background: var(--electric-magenta);
    border-color: var(--electric-magenta);
}

.nav-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--phantom-silver);
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-diamond:hover .nav-label {
    opacity: 1;
    transform: translateX(0);
}

/* Mask outline hover effect on nav */
.nav-diamond::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 25px;
    border: 1px solid var(--wire-gold);
    border-radius: 50% 50% 40% 40%;
    opacity: 0;
    transition: opacity 0.3s ease;
    transform: translate(-13px, -6px);
    pointer-events: none;
}

.nav-diamond:hover::before {
    opacity: 0.15;
}

/* ========== SECTIONS ========== */

.fullscreen-section {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.section-content {
    padding: 4rem;
}

/* ========== MASK DIVIDER ========== */

.mask-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    z-index: 2;
}

.mask-divider svg {
    width: 100%;
    height: 100%;
}

/* ========== SECTION 1: SIGNAL MASKED ========== */

.section-signal {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.section-signal .section-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.display-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--glitch-white);
    text-shadow: 0 0 40px rgba(0, 240, 255, 0.3);
    line-height: 1;
    position: relative;
}

.letter {
    display: inline-block;
    opacity: 0;
    transform: translateX(15px);
    animation: letterReveal 0.4s ease forwards;
}

@keyframes letterReveal {
    0% {
        opacity: 0;
        transform: translateX(15px);
        text-shadow: 2px 0 var(--electric-magenta), -2px 0 var(--electric-cyan);
    }
    30% {
        opacity: 1;
        transform: translateX(-8px);
        text-shadow: 4px 0 var(--electric-magenta), -4px 0 var(--electric-cyan);
    }
    60% {
        transform: translateX(3px);
        text-shadow: 2px 0 var(--electric-magenta), -2px 0 var(--electric-cyan);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
        text-shadow: 0 0 40px rgba(0, 240, 255, 0.3);
    }
}

.tagline {
    opacity: 0;
    animation: fadeIn 1s ease 2.8s forwards;
}

@keyframes fadeIn {
    to { opacity: 0.6; }
}

.mono-accent {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--electric-cyan);
    opacity: 0.6;
}

/* ========== SECTION 2: THE VENETIAN PROTOCOL ========== */

.section-venetian .section-content {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.split-layout {
    display: flex;
    gap: 4rem;
    align-items: center;
}

.split-left {
    flex: 0 0 58%;
}

.split-right {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.section-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--glitch-white);
    line-height: 1.05;
    margin-bottom: 2rem;
}

.cyan-glow {
    text-shadow: 0 0 30px rgba(0, 240, 255, 0.3);
}

.magenta-glow {
    text-shadow: 0 0 30px rgba(255, 0, 60, 0.3);
}

.violet-glow {
    text-shadow: 0 0 30px rgba(123, 47, 255, 0.3);
}

.body-text p {
    margin-bottom: 1.5rem;
    color: var(--phantom-silver);
}

.mask-illustration {
    width: 100%;
    max-width: 380px;
    height: auto;
}

.mask-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 4s ease;
}

.mask-illustration.animate .mask-path {
    stroke-dashoffset: 0;
}

/* ========== SECTION 3: FACES IN THE STATIC ========== */

.section-faces .section-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section-faces .section-heading {
    text-align: center;
    margin-bottom: 3rem;
}

.identity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem 4rem;
    max-width: 900px;
    margin: 0 auto;
}

.identity-card {
    width: 100%;
    max-width: 340px;
    background: var(--mask-charcoal);
    border: 1px solid rgba(0, 240, 255, 0.1);
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
    clip-path: polygon(0% 0%, 92% 0%, 100% 30%, 100% 100%, 8% 100%, 0% 70%);
    position: relative;
}

.identity-card[data-offset="left"] {
    justify-self: end;
}

.identity-card[data-offset="right"] {
    justify-self: start;
    margin-top: 1rem;
}

.identity-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.identity-card.glitch-enter {
    animation: cardGlitch 0.3s ease;
}

@keyframes cardGlitch {
    0%, 100% {
        text-shadow: none;
        filter: none;
    }
    25% {
        text-shadow: 2px 0 var(--electric-magenta), -2px 0 var(--electric-cyan);
        filter: saturate(2);
    }
    50% {
        text-shadow: -3px 0 var(--electric-magenta), 3px 0 var(--electric-cyan);
        filter: saturate(1.5) brightness(1.2);
    }
    75% {
        text-shadow: 1px 0 var(--electric-magenta), -1px 0 var(--electric-cyan);
        filter: saturate(1.2);
    }
}

.identity-card:hover {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
    border-color: rgba(0, 240, 255, 0.3);
}

.identity-card:hover .static-lines {
    opacity: 0.8;
}

/* Mask outline hover state behind card */
.identity-card::after {
    content: '';
    position: absolute;
    inset: -8px;
    border: 1px solid var(--wire-gold);
    border-radius: 50% 50% 40% 40% / 60% 60% 40% 40%;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: -1;
}

.identity-card:hover::after {
    opacity: 0.1;
}

.card-portrait {
    width: 60px;
    height: 80px;
    background: var(--void-black);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.static-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200%;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(0, 240, 255, 0.08) 2px,
        rgba(0, 240, 255, 0.08) 3px,
        transparent 3px,
        transparent 5px,
        rgba(255, 0, 60, 0.05) 5px,
        rgba(255, 0, 60, 0.05) 6px
    );
    opacity: 0.5;
    transition: opacity 0.3s ease;
    animation: staticScroll 2s linear infinite;
}

@keyframes staticScroll {
    from { transform: translateY(0); }
    to { transform: translateY(-50%); }
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-name {
    font-family: 'Exo 2', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--phantom-silver);
    position: relative;
    margin-bottom: 0.3rem;
}

.redact-bar {
    position: absolute;
    top: 50%;
    left: 0;
    width: 80%;
    height: 2px;
    background: var(--void-black);
    transform: translateY(-50%);
}

.card-hex {
    font-size: 0.65rem;
    word-break: break-all;
}

/* Hover scanline intensify on identity card */
.identity-card:hover .card-portrait::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 1px,
        rgba(0, 240, 255, 0.12) 1px,
        rgba(0, 240, 255, 0.12) 2px
    );
    animation: scanFlicker 0.15s steps(2) infinite;
}

@keyframes scanFlicker {
    0% { opacity: 0.8; }
    50% { opacity: 0.4; }
    100% { opacity: 0.8; }
}

/* ========== SECTION 4: BENEATH THE CHROME ========== */

.section-beneath {
    position: relative;
}

.watermark-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 18rem;
    color: var(--phantom-silver);
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
    line-height: 1;
}

.centered-column {
    max-width: 680px;
    margin: 0 auto;
    padding: 6rem 2rem;
    position: relative;
    z-index: 1;
}

.pull-quote {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-style: italic;
    font-size: 1.5rem;
    line-height: 1.4;
    color: var(--glitch-white);
    border-left: 3px solid var(--electric-magenta);
    padding-left: 1.5rem;
    margin: 2.5rem 0;
    letter-spacing: 0.02em;
}

/* ========== SECTION 5: UNMASK ========== */

.section-unmask {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: background-color 0.5s ease, color 0.5s ease;
}

.section-unmask.inverted {
    background-color: var(--glitch-white);
}

.section-unmask.inverted .domain-reveal {
    color: var(--void-black);
    text-shadow: none;
}

.unmask-final {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.domain-reveal {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--glitch-white);
    text-shadow: 0 0 40px rgba(0, 240, 255, 0.3);
    transition: color 0.5s ease, text-shadow 0.5s ease;
}

.pulse-line {
    width: 200px;
    height: 2px;
    border-radius: 1px;
    animation: pulseLine 3s ease-in-out infinite;
}

@keyframes pulseLine {
    0%, 100% {
        background: var(--electric-cyan);
        box-shadow: 0 0 10px var(--electric-cyan);
    }
    50% {
        background: var(--electric-magenta);
        box-shadow: 0 0 10px var(--electric-magenta);
    }
}

/* ========== WIRE-FRAME MASKS (Overlay) ========== */

.wire-mask {
    position: fixed;
    width: 120px;
    height: auto;
    opacity: 0.12;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.wire-mask-plague {
    top: 15%;
    left: 5%;
    animation: floatDrift1 60s linear infinite;
}

.wire-mask-bauta {
    top: 50%;
    right: 3%;
    animation: floatDrift2 55s linear infinite;
}

.wire-mask-moretta {
    bottom: 20%;
    left: 8%;
    animation: floatDrift3 65s linear infinite;
}

.wire-mask-colombina {
    top: 75%;
    right: 10%;
    width: 140px;
    animation: floatDrift4 58s linear infinite;
}

@keyframes floatDrift1 {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(180deg); }
    100% { transform: translateY(0) rotate(360deg); }
}

@keyframes floatDrift2 {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(20px) rotate(-180deg); }
    100% { transform: translateY(0) rotate(-360deg); }
}

@keyframes floatDrift3 {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(180deg); }
    100% { transform: translateY(0) rotate(360deg); }
}

@keyframes floatDrift4 {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(15px) rotate(-180deg); }
    100% { transform: translateY(0) rotate(-360deg); }
}

/* ========== ENCRYPTED STREAMS (Overlay) ========== */

.encrypted-stream {
    position: fixed;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: var(--electric-cyan);
    opacity: 0.04;
    writing-mode: vertical-rl;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.encrypted-stream span {
    white-space: nowrap;
}

.encrypted-stream-1 {
    top: -10%;
    left: 12%;
    animation: dataRain 25s linear infinite;
}

.encrypted-stream-2 {
    top: -15%;
    left: 45%;
    animation: dataRain 30s linear infinite;
    animation-delay: -8s;
}

.encrypted-stream-3 {
    top: -10%;
    right: 15%;
    animation: dataRain 22s linear infinite;
    animation-delay: -14s;
}

.encrypted-stream-4 {
    top: -12%;
    left: 75%;
    animation: dataRain 28s linear infinite;
    animation-delay: -5s;
}

@keyframes dataRain {
    from { transform: translateY(-10%); }
    to { transform: translateY(120vh); }
}

/* ========== GLITCH BANDS (Overlay) ========== */

.glitch-band {
    position: fixed;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 0, 60, 0.3) 20%,
        rgba(0, 240, 255, 0.2) 40%,
        transparent 60%,
        rgba(123, 47, 255, 0.2) 80%,
        transparent 100%
    );
    opacity: 0;
    pointer-events: none;
    z-index: 5;
}

.glitch-band-1 {
    top: 30%;
    animation: glitchSweep 10s ease-in-out infinite;
}

.glitch-band-2 {
    top: 55%;
    animation: glitchSweep 8s ease-in-out infinite;
    animation-delay: -3s;
}

.glitch-band-3 {
    top: 78%;
    animation: glitchSweep 12s ease-in-out infinite;
    animation-delay: -7s;
}

@keyframes glitchSweep {
    0%, 85%, 100% {
        opacity: 0;
        transform: translateX(0) scaleX(1);
    }
    87% {
        opacity: 0.6;
        transform: translateX(-25px) scaleX(1.03);
    }
    89% {
        opacity: 1;
        transform: translateX(20px) scaleX(0.97);
    }
    91% {
        opacity: 0.5;
        transform: translateX(-15px) scaleX(1.01);
    }
    93% {
        opacity: 0.2;
        transform: translateX(8px) scaleX(1);
    }
    95% {
        opacity: 0;
        transform: translateX(0) scaleX(1);
    }
}

/* ========== SECTION TRANSITIONS / MASK REVEAL ========== */

.section-venetian,
.section-faces,
.section-beneath {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cellipse cx='50' cy='45' rx='48' ry='42' fill='white'/%3E%3Cellipse cx='35' cy='40' rx='12' ry='9'/%3E%3Cellipse cx='65' cy='40' rx='12' ry='9'/%3E%3C/svg%3E");
    mask-size: 0% 0%;
    mask-repeat: no-repeat;
    mask-position: center;
    transition: mask-size 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cellipse cx='50' cy='45' rx='48' ry='42' fill='white'/%3E%3Cellipse cx='35' cy='40' rx='12' ry='9'/%3E%3Cellipse cx='65' cy='40' rx='12' ry='9'/%3E%3C/svg%3E");
    -webkit-mask-size: 0% 0%;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

.section-venetian.revealed,
.section-faces.revealed,
.section-beneath.revealed {
    mask-size: 250% 250%;
    -webkit-mask-size: 250% 250%;
}

/* ========== UNMASK ANIMATION ========== */

.section-unmask .section-content {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 1s ease, transform 1s ease;
}

.section-unmask.revealed .section-content {
    opacity: 1;
    transform: scale(1);
}

/* Clip-path dissolve on unmask */
.section-unmask.dissolve-clips .identity-card {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%) !important;
    transition: clip-path 2s ease;
}

/* Grid brightens on unmask */
#bg-grid.unmask-bright {
    opacity: 1;
}

#bg-grid.unmask-bright #grid-canvas {
    filter: brightness(3) saturate(1.5);
    transition: filter 1s ease;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 900px) {
    .display-title {
        font-size: 5rem;
    }

    .section-heading {
        font-size: 3.5rem;
    }

    .split-layout {
        flex-direction: column;
        gap: 2rem;
    }

    .split-left {
        flex: 1;
    }

    .identity-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .identity-card {
        max-width: 100%;
        justify-self: center !important;
    }

    .identity-card[data-offset="right"] {
        margin-top: 0;
    }

    .domain-reveal {
        font-size: 3rem;
    }

    .watermark-number {
        font-size: 10rem;
    }

    .wire-mask {
        width: 80px;
        opacity: 0.08;
    }

    .wire-mask-colombina {
        display: none;
    }

    #main-nav {
        top: 1rem;
        right: 1rem;
    }
}

@media (max-width: 600px) {
    .display-title {
        font-size: 3.5rem;
    }

    .section-heading {
        font-size: 2.5rem;
    }

    .section-content {
        padding: 2rem 1.5rem;
    }

    .centered-column {
        padding: 4rem 1.5rem;
    }

    .domain-reveal {
        font-size: 2rem;
    }

    .pull-quote {
        font-size: 1.2rem;
    }

    .wire-mask {
        display: none;
    }

    .watermark-number {
        font-size: 7rem;
    }
}
