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

:root {
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="light"] {
    --bg: #ffffff;
    --bg-secondary: #f9fafb;
    --text: #111827;
    --text-secondary: #6b7280;
    --border: rgba(0, 0, 0, 0.06);
    --hover: #000000;
}

html[data-theme="dark"] {
    --bg: #000000;
    --bg-secondary: #0a0a0a;
    --text: #fafafa;
    --text-secondary: #a1a1aa;
    --border: rgba(255, 255, 255, 0.08);
    --hover: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    font-size: 18px;
    transition: background-color var(--transition), color var(--transition);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 32px;
    right: 32px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    z-index: 100;
    border: 1px solid var(--border);
}

.theme-toggle:hover {
    transform: scale(1.08);
    border-color: var(--text-secondary);
}

.theme-toggle:active {
    transform: scale(0.92);
}

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

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

main {
    max-width: 620px;
    margin: 0 auto;
    padding: 140px 32px 80px;
}

.intro {
    margin-bottom: 32px;
}

h1 {
    font-size: 2.25rem;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.aka {
    color: var(--text-secondary);
    font-size: 17px;
    margin: 0;
    font-weight: 400;
}

h2 {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.bio {
    color: var(--text-secondary);
    margin-bottom: 44px;
    font-size: 17px;
    line-height: 1.6;
}

.projects {
    margin-bottom: 44px;
}

.projects h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    color: var(--text);
}

.project {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.project a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition);
}

.project a:hover {
    border-bottom-color: var(--text);
}

p {
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 40px;
}

.badges img {
    width: 88px;
    height: 31px;
    image-rendering: pixelated;
    transition: transform var(--transition);
}

.badges img:hover {
    transform: scale(1.05);
}

.graph-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.github-section a {
    display: block;
    text-decoration: none;
}

.contrib-graph {
    width: 100%;
    height: auto;
    border-radius: 6px;
}

nav {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

nav a {
    color: var(--text);
    text-decoration: none;
    transition: all var(--transition);
    font-weight: 400;
    position: relative;
    font-size: 16px;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--text);
    transition: width var(--transition);
}

nav a:hover::after {
    width: 100%;
}

nav a:hover {
    opacity: 1;
}

a {
    color: var(--text);
    text-decoration: underline;
    transition: all var(--transition);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.glitch {
    position: relative;
    display: inline-block;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.glitch:hover::before {
    animation: glitch-1 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    color: #ff00de;
    z-index: -1;
}

.glitch:hover::after {
    animation: glitch-2 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    color: #00ffff;
    z-index: -1;
}

@keyframes glitch-1 {
    0% {
        transform: translate(0);
        opacity: 0.7;
    }
    20% {
        transform: translate(-2px, 2px);
        opacity: 0.7;
    }
    40% {
        transform: translate(-2px, -2px);
        opacity: 0.7;
    }
    60% {
        transform: translate(2px, 2px);
        opacity: 0.7;
    }
    80% {
        transform: translate(2px, -2px);
        opacity: 0.7;
    }
    100% {
        transform: translate(0);
        opacity: 0.7;
    }
}

@keyframes glitch-2 {
    0% {
        transform: translate(0);
        opacity: 0.7;
    }
    20% {
        transform: translate(2px, -2px);
        opacity: 0.7;
    }
    40% {
        transform: translate(2px, 2px);
        opacity: 0.7;
    }
    60% {
        transform: translate(-2px, -2px);
        opacity: 0.7;
    }
    80% {
        transform: translate(-2px, 2px);
        opacity: 0.7;
    }
    100% {
        transform: translate(0);
        opacity: 0.7;
    }
}

a:hover {
    opacity: 0.6;
}

/* Projects page */
.back {
    display: inline-block;
    margin-bottom: 32px;
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
}

.back:hover {
    opacity: 0.6;
}

.projects-list {
    list-style: decimal;
    padding-left: 24px;
    margin-top: 32px;
}

.project {
    margin-bottom: 32px;
}

.project-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.project-title:hover {
    text-decoration: underline;
    opacity: 1;
}

.project p {
    margin-bottom: 0;
    margin-top: 4px;
}

@media (max-width: 640px) {
    .theme-toggle {
        top: 16px;
        right: 16px;
    }
    
    main {
        padding: 80px 20px 60px;
    }
}

/* Projects page */
.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 50%, var(--accent-tertiary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.back {
    display: inline-block;
    margin-bottom: 32px;
    color: var(--text-dim);
    font-size: 14px;
}

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

.projects-list {
    margin-top: 32px;
}

.project {
    margin-bottom: 28px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color 0.2s ease;
}

.project:hover {
    border-color: var(--accent);
}

.project h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    text-transform: none;
    letter-spacing: normal;
    margin-bottom: 6px;
}

.project p {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.project-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.tag {
    font-size: 11px;
    padding: 4px 10px;
    background: rgba(232, 121, 249, 0.1);
    color: var(--accent);
    border-radius: 20px;
    border: 1px solid rgba(232, 121, 249, 0.2);
}

.project-links {
    display: flex;
    gap: 16px;
}

.project-links a {
    font-size: 13px;
    color: var(--accent-secondary);
}

.project-links a:hover {
    color: var(--accent);
}
