/* =========================================================
   Palette: change these and the whole site re-themes
   ========================================================= */
:root {
    --sky: #5c94fc;
    --sky-light: #a9d4ff;
    --red: #e8383d;
    --blue: #2f6fe0;
    --yellow: #fbd000;
    --green: #43b047;
    --green-dark: #2e8b3a;
    --brick: #c84c0c;
    --brick-dark: #8f3507;
    --cream: #fff6dc;
    --ink: #2b2b3a;
    --px: "Press Start 2P", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: "Nunito", system-ui, sans-serif;
    font-weight: 600;
    line-height: 1.7;
}

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

/* =========================================================
   Nav
   ========================================================= */
nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    background: #fff;
    border-bottom: 4px solid var(--ink);
    font-family: var(--px);
    font-size: 0.6rem;
}

.logo { color: var(--red); font-size: 0.8rem; }

.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-right a:hover { color: var(--blue); }

.score { display: flex; align-items: center; gap: 6px; }

.mini-coin {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--yellow);
    border: 2px solid #b8860b;
    display: inline-block;
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
    position: relative;
    min-height: 620px;
    padding: 70px 20px 220px;
    overflow: hidden;
    background: linear-gradient(var(--sky) 0%, var(--sky-light) 100%);
    border-bottom: 4px solid var(--ink);
}

.hero-text {
    position: relative;
    z-index: 5;
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.prompt {
    display: inline-block;
    margin: 0 0 16px;
    padding: 6px 12px;
    background: var(--ink);
    color: var(--yellow);
    font-family: var(--px);
    font-size: 0.65rem;
}

h1 {
    margin: 0 0 22px;
    font-family: var(--px);
    font-size: clamp(3rem, 14vw, 6rem);
    line-height: 1;
    color: #fff;
    text-shadow: 4px 4px 0 var(--red), 8px 8px 0 var(--ink);
    animation: float 3s ease-in-out infinite;
}

.tagline {
    display: inline-block;
    max-width: 520px;
    margin: 0 0 26px;
    padding: 12px 18px;
    background: #fff;
    border: 4px solid var(--ink);
    border-radius: 12px;
    box-shadow: 5px 5px 0 var(--ink);
    font-weight: 800;
}

/* button used in hero + contact */
.start {
    display: inline-block;
    padding: 14px 22px;
    background: var(--red);
    color: #fff;
    border: 4px solid var(--ink);
    border-radius: 8px;
    box-shadow: 0 6px 0 var(--ink);
    font-family: var(--px);
    font-size: 0.75rem;
    transition: transform 0.1s, box-shadow 0.1s;
}
.start:hover { transform: translateY(-3px); box-shadow: 0 9px 0 var(--ink); }
.start:active { transform: translateY(6px); box-shadow: 0 0 0 var(--ink); }

.hero .start { display: block; width: fit-content; margin: 8px auto 0; }

/* ---------- clouds (drift across the sky) ---------- */
.cloud {
    position: absolute;
    left: -160px;
    width: 90px;
    height: 30px;
    background: #fff;
    border-radius: 30px;
    box-shadow: 0 4px 0 rgba(43, 43, 58, 0.12);
    animation: drift linear infinite;
    z-index: 1;
}
.cloud::before, .cloud::after {
    content: "";
    position: absolute;
    background: #fff;
    border-radius: 50%;
}
.cloud::before { width: 44px; height: 44px; left: 12px; top: -22px; }
.cloud::after  { width: 34px; height: 34px; left: 44px; top: -16px; }

.c1 { top: 90px;  animation-duration: 42s; }
.c2 { top: 200px; animation-duration: 58s; animation-delay: -20s; transform: scale(1.4); }
.c3 { top: 150px; animation-duration: 70s; animation-delay: -45s; transform: scale(0.8); }

/* ---------- hills ---------- */
.hill {
    position: absolute;
    bottom: 64px;
    background: var(--green);
    border: 4px solid var(--ink);
    border-bottom: none;
    border-radius: 50% 50% 0 0;
    z-index: 2;
}
.hill.h1 { left: -60px;  width: 420px; height: 150px; }
.hill.h2 { right: -80px; width: 520px; height: 200px; background: var(--green-dark); }

/* ---------- ground: grass on top, bricks below ---------- */
.ground {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 64px;
    z-index: 4;
    border-top: 4px solid var(--ink);
    background-color: var(--brick);
    background-image:
        linear-gradient(var(--brick-dark) 3px, transparent 3px),
        linear-gradient(90deg, var(--brick-dark) 3px, transparent 3px);
    background-size: 40px 20px;
}
.ground::before {          /* grass strip */
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 14px;
    background: var(--green);
    border-bottom: 4px solid var(--green-dark);
}

/* ---------- the pixel gecko ---------- */
.walker {
    position: absolute;
    bottom: 68px;
    left: 0;
    z-index: 6;
    animation: walk 22s linear infinite;
}

.gecko {
    width: 96px;
    cursor: pointer;
    animation: bob 0.5s steps(2) infinite;   /* 2-frame "walking" wobble */
}
.gecko svg { display: block; width: 100%; height: auto; }
.gecko.jump { animation: jump 0.6s ease-out; }

/* ---------- coins ---------- */
.coin-wrap {
    position: absolute;
    z-index: 5;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    animation: float 2.4s ease-in-out infinite;
    animation-delay: var(--d);
}
.coin {
    display: block;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--yellow);
    border: 4px solid #b8860b;
    box-shadow: inset -4px -4px 0 rgba(0,0,0,0.12), inset 4px 4px 0 rgba(255,255,255,0.5);
    animation: spin 1.2s ease-in-out infinite;
    animation-delay: var(--d);
}
.coin-wrap.collected { animation: pop 0.5s ease-out forwards; pointer-events: none; }

/* =========================================================
   Sections
   ========================================================= */
main, footer {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
}

section { padding: 56px 0 10px; }

h2 {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 22px;
    font-family: var(--px);
    font-size: 1.1rem;
}

.badge {
    display: inline-grid;
    place-items: center;
    width: 34px; height: 34px;
    background: var(--yellow);
    border: 3px solid var(--ink);
    box-shadow: 3px 3px 0 var(--ink);
    font-size: 0.8rem;
}

.panel {
    padding: 22px 24px;
    background: #fff;
    border: 4px solid var(--ink);
    border-radius: 12px;
    box-shadow: 6px 6px 0 var(--ink);
}
.panel p:first-child { margin-top: 0; }
.panel p:last-child  { margin-bottom: 0; }

/* ---------- project cards ---------- */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 22px;
}

.card {
    --accent: var(--red);
    padding: 22px;
    background: #fff;
    border: 4px solid var(--ink);
    border-top: 14px solid var(--accent);
    border-radius: 10px;
    box-shadow: 6px 6px 0 var(--ink);
}
.card.red    { --accent: var(--red); }
.card.blue   { --accent: var(--blue); }
.card.yellow { --accent: var(--yellow); }
.card.green  { --accent: var(--green); }

.card:hover { animation: bump 0.4s ease-out; }

.card h3 {
    margin: 0 0 10px;
    font-family: var(--px);
    font-size: 0.8rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.card p { margin: 0 0 14px; }
.card.soon { border-style: dashed; border-top-style: solid; }

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.tags li {
    padding: 2px 10px;
    background: var(--cream);
    border: 2px solid var(--ink);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

/* ---------- footer: a strip of bricks ---------- */
footer {
    max-width: none;
    margin-top: 70px;
    padding: 28px 20px;
    text-align: center;
    color: #fff;
    border-top: 4px solid var(--ink);
    background-color: var(--brick);
    background-image:
        linear-gradient(var(--brick-dark) 3px, transparent 3px),
        linear-gradient(90deg, var(--brick-dark) 3px, transparent 3px);
    background-size: 40px 20px;
}
footer p {
    display: inline-block;
    margin: 0;
    padding: 6px 14px;
    background: var(--ink);
    font-size: 0.85rem;
}

/* =========================================================
   Animations (each @keyframes block = one little movie)
   ========================================================= */
@keyframes drift  { from { left: -160px; } to { left: 110%; } }
@keyframes walk   { from { transform: translateX(-140px); } to { transform: translateX(100vw); } }
@keyframes bob    { 0% { transform: translateY(0); } 100% { transform: translateY(-4px); } }
@keyframes float  { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes spin   { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(0.15); } }
@keyframes pop    { 0% { transform: translateY(0) scale(1); opacity: 1; }
                    100% { transform: translateY(-60px) scale(1.4); opacity: 0; } }
@keyframes jump   { 0% { transform: translateY(0); } 40% { transform: translateY(-70px); } 100% { transform: translateY(0); } }
@keyframes bump   { 0% { transform: translateY(0); } 40% { transform: translateY(-14px); } 100% { transform: translateY(-6px); } }

/* people who prefer less motion get a calm page */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =========================================================
   Phones
   ========================================================= */
@media (max-width: 560px) {
    nav { justify-content: center; }
    .hero { padding-top: 50px; min-height: 600px; }
    .cards { grid-template-columns: 1fr; }
    .hill.h1 { width: 300px; }
    .hill.h2 { width: 360px; }
}
