/* =========================================
   continua.st — Styles
   Nocturnal alleyway / graffiti-glitch
   ========================================= */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #0d0a0e;
    --bg-deep: #000000;
    --text-primary: #e8ddd0;
    --text-secondary: #9a8e7f;
    --accent-1: #e85d26;
    --accent-2: #f4a623;
    --accent-3: #c2294e;
    --accent-4: #8b3a6b;
    --border-divider: #2a2430;
    --column-max: 680px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Barlow', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.78;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Noise Grain Overlay --- */
#noise-overlay {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
    animation: grain 0.3s steps(4) infinite;
}

@keyframes grain {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(-2px, 1px); }
    50%  { transform: translate(1px, -2px); }
    75%  { transform: translate(-1px, 2px); }
    100% { transform: translate(2px, -1px); }
}

/* Increase noise in closing section (JS adds this class) */
body.closing-active #noise-overlay {
    opacity: 0.10;
    transition: opacity 1s ease;
}

/* --- Fixed "C" Glyph Anchor --- */
#glyph-anchor {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 1000;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 1px solid var(--border-divider);
    border-radius: 50%;
    animation: border-trace 20s linear infinite;
    background: transparent;
}

#glyph-anchor span {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: var(--text-secondary);
    opacity: 0.5;
}

@keyframes border-trace {
    0%   { border-color: var(--accent-1); box-shadow: 0 0 4px rgba(232,93,38,0.2); }
    25%  { border-color: var(--accent-2); box-shadow: 0 0 4px rgba(244,166,35,0.2); }
    50%  { border-color: var(--accent-3); box-shadow: 0 0 4px rgba(194,41,78,0.2); }
    75%  { border-color: var(--accent-4); box-shadow: 0 0 4px rgba(139,58,107,0.2); }
    100% { border-color: var(--accent-1); box-shadow: 0 0 4px rgba(232,93,38,0.2); }
}

/* --- Tech Glyph Watermarks --- */
#watermarks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.watermark {
    position: absolute;
    opacity: 0.04;
    width: 200px;
    height: 200px;
}

.wm-1 { top: 10%; left: 3%; }
.wm-2 { top: 35%; right: 5%; }
.wm-3 { top: 60%; left: 6%; }
.wm-4 { top: 85%; right: 3%; }

/* --- Tag Marks --- */
.tag-mark {
    display: block;
    width: 60px;
    height: 40px;
    margin: 3rem 0 2rem;
    opacity: 0.5;
    transform: rotate(-3deg);
}

.tag-mark-right {
    margin-left: auto;
    margin-right: 2rem;
    transform: rotate(2deg);
}

/* --- HERO ZONE --- */
.zone-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    overflow: hidden;
    z-index: 2;
}

.hero-content {
    position: relative;
    text-align: center;
    opacity: 0;
    animation: heroFadeIn 1.2s ease-out 0.4s forwards;
}

@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: -0.03em;
    line-height: 0.92;
    background: linear-gradient(135deg, #e85d26, #f4a623, #c2294e, #8b3a6b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

/* Drip lines */
.drip-lines {
    position: relative;
    width: 100%;
    height: 120px;
    margin-top: -5px;
}

.drip {
    position: absolute;
    left: var(--drip-left);
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--drip-color);
    transform-origin: top;
    transform: scaleY(0);
    animation: dripDown 3s ease-out var(--drip-delay) forwards;
    opacity: 0.7;
}

@keyframes dripDown {
    0%   { transform: scaleY(0); }
    60%  { transform: scaleY(0.85); }
    80%  { transform: scaleY(0.95); }
    100% { transform: scaleY(1); }
}

/* --- COLUMN (Manifesto) --- */
.column {
    max-width: var(--column-max);
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 2;
}

/* --- MANIFESTO ZONE --- */
.zone-manifesto {
    position: relative;
    padding: 6rem 0;
}

/* --- Manifesto Blocks --- */
.manifesto-block {
    margin-left: var(--indent, 2rem);
    margin-bottom: 3.5rem;
    padding-left: 1.5rem;
    border-left: 4px solid transparent;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.manifesto-block.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Animated left border via pseudo-element */
.manifesto-block::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 0;
    background: var(--border-color, var(--accent-1));
    transition: height 0.6s ease-out 0.1s;
    border-radius: 2px;
}

.manifesto-block.in-view::before {
    height: 100%;
}

/* Border glow on hover */
.manifesto-block:hover::before {
    box-shadow: 0 0 12px var(--border-color, var(--accent-1));
}

.manifesto-block p {
    color: var(--text-primary);
}

/* --- Pull Quotes --- */
.pull-quote {
    font-family: 'Permanent Marker', cursive;
    font-size: 1.4rem;
    color: var(--text-primary);
    transform: rotate(-1.5deg);
    opacity: 0;
    margin: 3rem 0 3rem 2rem;
    padding: 1rem 0;
    text-shadow: 0 0 20px rgba(232, 93, 38, 0.3);
    transition: opacity 0.8s ease-out;
    position: relative;
}

.pull-quote.in-view {
    opacity: 0.7;
}

/* --- Gallery Breakout Zone --- */
.zone-gallery {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    height: 50vh;
    min-height: 300px;
    overflow: hidden;
    z-index: 2;
}

.glitch-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Base layer - abstract gradient acting as "corrupted image" */
.glitch-base {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        145deg,
        var(--bg-primary) 0%,
        #1a1020 15%,
        #2d1525 30%,
        #0d0a0e 45%,
        #1c1018 60%,
        var(--accent-4) 70%,
        var(--bg-primary) 85%,
        #1a0d15 100%
    );
}

/* Abstract block shapes for glitch effect */
.glitch-base::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 10%;
    width: 35%;
    height: 25%;
    background: linear-gradient(90deg, var(--accent-1), transparent);
    opacity: 0.15;
    clip-path: polygon(0 0, 100% 10%, 95% 90%, 5% 100%);
}

.glitch-base::after {
    content: '';
    position: absolute;
    bottom: 15%;
    right: 8%;
    width: 40%;
    height: 30%;
    background: linear-gradient(135deg, var(--accent-3), var(--accent-4));
    opacity: 0.12;
    clip-path: polygon(5% 0, 100% 5%, 95% 100%, 0 90%);
}

/* Red channel layer */
.glitch-red {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        145deg,
        transparent 0%,
        rgba(232, 93, 38, 0.08) 25%,
        transparent 50%,
        rgba(194, 41, 78, 0.1) 75%,
        transparent 100%
    );
    mix-blend-mode: screen;
    transform: translateX(-4px);
}

/* Blue channel layer */
.glitch-blue {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        145deg,
        transparent 0%,
        rgba(139, 58, 107, 0.1) 30%,
        transparent 55%,
        rgba(42, 36, 48, 0.15) 80%,
        transparent 100%
    );
    mix-blend-mode: screen;
    transform: translateX(4px);
}

/* Scanlines */
.scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 1.5px,
        rgba(0, 0, 0, 0.15) 1.5px,
        rgba(0, 0, 0, 0.15) 3px
    );
    pointer-events: none;
}

/* Glitch displacement blocks */
.glitch-image::before {
    content: '';
    position: absolute;
    top: 35%;
    left: 0;
    width: 100%;
    height: 8px;
    background: var(--accent-1);
    opacity: 0.06;
    z-index: 5;
    transform: translateX(0);
    animation: glitchSlice 8s ease-in-out infinite;
}

.glitch-image::after {
    content: '';
    position: absolute;
    top: 68%;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-3);
    opacity: 0.08;
    z-index: 5;
    transform: translateX(0);
    animation: glitchSlice 6s ease-in-out 2s infinite reverse;
}

@keyframes glitchSlice {
    0%, 90%, 100% { transform: translateX(0); opacity: 0; }
    92% { transform: translateX(15px); opacity: 0.1; }
    94% { transform: translateX(-10px); opacity: 0.06; }
    96% { transform: translateX(8px); opacity: 0.08; }
    98% { transform: translateX(-5px); opacity: 0.04; }
}

/* Gallery 2 different colors */
#glitch-2 .glitch-base {
    background: linear-gradient(
        170deg,
        var(--bg-primary) 0%,
        #181020 20%,
        #251520 40%,
        var(--accent-3) 55%,
        #0d0a0e 70%,
        #150d18 90%,
        var(--bg-primary) 100%
    );
}

#glitch-2 .glitch-base::before {
    top: 30%;
    left: 25%;
    width: 45%;
    height: 20%;
    background: linear-gradient(90deg, var(--accent-2), transparent);
    opacity: 0.12;
}

#glitch-2 .glitch-base::after {
    bottom: 20%;
    right: 15%;
    width: 35%;
    height: 25%;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    opacity: 0.1;
}

/* --- Section Transition Lines --- */
.section-line {
    width: 100%;
    max-width: var(--column-max);
    margin: 0 auto;
    height: 1px;
    background: var(--accent-3);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1s ease-out;
    position: relative;
    z-index: 2;
}

.section-line.in-view {
    transform: scaleX(1);
}

/* --- CLOSING ZONE --- */
.zone-closing {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.closing-glyph {
    display: flex;
    align-items: center;
    justify-content: center;
}

.final-tag {
    width: 120px;
    height: 120px;
    animation: slowRotate 720s linear infinite;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.final-tag.in-view {
    opacity: 1;
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
    .column {
        padding: 0 1.2rem;
    }

    .manifesto-block {
        margin-left: calc(var(--indent, 1rem) * 0.5);
    }

    .zone-manifesto {
        padding: 4rem 0;
    }

    .drip-lines {
        height: 80px;
    }

    .tag-mark {
        width: 45px;
    }

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

    .zone-gallery {
        height: 35vh;
        min-height: 220px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(3rem, 15vw, 5rem);
    }

    .manifesto-block {
        margin-left: calc(var(--indent, 1rem) * 0.3);
    }

    .pull-quote {
        font-size: 1.1rem;
        margin-left: 0.5rem;
    }
}
