/* ========================================
   HydrogenE7 Personal Homepage
   Complete Redesign - Dark Theme
   ======================================== */

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

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #666666;
    --accent: #00d9ff;
    --accent-hover: #00b8d9;
    --primary: #6366f1;
    --secondary: #8b5cf6;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.5);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

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


/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 24px;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.header-container:has(.back-link) {
    justify-content: space-between;
}

.header-right {
    display: flex;
    align-items: center;
}

.lang-switch {
    display: flex;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.lang-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-width: 70px;
    width: 70px;
    text-align: center;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.lang-btn.active {
    background: var(--accent);
    color: var(--bg-primary);
}

/* Main Container */
.main {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 24px 80px;
}

/* Hero Section */
.hero-section {
    margin-bottom: 120px;
    animation: fadeIn 1s ease-out;
}

.hero-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.hero-name {
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 700;
    line-height: 1.1;
    margin: 24px 0;
    position: relative;
    letter-spacing: -0.04em;
    display: flex;
    align-items: baseline;
    gap: 20px;
    flex-wrap: wrap;
}

.intro-line {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
    line-height: 1;
    opacity: 0.8;
}

.name-prefix {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.8;
}

.name-text {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.name-underline {
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), transparent);
    animation: underlineExpand 1s ease-out 0.5s both;
}

@keyframes underlineExpand {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.hero-tagline {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 16px;
}

.hero-quote {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--text-tertiary);
    line-height: 1.8;
    max-width: 600px;
    font-style: italic;
}

/* Social Grid */
.social-grid {
    display: flex;
    gap: 16px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.social-item {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.social-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.social-item:hover::before {
    width: 100px;
    height: 100px;
}

.social-item svg {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
    opacity: 0.7;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.social-item:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.social-item:hover svg {
    opacity: 1;
    color: var(--text-primary);
    transform: scale(1.1);
}

/* Section Styles */
.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease-out;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
}

/* Projects Section */
.projects-section {
    margin-bottom: 120px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.projects-grid:has(.project-item:nth-child(2):last-child) {
    grid-template-columns: repeat(2, 1fr);
    max-width: 900px;
    margin: 0 auto;
}

.projects-grid:has(.project-item:nth-child(1):last-child) {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin: 0 auto;
}

.project-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.4s ease;
}

.project-item:hover::before {
    transform: scaleY(1);
}

.project-item:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 217, 255, 0.1);
}

.project-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.project-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s ease;
}

.project-icon svg {
    width: 32px;
    height: 32px;
    color: var(--accent);
    opacity: 0.9;
    transition: all 0.3s ease;
}

.project-item:hover .project-icon {
    background: rgba(0, 217, 255, 0.1);
    transform: scale(1.05);
}

.project-item:hover .project-icon svg {
    color: var(--accent);
    opacity: 1;
    transform: rotate(5deg) scale(1.1);
}

.blog-icon svg {
    color: var(--accent);
}

.tools-icon svg {
    color: var(--accent);
}

.project-item:hover .blog-icon {
    background: rgba(0, 217, 255, 0.1);
}

.project-item:hover .blog-icon svg {
    color: var(--accent);
}

.project-item:hover .tools-icon {
    background: rgba(0, 217, 255, 0.1);
}

.project-item:hover .tools-icon svg {
    color: var(--accent);
}

.project-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
}

.project-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.project-badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 4px 10px;
    background: rgba(139, 92, 246, 0.2);
    color: var(--secondary);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    line-height: 1;
    display: inline-block;
    white-space: nowrap;
    width: fit-content;
}

.project-desc {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 0.95rem;
    flex-grow: 1;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
}

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

.project-link:hover {
    color: var(--accent-hover);
    gap: 12px;
}

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

.project-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 20px;
}

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

.project-link.secondary:hover {
    color: var(--text-primary);
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-link:hover {
    color: var(--accent);
    gap: 12px;
}

/* About Section */
.about-section {
    margin-bottom: 80px;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.about-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    transition: all 0.3s ease;
}

.about-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.about-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.about-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.about-list li {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    padding-left: 24px;
    position: relative;
    transition: all 0.3s ease;
}

.about-list li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 300;
    font-size: 1.1em;
}

.about-list li:hover {
    color: var(--text-primary);
    padding-left: 28px;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 40px 24px;
    margin-top: 120px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-text {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.footer-text a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-text a:hover {
    color: var(--accent);
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .main {
        padding: 100px 20px 60px;
    }

    .hero-section {
        margin-bottom: 80px;
    }

    .projects-grid {
        grid-template-columns: 1fr !important;
        max-width: 100% !important;
        gap: 24px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .hero-name {
        gap: 16px;
    }
    
    .intro-line {
        font-size: clamp(2rem, 5vw, 3rem);
    }

    .section-header {
        margin-bottom: 32px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 16px;
    }

    .main {
        padding: 80px 16px 40px;
    }

    .project-item,
    .about-item {
        padding: 24px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* Selection */
::selection {
    background: var(--accent);
    color: var(--bg-primary);
}
