/* ============================================================
   shinonome.monster — Y2K-futurism dawn-control panel
   Hexagonal honeycomb lattice with layered-depth parallax
   ============================================================ */

:root {
    --base: #0b0f24;
    --cyan: #3df0ff;
    --magenta: #ff5cf2;
    --lavender: #9d7bff;
    --mint: #a8ffd6;
    --cream: #fff7d6;
    --chrome: #c9d6ff;

    --hex-lg: 220px;
    --hex-md: 140px;
    --hex-sm: 82px;

    --easing-overshoot: cubic-bezier(0.34, 1.56, 0.64, 1.0);
    --easing-elastic: cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body.lattice {
    position: relative;
    min-height: 320vh;
    background: var(--base);
    overflow-x: hidden;
    font-family: "Commissioner", -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    font-size: 0.96rem;
    line-height: 1.55;
    letter-spacing: 0.005em;
    color: var(--cream);
    cursor: none;
}

/* Default cursor (we paint our own trail) */
body.lattice a, body.lattice button {
    cursor: none;
}

/* ============================================================
   Dawn-strip — fixed conic gradient horizon
   ============================================================ */
.dawn {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 12vh;
    z-index: 5;
    pointer-events: none;
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    overflow: hidden;
}

.dawn__conic {
    position: absolute;
    top: -100%;
    left: -50%;
    width: 200%;
    height: 400%;
    background: conic-gradient(from 195deg at 50% 50%,
        var(--cyan),
        var(--lavender),
        var(--magenta),
        var(--mint),
        var(--cyan));
    filter: saturate(1.3) blur(2px);
    animation: dawnRotate 1152s linear infinite;
    opacity: 0.86;
}

.dawn__readout {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 18px;
    font-family: "Major Mono Display", monospace;
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    color: var(--chrome);
    text-shadow: 0 0 8px rgba(61, 240, 255, 0.55);
    z-index: 2;
}

.dawn__chip {
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(11, 15, 36, 0.55);
    border: 1px solid rgba(201, 214, 255, 0.32);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

@keyframes dawnRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================================
   Scanline overlay — global LCD authenticity
   ============================================================ */
.scanlines {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(0deg,
        transparent 0,
        transparent 3px,
        rgba(61, 240, 255, 0.04) 3px,
        rgba(61, 240, 255, 0.04) 4px);
    animation: scanDrift 1.4s linear infinite;
    mix-blend-mode: screen;
}

@keyframes scanDrift {
    from { background-position: 0 0; }
    to   { background-position: 0 4px; }
}

/* ============================================================
   Cursor trail
   ============================================================ */
.trail {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9000;
}

.trail__dot {
    position: absolute;
    top: 0;
    left: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow:
        0 0 14px var(--mint),
        0 0 28px var(--cyan);
    transform: translate(-50%, -50%) scale(1);
    transition: transform 60ms var(--easing-elastic);
    will-change: transform, opacity;
    mix-blend-mode: screen;
}

/* ============================================================
   Canvas — main lattice container
   ============================================================ */
.canvas {
    position: relative;
    width: 100%;
    min-height: 320vh;
    padding-top: 14vh;
    z-index: 1;
}

.cells {
    position: relative;
    width: 100%;
    height: 100%;
}

.stickers {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

/* ============================================================
   Hex cells — clip-path polygon, axial-positioned absolute
   ============================================================ */
.hex {
    position: absolute;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    -webkit-clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    aspect-ratio: 1 / 0.866;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition:
        transform 0.42s var(--easing-overshoot),
        filter 0.42s ease;
    will-change: transform;
    cursor: none;
}

.hex--lg { width: var(--hex-lg); z-index: 12; }
.hex--md { width: var(--hex-md); z-index: 11; }
.hex--sm { width: var(--hex-sm); z-index: 10; }

/* Hex inner stack: gradient fill + frosted backdrop + rim + specular */
.hex__inner {
    position: relative;
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background:
        radial-gradient(circle at 22% 18%,
            rgba(255, 255, 255, 0.42) 0%,
            rgba(255, 255, 255, 0.0) 14%),
        radial-gradient(circle at 25% 25%,
            rgba(61, 240, 255, 0.22) 0%,
            rgba(157, 123, 255, 0.32) 60%,
            rgba(11, 15, 36, 0.42) 100%);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

@supports not (backdrop-filter: blur(1px)) {
    .hex__inner {
        background:
            radial-gradient(circle at 22% 18%,
                rgba(255, 255, 255, 0.42) 0%,
                rgba(255, 255, 255, 0.0) 14%),
            radial-gradient(circle at 25% 25%,
                rgba(61, 240, 255, 0.42) 0%,
                rgba(157, 123, 255, 0.52) 60%,
                rgba(11, 15, 36, 0.78) 100%);
    }
}

/* Chrome rim — drawn via inset shadow on a sibling pseudo */
.hex__rim {
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(135deg,
        rgba(201, 214, 255, 0.85) 0%,
        rgba(201, 214, 255, 0.32) 22%,
        transparent 44%,
        transparent 60%,
        rgba(201, 214, 255, 0.18) 78%,
        rgba(201, 214, 255, 0.72) 100%);
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    padding: 1.5px;
    pointer-events: none;
    opacity: 0.9;
}

/* Inner specular highlight (Aqua wet-jelly read) */
.hex__specular {
    position: absolute;
    top: 8%;
    left: 14%;
    width: 22%;
    height: 22%;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(255, 255, 255, 0.82) 0%,
        rgba(255, 255, 255, 0.0) 60%);
    pointer-events: none;
    opacity: 0.7;
    filter: blur(2px);
}

/* LED dot — corner status indicator */
.hex__led {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--magenta);
    box-shadow: 0 0 8px currentColor;
    animation: ledBlink 2.8s ease-in-out infinite;
}
.hex__led--tl { top: 18%; left: 22%; }
.hex__led--tr { top: 18%; right: 22%; color: var(--mint); background: var(--mint); }
.hex__led--br { bottom: 22%; right: 22%; color: var(--lavender); background: var(--lavender); animation-delay: -1.2s; }

@keyframes ledBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.32; transform: scale(0.78); }
}

/* Hex content */
.hex__label {
    font-family: "Commissioner", sans-serif;
    font-weight: 580;
    font-variation-settings: "wght" 580, "slnt" -4;
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--chrome);
    text-shadow: 0 0 6px rgba(61, 240, 255, 0.45);
    z-index: 2;
    max-width: 78%;
    line-height: 1.18;
    pointer-events: none;
}

.hex--lg .hex__label {
    font-size: 0.92rem;
}

.hex--sm .hex__label {
    font-size: 0.58rem;
    letter-spacing: 0.04em;
}

.hex__coord {
    position: absolute;
    bottom: 22%;
    left: 50%;
    transform: translateX(-50%);
    font-family: "Major Mono Display", monospace;
    font-size: 0.52rem;
    letter-spacing: 0.18em;
    color: var(--cyan);
    opacity: 0.78;
    pointer-events: none;
}

.hex--sm .hex__coord {
    display: none;
}

/* Wordmark hex — oversized centerpiece */
.hex--wordmark {
    width: clamp(280px, 38vw, 520px);
    z-index: 25;
}

.hex--wordmark .hex__label {
    font-family: "Commissioner", sans-serif;
    font-weight: 850;
    font-variation-settings: "wght" 850, "slnt" -8;
    font-size: clamp(2.0rem, 5.2vw, 4.6rem);
    line-height: 0.92;
    letter-spacing: -0.022em;
    text-transform: lowercase;
    background: linear-gradient(112deg,
        var(--cyan) 0%,
        var(--lavender) 48%,
        var(--magenta) 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--chrome);
    filter: drop-shadow(0 0 14px rgba(61, 240, 255, 0.42));
    max-width: 88%;
}

.hex--wordmark .hex__sub {
    position: absolute;
    bottom: 24%;
    left: 50%;
    transform: translateX(-50%);
    font-family: "Major Mono Display", monospace;
    font-size: 0.66rem;
    letter-spacing: 0.22em;
    color: var(--mint);
    text-transform: uppercase;
    opacity: 0.78;
    text-shadow: 0 0 6px var(--mint);
    pointer-events: none;
}

/* Z-plane depths — opacity + scale + parallax via JS */
.hex[data-plane="0"] {
    transform: scale(0.4);
    opacity: 0.42;
    filter: blur(0.6px) saturate(0.78);
    z-index: 1;
}

.hex[data-plane="1"] {
    opacity: 0.7;
    z-index: 5;
}

.hex[data-plane="2"] {
    opacity: 1;
    z-index: 12;
}

/* ============================================================
   Hover behavior — inflate + reveal card
   ============================================================ */
.hex--lg:hover, .hex--md:hover {
    transform: scale(1.42) !important;
    z-index: 80 !important;
    filter: drop-shadow(0 12px 36px rgba(255, 92, 242, 0.42));
}

.hex--lg:hover .hex__card,
.hex--md:hover .hex__card {
    clip-path: inset(0 0 0 0);
    -webkit-clip-path: inset(0 0 0 0);
    opacity: 1;
}

.hex__card {
    position: absolute;
    top: -6%;
    left: 86%;
    width: 240px;
    padding: 14px 16px;
    background: rgba(11, 15, 36, 0.86);
    border: 1px solid rgba(201, 214, 255, 0.42);
    border-radius: 6px;
    backdrop-filter: blur(22px) saturate(1.4);
    -webkit-backdrop-filter: blur(22px) saturate(1.4);
    color: var(--cream);
    font-weight: 400;
    font-size: 0.78rem;
    line-height: 1.5;
    letter-spacing: 0.005em;
    text-align: left;
    text-transform: none;
    clip-path: inset(0 100% 0 0);
    -webkit-clip-path: inset(0 100% 0 0);
    opacity: 0;
    transition:
        clip-path 0.46s var(--easing-overshoot),
        opacity 0.32s ease;
    transform-origin: 0% 100%;
    pointer-events: none;
    z-index: 90;
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(61, 240, 255, 0.18) inset;
}

.hex__card::before {
    content: "";
    position: absolute;
    top: 10%;
    left: -4px;
    width: 8px;
    height: 8px;
    background: var(--cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--cyan);
}

.hex__card-title {
    display: block;
    font-family: "Major Mono Display", monospace;
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    color: var(--mint);
    margin-bottom: 6px;
    text-shadow: 0 0 6px var(--mint);
}

/* ============================================================
   Breathing animation — z:2 plane cells
   ============================================================ */
@keyframes breathe {
    0%, 100% { transform: scale(1.0); }
    50%      { transform: scale(1.014); }
}

.hex[data-plane="2"]:not(:hover) {
    animation: breathe 4.2s ease-in-out infinite;
}

/* Override breathing for wordmark — gentler */
.hex--wordmark:not(:hover) {
    animation: breathe 6.8s ease-in-out infinite;
}

/* ============================================================
   Holographic stickers — z:3 plane lozenges
   ============================================================ */
.sticker {
    position: absolute;
    width: 78px;
    height: 26px;
    border-radius: 13px;
    background: linear-gradient(117deg,
        var(--cyan) 0%,
        var(--magenta) 50%,
        var(--mint) 100%);
    background-size: 200% 200%;
    mix-blend-mode: screen;
    box-shadow:
        0 0 12px rgba(61, 240, 255, 0.55),
        0 0 24px rgba(255, 92, 242, 0.32);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Major Mono Display", monospace;
    font-size: 0.46rem;
    letter-spacing: 0.18em;
    color: var(--base);
    text-transform: uppercase;
    pointer-events: none;
    opacity: 0.88;
    animation: stickerShimmer 6.4s ease-in-out infinite;
    z-index: 30;
}

@keyframes stickerShimmer {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* ============================================================
   Telemetry HUD — fixed, sits as a participant in the lattice
   ============================================================ */
.hud {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 232px;
    padding: 14px 16px;
    background: rgba(11, 15, 36, 0.72);
    border: 1px solid rgba(201, 214, 255, 0.34);
    border-radius: 4px;
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    z-index: 200;
    font-family: "Major Mono Display", monospace;
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    color: var(--chrome);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(61, 240, 255, 0.18) inset;
}

.hud::before {
    content: "";
    position: absolute;
    top: 10px;
    right: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 8px var(--mint);
    animation: ledBlink 1.6s ease-in-out infinite;
}

.hud__row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dashed rgba(201, 214, 255, 0.18);
}

.hud__row:last-child {
    border-bottom: none;
}

.hud__k {
    color: var(--mint);
    opacity: 0.78;
}

.hud__v {
    color: var(--cream);
    text-shadow: 0 0 6px rgba(168, 255, 214, 0.42);
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .trail__dot { display: none; }
    .scanlines { display: none; }
}

/* ============================================================
   Responsive (the page is intentionally desktop-first)
   ============================================================ */
@media (max-width: 720px) {
    :root {
        --hex-lg: 160px;
        --hex-md: 100px;
        --hex-sm: 62px;
    }

    .hud {
        width: 180px;
        bottom: 12px;
        right: 12px;
        font-size: 0.54rem;
    }

    .hex__card {
        width: 180px;
        left: 60%;
        font-size: 0.66rem;
    }
}
