/* ==========================================================================
   Holotype — a theme for sale. Cards lean back like consoles and project
   their own interface: hover one and a wireframe icon blinks to life above
   it (cold-start flicker, then a settling brightness strobe), the card face
   tips back 75deg, its body copy/tags fade off, and its h2 counter-rotates
   upright to ride down the tilted plane as a projected caption. Recreated
   verbatim from Adam's pasted pen (tokens, timings, keyframes unchanged)
   with a theme-kit built around it in the site's usual idiom (badge + h1 +
   theme_card + tags + two buttons). Ambient, same "themes breathe"
   convention as every other theme: a slow-drifting perspective-grid floor
   + a faint page-wide scanline shimmer. No light/dark toggle — a cold
   hologram has no light mode, so this theme is dark-native by design.
   ========================================================================== */

/* ---------- 1. TOKENS ---------- */
:root {
    /* Palette — cold projector in a dark room */
    --bg-0: #05080f;
    /* page depth */
    --bg-1: #0a1220;
    /* upper glow of page gradient */
    --ink: #d9e6f2;
    /* primary text */
    --ink-muted: #93a7bd;
    /* secondary text */
    --holo: #4de3ff;
    /* the one accent — hologram cyan */
    --holo-dim: rgba(77, 227, 255, 0.28);
    --holo-faint: rgba(77, 227, 255, 0.10);
    --surface: rgba(13, 22, 36, 0.72);
    --surface-edge: rgba(77, 227, 255, 0.18);

    /* Type */
    --font: "Inter", system-ui, sans-serif;

    /* Motion — ambient + hologram share one named clock */
    --drift-duration: 14s;
    --shimmer-duration: 9s;
    --boot-duration: 0.9s;
    --spin-duration: 7s;
    --holo-z: 90px;
    /* projection depth toward the viewer */
    --header-drop: 160px;
    /* how far the h2 slides down the tilted plane;
                              pure CSS can't measure "distance to bottom
                              edge" — tune this by eye if content changes */

    /* Layout */
    --card-radius: 10px;
    --deck-gap: clamp(1.25rem, 3vw, 2.5rem);
}

/* ---------- 2. BASE ---------- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink);
    background:
        radial-gradient(120% 80% at 50% 0%, var(--bg-1) 0%, var(--bg-0) 60%);
    background-attachment: fixed;
    overflow-x: hidden;
}

h1,
h2 {
    line-height: 1.15;
    margin: 0;
    font-weight: 700;
}

p {
    margin: 0;
}

/* ---------- 3. AMBIENT ---------- */
/* Perspective grid floor: two repeating hairline gradients tilted back.
   The perspective() inside the transform makes distant lines converge;
   animating background-position Y crawls the grid toward the viewer. */
.floor {
    position: fixed;
    left: -25vw;
    bottom: -12vh;
    width: 150vw;
    /* oversized so the tilt never shows edges */
    height: 55vh;
    background-image:
        repeating-linear-gradient(to right,
            var(--holo-faint) 0 1px,
            transparent 1px 60px),
        repeating-linear-gradient(to top,
            var(--holo-dim) 0 1px,
            transparent 1px 60px);
    transform: perspective(600px) rotateX(62deg);
    transform-origin: 50% 100%;
    animation: floor-drift var(--drift-duration) linear infinite;
    /* Fade the horizon so the grid dissolves instead of hard-stopping */
    -webkit-mask-image: linear-gradient(to top, black 30%, transparent 95%);
    mask-image: linear-gradient(to top, black 30%, transparent 95%);
    pointer-events: none;
    z-index: -1;
}

@keyframes floor-drift {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 0 60px;
    }

    /* exactly one cell = seamless loop */
}

/* Page-wide CRT scanlines + slow breathing shimmer */
.scanlines {
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(to bottom,
            rgba(77, 227, 255, 0.04) 0 1px,
            transparent 1px 3px);
    animation: scan-breathe var(--shimmer-duration) ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
    /* above content, but 4% opacity + no events */
}

@keyframes scan-breathe {

    0%,
    100% {
        opacity: 0.55;
    }

    50% {
        opacity: 1;
    }
}

/* ---------- 4. INTRO ---------- */
main {
    max-width: 72rem;
    margin: 0 auto;
    padding: clamp(3rem, 8vh, 6rem) clamp(1.25rem, 4vw, 3rem);
}

.theme_intro {
    max-width: 44rem;
    margin: 0 auto clamp(3rem, 8vh, 5.5rem);
    text-align: center;
}

.badge {
    display: inline-block;
    margin: 0 0 1rem;
    padding: 0.35rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--holo);
    border: 1px solid var(--surface-edge);
    border-radius: 999px;
    background: var(--holo-faint);
}

h1 {
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    letter-spacing: 0.02em;
    text-shadow: 0 0 24px var(--holo-dim);
    /* faint projector bloom */
    margin-bottom: 1.5rem;
}

.theme_card {
    display: grid;
    gap: 1.1rem;
    padding: clamp(1.5rem, 4vw, 2.25rem);
    text-align: left;
    color: var(--ink-muted);
    background: var(--surface);
    border: 1px solid var(--surface-edge);
    border-radius: var(--card-radius);
}

/* Shared tag chips (intro + cards) */
.theme_tags,
.card_tags {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.theme_tags li,
.card_tags li {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--holo);
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--surface-edge);
    border-radius: 999px;
}

.theme_actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.4rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    color: var(--bg-0);
    background: var(--holo);
    border: 1px solid var(--holo);
    border-radius: 6px;
    box-shadow: 0 0 18px var(--holo-dim);
    transition: box-shadow 0.25s, background 0.25s, color 0.25s;
}

.btn:hover {
    box-shadow: 0 0 32px var(--holo-dim);
}

.btn--ghost {
    color: var(--holo);
    background: transparent;
    box-shadow: none;
}

.btn--ghost:hover {
    background: var(--holo-faint);
}

.btn:focus-visible {
    outline: 2px solid var(--holo);
    outline-offset: 3px;
}

/* ---------- 5. DECK ---------- */
.cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--deck-gap);
}

@media (max-width: 56rem) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 36rem) {
    .cards {
        grid-template-columns: 1fr;
    }
}

.card {
    position: relative;
    perspective: 1200px;
    /* gives .holo's translateZ real depth */
}

.card:hover {
    z-index: 5;
    /* hologram overlaps the row above */
}

/* Hologram: hidden at rest, boots on hover, fades on leave.
   Boot ANIMATION beats the opacity TRANSITION while it runs (cascade
   order), and fill-mode:both holds the end state; removing it on
   mouse-out hands opacity back to the transition = clean fade out. */
.holo {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: calc(100% - 3rem);
    z-index: 99;
    /* projection base overlaps the card top */
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    transform: translateZ(var(--holo-z));
    transition: opacity 0.35s ease;
    perspective: 700px;
    /* lets the icon's rotateY read as 3D */
    pointer-events: none;
}

.card:hover .holo {
    animation: holo-boot var(--boot-duration) ease-out 0.7s both;
}

/* Cold start: collapsed bright line → snap open → decaying strobe →
   brightness settle. Adjacent keyframes 1% apart = hard cuts. */
@keyframes holo-boot {
    0% {
        opacity: 0;
        transform:
            translateZ(var(--holo-z)) translateY(48px) scale(1.35, 0.04);
        filter: brightness(3.5);
    }

    9% {
        opacity: 1;
        transform:
            translateZ(var(--holo-z)) translateY(48px) scale(1.35, 0.04);
        filter: brightness(3.5);
    }

    13% {
        opacity: 0;
        transform:
            translateZ(var(--holo-z)) translateY(20px) scale(1, 1.08);
        filter: brightness(3);
    }

    14% {
        opacity: .85;
    }

    21% {
        opacity: .15;
    }

    25% {
        opacity: .9;
        transform:
            translateZ(var(--holo-z)) translateY(0) scale(1, 1);
        filter: brightness(2.2);
    }

    33% {
        opacity: .35;
    }

    40% {
        opacity: 1;
        filter: brightness(1.7);
    }

    100% {
        opacity: 1;
        transform:
            translateZ(var(--holo-z)) translateY(0) scale(1, 1);
        filter: brightness(1);
    }
}

.holo_icon {
    width: 76px;
    height: 76px;
    color: var(--holo);
    filter: drop-shadow(0 0 6px var(--holo-dim)) drop-shadow(0 0 18px var(--holo-faint));
    animation: holo-spin var(--spin-duration) linear infinite;
}

@keyframes holo-spin {
    from {
        transform: rotateY(0deg);
    }

    to {
        transform: rotateY(360deg);
    }
}

.holo_glow {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 26px;
    background: radial-gradient(ellipse at center, var(--holo-dim), transparent 70%);
}

.card_face {
    height: 100%;
    transform-origin: 50% 100%;
    /* tips back from its base, like a console */
    transform-style: preserve-3d;
    /* children keep 3D → h2 can lift OFF the tilted plane */
    transition: transform 0.7s, box-shadow 0.7s;
    text-align: center;
    display: grid;
    gap: 0.8rem;
    align-content: start;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--surface-edge);
    border-radius: var(--card-radius);
}

/* Hover choreography — the 0.7s lean is the master clock:
   0.00s   face tips back 38°
   0.35s   body copy + tags fade off the face (exact midpoint)
   0.35s   h2 counter-rotates upright (rotateX(-38°) cancels the plane's
           tilt = billboard facing the viewer, "part of the hologram")
           and slides down the plane to the card's bottom edge
   0.70s   lean lands; hologram boots alone above it
   Transform order reads RIGHT-TO-LEFT: upright first, lift 24px off
   the plane, then travel down it. Delays exist ONLY in :hover rules →
   mouse-out reverses everything at once instead of un-staggering. */
.card:hover .card_face {
    transform: perspective(900px) rotateX(75deg);
    box-shadow: 0 30px 32px -12px rgba(0, 0, 0, 0.7);
}

.card_face p,
.card_face .card_tags {
    transition: opacity 0.25s ease;
}

.card:hover .card_face p,
.card:hover .card_face .card_tags {
    opacity: 0;
    transition-delay: 0.35s;
}

.card:hover .card_face h2 {
    transform: translateY(var(--header-drop)) translateZ(24px) rotateX(-75deg);
    text-shadow: 0 0 18px var(--holo-dim);
    /* projected label, ties to the holo */
    transition-delay: 0.35s;
}

.card_face h2 {
    font-size: 1.15rem;
    color: var(--ink);
    transition: transform 0.35s ease, text-shadow 0.35s ease;
}

.card_face p {
    font-size: 0.92rem;
    color: var(--ink-muted);
}

.card_tags {
    margin-top: auto;
    /* pins chips to the card bottom across the row */
    justify-content: center;
}

/* ---------- 6. REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {

    .floor,
    .scanlines,
    .holo_icon {
        animation: none;
    }

    /* No flicker, no spin, no 3D tip — hologram becomes a plain fade */
    .card:hover .holo {
        animation: none;
        opacity: 1;
    }

    .card:hover .card_face {
        transform: none;
    }

    /* Content stays put and visible — hologram alone fades in */
    .card:hover .card_face p,
    .card:hover .card_face .card_tags {
        opacity: 1;
    }

    .card:hover .card_face h2 {
        transform: none;
    }
}
