/* ============================================
   Design Tokens
   ============================================ */
:root {
    --background: #0a0a0b;
    --surface: #131316;
    --surface-hover: #1a1a1f;
    --border: #26262c;
    --foreground: #f4f4f5;
    --muted: #9d9da8;
    --primary: #3a86ff;
    --primary-hover: #5d9bff;
    --primary-foreground: #ffffff;
    --radius: 10px;
    --transition: all 0.25s ease;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* ============================================
   Reset & Base
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: var(--background);
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--foreground);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
}

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

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

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

button {
    font-family: inherit;
}

/* ============================================
   Utilities
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -48px;
    left: 16px;
    z-index: 200;
    padding: 10px 16px;
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-radius: var(--radius);
    font-weight: 600;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 12px;
    color: var(--primary-foreground);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 0.95rem;
}

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

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

.btn-ghost {
    background-color: transparent;
    color: var(--foreground);
    border-color: var(--border);
}

.btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.section-padding {
    padding: 96px 0;
}

.section-head {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 12px;
    position: relative;
    display: inline-block;
    text-wrap: balance;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -10px;
    width: 48px;
    height: 3px;
    border-radius: 2px;
    background: var(--primary);
}

.section-sub {
    color: var(--muted);
    margin-top: 20px;
}

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

/* ============================================
   Header
   ============================================ */
header {
    background-color: rgba(10, 10, 11, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
}

.logo {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--foreground);
}

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

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-links a {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 12px;
    border-radius: 6px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--foreground);
    background-color: var(--surface-hover);
}

.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
}

.bar {
    display: block;
    width: 24px;
    height: 2px;
    margin: 5px auto;
    transition: var(--transition);
    background-color: var(--foreground);
}

.hamburger.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   Hero
   ============================================ */
#hero {
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding-top: 80px;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
}

.hero-text {
    flex: 1;
    max-width: 640px;
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--primary);
    margin-bottom: 16px;
}

.hero-text h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.15;
    margin-bottom: 20px;
    text-wrap: balance;
}

.hero-lead {
    margin-bottom: 32px;
    font-size: 1.1rem;
    color: var(--muted);
    text-wrap: pretty;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-image {
    flex-shrink: 0;
}

.hero-image img {
    width: 280px;
    height: 280px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--border);
    transition: var(--transition);
}

.hero-image img:hover {
    border-color: var(--primary);
    transform: scale(1.03);
}

.social-icons {
    display: flex;
    gap: 20px;
    margin-top: 36px;
}

.social-icons a {
    font-size: 1.35rem;
    color: var(--muted);
}

.social-icons a:hover {
    color: var(--primary);
}

/* ============================================
   About
   ============================================ */
#about {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.about-content {
    display: flex;
    align-items: flex-start;
    gap: 48px;
}

.about-image {
    flex-shrink: 0;
    position: sticky;
    top: 100px;
}

.about-image img {
    width: 360px;
    height: 460px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.about-text {
    flex: 1;
}

.about-text h3 {
    font-size: 1.6rem;
    margin-bottom: 16px;
}

.about-text p {
    margin-bottom: 16px;
    color: var(--muted);
}

.skills {
    margin-top: 32px;
}

.skills h3 {
    margin-bottom: 20px;
}

.skill-item {
    margin-bottom: 18px;
}

.skill-title {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.skill-title span:last-child {
    font-family: var(--font-mono);
    color: var(--muted);
    font-weight: 400;
}

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

.skill-progress {
    width: var(--skill, 0%);
    height: 100%;
    border-radius: 4px;
    background-color: var(--primary);
    transition: width 1s ease-out;
}

/* ============================================
   Services
   ============================================ */
.services-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.service-card {
    background-color: var(--surface);
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
}

.service-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.service-card p {
    color: var(--muted);
    font-size: 0.95rem;
}

/* ============================================
   Projects
   ============================================ */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

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

.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
}

.project-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.project-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-info h3 {
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.project-info > p {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

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

.project-tag {
    font-family: var(--font-mono);
    background-color: var(--surface-hover);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
}

.project-links {
    display: flex;
    gap: 20px;
    margin-top: auto;
}

.project-links a {
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================
   Contact
   ============================================ */
#contact {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
}

.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.contact-item i {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background-color: var(--surface-hover);
    border: 1px solid var(--border);
    color: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.contact-details h4 {
    margin-bottom: 2px;
    font-size: 0.95rem;
}

.contact-details p,
.contact-details a {
    color: var(--muted);
    font-size: 0.9rem;
    word-break: break-word;
}

.contact-details a:hover {
    color: var(--primary);
}

.contact-form {
    background-color: var(--background);
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 18px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--foreground);
    transition: border-color 0.2s ease;
}

.form-control::placeholder {
    color: var(--muted);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.form-control.error {
    border-color: #ff5470;
}

.form-error {
    display: block;
    color: #ff5470;
    font-size: 0.8rem;
    margin-top: 6px;
}

textarea.form-control {
    height: 140px;
    resize: none;
}

/* ============================================
   Notification & Back to Top
   ============================================ */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 14px 20px;
    background-color: var(--surface-hover);
    border: 1px solid var(--primary);
    color: var(--foreground);
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9rem;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    animation: slideIn 0.3s ease-out;
    max-width: 320px;
}

.notification.hiding {
    animation: slideOut 0.3s ease-out forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--primary-foreground);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    z-index: 99;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
}

/* ============================================
   Scroll Reveal
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   Footer
   ============================================ */
footer {
    background-color: var(--background);
    border-top: 1px solid var(--border);
    color: var(--muted);
    padding: 48px 0;
    text-align: center;
}

footer .logo {
    font-size: 1.25rem;
}

footer p {
    margin-top: 8px;
    font-size: 0.95rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    list-style: none;
    margin: 24px 0;
}

.footer-links a {
    color: var(--muted);
    padding: 6px 12px;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--foreground);
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 8px 0 24px;
}

.footer-social a {
    color: var(--muted);
    font-size: 1.2rem;
}

.footer-social a:hover {
    color: var(--primary);
}

.footer-copy {
    font-size: 0.85rem;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 992px) {
    .hero-content,
    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        flex-direction: column-reverse;
        justify-content: center;
    }

    .hero-image img {
        width: 200px;
        height: 200px;
    }

    .hero-actions,
    .social-icons {
        justify-content: center;
    }

    .about-image {
        position: static;
        margin: 0 auto;
    }

    .about-image img {
        width: 100%;
        max-width: 360px;
        height: auto;
    }

    .skill-title {
        text-align: left;
    }
}

@media (max-width: 768px) {
    .section-padding {
        padding: 64px 0;
    }

    .hamburger {
        display: block;
    }

    .nav-links {
        position: fixed;
        left: -100%;
        top: 65px;
        flex-direction: column;
        gap: 0;
        background-color: var(--background);
        border-bottom: 1px solid var(--border);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease;
        padding: 16px 0;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        margin: 8px 0;
    }
}
