
/* Design variables */

:root {
    --bg-main: #070914;
    --bg-panel: #0e1224;
    --bg-panel-light: #151a30;
    --neon-yellow: #ffeb3b;
    --neon-yellow-light: #fff9a6;
    --neon-yellow-dark: #c9a900;
    --neon-blue: #35baff;
    --neon-blue-light: #a4e7ff;
    --neon-blue-dark: #087fc2;
    
    --yellow-gradient: linear-gradient(
        135deg,
        #ffeb3b,
        #fff9a6,
        #ffeb3b
    );

    --blue-gradient: linear-gradient(
        135deg,
        #35baff,
        #a4e7ff,
        #35baff
    );

    --accent-gradient: linear-gradient(
        135deg,
        #ffeb3b,
        #fff9a6,
        #35baff
    );

    --yellow-glow:
        0 0 8px rgba(255, 235, 59, 0.8),
        0 0 20px rgba(255, 235, 59, 0.5),
        0 0 35px rgba(255, 235, 59, 0.25);

    --blue-glow:
        0 0 8px rgba(53, 186, 255, 0.8),
        0 0 20px rgba(53, 186, 255, 0.5),
        0 0 35px rgba(53, 186, 255, 0.25);

    --text-main: #f4f2ff;
    --text-muted: #969bb5;
    --border-colour: #292d48;

    --font-display: "Orbitron", sans-serif;
    --font-body: "Inter", sans-serif;
}

/* Global styles */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;

    display: flex;
    flex-direction: column;

    color: var(--text-main);
    font-family: var(--font-body);
    background-color: var(--bg-main);

    background-image:
        linear-gradient(
            rgba(53, 186, 255, 0.025) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(53, 186, 255, 0.025) 1px,
            transparent 1px
        );

    background-size: 35px 35px;
}

a {
    color: inherit;
    text-decoration: none;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--neon-yellow);
    outline-offset: 4px;
}

::selection {
    color: var(--bg-main);
    background: var(--neon-yellow);
}

/* Shared navigation */

.site-header {
    position: relative;
    z-index: 10;

    border-bottom: 1px solid var(--border-colour);
    background: rgba(7, 9, 20, 0.94);
}

.site-nav {
    min-height: 78px;
}

.brand-name {
    color: var(--text-main) !important;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.13em;
}

.brand-icon {
    margin-right: 0.4rem;

    background: var(--yellow-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;

    filter: drop-shadow(
        0 0 8px rgba(255, 235, 59, 0.6)
    );
}

.site-nav .nav-link {
    position: relative;

    margin-left: 1rem;
    padding: 0.7rem 0.2rem !important;

    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    transition:
        color 0.2s ease,
        text-shadow 0.2s ease;
}

.site-nav .nav-link:hover,
.site-nav .nav-link.active {
    color: var(--neon-yellow);

    text-shadow:
        0 0 8px rgba(255, 235, 59, 0.5);
}

.site-nav .nav-link.active::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;

    height: 3px;
    background: var(--yellow-gradient);
    box-shadow: var(--yellow-glow);

    content: "";
}

.menu-toggle {
    border: 1px solid transparent;
    border-radius: 0;

    color: var(--neon-yellow);

    background:
        linear-gradient(var(--bg-main), var(--bg-main)) padding-box,
        var(--accent-gradient) border-box;
}

.menu-toggle:focus {
    box-shadow: var(--yellow-glow);
}

.menu-symbol {
    font-size: 1.4rem;
}

/* Shared typography and status indicators */

.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.65rem;

    margin-bottom: 1.8rem;

    color: var(--neon-yellow);

    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    line-height: 1.8;
}

.status-dot {
    flex: 0 0 auto;

    width: 8px;
    height: 8px;

    border-radius: 50%;
    background: var(--neon-yellow);

    box-shadow:
        0 0 8px var(--neon-yellow),
        0 0 16px rgba(255, 235, 59, 0.6);
}

.text-neon {
    background: var(--yellow-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;

    filter: drop-shadow(
        0 0 10px rgba(255, 235, 59, 0.25)
    );
}

.yellow-text,
.mood-happy {
    color: var(--neon-yellow);
}

.blue-text {
    color: var(--neon-blue);
}

/* Home page */
.landing-page {
    flex: 1;
    display: flex;
}

.hero {
    position: relative;

    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;

    width: min(100%, 1500px);
    min-height: 650px;
    margin: auto;
    padding: 5rem clamp(1.5rem, 7vw, 7rem);

    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;

    max-width: 600px;
}

.hero h1 {
    margin: 0 0 1.5rem;

    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.2;
}

.hero-description {
    max-width: 440px;
    margin-bottom: 2rem;

    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.9;
}

.btn-enter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;

    min-height: 52px;
    padding: 0.9rem 1.6rem;

    border: 1px solid transparent;
    border-radius: 2px;

    color: var(--text-main);

    background:
        linear-gradient(var(--bg-main), var(--bg-main)) padding-box,
        var(--accent-gradient) border-box;

    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;

    transition:
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.btn-enter:hover {
    color: var(--bg-main);
    background: var(--yellow-gradient);
    box-shadow: var(--yellow-glow);
    transform: translateY(-2px);
}

.hero-footnote {
    margin-top: 1.5rem;

    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
}

/* Shared Lil_Guy character */
.hero-visual {
    position: relative;

    display: grid;
    place-items: center;

    width: 100%;
    min-height: 500px;

    isolation: isolate;
}

.halo {
    position: absolute;
    top: 50%;
    left: 50%;

    aspect-ratio: 1;
    border: 3px solid var(--neon-yellow);
    border-radius: 50%;

    pointer-events: none;
    transform: translate(-50%, -50%);
}

.halo-outer {
    width: min(90%, 400px);

    border: 4px solid transparent;

    background:
        linear-gradient(var(--bg-main), var(--bg-main)) padding-box,
        var(--accent-gradient) border-box;

    opacity: 0.95;

    box-shadow:
        0 0 8px rgba(255, 235, 59, 0.8),
        0 0 18px rgba(53, 186, 255, 0.7),
        0 0 35px rgba(255, 235, 59, 0.35);
}

.halo-inner {
    width: min(72%, 310px);

    border: 3px solid transparent;

    background:
        linear-gradient(var(--bg-main), var(--bg-main)) padding-box,
        var(--blue-gradient) border-box;

    box-shadow: var(--blue-glow);
}

.pet-frame {
    position: relative;
    z-index: 2;

    width: 230px;
    height: 140px;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        linear-gradient(145deg, #191d35, #080a16) padding-box,
        var(--accent-gradient) border-box;

    border: 2px solid transparent;

    clip-path: polygon(
        10% 0,
        90% 0,
        100% 15%,
        100% 85%,
        90% 100%,
        10% 100%,
        0 85%,
        0 15%
    );

    filter: drop-shadow(
        0 0 12px rgba(53, 186, 255, 0.4)
    );
}

.pet-face {
    position: relative;
    width: 66%;
    height: 50%;
}

.pet-eye {
    position: absolute;
    top: 12%;

    width: 20%;
    height: 40%;

    border-radius: 50%;
    background: var(--neon-yellow);

    box-shadow:
        0 0 8px var(--neon-yellow),
        0 0 18px rgba(255, 235, 59, 0.6);
}

.eye-left {
    left: 18%;
}

.eye-right {
    right: 18%;
}

.pet-mouth {
    position: absolute;
    bottom: 15%;
    left: 50%;

    width: 27%;
    height: 12%;

    border-bottom: 2px solid var(--neon-blue-light);
    border-radius: 0 0 50% 50%;

    filter: drop-shadow(
        0 0 5px rgba(53, 186, 255, 0.6)
    );

    transform: translateX(-50%);
}

.visual-label {
    position: absolute;
    bottom: 2%;

    color: var(--neon-yellow);

    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 0.2em;

    text-shadow:
        0 0 8px rgba(255, 235, 59, 0.35);
}

/* Home page decorations */
.hero-decoration {
    position: absolute;
    inset: 0;

    overflow: hidden;
    pointer-events: none;
}

.sigil {
    position: absolute;

    background: var(--accent-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;

    filter: drop-shadow(
        0 0 8px rgba(53, 186, 255, 0.4)
    );

    opacity: 0.8;
    font-size: 2rem;
}

.sigil-top {
    top: 13%;
    right: 7%;

    filter: drop-shadow(
        0 0 8px rgba(255, 235, 59, 0.5)
    );
}

.sigil-bottom {
    bottom: 12%;
    left: 4%;

    background: var(--blue-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;

    filter: drop-shadow(
        0 0 8px rgba(53, 186, 255, 0.5)
    );
}

.hero-line {
    display: none;
}

@keyframes pet-float {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.dashboard-main > .hero-content h1 {
    margin: 0 0 1.5rem;
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.2;
}

/* Shared footer */

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    padding: 1.25rem clamp(1.5rem, 4vw, 4rem);

    border-top: 1px solid var(--border-colour);
    color: var(--text-muted);

    font-family: var(--font-display);
    font-size: 0.58rem;
    letter-spacing: 0.1em;
}

/* Dashboard layout */

.dashboard-main {
    flex: 1;
    width: min(100%, 1600px);
    margin: 0 auto;
    padding: 1rem clamp(0.75rem, 1.5vw, 1.5rem);
}

/* Upper row: status | creature | interactions */

.dashboard-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(280px, 1.15fr)
        minmax(0, 1fr);

    align-items: center;
    gap: 1.25rem;
}

/* Shared panel appearance */

.dashboard-panel {
    min-width: 0;
    padding: 1.25rem;

    border: 1px solid var(--neon-blue);
    background: rgba(7, 9, 20, 0.88);

    box-shadow:
        inset 0 0 18px rgba(53, 186, 255, 0.04);
}

/* Panel headings */

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.panel-heading h2,
.mood-card-heading h2 {
    margin: 0;

    color: var(--text-main);
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
}

.panel-link,
.view-history-link {
    color: var(--neon-yellow);
    font-family: var(--font-display);
    font-size: 0.65rem;
}

.panel-link:hover,
.view-history-link:hover {
    color: var(--neon-blue);
}

/* Device status */

.device-status-line {
    display: flex;
    align-items: center;
    gap: 0.65rem;

    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-colour);

    font-size: 0.85rem;
}

.current-state {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-colour);

    font-size: 0.75rem;
    line-height: 1.8;
}

.device-detail {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;

    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(41, 45, 72, 0.7);

    color: var(--text-muted);
    font-size: 0.68rem;
}

.detail-value {
    color: var(--text-main);
    text-align: right;
    overflow-wrap: anywhere;
}

/* Central creature */

.dashboard-creature {
    display: flex;
    flex-direction: column;
    align-items: center;

    min-width: 0;
}

.dashboard-pet-visual {
    min-height: 420px;
}

.dashboard-pet-visual .halo-outer {
    width: min(100%, 390px);
}

.dashboard-pet-visual .halo-inner {
    width: min(78%, 310px);
}

.dashboard-pet-visual .visual-label {
    bottom: 1%;
}

/* Interaction history */

.interaction-list {
    display: flex;
    flex-direction: column;
}

.interaction-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;

    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(41, 45, 72, 0.7);
}

.interaction-icon {
    flex: 0 0 34px;

    width: 34px;
    min-height: 34px;

    display: grid;
    place-items: center;

    overflow-wrap: anywhere;

    color: var(--neon-yellow);
    font-size: 0.55rem;
    text-align: center;
}

.interaction-content {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.interaction-content p {
    margin: 0;

    color: var(--text-main);
    font-size: 0.75rem;

    overflow-wrap: anywhere;
}

.interaction-time,
.interaction-effect {
    color: var(--text-muted);
    font-size: 0.65rem;

    overflow-wrap: anywhere;
}

.interaction-effect {
    font-family: var(--font-display);
}

.view-history-link {
    display: inline-block;
    margin-top: 1rem;
}

/* Bottom row: happiness | sleepiness | other */

.mood-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;

    margin-top: 1rem;
}

.mood-card {
    min-height: 165px;

    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mood-card-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mood-card-icon {
    flex: 0 0 auto;
    max-width: 90px;

    color: var(--neon-yellow);
    font-size: 0.6rem;

    overflow-wrap: anywhere;
}

.sleepiness-card .mood-card-icon {
    color: var(--neon-blue);
}

.mood-value {
    margin: 0.8rem 0;

    font-family: var(--font-display);
    font-size: clamp(1rem, 2vw, 1.8rem);

    overflow-wrap: anywhere;
}

/* Progress meter base */

.mood-meter {
    height: 12px;
    overflow: hidden;

    background: rgba(53, 186, 255, 0.12);
}

.mood-meter-fill {
    display: block;
    width: 0;
    height: 100%;
}

.happiness-bar {
    background: var(--yellow-gradient);
    box-shadow: var(--yellow-glow);
}

.sleepiness-bar {
    background: var(--blue-gradient);
    box-shadow: var(--blue-glow);
}

.other-card-content {
    margin-top: 1rem;

    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 0.7rem;
    text-align: center;

    overflow-wrap: anywhere;
}

/* Settings page width */
.settings-page .dashboard-panel.mb-4, .mb-4 {
    max-width: 90%;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Bottom dashboard information */

.dashboard-bottom {
    display: flex;
    justify-content: space-between;
    gap: 1rem;

    margin-top: 1.25rem;
    padding: 1rem 0.25rem;

    border-top: 1px solid var(--border-colour);

    color: var(--neon-blue);
    font-family: var(--font-display);
    font-size: 0.58rem;
    letter-spacing: 0.05em;
}

/* Responsive layouts */

@media (max-width: 1000px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-creature {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .dashboard-pet-visual {
        width: min(100%, 500px);
        min-height: 380px;
    }

    .dashboard-panel {
        padding: 1rem;
    }
}

@media (max-width: 767.98px) {
    .site-nav {
        min-height: 68px;
    }

    .site-nav .navbar-collapse {
        padding: 0.5rem 0 1rem;
    }

    .site-nav .navbar-nav {
        align-items: stretch !important;
        gap: 0.25rem;
    }

    .site-nav .nav-link {
        margin-left: 0;
        padding: 0.8rem 0.5rem !important;
    }

    .site-nav .nav-link.active::after {
        right: auto;
        width: 45px;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 1rem;

        min-height: auto;
        padding: 4rem 1.5rem 3rem;
    }

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

    .eyebrow {
        justify-content: center;
        font-size: 0.58rem;
    }

    .hero h1 {
        font-size: clamp(2.3rem, 10vw, 3.7rem);
    }

    .hero-description {
        margin-right: auto;
        margin-left: auto;
        font-size: 0.95rem;
    }

    .hero-visual {
        min-height: 390px;
    }

    .halo-outer {
        width: min(80%, 310px);
    }

    .halo-inner {
        width: min(65%, 250px);
    }

    .pet-frame {
        width: clamp(135px, 42vw, 180px);
    }

    .visual-label {
        bottom: 1%;
    }

    .sigil-top {
        top: 5%;
        right: 6%;
    }

    .sigil-bottom {
        bottom: 5%;
        left: 6%;
    }

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.5rem;

        font-size: 0.52rem;
    }
}

@media (max-width: 600px) {
    .dashboard-main {
        padding: 0.75rem;
    }

    .dashboard-grid,
    .mood-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-creature {
        grid-column: auto;
        grid-row: auto;
    }

    .dashboard-pet-visual {
        min-height: 330px;
    }

    .mood-grid {
        gap: 0.75rem;
    }

    .mood-card {
        min-height: 135px;
    }

    .dashboard-bottom {
        flex-direction: column;
        font-size: 0.55rem;
    }
}

/* Reduced motion accessibility */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
