:root {
    --primary-bg: #0f172a;
    --secondary-bg: #1e293b;
    --card-bg: rgba(30, 41, 59, 0.6);
    --primary-color: #8b5cf6;
    --secondary-color: #d8b4fe;
    --accent-color: #f472b6;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    --gradient-glow: radial-gradient(circle at top left, rgba(139, 92, 246, 0.15), transparent 70%);
    
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-blur: blur(16px);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* --- Background & Particles --- */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.cursor-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease;
    z-index: 0;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: var(--glass-border);
    padding: 1rem 0;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo i {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    background: var(--glass-bg);
    padding: 0.5rem 1.5rem;
    border-radius: 999px;
    border: var(--glass-border);
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--glass-bg);
    border: var(--glass-border);
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* --- Hero Section (Asymmetric Layout) --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
    overflow: hidden;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.hero-text {
    position: relative;
    z-index: 2;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary-color);
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.glitch-text {
    font-size: clamp(3.5rem, 6vw, 5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    background: #7c3aed;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color); /* Fallback */
    border: var(--glass-border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

.hero-visual {
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    gap: 2rem;
    position: relative;
    z-index: 2;
    box-shadow: var(--shadow-lg);
    animation: float 6s ease-in-out infinite;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.divider {
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.abstract-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: 1;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: var(--primary-color);
    top: 0;
    right: 0;
    animation: blob 10s infinite alternate;
}

.shape-2 {
    width: 250px;
    height: 250px;
    background: var(--accent-color);
    bottom: 0;
    left: 0;
    animation: blob 10s infinite alternate-reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes blob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -30px) scale(1.1); }
}

/* --- Section Commons --- */
section {
    padding: 6rem 0;
}

.section-header {
    margin-bottom: 3rem;
}

.section-tag {
    display: block;
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* --- Bento Grid (About) --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 240px);
    gap: 1.5rem;
}

.bento-item {
    background: var(--card-bg);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.bento-item:hover {
    transform: translateY(-5px);
    border-color: rgba(139, 92, 246, 0.3);
}

.item-large {
    grid-column: span 2;
    grid-row: span 2;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
}

.item-tall {
    grid-column: span 1;
    grid-row: span 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.item-wide {
    grid-column: span 1;
    grid-row: span 1;
}

.item-small {
    grid-column: span 1;
    grid-row: span 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
}

/* Bento Content */
.profile-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.profile-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.bento-item h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.bento-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.tags {
    margin-top: auto;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tags span {
    padding: 0.35rem 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.card-bg-icon {
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 10rem;
    color: rgba(255, 255, 255, 0.03);
    transform: rotate(15deg);
}

.quote-card {
    text-align: center;
    font-style: italic;
    font-size: 1.25rem;
    position: relative;
}

.quote-icon {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 1.5rem;
    opacity: 0.3;
}

/* --- Masonry Hobbies --- */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.masonry-item {
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: var(--radius-md);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: default;
}

.masonry-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.hobby-inner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.hobby-inner i {
    font-size: 2rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.masonry-item:hover .hobby-inner i {
    color: var(--primary-color);
}

.hobby-inner span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* --- Dock Portal --- */
.dock-container {
    display: flex;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem 2rem;
    border-radius: 24px;
    border: var(--glass-border);
    width: fit-content;
    backdrop-filter: blur(20px);
}

.dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.dock-item:hover {
    transform: translateY(-5px);
}

.dock-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #334155, #1e293b);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-primary);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

.dock-item:hover .dock-icon {
    background: var(--primary-color);
    box-shadow: 0 8px 12px rgba(139, 92, 246, 0.3);
}

.dock-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dock-item.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(1);
}

/* --- Footer --- */
.footer {
    margin-top: 6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 4rem 0 2rem;
    background: var(--secondary-bg);
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-brand h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.footer-brand p {
    color: var(--text-secondary);
}

.footer-hitokoto {
    max-width: 400px;
    text-align: right;
}

#hitokoto-text {
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: block;
    text-decoration: none;
    transition: color 0.3s ease;
}

#hitokoto-text:hover {
    color: var(--primary-color);
}

#hitokoto-source {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.icp-info a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.icp-info a:hover {
    color: var(--primary-color);
}

/* --- Mobile Responsive --- */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
    }
    
    .item-large { grid-column: span 2; }
    .item-tall { grid-column: span 1; grid-row: span 1; }
    .item-wide { grid-column: span 1; }
    .item-small { grid-column: span 2; }
}

@media (max-width: 768px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .nav-links {
        display: none; /* Simplification for mobile */
    }
    
    /* Simple Mobile Nav fix */
    .nav-links.mobile-active {
        display: flex;
        position: absolute;
        top: 70px;
        left: 20px;
        right: 20px;
        flex-direction: column;
        background: var(--secondary-bg);
        z-index: 100;
    }

    .bento-grid {
        grid-template-columns: 1fr;
    }
    
    .item-large, .item-tall, .item-wide, .item-small {
        grid-column: span 1;
        grid-row: auto;
    }

    .item-tall {
        min-height: 240px;
    }

    .footer-grid {
        flex-direction: column;
        text-align: center;
    }

    .footer-hitokoto {
        text-align: center;
        margin: 0 auto;
    }

    .footer-bottom {
        flex-direction: column;
    }
}

/* Light Theme Adjustments */
.light-theme {
    --primary-bg: #f8fafc;
    --secondary-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --card-bg: rgba(255, 255, 255, 0.8);
    --glass-bg: rgba(255, 255, 255, 0.5);
    --glass-border: 1px solid rgba(0,0,0,0.06);
}

.light-theme .nav-links {
    background: white;
    box-shadow: var(--shadow-sm);
}

.light-theme .dock-icon {
    background: #f1f5f9;
    color: #475569;
    border-color: rgba(0,0,0,0.05);
}

.light-theme .badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-color: rgba(99, 102, 241, 0.1);
}

.light-theme .abstract-shape {
    opacity: 0.2;
}
