/* =============================================================
   1. Reset & Variables
   ============================================================= */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

/* Re-enable selection only for interactive form fields */
.contact-form input,
.contact-form textarea {
    user-select: text;
    -webkit-user-select: text;
}

:root {
    --bg:           #080808;
    --bg-card:      #111111;
    --bg-hover:     #1a1a1a;
    --border:       #222222;
    --border-hover: #444444;
    --text:         #f0f0f0;
    --text-muted:   #888888;
    --accent:       #d4d4d4;
    --white:        #ffffff;
    --nav-height:   72px;
}

/* =============================================================
   2. Base / Typography
   ============================================================= */
html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
    background-color: var(--bg);
    min-height: 100%;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'JetBrains Mono', 'Space Grotesk', 'Inter', monospace;
    background: transparent;
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
}

#star-canvas {
    max-width: 100%;
}

h1, h2, h3, h4 {
    color: var(--white);
    font-weight: 700;
    line-height: 1.2;
}

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

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

/* =============================================================
   3. Layout
   ============================================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

section {
    padding: 96px 0;
}

/* =============================================================
   4. Navigation
   ============================================================= */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(8, 8, 8, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.nav-logo {
    height: 44px;
    width: auto;
    max-width: 180px;
    flex-shrink: 0;
    display: block;
    filter: grayscale(1) invert(1);
    opacity: 0.9;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    padding: 0;
}

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

.nav-link[data-dropdown]::after {
    content: ' ▾';
    font-size: 0.7rem;
    opacity: 0.5;
}

/* Projects dropdown */
.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 16px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 180px;
    padding: 6px 0;
    z-index: 100;
}

@media (hover: hover) {
    .nav-item:hover .nav-dropdown {
        display: block;
    }
}

.nav-item.open .nav-dropdown {
    display: block;
}

.nav-dropdown a {
    display: block;
    padding: 8px 16px;
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: color 0.15s, background 0.15s;
}

.nav-dropdown a:hover {
    color: var(--white);
    background: var(--bg-hover);
}

.nav-dropdown-disabled {
    display: block;
    padding: 8px 16px;
    font-size: 0.875rem;
    color: #444;
    cursor: default;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.2s;
}

/* =============================================================
   5. Star Field Canvas
   ============================================================= */
#star-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* =============================================================
   6. Hero
   ============================================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--nav-height);
    background: transparent;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.hero-content {
    flex: 1;
}

.hero-title {
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 800;
    cursor: default;
    color: var(--white);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    font-weight: 400;
    min-height: 2rem;
    cursor: default;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.8;
    max-width: 480px;
    cursor: default;
}

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

.hero-image {
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    line-height: 0;
    border: 3px solid #333;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.hero-image:hover {
    border-color: #888;
    box-shadow: 0 0 0 4px rgba(180,180,180,0.12), 0 12px 40px rgba(0,0,0,0.5);
}

.profile-photo {
    width: 360px;
    height: 360px;
    border-radius: 50%;
    object-fit: cover;
    border: none;
    background: transparent;
    transition: transform 0.3s;
    display: block;
}

.hero-image:hover .profile-photo {
    transform: scale(1.04);
}

/* =============================================================
   7. Buttons
   ============================================================= */
.btn {
    display: inline-block;
    padding: 11px 24px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}

.btn:active {
    transform: scale(0.97) !important;
}

.btn-primary {
    background: var(--white);
    color: #080808;
}

.btn-primary:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.08);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 1.5px solid var(--border-hover);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Prevent text-insertion caret on decorative/heading elements */
h1, h2, h3, h4,
.hero-title, .hero-subtitle, .section-title, .section-line,
.stat h3, .stat p,
.project-label, .project-title, .project-tagline,
.skill-category h3, .promo-banner {
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
}

/* =============================================================
   8. Section Titles
   ============================================================= */
.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    cursor: default;
    color: var(--white);
    text-align: center;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.section-line {
    width: 48px;
    height: 1px;
    background: var(--border-hover);
    margin: 0 auto 3rem auto;
}

/* =============================================================
   9. About Section
   ============================================================= */
.about {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

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

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.stat {
    padding: 1.25rem;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s, transform 0.2s, background 0.2s, box-shadow 0.2s;
    text-align: center;
    cursor: default;
}

.stat:hover {
    border-color: var(--border-hover);
    background: #222;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.stat h3 {
    font-size: 1.75rem;
    font-weight: 800;
    cursor: default;
    color: var(--white);
    margin-bottom: 0.2rem;
}

.stat p {
    font-size: 0.82rem;
    color: var(--text-muted);
    cursor: default;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.about-photo {
    width: 400px;
    height: 400px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.about-photo:hover {
    border-color: var(--border-hover);
    transform: scale(1.03);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

/* =============================================================
   10. Promo Banner (Owen's Linktree)
   ============================================================= */
.promo-banner {
    background: var(--bg-hover);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
}

.promo-banner p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.promo-banner a {
    color: var(--accent);
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.promo-banner a:hover {
    border-color: var(--accent);
}

/* =============================================================
   11. Projects Section
   ============================================================= */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

.project-card:not(.coming-soon):hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
}

.project-card.coming-soon {
    border-style: dashed;
    opacity: 0.5;
    pointer-events: none;
}

.project-image {
    height: 180px;
    overflow: hidden;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.project-card:not(.coming-soon):hover .project-photo {
    transform: scale(1.04);
}

.project-image img:not(.project-photo) {
    transition: transform 0.3s, opacity 0.3s, filter 0.3s;
}

.project-card:not(.coming-soon):hover .project-image img:not(.project-photo) {
    transform: scale(1.08);
    opacity: 1;
    filter: grayscale(1) invert(1) brightness(1.4);
}

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

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

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

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.tech-tag {
    background: var(--bg-hover);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 2px 9px;
    border-radius: 4px;
    font-size: 0.77rem;
    font-weight: 500;
}

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

.project-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.project-link:hover {
    border-color: var(--accent);
}

.project-link.disabled {
    color: var(--text-muted);
    pointer-events: none;
    opacity: 0.5;
}

/* =============================================================
   12. Skills Section
   ============================================================= */
.skills {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.skill-category {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2rem;
    transition: border-color 0.2s;
}

.skill-category:hover {
    border-color: var(--border-hover);
}

.skill-category h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.25rem;
    text-align: center;
}

.skill-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.875rem 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s, transform 0.2s;
    text-align: center;
}

.skill-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.skill-item i {
    font-size: 1.4rem;
    color: var(--accent);
}

.custom-icon {
    width: 1.4rem;
    height: 1.4rem;
    color: var(--accent);
}

.skill-item span {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* =============================================================
   13. Contact Section
   ============================================================= */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

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

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

.contact-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s, transform 0.2s, background 0.2s;
    cursor: pointer;
    color: inherit;
}

.contact-method:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
    transform: translateY(-3px);
}

.contact-method i {
    font-size: 1.1rem;
    color: var(--accent);
    width: 20px;
    flex-shrink: 0;
}

.contact-method-text h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}

.contact-method-text p,
.contact-method-text a {
    font-size: 0.9rem;
    color: var(--text);
}

.contact-method-text a:hover {
    color: var(--white);
}

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

.social-link {
    width: 42px;
    height: 42px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

.social-link:hover {
    color: var(--white);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
    cursor: text;
}

.form-group input:hover,
.form-group textarea:hover {
    border-color: var(--border-hover);
    background: #222;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #1a1a1a;
    transform: translateY(-2px);
}

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

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

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

/* =============================================================
   15. Notification
   ============================================================= */
.notification {
    position: fixed;
    top: calc(var(--nav-height) + 16px);
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-hover);
    background: var(--bg-card);
    z-index: 10000;
    max-width: 380px;
    animation: slideInRight 0.25s ease-out;
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.notification-message {
    font-size: 0.875rem;
    color: var(--text);
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    font-family: inherit;
}

.notification-close:hover {
    color: var(--white);
}

/* =============================================================
   16. Animations
   ============================================================= */
@keyframes slideInRight {
    from { transform: translateX(calc(100% + 20px)); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
    0%   { opacity: 0; transform: scale(0.88) translateY(20px); }
    70%  { transform: scale(1.03) translateY(-3px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

[data-anim] {
    opacity: 0;
    transform: translateY(28px);
}

.animate-in[data-anim="fade"] {
    animation: fadeSlideUp 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-in[data-anim="pop"] {
    animation: popIn 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-in[data-anim="stagger"] { animation: fadeSlideUp 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.animate-in[data-anim="stagger"]:nth-child(1) { animation-delay: 0.05s; }
.animate-in[data-anim="stagger"]:nth-child(2) { animation-delay: 0.15s; }
.animate-in[data-anim="stagger"]:nth-child(3) { animation-delay: 0.25s; }
.animate-in[data-anim="stagger"]:nth-child(4) { animation-delay: 0.35s; }

@media (prefers-reduced-motion: reduce) {
    [data-anim],
    .animate-in[data-anim] {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }
    #star-canvas { display: none; }
    html { scroll-behavior: auto; }
}

/* =============================================================
   17. Responsive
   ============================================================= */
@media (max-width: 900px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 3rem;
    }

    .hero-description {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons {
        justify-content: center;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: stretch;
        padding: 0.5rem 24px 1rem;
        gap: 0;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu .nav-link {
        display: block;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border);
        font-size: 1rem;
    }

    .nav-dropdown {
        position: static;
        transform: none;
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0 0 0 1rem;
        display: none;
        min-width: unset;
    }

    .nav-item.open .nav-dropdown {
        display: block;
    }

    .nav-dropdown a {
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border);
        background: transparent;
    }

    .profile-photo {
        width: 200px;
        height: 200px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }
}

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

    .about-stats {
        grid-template-columns: 1fr 1fr;
    }
}
