:root {
    --bg-light: #f5f5f5;
    --bg-dark: #0d0d0d;
    --text-light: #1a1a1a;
    --text-dark: #f0f0f0;
    --accent-light: #666;
    --accent-dark: #999;
    --highlight: #3b82f6;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--bg-light);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background 0.5s ease, color 0.5s ease;
    font-family: 'Source Code Pro', monospace;
    line-height: 1.7;
    padding: 0 1.5rem;
    padding-top: 35vh;
    padding-bottom: 6rem;
}

.dark-mode {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* Hide star effects in light mode */
body:not(.dark-mode) #stars-canvas,
body:not(.dark-mode) .aurora {
    display: none;
}

.top-right {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
}

.top-left {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 100;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.icon-link {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dark);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    outline: none;
    cursor: pointer;
}

.icon-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

body:not(.dark-mode) .icon-link {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-light);
}

body:not(.dark-mode) .icon-link:hover {
    background: rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 500;
    margin: 0 0 3rem 0;
    letter-spacing: -0.03em;
    display: inline-block;
    border-right: 2px solid var(--text-light);
    animation: blink-cursor 0.8s step-end infinite;
    white-space: nowrap;
    overflow: hidden;
    padding-right: 0.15em;
    margin-left: -0.07em;
}

.name-container {
    width: 100%;
    max-width: 560px;
    text-align: left;
    pointer-events: none;
}

h1 {
    pointer-events: none;
}

.dark-mode h1 {
    border-right-color: var(--text-dark);
}

h1.done {
    border-right: none;
    animation: none;
}

@keyframes blink-cursor {
    0%, 100% { border-color: currentColor; }
    50% { border-color: transparent; }
}

.section {
    width: 100%;
    max-width: 560px;
    padding: 3.5rem 0;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    text-align: left;
    margin: 0 auto;
    pointer-events: none;
}

.section a,
.section button,
.project-item,
.skill-tag {
    pointer-events: auto;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.typed-heading {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0 0 1.25rem 0;
    border-right: 2px solid;
    animation: blink-cursor 0.8s step-end infinite;
    display: inline-block;
    white-space: nowrap;
    padding-right: 0.15em;
    text-transform: lowercase;
    letter-spacing: 0.05em;
}

.typed-heading.done {
    border-right: none;
    animation: none;
}

.typed-text {
    font-size: 1rem;
    font-weight: 400;
    color: var(--accent-light);
    margin: 0;
    line-height: 1.9;
    max-width: 480px;
}

.dark-mode .typed-text {
    color: var(--accent-dark);
}

.links-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.links-container a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    position: relative;
    padding-bottom: 2px;
    transition: color 0.3s ease;
}

.links-container a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 1px;
    background: var(--highlight);
    transition: width 0.3s ease;
}

.links-container a:hover::after {
    width: 100%;
}

.links-container a:hover {
    color: var(--highlight);
}

.dark-mode .links-container a {
    color: var(--text-dark);
}

.dark-mode .links-container a:hover {
    color: var(--highlight);
}

.mode-toggle {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-light);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.mode-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.mode-toggle svg {
    display: block;
    width: 22px;
    height: 22px;
}

.dark-mode .mode-toggle {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dark);
}

.dark-mode .mode-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

::selection {
    background: var(--highlight);
    color: #fff;
}

@media (max-width: 600px) {
    body {
        padding-top: 25vh;
    }
    
    .section {
        padding: 2.5rem 0;
    }
    
    .links-container {
        gap: 1.25rem;
    }
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--highlight), #8b5cf6);
    width: 0%;
    z-index: 1000;
    transition: width 0.1s ease-out;
}

#stars-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

body:not(.dark-mode) #stars-canvas {
    opacity: 0.15;
}

.aurora {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.4;
    background: 
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 70% 50% at 50% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
    animation: aurora-shift 20s ease-in-out infinite;
}

@keyframes aurora-shift {
    0%, 100% { transform: translateX(0) translateY(0) scale(1); }
    25% { transform: translateX(2%) translateY(-1%) scale(1.02); }
    50% { transform: translateX(-1%) translateY(2%) scale(0.98); }
    75% { transform: translateX(-2%) translateY(-1%) scale(1.01); }
}

body:not(.dark-mode) .aurora {
    opacity: 0.2;
}

.ripple-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: ripple-expand 0.8s ease-out forwards;
    pointer-events: none;
}

body:not(.dark-mode) .ripple {
    border-color: rgba(0, 0, 0, 0.15);
}

@keyframes ripple-expand {
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

.secret-stats {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    font-size: 0.75rem;
    color: var(--accent-dark);
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    font-family: 'Source Code Pro', monospace;
    transition: opacity 0.3s ease;
    text-align: right;
}

.secret-stats.visible {
    opacity: 1;
}

body:not(.dark-mode) .secret-stats {
    color: var(--accent-light);
}

.footer {
    margin-top: 4rem;
    padding: 2rem;
    font-size: 0.8rem;
    color: var(--accent-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.footer:hover {
    opacity: 1;
}

body:not(.dark-mode) .footer {
    color: var(--accent-light);
}

.footer-divider {
    opacity: 0.4;
}

.footer-hint {
    font-style: italic;
    opacity: 0.5;
}

body:not(.dark-mode) .footer-hint {
    display: none;
}

/* Contact Modal */
.contact-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.contact-modal.active {
    display: flex;
}

.contact-modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--accent-dark);
    border-radius: 8px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    position: relative;
}

body:not(.dark-mode) .contact-modal-content {
    background: var(--bg-light);
    border-color: var(--accent-light);
}

.contact-modal-content h3 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.contact-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    line-height: 1;
}

.contact-close:hover {
    opacity: 1;
}

body:not(.dark-mode) .contact-close {
    color: var(--text-light);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form textarea {
    background: transparent;
    border: 1px solid var(--accent-dark);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.9rem;
    color: var(--text-dark);
    transition: border-color 0.3s ease, background 0.3s ease;
    resize: vertical;
}

.contact-form textarea::placeholder {
    color: var(--accent-dark);
    opacity: 0.7;
}

.contact-form textarea:focus {
    outline: none;
    border-color: var(--highlight);
    background: rgba(255, 255, 255, 0.03);
}

body:not(.dark-mode) .contact-form textarea {
    border-color: var(--accent-light);
    color: var(--text-light);
}

body:not(.dark-mode) .contact-form textarea::placeholder {
    color: var(--accent-light);
}

body:not(.dark-mode) .contact-form textarea:focus {
    background: rgba(0, 0, 0, 0.02);
}

.contact-form button {
    background: transparent;
    border: 1px solid var(--text-dark);
    border-radius: 4px;
    padding: 0.75rem 1.5rem;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.9rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.contact-form button:hover {
    background: var(--text-dark);
    color: var(--bg-dark);
}

body:not(.dark-mode) .contact-form button {
    border-color: var(--text-light);
    color: var(--text-light);
}

body:not(.dark-mode) .contact-form button:hover {
    background: var(--text-light);
    color: var(--bg-light);
}

.form-status {
    margin-top: 1rem;
    font-size: 0.9rem;
    min-height: 1.2em;
}

.experience-list,
.project-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.exp-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1rem;
}

.exp-company {
    font-weight: 500;
}

.exp-role {
    color: var(--accent-light);
    font-size: 0.9rem;
}

.dark-mode .exp-role {
    color: var(--accent-dark);
}

.exp-date {
    color: var(--accent-light);
    font-size: 0.85rem;
    margin-left: auto;
}

.dark-mode .exp-date {
    color: var(--accent-dark);
}

.project-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-decoration: none;
    color: inherit;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.dark-mode .project-item {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.project-item:hover {
    transform: translateX(4px);
}

.project-name {
    font-weight: 500;
}

.project-desc {
    font-size: 0.9rem;
    color: var(--accent-light);
}

.dark-mode .project-desc {
    color: var(--accent-dark);
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.skill-tag {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 4px;
    color: var(--accent-light);
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateY(10px);
}

.skill-tag.visible {
    opacity: 1;
    transform: translateY(0);
}

.dark-mode .skill-tag {
    background: rgba(255, 255, 255, 0.06);
    color: var(--accent-dark);
}

.skill-tag:hover {
    background: var(--highlight);
    color: #fff;
}
