/* ============================================
   lovebot.quest — Styles
   Chrome-Metallic + Triadic Palette
   Hexagonal Honeycomb Layout
   ============================================ */

/* ---- Custom Properties ---- */
:root {
    --chrome-base: #B8C0CC;
    --chrome-dark: #2A2D35;
    --signal-magenta: #E63FAE;
    --electric-chartreuse: #A8E61F;
    --cobalt-wash: #1F6AE6;
    --near-black-steel: #12141A;
    --pale-chrome: #D8DCE4;
    --aurora-white: #F0F4FF;

    --font-display: 'Archivo Black', sans-serif;
    --font-body: 'Cormorant Garamond', serif;

    --hex-width: 180px;
    --hex-height: 156px; /* hex-width * 0.866 */
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--signal-magenta) var(--chrome-dark);
}

html::-webkit-scrollbar {
    width: 3px;
}

html::-webkit-scrollbar-track {
    background: var(--chrome-dark);
}

html::-webkit-scrollbar-thumb {
    background: var(--signal-magenta);
}

body {
    background-color: var(--chrome-base);
    color: var(--near-black-steel);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.85;
    letter-spacing: 0.04em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Chrome Reflection Lines (fixed) ---- */
#chrome-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.chrome-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 0.5px;
    background: rgba(255, 255, 255, 0.12);
}

/* ---- Retro Pattern Overlay ---- */
#retro-pattern-svg {
    position: absolute;
    width: 0;
    height: 0;
}

.retro-pattern-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='52'%3E%3Cpolygon points='30,2 55,15 55,37 30,50 5,37 5,15' fill='none' stroke='%23B8C0CC' stroke-width='0.5'/%3E%3Cpolygon points='30,8 48,18 48,34 30,44 12,34 12,18' fill='none' stroke='%23B8C0CC' stroke-width='0.3'/%3E%3Cpolygon points='30,14 41,21 41,31 30,38 19,31 19,21' fill='none' stroke='%23B8C0CC' stroke-width='0.2'/%3E%3C/svg%3E");
    background-repeat: repeat;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}

.retro-dark {
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='52'%3E%3Cpolygon points='30,2 55,15 55,37 30,50 5,37 5,15' fill='none' stroke='%23D8DCE4' stroke-width='0.5'/%3E%3Cpolygon points='30,8 48,18 48,34 30,44 12,34 12,18' fill='none' stroke='%23D8DCE4' stroke-width='0.3'/%3E%3Cpolygon points='30,14 41,21 41,31 30,38 19,31 19,21' fill='none' stroke='%23D8DCE4' stroke-width='0.2'/%3E%3C/svg%3E");
}

/* ---- Aurora Layers ---- */
.aurora-layer {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    will-change: transform;
}

.aurora-layer-1 {
    width: 500px;
    height: 500px;
    background: var(--signal-magenta);
    opacity: 0.1;
    top: 20%;
    left: 10%;
    animation: auroraFloat1 18s ease-in-out infinite;
}

.aurora-layer-2 {
    width: 400px;
    height: 400px;
    background: var(--electric-chartreuse);
    opacity: 0.08;
    top: 40%;
    right: 15%;
    animation: auroraFloat2 22s ease-in-out infinite;
}

.aurora-layer-3 {
    width: 450px;
    height: 450px;
    background: var(--cobalt-wash);
    opacity: 0.12;
    bottom: 10%;
    left: 30%;
    animation: auroraFloat3 20s ease-in-out infinite;
}

@keyframes auroraFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(60px, -30px) scale(1.1); }
    50% { transform: translate(-40px, 50px) scale(0.95); }
    75% { transform: translate(30px, 20px) scale(1.05); }
}

@keyframes auroraFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-50px, 40px) scale(1.08); }
    66% { transform: translate(40px, -30px) scale(0.92); }
}

@keyframes auroraFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    20% { transform: translate(40px, 20px) scale(1.12); }
    50% { transform: translate(-30px, -40px) scale(0.9); }
    80% { transform: translate(20px, 30px) scale(1.05); }
}

/* ============================================
   ZONE 1: The Void Field
   ============================================ */
#zone-1 {
    position: relative;
    width: 100%;
    height: 40vh;
    min-height: 350px;
    background-color: var(--chrome-base);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#void-hex-cluster {
    position: relative;
    z-index: 2;
    width: 400px;
    height: 350px;
    opacity: 0;
    animation: fadeInCluster 2s ease-out 0.5s forwards;
}

@keyframes fadeInCluster {
    to { opacity: 1; }
}

#morphing-hex-svg {
    width: 100%;
    height: 100%;
}

.cluster-hex {
    opacity: 0;
    animation: hexAppear 1s ease-out forwards;
}

.cluster-hex[data-delay="0"] { animation-delay: 0.8s; }
.cluster-hex[data-delay="200"] { animation-delay: 1.0s; }
.cluster-hex[data-delay="400"] { animation-delay: 1.2s; }
.cluster-hex[data-delay="600"] { animation-delay: 1.4s; }
.cluster-hex[data-delay="800"] { animation-delay: 1.6s; }
.cluster-hex[data-delay="1000"] { animation-delay: 1.8s; }
.cluster-hex[data-delay="1200"] { animation-delay: 2.0s; }

@keyframes hexAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hex-border-anim {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: drawHexBorder 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.cluster-hex[data-delay="0"] .hex-border-anim { animation-delay: 0.8s; }
.cluster-hex[data-delay="200"] .hex-border-anim { animation-delay: 1.0s; }
.cluster-hex[data-delay="400"] .hex-border-anim { animation-delay: 1.2s; }
.cluster-hex[data-delay="600"] .hex-border-anim { animation-delay: 1.4s; }
.cluster-hex[data-delay="800"] .hex-border-anim { animation-delay: 1.6s; }
.cluster-hex[data-delay="1000"] .hex-border-anim { animation-delay: 1.8s; }
.cluster-hex[data-delay="1200"] .hex-border-anim { animation-delay: 2.0s; }

@keyframes drawHexBorder {
    to { stroke-dashoffset: 0; }
}

/* Micro visualizations in cluster */
.micro-wave {
    animation: waveShift 3s ease-in-out infinite alternate;
}

@keyframes waveShift {
    from { transform: translateY(0); }
    to { transform: translateY(3px); }
}

.micro-gauge {
    animation: gaugeRotate 4s linear infinite;
    transform-origin: center;
}

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

.micro-bar {
    animation: barPulse 2s ease-in-out infinite alternate;
}

.micro-bar:nth-child(2) { animation-delay: 0.3s; }
.micro-bar:nth-child(3) { animation-delay: 0.6s; }
.micro-bar:nth-child(4) { animation-delay: 0.9s; }

@keyframes barPulse {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

/* Domain name - anti-design placement */
.domain-name {
    position: absolute;
    bottom: 20px;
    right: 30px;
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 300;
    font-size: 14px;
    color: var(--near-black-steel);
    letter-spacing: 0.04em;
    opacity: 0.6;
    z-index: 5;
}

/* ============================================
   ZONE 2: The Honeycomb Matrix
   ============================================ */
#zone-2 {
    position: relative;
    width: 100%;
    min-height: 120vh;
    background-color: var(--chrome-base);
    padding: 8vh 4vw;
    overflow: hidden;
}

.aurora-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.aurora-bg .aurora-layer-1 {
    width: 600px;
    height: 600px;
    top: 10%;
    left: 5%;
    opacity: 0.08;
}

.aurora-bg .aurora-layer-2 {
    width: 500px;
    height: 500px;
    top: 50%;
    right: 10%;
    opacity: 0.1;
}

.aurora-bg .aurora-layer-3 {
    width: 550px;
    height: 550px;
    bottom: 5%;
    left: 25%;
    opacity: 0.09;
}

/* Honeycomb Grid */
#honeycomb-grid {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.hex-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: -25px;
}

.hex-row:first-child {
    margin-top: 0;
}

.hex-row-offset {
    margin-left: calc(var(--hex-width) / 2 + 4px);
}

/* Individual Hex Cell */
.hex-cell {
    width: var(--hex-width);
    height: var(--hex-height);
    position: relative;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hex-cell.hex-void {
    visibility: hidden;
}

.hex-clip {
    width: 100%;
    height: 100%;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    position: relative;
    background-color: var(--chrome-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hex-clip-wide {
    background-color: var(--chrome-dark);
}

/* Hex border SVG overlay */
.hex-border-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.hex-stroke-anim {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hex-stroke-anim.animated {
    stroke-dashoffset: 0;
}

/* Hex inner content */
.hex-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px 15px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.hex-inner.visible {
    opacity: 1;
}

.hex-inner-color {
    opacity: 0.25;
    transition: opacity 0.8s ease-out;
}

.hex-inner-color.visible {
    opacity: 0.25;
}

/* Hex labels */
.hex-label {
    font-family: var(--font-display);
    font-size: clamp(0.65rem, 1.2vw, 0.85rem);
    text-transform: uppercase;
    letter-spacing: -0.03em;
    color: var(--pale-chrome);
    line-height: 1.2;
    margin-bottom: 2px;
}

.hex-label-sub {
    font-family: var(--font-body);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(0.55rem, 0.9vw, 0.7rem);
    color: var(--pale-chrome);
    opacity: 0.7;
    letter-spacing: 0.04em;
    line-height: 1.3;
    margin-bottom: 6px;
}

/* Hex data visualizations */
.hex-dataviz {
    width: 80%;
    max-width: 100px;
    height: auto;
    margin-top: 4px;
}

.gauge-fill {
    animation: gaugeAnim 2s ease-out forwards;
}

@keyframes gaugeAnim {
    from {
        stroke-dashoffset: 113;
    }
}

/* Hex text cells */
.hex-text-cell .hex-label {
    font-size: clamp(0.7rem, 1.4vw, 0.95rem);
    margin-bottom: 4px;
}

.hex-text-cell .hex-label-sub {
    font-size: clamp(0.6rem, 1vw, 0.75rem);
}

/* Hex color fill cells */
.hex-color-fill .hex-clip {
    background-color: transparent;
}

/* The oversized statement */
.hex-statement {
    width: calc(var(--hex-width) * 1);
    height: var(--hex-height);
}

.hex-statement-text {
    font-family: var(--font-display);
    font-size: clamp(0.8rem, 1.8vw, 1.4rem);
    text-transform: uppercase;
    letter-spacing: -0.03em;
    color: var(--aurora-white);
    line-height: 1.15;
    text-align: center;
    padding: 0 5px;
}

/* Hover interactions (pointer devices) */
@media (hover: hover) and (pointer: fine) {
    .hex-cell:not(.hex-void):hover {
        transform: scale(1.06);
        z-index: 10;
    }

    .hex-cell:not(.hex-void):hover .hex-clip {
        box-shadow: 0 0 30px rgba(240, 244, 255, 0.25);
    }

    /* Sympathetic scale on adjacent cells */
    .hex-cell:not(.hex-void):hover ~ .hex-cell:not(.hex-void) {
        transform: scale(1.02);
    }
}

/* ============================================
   ZONE 3: The Terminal Residue
   ============================================ */
#zone-3 {
    position: relative;
    width: 100%;
    min-height: 60vh;
    background-color: var(--chrome-dark);
    padding: 12vh 8vw;
    overflow: hidden;
}

/* Scattered hex fragments */
.terminal-hex-fragment {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.frag-1 {
    width: 120px;
    top: 10%;
    right: 12%;
}

.frag-2 {
    width: 80px;
    top: 40%;
    left: 8%;
}

.frag-3 {
    width: 100px;
    bottom: 20%;
    right: 25%;
}

.frag-4 {
    width: 60px;
    bottom: 35%;
    left: 20%;
}

/* Terminal text grid */
#terminal-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 8vw;
    row-gap: 12vh;
    max-width: 1200px;
    margin: 0 auto;
}

.terminal-fragment {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.terminal-fragment.revealed {
    opacity: 1;
    transform: translateY(0);
}

.terminal-fragment:nth-child(odd) {
    grid-column: 1;
}

.terminal-fragment:nth-child(even) {
    grid-column: 2;
}

.terminal-fragment:nth-child(5) {
    grid-column: 1 / -1;
    max-width: 600px;
    justify-self: center;
}

.terminal-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    line-height: 1.85;
    letter-spacing: 0.25em;
    color: var(--pale-chrome);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media screen and (max-width: 1024px) {
    :root {
        --hex-width: 140px;
        --hex-height: 121px;
    }

    .hex-row-offset {
        margin-left: calc(var(--hex-width) / 2 + 4px);
    }

    #terminal-grid {
        grid-template-columns: 1fr;
        column-gap: 0;
        row-gap: 8vh;
    }

    .terminal-fragment:nth-child(odd),
    .terminal-fragment:nth-child(even),
    .terminal-fragment:nth-child(5) {
        grid-column: 1;
    }
}

@media screen and (max-width: 768px) {
    :root {
        --hex-width: 110px;
        --hex-height: 95px;
    }

    .hex-row {
        gap: 4px;
        margin-top: -18px;
    }

    .hex-row-offset {
        margin-left: calc(var(--hex-width) / 2 + 2px);
    }

    .hex-label {
        font-size: 0.55rem;
    }

    .hex-label-sub {
        font-size: 0.45rem;
    }

    .hex-statement-text {
        font-size: 0.65rem;
    }

    #zone-2 {
        padding: 4vh 2vw;
    }

    #zone-3 {
        padding: 8vh 5vw;
    }

    .terminal-text {
        letter-spacing: 0.12em;
        font-size: clamp(0.9rem, 2vw, 1.2rem);
    }

    #void-hex-cluster {
        width: 280px;
        height: 250px;
    }
}

@media screen and (max-width: 480px) {
    :root {
        --hex-width: 80px;
        --hex-height: 69px;
    }

    .hex-row {
        gap: 2px;
        margin-top: -12px;
    }

    .hex-row-offset {
        margin-left: calc(var(--hex-width) / 2 + 1px);
    }

    .hex-dataviz {
        display: none;
    }

    .hex-label {
        font-size: 0.45rem;
    }

    .hex-label-sub {
        font-size: 0.38rem;
    }

    .hex-statement-text {
        font-size: 0.55rem;
    }

    .terminal-text {
        letter-spacing: 0.08em;
    }

    #void-hex-cluster {
        width: 220px;
        height: 200px;
    }
}
