/* =============================================
   Noir Melancholy / Atmospheric Obsidian Design System
   Karanlık & Üzücü / Melankolik Tema
   ============================================= */
@property --border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

:root {
    --bg-primary: #040306;
    --bg-card: rgba(12, 10, 16, 0.65);
    --bg-card-inner: rgba(18, 16, 24, 0.45);
    --border-card: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.16);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-spotify: #1db954;
    --accent-discord: #6366f1;
    --accent-silver: #cbd5e1;
    --accent-slate: #475569;
    --accent-glow: rgba(148, 163, 184, 0.2);
    --radius-card: 32px;
    --radius-inner: 20px;
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

::-webkit-scrollbar {
    width: 5px;
}
::-webkit-scrollbar-track {
    background: rgba(5, 4, 8, 0.95);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* =============================================
   Background & Atmospheric Ambience
   ============================================= */
.lofi-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('mobile.jpg');
    background-size: cover;
    background-position: center;
    filter: brightness(0.38) contrast(1.15) saturate(0.35) grayscale(25%);
    z-index: 0;
    transition: background-image 0.5s ease, filter 2s ease, opacity 0.5s ease, transform 0.1s ease-out;
    will-change: transform;
}

.lofi-bg.night-mode {
    filter: brightness(0.28) contrast(1.2) saturate(0.2) grayscale(40%);
}

@media (min-width: 768px) {
    .lofi-bg {
        background-image: url('desktop.jpg');
    }
}

.video-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: 0;
    opacity: 0;
    filter: brightness(0.4) contrast(1.15) saturate(0.3);
    transition: opacity 0.5s ease;
    pointer-events: none;
}

/* Scanlines & Melancholic Film Grain */
.synth-scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0) 50%,
        rgba(0, 0, 0, 0.35) 50%,
        rgba(0, 0, 0, 0.35)
    );
    background-size: 100% 4px;
    z-index: 1;
    pointer-events: none;
    opacity: 0.7;
}

.lofi-noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
    opacity: 0.055;
    pointer-events: none;
    z-index: 1;
}

#dust-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    pointer-events: none;
}

/* Somber Vignette Overlay */
.vignette-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(3, 2, 6, 0.92) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Ambient Ghostly Moonlight Orbs (Cold, Somber, Foggy) */
.gradient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.07;
    pointer-events: none;
    z-index: 1;
    animation: orbFloat 24s ease-in-out infinite;
}
.orb-1 { width: 500px; height: 500px; background: #475569; top: 5%; left: 5%; }
.orb-2 { width: 450px; height: 450px; background: #334155; bottom: 8%; right: 5%; animation-delay: -8s; }
.orb-3 { width: 380px; height: 380px; background: #1e293b; top: 40%; left: 40%; animation-delay: -16s; }

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -25px) scale(1.05); }
    66% { transform: translate(-25px, 30px) scale(0.95); }
}

/* =============================================
   Single Master Obsidian Glass Card
   ============================================= */
.card-wrapper {
    position: relative;
    z-index: 10;
    width: 92%;
    max-width: 660px;
    margin: 3rem auto;
    padding: 1.5px;
    border-radius: var(--radius-card);
    background: conic-gradient(from var(--border-angle), rgba(255, 255, 255, 0.12), rgba(148, 163, 184, 0.22), rgba(51, 65, 85, 0.35), rgba(255, 255, 255, 0.12));
    animation: rotateBorder 20s linear infinite, cardPulseGlow 8s ease-in-out infinite alternate;
    box-shadow: 0 35px 90px -15px rgba(0, 0, 0, 0.9), 0 0 40px rgba(15, 23, 42, 0.4);
    transition: transform 0.2s var(--ease-out), box-shadow 0.4s var(--ease-out);
    will-change: transform;
}

@keyframes rotateBorder {
    to {
        --border-angle: 360deg;
    }
}

@keyframes cardPulseGlow {
    0% {
        box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.9), 0 0 30px rgba(51, 65, 85, 0.2);
    }
    100% {
        box-shadow: 0 40px 95px -15px rgba(0, 0, 0, 0.95), 0 0 45px rgba(100, 116, 139, 0.2);
    }
}

.glass-card {
    background: rgba(10, 8, 15, 0.72);
    backdrop-filter: blur(28px) saturate(110%);
    -webkit-backdrop-filter: blur(28px) saturate(110%);
    border-radius: calc(var(--radius-card) - 1.5px);
    padding: 2.25rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
    width: 100%;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 30px 0 rgba(0, 0, 0, 0.4);
    transition: backdrop-filter 0.6s ease, -webkit-backdrop-filter 0.6s ease, background-color 0.6s ease;
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle 350px at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.05), transparent 75%);
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
    pointer-events: none;
    z-index: 1;
}

.glass-card:hover::before {
    opacity: 1;
}

.no-blur {
    backdrop-filter: blur(0px) !important;
    -webkit-backdrop-filter: blur(0px) !important;
    background: rgba(10, 8, 15, 0.2) !important;
}

/* =============================================
   Profile Header & Moody Avatar
   ============================================= */
.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

.avatar-container {
    position: relative;
    width: 124px;
    height: 124px;
    border-radius: 50%;
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(from 0deg, #475569, #94a3b8, #334155, #475569);
    box-shadow: 0 0 25px rgba(100, 116, 139, 0.25), 0 8px 24px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease-out);
    will-change: transform;
}

.avatar-container:hover {
    transform: scale(1.06);
    box-shadow: 0 0 35px rgba(148, 163, 184, 0.4), 0 0 15px rgba(71, 85, 105, 0.3);
}

.avatar-container:active {
    transform: scale(0.96);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    user-select: none;
    pointer-events: none;
    filter: contrast(1.1) brightness(0.92);
}

.avatar-pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(100% + 14px);
    height: calc(100% + 14px);
    border-radius: 50%;
    border: 1.5px solid rgba(148, 163, 184, 0.35);
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
    pointer-events: none;
}

.avatar-container:hover .avatar-pulse-ring {
    animation: avatarPulse 1.8s var(--ease-out) infinite;
}

@keyframes avatarPulse {
    0% { transform: translate(-50%, -50%) scale(0.98); opacity: 0.7; }
    100% { transform: translate(-50%, -50%) scale(1.22); opacity: 0; }
}

.handle-title {
    font-size: 2.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 60%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.15;
    filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.6));
}

.bio-thought {
    color: rgba(203, 213, 225, 0.7);
    font-style: italic;
    font-weight: 400;
    font-size: 0.96rem;
    max-width: 460px;
    line-height: 1.5;
    letter-spacing: 0.01em;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* =============================================
   Status Sections Container
   ============================================= */
.status-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

@media (min-width: 640px) {
    .status-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.status-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-inner);
    padding: 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 112px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color 0.3s var(--ease-out), background-color 0.3s var(--ease-out), transform 0.35s var(--ease-spring), box-shadow 0.35s var(--ease-out);
}

.status-section:hover {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.6), 0 0 20px rgba(100, 116, 139, 0.08);
}

/* Spotify Widget Styling */
#spotify-widget {
    cursor: pointer;
}

.widget-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.label-spotify {
    color: #10b981;
}

.label-discord {
    color: #94a3b8;
}

/* Animated Equalizer Bars */
.eq-container {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
    margin-left: auto;
}

.eq-bar {
    width: 3px;
    background: #10b981;
    border-radius: 2px;
    animation: eqBounce 1.2s ease-in-out infinite alternate;
}

.eq-bar:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.eq-bar:nth-child(2) { height: 80%; animation-delay: 0.3s; }
.eq-bar:nth-child(3) { height: 60%; animation-delay: 0.2s; }
.eq-bar:nth-child(4) { height: 100%; animation-delay: 0.4s; }

@keyframes eqBounce {
    0% { height: 20%; }
    100% { height: 100%; }
}

.eq-paused .eq-bar {
    animation-play-state: paused;
    height: 30% !important;
}

/* Discord Status SVG Indicator */
.discord-avatar-wrapper {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.discord-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    filter: contrast(1.1) brightness(0.92);
}

.discord-status-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0f0c18;
    border: 2px solid #0f0c18;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

/* Progress bar inside Spotify widget */
#progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

#progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #059669, #10b981);
    width: 0%;
    border-radius: 4px;
    transition: width 0.1s linear;
}

/* =============================================
   Social Links & Tech Stack Rows
   ============================================= */
.divider-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    margin: 0.25rem 0;
    position: relative;
    z-index: 2;
}

.social-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.35rem;
    position: relative;
    transition: all 0.35s var(--ease-spring);
}

.social-link:hover {
    transform: translateY(-5px) scale(1.1);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 255, 255, 0.15);
}

/* Accessible Tooltips */
.tooltip-container {
    position: relative;
    display: inline-flex;
}

.tooltip-container::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: rgba(10, 8, 16, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #f8fafc;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: transform 0.25s var(--ease-spring), opacity 0.2s ease;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.tooltip-container:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Tech Stack Row */
.tech-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
    padding-top: 0.25rem;
}

.tech-icon {
    font-size: 1.6rem;
    transition: all 0.3s ease;
    filter: grayscale(100%);
    opacity: 0.35;
    cursor: default;
}

.tech-icon:hover {
    transform: translateY(-5px) scale(1.15);
    filter: grayscale(40%) drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    opacity: 0.9;
}

/* =============================================
   Floating Action Buttons & Controls
   ============================================= */
.fab-button {
    position: relative;
    background: rgba(12, 10, 18, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 50px;
    padding: 0.75rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.fab-button:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65), 0 0 20px rgba(255, 255, 255, 0.08);
}

.fab-button:active {
    transform: translateY(0);
}

.fab-contact {
    position: fixed;
    bottom: 1.75rem;
    left: 1.75rem;
    z-index: 50;
}

.fab-controls-right {
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 50;
    transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-spring), visibility 0.4s ease;
}

body.lyrics-active .fab-controls-right,
body.lyrics-active #preview-btn {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: scale(0.6) translateY(20px) !important;
    visibility: hidden !important;
}

.fab-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    padding: 0;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .card-wrapper {
        margin: 1.75rem auto 5.5rem auto;
    }

    .fab-contact {
        bottom: 1.25rem;
        left: 1.25rem;
        padding: 0.65rem 1.1rem;
        font-size: 0.85rem;
    }

    .fab-controls-right {
        bottom: 1.25rem;
        right: 1.25rem;
        gap: 0.5rem;
    }

    .fab-circle {
        width: 42px;
        height: 42px;
    }
}

/* Toast Notification */
#copy-popup {
    position: fixed;
    bottom: 5.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    background: rgba(12, 10, 18, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #ffffff;
    padding: 0.85rem 1.75rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.92rem;
    pointer-events: none;
    opacity: 0;
    z-index: 9999;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =============================================
   Contact Modal
   ============================================= */
#contact-modal {
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

#contact-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#contact-modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-glass-card {
    background: rgba(12, 10, 18, 0.94);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-card);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8);
}

.input-field {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 0.85rem 1.15rem;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.input-field:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

/* =============================================
   Custom Silver Cursor (Desktop Only)
   ============================================= */
.custom-cursor-dot {
    position: fixed;
    width: 7px;
    height: 7px;
    background: #ffffff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.custom-cursor-outline {
    position: fixed;
    width: 36px;
    height: 36px;
    border: 1.2px solid rgba(148, 163, 184, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease-out, width 0.2s ease, height 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 0 15px rgba(100, 116, 139, 0.25);
}

.cursor-hover .custom-cursor-dot {
    width: 10px;
    height: 10px;
    background: #cbd5e1;
    box-shadow: 0 0 14px rgba(203, 213, 225, 0.9);
}

.cursor-hover .custom-cursor-outline {
    width: 48px;
    height: 48px;
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px), (pointer: coarse) {
    .custom-cursor-dot,
    .custom-cursor-outline {
        display: none !important;
    }
}

/* =============================================
   Accessibility & Reduced Motion Fallbacks
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .card-wrapper {
        animation: none !important;
    }
    .gradient-orb {
        animation: none !important;
    }
}
