/* Space Plumbers: the game's own look (suit orange, coolant teal, hazard yellow on a hull navy),
   on the Arcade Night kit's fonts and arcade.js (starfield, motion button, hero video, signup). */

@font-face { font-family: "Bungee"; src: url(kit/fonts/Bungee.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Rubik"; src: url(kit/fonts/Rubik.woff2) format("woff2"); font-weight: 300 900; font-display: swap; }

:root { --bg: #0a0f1f; --hull: #151d36; --hull2: #1e2848; --suit: #f28a1f; --cool: #31e6d0; --haz: #ffd23f; --alarm: #ff4d4d; --txt: #eef2ff; --dim: #aab4d4; --fine: #8e9ac0; --r: 18px; color-scheme: dark; }
* { box-sizing: border-box; }
/* The navy is on html only: a body background would paint over the starfield (z-index -1). */
html { scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; color: var(--txt); font: 400 18px/1.6 "Rubik", system-ui, sans-serif; overflow-x: hidden; }
h1, h2, h3, .btn, .stamp { font-family: "Bungee", "Arial Black", sans-serif; font-weight: 400; }
h1, h2, h3 { margin: 0; line-height: 1.02; }
a { color: inherit; }
img, video, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--haz); outline-offset: 3px; }
.wrap { width: min(1220px, 100% - 40px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 60; background: var(--haz); color: #111; font-weight: 600; padding: 12px; }
.skip:focus { top: 12px; }
.hazard { height: 14px; background: repeating-linear-gradient(-45deg, var(--haz) 0 18px, #111 18px 36px); }
.starfield { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; display: block; }

/* Nav: brand, links, the motion button and the playtest button. */
nav { position: sticky; top: 0; z-index: 20; background: rgba(10,15,31,.86); backdrop-filter: blur(8px); }
nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 70px; }
.brand { font: 400 22px "Bungee", sans-serif; text-decoration: none; color: var(--suit); display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand i { width: 30px; height: 30px; border-radius: 50%; background: var(--cool); box-shadow: inset -6px -6px 0 rgba(0,0,0,.2); animation: wobble 3s ease-in-out infinite; flex: none; }
.menu { display: flex; gap: 6px; align-items: center; }
.menu a:not(.btn) { text-decoration: none; padding: 8px 12px; font-weight: 500; color: var(--dim); }
.menu a:not(.btn):hover { color: #fff; }
.menu .btn { padding: 10px 18px; font-size: 14px; }
@media (max-width: 1000px) { .menu a:not(.btn) { display: none; } }
@media (max-width: 760px) { .menu .btn .long { display: none; } }
@media (max-width: 420px) { .brand { font-size: 17px; } .brand i { width: 24px; height: 24px; } .menu .btn { padding: 10px 12px; } }

.motion-toggle { font: 600 14px "Rubik", sans-serif; color: var(--cool); background: transparent; border: 2px solid var(--cool); border-radius: 12px; padding: 8px 12px; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.motion-toggle:hover { background: rgba(49,230,208,.12); }
.motion-toggle .icon { width: 12px; height: 12px; display: inline-block; background: currentColor; clip-path: polygon(0 0, 35% 0, 35% 100%, 0 100%, 0 0, 65% 0, 100% 0, 100% 100%, 65% 100%, 65% 0); }
.motion-toggle[aria-pressed="true"] .icon { clip-path: polygon(0 0, 100% 50%, 0 100%); }
@media (max-width: 520px) { .motion-toggle .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }

/* Buttons. */
.btn { display: inline-flex; gap: 8px; align-items: center; background: var(--suit); color: #1a0e00; text-decoration: none; padding: 15px 26px; border-radius: 12px; border: 0; font-size: 17px; cursor: pointer; box-shadow: 0 5px 0 #9c5306; transition: transform .1s, box-shadow .1s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #9c5306; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #9c5306; }
.btn.cool { background: var(--cool); color: #002a25; box-shadow: 0 5px 0 #13897b; }
.btn.off { background: var(--hull2); color: var(--dim); box-shadow: 0 5px 0 #0c1126; cursor: not-allowed; transform: none; }
.btn[disabled] { opacity: .7; cursor: wait; }

/* Hero: the clip on a tilted monitor, coolant blobs drifting up behind. */
.hero { position: relative; padding: 56px 0 90px; overflow: hidden; }
.hero .wrap { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(36px, 4.4vw, 66px); }
.hero h1 em { font-style: normal; color: var(--cool); display: inline-block; animation: wobble 2.4s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg) translateY(-3px); } }
.hero p { font-size: 21px; color: var(--dim); margin: 22px 0 30px; max-width: 32ch; }
.hero p b { color: var(--txt); font-weight: 600; }
.ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.monitor { position: relative; border-radius: var(--r); overflow: hidden; border: 4px solid var(--hull2); box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 10px var(--hull); transform: rotate(1.5deg); background: #000; }
.monitor video { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; }
.monitor .hud { position: absolute; inset: 0; padding: 14px 18px; display: flex; justify-content: space-between; align-items: flex-start; font: 600 15px "Rubik", sans-serif; pointer-events: none; }
.monitor .hud span { background: rgba(0,0,0,.6); padding: 4px 10px; border-radius: 8px; }
.monitor .alarm { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); background: #c81e1e; color: #fff; font: 400 15px "Bungee", sans-serif; padding: 6px 14px; border-radius: 8px; animation: flash 1s steps(1) infinite; white-space: nowrap; }
@keyframes flash { 50% { opacity: .25; } }
.caption { font-size: 14px; color: var(--dim); margin: 18px 0 0; text-align: right; }
#blobs { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #b9fff5, var(--cool) 45%, #149e8e); opacity: .85; animation: drift linear infinite; }
@keyframes drift { from { transform: translate(0, 0) rotate(0); } to { transform: translate(var(--dx), -110vh) rotate(360deg); } }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } .monitor { transform: none; } #blobs { opacity: .35; } }

section { padding: 100px 0; position: relative; }
@media (max-width: 720px) { section { padding: 72px 0; } }
.title { font-size: clamp(34px, 5vw, 60px); margin-bottom: 16px; }
.lede { font-size: 20px; color: var(--dim); max-width: 50ch; margin: 0 0 46px; }

/* Help wanted. */
.wanted { background: var(--haz); color: #111; }
.wanted .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.poster { background: #fffbea; border: 4px solid #111; border-radius: 6px; padding: 34px; transform: rotate(-2deg); box-shadow: 10px 10px 0 #111; }
.poster h2 { font-size: clamp(34px, 4.6vw, 58px); }
.poster dl { margin: 20px 0 0; font-size: 19px; }
.poster dl div { padding: 10px 0; border-top: 2px dashed #111; display: flex; justify-content: space-between; gap: 18px; }
.poster dd { margin: 0; font-weight: 700; text-align: right; }
.stamp { display: inline-block; margin-top: 22px; color: #c81e1e; border: 4px solid #c81e1e; padding: 6px 16px; transform: rotate(-8deg); font-size: 22px; }
.wanted .side h2 { font-size: clamp(28px, 3.4vw, 42px); margin-bottom: 14px; }
.wanted .side p { font-size: 20px; margin: 0 0 16px; }
@media (max-width: 900px) { .wanted .wrap { grid-template-columns: 1fr; } .poster { padding: 26px; } }

/* The jokes: a shot and a feature, alternating sides. */
.jokes { display: grid; gap: 30px; }
.joke { display: grid; grid-template-columns: 1.2fr 1fr; background: var(--hull); border-radius: var(--r); overflow: hidden; }
.joke:nth-child(even) { grid-template-columns: 1fr 1.2fr; }
.joke:nth-child(even) .pic { order: 2; }
.joke .pic { position: relative; min-height: 320px; background: #000; overflow: hidden; }
.joke .pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.joke:hover .pic img { transform: scale(1.03); }
.joke .txt { padding: clamp(26px, 4vw, 52px); display: flex; flex-direction: column; justify-content: center; }
.joke h3 { font-size: clamp(26px, 3vw, 38px); color: var(--suit); margin-bottom: 12px; }
.joke p { margin: 0; color: var(--dim); font-size: 19px; }
.joke .fine { margin-top: 14px; font-size: 15px; color: var(--fine); font-style: italic; }
@media (max-width: 900px) { .joke, .joke:nth-child(even) { grid-template-columns: 1fr; } .joke:nth-child(even) .pic { order: 0; } .joke .pic { min-height: 0; aspect-ratio: 16/9; } }

/* How co-op works, and the crew slider. */
.how { background: var(--hull); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: s; list-style: none; padding: 0; margin: 0; }
.step { background: var(--bg); border-radius: var(--r); padding: 26px; border-top: 6px solid var(--suit); counter-increment: s; }
.step::before { content: counter(s); font: 400 44px "Bungee", sans-serif; color: var(--suit); display: block; line-height: 1; margin-bottom: 10px; }
.step:nth-child(2) { border-color: var(--haz); } .step:nth-child(2)::before { color: var(--haz); }
.step:nth-child(3) { border-color: var(--alarm); } .step:nth-child(3)::before { color: var(--alarm); }
.step:nth-child(4) { border-color: var(--cool); } .step:nth-child(4)::before { color: var(--cool); }
.step h3 { font-size: 22px; margin-bottom: 8px; }
.step p { margin: 0; color: var(--dim); font-size: 17px; }
@media (max-width: 960px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

.crew { margin-top: 40px; background: var(--bg); border-radius: var(--r); padding: 30px; display: grid; grid-template-columns: 1fr 1.3fr; gap: 30px; align-items: center; }
.crew h3 { font-size: 26px; margin-bottom: 8px; }
.crew p { margin: 0; color: var(--dim); }
.crew label { display: block; font-weight: 600; margin-bottom: 4px; }
.crew input[type=range] { width: 100%; accent-color: var(--suit); height: 30px; }
.suits { display: flex; gap: 8px; margin: 6px 0 16px; min-height: 52px; align-items: flex-end; }
.suits i { width: 30px; height: 50px; border-radius: 15px; background: var(--suit); position: relative; animation: pop .3s ease; }
.suits i::after { content: ""; position: absolute; top: 10px; left: 6px; width: 18px; height: 8px; background: #3aa0e0; border-radius: 3px; }
@keyframes pop { from { transform: scale(0); } }
.readout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.readout div { background: var(--hull2); border-radius: 12px; padding: 12px 14px; }
.readout b { display: block; font: 400 28px "Bungee", sans-serif; color: var(--cool); }
.readout span { font-size: 14px; color: var(--dim); }
@media (max-width: 760px) { .crew { grid-template-columns: 1fr; padding: 22px; } }

/* Try it: hold on the crack to patch it while the tank drains. */
.try .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.rig { position: relative; background: var(--hull); border-radius: var(--r); height: 340px; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; }
.pipe { position: absolute; left: 0; right: 0; top: 90px; height: 46px; background: linear-gradient(#ff8a4a, #c2410c 60%, #7c2d12); }
.crack { position: absolute; top: 90px; left: calc(52% - 6px); width: 46px; height: 46px; border-radius: 50%; border: 0; padding: 0; background: radial-gradient(circle, #ffb38a 0 16px, transparent 17px); filter: drop-shadow(0 0 12px #ff6a2a); cursor: pointer; transition: filter .3s; }
.rig.fixed .crack { background: radial-gradient(circle, #9aa3b5 0 16px, transparent 17px); filter: none; }
.ring { position: absolute; top: 90px; left: calc(52% - 6px); width: 46px; height: 46px; border-radius: 50%; background: conic-gradient(var(--haz) calc(var(--p, 0) * 1%), transparent 0); opacity: .9; pointer-events: none; mask: radial-gradient(circle, transparent 16px, #000 17px); }
.tank { position: absolute; right: 24px; bottom: 24px; width: 64px; height: 150px; border: 4px solid var(--txt); border-radius: 12px; overflow: hidden; }
.tank i { position: absolute; bottom: 0; left: 0; right: 0; background: var(--cool); height: 100%; }
.tanklabel { position: absolute; right: 18px; bottom: 182px; font: 600 14px "Rubik", sans-serif; color: var(--dim); text-align: right; }
.rig .say { position: absolute; left: 24px; bottom: 24px; font: 400 22px "Bungee", sans-serif; max-width: 60%; margin: 0; }
.spray { position: absolute; left: 0; top: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--cool); pointer-events: none; }
.points { font: 400 20px "Bungee", sans-serif; color: var(--haz); }
@media (max-width: 900px) { .try .wrap { grid-template-columns: 1fr; } }

/* Playtest signup. */
.signup .box { background: var(--suit); color: #1a0e00; border-radius: 26px; padding: clamp(28px, 6vw, 70px); display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.signup .title { color: #1a0e00; }
.signup p { font-size: 19px; margin: 0 0 14px; }
.signup form { display: grid; gap: 12px; }
.signup label { font-weight: 600; font-size: 15px; display: grid; gap: 6px; }
.signup input, .signup select { font: 500 18px "Rubik", sans-serif; padding: 13px 16px; border-radius: 12px; border: 3px solid #1a0e00; background: #fff7ee; color: #1a0e00; width: 100%; }
.signup input:focus, .signup select:focus { outline: 3px solid #1a0e00; outline-offset: 2px; }
.signup .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.signup .btn { background: #1a0e00; color: var(--suit); box-shadow: 0 5px 0 #000; justify-self: start; }
.signup .trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.signup .notice { font-size: 15px; margin: 14px 0 0; }
.signup .notice a { font-weight: 600; }
.form-msg { font: 400 24px/1.3 "Bungee", sans-serif; margin: 18px 0 0; }
.form-msg:empty { display: none; }
.form-msg.err { font: 600 18px "Rubik", sans-serif; background: #1a0e00; color: #ffb7b7; padding: 12px 16px; border-radius: 12px; }
.sent form, .sent .notice { display: none; }
@media (max-width: 900px) { .signup .box { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .signup .row { grid-template-columns: 1fr; } }

.wish { text-align: center; padding-top: 20px; }
.wish .steam { display: inline-flex; gap: 18px; align-items: center; background: var(--hull); border-radius: var(--r); padding: 22px 28px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.wish .steam p { margin: 0; color: var(--dim); text-align: left; }

footer { padding: 40px 0 70px; color: var(--dim); font-size: 15px; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
footer a { color: var(--suit); }

/* Plain prose pages (privacy). */
.prose { max-width: 70ch; padding: 40px 0 80px; }
.prose h1 { font-size: clamp(32px, 6vw, 56px); color: var(--suit); margin-bottom: 24px; }
.prose h2 { font-size: 24px; color: var(--cool); margin: 36px 0 8px; }
.prose p { color: var(--dim); }

/* Still: the motion button's paused state, and the default under reduced motion.
   CSS loops stop; arcade.js stops the starfield and the video. */
.still *, .still *::before, .still *::after { animation: none !important; transition: none !important; }

/* Reduced motion: no starfield, no blobs, the poster only. Play opts in for this visit. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html:not(.motion-opt-in) *, html:not(.motion-opt-in) *::before, html:not(.motion-opt-in) *::after { animation: none !important; transition: none !important; }
  html:not(.motion-opt-in) .starfield, html:not(.motion-opt-in) #blobs { display: none; }
}
