:root {
  color-scheme: light;
  --paper: #fae7cf;
  --surround: #101a2b;
  --ink: #2b1a26;
  --navy: #142238;
  --cream: #fff1d9;
  --serif: Georgia, 'Times New Roman', serif;
  --shell: 73rem;
  --gutter: clamp(1.25rem, 5cqi, 5.5rem);
  --page-width: 90rem;
  --paper-grain: url('assets/parchment-grain.webp');
  --hero-tear-height: clamp(1.05rem, 4.64cqi, 4.25rem);
  --horde-top-tear-height: clamp(.95rem, 3.66cqi, 3.3rem);
  --horde-bottom-tear-height: clamp(1.2rem, 5.5cqi, 5rem);
}

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

html { background: var(--surround); }

body {
  container-type: inline-size;
  max-inline-size: var(--page-width);
  margin: 0 auto;
  background: var(--paper) var(--paper-grain) center top / 100% auto;
  color: var(--ink);
  font-family: var(--serif);
}

img { display: block; max-width: 100%; }
h1, h2, p, figure { margin: 0; }
a { color: inherit; text-underline-offset: .23em; }

a:focus-visible, .gallery:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 5px;
}

.shell {
  width: min(var(--shell), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 5;
  inset: .75rem auto auto .75rem;
  padding: .8rem 1rem;
  background: var(--cream);
  color: var(--ink);
  transform: translateY(-180%);
}

.skip-link:focus { transform: none; }

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr;
  min-block-size: clamp(30rem, 60cqi, 53rem);
  background: #ecd6c2;
}

.hero-art, .hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero::before {
  z-index: 0;
  content: '';
  pointer-events: none;
  background: linear-gradient(90deg, #f6e7dc70, #f6e7dc35 35%, transparent 63%);
}

/* The masks follow the mock and the fiber textures follow each mask. */
.hero::after, .horde::before, .horde::after, .horde picture::after {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  content: '';
  inset-inline: 0;
  background:
    var(--tear-fibers, none) center / 100% 100% no-repeat,
    var(--paper) var(--paper-grain) center / 100% auto;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
}

.hero::after {
  --tear-fibers: url('assets/hero-paper-fibers.webp');
  inset-block-end: -1px;
  block-size: var(--hero-tear-height);
  mask-image: url('assets/hero-paper.png');
}

.hero-bar, .hero-content { position: relative; }

.hero-bar, .footer-bar, .site-links {
  display: flex;
  align-items: center;
}

.hero-bar, .footer-bar { justify-content: space-between; gap: 1rem; }
.hero-bar { padding-block: clamp(1.2rem, 3cqi, 2.75rem); align-self: start; }
.site-links { gap: clamp(.65rem, 2.5cqi, 2.7rem); }
.hero-bar .site-links { margin-inline-end: clamp(3rem, 9cqi, 10rem); }
.site-links a, .footer-bar > a {
  display: inline-flex;
  min-block-size: 44px;
  align-items: center;
  font-weight: 700;
  text-decoration: none;
}

.site-links a:hover, .footer-bar > a:hover, .site-links a:focus-visible { text-decoration: underline; }

.wordmark {
  display: block;
  width: clamp(10rem, 25cqi, 23rem);
  flex: 0 1 auto;
}

.wordmark img { width: 100%; height: auto; }
.hero-content {
  align-self: start;
  padding-block-start: clamp(2rem, 4cqi, 3.75rem);
  padding-block-end: 7rem;
}

h1, h2 {
  letter-spacing: -.052em;
  line-height: .98;
}

h1 {
  font-family: Baskerville, var(--serif);
  font-size: clamp(2.88rem, 5.94cqi, 5.985rem);
  font-weight: 600;
}

h2 { font-size: clamp(2.5rem, 4.6cqi, 4.7rem); font-weight: 700; }

.hero-content p {
  max-inline-size: 27ch;
  margin-block-start: clamp(.65rem, 1.4cqi, 1.25rem);
  font-size: clamp(1.06rem, 1.85cqi, 1.52rem);
  line-height: 1.32;
  text-wrap: pretty;
}

.action {
  --cut: 12px;
  position: relative;
  isolation: isolate;
  display: inline-grid;
  min-inline-size: 11rem;
  padding: 4px 5px;
  color: #fff7e6;
  font-size: clamp(1.28rem, 2.1cqi, 1.65rem);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  filter: drop-shadow(0 2px 2px #1714264d);
}

.action::before, .action::after, .action span {
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut),
    100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%,
    0 calc(100% - var(--cut)), 0 var(--cut));
}

.action::before, .action::after {
  position: absolute;
  z-index: -1;
  content: '';
}

.action::before {
  inset: 0;
  background: linear-gradient(180deg, #fff0b8 0%, #edc778 8%, #9e5b2c 43%,
    #9e5b2c 57%, #dbb16a 92%, #f5d691 100%);
}

.action::after {
  --cut: 10px;
  inset: 2px;
  background: linear-gradient(180deg, #6d3d29, #ad7644 50%, #6d3d29);
}

.action span {
  --cut: 8px;
  position: relative;
  display: grid;
  min-block-size: 47px;
  place-items: center;
  padding: .665rem 2rem;
  background:
    radial-gradient(ellipse at 24% -40%, #cdefffad, transparent 64%),
    linear-gradient(180deg, #7cbafb 0%, #4c8bd4 9%, #2b64b3 40%, #194582 54%, #193c78 75%, #24549b);
  box-shadow: inset 0 2px #bae5ffab, inset 0 -2px #527db0b3;
  text-shadow: 0 2px 2px #071c41, 0 0 5px #071c415c;
}

.action span::before, .action span::after {
  position: absolute;
  inset-block-start: calc(50% - 2px);
  inline-size: 5px;
  block-size: 5px;
  border: 1px solid #a97748;
  background: #f9d894;
  box-shadow: 0 1px 2px #102849;
  transform: rotate(45deg);
  content: '';
}

.action span::before { inset-inline-start: .72rem; }
.action span::after { inset-inline-end: .72rem; }
.action:hover span { filter: brightness(1.12); }
.action:active { transform: translateY(1px); filter: drop-shadow(0 1px 1px #1714264d); }
.action:focus-visible { outline-color: #fff7e6; box-shadow: 0 0 0 7px #173458; }
.hero .action {
  min-inline-size: clamp(11.25rem, 16cqi, 14rem);
  margin-block-start: clamp(1.15rem, 2cqi, 1.8rem);
}

.gameplay {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
  column-gap: clamp(3rem, 7cqi, 7.25rem);
  align-items: center;
  padding-block: clamp(3.3rem, 6cqi, 5.5rem) clamp(2rem, 3.3cqi, 3rem);
}

.gameplay-copy h2 { font-size: clamp(2.5rem, 4.1cqi, 4.2rem); }

.gameplay-copy p {
  max-width: 24ch;
  margin-block-start: 1.3rem;
  font-size: clamp(1.15rem, 1.75cqi, 1.5rem);
  line-height: 1.47;
}

.tower-lineup {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  column-gap: clamp(.3rem, 1.25cqi, 1rem);
  width: min(100%, 27rem);
  margin-block-start: clamp(1.2rem, 2.9cqi, 2.5rem);
}

.tower-lineup img {
  width: 100%;
  height: auto;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  grid-template-rows: auto;
  align-items: center;
  width: min(100%, 34rem);
  justify-self: end;
  min-inline-size: 0;
  isolation: isolate;
}

.shot {
  grid-row: 1;
  border-radius: .72rem;
  overflow: hidden;
  background: #28492a;
  box-shadow: 0 .2rem .65rem #452d2426, 0 .95rem 2.15rem -.25rem #442b2245;
}

.shot img {
  width: 100%;
  height: auto;
}

.shot-battle { grid-column: 4 / 12; z-index: 1; }
.shot-map, .shot-canyon { width: 78%; }
.shot-map { grid-column: 8 / 15; justify-self: end; }
.shot-canyon { grid-column: 1 / 8; justify-self: start; }

.horde {
  position: relative;
  background: #83a6bc;
}

.horde::before {
  --tear-fibers: url('assets/horde-top-paper-fibers.webp');
  inset-block-start: -1px;
  block-size: var(--horde-top-tear-height);
  mask-image: url('assets/horde-top-paper.png');
}

.horde::after, .horde picture::after {
  inset-block-end: -1px;
  block-size: var(--horde-bottom-tear-height);
}

.horde::after {
  --tear-fibers: url('assets/horde-bottom-paper-fibers.webp');
  mask-image: url('assets/horde-bottom-paper.png');
}

.horde picture::after {
  z-index: 2;
  inset-block-end: -4px;
  block-size: calc(var(--horde-bottom-tear-height) + 3px);
  mask-image: url('assets/horde-bottom-navy.png');
  background: var(--navy);
}

.horde img { width: 100%; height: auto; }

.download, .site-footer {
  background: var(--navy);
  color: var(--cream);
}

.download {
  text-align: center;
  padding-block: clamp(2.5rem, 5.5cqi, 5rem) clamp(2rem, 3.8cqi, 3.5rem);
}

.download h2 { font-size: clamp(2.25rem, 4.4cqi, 4.4rem); }
.download .action { margin-block-start: 1.4rem; }
.footer-bar { border-block-start: 1px solid #fff1d95c; padding-block: .55rem 1.1rem; }

@media (max-width: 720px) {
  .hero { min-block-size: clamp(31rem, 127cqi, 43rem); }
  .hero-art img { object-position: center; }
  .hero::before {
    background: linear-gradient(180deg, #f7e6dfdc 0%, #f7e6dfa6 25%, #f7e6df28 46%, transparent 72%);
  }
  .hero-bar { padding-block: .85rem; }
  .hero-bar .site-links { margin-inline-end: 0; font-size: .9rem; }
  .wordmark { width: min(46cqi, 13rem); }
  .hero-content { padding-block-start: clamp(.3rem, 1.6cqi, 1rem); }
  h1 { font-size: clamp(2.475rem, 9.54cqi, 4.5rem); }
  .hero .action { margin-block-start: 1rem; }

  .gameplay {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.85rem;
    padding-block: 2.5rem 1.9rem;
  }

  .gameplay-copy h2 { font-size: clamp(2.25rem, 8.7cqi, 4.15rem); }
  .gameplay-copy p { margin-block-start: .95rem; font-size: clamp(1.1rem, 4cqi, 1.35rem); }
  .tower-lineup { max-width: 23rem; }
  .wide-break { display: none; }

  .gallery {
    display: flex;
    width: 100%;
    gap: 1rem;
    overflow-x: auto;
    padding: .4rem .45rem 1.35rem;
    align-items: start;
    scroll-snap-type: inline mandatory;
    scroll-padding-inline: .45rem;
  }

  .shot {
    flex: 0 0 auto;
    width: auto;
    scroll-snap-align: start;
    box-shadow: 0 .18rem .4rem #452d2426, 0 .55rem 1.1rem -.24rem #442b223b;
  }

  .shot img { height: min(118cqi, 32rem); width: auto; }

  .site-footer { font-size: .9rem; }
}

@media (max-width: 350px) {
  .hero-bar .site-links { gap: .5rem; }
  .hero-bar .site-links a { font-size: .83rem; }
}

@media (forced-colors: active) {
  .action { border: 2px solid ButtonText; color: ButtonText; filter: none; }
  .action span { text-shadow: none; }
}
