:root {
    --bg: #090909;
    --surface: #141414;
    --surface-alt: #1d1d1d;
    --accent: #8cff62;
    --accent2: #2e7f2c;
    --text: #f5f5f5;
    --muted: #a6a6a6;
    --line: rgba(255, 255, 255, 0.08);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    --panel-bg:
        linear-gradient(180deg, rgba(11, 14, 11, 0.62), rgba(8, 10, 8, 0.54)),
        linear-gradient(135deg, rgba(140, 255, 98, 0.03), rgba(160, 160, 160, 0.015));
    --font-display: "Orbitron", monospace;
    --font-body: "DM Mono", monospace;
    --radius: 18px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-height: 84px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-color: var(--accent) var(--surface);
    background: #020402;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(140, 255, 98, 0.08), transparent 28%),
        radial-gradient(circle at 80% 20%, rgba(140, 255, 98, 0.06), transparent 24%),
        linear-gradient(180deg, #010201 0%, #030503 45%, #070907 100%);
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
}

::selection {
    background: rgba(140, 255, 98, 0.22);
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent), var(--accent2));
    border-radius: 999px;
}

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

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

canvas,
iframe {
    display: block;
}

.page-shell {
    position: relative;
    z-index: 1;
}

#matrix-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0.4;
    pointer-events: none;
}

.site-nav {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1280px, calc(100% - 40px));
    padding: 14px 18px;
    border: 1px solid rgba(140, 255, 98, 0.12);
    border-radius: 999px;
    background: rgba(3, 6, 3, 0.52);
    transform: translateX(-50%);
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.site-nav.scrolled {
    background: rgba(2, 5, 2, 0.68);
    border-color: rgba(140, 255, 98, 0.18);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(140, 255, 98, 0.18);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(8, 18, 8, 0.95), rgba(4, 10, 4, 0.95));
    color: var(--accent);
    box-shadow: 0 0 20px rgba(140, 255, 98, 0.06);
}

.brand-text {
    font-size: 0.92rem;
}

.top-social-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: fit-content;
    margin: 0 auto;
    padding: 12px 16px;
    border: 1px solid rgba(140, 255, 98, 0.1);
    border-radius: 999px;
    background: var(--panel-bg);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.social-section {
    display: flex;
    justify-content: center;
    padding: 32px 0 24px;
}

.top-social-strip a {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    color: var(--accent);
    transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.top-social-strip a:hover {
    transform: translateY(-2px);
    border-color: rgba(140, 255, 98, 0.32);
    background: rgba(140, 255, 98, 0.08);
}

.top-social-strip svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    position: relative;
    padding: 10px 14px;
    color: var(--muted);
    transition: color var(--transition);
}

.nav-link::after {
    content: "";
    position: absolute;
    right: 14px;
    bottom: 6px;
    left: 14px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition);
}

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

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    border: 0;
    background: transparent;
}

.nav-toggle span {
    width: 26px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
    transition: transform var(--transition), opacity var(--transition);
}

main {
    width: min(1280px, calc(100% - 40px));
    margin: 0 auto;
    padding-top: 24px;
}

section {
    position: relative;
    padding: 96px 0;
    scroll-margin-top: 110px;
}

.hero {
    min-height: 100vh;
    padding-top: 70px;
    display: flex;
    align-items: center;
}

#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 34px;
    opacity: 0;
    pointer-events: none;
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    inset: 30px 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    animation: scanline 8s linear infinite;
}

.hero::after {
    inset: auto 0 70px;
    animation-delay: -4s;
}

.hero-card {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
    gap: 72px;
    width: 100%;
    padding: 44px 48px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 26px;
    background: var(--panel-bg);
    box-shadow: var(--shadow);
}

.eyebrow,
.section-kicker,
.modal-status {
    margin: 0 0 18px;
    color: var(--accent);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.hero h1,
.section-heading h2 {
    margin: 0;
    font-family: var(--font-display);
    line-height: 1.05;
}

.hero h1 {
    max-width: 8ch;
    font-size: clamp(3.2rem, 9vw, 6.4rem);
    text-transform: uppercase;
    line-height: 0.92;
    letter-spacing: 0.02em;
    text-shadow: 0 0 18px rgba(140, 255, 98, 0.08);
}

.hero h1 span {
    display: inline-block;
    color: #a8ff87;
    text-shadow: 0 0 20px rgba(140, 255, 98, 0.14);
}

.hero-role {
    margin: 14px 0 0;
    color: rgba(255, 255, 255, 0.72);
    letter-spacing: 0.24em;
    font-size: 0.82rem;
}

.hero-copy {
    display: grid;
    align-content: center;
    padding-right: 12px;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.hero-badge {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #d7ffd1;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

._title {
    font-size: 5rem;
}

.hero-text,
.about-copy p,
.skill-card p,
.contact-card,
.modal-content p,
.feature-list,
.site-footer {
    color: var(--muted);
    line-height: 1.75;
}

.hero-text {
    max-width: 60ch;
    margin: 22px 0 0;
    font-size: 1rem;
}

.hero-actions {
    margin-top: 30px;
}

.hero-actions,
.modal-actions,
.social-links,
.engine-strip,
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    padding: 14px 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.button:hover {
    transform: translateY(-3px);
}

.button-primary {
    background: linear-gradient(135deg, rgba(140, 255, 98, 0.18), rgba(140, 255, 98, 0.05));
    border-color: rgba(140, 255, 98, 0.34);
    box-shadow: 0 0 26px rgba(140, 255, 98, 0.1);
}

.button-secondary {
    background: var(--panel-bg);
    border-color: rgba(255, 255, 255, 0.08);
}

.hero-panel,
.avatar-card,
.skill-card,
.project-card,
.contact-card,
.contact-form,
.modal-panel {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--panel-bg);
    box-shadow: var(--shadow);
}

.hero-panel {
    position: relative;
    overflow: hidden;
    min-height: 500px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.hero-panel::before,
.avatar-card::before,
.skill-card::before,
.project-card::before,
.contact-card::before,
.contact-form::before,
.modal-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    border-radius: inherit;
    pointer-events: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.hero-panel:hover::before,
.skill-card:hover::before,
.project-card:hover::before,
.contact-card:hover::before,
.contact-form:hover::before,
.modal-panel:hover::before {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.02);
}

.hero-panel::before,
.hero-panel:hover::before {
    display: none;
}

.hero-portrait {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 500px;
}

.portrait-glow {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(140, 255, 98, 0.12), transparent 65%);
    filter: blur(26px);
}

.portrait-frame {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    width: 380px;
    height: 380px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    box-shadow:
        0 0 36px rgba(140, 255, 98, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.portrait-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-float-badge {
    position: absolute;
    z-index: 2;
    max-width: 132px;
    padding: 8px 12px;
    border: 1px solid rgba(140, 255, 98, 0.26);
    border-radius: 999px;
    background: rgba(8, 12, 8, 0.58);
    color: rgba(245, 245, 245, 0.88);
    font-family: var(--font-body);
    font-size: 0.68rem;
    line-height: 1.3;
    text-align: center;
    letter-spacing: 0.04em;
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.18),
        0 0 14px rgba(140, 255, 98, 0.08),
        inset 0 0 10px rgba(140, 255, 98, 0.03);
    backdrop-filter: blur(10px);
}

.hero-float-badge-top {
    top: 78px;
    left: 4px;
}

.hero-float-badge-bottom {
    right: 0;
    bottom: 86px;
}

.hero-socials {
    display: grid;
    gap: 12px;
    margin-top: 26px;
    color: var(--muted);
}

.hero-social-row {
    display: flex;
    gap: 10px;
}

.hero-social-row a {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    transition: transform var(--transition), border-color var(--transition), color var(--transition);
}

.hero-social-row a:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

.section-heading {
    display: grid;
    gap: 14px;
    margin-bottom: 34px;
}

.section-heading h2 {
    max-width: 16ch;
    font-size: clamp(2rem, 4vw, 3.2rem);
}

.about-grid,
.contact-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
    gap: 28px;
}

.avatar-card,
.contact-card,
.contact-form {
    position: relative;
    overflow: hidden;
    padding: 28px;
    border-radius: 28px;
}

.avatar-card {
    display: grid;
    place-items: center;
    text-align: center;
    min-height: 360px;
}

.avatar-core {
    position: relative;
    display: grid;
    place-items: center;
    width: 220px;
    height: 220px;
    margin-bottom: 24px;
}

.avatar-ring {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 50%;
    box-shadow: 0 0 60px rgba(255, 255, 255, 0.05);
    animation: glowPulse 4s ease-in-out infinite;
}

.avatar-face {
    display: grid;
    place-items: center;
    width: 140px;
    height: 140px;
    border-radius: 30px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(140, 140, 140, 0.14));
    font-family: var(--font-display);
    font-size: 2.6rem;
    color: var(--accent);
}

.about-copy {
    display: grid;
    align-content: center;
    gap: 18px;
}

.engine-strip span,
.tag-row span,
.project-tags span,
.screenshot-chip {
    padding: 9px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
}

.skills-grid {
    display: flex;
    gap: 18px;
    align-items: stretch;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
    mask-image: linear-gradient(
        90deg,
        transparent 0,
        #000 6%,
        #000 94%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        90deg,
        transparent 0,
        #000 6%,
        #000 94%,
        transparent 100%
    );
    cursor: grab;
    user-select: none;
}

.skills-grid::-webkit-scrollbar {
    display: none;
}

.skills-grid.dragging {
    cursor: grabbing;
}

.skill-card,
.project-card {
    position: relative;
    overflow: hidden;
    padding: 24px;
    border-radius: 24px;
    transition: transform var(--transition), border-color var(--transition);
}

.skill-card:hover,
.project-card:hover {
    transform: translateY(-6px);
}

.skill-icon {
    display: grid;
    place-items: center;
    width: 104px;
    height: 104px;
    margin: 0 auto 22px;
    color: var(--accent);
    background: transparent;
    border: 0;
}

.skill-icon svg {
    width: 64px;
    height: 64px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.skill-icon img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    /* Force all imported SVG logos to match the portfolio green accent. */
    filter: brightness(0) saturate(100%) invert(86%) sepia(53%) saturate(663%)
        hue-rotate(42deg) brightness(102%) contrast(103%);
}

.skill-icon-text {
    font-family: var(--font-display);
    font-size: 1.35rem;
    line-height: 1;
    color: currentColor;
}

.skill-card h3,
.project-card h3,
.modal-content h3 {
    margin: 0 0 12px;
    font-family: var(--font-display);
}

.skill-card {
    flex: 0 0 auto;
    min-width: 180px;
    min-height: 200px;
    padding: 28px 18px 22px;
    text-align: center;
    border-radius: 18px;
    scroll-snap-align: start;
}

.skill-card h3 {
    margin-bottom: 6px;
    font-size: 0.96rem;
}

.skill-card p {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.4;
}

.projects-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-button {
    position: relative;
    padding: 10px 14px;
    border: 0;
    color: var(--muted);
    background: transparent;
}

.filter-button::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: 4px;
    left: 12px;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform var(--transition);
}

.filter-button.active,
.filter-button:hover {
    color: var(--text);
}

.filter-button.active::after,
.filter-button:hover::after {
    transform: scaleX(1);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.projects-group + .projects-group {
    margin-top: 42px;
}

.projects-group {
    padding: 30px 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    background: var(--panel-bg);
    box-shadow: var(--shadow);
}

.projects-subtitle {
    margin: 0 0 16px;
    color: #dfff6b;
    background: linear-gradient(90deg, #ffe96a 0%, #b8ff6f 55%, #8cff62 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    letter-spacing: 0.03em;
}

.projects-subtitle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.projects-subtitle-row .projects-subtitle {
    margin: 0;
}

.projects-arrows {
    display: flex;
    gap: 8px;
}

.projects-arrow-btn {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(140, 255, 98, 0.32);
    border-radius: 50%;
    color: var(--accent);
    background: rgba(140, 255, 98, 0.08);
    transition: transform var(--transition), background var(--transition), border-color var(--transition);
}

.projects-arrow-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(140, 255, 98, 0.5);
    background: rgba(140, 255, 98, 0.16);
}

.systems-grid,
.games-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.systems-grid {
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
    mask-image: linear-gradient(
        90deg,
        transparent 0,
        #000 6%,
        #000 94%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        90deg,
        transparent 0,
        #000 6%,
        #000 94%,
        transparent 100%
    );
    cursor: grab;
    user-select: none;
}

.systems-grid::-webkit-scrollbar {
    display: none;
}

.systems-grid.dragging {
    cursor: grabbing;
}

.project-showcase {
    flex: 0 0 min(320px, 80vw);
    scroll-snap-align: start;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: var(--panel-bg);
    box-shadow: var(--shadow);
}

.project-video-shell {
    overflow: hidden;
    border-radius: 14px;
    aspect-ratio: 16 / 9;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #030503;
}

.project-video-shell video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.project-showcase p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.project-thumb,
.screenshot-card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    aspect-ratio: 16 / 10;
    margin-bottom: 18px;
    background:
        linear-gradient(145deg, rgba(140, 255, 98, 0.06), transparent 55%),
        linear-gradient(180deg, rgba(11, 14, 11, 0.62), rgba(8, 10, 8, 0.54)),
        linear-gradient(135deg, rgba(140, 255, 98, 0.03), rgba(160, 160, 160, 0.015));
}

.project-thumb::before,
.screenshot-card::before {
    content: attr(data-label);
    position: absolute;
    right: 14px;
    bottom: 14px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(13, 13, 15, 0.7);
    color: var(--accent);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.project-card p {
    margin: 0 0 16px;
    color: var(--muted);
}

.project-open {
    width: 100%;
    padding: 0;
    border: 0;
    color: inherit;
    text-align: left;
    background: transparent;
}

.project-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

.project-arrow {
    font-size: 1.4rem;
    color: var(--accent);
    transition: transform var(--transition);
}

.project-card:hover .project-arrow {
    transform: translateX(4px);
}

.contact-card {
    display: grid;
    align-content: center;
    gap: 24px;
    min-height: 100%;
}

.contact-card > a {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 3vw, 1.8rem);
}

.contact-simple {
    display: grid;
    justify-content: center;
    gap: 14px;
    padding-top: 8px;
}

.contact-shell {
    width: min(760px, 100%);
    margin: 0 auto;
    padding: 24px 28px;
    border: 1px solid rgba(140, 255, 98, 0.06);
    border-radius: 18px;
    background: var(--panel-bg);
    box-shadow: var(--shadow);
}

.contact-heading {
    justify-items: center;
    text-align: center;
    margin-bottom: 18px;
}

.contact-simple p {
    margin: 0;
    color: #a8ff87;
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.7vw, 1.28rem);
    text-align: center;
    text-shadow: 0 0 14px rgba(140, 255, 98, 0.12);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.contact-simple span {
    margin-right: 10px;
}

.contact-simple a {
    font-family: inherit;
    font-size: inherit;
    color: var(--text);
    text-decoration: none;
    transition: color var(--transition), text-decoration-color var(--transition);
}

.contact-simple a {
    font-family: inherit;
}

.contact-simple a:hover {
    color: var(--accent);
}

.contact-phone {
    color: var(--text);
}

.social-links a {
    color: var(--muted);
    transition: color var(--transition), transform var(--transition);
}

.social-links a:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

.contact-form {
    display: grid;
    gap: 16px;
}

.contact-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.92rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: var(--text);
    background: rgba(7, 7, 10, 0.8);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.form-message {
    min-height: 24px;
    margin: 0;
}

.form-message.success {
    color: #ffffff;
}

.form-message.error {
    color: #d0d0d0;
}

.site-footer {
    width: min(1280px, calc(100% - 40px));
    margin: 0 auto;
    padding: 0 0 40px;
    text-align: center;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(12px);
}

.modal-panel {
    position: relative;
    z-index: 1;
    width: min(980px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border-radius: 28px;
    transform: translateY(24px);
    transition: transform var(--transition);
}

.modal.open .modal-panel {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    color: var(--text);
    background: rgba(13, 13, 15, 0.8);
}

.modal-media {
    aspect-ratio: 16 / 9;
    border-bottom: 1px solid var(--line);
}

.modal-media iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.modal-content {
    padding: 28px;
}

.modal-head {
    margin-bottom: 22px;
}

.feature-list {
    display: grid;
    gap: 12px;
    margin: 0 0 22px;
    padding-left: 18px;
}

.screenshot-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 22px 0 26px;
}

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

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

@keyframes glowPulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.65;
    }
    50% {
        transform: scale(1.06);
        opacity: 1;
    }
}

@keyframes scanline {
    0% {
        transform: translateY(0);
        opacity: 0.1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(40px);
        opacity: 0.1;
    }
}

@media (max-width: 980px) {
    .hero-card,
    .about-grid,
    .contact-layout,
    .projects-heading {
        grid-template-columns: 1fr;
    }

    .skills-grid,
    .projects-grid,
    .systems-grid,
    .games-grid,
    .screenshot-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .site-nav {
        top: 12px;
        width: calc(100% - 20px);
        border-radius: 24px;
    }

    .nav-toggle {
        display: flex;
    }

    .top-social-strip {
        width: fit-content;
        margin-top: 0;
        padding: 10px 14px;
    }

    .social-section {
        padding: 24px 0 18px;
    }

    .nav-toggle.active span:first-child {
        transform: translateY(7px) rotate(45deg);
    }

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

    .nav-toggle.active span:last-child {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-menu {
        position: absolute;
        top: calc(100% + 12px);
        right: 0;
        left: 0;
        display: grid;
        gap: 6px;
        padding: 10px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 24px;
        background: rgba(13, 13, 15, 0.96);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity var(--transition), transform var(--transition);
    }

    .nav-menu.open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    main {
        width: min(1280px, calc(100% - 24px));
    }

    section {
        padding: 68px 0;
    }

    .hero {
        min-height: auto;
        padding-top: 90px;
    }

    .hero-card {
        gap: 28px;
        padding: 26px;
    }

    .hero-panel,
    .hero-portrait {
        min-height: 360px;
    }

    .portrait-glow {
        width: 300px;
        height: 300px;
    }

    .portrait-frame {
        width: 280px;
        height: 280px;
    }

    .hero-float-badge-top {
        top: 26px;
        left: 8px;
    }

    .hero-float-badge-bottom {
        right: 8px;
        bottom: 34px;
    }

    .hero h1 {
        max-width: 100%;
    }

    .skills-grid {
        display: flex;
        gap: 14px;
        overflow-x: auto;
        padding-bottom: 6px;
        scroll-snap-type: x proximity;
    }

    .skill-card {
        min-width: 148px;
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .projects-grid,
    .systems-grid,
    .games-grid,
    .screenshot-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .brand-text {
        display: none;
    }

    .button {
        width: 100%;
    }

    .hero-actions {
        flex-direction: column;
    }

    .contact-simple p {
        white-space: normal;
    }

    .modal-content,
    .avatar-card,
    .contact-card,
    .contact-form,
    .project-card,
    .skill-card {
        padding: 20px;
    }
}
