/* Limitless — site styles */

:root {
  --ink: #18160f;
  --ink-2: #3a362c;
  --muted: #6e675a;
  --paper: #f5f0e6;
  --paper-2: #ece5d6;
  --card: #fffdf8;
  --line: #ddd4c1;
  --apple: #c63b2b;
  --apple-dark: #a42e20;
  --olive: #56662b;
  --radius: 18px;
  --wrap: 1160px;
  --display: "Texturina", Georgia, serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--apple);
  margin: 0 0 14px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  background: var(--card);
  padding: 8px 14px;
  border-radius: 8px;
}

/* Header */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  color: #fff;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}
.site-header.is-scrolled {
  background: rgba(20, 18, 13, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 30px rgba(0, 0, 0, 0.18);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  transition: height 0.3s ease;
}
.site-header.is-scrolled .wrap { height: 64px; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.01em;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  image-rendering: pixelated;
}
.site-nav {
  display: flex;
  gap: 28px;
  font-size: 15px;
  font-weight: 500;
}
.site-nav a {
  text-decoration: none;
  opacity: 0.85;
}
.site-nav a:hover { opacity: 1; }

/* Hero */

.hero {
  position: relative;
  min-height: min(860px, 100svh);
  display: flex;
  align-items: flex-end;
  color: #fff;
  background: #1b1a16;
  overflow: hidden;
  isolation: isolate;
}
.hero-slides {
  position: absolute;
  inset: -6% 0;
  z-index: -2;
  will-change: transform;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background: center / cover no-repeat;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 1.4s ease, transform 8s linear;
}
.hero-slide.is-active { opacity: 1; transform: scale(1); }
.hero-dots {
  position: absolute;
  right: 24px;
  bottom: 28px;
  z-index: 2;
  display: flex;
  gap: 6px;
}
.hero-dots button {
  width: 26px;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.hero-dots button::before {
  content: "";
  display: block;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.32);
  transition: background-color 0.3s ease;
}
.hero-dots button[aria-current="true"]::before { background: #fff; }
.hero-dots button:hover::before { background: rgba(255, 255, 255, 0.7); }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(16, 14, 10, 0.92) 0%, rgba(16, 14, 10, 0.72) 38%, rgba(16, 14, 10, 0.1) 75%),
    linear-gradient(0deg, rgba(16, 14, 10, 0.85) 0%, rgba(16, 14, 10, 0) 45%),
    linear-gradient(180deg, rgba(16, 14, 10, 0.55) 0%, rgba(16, 14, 10, 0) 22%);
}
.hero .wrap {
  position: relative;
  padding-top: 140px;
  padding-bottom: 88px;
}
.hero .wrap > * {
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero .wrap > :nth-child(2) { animation-delay: 0.08s; }
.hero .wrap > :nth-child(3) { animation-delay: 0.16s; }
.hero .wrap > :nth-child(4) { animation-delay: 0.26s; }
.hero .wrap > :nth-child(5) { animation-delay: 0.36s; }
.hero .wrap > :nth-child(6) { animation-delay: 0.44s; }
@keyframes rise {
  from { opacity: 0; translate: 0 22px; }
}
.hero-icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  margin-bottom: 26px;
}
.hero .eyebrow { color: #ff8a73; }
.hero h1 {
  font-size: clamp(48px, 9vw, 112px);
}
.hero-lede {
  font-size: clamp(18px, 2vw, 21px);
  max-width: 34ch;
  color: rgba(255, 255, 255, 0.86);
  margin: 22px 0 0;
}
.hero-note {
  margin: 14px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
}
.badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
}
.badges a {
  display: block;
  border-radius: 10px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.badges a:hover { transform: translateY(-2px); }
.badges .badge-apple { height: 54px; width: auto; }
/* The Google Play artwork has a thin transparent margin; scale so the visible badge matches */
.badges .badge-google { height: 58px; width: auto; margin: -2px -3px; }

/* Apple Knight 3 details */

.section { padding: 110px 0; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 40px;
  margin-bottom: 52px;
}
.section-head h2 {
  font-size: clamp(36px, 5vw, 56px);
  max-width: 14ch;
}
.section-head p {
  max-width: 44ch;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.feature {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
}
.feature-num {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--apple);
  margin-bottom: 30px;
}
.feature h3 {
  font-size: 23px;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
}

.carousel { margin-top: 20px; }
.carousel-viewport {
  overflow: hidden;
  border-radius: var(--radius);
  cursor: grab;
  outline-offset: 4px;
}
.carousel-viewport:active { cursor: grabbing; }
.carousel-track {
  display: flex;
  touch-action: pan-y pinch-zoom;
  margin-left: -16px;
}
.carousel-slide {
  flex: 0 0 82%;
  min-width: 0;
  padding-left: 16px;
}
.carousel-slide img {
  width: 100%;
  height: auto;
  aspect-ratio: 1600 / 736;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--paper-2);
  opacity: 0.55;
  transform: scale(0.94);
  transition: opacity 0.5s ease, transform 0.5s ease;
  -webkit-user-drag: none;
  user-select: none;
}
.carousel-slide.is-snapped img { opacity: 1; transform: none; }
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}
.carousel-dots { display: flex; gap: 4px; }
.carousel-dots button {
  width: 30px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.carousel-dots button::before {
  content: "";
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  transition: background-color 0.3s ease;
}
.carousel-dots button[aria-current="true"]::before { background: var(--apple); }
.carousel-arrows { display: flex; gap: 10px; }
.carousel-arrow {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.carousel-arrow:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.carousel-arrow:active { transform: scale(0.94); }
.carousel-arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pswp { --pswp-bg: #100e0a; }

.cta-band {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 30px 34px;
}
.cta-band strong {
  display: block;
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: -0.01em;
}
.cta-band span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 15px;
}
.cta-band .badges { margin-top: 0; }

/* Games */

.games-section {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 20px;
}
.game {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
  transition: transform 0.3s ease-out, box-shadow 0.3s ease, border-color 0.3s ease;
}
.game:hover {
  --lift: -6px;
  border-color: #cfc3aa;
  box-shadow: 0 22px 44px -18px rgba(60, 40, 10, 0.28);
}
.game:hover .game-top img { animation: bob 0.6s ease; }
@keyframes bob {
  40% { transform: translateY(-5px) rotate(-3deg); }
  70% { transform: translateY(1px) rotate(1deg); }
}
.game-top {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}
.game-top img {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  flex: none;
  box-shadow: 0 2px 8px rgba(40, 30, 10, 0.12);
}
.game h3 {
  font-size: 24px;
  letter-spacing: -0.01em;
}
.game-tag {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.game > p {
  margin: 0 0 22px;
  color: var(--ink-2);
  font-size: 15.5px;
}
.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}
.platforms a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.platforms a::after {
  content: "↗";
  font-size: 12px;
  opacity: 0.55;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.platforms a:hover::after { transform: translate(2px, -2px); opacity: 1; }
.platforms a:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.game-award {
  display: inline-block;
  margin-right: 8px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #d9b45a;
  background: #fbf1d6;
  color: #7a5a12;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.game-new {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--apple);
  color: #fff;
  font-family: var(--body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Scroll reveal (only when JS has started; see js/site.js) */

.js-motion [data-reveal] {
  opacity: 0;
  translate: 0 26px;
  transition: opacity 0.7s ease, translate 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--delay, 0s);
}
.js-motion [data-reveal].is-visible {
  opacity: 1;
  translate: none;
}
section[id] { scroll-margin-top: 64px; }

/* Footer */

.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.72);
  padding: 64px 0 40px;
  font-size: 15px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}
.site-footer .brand { color: #fff; margin-bottom: 12px; }
.site-footer p { margin: 0; max-width: 32ch; }
.site-footer h4 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  margin-top: 54px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.5);
}

/* Responsive */

@media (max-width: 1000px) {
  .features { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .site-nav { gap: 18px; font-size: 14px; }
  .site-nav .nav-optional { display: none; }
  .hero {
    min-height: 0;
    background-position: 42% center;
  }
  .badges { gap: 10px; }
  .badges .badge-apple { height: 46px; }
  .badges .badge-google { height: 50px; }
  .feature { padding: 24px 22px; }
  .feature-num { margin-bottom: 14px; }
  .hero::before {
    background:
      linear-gradient(0deg, rgba(16, 14, 10, 0.95) 0%, rgba(16, 14, 10, 0.75) 55%, rgba(16, 14, 10, 0.35) 100%);
  }
  .hero .wrap { padding-top: 120px; padding-bottom: 56px; }
  .hero-icon { width: 72px; height: 72px; border-radius: 18px; }
  .section { padding: 72px 0; }
  .section-head { margin-bottom: 34px; }
  .features { grid-template-columns: 1fr; }
  .carousel-slide { flex-basis: 90%; padding-left: 10px; }
  .carousel-track { margin-left: -10px; }
  .carousel-arrow { width: 42px; height: 42px; }
  .hero-dots { right: 12px; bottom: 14px; }
  .games { grid-template-columns: 1fr; }
  .game { padding: 22px; }
  .cta-band { padding: 26px 22px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01s !important;
    transition-delay: 0s !important;
  }
  .hero-slide, .hero-slide.is-active { transform: none; }
  .game { transform: none; }
}
