/* ============================================================
   layer2.id — Styles
   Generative Identity Laboratory
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: #2A2A3E;
    background: #1A1A2E;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- PALETTE VARIABLES --- */
:root {
    --deep-indigo: #1A1A2E;
    --dark-slate: #2A2A3E;
    --slate-blue: #6A5ACD;
    --soft-lavender: #E8E0F0;
    --botanical-sage: #7A9A6A;
    --signal-amber: #E8A840;
    --pure-white: #FAFAFA;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3 {
    font-family: 'Anybody', sans-serif;
    font-variation-settings: 'wdth' 125;
    color: var(--deep-indigo);
    line-height: 1.1;
}

.section--dark h1,
.section--dark h2,
.section--dark h3 {
    color: var(--pure-white);
}

p {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.8;
    letter-spacing: 0.01em;
    color: var(--dark-slate);
}

.section--dark p {
    color: var(--soft-lavender);
}

code {
    font-family: 'JetBrains Mono', monospace;
    color: var(--slate-blue);
}

/* --- SECTIONS --- */
.section {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.section--dark {
    background: var(--deep-indigo);
}

.section--light {
    background: var(--soft-lavender);
}

/* --- HERO --- */
#hero {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    position: relative;
}

#noise-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 2s ease;
    z-index: 1;
}

#noise-canvas.revealed {
    opacity: 0.3;
}

.hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.hero__title {
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 900;
    font-variation-settings: 'wdth' 125;
    color: var(--pure-white);
    letter-spacing: 0.05em;
    perspective: 1000px;
    display: flex;
    gap: 0.02em;
}

.hero__char {
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
    opacity: 0;
    transform: rotateY(45deg) rotateX(-10deg);
}

.hero__char.visible {
    opacity: 1;
    transform: rotateY(0deg) rotateX(0deg);
}

.hero__subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--soft-lavender);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease 1.5s, transform 1s ease 1.5s;
    letter-spacing: 0.04em;
}

.hero__subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero__identity-mark {
    margin-top: 2rem;
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
    transition: opacity 1.5s ease 2s, transform 1.5s cubic-bezier(0.23, 1, 0.32, 1) 2s;
}

.hero__identity-mark.visible {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.hero__identity-mark svg {
    filter: drop-shadow(0 0 20px rgba(106, 90, 205, 0.4));
}

.hero__cityscape {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    z-index: 1;
    opacity: 0.05;
}

/* --- EDITORIAL SPREAD --- */
.spread {
    padding: 6rem 2rem;
    perspective: 1000px;
}

.spread__grid {
    display: grid;
    max-width: 1400px;
    margin: 0 auto;
    gap: 4rem;
    align-items: start;
}

.spread__grid--left-heavy {
    grid-template-columns: 3fr 2fr;
}

.spread__grid--right-heavy {
    grid-template-columns: 2fr 3fr;
}

.spread__text {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.spread__illustration {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.botanical-svg {
    width: 100%;
    max-width: 400px;
    height: auto;
}

/* --- STICKY LABELS --- */
.sticky-label {
    position: sticky;
    top: 2rem;
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 900;
    font-variation-settings: 'wdth' 125;
    padding: 0.3em 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    z-index: 5;
}

.section--dark .sticky-label {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* --- SHOWCASE SPREADS --- */
.spread--showcase {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 6rem 2rem;
}

.spread__noise-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.04;
}

.spread__overlay {
    position: relative;
    z-index: 2;
    max-width: 900px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.spread__showcase-text {
    font-size: clamp(1.1rem, 1.5vw, 1.35rem);
    line-height: 1.9;
    max-width: 700px;
}

.spread__body {
    max-width: 600px;
}

/* --- CODE BLOCKS --- */
.code-block {
    background: var(--soft-lavender);
    border: 1px solid var(--slate-blue);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    overflow-x: auto;
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.code-block.visible {
    opacity: 1;
    transform: translateX(0);
}

.section--dark .code-block {
    background: rgba(232, 224, 240, 0.08);
    border-color: rgba(106, 90, 205, 0.4);
}

.code-block--wide {
    max-width: 600px;
    width: 100%;
}

.code-block__content {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    line-height: 1.7;
    color: var(--slate-blue);
    white-space: pre-wrap;
}

.section--dark .code-block__content {
    color: var(--signal-amber);
}

/* --- IDENTITY MARKS --- */
.identity-mark {
    display: flex;
    align-items: center;
    justify-content: center;
}

.identity-mark svg {
    filter: drop-shadow(0 0 8px rgba(106, 90, 205, 0.3));
}

/* --- TILT 3D EFFECT --- */
[data-tilt] {
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
}

/* --- SCROLL ENTRANCE ANIMATIONS --- */
.spread__text,
.spread__illustration {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.spread__text.in-view,
.spread__illustration.in-view {
    opacity: 1;
    transform: translateY(0);
}

.spread__overlay {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .spread__grid--left-heavy,
    .spread__grid--right-heavy {
        grid-template-columns: 1fr;
    }

    .spread__grid--right-heavy .spread__illustration {
        order: -1;
    }

    .spread {
        padding: 4rem 1.5rem;
    }

    .hero__title {
        font-size: clamp(2.2rem, 10vw, 4rem);
    }

    .sticky-label {
        position: relative;
        top: 0;
    }
}

@media (max-width: 600px) {
    .spread {
        padding: 3rem 1rem;
    }

    .code-block {
        padding: 1rem;
    }
}

/* --- CITYSCAPE SVG STYLING --- */
.cityscape-rect {
    fill: var(--dark-slate);
}

/* --- BOTANICAL SVG STYLING --- */
.botanical-line {
    fill: none;
    stroke: var(--deep-indigo);
    stroke-width: 1.5;
    stroke-linecap: round;
}

.section--dark .botanical-line {
    stroke: var(--soft-lavender);
}

.botanical-fill-sage {
    fill: var(--botanical-sage);
    opacity: 0.6;
}

.botanical-fill-blue {
    fill: var(--slate-blue);
    opacity: 0.5;
}

/* --- GENERATIVE MARK COLORS --- */
.mark-stroke {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mark-fill-amber {
    fill: var(--signal-amber);
    opacity: 0.7;
}

.mark-fill-blue {
    fill: var(--slate-blue);
    opacity: 0.6;
}

.mark-fill-sage {
    fill: var(--botanical-sage);
    opacity: 0.5;
}

.mark-stroke-indigo {
    stroke: var(--deep-indigo);
}

.mark-stroke-white {
    stroke: var(--pure-white);
}

.section--dark .mark-stroke-indigo {
    stroke: var(--pure-white);
}
