/* Heat Lines website. Plain CSS, mobile first. Colors and fonts match the game. */

@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --night: #0e1b2c;
  --night-2: #132640;
  --slate: #2a3a4f;
  --slate-hi: #36506b;
  --snow: #e8f1f8;
  --snow-dim: #b9c8d8;
  --ice: #9fd3f0;
  --copper: #b9774a;
  --heat: #ff8a2a;
  --gold: #ffc857;
  --cream: #f5ede0;
  --ink: #1e2633;
  --ink-soft: #4a5566;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgb(0 0 0 / 0.35);
  --shadow-soft: 0 6px 18px rgb(0 0 0 / 0.25);
  --content: 1180px;
  --font-head: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--snow);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
}

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

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

a:hover {
  color: #ffd98a;
}

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

h1,
h2,
h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.005em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  color: var(--gold);
}

h2 {
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  color: var(--cream);
}

h3 {
  font-size: 1.3rem;
  color: var(--cream);
}

p {
  margin: 0 0 1em;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 800;
  border-radius: 10px;
  text-decoration: none;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(14 27 44 / 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgb(255 255 255 / 0.06);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  color: var(--cream);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.35rem;
  text-decoration: none;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

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

.site-nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--snow);
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgb(255 255 255 / 0.08);
  color: var(--gold);
}

.nav-toggle {
  display: none;
  flex: none;
  margin-left: auto;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.08);
  color: var(--snow);
  cursor: pointer;
}

.nav-toggle svg {
  margin: auto;
}

.header-cta {
  flex: none;
}

/* Small phones: the hero's store badge is right below, so the header keeps only the menu. */
@media (max-width: 479px) {
  .site-header .header-cta {
    display: none;
  }
}

@media (max-width: 959px) {
  .nav-toggle {
    display: grid;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 69px);
    max-height: calc(100dvh - 69px);
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0;
    background: var(--night-2);
    border-bottom: 1px solid rgb(255 255 255 / 0.08);
    box-shadow: var(--shadow);
    display: none;
  }

  .site-nav.open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    padding: 10px 16px 16px;
  }

  .site-nav a {
    padding: 12px 14px;
    font-size: 1.1rem;
  }
}

/* --- Buttons ------------------------------------------------------------------------ */

/* Game-style buttons: a soft gradient, a light top edge, a darker bottom edge for depth
   and a glow underneath. Hover lifts the button, pressing pushes it down onto its edge. */
.btn {
  --edge: transparent;
  --edge-h: 4px;
  --glow: rgb(0 0 0 / 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 26px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.55),
    inset 0 -2px 0 rgb(0 0 0 / 0.06),
    0 var(--edge-h) 0 var(--edge),
    0 calc(var(--edge-h) + 6px) 18px var(--glow);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn:hover {
  --edge-h: 6px;
  transform: translateY(-2px);
}

.btn:active {
  --edge-h: 1px;
  transform: translateY(3px);
}

.btn-heat {
  --edge: #b9530a;
  --glow: rgb(255 122 26 / 0.38);
  background: linear-gradient(180deg, #ffad5c 0%, #ff8a2a 52%, #f77b17 100%);
  color: #2b1708;
}

.btn-heat:hover {
  color: #2b1708;
  filter: brightness(1.05);
}

.btn-cream {
  --edge: #b9a07c;
  --glow: rgb(0 0 0 / 0.32);
  background: linear-gradient(180deg, #fffbf4 0%, #f5ede0 55%, #ebdfca 100%);
  color: var(--ink);
}

.btn-cream:hover {
  color: var(--ink);
  filter: brightness(1.03);
}

.btn-ghost {
  background: rgb(255 255 255 / 0.07);
  color: var(--snow);
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 0.22);
}

.btn-ghost:hover {
  color: var(--gold);
  background: rgb(255 255 255 / 0.12);
  box-shadow: inset 0 0 0 1.5px rgb(255 200 87 / 0.6);
}

.btn-ghost:active {
  transform: translateY(1px);
}

.btn-small {
  --edge-h: 3px;
  min-height: 44px;
  padding: 8px 20px;
  font-size: 1rem;
}

.btn-small:hover {
  --edge-h: 5px;
}

.btn-small:active {
  --edge-h: 1px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px 10px 16px;
  border-radius: 16px;
  background: #000;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgb(255 255 255 / 0.25);
  line-height: 1.15;
}

.store-badge small {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}

.store-badge strong {
  font-family: var(--font-head);
  font-size: 1.25rem;
}

.store-badge:hover {
  color: #fff;
  border-color: var(--gold);
}

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

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 30px 0 56px;
}

.hero-art {
  position: absolute;
  inset: 0;
  z-index: -2;
}

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

/* Phones: the text spans the whole picture, so it is shaded from the top down and the
   village shows through behind the phone. Wide screens shade from the left instead. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgb(14 27 44 / 0.92) 0%, rgb(14 27 44 / 0.8) 40%, rgb(14 27 44 / 0.35) 64%, rgb(14 27 44 / 0.5) 84%, var(--night) 100%);
}

.snow {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero .wrap {
  display: grid;
  gap: 34px;
  align-items: center;
}

.hero-text {
  max-width: 620px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgb(255 200 87 / 0.14);
  color: var(--gold);
  font-weight: 800;
  font-size: 0.9rem;
}

.hero h1 {
  margin-bottom: 6px;
  font-size: clamp(2.9rem, 8vw, 4.6rem);
  line-height: 1;
  text-shadow: 0 4px 0 rgb(0 0 0 / 0.35), 0 0 40px rgb(255 138 42 / 0.35);
}

.hero .tagline {
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  color: var(--cream);
  margin-bottom: 12px;
}

.hero .lead {
  font-size: 1.05rem;
  color: #d3deea;
  max-width: 560px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 26px 0 22px;
}

/* Store badge and demo button side by side, the same height, even on small phones. */
.hero .hero-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 22px 0 18px;
}

.hero .hero-actions > * {
  min-height: 58px;
}

.hero .store-badge {
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
}

.hero .store-badge svg {
  flex: none;
  width: 24px;
  height: auto;
}

.hero .store-badge small {
  font-size: 0.6rem;
}

.hero .store-badge strong {
  font-size: 1.1rem;
}

.hero .btn-ghost {
  gap: 8px;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 1rem;
  text-align: center;
  background: rgb(14 27 44 / 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.play-icon {
  flex: none;
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 0 6px rgb(255 138 42 / 0.6));
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgb(14 27 44 / 0.72);
  border: 1px solid rgb(255 255 255 / 0.14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--snow);
  font-weight: 700;
  font-size: 0.88rem;
}

.facts li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--heat);
  box-shadow: 0 0 8px var(--heat);
}

/* The phone, a warm glow behind it and two pieces of game art floating beside it. */
.hero-phone {
  position: relative;
  justify-self: center;
}

.hero-phone::before {
  content: "";
  position: absolute;
  inset: 8% -30%;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(255 138 42 / 0.4), rgb(255 138 42 / 0) 100%);
}

.hero-phone .phone {
  width: min(270px, 70vw);
}

.float {
  position: absolute;
  z-index: 1;
  width: 84px;
  height: 84px;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgb(0 0 0 / 0.45));
  animation: float 5s ease-in-out infinite;
  pointer-events: none;
}

.float-cabin {
  left: -48px;
  bottom: 64px;
}

.float-ember {
  right: -50px;
  top: 38%;
  width: 70px;
  height: 70px;
  animation-delay: -2.5s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }

  50% {
    transform: translateY(-10px) rotate(2deg);
  }
}

@media (min-width: 560px) {
  .hero .hero-actions {
    display: flex;
    gap: 14px;
  }

  .hero .store-badge {
    padding: 10px 22px 10px 16px;
  }

  .hero .btn-ghost {
    padding: 8px 22px;
  }
}

/* Tablets and up: text on the left, the phone on the right. */
@media (min-width: 720px) {
  .hero {
    padding: 64px 0 90px;
  }

  .hero::before {
    background:
      linear-gradient(90deg, rgb(14 27 44 / 0.95) 0%, rgb(14 27 44 / 0.82) 40%, rgb(14 27 44 / 0.25) 75%, rgb(14 27 44 / 0.1) 100%),
      linear-gradient(0deg, var(--night) 0%, rgb(14 27 44 / 0) 28%);
  }

  .hero .wrap {
    grid-template-columns: 1.25fr 0.75fr;
    gap: 40px;
  }

  .float-ember {
    right: -22px;
  }
}

@media (min-width: 900px) {
  .hero {
    padding: 80px 0 110px;
  }

  .hero .lead {
    font-size: 1.15rem;
  }

  .hero-phone .phone {
    width: 300px;
  }

  .float {
    width: 108px;
    height: 108px;
  }

  .float-cabin {
    left: -70px;
  }

  .float-ember {
    right: -48px;
    width: 86px;
    height: 86px;
  }
}

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

.phone {
  position: relative;
  width: min(300px, 78vw);
  padding: 12px;
  border-radius: 42px;
  background: linear-gradient(145deg, #2b3747, #11192a);
  box-shadow: 0 30px 60px rgb(0 0 0 / 0.5), inset 0 0 0 2px rgb(255 255 255 / 0.08);
}

.phone img {
  width: 100%;
  border-radius: 32px;
  aspect-ratio: 9 / 16;
  object-fit: cover;
}

.phone::after {
  content: "";
  position: absolute;
  top: 22px;
  left: 50%;
  width: 70px;
  height: 7px;
  margin-left: -35px;
  border-radius: 7px;
  background: rgb(0 0 0 / 0.55);
}

.hero-phone .phone {
  transform: rotate(3deg);
}

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

.section {
  padding: 84px 0;
}

.section-alt {
  background:
    radial-gradient(1200px 400px at 50% 0%, rgb(54 80 107 / 0.35), transparent 70%),
    var(--night-2);
}

.section-head {
  max-width: 760px;
  margin: 0 auto 44px;
  text-align: center;
}

.section-head p {
  color: var(--snow-dim);
  font-size: 1.12rem;
}

.kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--heat);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.steps {
  display: grid;
  gap: 18px;
  margin: 0 0 48px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 26px 22px 22px 84px;
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 22px;
  top: 24px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--heat);
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
}

.steps h3 {
  color: var(--ink);
  margin-bottom: 4px;
}

.steps p {
  margin: 0;
  color: var(--ink-soft);
}

@media (min-width: 1000px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- Mini puzzle demo ------------------------------------------------------------- */

.demo {
  display: grid;
  gap: 28px;
  align-items: center;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(160deg, var(--slate) 0%, #1c2c42 100%);
  border: 1px solid rgb(255 255 255 / 0.08);
  box-shadow: var(--shadow);
}

.demo-copy h3 {
  font-size: 1.6rem;
  color: var(--gold);
}

.demo-copy p {
  color: var(--snow-dim);
}

.demo-play {
  display: grid;
  gap: 16px;
  justify-items: center;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: min(100%, 420px);
  padding: 10px;
  border-radius: 18px;
  background: #5a3a24;
  box-shadow: inset 0 0 0 4px #7a5434, var(--shadow-soft);
}

.cell {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--slate-hi), var(--slate));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06);
  cursor: pointer;
}

.cell:disabled {
  cursor: default;
}

.cell.target-glow {
  box-shadow: inset 0 0 0 3px rgb(255 200 87 / 0.7);
}

.cell img,
.cell svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cell img {
  padding: 8%;
  object-fit: contain;
}

/* One row of up to four pieces that shrinks to fit narrow phones. */
.hand {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 74px);
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.piece {
  width: 100%;
  aspect-ratio: 1;
  padding: 6px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffbf4 0%, #f5ede0 60%, #ebdfca 100%);
  box-shadow: inset 0 1px 0 #fff, 0 4px 0 #b9a07c, 0 9px 16px rgb(0 0 0 / 0.3);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.piece:active {
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 #b9a07c, 0 5px 10px rgb(0 0 0 / 0.3);
}

.piece[aria-pressed="true"] {
  outline: 4px solid var(--heat);
  outline-offset: 2px;
  transform: translateY(-4px);
}

.piece svg {
  width: 100%;
  height: 100%;
  transition: transform 0.15s ease;
}

.demo-status {
  min-height: 3.2em;
  margin: 0;
  text-align: center;
  font-weight: 700;
  color: var(--cream);
}

.demo-status.won {
  color: var(--gold);
  font-family: var(--font-head);
  font-size: 1.25rem;
}

.demo-actions {
  display: flex;
  gap: 10px;
}

@media (max-width: 479px) {
  .demo {
    padding: 22px 16px;
  }
}

@media (min-width: 900px) {
  .demo {
    grid-template-columns: 0.9fr 1.1fr;
    padding: 40px;
  }
}

/* Pipes (SVG) */
.pipe-outline {
  stroke: #4a2a18;
}

.pipe-body {
  stroke: var(--copper);
  transition: stroke 0.35s ease;
}

.pipe-stripe {
  stroke: #e3a877;
}

.pipe-core {
  fill: var(--copper);
  transition: fill 0.35s ease;
}

.hot .pipe-body {
  stroke: var(--heat);
}

.hot .pipe-core {
  fill: var(--heat);
}

.hot .pipe-stripe {
  stroke: #ffd39a;
}

.pipe-flow {
  stroke: #fff1c9;
  stroke-dasharray: 6 16;
  opacity: 0;
}

.hot .pipe-flow {
  opacity: 0.85;
  animation: flow 0.9s linear infinite;
}

.hot {
  filter: drop-shadow(0 0 6px rgb(255 138 42 / 0.8));
}

@keyframes flow {
  to {
    stroke-dashoffset: -22;
  }
}

/* --- Feature cards ------------------------------------------------------------------- */

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

.card {
  padding: 26px;
  border-radius: var(--radius);
  background: rgb(255 255 255 / 0.05);
  border: 1px solid rgb(255 255 255 / 0.09);
}

.card img {
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  object-fit: contain;
}

.card h3 {
  margin-bottom: 6px;
}

.card p {
  margin: 0;
  color: var(--snow-dim);
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- Split sections (village, daily) -------------------------------------------------- */

.split {
  display: grid;
  gap: 44px;
  align-items: center;
}

.split-text p {
  color: var(--snow-dim);
}

.ticks {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.ticks li {
  position: relative;
  padding: 7px 0 7px 36px;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--heat) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%231e2633' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat;
}

.split-media {
  position: relative;
  display: grid;
  justify-items: center;
}

.art-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 92px));
  justify-content: center;
  gap: 6px;
  margin-top: 26px;
}

.art-row img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgb(0 0 0 / 0.35));
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }

  .split.reverse .split-media {
    order: -1;
  }
}

/* --- Mechanics -------------------------------------------------------------------------- */

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

.mechanics li {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--ink);
}

.mechanics img,
.mechanics svg {
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.mechanics h3 {
  color: var(--ink);
  font-size: 1.15rem;
  margin-bottom: 2px;
}

.mechanics p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
}

@media (min-width: 760px) {
  .mechanics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .mechanics {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- Chapters --------------------------------------------------------------------- */

.chapters {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: chapter;
}

.chapters li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 0.05);
  border-left: 4px solid var(--heat);
  counter-increment: chapter;
}

.chapters li::before {
  content: counter(chapter);
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--heat);
  min-width: 1.5em;
}

.chapters strong {
  font-family: var(--font-head);
  font-size: 1.15rem;
  color: var(--cream);
}

.chapters span {
  margin-left: auto;
  color: var(--snow-dim);
  font-size: 0.95rem;
  white-space: nowrap;
}

@media (min-width: 760px) {
  .chapters {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.gallery {
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 6px 4px 22px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--slate-hi) transparent;
}

.gallery li {
  flex: 0 0 auto;
  scroll-snap-align: center;
}

.gallery figure {
  margin: 0;
}

.gallery .phone {
  width: 230px;
  padding: 9px;
  border-radius: 34px;
}

.gallery .phone img {
  border-radius: 26px;
}

.gallery .phone::after {
  top: 17px;
  width: 54px;
  margin-left: -27px;
  height: 6px;
}

.gallery a {
  display: block;
  border-radius: 34px;
}

.gallery figcaption {
  margin-top: 12px;
  text-align: center;
  font-weight: 700;
  color: var(--snow-dim);
}

@media (min-width: 1100px) {
  .gallery {
    justify-content: center;
    flex-wrap: wrap;
    overflow: visible;
  }

  .gallery .phone {
    width: 204px;
  }
}

.lightbox {
  max-width: min(92vw, 520px);
  max-height: 92vh;
  max-height: 92dvh;
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: transparent;
  overflow: visible;
}

.lightbox::backdrop {
  background: rgb(5 10 18 / 0.86);
}

.lightbox img {
  max-height: 86vh;
  max-height: 86dvh;
  width: auto;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.lightbox button {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  font-size: 1.6rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

/* --- FAQ ------------------------------------------------------------------------------ */

.faq {
  max-width: 860px;
  margin: 0 auto;
}

.faq details {
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.faq summary {
  position: relative;
  padding: 18px 56px 18px 22px;
  list-style: none;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  cursor: pointer;
}

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

.faq summary::after {
  content: "+";
  content: "+" / "";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--heat);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

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

.faq .answer {
  padding: 0 22px 20px;
  color: var(--ink-soft);
}

.faq .answer p:last-child {
  margin-bottom: 0;
}

.faq a {
  color: #9c4708;
}

/* --- Call to action ---------------------------------------------------------------- */

.cta {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 90px 0;
  background:
    radial-gradient(600px 300px at 50% 100%, rgb(255 138 42 / 0.28), transparent 70%),
    var(--night);
}

.cta h2 {
  color: var(--gold);
}

/* 404 page: the CTA block is the whole page. */
.not-found {
  min-height: 70vh;
  display: grid;
  align-items: center;
}

.not-found h1 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  color: var(--gold);
}

.not-found .kicker {
  margin: 0 auto 6px;
}

.cta p {
  max-width: 620px;
  margin: 0 auto 26px;
  color: var(--snow-dim);
}

.cta .hero-actions {
  justify-content: center;
}

.cta-art {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}

.cta-art img {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

/* --- Article pages (guide, support, press, privacy) ------------------------------------ */

.page-hero {
  padding: 56px 0 30px;
  background:
    radial-gradient(900px 300px at 20% 0%, rgb(255 138 42 / 0.18), transparent 70%),
    var(--night);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
  color: var(--snow-dim);
}

.breadcrumbs li + li::before {
  content: "›";
  margin-right: 6px;
  color: var(--snow-dim);
}

.breadcrumbs a {
  color: var(--snow-dim);
}

/* Same column as the article below it. */
.page-hero .wrap {
  max-width: 820px;
}

.page-hero p {
  max-width: 760px;
  color: var(--snow-dim);
  font-size: 1.15rem;
}

.prose {
  max-width: 820px;
  padding-bottom: 80px;
  overflow-wrap: break-word;
}

.prose h2 {
  margin-top: 1.8em;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  color: var(--gold);
}

.prose h3 {
  margin-top: 1.4em;
}

.prose p,
.prose li {
  color: #d7e2ee;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li {
  margin-bottom: 0.45em;
}

.prose address {
  margin: 0 0 1em;
  font-style: normal;
  line-height: 1.6;
  color: #d7e2ee;
}

.prose strong {
  color: var(--cream);
}

.toc {
  margin: 24px 0 8px;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: rgb(255 255 255 / 0.05);
  border: 1px solid rgb(255 255 255 / 0.09);
}

.toc h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: var(--cream);
}

.toc ol {
  margin: 0;
  columns: 2 220px;
}

.toc a {
  color: var(--snow);
}

.figure-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 14px;
  margin: 18px 0 8px;
  list-style: none;
}

.prose .figure-row,
.prose .downloads {
  padding: 0;
}

.figure-row li {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4px;
  margin: 0;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--ink);
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
}

.figure-row svg,
.figure-row img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.tip {
  margin: 18px 0;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: rgb(255 200 87 / 0.1);
  border-left: 4px solid var(--gold);
}

.tip p:last-child {
  margin: 0;
}

.fact-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.fact-table th,
.fact-table td {
  padding: 12px 16px;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
}

.fact-table th {
  width: 34%;
  color: var(--cream);
  font-family: var(--font-head);
  font-weight: 700;
  background: rgb(255 255 255 / 0.04);
}

@media (max-width: 479px) {
  .fact-table th,
  .fact-table td {
    display: block;
    width: auto;
  }

  .fact-table th {
    padding-bottom: 0;
    border-bottom: 0;
  }
}

.downloads {
  display: grid;
  gap: 16px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.downloads a {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 0.05);
  color: var(--snow);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.downloads a:hover {
  background: rgb(255 255 255 / 0.1);
  color: var(--gold);
}

.downloads img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 160px;
  border-radius: 12px;
}

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

.site-footer {
  padding: 48px 0 36px;
  background: #0a1422;
  border-top: 1px solid rgb(255 255 255 / 0.06);
  color: var(--snow-dim);
  font-size: 0.97rem;
}

.footer-grid {
  display: grid;
  gap: 28px;
}

.footer-grid h2 {
  font-size: 1.05rem;
  color: var(--cream);
  margin-bottom: 10px;
}

.footer-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-grid li {
  margin-bottom: 6px;
}

.footer-grid a {
  color: var(--snow-dim);
  text-decoration: none;
}

.footer-grid a:hover {
  color: var(--gold);
}

.footer-brand p {
  max-width: 340px;
}

.footer-bottom:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid rgb(255 255 255 / 0.06);
  font-size: 0.9rem;
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }
}

/* --- Motion ---------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

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

  .hero-phone .phone {
    transform: none;
  }
}

/* Without JavaScript, everything is visible. */
.no-js .reveal {
  opacity: 1;
  transform: none;
}

/* --- Without JavaScript and in print ---------------------------------------------------- */

.no-js .demo .board,
.no-js .demo .hand,
.no-js .demo-actions {
  display: none;
}

@media print {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .site-header,
  .snow,
  .demo-play,
  .lightbox {
    display: none !important;
  }
}
