/* =========================================
   COMMON MENU STYLES
   Extracted from pixiai.css
   ========================================= */

@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond&display=swap");

:root {
    --void-bg: #020202;
    --starlight: #f0f0f0;
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-surface: rgba(255, 255, 255, 0.03);
    /* Primary accent used across PIXIAI components */
    --accent-color: #e6c99a;
    --holo-gradient: linear-gradient(135deg, var(--accent-color), #ffdba5, #fff7ed);

    --font-main: "Garamond", serif;
    /* logo offsets for menu toggle animations */
    --logo-left-offset: 0px;
    --logo-right-offset: -3px;
    --logo-left-rotate: 0deg;
    --logo-right-rotate: 0deg;
}

/* Base styles for standardizing */
body {
    margin: 0;
    font-family: var(--font-main);
}

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

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* === NAV / HEADER === */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    pointer-events: none;
    /* Allow clicking through header container */
}

header * {
    pointer-events: auto;
}

header .navbar {
    position: fixed;
    top: 30px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    z-index: 5;
}

header .nav-logo {
    height: 64px;
}

header .nav-logo img {
    height: 100%;
    width: auto;
    transition: all 0.3s ease;
}

header .nav-logo:hover img {
    transform: scale(1.05);
}

header .social-icon {
    font-size: clamp(1.2rem, 2.5vw, 2.2rem);
    color: var(--starlight);
    transition: all 0.3s ease;
}

header .social-icon:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

/* ==================== HAMBURGER ICON (Split Logo) ==================== */
.logo-container {
    position: fixed;
    left: 5%;
    top: 90%;
    transform: translateY(-50%);
    z-index: 101;
    cursor: pointer;
    transition: all 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: none;
}

.logo-half {
    position: absolute;
    max-width: 30px;
    max-height: 30px;
    z-index: 3;
}

.logo-left {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    transition: none;
}

.logo-right {
    left: 35px;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

/* Logo animation when menu is open */
.menu.open~.logo-container .logo-right {
    transform: translateX(15px);
    opacity: 0;
}

.menu:not(.open)~.logo-container .logo-right {
    transform: translateX(0);
    opacity: 1;
}

/* Mobile adjustments for hamburger */
@media (max-width: 600px) {
    .logo-container {
        left: 10px;
        width: 60px;
        height: 60px;
    }

    .logo-half {
        max-width: 30px;
        max-height: 30px;
    }

    .logo-left {
        left: 10px;
    }

    .logo-right {
        left: 34px;
    }

    .menu.open~.logo-container .logo-right {
        transform: translateX(15px);
    }
}

/* ==================== SIDEBAR MENU ==================== */
.menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 70vw !important;
    min-width: unset;
    max-width: unset;
    height: 100vh;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-100%);
    transition: transform 0.5s ease;
    z-index: 4;
}

.menu.open {
    transform: translateX(0);
}

/* Subtle texture overlay */
.menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.02) 1px, transparent 1px), radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.015) 1px, transparent 1px), radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 50px 50px, 30px 30px, 70px 70px;
    background-position: 0 0, 25px 25px, 35px 35px;
    opacity: 0.4;
    pointer-events: none;
    z-index: -1;
}

/* ==================== MENU LIST ==================== */
.menu ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

@media (max-width: 768px) {
    .menu ul {
        padding-left: 60px;
        padding-right: 2rem;
    }
}

@media (max-width: 480px) {
    .menu ul {
        padding-left: 40px;
        padding-right: 1.5rem;
    }
}

/* ==================== MENU ITEMS ==================== */
.menu li {
    margin: 1.5rem 0;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Staggered animation when menu opens */
.menu.open li {
    opacity: 1;
    transform: translateY(0);
}

.menu.open li:nth-child(1) {
    transition-delay: 0.1s;
}

.menu.open li:nth-child(2) {
    transition-delay: 0.2s;
}

.menu.open li:nth-child(3) {
    transition-delay: 0.3s;
}

.menu.open li:nth-child(4) {
    transition-delay: 0.4s;
}

.menu.open li:nth-child(5) {
    transition-delay: 0.5s;
}

/* ==================== MENU LINKS ==================== */
.menu a {
    color: var(--secondary-clr);
    font-family: "Garamond", serif;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    letter-spacing: clamp(0.05em, 0.1vw, 0.1em);
    padding: clamp(0.25rem, 1vw, 0.4rem) clamp(0.5rem, 2vw, 0.8rem);
    transition: all 0.3s ease;
    border-radius: 12px;
}

.menu a:hover {
    color: var(--accent-gold);
    transform: translateY(-2px);
}

/* Underline animation on hover */
.menu a::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-gold);
    transition: width 0.3s ease;
}

.menu a:hover::after {
    width: 100%;
}

/* ==================== CLOSE BUTTON ==================== */
.menu-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 999;
    background: none !important;
    border: none;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    transform: translateZ(0);
}

@media (max-width: 600px) {
    .menu-close {
        width: 20px;
        height: 20px;
        top: 20px;
        right: 20px;
    }
}

.menu-close:hover {
    transform: translateZ(0) scale(1.1) rotate(90deg);
    opacity: 0.8;
    filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.3));
}

.menu-close:active {
    transform: translateZ(0) scale(0.95) rotate(90deg);
    transition: all 0.1s;
}

.menu-close:focus {
    outline: none;
}

.menu-close img {
    width: 100%;
    height: 100%;
    display: block;
    transition: filter 0.3s, box-shadow 0.3s, transform 0.3s;
}

.menu-close:hover img,
.menu-close:focus img {
    filter: drop-shadow(0 0 8px #d4af37) drop-shadow(0 0 16px #fff);
    box-shadow: 0 0 16px 4px #d4af37, 0 0 32px 8px rgba(255, 255, 255, 0.2);
    transform: scale(1.15) rotate(90deg);
}

.menu-close:active img {
    transform: scale(0.95) rotate(90deg);
}

.contact-icons {
    display: flex;
    justify-content: center;
    gap: 1.2em;
    margin-top: 0.5em;
}

.menu .icon-gold {
    font-size: 1.7em;
    color: var(--accent-color);
}

/* Logo border glow */
.logo-menu-border {
    position: absolute;
    left: 0;
    top: 0;
    width: 60px;
    height: 60px;
    z-index: 2;
    pointer-events: none;
    background: none !important;
    box-shadow: none !important;
    border-radius: 50%;
    overflow: visible;
}

.logo-menu-border svg,
.logo-menu-border circle {
    background: none !important;
    box-shadow: none !important;
    border-radius: 50%;
    overflow: visible;
}

.logo-menu-glow {
    stroke: #fff;
    stroke-width: 3;
    filter: drop-shadow(0 0 8px #fff) drop-shadow(0 0 16px #fff) drop-shadow(0 0 24px #fff);
    stroke-dasharray: 25 138.36;
    stroke-dashoffset: 163.36;
    animation: logoMenuGlowAnim 2.5s linear infinite;
    stroke-linecap: round;
    opacity: 1;
}

@keyframes logoMenuGlowAnim {
    0% {
        stroke-dashoffset: 163.36;
        opacity: 0.8;
    }

    25% {
        opacity: 1;
    }

    50% {
        opacity: 0.9;
    }

    75% {
        opacity: 1;
    }

    100% {
        stroke-dashoffset: 0;
        opacity: 0.8;
    }
}

/* === Navbar Controls & Theme Toggle === */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 40px;
}

.theme-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--starlight);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

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

@media (max-width: 768px) {
    .nav-controls {
        gap: 20px;
    }
}

/* === LIGHT MODE STYLES === */
body.light-mode {
    background-color: #f9f9f9;
    color: #1a1a1a;
    --starlight: #1a1a1a;
    --void-bg: #f9f9f9;
    --glass-surface: rgba(0, 0, 0, 0.03);
    --glass-border: rgba(0, 0, 0, 0.08);
}

/* Header & Nav Light */
body.light-mode header .nav-logo img {
    filter: invert(1);
}

body.light-mode .social-icon,
body.light-mode .theme-toggle-btn {
    color: #1a1a1a;
}

body.light-mode .social-icon:hover,
body.light-mode .theme-toggle-btn:hover {
    color: var(--accent-color);
}

body.light-mode .logo-container .logo-half {
    filter: invert(1);
}

body.light-mode .logo-menu-border circle {
    stroke: rgba(0, 0, 0, 0.2);
}

body.light-mode .logo-menu-glow {
    stroke: #000;
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.5));
}

@media (min-width: 601px) and (max-width: 1024px) {
    .menu a {
        font-size: 1.5rem;
    }
}

@media (max-width: 600px) {
    .menu a {
        font-size: 1.3rem;
    }

    .icon-gold {
        font-size: 2.2rem;
    }
}