@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Figtree:wght@300;700&display=swap');

/* ===== CSS Variables ===== */
:root {
    --bg-primary: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --current-color: #ffffff;
}

[data-theme="light"] {
    --bg-primary: #fafaf8;
    --text-primary: #0a0a0a;
    --text-secondary: #666666;
    --accent-gradient: linear-gradient(135deg, #0088cc 0%, #6d28d9 100%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: var(--transition);
}

/* ===== Network Background (Full Page) ===== */
.network-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

/* ===== Initial Quote ===== */
.initial-quote {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    max-width: 1200px;
    padding: 2rem;
    text-align: center;
    opacity: 1;
    transition: opacity 0.4s ease-out;
    pointer-events: none;
}

.initial-quote.fade-out {
    opacity: 0;
}

.initial-quote p {
    font-family: 'Figtree', sans-serif;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 300;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
    font-style: italic;
}

.initial-quote .quote-attribution {
    font-family: 'Figtree', sans-serif;
    font-size: clamp(0.9rem, 1.4vw, 1.1rem);
    font-weight: 300;
    color: var(--text-secondary);
    margin-top: 1.5rem;
    font-style: normal;
    opacity: 0.8;
}

@media (max-height: 800px) {
    .initial-quote {
        top: 35%;
    }
}

@media (max-height: 600px) {
    .initial-quote {
        top: 30%;
    }
}

@media (max-width: 1024px) {
    .initial-quote {
        max-width: 95%;
        padding: 1.25rem;
    }

    .initial-quote p {
        font-size: clamp(1.1rem, 2.8vw, 1.5rem);
        line-height: 1.55;
    }

    .initial-quote .quote-attribution {
        font-size: clamp(0.8rem, 1.6vw, 1rem);
    }
}

@media (max-width: 768px) {
    .initial-quote {
        max-width: 90%;
        padding: 1rem 0.75rem;
    }

    .initial-quote p {
        font-size: clamp(1rem, 2.5vw, 1.3rem);
        line-height: 1.5;
    }

    .initial-quote .quote-attribution {
        font-size: clamp(0.75rem, 1.8vw, 0.9rem);
        margin-top: 0.75rem;
    }
}

@media (max-width: 640px) {
    .initial-quote {
        max-width: 92%;
        padding: 1rem 0.75rem;
    }

    .initial-quote p {
        font-size: clamp(1rem, 3.8vw, 1.4rem);
        line-height: 1.45;
    }

    .initial-quote .quote-attribution {
        font-size: clamp(0.75rem, 2.5vw, 0.95rem);
        margin-top: 0.75rem;
    }
}

@media (max-width: 480px) {
    .initial-quote {
        max-width: 94%;
        padding: 0.875rem 0.625rem;
    }

    .initial-quote p {
        font-size: clamp(0.9rem, 3.5vw, 1.2rem);
        line-height: 1.4;
    }

    .initial-quote .quote-attribution {
        font-size: clamp(0.7rem, 2.2vw, 0.85rem);
        margin-top: 0.625rem;
    }
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: visible;
    padding: 4rem 8rem;
    margin: 0 auto;
    max-width: 1600px;
}

.browser-notice {
    position: relative;
    z-index: 10;
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    font-family: 'Figtree', 'Inter', sans-serif;
    color: #4b5563;
    opacity: 0.6;
}

[data-theme="light"] .browser-notice {
    color: #6b7280;
}

.network-line {
    transition: stroke 0.6s ease, opacity 0.6s ease;
    will-change: opacity;
}

.network-dot {
    opacity: 0.8;
    transition: fill 0.6s ease, opacity 0.6s ease;
    will-change: cx, cy;
}

.network-dot.morphing {
    transition: fill 0.6s ease, opacity 0.6s ease, cx 0.8s ease, cy 0.8s ease;
}

/* All movement handled by JS */
.network-background > g {
    transition: transform 0.8s ease;
}

.network-background > g.shape-mode {
    animation: none;
}

.network-background > g.scatter-mode {
    animation: none;
}

.hero-top {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.25rem 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    margin-bottom: 0;
}

[data-theme="light"] .hero-top {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.name-description {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    align-items: flex-start;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.8s ease-out both;
    transition: background 0.6s ease;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.typing-container {
    min-height: 1.5rem;
    font-size: clamp(1.1rem, 2.4vw, 1.5rem);
    font-family: 'Figtree', 'Inter', sans-serif;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.3rem;
    letter-spacing: -0.01em;
}

.typing-text {
    font-weight: 300;
    display: inline-block;
}

.links-container {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    animation: fadeIn 1s ease-out 0.6s both;
}

.link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55px;
    height: 55px;
    font-size: 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}

.theme-toggle {
    position: fixed;
    top: 2rem;
    right: max(8rem, calc((100vw - 1600px) / 2 + 8rem));
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    outline: none;
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    color: var(--current-color);
}

[data-theme="light"] .theme-toggle {
    background: rgba(0, 0, 0, 0.05);
    border: 1.5px solid rgba(0, 0, 0, 0.15);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--current-color);
    transform: translateY(-4px);
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: var(--current-color);
    transform: translateY(-4px);
}

[data-theme="light"] .link-btn {
    background: rgba(0, 0, 0, 0.05);
    border: 1.5px solid rgba(0, 0, 0, 0.15);
}

.link-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--current-color);
    transform: translateY(-4px);
}

[data-theme="light"] .link-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .hero {
        padding: 4rem 6rem;
    }

    .theme-toggle {
        right: 6rem;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 3rem 4rem;
    }

    .hero-top {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 1rem 1.5rem;
        margin-bottom: 0;
    }

    .name-description {
        gap: 0.05rem;
        align-items: center;
        text-align: center;
    }

    .hero-title {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
    }

    .links-container {
        gap: 0.8rem;
    }

    .link-btn {
        width: 50px;
        height: 50px;
    }

    .link-btn svg {
        width: 20px;
        height: 20px;
    }

    .theme-toggle {
        right: 4rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 3rem;
    }

    .hero-top {
        gap: 0.8rem;
        padding: 0.875rem 1.25rem;
        margin-bottom: 0;
    }

    .links-container {
        gap: 0.6rem;
    }

    .link-btn {
        width: 45px;
        height: 45px;
    }

    .link-btn svg {
        width: 18px;
        height: 18px;
    }

    .typing-container {
        font-size: clamp(0.9rem, 4vw, 1.2rem);
    }

    .theme-toggle {
        right: 3rem;
    }
}
