/* The Tobadia website. Colours are the game's theme (Content/UI/Resources/Theme.uss); panels and buttons are the
   game's own 8x8 kit sprites, nine-sliced at 3x. Pixel art scales only by whole numbers, nearest-neighbour. */

@font-face { font-family: "Silkscreen"; src: url("fonts/Silkscreen-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --bone: #F2EEE4;
  --fog: #B4B4BF;
  --butter: #F6E08C;
  --gold: #E8B43C;
  --ember: #C8403C;
  --night: #2E2838;
  --ink: #1B1622;
  --slate: #555A6E;
  --sky: #4A7CC4;
  --gutter: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  background-image: radial-gradient(ellipse at 50% -20%, #3d3550 0%, var(--ink) 60%);
  background-attachment: fixed;
  color: var(--bone);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
img { max-width: 100%; height: auto; }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--butter); }
a:hover { color: var(--gold); }
.muted { color: var(--fog); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3, .btn, .bar-nav a, .chip {
  font-family: "Silkscreen", ui-monospace, monospace;
  font-weight: normal;
  letter-spacing: 0.02em;
  line-height: 1.25;
}
h1, h2, h3 { color: var(--butter); text-shadow: 2px 2px 0 var(--ink); }
h1 { font-size: 2rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.3rem; margin: 0 0 0.5rem; }
h3 { font-size: 1.05rem; margin: 0.6rem 0 0.25rem; }

main { max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter) 48px; }

/* ---- header and footer ---- */
.bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  max-width: 1040px; margin: 0 auto; padding: 14px var(--gutter);
}
.bar-home { text-decoration: none; }

/* The drawn title (163x42 art pixels): whole-number scales only, 1x in the bar, 2x on phones and 3x on wide screens. */
.title-bar { display: block; width: 163px; height: 42px; }
.hero-h1 { margin: 0; line-height: 0; }
.title-hero { width: 326px; height: 84px; }
@media (min-width: 820px) { .title-hero { width: 489px; height: 126px; } }
.kicker { font-family: "Silkscreen", monospace; color: var(--bone); letter-spacing: 0.2em; margin: 10px 0 18px; font-size: 1.1rem; }
.bar-nav { display: flex; gap: 18px; }
.bar-nav a { color: var(--bone); text-decoration: none; font-size: 0.95rem; }
.bar-nav a:hover, .bar-nav a[aria-current] { color: var(--butter); }
.bar-nav a[aria-current] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

.foot { text-align: center; color: var(--fog); font-size: 0.9rem; padding: 28px var(--gutter) 40px; border-top: 3px solid var(--night); }
.foot p { margin: 12px 0 0; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; }
.foot-links a { display: inline-flex; align-items: center; gap: 8px; color: var(--bone); text-decoration: none; }
.foot-links img { width: 32px; }

/* ---- kit sprites ---- */
.panel {
  border: 9px solid transparent;
  border-image: url("img/kit/Panel.png") 3 fill / 9px round;
  image-rendering: pixelated;
  padding: 12px 16px;
}
.btn {
  display: inline-block; text-decoration: none; text-align: center;
  font-size: 1rem; padding: 10px 14px; min-height: 48px;
  border: 9px solid transparent; image-rendering: pixelated;
}
.btn-primary { border-image: url("img/kit/ButtonPrimary.png") 3 fill / 9px round; color: var(--ink); }
.btn-primary:hover, .btn-primary:active { border-image-source: url("img/kit/ButtonPrimaryPressed.png"); color: var(--ink); }
.btn-primary[data-state="soon"] { pointer-events: none; }
.btn-secondary { border-image: url("img/kit/ButtonSecondary.png") 3 fill / 9px round; color: var(--bone); }
.btn-secondary:hover, .btn-secondary:active { border-image-source: url("img/kit/ButtonSecondaryPressed.png"); color: var(--bone); }
.chip {
  display: inline-block; vertical-align: middle; font-size: 0.7rem; padding: 0 6px; margin-left: 6px;
  border: 6px solid transparent; border-image: url("img/kit/Chip.png") 3 fill / 6px round; image-rendering: pixelated;
  color: var(--bone); text-shadow: none;
}

/* ---- home ---- */
.hero { display: grid; grid-template-columns: 1fr; gap: 8px; align-items: center; padding: 24px 0 32px; }
.lede { font-size: 1.2rem; margin: 0 0 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hero-art { width: 100%; max-width: 320px; justify-self: center; filter: drop-shadow(0 10px 0 rgba(0,0,0,0.25)); }
@media (min-width: 820px) {
  .hero { grid-template-columns: 1.35fr 1fr; padding: 48px 0 56px; }
  .hero-art { max-width: 400px; }
}

.features { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 48px; }
.features p { margin: 0; color: var(--bone); }
@media (min-width: 820px) { .features { grid-template-columns: repeat(3, 1fr); } }

.section-title { text-align: center; margin-bottom: 20px; }
.civs { list-style: none; padding: 0; margin: 0 0 48px; display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .civs { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .civs { grid-template-columns: repeat(3, 1fr); } }
.civ img { display: block; width: 100%; background: var(--ink); }
.civ p { margin: 0; color: var(--fog); font-size: 0.95rem; }

.note { max-width: 720px; margin: 0 auto; }
.note p { margin: 0 0 0.8rem; }
.sign { font-family: "Silkscreen", monospace; color: var(--butter); }

/* ---- support and privacy ---- */
.page-title { margin-top: 24px; }
.cards { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 24px 0 32px; }
@media (min-width: 760px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { display: block; text-decoration: none; color: var(--bone); }
.card:hover { color: var(--bone); }
.card:hover h2 { color: var(--gold); }
.card img { width: 32px; }
.card p { margin: 0; color: var(--fog); }

.prose { max-width: 760px; margin: 24px auto 0; padding: 16px 22px; }
.prose h1 { font-size: 1.6rem; }
.prose h2 { margin-top: 1.6rem; }
.prose h3 { margin-top: 1.2rem; }
.prose p, .prose li { overflow-wrap: anywhere; }
.prose ul { padding-left: 1.2rem; }
.prose code { font-size: 0.9em; background: var(--ink); padding: 1px 5px; }
mark.owner { background: var(--ember); color: var(--bone); padding: 0 4px; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  .bar-nav { gap: 12px; }
  .bar-nav a { font-size: 0.8rem; }
  h1 { font-size: 1.6rem; }
  .btn { width: 100%; }
}

/* The home page shows the title big in its hero, so the bar keeps only the links there. */
body[data-page="index"] .bar-home { visibility: hidden; }
@media (max-width: 819px) { .hero-art { max-width: 200px; order: -1; } }
