/* Starfield canvas behind content */
#starfield {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    pointer-events: none;
    opacity: 1;
    background: none;
    mix-blend-mode: normal;
    display: block;
}
:root{
        --bg:#000000;
        --card:#0a0a0a;
        --accent:#7dd3fc;
        --muted:rgba(255,255,255,0.72);
}
body {
    margin:0;
    font-family:'Poppins',Inter,system-ui,-apple-system,Segoe UI,Roboto,'Helvetica Neue',Arial;
    color:#e6eef8;
    background:linear-gradient(180deg,#000000 0%, #040404 100%);
    min-height:100vh;
    user-select: none;
}

/* Top navigation */
.topnav{position:sticky;top:0;z-index:40;background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));backdrop-filter: blur(6px);box-shadow:0 6px 18px rgba(2,6,23,0.6)}
.container{max-width:1100px;margin:0 auto;padding:10px 20px;display:flex;align-items:center;gap:12px}
.social-link .social-icon {
    display: inline-flex;
    width: 24px;
    height: 24px;
    filter: brightness(0) saturate(100%) invert(78%) sepia(6%) saturate(164%) hue-rotate(178deg) brightness(93%) contrast(88%);
}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--accent);font-weight:600}
.brand img.logo{width:36px;height:36px;border-radius:8px;display:inline-block;object-fit:cover}

/* make the brand text (your name) white for better contrast */
.brand > span{color:#ffffff;font-weight:600}
nav{margin-left:auto;display:flex;align-items:center;gap:18px}
.nav-links{display:flex;gap:12px;align-items:center}
.nav-links a{color:var(--muted);text-decoration:none;padding:8px 10px;border-radius:8px;transition:all .18s ease;font-weight:500}
.nav-links a:hover, .nav-links a:focus{color:#fff;background:rgba(255,255,255,0.03);transform:translateY(-2px)}

/* Language selector */
.lang-switch{display:flex;gap:6px;border-radius:8px;padding:6px;background:transparent}
.lang-btn{border:1px solid transparent;background:transparent;color:var(--muted);padding:6px 8px;border-radius:6px;cursor:pointer;transition:all .12s ease}
.lang-btn[aria-pressed="true"]{background:linear-gradient(90deg, rgba(125,211,252,0.12), rgba(6,182,212,0.06));color:var(--accent);border-color:rgba(125,211,252,0.18);box-shadow:0 6px 14px rgba(7,18,36,0.6)}

/* Mobile */
.menu-toggle{display:none;background:transparent;border:0;color:var(--muted);font-size:20px;cursor:pointer}
@media (max-width:720px){
    .nav-links{position:fixed;right:12px;top:64px;background:rgba(2,6,23,0.9);backdrop-filter:blur(8px);flex-direction:column;padding:12px;border-radius:10px;display:none}
    .nav-links.show{display:flex}
    .menu-toggle{display:inline-block;margin-left:8px}
}

/* small page content so menu can be seen */
/* starfield canvas behind content */


/* center main (hero) content vertically and horizontally below the header */
/* header height is approximate; calc accounts for sticky top nav */
main{position:relative;z-index:1;max-width:1100px;margin:0 auto;min-height:calc(100vh - 72px);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 20px 20px;color:var(--muted);text-align:center}
h1{color:#fff;margin:0 0 12px}
section{margin-top:48px;margin-bottom:48px;}
section:first-of-type{margin-top:0;}
section:last-of-type{margin-bottom:0;}
.about-section {
    margin-top: clamp(68px, 10vw, 110px);
    margin-bottom: clamp(88px, 12vw, 120px);
}
.portfolio-section {
    margin-top: clamp(88px, 12vw, 120px);
}

.scroll-top-btn {
    position: fixed;
    right: clamp(16px, 5vw, 36px);
    bottom: clamp(20px, 6vw, 40px);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #f1f5f9;
    font-size: 1.4rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    box-shadow: none;
    z-index: 50;
}
.scroll-top-btn:hover,
.scroll-top-btn:focus {
    transform: translateY(-2px);
    box-shadow: none;
    outline: none;
}
.scroll-top-btn span {
    pointer-events: none;
}
.scroll-top-btn.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    box-shadow: none;
}
@media (max-width: 720px) {
    .scroll-top-btn {
        right: 16px;
        bottom: 18px;
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }
}

.social-links {
    margin-top: 24px;
    display: inline-flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.12);
    color: #f8fafc;
    background: rgba(15, 23, 42, 0.55);
    text-decoration: none;
    font-size: 0.95rem;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.5);
}
.social-link:hover,
.social-link:focus {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.28);
    box-shadow: 0 18px 30px rgba(2, 6, 23, 0.6);
    outline: none;
}

.projects {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    list-style: none;
    padding: 0;
    margin: 32px 0 0 0;
}
.skills-section {
    width: 100%;
}
.skills-section h2 {
    color: #fff;
    margin-bottom: 12px;
}
.skills-section p {
    margin: 0;
    color: var(--muted);
}
.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 24px;
    list-style: none;
    padding: 0;
    margin: 32px 0 0 0;
}
.skill-card {
    background: var(--card);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 2px 16px rgba(0,0,0,0.45);
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: transform .18s ease, box-shadow .18s ease;
}
.skill-name {
    font-size: 1rem;
}
.skill-rating {
    display: inline-flex;
    gap: 4px;
    font-size: 1.1rem;
}
.star {
    color: rgba(226, 232, 240, 0.28);
}
.star.filled {
    color: var(--accent);
}
.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;
}
.skill-card:hover,
.skill-card:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(2,6,23,0.55);
}
.project {
    background: var(--card);
    border-radius: 14px;
    box-shadow: 0 2px 16px #0003;
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: box-shadow .18s;
}
.project img {
    width: 100%;
    max-width: 180px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 2px 12px #0002;
    margin-bottom: 10px;
    transition: transform .18s cubic-bezier(.4,1.4,.6,1);
    cursor: pointer;
}
.project div {
    margin-top: 6px;
    color: #fff;
    font-size: 1rem;
}
.project:hover {
    box-shadow: 0 6px 32px #0006;
}
.project:hover img {
    transform: scale(1.08);
}

.contact-section {
    margin-top: 48px;
    width: 100%;
    max-width: 760px;
    background: var(--card);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.55);
    padding: clamp(28px, 6vw, 48px) clamp(22px, 6vw, 56px);
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(18px, 4vw, 28px);
    text-align: center;
}
.contact-section > h1 {
    font-size: clamp(1.9rem, 2.8vw, 2.6rem);
    margin: 0;
    color: #fff;
}
.contact-section > p {
    color: var(--muted);
    margin: 0;
    max-width: 520px;
}
.contact-form {
    display: grid;
    gap: clamp(18px, 4vw, 26px);
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    text-align: center;
}
.contact-form .form-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: rgba(12, 12, 20, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: clamp(18px, 4vw, 24px);
    box-shadow: 0 6px 24px rgba(2, 6, 23, 0.45);
}
.contact-form label {
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #ffffff;
    text-align: center;
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    max-width: 420px;
    background: #04060e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 16px 18px;
    color: #f8fafc;
    font-size: 1rem;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
    resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: rgba(248, 250, 252, 0.75);
    box-shadow: 0 0 0 4px rgba(248, 250, 252, 0.12);
    transform: translateY(-1px);
}
.contact-form textarea {
    min-height: 180px;
}
.contact-form .form-status {
    font-size: 0.94rem;
    color: rgba(226, 232, 240, 0.7);
    margin: -4px 0 0;
    text-align: center;
}
.contact-form .btn {
    justify-self: center;
    background: linear-gradient(120deg, rgba(248, 250, 252, 0.9), rgba(226, 232, 240, 0.85));
    color: #05070c;
    font-weight: 600;
    border: none;
    border-radius: 14px;
    padding: 14px 34px;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
    box-shadow: 0 14px 28px rgba(15, 118, 204, 0.34);
}
.contact-form .btn:hover,
.contact-form .btn:focus {
    transform: translateY(-2px);
    box-shadow: 0 22px 40px rgba(15, 15, 21, 0.5);
    outline: none;
}
.contact-form .btn:disabled {
    cursor: progress;
    opacity: 0.75;
    transform: none;
    box-shadow: 0 10px 20px rgba(15, 15, 21, 0.3);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: rgba(226, 232, 240, 0.45);
}

.site-footer {
    margin-top: clamp(36px, 6vw, 56px);
    padding: 24px 16px 32px;
    text-align: center;
    color: rgba(226, 232, 240, 0.55);
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}
.site-footer small {
    display: inline-flex;
    gap: 6px;
    align-items: baseline;
}
.site-footer::before {
    content: "";
    display: block;
    width: clamp(120px, 18vw, 160px);
    height: 1px;
    margin: 0 auto 16px;
    background: linear-gradient(90deg, rgba(226,232,240,0), rgba(226,232,240,0.35), rgba(226,232,240,0));
}

.modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s;
}
.modal.show {
    opacity: 1;
    pointer-events: auto;
}
.modal img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 16px;
    box-shadow: 0 8px 32px #000a;
}
.modal-close {
    position: absolute;
    top: 32px;
    right: 48px;
    color: #fff;
    font-size: 2.2rem;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1010;
    transition: color .18s;
}
.modal-close:hover {
    color: var(--accent);
}

@media (max-width: 900px) {
    .projects {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .projects {
        grid-template-columns: 1fr;
    }
}
.skills-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
}
@media (max-width: 600px) {
    .skills-grid {
        grid-template-columns: 1fr;
    }
}

/* footer socials removed */

/* ensure main doesn't get overlapped by fixed footer */
@media (min-width:0){
    main{padding-bottom:140px}
}

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

.modal.show {
    display: flex;
}

.modal img,
.modal model-viewer,
.modal canvas {
    max-width: 70%;
    max-height: 70%;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
}

/* Allow text selection in form elements */
input, textarea, select {
    user-select: text;
}

/* Center project titles */
.project > div {
    text-align: center;
}
