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

:root {
    --bg: #1c1a22;
    --surface: #28252f;
    --neon-magenta: #ff2d78;
    --neon-cyan: #00e5ff;
    --stencil-white: #f0ecf4;
    --sodium: #ffb347;
    --rust-orange: #e85d26;
    --field-gray: #5a5466;
}

html, body {
    height: 100%;
    overflow-x: hidden;
    font-family: 'Commissioner', sans-serif;
    background: var(--bg);
    color: var(--stencil-white);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    filter: url(#noiseFilter);
    opacity: 0.07;
    pointer-events: none;
    z-index: 1000;
    mix-blend-mode: overlay;
}

/* ===== Watermark ===== */
.watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Commissioner', sans-serif;
    font-size: 40vw;
    font-weight: 800;
    color: var(--stencil-white);
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
    letter-spacing: 0.04em;
}

/* ===== Grid ===== */
.grid {
    display: grid;
    grid-template-columns: 1fr 1.618fr 1fr 1.618fr 1fr;
    grid-template-rows: minmax(120px, auto) minmax(120px, auto) minmax(120px, auto) auto;
    gap: 16px;
    padding: 24px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    align-content: center;
}

/* ===== Cards ===== */
.card {
    position: relative;
    background: var(--surface);
    border-radius: 4px;
    transform: rotate(var(--rotation, 0deg));
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    filter: url(#noiseFilter);
    opacity: 0.08;
    pointer-events: none;
    mix-blend-mode: overlay;
}

/* ===== Hero Card ===== */
.hero-card {
    grid-column: 2 / 5;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: transparent;
}

.hero-text {
    font-family: 'Commissioner', sans-serif;
    font-weight: 800;
    font-size: clamp(5rem, 14vw, 16rem);
    letter-spacing: 0.04em;
    color: var(--stencil-white);
    text-shadow:
        1px 1px 0 rgba(255, 45, 120, 0.4),
        -1px -1px 0 rgba(0, 229, 255, 0.3),
        0 0 30px rgba(255, 45, 120, 0.2),
        0 0 60px rgba(0, 229, 255, 0.1);
    font-stretch: 85%;
    user-select: none;
}

/* ===== Manifesto Cards ===== */
.manifesto-card {
    display: flex;
    align-items: center;
    padding: 28px 24px;
    border: 3px solid var(--field-gray);
    border-width: 3px 2px 4px 3px;
    box-shadow: 2px 3px 0px rgba(0,0,0,0.4);
}

.manifesto-card p {
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-size: clamp(1.1rem, 2.2vw, 1.5rem);
    line-height: 1.55;
    color: var(--stencil-white);
}

[data-grid="manifesto-1"] {
    grid-column: 2 / 3;
    grid-row: 2;
}

[data-grid="manifesto-2"] {
    grid-column: 4 / 5;
    grid-row: 2;
}

[data-grid="manifesto-3"] {
    grid-column: 2 / 4;
    grid-row: 3;
}

/* ===== Signal Cards ===== */
.signal-card {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background: var(--surface);
    padding: 10px;
}

[data-grid="signal-1"] {
    grid-column: 1;
    grid-row: 1;
}

[data-grid="signal-2"] {
    grid-column: 5;
    grid-row: 1;
}

[data-grid="signal-3"] {
    grid-column: 3;
    grid-row: 2;
}

[data-grid="signal-4"] {
    grid-column: 1;
    grid-row: 3;
}

[data-grid="signal-5"] {
    grid-column: 5;
    grid-row: 3;
}

/* Neon glow on signal cards */
[data-grid="signal-1"] {
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.25), 0 0 60px rgba(0, 229, 255, 0.12);
}

[data-grid="signal-2"] {
    box-shadow: 0 0 20px rgba(255, 179, 71, 0.25), 0 0 60px rgba(255, 179, 71, 0.12);
}

[data-grid="signal-3"] {
    box-shadow: 0 0 20px rgba(255, 45, 120, 0.25), 0 0 60px rgba(255, 45, 120, 0.12);
}

[data-grid="signal-4"] {
    box-shadow: 0 0 20px rgba(232, 93, 38, 0.25), 0 0 60px rgba(232, 93, 38, 0.12);
}

[data-grid="signal-5"] {
    box-shadow: 0 0 20px rgba(90, 84, 102, 0.25), 0 0 60px rgba(90, 84, 102, 0.12);
}

/* ===== Transmission Card ===== */
.transmission-card {
    grid-column: 1 / -1;
    grid-row: 4;
    padding: 20px 28px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    letter-spacing: 0.02em;
    color: var(--neon-cyan);
    border-top: 2px solid var(--field-gray);
    display: flex;
    align-items: center;
    min-height: 60px;
}

.terminal-text {
    white-space: pre;
}

.cursor {
    animation: blink 1.06s step-end infinite;
    color: var(--neon-cyan);
}

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

/* ===== Deep Section ===== */
.deep-section {
    min-height: 100vh;
    background: #0e0d12;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.deep-content {
    text-align: center;
}

.deep-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: var(--field-gray);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.deep-link {
    font-family: 'Commissioner', sans-serif;
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--neon-magenta);
    text-decoration: none;
    text-shadow: 0 0 20px rgba(255, 45, 120, 0.4), 0 0 60px rgba(255, 45, 120, 0.2);
    transition: text-shadow 0.3s ease;
}

.deep-link:hover {
    text-shadow: 0 0 30px rgba(255, 45, 120, 0.6), 0 0 80px rgba(255, 45, 120, 0.3);
}

/* ===== Initial load animation ===== */
.card {
    opacity: 0;
    animation: settleIn 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card:nth-child(8) { animation-delay: 0.4s; }
.card:nth-child(9) { animation-delay: 0.45s; }
.card:nth-child(10) { animation-delay: 0.5s; }

@keyframes settleIn {
    0% {
        opacity: 0;
        transform: rotate(var(--rotation, 0deg)) translate(calc((var(--settle-x, 0)) * 1px), calc((var(--settle-y, 0)) * 1px));
    }
    100% {
        opacity: 1;
        transform: rotate(var(--rotation, 0deg)) translate(0, 0);
    }
}
