:root {
    --neon-pink: #ff00ff;
    --neon-blue: #00ffff;
    --neon-green: #00ff00;
    --neon-yellow: #ffff00;
    --white: #ffffff;
    --bg-dark: #121212;
    --bg-panel: #1e1e1e;
    --text-main: #e0e0e0;
    --text-muted: #b3b3b3;
    --max-width: 1200px;
}

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

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    font-family: 'Space Mono', monospace;
    background-color: #000000;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

body.menu-open,
body:has(dialog[open]) {
    overflow: hidden;
}

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

ul[class],
ol[class] {
    list-style: none;
}

/* Clear the fixed (compact) header when jumping to a section */
section[id] {
    scroll-margin-top: 80px;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Accessibility utilities */
.visually-hidden {
    position: absolute !important;
    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: -100px;
    left: 1rem;
    z-index: 3000;
    padding: 0.75rem 1.25rem;
    background: var(--neon-yellow);
    color: #000;
    font-weight: 700;
    text-decoration: none;
}

.skip-link:focus {
    top: 1rem;
}

:focus-visible {
    outline: 3px solid var(--neon-yellow);
    outline-offset: 4px;
}

main:focus {
    outline: none;
}

/* Header - Minimal & Clean, fixed; compacts once the page scrolls (.scrolled set in script.js) */
header {
    padding: 2rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    /* No backdrop-filter here: it would trap the fixed .mobile-nav inside the header */
    background: transparent;
    transition: padding 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled {
    padding: 0.75rem 0;
    background: rgba(0, 0, 0, 0.92);
    border-bottom-color: var(--neon-pink);
    box-shadow: 0 4px 0 rgba(255, 0, 255, 0.25);
}

header .logo,
header .header-headshot,
header .nav-links a {
    transition: font-size 0.3s ease, width 0.3s ease, height 0.3s ease, color 0.3s, text-shadow 0.3s, transform 0.3s;
}

header.scrolled .logo {
    font-size: 1.5rem;
}

header.scrolled .header-headshot {
    width: 32px;
    height: 32px;
}

header.scrolled .nav-links a {
    font-size: 1rem;
}

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

.logo {
    font-family: 'Permanent Marker', cursive;
    font-size: 2rem;
    color: var(--white);
    text-decoration: none;
    text-shadow: 2px 2px 0px var(--neon-pink);
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-headshot {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border: 2px solid var(--neon-green);
    box-shadow: 2px 2px 0px var(--neon-pink);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--neon-yellow);
    font-family: 'Permanent Marker', cursive;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    transition: all 0.3s;
    text-shadow: 2px 2px 0px var(--neon-pink);
}

.nav-links a:hover {
    color: var(--neon-pink);
    text-shadow: 2px 2px 0px var(--white);
    transform: rotate(-2deg);
}

/* Hero Section */
.hero {
    min-height: 700px;
    padding: 140px 0 100px;
    display: flex;
    align-items: center;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-content {
    max-width: 900px;
}

.hero h1 {
    font-family: 'Permanent Marker', cursive;
    font-size: 6rem;
    line-height: 0.9;
    margin-bottom: 2rem;
    color: var(--white);
    text-shadow:
        3px 3px 0px var(--neon-pink),
        6px 6px 0px rgba(0, 0, 0, 0.5);
}

.hero-kicker {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--neon-blue);
    text-shadow: none;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    max-width: 640px;
    color: #ccc;
    border-left: 2px solid var(--neon-green);
    padding-left: 1.5rem;
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-family: 'Permanent Marker', cursive;
    font-size: 1.5rem;
    color: #000;
    background: var(--neon-green);
    text-decoration: none;
    transform: rotate(-2deg);
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 5px 5px 0px var(--white);
    text-transform: uppercase;
    border: none;
}

.btn:hover {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 8px 8px 0px var(--neon-pink);
    background: var(--neon-yellow);
    color: #000;
}

/* Section scaffolding */
.projects {
    padding: 100px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.skills {
    background: rgba(0, 0, 0, 0.3);
}

.section-title {
    font-family: 'Permanent Marker', cursive;
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 3rem;
    color: var(--neon-yellow);
    text-shadow: 3px 3px 0px var(--neon-pink);
}

.section-title--md {
    font-size: 3rem;
}

.section-title--green {
    color: var(--neon-green);
}

/* Accent color classes (shared by cards, skill rows, timeline) */
.style-blue {
    --accent: var(--neon-blue);
}

.style-pink {
    --accent: var(--neon-pink);
}

.style-green {
    --accent: var(--neon-green);
}

.style-yellow {
    --accent: var(--neon-yellow);
}

/* Portfolio Grid - Heavy Design */
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3rem;
    padding: 1rem;
}

.project-card {
    background: #111;
    border: 4px solid var(--accent);
    padding: 2rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.5rem;
    cursor: pointer;
    position: relative;
    box-shadow: 10px 10px 0px var(--accent);
}

.project-card:hover {
    transform: scale(1.02) rotate(-1deg);
    box-shadow: 15px 15px 0px var(--accent);
    z-index: 10;
}

.project-card:has(.card-btn:focus-visible) {
    outline: 3px solid var(--neon-yellow);
    outline-offset: 6px;
}

.project-thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top;
    margin-bottom: 1.5rem;
    border: 2px solid #333;
    background: #000;
}

.project-card h3 {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--white);
    text-transform: uppercase;
}

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

.card-btn {
    margin-top: 1.25rem;
    background: none;
    border: 2px solid var(--accent);
    color: var(--accent);
    font: 700 0.9rem 'Space Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 1rem;
    cursor: pointer;
}

/* Stretch the button's hit area over the whole card */
.card-btn::after {
    content: "";
    position: absolute;
    inset: 0;
}

.card-btn:focus-visible {
    outline: none;
}

.project-card:hover .card-btn {
    background: var(--accent);
    color: #000;
}

.tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border: 1px solid #555;
    color: var(--white);
    text-transform: uppercase;
}

.project-card .tag {
    border-color: var(--accent);
}

/* Skills (Arsenal) */
.skill-list {
    display: grid;
    gap: 3rem;
    padding: 1rem;
}

.skill-row {
    background: #111;
    border: 4px solid var(--accent);
    box-shadow: 10px 10px 0px var(--accent);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.skill-row h3 {
    min-width: 150px;
    font-size: 1.5rem;
    color: var(--accent);
}

.skill-row .tags {
    flex-grow: 1;
    justify-content: flex-end;
}

.skill-row .tag {
    transition: transform 0.2s ease, background 0.2s ease;
}

.skill-row .tag:hover {
    transform: scale(1.2) translateY(-2px);
    background: #333;
    color: #fff;
    box-shadow: 0 0 10px #333;
}

/* About Section */
.about {
    padding: 100px 0;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.about-copy {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #ccc;
    border-left: 2px solid var(--neon-pink);
    padding-left: 1.5rem;
    max-width: 720px;
}

.about-copy p+p {
    margin-top: 1.25rem;
}

/* Experience timeline */
.timeline {
    display: grid;
    gap: 2.5rem;
    padding: 1rem;
    max-width: 900px;
}

.timeline-item {
    border-left: 4px solid var(--accent);
    padding: 0.25rem 0 0.25rem 1.75rem;
}

.timeline-item h3 {
    font-size: 1.3rem;
    color: var(--white);
    text-transform: uppercase;
}

.timeline-meta {
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.timeline-item ul {
    padding-left: 1.25rem;
    color: #ccc;
}

.timeline-item li+li {
    margin-top: 0.4rem;
}

/* Contact */
.contact {
    padding: 100px 0;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
}

.social-links a {
    color: var(--bg-dark);
    font-family: 'Permanent Marker', cursive;
    font-size: 1.5rem;
    text-decoration: none;
    background: var(--neon-blue);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 4px 4px 0px var(--white);
}

.social-links a:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--white);
}

footer {
    text-align: center;
    padding: 2rem;
    color: #999;
    font-size: 0.8rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--neon-blue);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: underline;
    text-decoration-color: var(--neon-pink);
    text-underline-offset: 4px;
}

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

/* Modal (native <dialog>) */
.modal {
    border: none;
    padding: 0;
    background: transparent;
    color: inherit;
    max-width: min(1100px, 92vw);
    width: 100%;
    max-height: 90vh;
    margin: auto;
    overflow: visible;
}

.modal::backdrop {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    --accent: var(--neon-pink);
    background: #111;
    border: 4px solid var(--accent);
    box-shadow: 20px 20px 0px var(--accent);
    padding: 3rem;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal[open] .modal-content {
    animation: modal-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modal-in {
    from {
        transform: scale(0.9) rotate(2deg);
        opacity: 0;
    }
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    font-size: 2.25rem;
    line-height: 1;
    color: var(--white);
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--neon-pink);
}

.modal-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    padding-right: 3rem;
    text-shadow: 3px 3px 0px var(--white);
}

.modal-tags {
    margin-bottom: 2rem;
}

.modal-body {
    font-size: 1.05rem;
    color: #ccc;
    display: grid;
    gap: 2.5rem;
}

.modal-body.has-frame {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    align-items: start;
}

.modal-info>*+* {
    margin-top: 1.25rem;
}

.modal-info ul {
    padding-left: 1.25rem;
}

.modal-info li+li {
    margin-top: 0.5rem;
}

.modal-info strong {
    color: var(--white);
}

.modal-info .note {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

.project-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    padding: 1rem 0;
}

.project-meta dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.project-meta dd {
    font-weight: 700;
    color: var(--accent);
}

.text-link {
    display: inline-block;
    color: #000;
    background: var(--accent);
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    padding: 0.6rem 1.2rem;
    box-shadow: 4px 4px 0 var(--white);
    transition: transform 0.2s, box-shadow 0.2s;
}

.text-link:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--white);
}

/* Scrollable full-page site screenshot */
.site-frame {
    border: 2px solid var(--accent);
    background: #000;
    max-height: 70vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: var(--accent) #111;
}

.site-frame-bar {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #1e1e1e;
    border-bottom: 2px solid var(--accent);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.site-frame-bar::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--neon-pink);
    box-shadow: 16px 0 0 var(--neon-yellow), 32px 0 0 var(--neon-green);
    margin-right: 40px;
}

.site-frame img {
    width: 100%;
}

.site-frame-divider {
    padding: 0.5rem 0.75rem;
    background: var(--accent);
    color: #000;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Mobile Navigation */
.hamburger {
    display: none;
    position: relative;
    z-index: 2001;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.hamburger span {
    display: block;
    width: 30px;
    height: 3px;
    margin: 6px 0;
    background: var(--neon-green);
    transition: 0.3s;
    box-shadow: 0 0 5px var(--neon-green);
}

.mobile-nav {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    z-index: 2000;
    /* Closed state is removed from tab order / screen readers via the `inert` attribute */
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
}

.mobile-nav.active {
    transform: translateX(0);
}

.mobile-nav a {
    font-family: 'Permanent Marker', cursive;
    font-size: 3rem;
    color: var(--neon-yellow);
    text-decoration: none;
    text-transform: uppercase;
    transition: 0.3s;
    text-shadow: 3px 3px 0px var(--neon-pink);
}

.mobile-nav a:hover {
    color: var(--neon-pink);
    text-shadow: 2px 2px 0px var(--white);
    transform: scale(1.1);
}

/* Hamburger Animation */
.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-6px, 6px);
    background: var(--neon-pink);
    box-shadow: 0 0 5px var(--neon-pink);
}

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

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-6px, -6px);
    background: var(--neon-pink);
    box-shadow: 0 0 5px var(--neon-pink);
}

/* Responsive updates */
@media (max-width: 900px) {
    .modal-body.has-frame {
        grid-template-columns: 1fr;
    }

    .site-frame {
        max-height: 60vh;
    }
}

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

    .nav-links {
        display: none;
    }

    /* Tighter Mobile Spacing */
    .hero {
        min-height: auto;
        padding: 150px 0 60px;
    }

    .hero h1 {
        font-size: 3rem;
        margin-bottom: 1rem;
    }

    .hero-kicker {
        font-size: 0.8rem;
        letter-spacing: 1px;
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .projects,
    .about,
    .contact {
        padding: 60px 0;
    }

    .section-title {
        font-size: 2.5rem;
        margin-bottom: 2rem;
    }

    .project-grid,
    .skill-list {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .project-card,
    .skill-row {
        padding: 1.5rem;
    }

    .skill-row .tags {
        justify-content: flex-start;
    }

    .modal-content {
        padding: 2rem 1.25rem;
        box-shadow: 8px 8px 0px var(--accent);
    }

    .modal-title {
        font-size: 2rem;
    }
}

@media (max-width: 680px) {
    .container {
        padding: 0 1rem;
    }

    .project-grid,
    .skill-list,
    .timeline {
        padding: 0;
    }
}

@media (max-width: 450px) {
    .logo {
        font-size: 1.5rem;
    }

    .header-headshot {
        width: 30px;
        height: 30px;
    }

    header.scrolled .logo {
        font-size: 1.25rem;
    }

    header.scrolled .header-headshot {
        width: 26px;
        height: 26px;
    }
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .project-card:hover,
    .btn,
    .btn:hover,
    .nav-links a:hover,
    .mobile-nav a:hover,
    .skill-row .tag:hover {
        transform: none;
    }
}
