/* =============================================
   VOIDWALLZ — Mobile-First CSS
   Redesigned for clean mobile rendering
   ============================================= */

/* --- TOKENS --- */
:root {
    --bg: #000000;
    --surface: #080808;
    --surface-2: #0d0d0d;
    --line: #1c1c1c;
    --line-2: #2a1818;
    --muted: #555;
    --soft: #9c957d;
    --text: #f6efd2;
    --red: #b03030;
    --red-dim: rgba(176, 48, 48, 0.12);
    --red-glow: rgba(176, 48, 48, 0.18);

    --font-mono: "Space Mono", monospace;
    --font-disp: "Syne", sans-serif;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    min-height: 100dvh;
    overflow-x: hidden;
    position: relative;
}

img {
    display: block;
    max-width: 100%;
}

/* --- ANIMATIONS --- */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse-rule {
    0%,
    100% {
        transform: scaleX(0.25);
        opacity: 0.4;
    }
    50% {
        transform: scaleX(1);
        opacity: 1;
    }
}

@keyframes frame-float {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes scan-line {
    0% {
        top: -40%;
        opacity: 0;
    }
    10%,
    80% {
        opacity: 1;
    }
    100% {
        top: 110%;
        opacity: 0;
    }
}

@keyframes grid-drift {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 40px 40px;
    }
}

/* --- NOISE OVERLAY --- */
.noise {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    opacity: 0.028;
    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-size: 200px 200px;
}

/* --- AMBIENT GLOW --- */
.glow {
    pointer-events: none;
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(80px);
}

.glow--top {
    width: 60vw;
    height: 60vw;
    max-width: 500px;
    max-height: 500px;
    top: -10vw;
    right: -10vw;
    background: radial-gradient(
        circle,
        rgba(176, 48, 48, 0.14),
        transparent 70%
    );
}

.glow--bottom {
    width: 50vw;
    height: 50vw;
    max-width: 400px;
    max-height: 400px;
    bottom: -5vw;
    left: -10vw;
    background: radial-gradient(
        circle,
        rgba(246, 239, 210, 0.04),
        transparent 70%
    );
}

/* --- BACKGROUND GRID --- */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(246, 239, 210, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(246, 239, 210, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 70%);
    animation: grid-drift 20s linear infinite;
}

/* =============================================
   HEADER
   ============================================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent);
    animation: fade-up 600ms var(--ease-out) both;
}

.header__brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header__logo {
    height: 28px;
    width: auto;
    object-fit: contain;
}

.header__status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 9px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
}

.header__dot {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--red);
    flex-shrink: 0;
    animation: blink 2s steps(1) infinite;
}

/* =============================================
   MAIN LAYOUT
   ============================================= */
.main {
    padding: 96px 20px 40px;
    display: flex;
    flex-direction: column;
    gap: 48px;
    max-width: 600px;
    margin: 0 auto;
}

/* =============================================
   HERO
   ============================================= */
.hero {
    animation: fade-up 700ms 100ms var(--ease-out) both;
}

.hero__eyebrow {
    font-size: 9px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 20px;
}

.hero__title {
    font-family: var(--font-disp);
    font-size: clamp(2.4rem, 12vw, 4.5rem);
    font-weight: 800;
    line-height: 0.88;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.hero__line {
    display: block;
}

.hero__line--light {
    color: var(--text);
}

.hero__line--red {
    color: var(--red);
}

.hero__rule {
    width: 100%;
    height: 1px;
    background: var(--line-2);
    margin: 28px 0 24px;
    position: relative;
    overflow: hidden;
}

.hero__rule::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--red);
    transform-origin: left center;
    transform: scaleX(0.25);
    animation: pulse-rule 3s ease-in-out infinite;
}

.hero__copy {
    color: var(--soft);
    font-size: 0.875rem;
    line-height: 1.75;
    letter-spacing: 0.02em;
    max-width: 440px;
}

/* =============================================
   PREVIEW FRAMES
   ============================================= */
.preview {
    animation: fade-up 700ms 200ms var(--ease-out) both;
}

.preview__stack {
    position: relative;
    width: 100%;
    /* height driven by the tallest frame */
    padding-bottom: calc(56.25% + 80px); /* 16:9 ratio + stagger offset */
}

.frame {
    position: absolute;
    width: 88%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line-2);
    background: linear-gradient(135deg, #111 0%, #050505 60%, #1e0a0a 100%);
    overflow: hidden;
    animation: frame-float 7s ease-in-out infinite;
}

.frame__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(246, 239, 210, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(246, 239, 210, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
}

.frame__scan {
    position: absolute;
    left: 0;
    right: 0;
    height: 35%;
    background: linear-gradient(
        to bottom,
        transparent,
        var(--red-glow),
        transparent
    );
    animation: scan-line 5s ease-in-out infinite;
}

.frame--1 {
    top: 0;
    left: 0;
    border-color: #2a1414;
    z-index: 3;
}

.frame--2 {
    top: 40px;
    left: 5%;
    border-color: #321b1b;
    z-index: 2;
    animation-delay: -1.8s;
}

.frame--2 .frame__scan {
    animation-delay: -2s;
}

.frame--3 {
    top: 80px;
    left: 10%;
    border-color: #3d2020;
    z-index: 1;
    animation-delay: -3.5s;
}

.frame--3 .frame__scan {
    animation-delay: -3.5s;
}

/* =============================================
   STATS BAR
   ============================================= */
.stats {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: center;
    border: 1px solid var(--line);
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: fade-up 700ms 300ms var(--ease-out) both;
}

.stats__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 12px;
    text-align: center;
}

.stats__divider {
    width: 1px;
    height: 40px;
    background: var(--line);
    flex-shrink: 0;
}

.stats__value {
    font-family: var(--font-disp);
    font-size: clamp(1.1rem, 5vw, 1.4rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}

.stats__label {
    font-size: 8px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--red);
}

/* =============================================
   FOOTER
   ============================================= */
/* ============================================= FOOTER ============================================= */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 32px;
    max-width: 600px;
    margin: 0 auto;
    font-size: 8px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #2e2e2e;
    border-top: 1px solid var(--line);
    animation: fade-up 700ms 400ms var(--ease-out) both;
}

.footer__social {
    display: flex;
    gap: 16px;
}

.footer__icon {
    width: 18px;
    height: 18px;
    color: var(--muted);
    transition: color 0.2s ease-in-out;
}

.footer__icon:hover {
    color: var(--text);
}

/* =============================================
   DESKTOP — 768px+
   ============================================= */
@media (min-width: 768px) {
    .header {
        padding: 24px 48px;
    }

    .header__logo {
        height: 32px;
    }

    .header__status {
        font-size: 10px;
    }

    .main {
        padding: 0 48px 56px;
        max-width: 1200px;
        display: grid;
        grid-template-columns: 1fr minmax(0, 480px);
        grid-template-rows: auto auto;
        column-gap: 72px;
        row-gap: 0;
        align-items: start;
        /* push below fixed header */
        padding-top: 120px;
    }

    .hero {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
        padding-top: 40px;
    }

    .hero__eyebrow {
        font-size: 10px;
        margin-bottom: 24px;
    }

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

    .hero__rule {
        margin: 32px 0 28px;
    }

    .hero__copy {
        font-size: 1rem;
        max-width: 420px;
    }

    .preview {
        grid-column: 2;
        grid-row: 1 / 3;
        align-self: center;
        /* vertically center the whole preview column */
        padding-top: 40px;
    }

    .preview__stack {
        padding-bottom: calc(56.25% + 130px);
    }

    .frame--2 {
        top: 60px;
        left: 6%;
    }

    .frame--3 {
        top: 120px;
        left: 12%;
    }

    .stats {
        grid-column: 1;
        grid-row: 2;
        margin-top: 48px;
        max-width: 440px;
    }

    .stats__item {
        padding: 22px 16px;
    }

    .stats__value {
        font-size: 1.4rem;
    }

    .stats__label {
        font-size: 9px;
    }

    .footer {
        padding: 20px 48px 36px;
        max-width: 1200px;
        font-size: 9px;
    }
}

/* =============================================
   LARGE DESKTOP — 1200px+
   ============================================= */
@media (min-width: 1200px) {
    .main {
        grid-template-columns: 1fr 520px;
        gap: 0 96px;
    }

    .glow--top {
        width: 500px;
        height: 500px;
    }
}

/* =============================================
   REDUCED MOTION
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
