@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    color-scheme: dark;
    --ink: #030507;
    --paper: #f4f6f2;
    --acid: #c8ff31;
    --red: #ff2b46;
    --dim: rgba(244, 246, 242, .52);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body { min-height: 100%; }

body {
    margin: 0;
    color: var(--paper);
    background: var(--ink);
    font-family: Inter, Arial, sans-serif;
}

body::before {
    content: "MMG";
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: -1;
    color: rgba(255, 255, 255, .018);
    font-size: 34vw;
    font-weight: 900;
    letter-spacing: -.1em;
    transform: translate(-50%, -52%);
    white-space: nowrap;
}

#scene {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.noise, .scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 6;
}

.noise {
    opacity: .16;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.46'/%3E%3C/svg%3E");
    mix-blend-mode: soft-light;
}

.scanlines {
    opacity: .12;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(255,255,255,.1) 4px);
}

.site-header, main { position: relative; z-index: 4; }

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 38px;
    background: linear-gradient(to bottom, rgba(3,5,7,.82), transparent);
}

.mark {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--paper);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .02em;
    text-decoration: none;
}

.mark strong { color: var(--acid); }

.mmg-logo {
    width: 44px;
    height: 44px;
    filter: drop-shadow(0 0 10px rgba(200,255,49,.35));
}

.mmg-logo .hex {
    fill: rgba(3,5,7,.65);
    stroke: var(--acid);
    stroke-width: 2;
}

.mmg-logo .hex-inner {
    fill: none;
    stroke: rgba(244,246,242,.22);
    stroke-width: 1;
}

.mmg-logo .hex-text {
    fill: var(--acid);
    font: 900 15px Inter, Arial, sans-serif;
    letter-spacing: .02em;
    text-anchor: middle;
    dominant-baseline: middle;
}

.signal-status {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--dim);
    font: 500 10px DM Mono, monospace;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.signal-status i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--acid);
    box-shadow: 0 0 12px var(--acid);
    animation: blink 1.8s ease-in-out infinite;
}

/* ---------- Hero banner ---------- */

.hero-banner {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
}

.hero {
    position: absolute;
    left: clamp(28px, 8vw, 130px);
    top: 50%;
    width: min(800px, 80vw);
    transform: translateY(-48%);
}

.eyebrow {
    margin: 0 0 10px 5px;
    color: rgba(244,246,242,.7);
    font: 500 11px DM Mono, monospace;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.eyebrow span { color: var(--red); }

.title-wrap { position: relative; }

h1 {
    position: relative;
    z-index: 2;
    margin: 0;
    color: var(--paper);
    font-size: clamp(96px, 19vw, 260px);
    font-weight: 900;
    line-height: .78;
    letter-spacing: -.06em;
    filter: drop-shadow(0 0 28px rgba(255,255,255,.08));
}

h1 span { color: var(--acid); }

h1::before, h1::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
}

h1::before { color: #20dcff; transform: translateX(-7px); }
h1::after { color: var(--red); transform: translateX(7px); }
body.glitch h1::before, body.glitch h1::after { opacity: .65; animation: glitch .42s steps(2, end); }

.title-ghost {
    position: absolute;
    left: 4px;
    top: 105%;
    color: transparent;
    font-size: clamp(96px, 19vw, 260px);
    font-weight: 900;
    line-height: .8;
    letter-spacing: -.06em;
    -webkit-text-stroke: 1px rgba(255,255,255,.11);
    transform: scaleY(-.46) skewX(-12deg);
    transform-origin: top;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.6), transparent 74%);
}

.lede {
    width: min(470px, 90%);
    margin: 43px 0 25px 5px;
    color: var(--dim);
    font: 300 clamp(14px, 1.3vw, 18px)/1.65 DM Mono, monospace;
}

.enter-button {
    display: inline-flex;
    align-items: center;
    gap: 26px;
    margin-left: 5px;
    padding: 14px 18px 14px 20px;
    border: 1px solid rgba(200,255,49,.5);
    color: var(--acid);
    background: rgba(3,5,7,.5);
    font: 500 10px DM Mono, monospace;
    letter-spacing: .19em;
    text-transform: uppercase;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: color .25s, background .25s, box-shadow .25s, transform .25s;
}

.enter-button:hover, .enter-button:focus-visible {
    color: #0a0d05;
    background: var(--acid);
    box-shadow: 0 0 35px rgba(200,255,49,.25);
    transform: translateY(-2px);
    outline: none;
}

.enter-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.coordinates {
    position: absolute;
    right: 38px;
    top: 50%;
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: rgba(244,246,242,.4);
    font: 400 9px DM Mono, monospace;
    letter-spacing: .14em;
    text-align: right;
    transform: translateY(-50%);
}

.coordinates::before {
    content: "";
    position: absolute;
    right: -38px;
    top: -30px;
    width: 1px;
    height: 112px;
    background: linear-gradient(var(--red), transparent);
}

.side-code {
    position: absolute;
    right: 18px;
    bottom: 115px;
    color: rgba(244,246,242,.16);
    font: 400 8px DM Mono, monospace;
    letter-spacing: .35em;
    text-transform: uppercase;
    writing-mode: vertical-rl;
}

.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(244,246,242,.45);
    font: 500 9px DM Mono, monospace;
    letter-spacing: .3em;
    text-decoration: none;
    text-transform: uppercase;
    transform: translateX(-50%);
    animation: bob 2.4s ease-in-out infinite;
}

.scroll-cue:hover { color: var(--acid); }
.scroll-cue svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }

/* ---------- Games section ---------- */

.games {
    position: relative;
    z-index: 5;
    padding: clamp(80px, 12vh, 140px) clamp(24px, 7vw, 120px) clamp(90px, 13vh, 150px);
    background:
        linear-gradient(to bottom, transparent, var(--ink) 140px),
        linear-gradient(rgba(3,5,7,.88), rgba(3,5,7,.96));
    border-top: 1px solid rgba(200,255,49,.14);
}

.games-inner {
    max-width: 1080px;
    margin: 0 auto;
}

.games h2, .open-projects h2 {
    margin: 0 0 clamp(38px, 6vh, 70px);
    color: var(--paper);
    font-size: clamp(52px, 8vw, 110px);
    font-weight: 900;
    line-height: .85;
    letter-spacing: -.05em;
}

.game-card {
    display: grid;
    grid-template-columns: minmax(0, 460px) 1fr;
    gap: clamp(26px, 4vw, 56px);
    align-items: center;
    padding: clamp(22px, 3vw, 40px);
    border: 1px solid rgba(244,246,242,.12);
    background: rgba(244,246,242,.03);
    backdrop-filter: blur(6px);
    transition: border-color .3s, box-shadow .3s;
}

.game-card:hover {
    border-color: rgba(200,255,49,.4);
    box-shadow: 0 0 45px rgba(200,255,49,.08);
}

.game-media {
    position: relative;
    display: block;
    overflow: hidden;
    border: 1px solid rgba(244,246,242,.14);
}

.game-media img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform .4s ease;
}

.game-media:hover img { transform: scale(1.035); }

.game-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    padding: 5px 10px;
    color: #0a0d05;
    background: var(--acid);
    font: 700 9px DM Mono, monospace;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.game-info h3 {
    margin: 0 0 6px;
    color: var(--paper);
    font-size: clamp(28px, 3.4vw, 44px);
    font-weight: 900;
    letter-spacing: -.03em;
}

.game-tagline {
    margin: 0 0 18px;
    color: var(--acid);
    font: 500 12px DM Mono, monospace;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.game-desc {
    margin: 0 0 26px;
    color: var(--dim);
    font: 300 14px/1.75 DM Mono, monospace;
}

.game-actions {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

.steam-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    border: 1px solid rgba(200,255,49,.5);
    color: var(--acid);
    background: rgba(3,5,7,.5);
    font: 500 10px DM Mono, monospace;
    letter-spacing: .19em;
    text-decoration: none;
    text-transform: uppercase;
    transition: color .25s, background .25s, box-shadow .25s, transform .25s;
}

.steam-button:hover, .steam-button:focus-visible {
    color: #0a0d05;
    background: var(--acid);
    box-shadow: 0 0 35px rgba(200,255,49,.25);
    transform: translateY(-2px);
    outline: none;
}

.steam-button svg { width: 18px; height: 18px; fill: currentColor; }

.game-price {
    color: var(--paper);
    font: 500 16px DM Mono, monospace;
    letter-spacing: .06em;
}

.open-projects {
    position: relative;
    z-index: 5;
    min-height: 82vh;
    padding: clamp(130px, 18vh, 200px) clamp(24px, 7vw, 120px) clamp(90px, 13vh, 150px);
    overflow: hidden;
    color: var(--ink);
    background:
        radial-gradient(circle at 82% 18%, rgba(244,246,242,.52), transparent 28%),
        linear-gradient(135deg, #d8ff68 0%, var(--acid) 48%, #a9dc1c 100%);
    border-top: 1px solid rgba(3,5,7,.28);
}

.open-projects::before {
    content: "//";
    position: absolute;
    right: -2vw;
    top: -8vw;
    color: rgba(3,5,7,.055);
    font-size: clamp(240px, 40vw, 620px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.15em;
    pointer-events: none;
}

.open-projects .games-inner {
    position: relative;
    z-index: 1;
    max-width: 1440px;
}

.open-projects .eyebrow {
    color: rgba(3,5,7,.6);
}

.open-projects .eyebrow span {
    color: var(--red);
}

.open-projects h2 {
    color: var(--ink);
}

.open-projects-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(20px, 2.5vw, 32px);
}

.open-projects .game-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    height: 100%;
    min-height: 250px;
    padding: clamp(15px, 1.6vw, 22px);
    border-color: rgba(3,5,7,.24);
    background: rgba(3,5,7,.96);
    box-shadow: 12px 12px 0 rgba(3,5,7,.14);
}

.open-projects .game-card:hover {
    border-color: rgba(3,5,7,.72);
    box-shadow: 16px 16px 0 rgba(3,5,7,.18);
}

.open-project-card.no-thumbnail {
    min-height: 250px;
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    gap: 28px;
}

.project-card-header h3 {
    flex: 1;
    min-width: 0;
    margin: 0;
    color: var(--paper);
    font-size: clamp(21px, 1.8vw, 30px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.03em;
    text-align: left;
    overflow-wrap: anywhere;
}

.project-badge {
    position: static;
    flex: none;
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
}

.project-card-body {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
    justify-items: start;
    justify-content: start;
    flex: 1;
    width: 100%;
}

.project-card-visual {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 112px;
    margin: 0;
    justify-self: start;
    align-self: start;
}

.open-project-card .game-info {
    width: 100%;
}

.open-project-card .game-media {
    width: 112px;
    height: 112px;
    align-self: start;
}

.open-project-card .game-media img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.open-project-card .game-info {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.open-project-card .game-desc {
    display: -webkit-box;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-line;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 8;
}

.project-card-visual .game-actions {
    width: 100%;
}

.open-project-card .steam-button svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.open-project-card .steam-button {
    justify-content: center;
    width: 100%;
    padding: 10px 8px;
}

.projects-status {
    margin: 0;
    padding: 24px 0;
    border-top: 1px solid rgba(3,5,7,.25);
    border-bottom: 1px solid rgba(3,5,7,.25);
    color: rgba(3,5,7,.68);
    font: 400 12px/1.7 DM Mono, monospace;
    letter-spacing: .06em;
}

@media (min-width: 1500px) {
    .open-projects-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

footer {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    width: 100%;
    margin: 0;
    padding: 26px max(24px, calc((100vw - 1080px) / 2)) 30px;
    background: var(--ink);
    border-top: 1px solid rgba(244,246,242,.08);
    color: rgba(244,246,242,.3);
    font: 400 8px DM Mono, monospace;
    letter-spacing: .16em;
    text-transform: uppercase;
}

footer a { justify-self: end; color: rgba(244,246,242,.44); text-decoration: none; }
footer a:hover { color: var(--acid); }

.flash {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    background: var(--paper);
    opacity: 0;
}

body.pulse .flash { animation: flash .7s ease-out; }

@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 7px); } }
@keyframes flash { 0% { opacity: .8; } 10% { opacity: .06; } 16% { opacity: .25; } 100% { opacity: 0; } }
@keyframes glitch {
    0% { clip-path: inset(8% 0 74% 0); }
    25% { clip-path: inset(65% 0 8% 0); }
    50% { clip-path: inset(36% 0 41% 0); }
    75% { clip-path: inset(82% 0 2% 0); }
    100% { clip-path: inset(12% 0 62% 0); }
}

@media (max-width: 860px) {
    .game-card { grid-template-columns: 1fr; }
    .open-projects-list { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .project-card-body { grid-template-columns: 1fr; }
    .project-card-visual { width: 104px; justify-self: start; margin-left: 0; margin-right: auto; }
    .open-project-card .game-media { width: 104px; height: 104px; }
}

@media (max-width: 720px) {
    .site-header { padding: 16px 20px; }
    .mmg-logo { width: 38px; height: 38px; }
    .hero { left: 20px; top: 47%; width: calc(100vw - 40px); }
    h1, .title-ghost { font-size: clamp(88px, 30vw, 170px); }
    .lede { margin-top: 32px; }
    .coordinates, .side-code, .footer-center { display: none; }
    .games, .open-projects { padding-left: 20px; padding-right: 20px; }
    footer { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .signal-status i { animation: none; }
    .scroll-cue { animation: none; }
    .noise, .scanlines { display: none; }
}
