/* Base reset */
img { max-width: 100%; }
[hidden] { display: none !important; }
body { margin: 0; }

/* Layout: navy header + footer bands, slate stage between; neon-framed game cards in a two-column grid */
:root {
  --band: #08223a;
  --stage: #48505a;
  --panel: #f2fcf6;
  --ink: #3e464e;
  --neon: #4fb3ff;
  --neon-soft: #9ed6ff;
  --shadow: #1f2a36;
  --void: #000a2c;
  --white: #ffffff;
  --font-logo: "Orbitron", "Segoe UI", sans-serif;
  --font-display: "Tektur", "Orbitron", "Segoe UI", sans-serif;
  --font-body: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  background: var(--stage);
  color: var(--ink);
  font-family: var(--font-body);
  display: flex; flex-direction: column; min-height: 100vh;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--band); }
.wrap {
  width: 100%; max-width: 1600px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Header ---------- */
header { background: var(--band); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-block: 22px; }
.brand { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 36px); text-decoration: none; min-width: 0; }
.brand .mark { width: clamp(48px, 5vw, 80px); height: auto; flex: none; }
.brand .wordmark { width: clamp(180px, 34vw, 560px); height: auto; min-width: 0; }
nav ul { list-style: none; display: flex; gap: clamp(10px, 2.4vw, 40px); margin: 0; padding: 0; flex-wrap: wrap; }
nav a {
  display: block; font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(13px, 1.3vw, 21px); letter-spacing: .32em; padding: 8px 6px 8px 12px;
  color: var(--neon); text-decoration: none; border: 2px solid transparent; border-radius: 4px;
  text-underline-offset: 8px; text-decoration-thickness: 2px;
  transition: border-color .2s, box-shadow .2s, color .2s, text-shadow .2s;
}
nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--neon); }
nav a:hover, nav a:focus-visible {
  outline: none; color: var(--neon-soft); border-color: var(--neon-soft);
  box-shadow: 0 0 6px var(--neon), 0 0 16px var(--neon), 0 0 32px var(--neon), inset 0 0 8px var(--neon);
  text-shadow: 0 0 6px var(--neon);
}

/* ---------- Stage ---------- */
main { flex: 1; display: flex; }
main > .wrap { padding-block: clamp(48px, 8vw, 110px); display: flex; align-items: center; }
section[data-view] { width: 100%; }

.heading {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase; color: var(--neon);
  letter-spacing: .38em; margin: 0; text-align: center; text-wrap: balance;
  text-shadow: -5px 4px 0 var(--shadow);
  font-size: clamp(26px, 3vw, 44px);
}
.heading.big { font-size: clamp(36px, 4.6vw, 70px); line-height: 1.15; }

.panel {
  background: var(--panel); color: var(--ink); border-radius: 36px;
  box-shadow: -18px 18px 34px rgba(20, 28, 38, .55);
}

/* ---------- Games grid ---------- */
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: clamp(48px, 10vw, 220px); }
.game { display: flex; flex-direction: column; align-items: center; gap: 40px; min-width: 0; }
.game .stack { position: relative; width: 100%; max-width: 620px; }
.game .face { display: flex; flex-direction: column; align-items: center; gap: 40px; width: 100%; }
.game .info { display: none; flex-direction: column; align-items: center; gap: 36px; width: 100%; max-width: 640px; }
.game.open .face { display: none; }
.game.open .info { display: flex; }
.info .panel { padding: 32px 30px; font-size: clamp(14px, 1.4vw, 20px); line-height: 1.7; }
.info .panel p { margin: 0; }
.info .panel p + p { margin-top: 1em; }
.info-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px; }

.frame {
  position: relative; display: block; width: 100%; max-width: 100%; margin: 0; cursor: pointer;
  background: none; padding: 14px; border: 4px solid var(--neon-soft); border-radius: 6px;
  box-shadow: 0 0 8px var(--neon), 0 0 22px var(--neon), 0 0 44px rgba(79,179,255,.35), inset 0 0 10px var(--neon);
  transition: box-shadow .25s;
}
.frame:hover { box-shadow: 0 0 10px var(--neon), 0 0 30px var(--neon), 0 0 60px rgba(79,179,255,.5), inset 0 0 12px var(--neon); }
.frame .screen { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: var(--void); }
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.frame:hover img { transform: scale(1.03); }
.badge {
  position: absolute; left: 14px; bottom: 14px; padding: 6px 12px 6px calc(12px + .3em);
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .3em; font-size: clamp(11px, 1vw, 14px);
  color: var(--white); background: rgba(0, 10, 44, .75); border: 1px solid var(--neon-soft); border-radius: 999px;
  box-shadow: 0 0 10px rgba(79, 179, 255, .5);
}
.frame:focus-visible { outline: 3px dashed var(--white); outline-offset: 10px; }
.hint { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--panel); opacity: .8; font-family: var(--font-display); text-shadow: 0 0 4px var(--stage), 0 0 8px var(--stage), 0 0 14px var(--stage); }
.back { font: inherit; font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .26em;
  color: var(--neon); background: none; border: 2px solid var(--neon); border-radius: 999px; padding: 8px 18px; cursor: pointer; }
.back:hover, .back:focus-visible { outline: none; box-shadow: 0 0 10px var(--neon), 0 0 24px var(--neon); }

/* ---------- Home ---------- */
.home {
  position: relative; width: 100%; max-width: 1000px; margin: 0 auto;
  padding: clamp(10px, 1.4vw, 14px); border: 4px solid var(--neon-soft); border-radius: 6px;
  box-shadow: 0 0 8px var(--neon), 0 0 22px var(--neon), 0 0 44px rgba(79,179,255,.35), inset 0 0 10px var(--neon);
}
.home .box { background: var(--void); color: var(--white); padding: clamp(18px, 2.4vw, 28px) clamp(16px, 2.4vw, 26px); }
.home h1 { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .32em; color: var(--neon); font-size: clamp(20px, 2.2vw, 30px); margin: 0 0 1em; text-wrap: balance; text-align: center; padding-left: .32em; /* offsets the space letter-spacing leaves after the last letter */ }
.home p { margin: 0 auto 1.2em; max-width: 60ch; font-size: clamp(14px, 1.3vw, 19px); line-height: 1.7; text-align: center; }
.cta-row { display: flex; justify-content: center; margin-top: 2em; }
.cta {
  display: inline-flex; align-items: center; gap: .5em; text-decoration: none;
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .3em; font-size: clamp(14px, 1.2vw, 17px);
  color: var(--neon); background: var(--band); border: 2px solid var(--neon); border-radius: 999px; padding: 14px 28px 14px calc(28px + .3em);
  box-shadow: 0 0 10px rgba(79, 179, 255, .45); transition: box-shadow .2s, color .2s;
}
.cta:hover, .cta:focus-visible { outline: none; color: var(--neon-soft); box-shadow: 0 0 10px var(--neon), 0 0 28px var(--neon); }
.home p:last-child { margin: 0; }

/* ---------- About ---------- */
.about { display: flex; flex-direction: column; align-items: center; gap: 40px; }
.about .panel { width: 100%; max-width: 1000px; padding: clamp(24px, 3.4vw, 50px) clamp(20px, 3vw, 40px); font-size: clamp(13px, 1.25vw, 19px); line-height: 1.6; }
.about .panel p { margin: 0 0 1.6em; text-align: justify; hyphens: auto; }
.about .panel p:last-child { margin: 0; }
.polaroid { float: left; margin: 0 32px 12px 0; width: clamp(150px, 18vw, 250px); background: #f1efea; padding: 9px 9px 44px;
  border: 1px solid #c8c4bc; position: relative; box-shadow: -2px 3px 6px rgba(0,0,0,.15); }
.polaroid img { display: block; width: 100%; height: auto; aspect-ratio: 1.05; object-fit: cover; }
.pin { position: absolute; top: -26px; left: 50%; width: 34px; height: 44px; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(32px, 7vw, 120px); align-items: start; }
.contact-left { display: flex; flex-direction: column; gap: 40px; align-items: center; }
.fields { display: flex; flex-direction: column; gap: 36px; width: 100%; max-width: 490px; }
.field, .message {
  width: 100%; border: 0; background: var(--panel); color: var(--ink); font-family: var(--font-display);
  letter-spacing: .3em; text-transform: uppercase; font-size: clamp(14px, 1.3vw, 20px);
  box-shadow: -18px 14px 28px rgba(20, 28, 38, .5);
}
.field { border-radius: 999px; padding: 12px 20px; }
.message { border-radius: 44px; padding: 24px 26px; min-height: 420px; resize: vertical; text-transform: none; letter-spacing: .08em; font-family: var(--font-body); }
.field { font-family: var(--font-body); text-transform: none; letter-spacing: .04em; color: #11161b; }
.message { color: #11161b; }
.message::placeholder, .field::placeholder { color: rgba(0, 0, 0, .38); opacity: 1; text-transform: uppercase; letter-spacing: .3em; font-family: var(--font-display); }
.field:focus, .message:focus { outline: none; box-shadow: -18px 14px 28px rgba(20,28,38,.5), 0 0 0 3px var(--neon), 0 0 18px var(--neon); }
.right { display: flex; flex-direction: column; gap: 22px; }
.right .cf-turnstile { align-self: flex-end; min-height: 65px; max-width: 100%; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: flex-end; }
.send { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .32em; font-size: 16px;
  color: var(--neon); background: var(--band); border: 2px solid var(--neon); border-radius: 999px; padding: 12px 26px; cursor: pointer; }
.send:hover, .send:focus-visible { outline: none; box-shadow: 0 0 8px var(--neon), 0 0 24px var(--neon); color: var(--neon-soft); }
.status { font-size: 14px; color: var(--panel); line-height: 1.6; flex: 1 1 260px; min-width: 0; text-shadow: 0 0 4px var(--stage), 0 0 8px var(--stage), 0 0 14px var(--stage); }
.status strong { color: var(--neon-soft); font-weight: 400; user-select: all; }
.status.is-ok { color: var(--neon-soft); }
.status.is-error { color: #ffc2c2; }
.send:disabled { opacity: .6; cursor: progress; box-shadow: none; }
/* Visually hidden labels: read by screen readers, not shown */
.vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Spam trap: kept off-screen so only bots fill it in */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
footer { background: var(--band); }
footer .wrap { display: flex; justify-content: center; gap: clamp(36px, 4vw, 58px); padding-block: 22px calc(22px + env(safe-area-inset-bottom, 0px)); }
.social { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; }
a.social { transition: box-shadow .2s, transform .2s; }
a.social:hover, a.social:focus-visible { outline: none; transform: translateY(-2px); box-shadow: 0 0 12px #ff7aa8, 0 0 26px #ff9b4a; }
.social svg { width: 100%; height: 100%; display: block; }

/* ---------- Narrow ---------- */
@media (max-width: 900px) {
  header .wrap { justify-content: center; }
  .contact { grid-template-columns: 1fr; }
  .message { min-height: 280px; }
}
@media (max-width: 480px) {
  nav a { letter-spacing: .18em; padding: 6px 6px 6px 8px; }
  .social { width: 52px; height: 52px; }
  .polaroid { float: none; margin: 18px auto 24px; width: min(240px, 80%); }
  .about .panel p { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Circuit background (parallax) ---------- */
/* The pattern sits on its own layer behind the content. script.js shifts it
   while the page scrolls, so it moves slower than the content. */
main {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-color: var(--stage);
}
.circuit-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("../images/circuit-board.svg");
  background-repeat: repeat;
  background-size: 1200px 1200px;
  pointer-events: none;
  will-change: transform;
}
