/* CSS Variables for theming */
:root {
    --bg: #0a0a0a;
    --fg: #fafafa;
    --muted: #737373;
    --muted-hover: #a3a3a3;
    --accent: #fe019a;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg: #fafafa;
    --fg: #0a0a0a;
    --muted: #525252;
    --muted-hover: #262626;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Starfield */
.starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.star {
    position: absolute;
    background: #ffffff;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

.star.small {
    width: 1px;
    height: 1px;
    box-shadow: 0 0 2px 0.5px rgba(255, 255, 255, 0.3);
}

.star.medium {
    width: 2px;
    height: 2px;
    box-shadow: 0 0 3px 1px rgba(255, 255, 255, 0.2);
}

.star.large {
    width: 3px;
    height: 3px;
    box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.15);
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: var(--max-opacity);
        transform: scale(1);
    }
}

/* Shooting star */
.shooting-star {
    position: absolute;
    pointer-events: none;
    width: 150px;
    height: 2px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0.05) 20%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.6) 80%,
        rgba(255, 255, 255, 1)
    );
    border-radius: 0 50% 50% 0;
    transform: rotate(35deg);
    opacity: 0;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.5));
}

.shooting-star.animate {
    animation: shootAcross 1.5s ease-in forwards;
}

@keyframes shootAcross {
    0% {
        opacity: 0;
        transform: rotate(35deg) translate(0, 0);
    }
    5% {
        opacity: 1;
    }
    85% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: rotate(35deg) translate(400px, 0);
    }
}

html {
    color-scheme: dark;
}

[data-theme="light"] html {
    color-scheme: light;
}

body {
    font-family: 'Geist Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    transition: background-color var(--transition), color var(--transition);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 2rem;
}

/* Main content */
.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* Name heading */
.name {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 500;
    letter-spacing: -0.025em;
    cursor: pointer;
    transition: letter-spacing var(--transition), text-shadow var(--transition);
    text-shadow: 0 0 30px rgba(254, 1, 154, 0.15), 0 0 60px rgba(254, 1, 154, 0.08);
}

.name:hover {
    letter-spacing: 0.02em;
    text-shadow: 0 0 30px rgba(254, 1, 154, 0.25), 0 0 60px rgba(254, 1, 154, 0.15);
}

/* Navigation links */
.links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--muted);
    font-size: 1.25rem;
    transition: color var(--transition);
    cursor: pointer;
}

.nav-link:hover {
    color: var(--muted-hover);
}

.link-text {
    transition: color var(--transition);
}

.bracket-wrap {
    display: inline-flex;
    align-items: center;
}

.bracket-inner {
    display: inline-block;
    padding: 0 0.15rem;
    transition: padding var(--transition);
    font-size: 0.9rem;
}

.nav-link:hover .bracket-inner {
    padding: 0 0.5rem;
}

/* Time-based greeting */
.greeting {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: var(--muted);
    opacity: 0.6;
    letter-spacing: 0.01em;
    z-index: 50;
    white-space: nowrap;
    transition: opacity var(--transition);
}

.greeting:hover {
    opacity: 0.85;
}

.greeting-icon {
    margin-left: 0.4rem;
    display: inline-block;
}

/* Corner links */
.corner-links {
    position: fixed;
    top: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    z-index: 50;
}

.corner-name {
    font-size: 1.4rem;
    color: var(--fg);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: opacity var(--transition);
}

.corner-name:hover {
    opacity: 0.7;
}

.corner-contact {
    font-size: 1.5rem;
    color: var(--muted);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: color var(--transition);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.corner-contact:hover {
    color: var(--fg);
}

.contact-star {
    display: inline-block;
    transition: transform var(--transition);
}

.corner-contact:hover .contact-star {
    transform: rotate(20deg) scale(1.2);
}

/* Contact bubble */
.contact-bubble {
    position: fixed;
    top: 3.5rem;
    left: 9rem;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
}

.contact-bubble.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.bubble-content {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95), rgba(20, 20, 20, 0.98));
    border: 1px solid rgba(254, 1, 154, 0.2);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: 
        0 0 30px rgba(254, 1, 154, 0.08),
        0 10px 40px rgba(0, 0, 0, 0.4);
    min-width: 260px;
}

[data-theme="light"] .bubble-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 250, 0.98));
    border: 1px solid rgba(254, 1, 154, 0.25);
}

.bubble-arrow {
    position: absolute;
    top: 0.75rem;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid rgba(30, 30, 30, 0.95);
}

[data-theme="light"] .bubble-arrow {
    border-right-color: rgba(255, 255, 255, 0.98);
}

.bubble-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.bubble-link {
    color: var(--fg);
    text-decoration: none;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color var(--transition), transform var(--transition);
}

.bubble-link:hover {
    color: #fe019a;
    transform: translateY(-1px);
}

.bubble-icon {
    font-weight: 600;
    font-size: 0.9rem;
}

.bubble-divider {
    height: 1px;
    background: rgba(128, 128, 128, 0.2);
    margin: 0.75rem 0;
}

.bubble-text {
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.bubble-emails {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bubble-email {
    color: var(--fg);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition);
}

.bubble-email:hover {
    color: #fe019a;
}

/* Top right controls */
.top-right-controls {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 50;
}

/* Theme toggle */
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color var(--transition), color var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: rgba(128, 128, 128, 0.1);
    color: var(--fg);
}

/* Fortune cookie button */
.fortune-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color var(--transition), transform var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.fortune-btn:hover {
    background-color: rgba(128, 128, 128, 0.1);
    transform: scale(1.1);
}

.fortune-btn:active {
    transform: scale(0.95);
}

/* Fortune banner */
.fortune-banner {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    max-width: 90vw;
    width: 600px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.fortune-banner.active {
    opacity: 1;
    visibility: visible;
}

.fortune-content {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95), rgba(20, 20, 20, 0.98));
    border: 1px solid rgba(254, 1, 154, 0.2);
    border-radius: 8px;
    padding: 1.5rem 2rem;
    box-shadow: 
        0 0 40px rgba(254, 1, 154, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: scaleY(0);
    transform-origin: top center;
    animation: none;
}

.fortune-banner.active .fortune-content {
    animation: unravel 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes unravel {
    0% {
        transform: scaleY(0);
        opacity: 0;
    }
    100% {
        transform: scaleY(1);
        opacity: 1;
    }
}

.fortune-text {
    display: block;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--fg);
    text-align: center;
}

.fortune-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem;
    transition: color var(--transition);
}

.fortune-close:hover {
    color: var(--fg);
}

[data-theme="light"] .fortune-content {
    background: linear-gradient(135deg, rgba(250, 250, 250, 0.98), rgba(240, 240, 240, 0.98));
    border: 1px solid rgba(254, 1, 154, 0.3);
}

/* Show/hide icons based on theme */
.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

[data-theme="light"] .sun-icon {
    display: block;
}

[data-theme="light"] .moon-icon {
    display: none;
}

/* Distant neon pink orb */
.container::before {
    content: '';
    position: fixed;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vh;
    background: radial-gradient(
        ellipse at center,
        rgba(254, 1, 154, 0.06) 0%,
        rgba(254, 1, 154, 0.03) 25%,
        rgba(254, 1, 154, 0.01) 50%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
    filter: blur(60px);
}

/* Secondary deeper glow for depth */
.container::after {
    content: '';
    position: fixed;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40vw;
    height: 40vh;
    background: radial-gradient(
        circle at center,
        rgba(254, 1, 154, 0.08) 0%,
        rgba(254, 1, 154, 0.02) 40%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
    filter: blur(80px);
}

/* Page content styles */
.page-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    max-width: 700px;
    padding: 2rem;
    z-index: 10;
}

.page-title {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 500;
    letter-spacing: -0.025em;
    text-shadow: 0 0 30px rgba(254, 1, 154, 0.15), 0 0 60px rgba(254, 1, 154, 0.08);
}

.page-body {
    color: var(--muted);
    line-height: 1.8;
    text-align: center;
    font-size: 1.1rem;
}

.page-body p {
    margin-bottom: 1rem;
}

.back-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color var(--transition);
    margin-top: 1rem;
}

.back-link:hover {
    color: var(--fg);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .name {
        font-size: 2rem;
    }
    
    .nav-link {
        font-size: 1.1rem;
    }
    
    .corner-name {
        font-size: 0.9rem;
    }
}

/* Selection styling */
::selection {
    background-color: var(--fg);
    color: var(--bg);
}

/* Music toggle */
.music-toggle {
    position: fixed;
    bottom: 0.5rem;
    left: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 1rem;
    transition: background-color var(--transition), transform var(--transition), opacity var(--transition);
    z-index: 50;
    font-size: 1.2rem;
    opacity: 0.7;
    color: var(--muted);
    letter-spacing: 0.05em;
}

.music-toggle:hover {
    background-color: rgba(128, 128, 128, 0.1);
    opacity: 1;
    color: var(--fg);
}

.music-toggle.playing {
    opacity: 1;
    color: var(--fg);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Footer */
.page-footer {
    position: fixed;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
    width: 100%;
    padding: 0 1rem;
}

.footer-text {
    font-size: 0.75rem;
    color: var(--muted);
    opacity: 0.85;
    line-height: 1.4;
    max-width: 90vw;
    margin: 0 auto;
    white-space: nowrap;
}

/* Focus styles for accessibility */
.nav-link:focus-visible,
.theme-toggle:focus-visible,
.corner-name:focus-visible,
.music-toggle:focus-visible {
    outline: 2px solid var(--muted);
    outline-offset: 4px;
}

