/* ================================
   CSS Variables & Base — Black & White Minimal
   ================================ */
:root {
    --bg: #000000;
    --bg-alt: #0a0a0a;
    --card-bg: #111111;
    --text: #ffffff;
    --text-muted: #666666;
    --accent: #ffffff;
    --accent-secondary: #888888;
    --border: rgba(255,255,255,0.1);
    --shadow: rgba(0,0,0,0.7);
    --error: #ff4444;
    --success: #44ff44;
    --radius: 0.5rem;
    --transition: 0.3s ease;
}

[data-theme="light"] {
    --bg: #ffffff;
    --bg-alt: #f5f5f5;
    --card-bg: #fafafa;
    --text: #000000;
    --text-muted: #666666;
    --accent: #000000;
    --accent-secondary: #333333;
    --border: rgba(0,0,0,0.1);
    --shadow: 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, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

.section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    display: inline-block;
    width: 100%;
    letter-spacing: -0.02em;
}

.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: var(--accent);
    margin: 0.75rem auto 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.btn:hover {
    transform: translateY(-2px);
}

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

.btn-primary:hover {
    background: var(--text-muted);
    color: var(--text);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--bg);
}

.btn-full {
    width: 100%;
}

/* ================================
   Navigation
   ================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}

[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.8);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 0.5rem;
    transition: color var(--transition), background var(--transition);
}

.theme-toggle:hover {
    color: var(--accent);
    background: var(--bg-alt);
}

.icon-sun, .icon-moon {
    display: none;
}

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

.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    background: var(--text);
    height: 2px;
    width: 1.5rem;
    border-radius: 0;
    transition: all 0.3s ease-in-out;
}

.hamburger {
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
}

.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }

.nav-toggle.active .hamburger {
    background: transparent;
}

.nav-toggle.active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.nav-toggle.active .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
}

.nav-menu {
    position: fixed;
    top: 4rem;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: calc(100vh - 4rem);
    background: var(--card-bg);
    border-left: 1px solid var(--border);
    list-style: none;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: right 0.3s ease;
    z-index: 999;
}

.nav-menu.active {
    right: 0;
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition);
    position: relative;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
}

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

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

@media (min-width: 768px) {
    .nav-toggle { display: none; }
    .nav-menu {
        position: static;
        width: auto;
        height: auto;
        background: none;
        border: none;
        flex-direction: row;
        padding: 0;
        gap: 2rem;
    }
}

/* ================================
   Hero
   ================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding-top: 4rem;
}

/* Grid background */
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

[data-theme="light"] .hero-bg {
    background-image:
        linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
}

/* Floating blobs — white/gray */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.08;
    animation: float 10s infinite ease-in-out;
    z-index: -1;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #ffffff;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #888888;
    bottom: 50px;
    right: -50px;
    animation-delay: -2s;
    animation-duration: 12s;
}

.blob-3 {
    width: 200px;
    height: 200px;
    background: #cccccc;
    top: 40%;
    left: 60%;
    animation-delay: -4s;
    animation-duration: 8s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

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

.hero-greeting {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-name {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 1.25rem;
    color: var(--text);
    letter-spacing: -0.03em;
}

.hero-tagline {
    font-size: 1.35rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    min-height: 2.5rem;
    font-weight: 400;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--accent);
    animation: blink 1s step-end infinite;
    margin-left: 3px;
    vertical-align: text-bottom;
}

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

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

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    animation: bounce 2s infinite;
    cursor: pointer;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

@media (min-width: 768px) {
    .hero-name { font-size: 5rem; }
    .hero-tagline { font-size: 1.75rem; }
}

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

.about-image {
    display: flex;
    justify-content: center;
}

.image-wrapper {
    position: relative;
    width: 280px;
    height: 280px;
}

.image-wrapper::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 1.5rem;
    background: var(--accent);
    z-index: -1;
    opacity: 0.15;
    transform: rotate(6deg);
    transition: transform var(--transition), opacity var(--transition);
}

.image-wrapper:hover::before {
    transform: rotate(0deg);
    opacity: 0.25;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    background: var(--card-bg);
    border-radius: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.about-text h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.7;
}

@media (min-width: 768px) {
    .about-content {
        grid-template-columns: 1fr 2fr;
    }
}

/* ================================
   Skills
   ================================ */
.skills-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

.skill-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.skill-card:hover::before {
    opacity: 0.5;
}

[data-theme="light"] .skill-card:hover {
    border-color: rgba(0,0,0,0.15);
    box-shadow: 0 10px 40px rgba(0,0,0,0.06);
}

.skill-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    background: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
    margin-bottom: 1rem;
}

.skill-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.skill-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.progress-bar {
    height: 3px;
    background: var(--bg-alt);
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--text);
    width: 0;
    transition: width 1.5s ease-out;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, transparent, var(--text));
    opacity: 0.5;
}

@media (min-width: 640px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ================================
   Projects
   ================================ */
.projects-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

[data-theme="light"] .project-card:hover {
    border-color: rgba(0,0,0,0.15);
    box-shadow: 0 20px 50px rgba(0,0,0,0.08);
}

.project-image {
    height: 200px;
    overflow: hidden;
}

.project-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    transition: transform 0.5s ease;
}

[data-theme="light"] .project-placeholder {
    color: rgba(0,0,0,0.5);
}

.project-card:hover .project-placeholder {
    transform: scale(1.05);
}

/* Monochrome project placeholders */
.mono-1 { background: #1a1a1a; }
.mono-2 { background: #222222; }
.mono-3 { background: #2a2a2a; }

[data-theme="light"] .mono-1 { background: #e8e8e8; }
[data-theme="light"] .mono-2 { background: #e0e0e0; }
[data-theme="light"] .mono-3 { background: #d8d8d8; }

.project-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.project-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    flex: 1;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-tags span {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: var(--bg-alt);
    color: var(--text-muted);
    border: 1px solid var(--border);
    letter-spacing: 0.02em;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.link-primary {
    font-weight: 600;
    color: var(--text);
    transition: color var(--transition);
    position: relative;
}

.link-primary::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--text);
    transition: width var(--transition);
}

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

.link-secondary {
    font-weight: 600;
    color: var(--text-muted);
    transition: color var(--transition);
}

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

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ================================
   Experience / Timeline
   ================================ */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 3rem;
}

.timeline-dot {
    position: absolute;
    left: 14px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--text-muted);
    z-index: 1;
    transition: border-color var(--transition), transform var(--transition);
}

.timeline-item:hover .timeline-dot {
    border-color: var(--accent);
    transform: scale(1.2);
}

.timeline-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all var(--transition);
}

.timeline-content:hover {
    transform: translateX(5px);
    border-color: rgba(255,255,255,0.15);
}

[data-theme="light"] .timeline-content:hover {
    border-color: rgba(0,0,0,0.12);
}

.timeline-date {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.timeline-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.timeline-content h4 {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.timeline-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .timeline::before {
        left: 50%;
        transform: translateX(-50%);
    }
    .timeline-item {
        width: 50%;
        padding-left: 0;
    }
    .timeline-item:nth-child(odd) {
        left: 0;
        padding-right: 40px;
        text-align: right;
    }
    .timeline-item:nth-child(even) {
        left: 50%;
        padding-left: 40px;
    }
    .timeline-dot {
        left: auto;
        right: -7px;
        top: 20px;
    }
    .timeline-item:nth-child(even) .timeline-dot {
        left: -7px;
        right: auto;
    }
    .timeline-item:nth-child(odd) .timeline-content:hover {
        transform: translateX(-5px);
    }
    .timeline-item:nth-child(even) .timeline-content:hover {
        transform: translateX(5px);
    }
}

/* ================================
   Contact
   ================================ */
.contact-content {
    display: grid;
    gap: 3rem;
}

.contact-info h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.contact-info > p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.contact-item svg {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color var(--transition);
}

.contact-item:hover svg {
    color: var(--accent);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 42px;
    height: 42px;
    border-radius: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition);
}

.social-links a:hover {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
    transform: translateY(-3px);
}

.contact-form {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.05);
}

[data-theme="light"] .form-group input:focus,
[data-theme="light"] .form-group textarea:focus {
    box-shadow: 0 0 0 2px rgba(0,0,0,0.05);
}

.form-group input.error,
.form-group textarea.error {
    border-color: var(--error);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.form-status {
    margin-top: 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    min-height: 1.5rem;
}

@media (min-width: 768px) {
    .contact-content {
        grid-template-columns: 1fr 1.5fr;
    }
}

/* ================================
   Footer
   ================================ */
.footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-content p:first-child {
    margin-bottom: 0.5rem;
}

/* ================================
   Back to Top
   ================================ */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

/* ================================
   Scroll Animations
   ================================ */
.hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* ================================
   Selection
   ================================ */
::selection {
    background: var(--text);
    color: var(--bg);
}
