/* ============================================================
   simidiot.net - Professional Glitch Laboratory
   Creamy-pastel palette with surgical glitch effects
   ============================================================ */

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

:root {
    --warm-cream: #FFF8F0;
    --soft-blush: #F5D6C8;
    --muted-lavender: #D4C5E2;
    --dusty-sage: #B8C9B8;
    --warm-charcoal: #3A3535;
    --deep-plum: #5C3D5E;
    --glitch-cyan: #00E5CC;
    --glitch-magenta: #FF3D8E;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 1.05rem;
    line-height: 1.75;
    font-weight: 400;
    color: var(--warm-charcoal);
    background-color: var(--warm-cream);
    overflow-x: hidden;
    cursor: default;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Nunito', sans-serif;
    color: var(--deep-plum);
    letter-spacing: -0.01em;
}

.section-heading {
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.15;
}

.section-text {
    max-width: 600px;
    margin-bottom: 1.25rem;
}

/* --- Sections --- */
.section {
    position: relative;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6rem 4vw;
}

.section--hero {
    min-height: 100vh;
    align-items: center;
    text-align: center;
}

/* --- Organic-flow offsets --- */
.section-inner {
    position: relative;
    max-width: 720px;
    width: 100%;
}

.section-inner.offset-left {
    margin-left: 8vw;
    margin-right: auto;
}

.section-inner.offset-right {
    margin-left: 20vw;
    margin-right: auto;
}

/* --- Hero Section --- */
.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 800;
    color: var(--deep-plum);
    position: relative;
    display: inline-block;
}

.hero-tagline {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 1.2rem;
    color: var(--warm-charcoal);
    margin-top: 1.5rem;
    opacity: 0.85;
}

/* --- Halftone Background --- */
.halftone-bg {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--warm-charcoal) 0.8px, transparent 0.8px);
    background-size: 6px 6px;
    opacity: 0.02;
    pointer-events: none;
    z-index: 0;
}

/* --- Glitch Text Effect --- */
.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
}

.glitch-text::before {
    color: var(--glitch-cyan);
    z-index: -1;
}

.glitch-text::after {
    color: var(--glitch-magenta);
    z-index: -1;
}

/* Chromatic aberration burst every 4 seconds */
@keyframes glitch-cyan {
    0%, 99% { opacity: 0; transform: translate(0, 0); }
    99.01% { opacity: 0.8; transform: translate(2px, -1px); }
    100% { opacity: 0; transform: translate(0, 0); }
}

@keyframes glitch-magenta {
    0%, 99% { opacity: 0; transform: translate(0, 0); }
    99.01% { opacity: 0.8; transform: translate(-2px, 1px); }
    100% { opacity: 0; transform: translate(0, 0); }
}

.glitch-text::before {
    animation: glitch-cyan 4s step-end infinite;
}

.glitch-text::after {
    animation: glitch-magenta 4s step-end infinite;
}

/* --- Glitch Band (full-width separator) --- */
.glitch-band {
    position: relative;
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
    height: 4px;
    margin-top: auto;
    overflow: hidden;
}

.glitch-band::before,
.glitch-band::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-band::before {
    background: linear-gradient(90deg,
        transparent 0%,
        var(--glitch-cyan) 15%,
        transparent 30%,
        var(--glitch-magenta) 50%,
        transparent 65%,
        var(--glitch-cyan) 80%,
        transparent 100%
    );
    opacity: 0.7;
}

.glitch-band::after {
    background: linear-gradient(90deg,
        var(--glitch-magenta) 0%,
        transparent 20%,
        var(--glitch-cyan) 45%,
        transparent 60%,
        var(--glitch-magenta) 85%,
        transparent 100%
    );
    opacity: 0.5;
    transform: translateX(3px);
}

/* --- Section 2: Concept --- */
.section--concept {
    background-color: var(--warm-cream);
}

/* Duotone image container */
.duotone-image-wrap {
    position: relative;
    width: 280px;
    height: 360px;
    overflow: hidden;
    border-radius: 4px;
}

.duotone-image-wrap.float-right {
    float: right;
    margin-left: 2rem;
    margin-bottom: 1rem;
    shape-outside: margin-box;
}

.duotone-image-wrap .duotone-overlay {
    position: absolute;
    inset: 0;
    background-color: var(--deep-plum);
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 1;
    opacity: 0.25;
}

.duotone-image-wrap svg,
.duotone-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
    display: block;
}

/* Chevron stripe border */
.chevron-border {
    border: 4px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.chevron-border::before {
    content: '';
    position: absolute;
    inset: -8px;
    z-index: -1;
    background: repeating-linear-gradient(
        45deg,
        var(--deep-plum) 0px,
        var(--deep-plum) 2px,
        transparent 2px,
        transparent 6px
    );
    opacity: 0.2;
    border-radius: 6px;
}

/* Hover chromatic aberration on images */
.duotone-image-wrap:hover {
    animation: img-glitch 200ms step-end forwards;
}

@keyframes img-glitch {
    0% { filter: none; transform: translate(0, 0); }
    25% { filter: none; transform: translate(2px, -1px); box-shadow: -2px 1px 0 var(--glitch-cyan), 2px -1px 0 var(--glitch-magenta); }
    50% { filter: none; transform: translate(-1px, 1px); box-shadow: 1px -1px 0 var(--glitch-magenta), -1px 1px 0 var(--glitch-cyan); }
    75% { filter: none; transform: translate(1px, 0); box-shadow: -2px 1px 0 var(--glitch-cyan); }
    100% { filter: none; transform: translate(0, 0); box-shadow: none; }
}

/* --- Section 3: Exploration --- */
.section--exploration {
    background-color: var(--warm-cream);
    position: relative;
}

/* Crosshatch background */
.crosshatch-bg {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            45deg,
            var(--warm-charcoal) 0px,
            var(--warm-charcoal) 0.5px,
            transparent 0.5px,
            transparent 10px
        ),
        repeating-linear-gradient(
            -45deg,
            var(--warm-charcoal) 0px,
            var(--warm-charcoal) 0.5px,
            transparent 0.5px,
            transparent 10px
        );
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}

.section--exploration .section-inner {
    position: relative;
    z-index: 1;
}

/* Thumbnail cluster */
.thumbnail-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2.5rem;
    justify-content: flex-start;
}

.thumbnail {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 200ms ease;
}

.thumbnail:nth-child(1) { transform: rotate(-2deg) translateY(4px); }
.thumbnail:nth-child(2) { transform: rotate(1deg) translateY(-6px); }
.thumbnail:nth-child(3) { transform: rotate(-1deg) translateY(8px); }
.thumbnail:nth-child(4) { transform: rotate(2deg) translateY(-2px); }

.thumbnail svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: grayscale(1);
}

.thumbnail .duotone-overlay {
    position: absolute;
    inset: 0;
    background-color: var(--deep-plum);
    mix-blend-mode: multiply;
    opacity: 0.2;
    pointer-events: none;
}

/* Thumbnail hover glitch */
.thumbnail:hover {
    transform: rotate(0deg) translateY(0) !important;
    box-shadow:
        2px -1px 0 var(--glitch-cyan),
        -2px 1px 0 var(--glitch-magenta);
    transition: transform 100ms step-end, box-shadow 100ms step-end;
}

.thumbnail:hover .duotone-overlay {
    opacity: 0;
}

/* --- Section 4: Closing --- */
.section--closing {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--warm-cream);
}

.closing-content {
    position: relative;
    max-width: 600px;
    padding: 4rem 2rem;
}

.closing-title {
    font-size: clamp(2.4rem, 6vw, 5rem);
    font-weight: 800;
    color: var(--deep-plum);
    margin-bottom: 1.5rem;
    display: inline-block;
}

.closing-statement {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--warm-charcoal);
    opacity: 0.9;
}

/* Halftone halo around closing title */
.halftone-halo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    border-radius: 50%;
    background-image: radial-gradient(circle, var(--deep-plum) 1px, transparent 1px);
    background-size: 8px 8px;
    pointer-events: none;
    z-index: 0;
    animation: halo-pulse 3s ease-in-out infinite;
}

@keyframes halo-pulse {
    0%, 100% { opacity: 0.02; }
    50% { opacity: 0.05; }
}

.closing-title,
.closing-statement {
    position: relative;
    z-index: 1;
}

/* --- Cursor Glitch Trail --- */
.glitch-trail-particle {
    position: fixed;
    width: 8px;
    height: 4px;
    pointer-events: none;
    mix-blend-mode: difference;
    z-index: 9999;
    opacity: 1;
    animation: trail-fade 400ms ease-out forwards;
}

.glitch-trail-particle--cyan {
    background-color: var(--glitch-cyan);
}

.glitch-trail-particle--magenta {
    background-color: var(--glitch-magenta);
}

@keyframes trail-fade {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.3) translateY(-4px); }
}

/* --- Retro Divider Patterns --- */
.section--concept::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 12px;
    background: repeating-linear-gradient(
        45deg,
        var(--dusty-sage) 0px,
        var(--dusty-sage) 3px,
        transparent 3px,
        transparent 8px
    );
    opacity: 0.3;
}

.section--exploration::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background-image: radial-gradient(circle, var(--deep-plum) 1px, transparent 1px);
    background-size: 6px 6px;
    opacity: 0.15;
    z-index: 1;
}

.section--closing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: repeating-linear-gradient(
        -45deg,
        var(--muted-lavender) 0px,
        var(--muted-lavender) 2px,
        transparent 2px,
        transparent 7px
    );
    opacity: 0.35;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .section {
        padding: 4rem 5vw;
    }

    .section-inner.offset-left,
    .section-inner.offset-right {
        margin-left: 5vw;
        margin-right: 5vw;
    }

    .duotone-image-wrap.float-right {
        float: none;
        width: 100%;
        height: 240px;
        margin-left: 0;
        margin-bottom: 2rem;
    }

    .thumbnail-cluster {
        justify-content: center;
    }

    .hero-title {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }
}
