:root {
    --bg-color: #0a0a0c;
    --accent-red: #e61c24;

    /* Theme-aware colors (dark by default) */
    --text-color: #ffffff;
    --text-soft: #e2e8f0;
    --grid-line: rgba(255, 255, 255, 0.03);
    --headline-glow: rgba(255, 255, 255, 0.45);
    --headline-glow-soft: rgba(255, 255, 255, 0.2);
    --selection-text: #ffffff;
    --toggle-bg: rgba(255, 255, 255, 0.06);
    --toggle-fg: #ffffff;
    --toggle-border: rgba(255, 255, 255, 0.15);
}

/* Light Theme */
:root.light-theme {
    --bg-color: #f4f2f0;
    --text-color: #1a1a1e;
    --text-soft: #3d3d45;
    --grid-line: rgba(0, 0, 0, 0.05);
    --headline-glow: rgba(30, 30, 35, 0.18);
    --headline-glow-soft: rgba(30, 30, 35, 0.08);
    --selection-text: #ffffff;
    --toggle-bg: rgba(0, 0, 0, 0.05);
    --toggle-fg: #1a1a1e;
    --toggle-border: rgba(0, 0, 0, 0.15);
}

/* Icon path used by every glow layer. Change the icon and every glow updates,
   because each layer renders the actual image file, blurred — no fixed colors. */
:root {
    --icon-image: url("../icons/icon.svg");
}

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

html,
body {
    height: 100%;
}

body {
    font-family: 'Red Hat Mono', monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    user-select: none;
    transition: background-color 0.4s ease, color 0.4s ease;

    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Selection colors */
::selection {
    background-color: var(--accent-red);
    color: var(--selection-text);
}

.full-size {
    width: 100%;
    height: 100%;
}

/* ---------------------------------- */
/* Background layers                  */
/* ---------------------------------- */

.bg-layer {
    position: absolute;
    inset: 0;
}

/* Ambient Glowing Background Grid */
.bg-grid {
    z-index: 0;
    opacity: 0.6;
    background-size: 50px 50px;
    background-image:
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
    mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0) 80%);
    -webkit-mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0) 80%);
}

/* Radial ambient tint — the icon itself, heavily blurred and masked to a
   soft circular vignette, so its colors bleed into the background. */
.glow-vignette {
    z-index: 0;
    pointer-events: none;
    background-image: var(--icon-image);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 40rem;
    filter: blur(110px);
    opacity: 0.45;
    mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 65%);
    -webkit-mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 65%);
}

/* Central Glowing Core Backlight — blurred copy of the icon */
.core-backlight {
    z-index: 0;
    top: 50%;
    left: 50%;
    inset: auto;
    width: 18rem;
    height: 18rem;
    background-image: var(--icon-image);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    filter: blur(90px) saturate(1.8);
    pointer-events: none;
    opacity: 0.3;
    animation: pulseGlow 4s ease-in-out infinite;
}

@media (min-width: 640px) {
    .core-backlight {
        width: 24rem;
        height: 24rem;
    }
}

/* Pulse animation for core backlight */
@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(0.95);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* ---------------------------------- */
/* Main content                       */
/* ---------------------------------- */

.content {
    position: relative;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
    text-align: center;

    /* Floating Logo & Content Animation */
    animation: subtleFloat 6s ease-in-out infinite;
}

@keyframes subtleFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-12px) rotate(0.5deg);
    }
}

/* ---------------------------------- */
/* Logo                               */
/* ---------------------------------- */

.logo-wrapper {
    position: relative;
    /* cursor: pointer; */
    margin-bottom: 2rem;
    transition: transform 0.5s ease-out;
}

@media (min-width: 640px) {
    .logo-wrapper {
        margin-bottom: 2.5rem;
    }
}

.logo-wrapper:hover {
    transform: scale(1.05);
}

/* Main Volkbyte Wolf SVG Icon */
.logo-icon {
    position: relative;
    z-index: 10;
    width: 11rem;
    height: 11rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 640px) {
    .logo-icon {
        width: 14rem;
        height: 14rem;
    }
}

@media (min-width: 768px) {
    .logo-icon {
        width: 16rem;
        height: 16rem;
    }
}

/* Dynamic halo behind the icon: a blurred copy of the icon image itself,
   so changing the icon file automatically changes the glow's color/shape. */
.logo-icon::after {
    content: "";
    position: absolute;
    inset: -1rem;
    z-index: -1;
    background-image: var(--icon-image);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    filter: blur(28px) saturate(1.6);
    opacity: 0.25;
    transition: opacity 0.5s ease;
}

.logo-wrapper:hover .logo-icon::after {
    opacity: 0.55;
}

/* ---------------------------------- */
/* Headline                           */
/* ---------------------------------- */

.headline {
    font-family: 'Red Hat Mono', monospace;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1;
    font-size: 2.25rem;
    user-select: none;
}

@media (min-width: 640px) {
    .headline {
        font-size: 3.75rem;
    }
}

@media (min-width: 768px) {
    .headline {
        font-size: 4.5rem;
    }
}

/* Gradient Text Animation — shimmer for readability */
.headline {
    background: linear-gradient(135deg, var(--text-color) 0%, var(--text-soft) 45%, var(--text-color) 70%, var(--text-color) 100%);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: textShimmer 5s ease infinite;
}

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

/* Glowing Text Effect — soft white for readability.
   Uses drop-shadow instead of text-shadow because text-shadow
   bleeds through background-clip:text, making glyphs look hazy. */
.headline {
    filter: drop-shadow(0 0 12px var(--headline-glow)) drop-shadow(0 0 28px var(--headline-glow-soft));
}

/* ---------------------------------- */
/* Canvas Overlay for Dynamic Particles */
/* ---------------------------------- */

#particleCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* ---------------------------------- */
/* Theme Toggle Button (top right)    */
/* ---------------------------------- */

.theme-toggle {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 100;
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--toggle-border);
    background-color: var(--toggle-bg);
    color: var(--toggle-fg);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, border-color 0.3s ease;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--accent-red);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Show sun icon in dark mode (click = go light), moon in light mode (click = go dark) */
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.4s ease;
}

.theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.light-theme .theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.light-theme .theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}
