/* ----------------------------------------
   CSS Variables & Base Styles
---------------------------------------- */
:root {
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --card-bg: #1e293b;
    --border: #334155;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

[data-theme="light"] {
    --bg: #f8fafc;
    --bg-secondary: #e2e8f0;
    --text: #0f172a;
    --text-muted: #475569;
    --accent: #0284c7;
    --accent-hover: #0369a1;
    --card-bg: #ffffff;
    --border: #cbd5e1;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

a {
    color: var(--accent);
    text-decoration: none;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 8%;
    position: sticky;
    top: 0;
    background-color: var(--bg);
    z-index: 100;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s;
}

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

/* Theme Toggle */
#theme-toggle {
    position: fixed;
    top: 1.2rem;
    right: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

#theme-toggle:hover {
    transform: scale(1.1);
}

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

/* Hero Section */
#hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 85vh;
    padding: 2rem 8%;
    gap: 2rem;
}

.hero-content {
    flex: 1;
}

.greeting {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.typing-container {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.cursor {
    animation: blink 1s step-end infinite;
    color: var(--accent);
    font-weight: 300;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-subtitle {
    max-width: 500px;
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

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

.btn {
    padding: 0.75rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.btn-primary {
    background: var(--accent);
    color: #0f172a;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn-secondary:hover {
    background: var(--accent);
    color: #0f172a;
}

/* Code Card */
.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
}

.code-card {
    background: #1e293b;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    max-width: 400px;
    color: #e2e8f0;
}

.code-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
}

.code-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #f87171;
}

.code-dots span:nth-child(2) {
    background: #fbbf24;
}

.code-dots span:nth-child(3) {
    background: #4ade80;
}

pre {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.keyword { color: #c084fc; }
.var { color: #67e8f9; }
.prop { color: #fde047; }
.string { color: #86efac; }
.func { color: #38bdf8; }

/* Section Titles */
section {
    padding: 5rem 8%;
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 2.5rem;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent);
    margin: 0.8rem auto 0;
    border-radius: 2px;
}

/* About */
.about-grid {
    display: flex;
    gap: 3rem;
    align-items: center;
    flex-wrap: wrap;
}

.about-text {
    flex: 2;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.about-text strong {
    color: var(--accent);
}

.stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.stat-item {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: var(--card-bg);
    padding: 1.8rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.skill-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    margin-top: 1rem;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 1s ease-out;
}

/* Contact */
#contact {
    background: var(--bg-secondary);
    text-align: center;
}

.contact-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input, textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
}

input:focus, textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.form-feedback {
    margin-top: 1rem;
    font-weight: 600;
    padding: 0.5rem;
    border-radius: 6px;
}

.form-feedback.success {
    color: #16a34a;
    background: #dcfce7;
}

.form-feedback.error {
    color: #b91c1c;
    background: #fee2e2;
}

.hidden {
    display: none;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 8%;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

.social-links {
    margin-top: 0.8rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 1.5rem;
}

/* Back to Top */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent);
    color: #0f172a;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
    box-shadow: var(--shadow);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    transform: scale(1.1);
}
