:root {
    --bg-color: #050505;
    --card-bg: #0f0f0f;
    --text-main: #e0e0e0;
    --accent: #E5B667; 
    --accent-wave: #00f3ff;
    --accent-maxx: #0aeb28;
    --border: rgba(255,255,255,0.1);
    --font-head: 'Syncopate', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-color);
}

@media (pointer: fine) {
    * { cursor: none; }
}

html, body {
    width: 100%;
    overflow-x: hidden;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    text-size-adjust: 100%; 
    -webkit-text-size-adjust: 100%;
}

.noise-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 9000; opacity: 0.05;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
}

.cursor-dot {
    position: fixed; top: 0; left: 0; width: 8px; height: 8px;
    background: var(--accent); border-radius: 50%; pointer-events: none;
    z-index: 9999; transform: translate(-50%, -50%);
}

.cursor-circle {
    position: fixed; top: 0; left: 0; width: 40px; height: 40px;
    border: 1px solid rgba(255,255,255,0.3); border-radius: 50%;
    pointer-events: none; z-index: 9998; transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, background-color 0.3s;
    mix-blend-mode: difference;
}

.cursor-circle.hovered { width: 80px; height: 80px; background-color: white; mix-blend-mode: difference; }

@media (hover: none) and (pointer: coarse) {
    .cursor-dot, .cursor-circle { display: none !important; }
}

.preloader {
    position: fixed; top: 0; left: 0; width: 100%; 
    height: 100vh; height: 100dvh;
    background-color: #000; z-index: 10000; display: flex;
    justify-content: center; align-items: center; overflow: hidden;
}

.loader-content {
    position: relative; width: 300px; height: 300px;
    display: flex; justify-content: center; align-items: center;
}

.solar-ring {
    position: absolute; width: 100%; height: 100%; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 30px rgba(229, 182, 103, 0.05);
}

.solar-progress {
    position: absolute; width: 100%; height: 100%; border-radius: 50%;
    border: 2px solid transparent; border-top-color: var(--accent);
    border-left-color: rgba(229, 182, 103, 0.3);
    animation: spin 1.5s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
}

.loader-data { display: flex; flex-direction: column; align-items: center; z-index: 2; text-align: center; }

.loader-counter {
    font-family: var(--font-head); font-size: 5rem; font-weight: 700; color: #fff;
    line-height: 1; margin-bottom: 10px; font-variant-numeric: tabular-nums;
}

.loader-text {
    font-family: var(--font-body); font-size: 0.8rem; color: var(--accent);
    text-transform: uppercase; letter-spacing: 4px; opacity: 0.8;
}

.scan-line {
    position: absolute; width: 100%; height: 2px;
    background: linear-gradient(to right, transparent, var(--accent), transparent);
    opacity: 0.3; animation: scan 2s linear infinite;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes scan { 0% { top: 0%; opacity: 0; } 50% { opacity: 1; } 100% { top: 100%; opacity: 0; } }

header.hero {
    height: 100vh; height: 100dvh; 
    width: 100%; position: relative;
    display: flex; flex-direction: column; justify-content: center; align-items: center; overflow: hidden;
}

canvas.hero-bg {
    position: absolute; top: 0; left: 0; width: 100%; 
    height: 120%; z-index: 0; opacity: 0.8; 
}

.hero-title {
    position: relative; z-index: 2;
    display: flex; justify-content: center; align-items: center;
    width: 100%; padding: 0 20px;
}

.hero-logo {
    width: 60vw; max-width: 700px; height: auto;
    filter: drop-shadow(0 0 30px rgba(229, 182, 103, 0.2));
    opacity: 1; will-change: opacity, transform;
}

.hero-meta {
    margin-top: 40px; display: flex; gap: 40px; font-size: 0.9rem;
    text-transform: uppercase; letter-spacing: 3px; color: var(--accent);
    opacity: 0; z-index: 2;
}

.projects-section {
    padding: 100px 5%; min-height: 100vh; border-top: 1px solid var(--border);
    position: relative; z-index: 2; background: var(--bg-color);
}

.section-title { font-family: var(--font-head); font-size: 2rem; margin-bottom: 50px; color: #fff; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 30px; }

.project-card {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px;
    height: 400px; position: relative; display: flex; justify-content: center; align-items: center;
    text-decoration: none; color: white; overflow: hidden; transition: border-color 0.4s ease;
    transform: translateZ(0); -webkit-mask-image: -webkit-radial-gradient(white, black); 
}

.project-card-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center; opacity: 0; z-index: 1;
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1); filter: brightness(0.4);
}

.card-content {
    position: relative; z-index: 2; display: flex; flex-direction: column;
    align-items: center; text-align: center; padding: 30px; transition: transform 0.4s ease;
}

.project-icon { font-size: 3.5rem; margin-bottom: 25px; color: #555; transition: color 0.4s; }
.project-title { font-family: var(--font-head); font-size: 1.8rem; margin-bottom: 15px; color: #fff; }
.project-desc { font-size: 1rem; color: rgba(255,255,255,0.8); line-height: 1.5; max-width: 90%; }

@media (hover: hover) {
    .project-card:hover { border-color: var(--accent); }
    .project-card:hover .project-card-bg { opacity: 1; transform: scale(1.1); }
    .project-card:hover .card-content { transform: translateY(-10px); }
    .project-card:hover .project-icon { color: var(--accent); }
}

.radio-dock-wrapper {
    position: fixed; bottom: -250px; left: 0; width: 100%;
    display: flex; justify-content: center; z-index: 8000;
    pointer-events: none; transition: transform 0.6s cubic-bezier(0.23, 1, 0.320, 1);
}

.radio-player-container {
    pointer-events: auto; display: flex; align-items: center;
    background: rgba(8, 8, 10, 0.95); 
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1); border-bottom: none;
    border-radius: 24px 24px 0 0; padding: 25px 35px 45px 35px;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.9);
    width: 100%; max-width: 850px; position: relative; color: #fff;
    user-select: none; -webkit-user-select: none;
}

.radio-cover {
    width: 70px; height: 70px; border-radius: 14px; margin-right: 25px;
    overflow: hidden; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.1);
}

.radio-cover img { width: 100%; height: 100%; object-fit: cover; }
.radio-info { flex-grow: 1; min-width: 0; margin-right: 15px; }
.artist-title { font-weight: 700; font-size: 1.2em; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-title { color: #999; font-size: 0.95em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 5px;}

.radio-controls { display: flex; align-items: center; gap: 25px; }
.volume-control { display: flex; align-items: center; gap: 12px; }
.vol-icon { font-size: 1.1rem; color: #888; width: 24px; text-align: center; transition: color 0.3s; }
.radio-player-container:hover .vol-icon { color: #fff; }

.play-button {
    background: white; color: #000; border-radius: 50%;
    width: 55px; height: 55px; display: flex; align-items: center; justify-content: center;
    font-size: 20px; border: none; transition: all 0.3s ease;
    cursor: pointer;
}

.play-button:hover { transform: scale(1.1); box-shadow: 0 0 20px currentColor; }

.radio-link-selector {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 8px; background: rgba(255,255,255,0.07); padding: 5px; border-radius: 30px; white-space: nowrap;
}

.radio-link-selector button {
    background: transparent; border: none; padding: 6px 18px;
    border-radius: 20px; color: #777; font-size: 0.8rem; font-weight: 700;
    font-family: var(--font-head); transition: all 0.3s; cursor: pointer;
}

.radio-link-selector button.active[data-station="wave"] { background: var(--accent-wave); color: #000; }
.radio-link-selector button.active[data-station="maxx"] { background: var(--accent-maxx); color: #000; }
.radio-player-container[data-theme="wave"] .play-button:hover { background: var(--accent-wave); color: #000; }
.radio-player-container[data-theme="maxx"] .play-button:hover { background: var(--accent-maxx); color: #000; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100px; height: 5px; background: rgba(255,255,255,0.15); border-radius: 3px; cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; margin-top: -4px; box-shadow: 0 0 5px rgba(0,0,0,0.5); }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 5px; cursor: pointer; background: rgba(255,255,255,0.15); border-radius: 3px; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border: none; border-radius: 50%; background: #fff; cursor: pointer; box-shadow: 0 0 5px rgba(0,0,0,0.5); }
input[type=range]::-moz-range-track { width: 100%; height: 5px; cursor: pointer; background: rgba(255,255,255,0.15); border-radius: 3px; }

footer {
    padding: 80px 0; display: flex; flex-direction: column;
    justify-content: center; align-items: center; border-top: 1px solid rgba(255,255,255,0.05);
    background: #020202; position: relative; z-index: 2; 
    margin-bottom: 150px;
}

.social-grid { display: flex; gap: 20px; margin-bottom: 40px; }

.social-btn {
    width: 50px; height: 50px; border-radius: 50%;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; text-decoration: none; transition: all 0.3s;
}

.social-btn:hover { background: var(--accent); color: #000; transform: translateY(-5px); }

.copyright-wrapper { display: flex; align-items: center; gap: 8px; opacity: 0.6; }
.copyright { font-size: 0.8rem; color: #fff; font-family: var(--font-body); margin: 0; }
.footer-flag { height: 0.8rem; width: auto; display: block; }

@media (max-width: 768px) {
    .loader-content { width: 220px; height: 220px; }
    .loader-counter { font-size: 3.5rem; }
    .loader-text { font-size: 0.7rem; letter-spacing: 2px; }
    .hero-title { padding: 0 10px; }
    .hero-logo { width: 85vw; } 
    .hero-meta { flex-wrap: wrap; justify-content: center; gap: 15px; width: 90%; font-size: 0.75rem; text-align: center; margin-top: 30px; }
    .projects-grid { grid-template-columns: 1fr; }
    .project-card-bg { opacity: 0.3; } 
    .project-icon { color: var(--accent); } 
    .radio-dock-wrapper { bottom: -280px; } 
    .radio-player-container { padding: 15px 15px 65px 15px; border-radius: 20px 20px 0 0; }
    .radio-cover { width: 50px; height: 50px; margin-right: 15px; }
    .radio-info { max-width: none; flex: 1; margin-right: 10px; display: flex; flex-direction: column; justify-content: center; }
    .artist-title { font-size: 0.95rem; }
    .song-title { font-size: 0.8rem; }
    .volume-control { display: none; }
    .play-button { width: 45px; height: 45px; font-size: 18px; }
    .radio-link-selector { width: 90%; justify-content: center; bottom: 15px; background: rgba(0,0,0,0.3); }
    .radio-link-selector button { padding: 10px 20px; font-size: 0.75rem; }
    footer { margin-bottom: 160px; padding: 50px 0; }
    .social-grid { gap: 10px; }
    .social-btn { width: 45px; height: 45px; }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .radio-player-container { padding-bottom: calc(65px + env(safe-area-inset-bottom)); }
    .radio-link-selector { bottom: calc(15px + env(safe-area-inset-bottom)); }
}