/* Crown & Conquest: the website. A royal night: deep indigo, gold, glass. */

@font-face {
  font-family: 'Fredoka';
  src: url('fonts/fredoka-bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --night-1: #0d0724;
  --night-2: #1b0f45;
  --night-3: #2c1470;
  --gold: #ffd54f;
  --gold-2: #ffb300;
  --gold-3: #e65100;
  --ink: #fff;
  --ink-2: rgba(255, 255, 255, 0.78);
  --ink-3: rgba(255, 255, 255, 0.56);
  --glass: rgba(255, 255, 255, 0.07);
  --glass-2: rgba(255, 255, 255, 0.12);
  --rim: rgba(255, 255, 255, 0.16);
  --green: #00c853;
  --green-2: #64dd17;
  --blue: #40c4ff;
  --red: #ff5252;
  --radius: 22px;
  --wrap: 1120px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 700;
  color: var(--ink);
  background: var(--night-1);
  background-image:
    radial-gradient(1200px 700px at 80% -10%, rgba(124, 77, 255, 0.35), transparent 60%),
    radial-gradient(900px 600px at -10% 20%, rgba(64, 196, 255, 0.18), transparent 60%),
    linear-gradient(180deg, var(--night-2), var(--night-1) 60%);
  background-attachment: fixed;
  line-height: 1.55;
  overflow-x: hidden;
}

/* A few stars in the night sky. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.55;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff, transparent),
    radial-gradient(1px 1px at 28% 72%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 45% 32%, #ffe9a8, transparent),
    radial-gradient(1px 1px at 63% 12%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 78% 55%, #fff, transparent),
    radial-gradient(1px 1px at 88% 82%, #ffe9a8, transparent),
    radial-gradient(1.4px 1.4px at 7% 88%, #fff, transparent),
    radial-gradient(1px 1px at 52% 92%, #fff, transparent);
}

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

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

/* ---------------------------------------------------------------- nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(13, 7, 36, 0.62);
  border-bottom: 1px solid var(--rim);
}

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 19px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(255, 179, 0, 0.35);
}

.brand b {
  color: var(--gold);
}

.nav nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.nav nav a {
  color: var(--ink-2);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 15px;
}

.nav nav a:hover,
.nav nav a[aria-current='page'] {
  color: var(--ink);
  background: var(--glass-2);
  text-decoration: none;
}

/* ---------------------------------------------------------------- type */

.title {
  font-size: clamp(44px, 7.4vw, 84px);
  line-height: 1;
  margin: 0;
  letter-spacing: 0.5px;
  background: linear-gradient(180deg, #fff6c9 0%, var(--gold) 38%, var(--gold-2) 70%, var(--gold-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 #5a2a00) drop-shadow(0 10px 22px rgba(255, 179, 0, 0.35));
}

.title .amp {
  display: block;
  font-size: 0.62em;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--glass-2);
  border: 1px solid var(--rim);
  color: var(--ink-2);
  font-size: 14px;
  letter-spacing: 0.4px;
}

.kicker img {
  width: 20px;
  height: 20px;
}

.lead {
  font-size: clamp(17px, 2vw, 21px);
  color: var(--ink-2);
  max-width: 34ch;
  margin: 18px 0 0;
}

h2 {
  font-size: clamp(30px, 4.4vw, 44px);
  line-height: 1.1;
  margin: 0 0 10px;
  color: var(--gold);
  text-shadow: 0 3px 0 #4a2300, 0 10px 26px rgba(255, 179, 0, 0.25);
}

.section-head {
  text-align: center;
  margin-bottom: 36px;
}

.section-head p {
  color: var(--ink-2);
  margin: 0 auto;
  max-width: 52ch;
  font-size: 17px;
}

/* ---------------------------------------------------------------- buttons */

.btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px 12px 14px;
  border-radius: 18px;
  color: #fff;
  font-size: 17px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.28), 0 14px 28px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.28), 0 18px 30px rgba(0, 0, 0, 0.32);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
}

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

.btn small {
  display: block;
  font-size: 11px;
  opacity: 0.85;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.btn span {
  line-height: 1.15;
}

.btn.green {
  background: linear-gradient(180deg, #7ee15a, var(--green) 55%, #00963e);
}

.btn.blue {
  background: linear-gradient(180deg, #80d8ff, #2196f3 55%, #1565c0);
}

.btn.gold {
  background: linear-gradient(180deg, #ffe082, var(--gold-2) 55%, var(--gold-3));
}

.btn.ghost {
  background: var(--glass-2);
  border-color: var(--rim);
  box-shadow: none;
  padding: 12px 20px;
}

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

.hero {
  position: relative;
  padding: 56px 0 0;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 40px;
}

.hero .copy {
  padding-bottom: 40px;
}

.hero .phone-wrap {
  position: relative;
  justify-self: center;
}

.hero .phone-wrap::before {
  content: '';
  position: absolute;
  inset: 8% -18% 0;
  background: radial-gradient(closest-side, rgba(255, 213, 79, 0.35), transparent);
  filter: blur(10px);
  z-index: -1;
}

.phone {
  width: 300px;
  aspect-ratio: 645 / 1398;
  border-radius: 42px;
  padding: 10px;
  background: linear-gradient(160deg, #3a2b6e, #120a2e);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), inset 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 33px;
}

.hero .phone {
  transform: rotate(4deg);
  animation: bob 6s ease-in-out infinite;
}

@keyframes bob {
  0%,
  100% {
    transform: rotate(4deg) translateY(0);
  }
  50% {
    transform: rotate(4deg) translateY(-10px);
  }
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--rim);
  color: var(--ink-2);
  font-size: 14px;
}

.chip img {
  width: 22px;
  height: 22px;
}

/* ---------------------------------------------------------------- the battlefield */

.field {
  position: relative;
  height: 250px;
  margin-top: 26px;
  overflow: hidden;
  background:
    linear-gradient(180deg, transparent 0, transparent 38%, #4f8a3b 38%, #47803a 60%, #3f7334 100%);
}

.field::before {
  /* The ground's soft stripes, and a horizon glow. */
  content: '';
  position: absolute;
  inset: 38% 0 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 60px, transparent 60px 120px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 30%);
}

.field::after {
  /* A fade into the page below. */
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 70px;
  background: linear-gradient(180deg, transparent, var(--night-1));
}

.field .river {
  position: absolute;
  left: 50%;
  top: 38%;
  bottom: 0;
  width: 86px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #2f7fb0, #49a6d6 50%, #2f7fb0);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.25);
}

.field .bridge {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 130px;
  height: 34px;
  transform: translateX(-50%);
  border-radius: 6px;
  background: repeating-linear-gradient(90deg, #a8693a 0 14px, #8c5530 14px 16px);
  box-shadow: 0 6px 0 #5e3a20, 0 10px 14px rgba(0, 0, 0, 0.3);
}

.cloud {
  position: absolute;
  top: 6%;
  width: 200px;
  height: 90px;
  background: url('sprites/cloud1.png') 0 0 / 200% 100% no-repeat;
  opacity: 0.55;
  animation: drift 60s linear infinite;
}

.cloud.c2 {
  top: 14%;
  width: 150px;
  height: 66px;
  background-image: url('sprites/cloud3.png');
  animation-duration: 85s;
  animation-delay: -40s;
  opacity: 0.4;
}

@keyframes drift {
  from {
    transform: translateX(-260px);
  }
  to {
    transform: translateX(calc(100vw + 260px));
  }
}

.unit,
.building {
  position: absolute;
  bottom: 22%;
  background-repeat: no-repeat;
  transform-origin: bottom center;
}

.building {
  background-size: 100% 100%;
}

/* A sprite sheet played frame by frame: --frames frames of --w x --h. */
.unit {
  width: var(--w);
  height: var(--h);
  background-size: calc(var(--w) * var(--frames)) var(--h);
  animation: play var(--speed, 0.9s) steps(var(--frames)) infinite;
  scale: var(--scale, 0.78);
}

.unit.flip {
  scale: calc(var(--scale, 0.78) * -1) var(--scale, 0.78);
}

/* Who stands where (a unit's box is --w wide; its centre is what counts). */
.field .castle {
  width: 200px;
  height: 160px;
}
.field .castle.b {
  left: 1%;
  background-image: url('sprites/blue_castle.png');
}
.field .castle.r {
  right: 1%;
  background-image: url('sprites/red_castle.png');
}
.field .tower {
  width: 64px;
  height: 128px;
}
.field .tower.b {
  left: 17%;
  background-image: url('sprites/blue_tower.png');
}
.field .tower.r {
  right: 17%;
  background-image: url('sprites/red_tower.png');
}
.field .king {
  --scale: 0.86;
}
.field .king.b {
  left: 23%;
}
.field .king.r {
  right: 23%;
}
.field .warrior.b {
  left: 29%;
}
.field .warrior.r {
  right: 29%;
}
.field .extra.b {
  left: 35%;
}
.field .extra.r {
  right: 35%;
}

@keyframes play {
  from {
    background-position: 0 0;
  }
  to {
    background-position: calc(var(--w) * var(--frames) * -1) 0;
  }
}

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

section {
  padding: 84px 0;
}

.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.card {
  position: relative;
  padding: 24px 22px 22px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--glass-2), var(--glass));
  border: 1px solid var(--rim);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 213, 79, 0.55);
}

.card .icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  margin-bottom: 16px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}

.card .icon img {
  width: 40px;
  height: 40px;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 21px;
}

.card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 15.5px;
}

.i-red {
  background: linear-gradient(180deg, #ff8a80, #e53935);
}

.i-blue {
  background: linear-gradient(180deg, #80d8ff, #1e88e5);
}

.i-gold {
  background: linear-gradient(180deg, #ffe082, #ffa000);
}

.i-purple {
  background: linear-gradient(180deg, #d1c4e9, #7e57c2);
}

.i-green {
  background: linear-gradient(180deg, #b9f6ca, #00c853);
}

/* The army: one card per kind of troop, the sprite alive in it. */
.army {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.trooper {
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(64, 196, 255, 0.25), rgba(64, 196, 255, 0.06));
  border: 1px solid rgba(128, 216, 255, 0.45);
  text-align: center;
  padding: 0 8px 14px;
  overflow: hidden;
}

.trooper.red {
  background: linear-gradient(180deg, rgba(255, 82, 82, 0.25), rgba(255, 82, 82, 0.06));
  border-color: rgba(255, 138, 128, 0.45);
}

.trooper .stage {
  position: relative;
  height: 120px;
}

.trooper .unit {
  bottom: 0;
  left: 50%;
  translate: -50% 0;
}

.trooper b {
  display: block;
  font-size: 16px;
}

.trooper small {
  color: var(--ink-3);
  font-size: 13px;
}

/* Screens: phones side by side, a strip on a small screen. */
.shots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  align-items: start;
}

.shots figure {
  margin: 0;
  text-align: center;
}

.shots .phone {
  width: 100%;
  border-radius: 34px;
  padding: 8px;
}

.shots .phone img {
  border-radius: 27px;
}

.shots figure:nth-child(even) {
  margin-top: 40px;
}

.shots figcaption {
  margin-top: 14px;
  color: var(--ink-2);
  font-size: 15px;
}

/* Promises: a band of three. */
.promise {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.promise .card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.promise .card .icon {
  flex: none;
  margin: 0;
  width: 54px;
  height: 54px;
  border-radius: 15px;
}

.promise .card .icon img {
  width: 32px;
  height: 32px;
}

.cta {
  text-align: center;
  padding: 56px 24px;
  border-radius: 30px;
  background:
    radial-gradient(600px 260px at 50% 0, rgba(255, 213, 79, 0.25), transparent 70%),
    linear-gradient(135deg, #8e5cff, #4a1db0 55%, #26105e);
  border: 2px solid var(--gold);
  box-shadow: 0 20px 60px rgba(124, 77, 255, 0.35);
}

.cta img.crown {
  width: 84px;
  margin: 0 auto 10px;
  filter: drop-shadow(0 8px 16px rgba(255, 179, 0, 0.5));
}

.cta p {
  color: var(--ink-2);
  max-width: 46ch;
  margin: 0 auto;
}

.cta .btns {
  justify-content: center;
}

/* ---------------------------------------------------------------- documents */

.doc {
  padding: 48px 0 80px;
}

.doc .paper {
  max-width: 800px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.05));
  border: 1px solid var(--rim);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.doc h1 {
  font-size: clamp(32px, 5vw, 46px);
  margin: 0 0 4px;
  color: var(--gold);
  text-shadow: 0 3px 0 #4a2300;
  line-height: 1.1;
}

.doc .date {
  color: var(--ink-3);
  font-size: 14px;
  margin: 0 0 24px;
}

.doc h2 {
  font-size: 22px;
  margin: 34px 0 8px;
  color: var(--ink);
  text-shadow: none;
}

.doc p,
.doc li {
  color: var(--ink-2);
  font-size: 16.5px;
}

.doc ul,
.doc ol {
  padding-left: 22px;
}

.doc li {
  margin: 6px 0;
}

.doc strong {
  color: var(--ink);
}

.doc .summary {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(0, 200, 83, 0.12);
  border: 1px solid rgba(105, 240, 174, 0.4);
}

.doc .summary img {
  width: 34px;
  flex: none;
}

.doc .summary p {
  margin: 0;
  color: var(--ink);
}

.faq details {
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--rim);
  margin: 10px 0;
  padding: 0 18px;
  transition: background 0.2s ease;
}

.faq details[open] {
  background: var(--glass-2);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 28px 16px 0;
  position: relative;
  font-size: 17px;
}

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

.faq summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 12px;
  font-size: 24px;
  color: var(--gold);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p,
.faq details ol,
.faq details ul {
  margin-top: 0;
}

.contact {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 213, 79, 0.18), rgba(255, 179, 0, 0.06));
  border: 1px solid rgba(255, 213, 79, 0.5);
  margin: 8px 0 26px;
}

.contact img {
  width: 52px;
  flex: none;
}

.contact p {
  margin: 2px 0 0;
}

.contact .btn {
  margin-left: auto;
  white-space: nowrap;
}

kbd {
  font-family: inherit;
  padding: 1px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid var(--rim);
  color: var(--ink);
  font-size: 0.92em;
}

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

footer {
  border-top: 1px solid var(--rim);
  padding: 34px 0 44px;
  color: var(--ink-3);
  font-size: 14px;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-left: auto;
}

footer a {
  color: var(--ink-2);
}

/* ---------------------------------------------------------------- reveal */

/* Hidden only once the script runs (it shows them as they scroll in). */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

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

@media (max-width: 960px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .lead {
    margin-inline: auto;
  }
  .btns,
  .badge-row {
    justify-content: center;
  }
  .hero .copy {
    padding-bottom: 0;
  }
  .phone {
    width: 250px;
  }
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
  .army {
    grid-template-columns: repeat(3, 1fr);
  }
  .promise {
    grid-template-columns: 1fr;
  }
  .shots {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 12px;
    margin-inline: -16px;
    padding-inline: 16px;
  }
  .shots figure {
    flex: 0 0 62%;
    scroll-snap-align: center;
  }
  .shots figure:nth-child(even) {
    margin-top: 0;
  }
}

@media (max-width: 600px) {
  .nav nav a {
    padding: 8px;
    font-size: 14px;
  }
  .brand span {
    display: none;
  }
  .features {
    grid-template-columns: 1fr;
  }
  .army {
    grid-template-columns: repeat(2, 1fr);
  }
  section {
    padding: 60px 0;
  }
  .field {
    height: 190px;
  }
  /* A phone's width: the castles, a king and a warrior a side. */
  .field .tower,
  .field .extra {
    display: none;
  }
  .field .castle {
    width: 104px;
    height: 84px;
  }
  .field .unit {
    --scale: 0.5;
  }
  .field .king {
    --scale: 0.56;
  }
  .field .king.b {
    left: calc(31% - 96px);
  }
  .field .king.r {
    right: calc(31% - 96px);
  }
  .field .warrior.b {
    left: calc(40% - 96px);
  }
  .field .warrior.r {
    right: calc(40% - 96px);
  }
  .field .river {
    width: 54px;
  }
  .field .bridge {
    width: 80px;
  }
  .contact {
    flex-wrap: wrap;
  }
  .contact .btn {
    margin-left: 0;
  }
  footer nav {
    margin-left: 0;
  }
}
