/* Typing Warrior website */

@font-face {
  font-family: "TW Display";
  src: url("../fonts/display-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "TW Text";
  src: url("../fonts/text-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --dark: #140c08;
  --panel: #2b1d14;
  --panel-deep: #1e140e;
  --line: #4a3322;
  --brown: #6b4a33;
  --gold: #f2c879;
  --title: #ffd23f;
  --cream: #fff6e6;
  --muted: #cbb9a3;
  --teal: #6fe3ea;
  --teal-deep: #3fc1c9;
  --orange: #e8743b;
  --purple: #6b3fa0;
  --purple-line: #b79be0;
  --key: #f6ebd6;
  --ink: #2a1e16;
  --red: #d2382a;

  --display: "TW Display", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --text: "TW Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --wrap: 1120px;
  --gutter: 20px;
  --radius: 22px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--dark);
  color: var(--cream);
  font-family: var(--text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--teal);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--cream);
}

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

p {
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 20;
  background: var(--cream);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Header ---------- */

.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 20px;
  color: var(--cream);
  text-decoration: none;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.brand img {
  width: 34px;
  height: 34px;
}

.brand span b {
  font-weight: 400;
  color: var(--title);
}

.nav {
  display: flex;
  gap: 6px;
}

.nav a {
  color: var(--cream);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 999px;
}

.nav a:hover,
.nav a[aria-current="page"] {
  background: rgba(20, 12, 8, 0.6);
  color: var(--gold);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 112px 0 72px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("../img/hero-desert-town.webp") center top / cover no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(20, 12, 8, 0.72) 0%, rgba(20, 12, 8, 0.38) 30%, rgba(20, 12, 8, 0.82) 78%, var(--dark) 100%),
    linear-gradient(90deg, rgba(20, 12, 8, 0.72) 0%, rgba(20, 12, 8, 0) 70%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 48px;
  align-items: center;
}

.logo {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.logo-keys {
  display: flex;
  gap: clamp(4px, 0.8vw, 8px);
}

.logo-keys span {
  width: clamp(40px, 6.2vw, 64px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 22%;
  background: var(--key);
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(24px, 3.8vw, 40px);
  line-height: 1;
  box-shadow: 0 0.12em 0 #120a06, 0 0.3em 0.6em rgba(0, 0, 0, 0.45);
  animation: key-hit 6s infinite;
}

.logo-keys span:nth-child(1) { animation-delay: 0.6s; }
.logo-keys span:nth-child(2) { animation-delay: 0.85s; }
.logo-keys span:nth-child(3) { animation-delay: 1.1s; }
.logo-keys span:nth-child(4) { animation-delay: 1.35s; }
.logo-keys span:nth-child(5) { animation-delay: 1.6s; }
.logo-keys span:nth-child(6) { animation-delay: 1.85s; }

@keyframes key-hit {
  0%, 2% { background: var(--key); color: var(--ink); transform: translateY(0); }
  4% { background: var(--teal); color: #0e3a3d; transform: translateY(3px); }
  7%, 62% { background: var(--teal); color: #0e3a3d; transform: translateY(0); }
  70%, 100% { background: var(--key); color: var(--ink); transform: translateY(0); }
}

.logo-word {
  font-family: var(--display);
  font-size: clamp(64px, 11.5vw, 124px);
  line-height: 0.95;
  color: var(--title);
  letter-spacing: 0.01em;
  -webkit-text-stroke: 0.09em #1a0d05;
  paint-order: stroke fill;
  text-shadow: 0 0.06em 0 #1a0d05;
}

.tagline {
  margin-top: 14px;
  font-weight: 700;
  font-size: clamp(15px, 1.8vw, 19px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
}

.pitch {
  margin-top: 20px;
  max-width: 33em;
  font-size: clamp(17px, 1.7vw, 20px);
  color: var(--cream);
  text-shadow: 0 1px 8px rgba(20, 12, 8, 0.8);
}

.cta-row {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 28px;
  border-radius: 18px;
  background: var(--orange);
  color: #fff;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.03em;
  text-decoration: none;
  box-shadow: 0 5px 0 #9c4217, 0 12px 24px rgba(0, 0, 0, 0.4);
}

.btn svg {
  width: 26px;
  height: 26px;
  flex: none;
}

.btn small {
  display: block;
  font-family: var(--text);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.9;
  line-height: 1.2;
}

.btn span {
  display: block;
  line-height: 1.1;
  text-align: left;
}

.btn.is-soon {
  cursor: default;
}

a.btn:hover {
  color: #fff;
  background: #f08650;
}

.btn.secondary {
  background: var(--brown);
  box-shadow: 0 5px 0 #3d2a1c, 0 12px 24px rgba(0, 0, 0, 0.4);
}

a.btn.secondary:hover {
  background: #7d5940;
}

.cta-note {
  flex-basis: 100%;
  font-size: 14px;
  color: var(--muted);
}

/* Store buttons: phones see only their own store, other devices see both */
html[data-os="android"] .store-ios,
html[data-os="ios"] .store-android {
  display: none;
}

/* ---------- Phone frame ---------- */

.phone {
  position: relative;
  margin: 0;
  width: 100%;
  border-radius: 34px;
  padding: 9px;
  background: #0b0705;
  border: 2px solid #3a281b;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(242, 200, 121, 0.12);
}

.phone img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 26px;
  background: var(--panel-deep);
}

.hero-phone {
  max-width: 330px;
  margin-inline: auto;
  transform: rotate(2.5deg);
}

/* ---------- Sections ---------- */

.section {
  padding: 84px 0;
}

.section.tight {
  padding-top: 24px;
}

.section-head {
  max-width: 40em;
  margin-bottom: 36px;
}

.eyebrow {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}

.section h2 {
  font-size: clamp(34px, 5vw, 52px);
  color: var(--title);
}

.section-head p:not(.eyebrow) {
  margin-top: 14px;
  color: var(--muted);
  font-size: 18px;
}

/* ---------- How to play ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  counter-reset: step;
}

.step {
  counter-increment: step;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-demo {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px 8px;
  border-radius: 14px;
  background: var(--panel-deep);
}

.tile {
  width: 38px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  background: var(--cream);
  color: #3b2a1e;
  border: 2px solid #c9a46a;
}

.tile.done {
  background: var(--teal-deep);
  border-color: #9deff3;
  color: #0e3a3d;
}

.tile.cur {
  border: 3px solid var(--orange);
}

.tile.cap {
  background: var(--purple);
  border-color: var(--purple-line);
  color: #fff;
}

.tile.wrong {
  background: #ffd0c8;
  border: 3px solid var(--red);
  color: #9a1b10;
}

.tile.finish {
  background: var(--title);
  border-color: #ffe993;
  color: #4a2a00;
}

.chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 78px;
  padding: 7px 14px;
  border-radius: 12px;
  background: #3b2a1e;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-weight: 800;
  font-size: 16px;
  line-height: 1.15;
  letter-spacing: 0.04em;
}

.chip small {
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.chip.teal {
  border-color: var(--teal);
  color: var(--teal);
}

.step h3 {
  font-family: var(--text);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.25;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 10px;
}

.step h3::before {
  content: counter(step);
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: #1e1410;
  font-family: var(--display);
  font-size: 20px;
}

.step p {
  color: var(--muted);
  font-size: 16px;
}

/* ---------- Screenshots ---------- */

.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 1fr);
  gap: 18px;
  overflow-x: auto;
  padding: 4px var(--gutter) 22px;
  margin: 0 calc(var(--gutter) * -1);
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--gutter);
  scrollbar-color: var(--brown) transparent;
}

.shot {
  margin: 0;
  scroll-snap-align: start;
}

.shot .phone {
  border-radius: 26px;
  padding: 6px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.45);
}

.shot .phone img {
  border-radius: 20px;
}

.shot figcaption {
  margin-top: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

/* ---------- Places ---------- */

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

.place {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--line);
  background: var(--panel-deep);
}

.place img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.place span {
  position: absolute;
  inset: auto 0 0 0;
  padding: 44px 14px 12px;
  background: linear-gradient(180deg, rgba(20, 12, 8, 0) 0%, rgba(20, 12, 8, 0.9) 70%);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
}

.place span small {
  display: block;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Monsters ---------- */

.band {
  background:
    radial-gradient(1200px 500px at 50% 0%, rgba(232, 116, 59, 0.14), rgba(232, 116, 59, 0) 70%),
    var(--panel-deep);
  border-block: 2px solid var(--line);
}

.roster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.roster.creeps {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.roster.bosses {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.roster li {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 14px 10px 12px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
  color: var(--cream);
}

.roster img {
  width: 100%;
  height: 96px;
  object-fit: contain;
  margin-bottom: 10px;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.45));
}

.roster.bosses li {
  padding: 18px 12px 14px;
  font-size: 16px;
  border-color: #7a5a2c;
}

.roster.bosses img {
  height: 170px;
}

.roster small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.sub-head {
  font-family: var(--text);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 34px 0 14px;
}

.sub-head:first-of-type {
  margin-top: 0;
}

/* ---------- Features ---------- */

.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 40px;
}

.features li {
  padding: 22px 0;
  border-top: 2px solid var(--line);
}

.features h3 {
  font-family: var(--text);
  font-weight: 700;
  font-size: 19px;
  color: var(--gold);
  margin-bottom: 6px;
}

.features p {
  color: var(--muted);
  font-size: 16px;
}

/* ---------- Closing call ---------- */

.closing {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  text-align: center;
  padding: 96px 0 0;
}

.closing::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("../img/sandstorm.webp") center / cover no-repeat;
}

.closing::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, var(--dark) 0%, rgba(20, 12, 8, 0.45) 40%, rgba(20, 12, 8, 0.75) 100%);
}

.closing h2 {
  font-size: clamp(38px, 6vw, 64px);
  color: var(--title);
  -webkit-text-stroke: 0.08em #1a0d05;
  paint-order: stroke fill;
}

.closing p {
  margin: 14px auto 0;
  max-width: 30em;
  font-size: 18px;
  text-wrap: balance;
}

.closing .cta-row {
  justify-content: center;
}

.closing-heroes {
  margin-top: 36px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(12px, 5vw, 60px);
}

.closing-heroes img {
  height: clamp(190px, 30vw, 300px);
  width: auto;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.5));
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 2px solid var(--line);
  background: var(--dark);
  padding: 28px 0 36px;
  font-size: 15px;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}

.site-footer a {
  color: var(--cream);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  color: var(--gold);
  text-decoration: underline;
}

/* ---------- Document pages ---------- */

.page-top {
  position: relative;
  isolation: isolate;
  padding: 120px 0 44px;
  border-bottom: 2px solid var(--line);
  overflow: hidden;
}

.page-top::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("../img/hero-desert-town.webp") center 30% / cover no-repeat;
}

.page-top::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(20, 12, 8, 0.8) 0%, rgba(20, 12, 8, 0.9) 100%);
}

.page-top h1 {
  font-size: clamp(40px, 7vw, 68px);
  color: var(--title);
}

.page-top p {
  margin-top: 10px;
  color: var(--muted);
}

.doc {
  max-width: calc(760px + var(--gutter) * 2);
  padding-top: 44px;
  padding-bottom: 84px;
}

.doc h2 {
  font-family: var(--text);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.25;
  color: var(--gold);
  margin: 44px 0 12px;
}

.doc h3 {
  font-family: var(--text);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  color: var(--cream);
  margin: 26px 0 8px;
}

.doc p,
.doc li {
  color: #e9dccb;
}

.doc p + p,
.doc ul + p,
.doc p + ul {
  margin-top: 14px;
}

.doc ul {
  margin: 0;
  padding-left: 22px;
}

.doc li + li {
  margin-top: 8px;
}

.doc li::marker {
  color: var(--gold);
}

.doc strong {
  color: var(--cream);
  font-weight: 700;
}

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

.card > h2:first-child {
  margin-top: 0;
}

.contact-line {
  font-size: 22px;
  font-weight: 700;
  word-break: break-word;
}

.faq {
  border-top: 2px solid var(--line);
}

.faq details {
  border-bottom: 2px solid var(--line);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 40px 18px 0;
  position: relative;
  font-weight: 700;
  font-size: 18px;
  color: var(--cream);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--display);
  font-size: 28px;
  color: var(--gold);
}

.faq details[open] summary::after {
  content: "\2013";
}

.faq details > *:not(summary) {
  margin: 0 0 18px;
}

.center-page {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 140px 0 80px;
}

.center-page h1 {
  font-size: clamp(56px, 12vw, 120px);
  color: var(--title);
}

.center-page p {
  margin: 14px 0 28px;
  color: var(--muted);
  font-size: 19px;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .roster.creeps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .nav a:not(.keep) {
    display: none;
  }

  .hero {
    padding: 96px 0 56px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
  }

  .hero::after {
    background: linear-gradient(180deg, rgba(20, 12, 8, 0.7) 0%, rgba(20, 12, 8, 0.5) 30%, rgba(20, 12, 8, 0.9) 70%, var(--dark) 100%);
  }

  .hero-phone {
    max-width: 270px;
  }

  .section {
    padding: 60px 0;
  }

  .shots {
    grid-auto-columns: 62%;
  }

  .places {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .roster.creeps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .roster.bosses {
    gap: 10px;
  }

  .roster.bosses li {
    padding: 14px 8px 12px;
    font-size: 14px;
  }

  .roster.bosses img {
    height: 96px;
  }

  .roster img {
    height: 76px;
  }

  .features {
    grid-template-columns: minmax(0, 1fr);
  }

  .btn {
    width: 100%;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-note {
    text-align: center;
  }

  .page-top {
    padding: 104px 0 34px;
  }

  .card {
    padding: 20px;
  }
}

@media (max-width: 520px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer .wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  .logo-keys span {
    animation: none;
  }

  .logo-keys span:nth-child(2),
  .logo-keys span:nth-child(5) {
    background: var(--teal);
    color: #0e3a3d;
  }
}
