/* Colors and fonts borrowed from the MinistryBase design system (Lora + DM Sans, primary #2E5C8A) */
:root {
  --bg: #f3efe6;
  --surface: #fffcf7;
  --text: #1c2430;
  --muted: #4e5966;
  --primary: #2E5C8A;
  --primary-deep: #1a3352;
  --on-primary: #ffffff;
  --brass: #8d6a32;
  --border: #e3d9c8;
  --focus: #b45309;
  --arcade: #10161e;
  --arcade-card: #1a2330;
  --shadow: 0 22px 50px rgba(48, 32, 12, 0.12);
  --font-display: "Lora", Georgia, serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151b;
    --surface: #1b222b;
    --text: #e6ebf0;
    --muted: #a7b3c0;
    --primary: #8eb6e2;
    --primary-deep: #8eb6e2;
    --on-primary: #0f1a26;
    --brass: #e0c07a;
    --border: #2d3846;
    --focus: #fbbf24;
    --arcade: #0b0f14;
    --arcade-card: #171e28;
    --shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 128px; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  background-blend-mode: multiply;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}
@media (prefers-color-scheme: dark) {
  body { background-image: none; }
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0 0 1rem; text-wrap: pretty; }
a { color: var(--primary); }
a:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
img { max-width: 100%; height: auto; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.kicker {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 20px;
  font-family: var(--font-body);
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--primary);
}
.kicker::before {
  content: ""; width: 22px; height: 2px; background: var(--brass); flex: none;
}

.skip {
  position: absolute; left: 16px; top: -60px;
  background: var(--primary); color: var(--on-primary);
  padding: 10px 14px; border-radius: 6px; z-index: 20;
}
.skip:focus { top: 12px; }

header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
header::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, #1a3352, #2E5C8A 46%, #c4a574);
}
header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 4px 20px; min-height: 76px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; padding: 14px 0; min-height: 44px;
}
.emblem { display: block; width: 50px; height: auto; flex: none; }
.logo-name { display: flex; flex-direction: column; line-height: 0.9; }
.logo-num {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.45rem; letter-spacing: -0.03em;
}
.logo-word {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.02rem; margin-top: 3px;
}
nav { display: flex; flex-wrap: wrap; gap: 2px; }
nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  color: var(--muted); text-decoration: none; font-weight: 500;
}
nav a:hover { color: var(--text); }
nav a[aria-current="page"] {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--brass);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  background: #2E5C8A; color: #fff;
  border: 1px solid #2E5C8A; border-radius: 999px;
  font-weight: 700; text-decoration: none;
  transition: transform .15s ease, filter .15s ease, background .15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: color-mix(in srgb, var(--text) 28%, var(--border));
}
.btn-ghost:hover { background: color-mix(in srgb, var(--text) 6%, transparent); filter: none; }
.btn-light { background: #f6f1e7; color: #1a3352; border-color: #f6f1e7; }
.btn-light:hover { filter: brightness(1.03); }
@media (prefers-color-scheme: dark) {
  .btn { background: #8eb6e2; color: #0f1a26; border-color: #8eb6e2; }
  .btn-ghost { background: transparent; color: #e6ebf0; border-color: #8ea0b5; }
  .btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }
  .btn-light { background: #f6f1e7; color: #1a3352; border-color: #f6f1e7; }
}

.badges { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 28px; padding: 0; }
.badges li {
  font-size: 0.8rem; font-weight: 500; padding: 5px 11px;
  border: 1px solid var(--border); border-radius: 999px; color: var(--muted);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

/* Homepage: the studio. MinistryBase's own site is ministrybase.app. */
.hero { padding: 56px 0 72px; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
.hero h1 {
  font-size: clamp(2.4rem, 4.6vw, 3.7rem);
  max-width: 16ch;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero .lede { color: var(--muted); font-size: 1.15rem; max-width: 38ch; margin-bottom: 32px; }
.actions { display: flex; flex-wrap: wrap; gap: 16px; }
.plate {
  margin: 0; padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.plate img { display: block; width: 100%; border-radius: 14px; }
.work { padding: 8px 0 96px; }
.app-page { padding: 72px 0 96px; }
.app-page h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); margin-bottom: 12px; }
.project .kicker { margin-bottom: 12px; }
.project {
  display: grid; gap: 32px; align-items: center;
  padding: 0;
  border: 0;
}
.project + .project {
  margin-top: 64px;
  padding-top: 64px;
  border-top: 1px solid var(--border);
}
.project h2 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 12px; }
.project .promise {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  line-height: 1.3;
  color: var(--text);
  max-width: 22ch;
  margin-bottom: 16px;
}
.project p { max-width: 42ch; margin-bottom: 22px; }
.stage {
  margin: 0; padding: 18px;
  background:
    radial-gradient(90% 80% at 50% 12%, #5686b4 0%, #2E5C8A 32%, #1a3352 72%, #13263c 100%);
  border-radius: 22px;
  box-shadow: 0 24px 50px rgba(20, 40, 63, 0.16);
}
.stage img {
  display: block; width: 100%; border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}
.tease { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tease a {
  display: block; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border); min-height: 44px;
}
.tease img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.nowrap { white-space: nowrap; }

/* Games */
body.games {
  --bg: #10161e;
  --surface: #1a2330;
  --text: #f4efe6;
  --muted: #c9d3de;
  --primary: #e7c98a;
  --brass: #e0c07a;
  --border: rgba(255, 255, 255, 0.1);
  background-color: #10161e;
  background-image:
    radial-gradient(80% 50% at 10% 0%, rgba(46, 92, 138, 0.35), transparent 60%),
    radial-gradient(60% 40% at 100% 8%, rgba(196, 165, 116, 0.16), transparent 55%);
  background-blend-mode: normal;
  color: #f4efe6;
  color-scheme: dark;
}
.games-intro { padding: 64px 0 56px; }
.games-intro h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  margin-bottom: 18px;
}
.games-intro .lede { max-width: 46ch; color: #c9d3de; font-size: 1.12rem; margin-bottom: 32px; }
.catalog { padding: 0 0 96px; }
.group {
  font-family: var(--font-body);
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: #e7c98a;
  margin: 56px 0 20px;
}
.group:first-child { margin-top: 0; }
.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.game {
  display: flex; flex-direction: column;
  background: var(--arcade-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px; overflow: hidden;
  color: #f4efe6; text-decoration: none; min-height: 44px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  transition: transform .18s ease, border-color .18s ease;
}
.game .frame { display: block; overflow: hidden; aspect-ratio: 3 / 4; background: #0e141c; }
.game img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .35s ease;
}
.game .info { padding: 16px 16px 18px; }
.game h3 { font-size: 1.05rem; margin: 0 0 8px; }
.game p { margin: 0; font-size: 0.88rem; color: #b7c3d0; line-height: 1.4; }
@media (hover: hover) {
  .game:hover { transform: translateY(-4px); border-color: rgba(231, 201, 138, 0.7); }
  .game:hover img { transform: scale(1.045); }
}

/* About */
.portrait { padding: 72px 0 0; }
.about-grid { display: grid; gap: 40px; align-items: center; }
.portrait h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); margin-bottom: 20px; }
.portrait p { max-width: 58ch; }
.about-art { margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
.about-art img {
  display: block; width: min(100%, 320px); aspect-ratio: 1;
  object-fit: cover; border-radius: 18px;
  box-shadow: var(--shadow);
}
#contact { padding: 72px 0 96px; }
.contact-panel {
  background:
    radial-gradient(80% 80% at 100% 0%, rgba(196, 165, 116, 0.2), transparent 50%),
    #1a3352;
  color: #f6f1e7;
  border-radius: 28px;
  padding: 48px 28px;
}
.contact-panel h2 { font-size: clamp(2rem, 4vw, 2.8rem); color: #fff; margin-bottom: 16px; }
.contact-panel p:not(.kicker) { max-width: 46ch; color: #d5dde6; font-size: 1.1rem; margin-bottom: 28px; }
.contact-panel .kicker { color: #f3e6c8; }
.contact-panel .kicker::before { background: #e0c07a; }
@media (prefers-color-scheme: dark) {
  .contact-panel { border: 1px solid #34506e; }
}

footer { border-top: 1px solid var(--border); padding: 36px 0 44px; color: var(--muted); font-size: 0.92rem; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }
footer p { margin: 0; }
footer a { color: var(--primary); font-weight: 700; }

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .contact-panel { padding: 36px 22px; }
  nav a { padding: 0 8px; }
}
@media (min-width: 720px) {
  html { scroll-padding-top: 88px; }
}
@media (min-width: 800px) {
  .hero { padding: 80px 0 104px; }
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: 72px; }
  .project { grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr); gap: 72px; }
  .project + .project { margin-top: 80px; padding-top: 80px; }
  .about-grid { grid-template-columns: 0.82fr 1.18fr; gap: 80px; }
  .about-art { order: -1; }
  .contact-panel { padding: 64px; }
}
@media (min-width: 900px) {
  .game-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .game, .game img { transition: none; }
  .game:hover { transform: none; }
  .game:hover img { transform: none; }
}
