:root {
  --bg: #050507;
  --bg-2: #0c0c10;
  --panel: #111116;
  --line: #24242c;
  --text: #ececf0;
  --muted: #9a9aa4;
  --steel: #a6a6ad;
  --red: #d8243c;
  --red-hot: #ff3550;
  --radius: 14px;
  --max: 1120px;
  --head: "Exo 2", system-ui, sans-serif;
  --body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--head); line-height: 1.1; margin: 0; }
h2 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700; letter-spacing: .01em; }
h3 { font-size: 1.5rem; font-weight: 600; }
p { margin: 0; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--red); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 20; }
.skip:focus { left: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--red-hot); outline-offset: 3px; border-radius: 6px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(16px, calc((100vw - var(--max)) / 2));
  background: rgba(5, 5, 7, .78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.nav__brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font: 600 15px var(--head); letter-spacing: .22em; color: var(--steel); white-space: nowrap; }
.nav__brand img { width: 56px; }
.nav__brand b { color: var(--red); font-weight: 600; }
.nav nav { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.nav nav a { text-decoration: none; color: var(--muted); transition: color .15s; }
.nav nav a:hover { color: var(--text); }
.nav nav a.nav__cta { color: var(--text); border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px; }
.nav nav a.nav__cta:hover { border-color: var(--red); }

/* Hero */
.hero {
  position: relative; isolation: isolate;
  min-height: calc(100svh - 64px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 16px 80px; text-align: center;
}
.hero__glow {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 60% 45% at 62% 42%, rgba(216, 36, 60, .16), transparent 70%),
    radial-gradient(ellipse 50% 40% at 30% 50%, rgba(166, 166, 173, .06), transparent 70%);
}
.hero__glow::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.hero__logo { width: min(760px, 100%); animation: swim 1.1s cubic-bezier(.2, .7, .2, 1) both; }
.hero__tag { margin-top: 28px; font: 500 clamp(1.1rem, 2.4vw, 1.35rem) var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); animation: rise .8s .35s both; }
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 36px; animation: rise .8s .5s both; }

@keyframes swim { from { opacity: 0; transform: translateX(-40px); filter: blur(6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; border-radius: 10px;
  font: 600 15px var(--head); letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s, background .15s, border-color .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--red); color: #fff; box-shadow: 0 8px 30px -10px rgba(216, 36, 60, .7); }
.btn--primary:hover { background: var(--red-hot); }
.btn--ghost { border-color: var(--line); color: var(--text); background: rgba(255,255,255,.02); }
.btn--ghost:hover { border-color: var(--steel); }

/* Sections */
.section { max-width: var(--max); margin: 0 auto; padding: 96px 16px; }
.eyebrow { font: 600 13px var(--head); letter-spacing: .3em; text-transform: uppercase; color: var(--red); margin-bottom: 14px; }
.section h2 { margin-bottom: 36px; }

/* Teaser */
.teaser {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 40px; align-items: center;
  padding: 40px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.teaser::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(var(--red), transparent); }
.teaser__mark { aspect-ratio: 16 / 10; display: grid; place-items: center; border-radius: 10px; background: radial-gradient(circle at 60% 45%, rgba(216,36,60,.18), transparent 65%), #08080b; border: 1px solid var(--line); }
.teaser__mark img { width: 72%; filter: brightness(.5) blur(1px); opacity: .9; }
.teaser__label { font: 600 12px var(--head); letter-spacing: .26em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.teaser h3 { margin-bottom: 12px; }
.teaser p:not(.teaser__label) { color: var(--muted); max-width: 46ch; }
.link { display: inline-block; margin-top: 18px; color: var(--red-hot); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }

/* Game cards (rendered from games.json) */
.games { display: grid; gap: 20px; }
.games:empty { display: none; }
.games:not(:empty) + .teaser { margin-top: 20px; }
.card { border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; transition: border-color .2s, transform .2s; }
.card:hover { border-color: #3a3a44; transform: translateY(-3px); }
.card__media { aspect-ratio: 16 / 9; background: #08080b; object-fit: cover; width: 100%; }
.card__body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__status { font: 600 12px var(--head); letter-spacing: .2em; text-transform: uppercase; color: var(--red); }
.card__body p { color: var(--muted); font-size: 15px; }
.card__actions { margin-top: auto; padding-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; }
@media (min-width: 761px) {
  .card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 40px; align-items: center; padding: 40px; position: relative; }
  .card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(var(--red), transparent); }
  .card__media { border-radius: 10px; border: 1px solid var(--line); }
  .card__body { padding: 0; }
  .card__body h3 { font-size: 1.5rem; }
  .card__body p { font-size: 17px; max-width: 46ch; }
  .card:hover { transform: none; }
}

/* Studio */
.studio { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; border-top: 1px solid var(--line); }
.studio h2 { margin-bottom: 0; }
.studio__copy { display: grid; gap: 18px; color: var(--muted); font-size: 18px; }

/* Join */
.join { text-align: center; border-top: 1px solid var(--line); }
.join h2 { margin-bottom: 14px; }
.join__lead { color: var(--muted); max-width: 52ch; margin: 0 auto 32px; }
.join__form { display: flex; gap: 10px; max-width: 520px; margin: 0 auto; }
.join__form input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 16px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 16px;
}
.join__form input::placeholder { color: #5e5e68; }
.join__form input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(216, 36, 60, .2); }
.join__status { min-height: 1.6em; margin-top: 14px; color: var(--muted); font-size: 15px; }
.join__status.is-error { color: var(--red-hot); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 40px 16px 56px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.footer img { width: 72px; opacity: .7; margin-bottom: 6px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav nav a:not(.nav__cta) { display: none; }
  .nav__brand span { display: none; }
  .section { padding: 72px 16px; }
  .teaser { grid-template-columns: 1fr; padding: 24px; gap: 24px; }
  .studio { grid-template-columns: 1fr; gap: 20px; }
  .join__form { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* 404 */
.lost__mark { width: min(320px, 70%); }
.lost__title { margin-top: 32px; font-size: clamp(2rem, 6vw, 3.2rem); }

/* Teaser screenshot */
.teaser__shot { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 9; }
.teaser__shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.teaser__shot:hover img { transform: scale(1.03); }

/* Devlog cards */
.devlog-latest { border-top: 1px solid var(--line); }
.devlog-latest__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 36px; }
.devlog-latest__head h2 { margin-bottom: 0; }
.devlog-latest__head .link { margin-top: 0; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.post-card { display: flex; flex-direction: column; text-decoration: none; border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--line); transition: border-color .2s, transform .2s; }
.post-card:hover { border-color: #3a3a44; transform: translateY(-3px); }
.post-card__media { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; background: #08080b; }
.post-card__body { padding: 20px; display: grid; gap: 8px; }
.post-card__body time { font: 600 12px var(--head); letter-spacing: .2em; text-transform: uppercase; color: var(--red); }
.post-card__body h3 { font-size: 1.3rem; }
.post-card__body p { color: var(--muted); font-size: 15px; }

/* Devlog index */
.devlog__title { font-size: clamp(2.4rem, 6vw, 3.6rem); margin-bottom: 14px; }
.devlog__lead { color: var(--muted); margin-bottom: 40px; max-width: 60ch; }
.devlog__lead a { color: var(--red-hot); }
.devlog__empty { color: var(--muted); }

/* Post */
.post { max-width: 820px; margin: 0 auto; padding: 64px 16px 32px; }
.post__back { display: inline-block; margin-bottom: 28px; color: var(--muted); text-decoration: none; font-size: 15px; }
.post__back:hover { color: var(--text); }
.post__head h1 { font-size: clamp(2.2rem, 5.5vw, 3.4rem); margin-bottom: 18px; }
.post__summary { color: var(--muted); font-size: 1.2rem; }
.post__cover { margin: 40px 0; border-radius: var(--radius); border: 1px solid var(--line); width: 100%; }
.prose { font-size: 18px; line-height: 1.75; color: #d6d6dc; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 1.9rem; margin-top: 2.2em; color: var(--text); }
.prose h3 { font-size: 1.4rem; margin-top: 1.8em; color: var(--text); }
.prose a { color: var(--red-hot); }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .5em; }
.prose li::marker { color: var(--red); }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--red); color: var(--text); font-style: italic; }
.prose code { font-size: .9em; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose figure { margin: 2em 0; }
.prose figure img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.prose figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); text-align: center; }
.post__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.post__nav-link { display: grid; gap: 4px; text-decoration: none; color: var(--text); font-weight: 600; }
.post__nav-link span { font: 600 12px var(--head); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.post__nav-link--older { text-align: right; }
.post__nav-link:hover { color: var(--red-hot); }
.nav nav a[aria-current="page"] { color: var(--text); }

/* Footer socials */
.footer__social { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-bottom: 6px; }

@media (max-width: 760px) {
  .devlog-latest__head { flex-direction: column; align-items: start; }
  .post { padding-top: 40px; }
  .prose { font-size: 17px; }
}

/* Arcade */
.arcade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.arcade-card { display: flex; flex-direction: column; text-decoration: none; border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--line); transition: border-color .2s, transform .2s; }
.arcade-card:hover { border-color: var(--red); transform: translateY(-3px); }
.arcade-card__media { position: relative; display: block; aspect-ratio: 16 / 9; background: #08080b; }
.arcade-card__media img { width: 100%; height: 100%; object-fit: cover; }
.arcade-card__play { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: rgba(216, 36, 60, .92); color: #fff; font-size: 22px; padding-left: 4px; box-shadow: 0 10px 40px -8px rgba(216, 36, 60, .8); opacity: 0; transform: scale(.85); transition: opacity .2s, transform .2s; }
.arcade-card:hover .arcade-card__play, .arcade-card:focus-visible .arcade-card__play { opacity: 1; transform: none; }
.arcade-card__body { padding: 20px; display: grid; gap: 8px; }
.arcade-card__tag { font: 600 12px var(--head); letter-spacing: .2em; text-transform: uppercase; color: var(--red); }
.arcade-card__body h3 { font-size: 1.4rem; }
.arcade-card__body p { color: var(--muted); font-size: 15px; }

.arcade-game { padding-top: 48px; }
.arcade-game__title { font-size: clamp(2.6rem, 7vw, 4.2rem); margin-bottom: 10px; }
.arcade-game__tagline { color: var(--muted); font-size: 1.2rem; margin-bottom: 28px; max-width: 60ch; }

.player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #000; }
.player__poster { width: 100%; height: 100%; object-fit: cover; filter: brightness(.6); }
.player__start {
  position: absolute; inset: 0; margin: auto; width: max-content; height: 64px; padding: 0 32px;
  display: inline-flex; align-items: center; gap: 12px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--red); color: #fff; font: 700 18px var(--head); letter-spacing: .12em; text-transform: uppercase;
  box-shadow: 0 14px 50px -10px rgba(216, 36, 60, .9); transition: background .15s, transform .15s;
}
.player__start:hover { background: var(--red-hot); transform: scale(1.04); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.player__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 14px; color: var(--muted); font-size: 15px; }
.player__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.player__actions .btn { min-height: 40px; padding: 0 16px; font-size: 13px; }
.player__actions [data-player-fullscreen][disabled] { opacity: .45; cursor: not-allowed; }

.arcade-game__info { max-width: 820px; margin-top: 48px; }
.controls { width: 100%; border-collapse: collapse; font-size: 15px; }
.controls th, .controls td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.controls thead th { font: 600 12px var(--head); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.controls tbody th { color: var(--text); font-weight: 600; }

/* Home: arcade strip */
.arcade-latest { border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  .arcade-grid { grid-template-columns: 1fr; }
  .controls { font-size: 14px; }
  .controls th, .controls td { padding: 8px 6px; }
  .player__start { height: 56px; font-size: 16px; padding: 0 24px; }
}

/* Feedback */
.feedback__form { display: grid; gap: 10px; max-width: 640px; }
.feedback__form label { font-weight: 600; margin-top: 10px; }
.feedback__form label span { font-weight: 400; color: var(--muted); }
.feedback__form select, .feedback__form textarea, .feedback__form input {
  width: 100%; padding: 12px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); font: inherit; font-size: 16px;
}
.feedback__form textarea { resize: vertical; min-height: 150px; }
.feedback__form select:focus, .feedback__form textarea:focus, .feedback__form input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(216, 36, 60, .2); }
.feedback__form .btn { justify-self: start; margin-top: 14px; }
.feedback__form .btn:disabled { opacity: .6; cursor: progress; }
.feedback__status { min-height: 1.6em; color: var(--muted); }
.feedback__status.is-error { color: var(--red-hot); }
.feedback__privacy { color: var(--muted); font-size: 14px; }
.feedback__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.arcade-game__feedback { margin-top: 2em; color: var(--muted); }

/* Private inbox */
.inbox { padding-top: 48px; }
.inbox__user { color: var(--muted); font-size: 14px; }
.inbox__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 8px 0 18px; }
.inbox__tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.inbox__tabs button { background: transparent; color: var(--muted); border: 0; padding: 10px 16px; font: 600 14px var(--body); cursor: pointer; }
.inbox__tabs button + button { border-left: 1px solid var(--line); }
.inbox__tabs button[aria-selected="true"] { background: var(--panel); color: var(--text); box-shadow: inset 0 -2px 0 var(--red); }
.inbox__filter select { padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 14px; }
.inbox__refresh { min-height: 40px; padding: 0 16px; font-size: 13px; }
.inbox__status { color: var(--muted); margin-bottom: 14px; }
.inbox__status.is-error { color: var(--red-hot); }
.inbox__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.inbox-item { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 10px; }
.inbox-item.is-archived { border-left-color: var(--line); opacity: .8; }
.inbox-item__head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.inbox-item__topic { font: 600 12px var(--head); letter-spacing: .18em; text-transform: uppercase; color: var(--red); }
.inbox-item__time { color: var(--muted); font-size: 14px; }
.inbox-item__message { white-space: pre-wrap; overflow-wrap: anywhere; }
.inbox-item__meta { color: var(--muted); font-size: 14px; }
.inbox-item__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inbox-item__actions .btn { min-height: 38px; padding: 0 14px; font-size: 12px; overflow-wrap: anywhere; }
.inbox-item__delete:hover { border-color: var(--red-hot); color: var(--red-hot); }
