/*
Theme Name: Sift
Theme URI: https://siftpuzzle.online/
Author: Sift Brain Games
Author URI: https://siftpuzzle.online/
Description: A 3D animated one-page theme for Sift — Brain Games. Dark "premium night" palette lifted straight from the app, an animated WebGL-free 3D hero, tilting mode cards, a rotating language ring and Google Play / App Store download links. Bilingual: visitors in Arab countries are served Arabic (full RTL) automatically, everyone else English, with a manual EN/العربية switch. Built for siftpuzzle.online.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sift
Tags: one-column, custom-colors, custom-logo, custom-menu, featured-images, translation-ready, rtl-language-support, blog, portfolio
*/

/* =========================================================================
   1. Tokens — mirrored from the app's src/theme/tokens.ts
   ========================================================================= */

:root {
  --bg: #07162c;
  --bg2: #0d2142;
  --card: #12284a;
  --card-elevated: #18345c;
  --card-pressed: #1c3a69;
  --line: #1f3d68;
  --primary: #4d8dff;
  --accent: #63c7ff;
  --gold: #f2c66d;
  --text: #f8faff;
  --dim: #aab8cc;
  --success: #55d69e;
  --error: #ff6f7d;
  --cream: #f4f0e6;

  /* Per-mode accents (categoryAccents) */
  --c-puzzle: #9b8cff;
  --c-flags: #ff7c78;
  --c-capitals: #6dd3a8;
  --c-history: #a99cff;
  --c-science: #f2c66d;
  --c-math: #63c7ff;
  --c-party: #63c7ff;
  --c-picture: #55d69e;
  --c-solo: #4d8dff;

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  --shell: 1180px;
  --gutter: 24px;
  --header-h: 72px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial,
    "Noto Sans", "Noto Sans Arabic", sans-serif;
}

/* =========================================================================
   2. Base
   ========================================================================= */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* The fixed atmosphere layer: aurora blobs + starfield canvas. */
.sift-sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(77, 141, 255, 0.22), transparent 60%),
    radial-gradient(900px 620px at 8% 12%, rgba(99, 199, 255, 0.14), transparent 62%),
    radial-gradient(1000px 800px at 50% 108%, rgba(155, 140, 255, 0.16), transparent 65%),
    linear-gradient(180deg, var(--bg) 0%, #081a34 45%, var(--bg) 100%);
}

.sift-sky canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
}

.sift-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  animation: drift 26s var(--ease) infinite alternate;
}

.sift-blob--a {
  width: 46vw;
  height: 46vw;
  top: -12vw;
  inset-inline-end: -8vw;
  background: radial-gradient(circle, rgba(77, 141, 255, 0.55), transparent 70%);
}

.sift-blob--b {
  width: 38vw;
  height: 38vw;
  top: 46vh;
  inset-inline-start: -12vw;
  background: radial-gradient(circle, rgba(155, 140, 255, 0.42), transparent 70%);
  animation-delay: -9s;
}

.sift-blob--c {
  width: 34vw;
  height: 34vw;
  bottom: -10vw;
  inset-inline-end: 12vw;
  background: radial-gradient(circle, rgba(99, 199, 255, 0.35), transparent 70%);
  animation-delay: -16s;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-4vw, 6vh, 0) scale(1.15);
  }
}

#page {
  position: relative;
  z-index: 1;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--text);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 800;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.1rem);
}

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

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em;
}

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

.screen-reader-text {
  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:focus {
  position: fixed;
  z-index: 999;
  inset-inline-start: 16px;
  top: 16px;
  clip: auto;
  width: auto;
  height: auto;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: #001229;
  font-weight: 700;
}

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

/* =========================================================================
   3. Header
   ========================================================================= */

.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease),
    backdrop-filter 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.is-stuck {
  background: rgba(7, 22, 44, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}

.site-header .shell {
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.25rem;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.brand:hover {
  color: var(--text);
}

.brand small {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

.nav {
  margin-inline-start: auto;
}

.nav ul {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  color: var(--dim);
  font-size: 0.95rem;
  font-weight: 600;
}

.nav a:hover,
.nav .current-menu-item > a {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

/* EN | العربية switch. Sits after the menu on desktop, next to the burger
   on small screens (the flex order below does both). */
.lang-switch {
  order: 3;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.04);
}

.nav {
  order: 2;
}

.nav-toggle {
  order: 4;
}

.lang-switch a {
  padding: 5px 12px;
  border-radius: var(--r-pill);
  color: var(--dim);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
}

.lang-switch a:hover {
  color: var(--text);
}

.lang-switch a.is-active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #04162e;
}

.nav-toggle {
  display: none;
  margin-inline-start: 8px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  margin-inline: auto;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s var(--ease), opacity 0.2s linear;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: relative;
}

.nav-toggle span::before {
  top: -6px;
}

.nav-toggle span::after {
  top: 4px;
}

.nav-toggle[aria-expanded="true"] span {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] span::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span::after {
  transform: translateY(-6px) rotate(-45deg);
}

.scroll-progress {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  z-index: 70;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--gold));
  box-shadow: 0 0 14px rgba(99, 199, 255, 0.7);
}

/* =========================================================================
   4. Buttons & store badges
   ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    background 0.25s var(--ease);
}

.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #04162e;
  box-shadow: 0 12px 30px -10px rgba(77, 141, 255, 0.8);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line);
  color: var(--text);
}

.btn:hover {
  transform: translateY(-2px);
  color: #04162e;
}

.btn--ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 22px 11px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(24, 52, 92, 0.95), rgba(11, 28, 54, 0.95));
  color: var(--text);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.9);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.store-badge:hover {
  transform: translateY(-3px);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 22px 46px -20px rgba(99, 199, 255, 0.55);
}

.store-badge svg {
  width: 27px;
  height: 27px;
  flex: none;
}

.store-badge-text b {
  display: block;
  font-size: 1.05rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.store-badge-text span {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

/* =========================================================================
   5. Hero + the 3D rig
   ========================================================================= */

.hero {
  position: relative;
  padding: calc(var(--header-h) + 72px) 0 90px;
}

.hero .shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(99, 199, 255, 0.08);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(85, 214, 158, 0.7);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(85, 214, 158, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(85, 214, 158, 0);
  }
}

.hero h1 .grad {
  background: linear-gradient(110deg, var(--accent) 5%, var(--primary) 45%, var(--gold) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  max-width: 46ch;
  color: var(--dim);
  font-size: 1.1rem;
}

.hero-cta {
  margin: 30px 0 26px;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.stat-row li {
  flex: 1 1 130px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(18, 40, 74, 0.6);
  backdrop-filter: blur(6px);
}

.stat-row b {
  display: block;
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--text);
}

.stat-row span {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

/* --- The scene ---------------------------------------------------------- */

.scene {
  position: relative;
  height: 520px;
  perspective: 1100px;
  perspective-origin: 50% 45%;
}

.rig {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  will-change: transform;
}

.cube {
  position: relative;
  width: 168px;
  height: 168px;
  transform-style: preserve-3d;
  animation: tumble 22s linear infinite;
}

@keyframes tumble {
  from {
    transform: rotateX(-18deg) rotateY(0deg);
  }
  to {
    transform: rotateX(-18deg) rotateY(360deg);
  }
}

.face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(99, 199, 255, 0.5);
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(24, 52, 92, 0.92), rgba(11, 28, 54, 0.88));
  box-shadow: inset 0 0 40px rgba(99, 199, 255, 0.16),
    0 0 60px -14px rgba(77, 141, 255, 0.55);
  font-size: 4.6rem;
  font-weight: 800;
  color: var(--text);
  text-shadow: 0 0 22px rgba(99, 199, 255, 0.55);
  backface-visibility: visible;
}

.face--1 { transform: translateZ(84px); }
.face--2 { transform: rotateY(90deg) translateZ(84px); }
.face--3 { transform: rotateY(180deg) translateZ(84px); }
.face--4 { transform: rotateY(-90deg) translateZ(84px); }
.face--5 { transform: rotateX(90deg) translateZ(84px); }
.face--6 { transform: rotateX(-90deg) translateZ(84px); }

.face--5,
.face--6 {
  font-size: 2.2rem;
  color: var(--gold);
}

/* Orbit rings around the cube. */
.orbit {
  position: absolute;
  top: 50%;
  inset-inline-start: 50%;
  width: 420px;
  height: 420px;
  margin: -210px 0 0 -210px;
  border: 1px dashed rgba(99, 199, 255, 0.28);
  border-radius: 50%;
  transform-style: preserve-3d;
}

.orbit--1 {
  transform: rotateX(74deg);
  animation: spin 18s linear infinite;
}

.orbit--2 {
  width: 300px;
  height: 300px;
  margin: -150px 0 0 -150px;
  border-color: rgba(242, 198, 109, 0.26);
  transform: rotateX(74deg) rotateZ(40deg);
  animation: spin 12s linear infinite reverse;
}

@keyframes spin {
  from {
    transform: rotateX(74deg) rotateZ(0deg);
  }
  to {
    transform: rotateX(74deg) rotateZ(360deg);
  }
}

.orbit--2 {
  animation-name: spin2;
}

@keyframes spin2 {
  from {
    transform: rotateX(74deg) rotateZ(360deg);
  }
  to {
    transform: rotateX(74deg) rotateZ(0deg);
  }
}

.orbit i {
  position: absolute;
  top: 50%;
  inset-inline-start: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(18, 40, 74, 0.95);
  border: 1px solid var(--line);
  font-size: 1.2rem;
  font-style: normal;
  transform-style: preserve-3d;
  box-shadow: 0 10px 24px -12px #000;
}

/* Floating chips scattered in Z. */
.chip3d {
  position: absolute;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(13, 33, 66, 0.9);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 16px 34px -18px #000;
  animation: bob 7s ease-in-out infinite;
}

.chip3d::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline-end: 8px;
  border-radius: 50%;
  background: var(--tint, var(--accent));
  box-shadow: 0 0 12px var(--tint, var(--accent));
}

@keyframes bob {
  0%, 100% {
    transform: translate3d(0, 0, var(--z, 40px));
  }
  50% {
    transform: translate3d(0, -14px, var(--z, 40px));
  }
}

/* =========================================================================
   6. Sections
   ========================================================================= */

.section {
  position: relative;
  padding: 84px 0;
}

.section--tight {
  padding: 56px 0;
}

.section-head {
  max-width: 62ch;
  margin-bottom: 42px;
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.section-head p {
  color: var(--dim);
  font-size: 1.05rem;
  margin-bottom: 0;
}

.kicker {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* Marquee band */

.marquee {
  position: relative;
  padding: 16px 0;
  border-block: 1px solid var(--line);
  background: rgba(13, 33, 66, 0.55);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  gap: 44px;
  animation: slide 34s linear infinite;
}

.marquee span {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: rgba(248, 250, 255, 0.72);
  white-space: nowrap;
}

.marquee span::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

@keyframes slide {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

/* Mode cards */

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  perspective: 1400px;
}

.mode {
  position: relative;
  padding: 26px 24px 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(165deg, rgba(24, 52, 92, 0.78), rgba(9, 25, 48, 0.9));
  transform-style: preserve-3d;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
  overflow: hidden;
}

.mode::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    340px 240px at var(--mx, 50%) var(--my, 0%),
    rgba(255, 255, 255, 0.12),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}

.mode:hover {
  border-color: color-mix(in srgb, var(--tint) 60%, var(--line));
  box-shadow: 0 34px 60px -34px rgba(0, 0, 0, 0.95),
    0 0 0 1px color-mix(in srgb, var(--tint) 28%, transparent);
}

.mode:hover::after {
  opacity: 1;
}

.mode-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--tint) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--tint) 45%, transparent);
  color: var(--tint);
  font-size: 1.5rem;
  transform: translateZ(38px);
}

.mode-icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mode h3 {
  margin-bottom: 6px;
  transform: translateZ(26px);
}

.mode p {
  margin: 0;
  color: var(--dim);
  font-size: 0.97rem;
  transform: translateZ(16px);
}

.mode .tag {
  position: absolute;
  top: 20px;
  inset-inline-end: 20px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--success);
  color: #04162e;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: translateZ(44px);
}

/* Split feature rows */

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 56px;
  align-items: center;
}

.feature-list {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.feature-list li {
  position: relative;
  padding-inline-start: 34px;
  color: var(--dim);
}

.feature-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(85, 214, 158, 0.16);
  border: 1px solid rgba(85, 214, 158, 0.55);
}

.feature-list li::after {
  content: "";
  position: absolute;
  inset-inline-start: 7px;
  top: 11px;
  width: 6px;
  height: 3px;
  border-inline-start: 2px solid var(--success);
  border-bottom: 2px solid var(--success);
  transform: rotate(-45deg);
}

.feature-list b {
  color: var(--text);
}

/* Phone mockup */

.phone-stage {
  perspective: 1200px;
  display: grid;
  place-items: center;
}

.phone {
  position: relative;
  width: 286px;
  height: 580px;
  padding: 12px;
  border-radius: 44px;
  background: linear-gradient(160deg, #22436f, #0a1c36);
  border: 1px solid var(--line);
  box-shadow: 0 60px 90px -50px #000, inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: rotateY(-19deg) rotateX(7deg);
  transform-style: preserve-3d;
  transition: transform 0.8s var(--ease);
  animation: float-phone 9s ease-in-out infinite;
}

@keyframes float-phone {
  0%, 100% {
    transform: rotateY(-19deg) rotateX(7deg) translateY(0);
  }
  50% {
    transform: rotateY(-13deg) rotateX(4deg) translateY(-16px);
  }
}

.phone::before {
  content: "";
  position: absolute;
  top: 12px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  width: 108px;
  height: 22px;
  border-radius: var(--r-pill);
  background: #050f1f;
  z-index: 3;
}

.phone-screen {
  position: relative;
  height: 100%;
  padding: 40px 16px 18px;
  border-radius: 34px;
  background: linear-gradient(180deg, #07162c, #0d2142 60%, #07162c);
  overflow: hidden;
}

.ui-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.ui-word {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.ui-word em {
  font-style: normal;
  color: var(--gold);
}

.ui-coins {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--gold);
}

.ui-coins::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(242, 198, 109, 0.8);
}

.ui-label {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.ui-h {
  margin: 4px 0 14px;
  font-size: 1.05rem;
  font-weight: 800;
}

.ui-split {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.ui-split div {
  flex: 1;
  padding: 12px 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(18, 40, 74, 0.85);
  font-size: 0.72rem;
  font-weight: 700;
}

.ui-split div:first-child {
  border-color: var(--accent);
  background: rgba(28, 58, 105, 0.9);
}

.ui-split small {
  display: block;
  font-weight: 500;
  color: var(--dim);
  font-size: 0.63rem;
}

.ui-row {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(18, 40, 74, 0.8);
  animation: rise 0.7s var(--ease) backwards;
}

.ui-row:nth-child(2) { animation-delay: 0.1s; }
.ui-row:nth-child(3) { animation-delay: 0.2s; }
.ui-row:nth-child(4) { animation-delay: 0.3s; }
.ui-row:nth-child(5) { animation-delay: 0.4s; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.ui-dot {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tint) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--tint) 55%, transparent);
}

.ui-row b {
  display: block;
  font-size: 0.8rem;
}

.ui-row span {
  font-size: 0.66rem;
  color: var(--dim);
}

/* Tile board (the word puzzle preview) */

.board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  perspective: 900px;
}

.tile {
  display: grid;
  place-items: center;
  aspect-ratio: 1.35;
  border-radius: 12px;
  background: var(--cream);
  color: #12284a;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 16px -10px #000;
  animation: flip 6s var(--ease) infinite;
  transform-style: preserve-3d;
}

.tile.is-correct {
  background: #bdeed7;
}

.tile.is-selected {
  background: #d8e7ff;
}

@keyframes flip {
  0%, 55%, 100% {
    transform: rotateY(0deg);
  }
  30% {
    transform: rotateY(180deg);
  }
}

.board .tile:nth-child(1) { animation-delay: 0s; }
.board .tile:nth-child(2) { animation-delay: 0.35s; }
.board .tile:nth-child(3) { animation-delay: 0.7s; }
.board .tile:nth-child(4) { animation-delay: 1.05s; }
.board .tile:nth-child(5) { animation-delay: 1.4s; }
.board .tile:nth-child(6) { animation-delay: 1.75s; }
.board .tile:nth-child(7) { animation-delay: 2.1s; }
.board .tile:nth-child(8) { animation-delay: 2.45s; }

/* Party / room code */

.room-code {
  display: flex;
  gap: 12px;
  margin: 8px 0 24px;
  perspective: 800px;
}

.room-code b {
  display: grid;
  place-items: center;
  width: 62px;
  height: 74px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(160deg, rgba(24, 52, 92, 0.95), rgba(10, 26, 50, 0.95));
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(99, 199, 255, 0.6);
  animation: card-flip 5s var(--ease) infinite;
  transform-style: preserve-3d;
}

.room-code b:nth-child(2) { animation-delay: 0.2s; }
.room-code b:nth-child(3) { animation-delay: 0.4s; }
.room-code b:nth-child(4) { animation-delay: 0.6s; }

@keyframes card-flip {
  0%, 60%, 100% {
    transform: rotateX(0deg);
  }
  30% {
    transform: rotateX(360deg);
  }
}

.player-stack {
  display: grid;
  gap: 10px;
}

.player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(18, 40, 74, 0.72);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}

.player:hover {
  transform: translateX(6px);
  border-color: var(--accent);
}

.player i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tint) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--tint) 55%, transparent);
  color: var(--tint);
  font-style: normal;
  font-weight: 800;
  font-size: 0.85rem;
}

.player b {
  flex: 1;
  font-size: 0.95rem;
}

.player span {
  color: var(--gold);
  font-weight: 800;
}

.player .host-tag {
  display: inline-block;
  margin-inline-start: 8px;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  background: rgba(242, 198, 109, 0.16);
  color: var(--gold);
  font-size: 0.6rem;
  font-style: normal;
  letter-spacing: 0.1em;
  vertical-align: 2px;
}

/* Language ring */

.ring-stage {
  height: 320px;
  perspective: 1000px;
  display: grid;
  place-items: center;
}

.ring {
  position: relative;
  width: 220px;
  height: 220px;
  transform-style: preserve-3d;
  animation: ring-spin 20s linear infinite;
}

@keyframes ring-spin {
  from {
    transform: rotateX(-10deg) rotateY(0deg);
  }
  to {
    transform: rotateX(-10deg) rotateY(-360deg);
  }
}

.ring .lang {
  position: absolute;
  top: 50%;
  inset-inline-start: 50%;
  width: 168px;
  margin: -38px 0 0 -84px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(13, 33, 66, 0.88);
  text-align: center;
  box-shadow: 0 20px 40px -24px #000;
  backface-visibility: hidden;
}

.ring .lang b {
  display: block;
  font-size: 1.05rem;
}

.ring .lang span {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.ring .lang:nth-child(1) { transform: rotateY(0deg) translateZ(230px); }
.ring .lang:nth-child(2) { transform: rotateY(72deg) translateZ(230px); }
.ring .lang:nth-child(3) { transform: rotateY(144deg) translateZ(230px); }
.ring .lang:nth-child(4) { transform: rotateY(216deg) translateZ(230px); }
.ring .lang:nth-child(5) { transform: rotateY(288deg) translateZ(230px); }

/* Ladder */

.ladder {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.ladder div {
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(18, 40, 74, 0.6);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--dim);
  transition: transform 0.3s var(--ease), color 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

.ladder div small {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.ladder div:hover {
  transform: translateY(-4px);
  color: var(--text);
  border-color: var(--accent);
}

.ladder div:last-child {
  border-color: rgba(242, 198, 109, 0.6);
  color: var(--gold);
}

.ladder div:last-child small {
  color: var(--gold);
}

/* CTA panel */

.cta-panel {
  position: relative;
  padding: 60px 40px;
  border: 1px solid var(--line);
  border-radius: 36px;
  background: linear-gradient(150deg, rgba(28, 58, 105, 0.85), rgba(8, 24, 46, 0.92));
  overflow: hidden;
  text-align: center;
}

.cta-panel::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(99, 199, 255, 0.16) 60deg,
    transparent 140deg,
    rgba(242, 198, 109, 0.14) 220deg,
    transparent 320deg
  );
  animation: sweep 18s linear infinite;
  pointer-events: none;
}

@keyframes sweep {
  to {
    transform: rotate(360deg);
  }
}

.cta-panel > * {
  position: relative;
}

.cta-panel .store-row {
  justify-content: center;
  margin-top: 26px;
}

/* FAQ */

.faq {
  display: grid;
  gap: 12px;
  max-width: 860px;
  margin-inline: auto;
}

.faq details {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(18, 40, 74, 0.6);
  overflow: hidden;
}

.faq summary {
  padding: 18px 22px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.faq summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 0.3s var(--ease);
}

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

.faq p {
  margin: 0;
  padding: 0 22px 20px;
  color: var(--dim);
}

/* Reveal-on-scroll */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

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

.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.reveal[data-delay="5"] { transition-delay: 0.4s; }

/* =========================================================================
   7. Blog / pages (so the theme works beyond the landing page)
   ========================================================================= */

.page-hero {
  padding: calc(var(--header-h) + 60px) 0 20px;
}

.entry {
  padding: 28px 0 40px;
}

.entry-card {
  padding: 26px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: rgba(18, 40, 74, 0.6);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}

.entry-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.entry-card h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.entry-meta {
  color: var(--dim);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.entry-content {
  max-width: 76ch;
}

.entry-content img,
.wp-block-image img {
  border-radius: var(--r-md);
}

.entry-content blockquote {
  margin: 24px 0;
  padding: 4px 22px;
  border-inline-start: 3px solid var(--accent);
  color: var(--dim);
  font-style: italic;
}

.entry-content code,
.entry-content pre {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
}

.entry-content pre {
  padding: 16px;
  overflow-x: auto;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
}

.entry-content th,
.entry-content td {
  padding: 10px;
  border: 1px solid var(--line);
}

.pagination {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 20px 0 60px;
}

.pagination .page-numbers {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--dim);
}

.pagination .current {
  background: var(--primary);
  color: #04162e;
  border-color: transparent;
}

.comment-respond,
.comments-area {
  max-width: 76ch;
  margin-top: 40px;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(7, 22, 44, 0.8);
  color: var(--text);
  font-family: inherit;
}

/* =========================================================================
   8. Footer
   ========================================================================= */

.site-footer {
  position: relative;
  padding: 56px 0 34px;
  border-top: 1px solid var(--line);
  background: rgba(6, 18, 36, 0.7);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(auto-fit, minmax(150px, 1fr));
  gap: 36px;
  margin-bottom: 34px;
}

.footer-grid p {
  color: var(--dim);
  max-width: 38ch;
  font-size: 0.95rem;
}

.footer-grid h4 {
  margin-bottom: 14px;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

.footer-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  font-size: 0.95rem;
}

.footer-grid ul a {
  color: var(--text);
}

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

.social {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.social a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
    background 0.3s var(--ease);
}

.social a:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: rgba(99, 199, 255, 0.12);
}

.social svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.85rem;
}

/* =========================================================================
   9. Responsive
   ========================================================================= */

@media (max-width: 980px) {
  .hero .shell {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .scene {
    height: 400px;
  }

  .cube {
    width: 132px;
    height: 132px;
  }

  .face--1 { transform: translateZ(66px); }
  .face--2 { transform: rotateY(90deg) translateZ(66px); }
  .face--3 { transform: rotateY(180deg) translateZ(66px); }
  .face--4 { transform: rotateY(-90deg) translateZ(66px); }
  .face--5 { transform: rotateX(90deg) translateZ(66px); }
  .face--6 { transform: rotateX(-90deg) translateZ(66px); }

  .split {
    gap: 34px;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .nav-toggle {
    display: grid;
    place-items: center;
  }

  .lang-switch {
    margin-inline-start: auto;
  }

  .nav {
    position: fixed;
    inset: var(--header-h) 12px auto 12px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: rgba(9, 25, 48, 0.97);
    backdrop-filter: blur(16px);
    box-shadow: 0 30px 60px -30px #000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease),
      visibility 0.25s;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .nav a {
    padding: 12px 14px;
  }

  .section {
    padding: 64px 0;
  }

  .section-head {
    margin-bottom: 30px;
  }

  .cta-panel {
    padding: 42px 22px;
  }

  /* Phone hero: copy first, a shorter scene under it. */
  .hero {
    padding-top: calc(var(--header-h) + 36px);
    padding-bottom: 56px;
  }

  .hero .shell {
    gap: 18px;
  }

  .scene {
    height: 320px;
  }

  .stat-row li {
    flex-basis: calc(50% - 6px);
    padding: 12px 14px;
  }

  .stat-row b {
    font-size: 1.4rem;
  }

  .chip3d {
    padding: 7px 12px;
    font-size: 0.74rem;
  }

  .orbit {
    display: none;
  }

  .store-badge {
    flex: 1 1 auto;
    justify-content: flex-start;
  }

  .split {
    gap: 40px;
  }

  .phone {
    width: 258px;
    height: 524px;
  }

  .room-code b {
    width: 54px;
    height: 64px;
    font-size: 1.6rem;
  }

  .ring-stage {
    height: 260px;
  }

  .ring .lang:nth-child(1) { transform: rotateY(0deg) translateZ(180px); }
  .ring .lang:nth-child(2) { transform: rotateY(72deg) translateZ(180px); }
  .ring .lang:nth-child(3) { transform: rotateY(144deg) translateZ(180px); }
  .ring .lang:nth-child(4) { transform: rotateY(216deg) translateZ(180px); }
  .ring .lang:nth-child(5) { transform: rotateY(288deg) translateZ(180px); }
}

/* Narrow phones (≤ 430px). */
@media (max-width: 430px) {
  :root {
    --gutter: 18px;
    --header-h: 64px;
  }

  .brand {
    font-size: 1.1rem;
  }

  .brand small {
    display: none;
  }

  .brand img {
    width: 32px;
    height: 32px;
  }

  .lang-switch a {
    padding: 5px 9px;
    font-size: 0.76rem;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .scene {
    height: 280px;
  }

  .cube {
    width: 112px;
    height: 112px;
  }

  .face--1 { transform: translateZ(56px); }
  .face--2 { transform: rotateY(90deg) translateZ(56px); }
  .face--3 { transform: rotateY(180deg) translateZ(56px); }
  .face--4 { transform: rotateY(-90deg) translateZ(56px); }
  .face--5 { transform: rotateX(90deg) translateZ(56px); }
  .face--6 { transform: rotateX(-90deg) translateZ(56px); }

  .face {
    font-size: 3.2rem;
    border-radius: 18px;
  }

  .face--5,
  .face--6 {
    font-size: 1.5rem;
  }

  /* Two chips are plenty on a narrow screen. */
  .chip3d:nth-of-type(n + 3) {
    display: none;
  }

  .store-row {
    gap: 10px;
  }

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

  .mode {
    padding: 22px 20px 24px;
    border-radius: 22px;
  }

  .mode-grid {
    gap: 14px;
  }

  .ring .lang {
    width: 140px;
    margin-inline-start: -70px;
    padding: 11px 12px;
  }

  .ring .lang:nth-child(1) { transform: rotateY(0deg) translateZ(140px); }
  .ring .lang:nth-child(2) { transform: rotateY(72deg) translateZ(140px); }
  .ring .lang:nth-child(3) { transform: rotateY(144deg) translateZ(140px); }
  .ring .lang:nth-child(4) { transform: rotateY(216deg) translateZ(140px); }
  .ring .lang:nth-child(5) { transform: rotateY(288deg) translateZ(140px); }

  .board {
    gap: 6px;
  }

  .tile {
    font-size: 0.62rem;
    border-radius: 9px;
  }

  .faq summary {
    padding: 15px 16px;
  }

  .faq p {
    padding: 0 16px 16px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 26px;
  }

  .footer-grid > div:first-child {
    grid-column: 1 / -1;
  }
}

/* =========================================================================
   10. Motion & print
   ========================================================================= */

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

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

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

@media print {
  .sift-sky,
  .site-header,
  .scene {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
