/* ===========================
   CSS Custom Properties
   =========================== */
:root {
    /* Typography */
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Transitions */
    --transition-speed: 0.4s;
    --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================
   Dark Theme (Default)
   =========================== */
[data-theme="dark"] {
    --bg-primary: #0b1220;
    --bg-secondary: #111a2e;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #94a3b8;
    --accent: #f1f5f9;
    --accent-hover: #ffffff;
    --link-color: #f1f5f9;
    --link-hover: #ffffff;
    --border-color: rgba(148, 163, 184, 0.14);
    --shadow-color: rgba(11, 18, 32, 0.3);
    --orb-1: rgba(30, 55, 120, 0.18);
    --orb-2: rgba(40, 65, 140, 0.12);
    --orb-3: rgba(20, 45, 110, 0.1);
    --gradient-start: #0b1220;
    --gradient-mid: #0f1829;
    --gradient-end: #0a1020;
}

/* ===========================
   Light Theme
   =========================== */
[data-theme="light"] {
    --bg-primary: #f0eef6;
    --bg-secondary: #e8e4f0;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4868;
    --text-muted: #7a789a;
    --accent: #6c5ce7;
    --accent-hover: #5a4bd1;
    --link-color: #6c5ce7;
    --link-hover: #4a3abf;
    --border-color: rgba(108, 92, 231, 0.15);
    --shadow-color: rgba(108, 92, 231, 0.06);
    --orb-1: rgba(108, 92, 231, 0.1);
    --orb-2: rgba(236, 150, 206, 0.12);
    --orb-3: rgba(99, 179, 237, 0.1);
    --gradient-start: #dde0f5;
    --gradient-mid: #f0eef6;
    --gradient-end: #ede4ef;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    transition: 
        background-color var(--transition-speed) var(--transition-ease),
        color var(--transition-speed) var(--transition-ease);
    position: relative;
}

/* ===========================
   Background Gradient Orbs
   =========================== */
.bg-orbs {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    transition: background var(--transition-speed) var(--transition-ease);
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--orb-1);
    top: -10%;
    right: -5%;
    animation: orbFloat1 20s ease-in-out infinite;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--orb-2);
    bottom: -15%;
    left: -10%;
    animation: orbFloat2 25s ease-in-out infinite;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: var(--orb-3);
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    animation: orbFloat3 18s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-40px, 30px); }
    66% { transform: translate(20px, -20px); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -40px); }
    66% { transform: translate(-20px, 20px); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translateX(-50%) translate(0, 0); }
    33% { transform: translateX(-50%) translate(-30px, -20px); }
    66% { transform: translateX(-50%) translate(20px, 30px); }
}

/* ===========================
   Main Container
   =========================== */
.container {
    position: relative;
    z-index: 1;
    max-width: 640px;
    width: 100%;
    padding: 60px 32px;
    margin: 0 auto;
    text-align: center;
    animation: fadeInUp 0.8s var(--transition-ease) forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   Avatar
   =========================== */
.avatar-wrapper {
    margin-bottom: 28px;
    display: flex;
    justify-content: center;
    animation: fadeInUp 0.8s var(--transition-ease) 0.1s both;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    box-shadow: 
        0 0 0 4px var(--shadow-color),
        0 8px 32px var(--shadow-color);
    transition: 
        transform 0.5s var(--transition-ease),
        box-shadow 0.5s var(--transition-ease),
        border-color var(--transition-speed) var(--transition-ease);
    cursor: pointer;
}

.avatar:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 
        0 0 0 6px var(--shadow-color),
        0 12px 40px rgba(139, 124, 246, 0.15);
}

/* ===========================
   Name & Subtitle
   =========================== */
.name {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 4.5rem);
    font-weight: 400;
    font-style: italic;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 8px;
    transition: color var(--transition-speed) var(--transition-ease);
    animation: fadeInUp 0.8s var(--transition-ease) 0.2s both;
}

.subtitle {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 40px;
    transition: color var(--transition-speed) var(--transition-ease);
    animation: fadeInUp 0.8s var(--transition-ease) 0.3s both;
}

/* ===========================
   Bio
   =========================== */
.bio {
    text-align: left;
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--text-primary);
    transition: color var(--transition-speed) var(--transition-ease);
    animation: fadeInUp 0.8s var(--transition-ease) 0.4s both;
}

.bio p {
    margin-bottom: 20px;
}

.bio p:last-child {
    margin-bottom: 0;
}

.inline-link {
    color: var(--link-color);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    font-weight: 600;
    position: relative;
    transition: color 0.3s var(--transition-ease), text-decoration-color 0.3s var(--transition-ease);
}

.inline-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--link-hover);
    transition: width 0.3s var(--transition-ease);
}

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

.inline-link:hover::after {
    width: 100%;
}

/* ===========================
   Navigation Links
   =========================== */
.links {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin: 44px 0 32px;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s var(--transition-ease) 0.5s both;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    position: relative;
    padding: 4px 0;
    transition: 
        color 0.3s var(--transition-ease),
        transform 0.3s var(--transition-ease);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: 
        width 0.3s var(--transition-ease),
        left 0.3s var(--transition-ease);
    border-radius: 1px;
}

.nav-link:hover {
    color: var(--accent-hover);
    transform: translateY(-1px);
}

.nav-link:hover::after {
    width: 100%;
    left: 0;
}

/* ===========================
   Location & Time
   =========================== */
.location {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: color var(--transition-speed) var(--transition-ease);
    animation: fadeInUp 0.8s var(--transition-ease) 0.6s both;
}

.separator {
    opacity: 0.5;
}

.pin {
    font-size: 0.9rem;
}

/* ===========================
   Theme Toggle
   =========================== */
.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: 
        background var(--transition-speed) var(--transition-ease),
        border-color var(--transition-speed) var(--transition-ease),
        color var(--transition-speed) var(--transition-ease),
        transform 0.3s var(--transition-ease),
        box-shadow 0.3s var(--transition-ease);
    box-shadow: 0 2px 12px var(--shadow-color);
    animation: fadeIn 0.8s var(--transition-ease) 0.8s both;
}

.theme-toggle:hover {
    transform: scale(1.08) rotate(15deg);
    box-shadow: 0 4px 20px var(--shadow-color);
    color: var(--accent);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

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

/* ===========================
   Selection
   =========================== */
::selection {
    background: var(--accent);
    color: #fff;
}

/* ===========================
   Scrollbar
   =========================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 640px) {
    .container {
        padding: 48px 24px;
    }

    .name {
        font-size: clamp(2.4rem, 10vw, 3.5rem);
    }

    .avatar {
        width: 100px;
        height: 100px;
    }

    .links {
        gap: 20px;
    }

    .bio {
        font-size: 0.95rem;
    }

    .theme-toggle {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 380px) {
    .container {
        padding: 40px 20px;
    }

    .links {
        gap: 16px;
    }
}
