:root {
    --bg: #0b0c0e;
    --bg-elev: #15171a;
    --border: #1f2329;
    --text: #e6e8eb;
    --muted: #a1a7b0;
    --accent: #8ab4f8;
    --white: #ffffff;
}

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

html {
    scroll-behavior: smooth;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 72px; /* space for fixed nav */
}
a {
    color: var(--accent);
    text-decoration: none;
}
a:hover {
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
section {
    padding: 80px 20px;
    scroll-margin-top: 88px;
}
section h2 {
    font-weight: 500;
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 2.5rem;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: saturate(160%) blur(10px);
    background: rgba(13, 15, 19, 0.65);
    border-bottom: 1px solid var(--border);
}
.nav-container {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center; /* center the nav links group */
    width: 100%;
}
.nav-logo {
    position: absolute;
    left: 2rem;              /* requested 2rem from left */
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}
.nav-logo h2 {
    color: var(--white);
    font-size: 1.25rem;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.25rem;
    justify-self: center;
}
.nav-link {
    color: var(--text);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
}

.hero {
    min-height: calc(100vh - 72px);
    display: grid;
    place-items: center;
    text-align: center;
    background: radial-gradient(
        80% 120% at 50% 0%,
        #0f1116 0%,
        #0b0c0e 60%,
        #111c36 100%
    );
}
.hero-content {
    max-width: 820px;
    padding: 0 20px;
}
.hero h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.15;
    margin-bottom: 0.75rem;
    font-weight: 600;
}
.hero-subtitle {
    font-size: 1.15rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}
.hero p {
    color: var(--muted);
    margin-bottom: 1.5rem;
}
.hero-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 8px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--text);
    transition: transform 0.15s ease, background-color 0.2s ease,
        border-color 0.2s ease;
}
.btn:hover {
    transform: translateY(-1px);
    border-color: #2a2f36;
}
.btn-primary {
    background: var(--white);
    color: #0b0c0e;
    border-color: transparent;
}
.btn-primary:hover {
    background: #e9eef7;
}
.btn-secondary {
    background: transparent;
    border-color: #2a2f36;
    color: var(--white);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
}
.btn-small {
    padding: 8px 14px;
    font-weight: 600;
}

/* Button icon */
.btn-icon {
    display: inline-block;
    margin-right: 4px;
    font-size: 1.1em;
    transition: transform 0.3s ease;
}

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

/* About */
.about {
    background: transparent;
}
.about .about-content {
    display: grid;
    grid-template-columns: 260px 1.4fr 1fr; /* photo | text | skills */
    gap: 72px;
    align-items: center;
}
.about-photo {
    position: relative;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--border);
    background: radial-gradient(circle at 30% 30%, #1e2530, #101317 70%);
    box-shadow: 0 4px 18px -4px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
    transition: transform 0.5s cubic-bezier(.4,.15,.2,1), box-shadow 0.4s ease;
}
.about-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 65% 35%, rgba(255,255,255,0.08), transparent 60%);
    pointer-events: none;
}
.about-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 5%; /* move visible area slightly down */
    display: block;
    filter: saturate(1.05) contrast(1.05);
    transition: transform 0.6s cubic-bezier(.25,.6,.3,1), filter 0.4s ease;
}
.about-photo:hover img,
.about-photo:focus-within img {
    transform: scale(1.08);
    filter: saturate(1.15) contrast(1.1);
}
.about-photo:hover,
.about-photo:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px -6px rgba(0,0,0,0.65), 0 0 0 1px rgba(138,180,248,0.25);
}
.about-photo:focus-within img { outline: none; }
.about-photo img { border: none; }

/* If image missing, show initials placeholder */
.about-photo:not(:has(img[src]))::before,
.about-photo img[src=""] + ::before {
    content: "DW";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--muted);
    background: linear-gradient(135deg, #1b2431, #0f141c);
}
.about .about-text p {
    color: var(--muted);
    font-size: 1.05rem;
    margin-bottom: 1rem;
}
.skills h3 {
    margin-bottom: 0.75rem;
    font-weight: 600;
}
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.skill-tag {
    background: #1f2329;
    color: var(--text);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.9rem;
    border: 1px solid var(--border);
}

/* Projects */
.projects {
    background: transparent;
}
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}
.project-item {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                border-color 0.3s ease, 
                box-shadow 0.3s ease;
}
.project-link:hover .project-item {
    transform: translateY(-6px) scale(1.02);
    border-color: rgba(138, 180, 248, 0.4);
    box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.4), 
                0 0 0 1px rgba(138, 180, 248, 0.2);
}
.project-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    position: relative;
}
.project-link .project-item {
    height: 100%;
}
/* External link icon overlay */
.project-link::after {
    content: "↗";
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(138, 180, 248, 0.15);
    border: 1px solid rgba(138, 180, 248, 0.3);
    border-radius: 50%;
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: bold;
    opacity: 0;
    transform: translate(4px, -4px) scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}
.project-link:hover::after {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}
.project-image {
    height: 160px;
    display: grid;
    place-items: center;
    color: var(--white);
    background: linear-gradient(135deg, #22314c 0%, #141e30 60%, #0f1622 100%);
}
.placeholder-project {
    opacity: 0.9;
    font-weight: 600;
    font-size: 1.5rem;
}
.project-content {
    padding: 18px;
}
.project-content h3 {
    margin-bottom: 8px;
    font-weight: 600;
}
.project-content p {
    color: var(--muted);
    margin-bottom: 12px;
}
.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.project-tech span {
    background: #1f2329;
    color: var(--text);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
}
.project-links {
    display: flex;
    gap: 10px;
}

/* Contact */
.contact {
    background: transparent;
}
.contact .contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
}
.contact-info p {
    color: var(--muted);
    margin-bottom: 1rem;
}
.contact-methods {
    display: grid;
    gap: 14px;
}
.contact-method h4 {
    margin-bottom: 4px;
}
.contact-method a {
    color: var(--accent);
}
.contact-method a:hover {
    text-decoration: underline;
}

.contact-form {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}
.form-group {
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2a2f36;
    box-shadow: 0 0 0 3px rgba(138, 180, 248, 0.15);
}
.form-group textarea {
    resize: vertical;
    min-height: 140px;
}

/* Form message styling */
.form-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 500;
    text-align: center;
    animation: slideDown 0.3s ease;
}

.form-message.success {
    background: rgba(40, 167, 69, 0.15);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #4ade80;
}

.form-message.error {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #f87171;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    background: transparent;
    text-align: center;
    padding: 28px 0;
    color: var(--muted);
}
.footer p {
    margin-bottom: 6px;
}

/* Responsive */
@media (max-width: 900px) {
    .about .about-content {
        grid-template-columns: 1fr;
        gap: 32px;
        justify-items: center;
        text-align: center;
    }
    .about-photo {
        width: 200px;
        height: 200px;
        margin: 0 auto;
    }
    .skills h3 { text-align: center; }
    .skill-tags { justify-content: center; }
    .contact .contact-content {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}
@media (max-width: 700px) {
    .nav-container {
        height: auto;
        padding: 10px 20px;
        gap: 10px;
        flex-direction: column;
        align-items: center;
    }
    .nav-logo {
        position: static;
        left: auto;
        top: auto;
        transform: none;
        display: flex;
        align-items: center;
    }
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
}
@media (max-width: 480px) {
    section {
        padding: 64px 16px;
    }
    .hero h1 {
        font-size: clamp(1.75rem, 7vw, 2.25rem);
    }
    .btn {
        width: 100%;
    }
}
