/* Unbound Towers landing page: the game's own colours, pixel art kept sharp */

/* Pixelify Sans, self-hosted under the SIL Open Font License, see assets/fonts/OFL.txt */
@font-face {
  font-family: "Pixelify Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/pixelify-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Pixelify Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/pixelify-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #10121c;
  --bg-dark: #0a0b12;
  --panel: #171a28;
  --panel-border: #2a2f45;
  --text: #e6e9f2;
  --muted: #9aa0b5;
  --gold: #ffd34e;
  --gold-dark: #feae34;
  --gold-lip: #d77643;
  --blue: #0099db;
  --blue-light: #2ce8f5;
  --blue-lip: #124e89;
  --navy: #181425;
  --green: #5ee07a;
  --radius: 4px;
  --heading: "Pixelify Sans", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
}

/* the art is pixel art, scaling it must not blur it */
.pixel,
.gallery img,
.feature-maps img,
.hero-art,
.hero-video,
.press-shots img {
  image-rendering: pixelated;
}

a {
  color: var(--blue-light);
}

h1,
h2,
h3 {
  font-family: var(--heading);
  /* the pixel font draws its fi ligature as a different letter */
  font-variant-ligatures: none;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

.container {
  width: min(1180px, 100% - 32px);
  margin-inline: auto;
}

.container.narrow {
  width: min(960px, 100% - 32px);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--gold);
  color: var(--navy);
  padding: 8px 12px;
  z-index: 100;
}

.skip-link:focus {
  left: 8px;
}

:focus-visible {
  outline: 3px solid var(--blue-light);
  outline-offset: 3px;
}

/* ---------- buttons, drawn like the game's: a face, a darker lip and a navy outline ---------- */

.btn {
  display: inline-block;
  font-family: var(--heading);
  font-variant-ligatures: none;
  font-weight: 600;
  font-size: 20px;
  text-decoration: none;
  text-align: center;
  padding: 12px 26px 14px;
  border: 3px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: inset 0 -6px 0 var(--lip), inset 0 3px 0 var(--shine);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55);
  color: #fff;
  background: var(--face);
  transition: transform 80ms ease, filter 120ms ease;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: inset 0 -2px 0 var(--lip);
}

.btn-blue {
  --face: var(--blue);
  --lip: var(--blue-lip);
  --shine: var(--blue-light);
}

.btn-gold {
  --face: var(--gold-dark);
  --lip: var(--gold-lip);
  --shine: var(--gold);
}

.btn-small {
  font-size: 16px;
  padding: 6px 14px 9px;
}

/* a link that isn't set yet, see js/main.js */
.btn.is-soon {
  background: #3a3f57;
  box-shadow: inset 0 -6px 0 #23263a, inset 0 3px 0 #4a5070;
  cursor: default;
  filter: none;
  transform: none;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 11, 18, 0.88);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--panel-border);
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 60px;
}

.nav-brand {
  font-variant-ligatures: none;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 20px;
}

.nav-links {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--heading);
  font-size: 18px;
}

.nav-links a:hover {
  color: var(--text);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 120px;
  text-align: center;
  isolation: isolate;
}

/* the still key art, the looping gameplay over it, and a dark gradient over both for the text */
.hero-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../assets/hero.webp") center / cover no-repeat;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 18, 28, 0.6) 0%, rgba(16, 18, 28, 0.8) 60%, var(--bg) 100%);
}

.hero-logo {
  margin: 0 auto 18px;
  max-width: 640px;
}

.hero-logo img {
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.35));
}

.hero-tagline {
  font-family: var(--heading);
  font-variant-ligatures: none;
  line-height: 1.3;
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 600;
  margin: 0 auto 10px;
  max-width: 820px;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
}

.hero-sub {
  color: #d0d5e6;
  margin: 0 auto 30px;
  max-width: 640px;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
}

/* the game at a glance, under the tagline */
.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  list-style: none;
  margin: 0 auto 28px;
  padding: 0;
  max-width: 760px;
}

.facts li {
  font-family: var(--heading);
  font-size: 15px;
  padding: 3px 10px 4px;
  background: rgba(10, 11, 18, 0.72);
  border: 2px solid var(--panel-border);
  border-radius: var(--radius);
  color: #d0d5e6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

/* the mailing list, hidden until js/main.js has its address */
.newsletter {
  margin: 26px auto 0;
  max-width: 460px;
  text-align: left;
}

.newsletter[hidden] {
  display: none;
}

.newsletter label {
  display: block;
  font-family: var(--heading);
  font-size: 16px;
  margin-bottom: 6px;
  color: #d0d5e6;
}

.newsletter-row {
  display: flex;
  gap: 8px;
}

.newsletter input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  padding: 8px 12px;
  color: var(--text);
  background: var(--bg-dark);
  border: 2px solid var(--panel-border);
  border-radius: var(--radius);
}

.newsletter input:focus {
  border-color: var(--blue-light);
  outline: none;
}

/* the tanks of the game rolling along the bottom of the hero */
.convoy {
  position: absolute;
  left: 0;
  bottom: 24px;
  display: flex;
  align-items: flex-end;
  gap: 48px;
  white-space: nowrap;
  animation: convoy 38s linear infinite;
  /* already rolling when the page opens */
  animation-delay: -16s;
}

.convoy img {
  width: auto;
  height: 52px;
  flex: none;
}

.convoy img:last-child {
  height: 72px;
}

@keyframes convoy {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100vw);
  }
}

/* ---------- sections ---------- */

.section {
  padding: 84px 0;
}

.section-dark {
  background: var(--bg-dark);
  border-block: 2px solid var(--panel-border);
}

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  text-align: center;
  color: var(--gold);
  margin-bottom: 40px;
}

.section-title.left {
  text-align: left;
  margin-bottom: 20px;
}

/* ---------- features ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}

.feature {
  background: var(--panel);
  border: 2px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 26px 24px 20px;
}

.feature h3 {
  font-size: 24px;
  color: #fff;
}

.feature p {
  color: var(--muted);
  margin: 0;
}

.feature-icon {
  display: block;
  height: 64px;
  width: auto;
  object-fit: contain;
  margin-bottom: 14px;
}

.feature-maps {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.feature-maps img {
  width: 33%;
  border: 2px solid var(--navy);
  border-radius: 2px;
}

/* ---------- screenshots ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.shot {
  display: block;
  width: 100%;
  padding: 0;
  border: 3px solid var(--navy);
  border-radius: var(--radius);
  background: var(--navy);
  cursor: zoom-in;
  overflow: hidden;
}

.shot img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 200ms ease;
}

.shot:hover img {
  transform: scale(1.03);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 6, 10, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 16px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-image {
  max-width: min(1600px, 100%);
  max-height: 100%;
  border: 3px solid var(--navy);
}

.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: #fff;
  font-size: 48px;
  line-height: 1;
  cursor: pointer;
  padding: 8px 14px;
}

.lightbox-close {
  top: 8px;
  right: 12px;
}

.lightbox-prev {
  left: 8px;
}

.lightbox-next {
  right: 8px;
}

/* ---------- trailer ---------- */

.trailer {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 3px solid var(--navy);
  border-radius: var(--radius);
}

/* ---------- setup and call to action ---------- */

.two-col {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.checklist li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 12px;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.55em;
  width: 12px;
  height: 12px;
  background: var(--green);
  box-shadow: 2px 2px 0 var(--navy);
}

.cta-card {
  background: var(--panel);
  border: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 32px 28px;
  display: grid;
  gap: 14px;
  text-align: center;
}

.cta-card h2 {
  color: var(--gold);
  font-size: 32px;
  margin: 0;
}

.cta-card p {
  color: var(--muted);
  margin: 0 0 6px;
}

.stores {
  font-size: 15px;
}

.stores[hidden] {
  display: none;
}

.play-tools .stores {
  margin: 0;
}

/* the dot is inline-block so the link's underline skips it */
.stores a + a::before {
  content: "\00b7";
  display: inline-block;
  margin: 0 8px 0 4px;
  color: var(--muted);
}

/* ---------- questions ---------- */

.faq {
  display: grid;
  gap: 10px;
}

.faq details {
  background: var(--panel);
  border: 2px solid var(--panel-border);
  border-radius: var(--radius);
}

.faq summary {
  font-family: var(--heading);
  font-size: 20px;
  color: #fff;
  padding: 14px 20px;
  cursor: pointer;
}

.faq details[open] summary {
  color: var(--gold);
}

.faq p {
  color: var(--muted);
  margin: 0;
  padding: 0 20px 16px;
}

/* ---------- footer ---------- */

.site-footer {
  padding: 32px 0;
  color: var(--muted);
  font-size: 15px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links [hidden] {
  display: none;
}

/* ---------- the demo page ---------- */

.play-page {
  padding: 40px 0 72px;
}

.play-page h1 {
  font-size: clamp(28px, 4vw, 40px);
  color: var(--gold);
  margin-bottom: 6px;
}

.play-intro {
  color: var(--muted);
  margin: 0 0 22px;
}

/* only on screens that are touched, not pointed at */
.touch-note {
  display: none;
  margin: 0 0 22px;
  padding: 12px 16px;
  background: var(--panel);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
}

@media (pointer: coarse) {
  .touch-note {
    display: block;
  }
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(240px, 1fr);
  gap: 28px;
  align-items: start;
}

.play-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 3px solid var(--navy);
  border-radius: var(--radius);
  overflow: hidden;
}

.play-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.play-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
}

.play-aside {
  display: grid;
  gap: 18px;
}

.keys {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin: 0;
  font-size: 15px;
}

.keys dt {
  font-family: var(--heading);
  color: var(--gold);
}

.keys dd {
  margin: 0;
  color: var(--muted);
}

/* ---------- the press page ---------- */

.press-page {
  padding: 48px 0 80px;
}

.press-page h1 {
  font-size: clamp(32px, 5vw, 48px);
  color: var(--gold);
}

.press-page h2 {
  font-size: 28px;
  color: var(--gold);
  margin-top: 48px;
}

.press-layout {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 2.2fr);
  gap: 40px;
  align-items: start;
}

.factsheet {
  background: var(--panel);
  border: 2px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 22px 22px 10px;
  position: sticky;
  top: 84px;
}

.factsheet dl {
  margin: 0;
}

.factsheet dt {
  font-family: var(--heading);
  color: var(--gold);
  font-size: 16px;
}

.factsheet dd {
  margin: 0 0 14px;
  color: var(--text);
}

.press-text p,
.press-text li {
  color: #cfd3e2;
}

.press-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 8px;
}

.press-shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.press-shots a {
  display: block;
  border: 3px solid var(--navy);
  border-radius: var(--radius);
  overflow: hidden;
}

.press-shots img {
  display: block;
  width: 100%;
}

.logo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.logo-row a {
  display: grid;
  place-items: center;
  padding: 16px;
  min-height: 120px;
  background: repeating-conic-gradient(#20243a 0% 25%, #191c2d 0% 50%) 0 0 / 20px 20px;
  border: 2px solid var(--panel-border);
  border-radius: var(--radius);
}

.logo-row img {
  max-height: 140px;
  width: auto;
}

.updated {
  color: var(--muted);
  font-size: 14px;
}

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  .nav-links {
    display: none;
  }

  .nav .btn {
    margin-left: auto;
  }

  .hero {
    padding: 48px 0 104px;
  }

  .two-col,
  .play-layout,
  .press-layout {
    grid-template-columns: 1fr;
  }

  .factsheet {
    position: static;
  }

  .gallery,
  .features {
    grid-template-columns: 1fr;
  }

  .btn {
    font-size: 18px;
  }
}

@media (max-width: 420px) {
  .nav-brand span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .convoy {
    animation: none;
    left: 50%;
    transform: translateX(-50%);
  }

  .shot img,
  .btn {
    transition: none;
  }
}
