/* ==========================================================================
   DiwaWIN — "Lamplight Ledger" design system
   Palette: Night Charcoal #141210 · Smoke #1D1A16 · Ember #26221C
            Lamp Flame #E3A857 · Flame Deep #B97F35 · Ivory #F5F1E8
            Ash #A79F91 · Signal Green #7FB069 · Warning Clay #C96F4A
   ========================================================================== */

:root {
  --night: #141210;
  --smoke: #1D1A16;
  --ember: #26221C;
  --flame: #E3A857;
  --flame-deep: #B97F35;
  --ivory: #F5F1E8;
  --ash: #A79F91;
  --sgreen: #7FB069;
  --clay: #C96F4A;
  --seam: rgba(227, 168, 87, 0.14);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-card: 0 20px 50px -20px rgba(10, 8, 6, 0.7);
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--night);
}

::selection {
  background: var(--flame);
  color: var(--night);
}

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--flame);
  color: var(--night);
  font-weight: 700;
  border-radius: 0 0 0.75rem 0;
}

.skip-link:focus {
  left: 0;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--flame);
  outline-offset: 3px;
  border-radius: 0.375rem;
}

a,
button,
[role="button"],
summary {
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Grain overlay — fixed pseudo-surface, never animated properties
   -------------------------------------------------------------------------- */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Header & navigation
   -------------------------------------------------------------------------- */
.site-header {
  background: rgba(20, 18, 16, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--seam);
}

.nav-link {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ash);
  transition: color 200ms var(--ease-spring), background-color 200ms var(--ease-spring);
}

.nav-link:hover {
  color: var(--ivory);
  background: var(--ember);
}

.nav-link.is-active {
  color: var(--flame);
  background: rgba(227, 168, 87, 0.09);
}

.mobile-nav {
  background: rgba(20, 18, 16, 0.97);
  border-bottom: 1px solid var(--seam);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.5rem;
  min-height: 44px;
  border-radius: 0.75rem;
  background: var(--flame);
  color: var(--night);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: background-color 180ms var(--ease-spring), transform 150ms var(--ease-spring);
}

.btn-primary:hover {
  background: var(--flame-deep);
}

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

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.5rem;
  min-height: 44px;
  border-radius: 0.75rem;
  border: 1px solid var(--seam);
  color: var(--ivory);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color 180ms var(--ease-spring), border-color 180ms var(--ease-spring), transform 150ms var(--ease-spring);
}

.btn-ghost:hover {
  background: var(--ember);
  border-color: rgba(227, 168, 87, 0.3);
}

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

/* Slow shimmer restricted to the download icon only */
@keyframes icon-shimmer {
  0%, 82% { opacity: 1; transform: translateY(0); }
  88%     { opacity: 0.55; transform: translateY(2px); }
  94%     { opacity: 1; transform: translateY(0); }
}

.dl-icon {
  animation: icon-shimmer 6s infinite var(--ease-spring);
}

/* --------------------------------------------------------------------------
   Section headers
   -------------------------------------------------------------------------- */
.kicker {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--flame);
}

.section-head { max-width: 40rem; }

.section-title {
  margin-top: 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ivory);
}

.section-sub {
  margin-top: 0.4rem;
  font-size: 0.95rem;
  color: var(--ash);
}

.seam-line {
  display: block;
  width: 64px;
  height: 2px;
  margin-top: 1rem;
  background: var(--flame);
  border-radius: 999px;
}

/* --------------------------------------------------------------------------
   Home hero
   -------------------------------------------------------------------------- */
.home-hero {
  border-bottom: 1px solid var(--seam);
}

/* Full-hero photographic backdrop (rummy table), faded hard on the text side */
.home-hero-bg {
  position: absolute;
  inset: 0;
  background-image: url("/assets/images/backgrounds/bg-home.jpg");
  background-size: cover;
  background-position: center 30%;
  opacity: 0.34;
}

.home-hero-fade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--night) 30%, rgba(20, 18, 16, 0.82) 55%, rgba(20, 18, 16, 0.45) 100%),
    linear-gradient(0deg, var(--night) 2%, transparent 40%),
    linear-gradient(180deg, rgba(20, 18, 16, 0.85) 0%, transparent 30%);
}

/* Collage stage — lamplit card-table panel that makes the logo tiles the hero */
.collage-stage {
  position: relative;
  border-radius: 1.5rem;
  border: 1px solid rgba(227, 168, 87, 0.28);
  padding: clamp(1.5rem, 2.5vw, 2.5rem);
  background-image: url("/assets/images/backgrounds/bg-home.jpg");
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(227, 168, 87, 0.18);
  overflow: hidden;
}

.collage-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 42%, rgba(20, 18, 16, 0.12) 0%, rgba(20, 18, 16, 0.68) 78%, rgba(20, 18, 16, 0.85) 100%);
}

.collage-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 90px 30px rgba(10, 8, 6, 0.55);
}

.lamp-pool {
  position: absolute;
  width: 44rem;
  height: 44rem;
  border-radius: 9999px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(227, 168, 87, 0.07) 0%, transparent 65%);
}

.lamp-pool-a { top: -18rem; left: -10rem; animation: drift-a 22s infinite alternate var(--ease-spring); }
.lamp-pool-b { bottom: -22rem; right: -8rem; animation: drift-b 26s infinite alternate var(--ease-spring); }

@keyframes drift-a { from { transform: translate(0, 0); } to { transform: translate(4rem, 2rem); } }
@keyframes drift-b { from { transform: translate(0, 0); } to { transform: translate(-3rem, -2rem); } }

.flame-dot,
.badge-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: currentColor;
  animation: breathe 3s ease-in-out infinite;
}

.flame-dot { color: var(--flame); }

@keyframes breathe {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* Hero collage — staggered offset logo tiles, no overlap */
.hero-collage {
  position: relative;
  z-index: 1;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.collage-tile {
  aspect-ratio: 1;
  border-radius: 1.1rem;
  border: 1px solid rgba(227, 168, 87, 0.35);
  background: rgba(29, 26, 22, 0.9);
  padding: 0.4rem;
  box-shadow: 0 18px 34px -12px rgba(10, 8, 6, 0.9), 0 0 0 1px rgba(10, 8, 6, 0.4);
  animation: tile-float 7s ease-in-out infinite alternate;
}

.collage-tile-1 { margin-top: 2.25rem; animation-delay: 1.2s; }
.collage-tile-2 { margin-top: 0.75rem; animation-delay: 2.6s; }
.collage-tile-3 { margin-top: 3rem; animation-delay: 3.8s; }

@keyframes tile-float {
  from { transform: translateY(0); }
  to   { transform: translateY(-6px); }
}

/* --------------------------------------------------------------------------
   Trust bar
   -------------------------------------------------------------------------- */
.trust-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--ash);
}

.trust-item strong {
  color: var(--ivory);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   APK cards
   -------------------------------------------------------------------------- */
.apk-card {
  display: flex;
  flex-direction: column;
  padding: 0.85rem;
  border-radius: 1rem;
  border: 1px solid var(--seam);
  background: var(--smoke);
  box-shadow: var(--shadow-card);
  transition: transform 250ms var(--ease-spring), border-color 250ms var(--ease-spring);
}

.apk-card:hover {
  transform: translateY(-4px);
  border-color: rgba(227, 168, 87, 0.3);
}

.apk-card-imgwrap {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0.9rem;
  background: var(--ember);
}

.apk-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms var(--ease-spring);
}

.apk-card:hover .apk-card-img {
  transform: scale(1.04);
}

.btn-card {
  margin-top: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.5rem 0.75rem;
  border-radius: 0.6rem;
  background: rgba(227, 168, 87, 0.1);
  border: 1px solid rgba(227, 168, 87, 0.25);
  color: var(--flame);
  font-size: 0.8rem;
  font-weight: 700;
  transition: background-color 200ms var(--ease-spring), color 200ms var(--ease-spring);
}

.apk-card:hover .btn-card {
  background: var(--flame);
  color: var(--night);
}

/* --------------------------------------------------------------------------
   Newest Games — spotlight card + mini tile shelf
   -------------------------------------------------------------------------- */
.spotlight-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 1.5rem;
  border: 1px solid rgba(227, 168, 87, 0.3);
  padding: clamp(1.4rem, 2.5vw, 2rem);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(227, 168, 87, 0.16);
  transition: border-color 250ms var(--ease-spring), transform 250ms var(--ease-spring);
}

.spotlight-card:hover {
  transform: translateY(-4px);
  border-color: rgba(227, 168, 87, 0.55);
}

.spotlight-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 400ms var(--ease-spring);
}

.spotlight-card:hover .spotlight-bg {
  transform: scale(1.03);
}

.spotlight-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 18, 16, 0.82) 0%, rgba(20, 18, 16, 0.6) 45%, rgba(20, 18, 16, 0.9) 100%),
    radial-gradient(ellipse at 30% 20%, rgba(20, 18, 16, 0.35), transparent 60%);
}

.spotlight-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mini-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  padding: 0.85rem 0.95rem;
  border-radius: 0.9rem;
  border: 1px solid var(--seam);
  background: var(--smoke);
  transition: border-color 200ms var(--ease-spring), background-color 200ms var(--ease-spring), transform 200ms var(--ease-spring);
}

.mini-tile-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--ash);
}

.mini-tile-stats {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(227, 168, 87, 0.08);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem;
  color: var(--ash);
}

.mini-tile-stats strong {
  color: var(--flame);
  font-weight: 700;
}

.mini-tile:hover {
  background: var(--ember);
  border-color: rgba(227, 168, 87, 0.35);
  transform: translateY(-2px);
}

.mini-tile-arrow {
  transition: transform 200ms var(--ease-spring);
}

.mini-tile:hover .mini-tile-arrow {
  transform: translateX(3px);
}

.mini-tile .stars .star-icon {
  width: 11px;
  height: 11px;
}

/* --------------------------------------------------------------------------
   Hot Games — download-chart leaderboard
   -------------------------------------------------------------------------- */
.rank-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--seam);
  background: var(--smoke);
  transition: border-color 200ms var(--ease-spring), background-color 200ms var(--ease-spring), transform 200ms var(--ease-spring);
}

.rank-row:hover {
  background: var(--ember);
  border-color: rgba(227, 168, 87, 0.35);
  transform: translateX(4px);
}

.rank-num {
  min-width: 2.4ch;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ash);
  text-align: right;
  letter-spacing: -0.04em;
}

.rank-top .rank-num {
  color: var(--flame);
}

.rank-top {
  border-color: rgba(227, 168, 87, 0.32);
  background: linear-gradient(90deg, rgba(227, 168, 87, 0.07) 0%, var(--smoke) 55%);
}

.heat-bar {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: rgba(227, 168, 87, 0.12);
  overflow: hidden;
}

.heat-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--flame-deep), var(--flame));
  transform-origin: left;
  animation: heat-in 900ms var(--ease-spring) both;
}

@keyframes heat-in {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.rank-row .stars .star-icon {
  width: 11px;
  height: 11px;
}

/* Stars */
.stars {
  display: inline-flex;
  gap: 1px;
}

.star-icon {
  width: 13px;
  height: 13px;
}

/* Badges — static positioning, in content flow */
.badge-new,
.badge-hot {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.badge-new {
  color: var(--sgreen);
  background: rgba(127, 176, 105, 0.12);
  border: 1px solid rgba(127, 176, 105, 0.3);
}

.badge-hot {
  color: var(--clay);
  background: rgba(201, 111, 74, 0.12);
  border: 1px solid rgba(201, 111, 74, 0.3);
}

.badge-sm {
  padding: 0.15rem 0.5rem;
  font-size: 0.6rem;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   APK detail hero
   -------------------------------------------------------------------------- */
.apk-hero {
  border-block: 1px solid var(--seam);
  background: var(--smoke);
}

.apk-hero-bg {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: saturate(0.95);
  opacity: 0.5;
}

.apk-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(20, 18, 16, 0.88) 0%, rgba(20, 18, 16, 0.62) 60%, rgba(20, 18, 16, 0.4) 100%),
    linear-gradient(180deg, rgba(20, 18, 16, 0.75) 0%, rgba(20, 18, 16, 0.55) 45%, rgba(20, 18, 16, 0.92) 100%);
}

/* Author / reviewer chip */
.author-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 1rem 0.4rem 0.45rem;
  border-radius: 999px;
  background: rgba(38, 34, 28, 0.75);
  border: 1px solid var(--seam);
}

.author-chip img {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  object-fit: cover;
  border: 2px solid rgba(227, 168, 87, 0.55);
}

.author-stack {
  display: inline-flex;
}

.author-stack img + img {
  margin-left: -12px;
}

.apk-logo-frame {
  padding: 5px;
  border-radius: 1.35rem;
  background: linear-gradient(150deg, rgba(227, 168, 87, 0.75), rgba(227, 168, 87, 0.12));
  box-shadow: var(--shadow-card);
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: rgba(38, 34, 28, 0.85);
  border: 1px solid var(--seam);
  font-size: 0.82rem;
}

/* --------------------------------------------------------------------------
   Sidebar cards
   -------------------------------------------------------------------------- */
.sidebar-card {
  padding: 1.4rem;
  border-radius: 1rem;
  border: 1px solid var(--seam);
  background: var(--smoke);
  box-shadow: var(--shadow-card);
}

.sidebar-title {
  font-size: 0.72rem;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--flame);
}

.def-list {
  margin-top: 0.75rem;
}

.def-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-top: 1px solid rgba(227, 168, 87, 0.08);
  font-size: 0.85rem;
}

.def-list > div:first-child {
  border-top: 0;
}

.def-list dt { color: var(--ash); }
.def-list dd { color: var(--ivory); font-weight: 600; text-align: right; }

/* --------------------------------------------------------------------------
   Warning components
   -------------------------------------------------------------------------- */
.warning-card {
  padding: 1.2rem 1.4rem;
  border-radius: 1rem;
  background: var(--smoke);
  border: 1px solid rgba(201, 111, 74, 0.25);
  border-left: 3px solid var(--clay);
}

.warning-panel {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: 1.25rem;
  background: var(--smoke);
  border: 1px solid rgba(201, 111, 74, 0.25);
  border-left: 4px solid var(--clay);
  box-shadow: var(--shadow-card);
}

.tip-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(201, 111, 74, 0.3);
  background: rgba(201, 111, 74, 0.08);
  color: var(--clay);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* --------------------------------------------------------------------------
   Static page hero
   -------------------------------------------------------------------------- */
.page-hero {
  border-bottom: 1px solid var(--seam);
  background: var(--smoke);
}

.page-hero-bg {
  position: absolute;
  inset: -60px;
  background-image: url("/assets/images/logo.webp");
  background-size: 340px;
  background-position: right -40px center;
  background-repeat: no-repeat;
  filter: blur(48px) saturate(0.9);
  opacity: 0.3;
}

.page-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 18, 16, 0.6) 0%, rgba(20, 18, 16, 0.92) 100%);
}

/* --------------------------------------------------------------------------
   Article typography — verbatim content from source docs
   -------------------------------------------------------------------------- */
.article {
  max-width: 72ch;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ash);
}

.article h2 {
  margin-top: 2.5rem;
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ivory);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--seam);
}

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

.article h3 {
  margin-top: 1.8rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--flame);
}

.article p {
  margin-top: 1rem;
}

.article strong {
  color: var(--ivory);
  font-weight: 600;
}

.article ul,
.article ol {
  margin-top: 1rem;
  padding-left: 1.4rem;
  display: grid;
  gap: 0.5rem;
}

.article ul { list-style: none; padding-left: 0; }

.article ul li {
  position: relative;
  padding-left: 1.6rem;
}

.article ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--flame);
  opacity: 0.8;
}

.article ol { list-style: decimal; }

.article ol li::marker {
  color: var(--flame);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
}

.article a {
  color: var(--flame);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article a:hover { color: var(--flame-deep); }

/* --------------------------------------------------------------------------
   Footer & scroll-top
   -------------------------------------------------------------------------- */
.footer-link {
  color: var(--ash);
  transition: color 180ms var(--ease-spring);
}

.footer-link:hover { color: var(--flame); }

.scroll-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 0.85rem;
  background: var(--flame);
  color: var(--night);
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 250ms var(--ease-spring), transform 250ms var(--ease-spring), background-color 180ms var(--ease-spring);
}

.scroll-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top:hover { background: var(--flame-deep); }

/* --------------------------------------------------------------------------
   Reveal on scroll — staggered cascade (JS adds .is-visible)
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms var(--ease-spring), transform 500ms var(--ease-spring);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* No-JS fallback: never hide content when script hasn't run */
html.no-observer .reveal {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   Reduced motion — kill every loop and transition dead
   -------------------------------------------------------------------------- */
@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;
  }
}

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */
@media (max-width: 374px) {
  .btn-primary,
  .btn-ghost { width: 100%; justify-content: center; }
}

/* ============================================================================
   FLOATING CTA (sticky pill at bottom, follows scroll, on every page)
   ============================================================================ */

.floating-cta {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(7, 4, 26, 0.82);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    box-shadow: var(--shadow-lg), 0 0 26px rgba(124, 58, 237, 0.35);
    animation: floatRise 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 300ms backwards;
}

.floating-cta::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(247, 201, 72, 0.55), rgba(236, 72, 153, 0.45) 50%, rgba(124, 58, 237, 0.55));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes floatRise {
    from { opacity: 0; transform: translate(-50%, 40px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

.store-badge {
    display: inline-flex;
    border-radius: 999px;
    overflow: hidden;
    transition: transform var(--tx-base), box-shadow var(--tx-base), filter var(--tx-base);
    cursor: pointer;
}

.store-badge img {
    width: auto;
    height: 48px;
    display: block;
    border-radius: 999px;
}

.store-badge:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
}

.store-badge:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 4px;
}