/* LinHug site styles. Dark is the brand default; [data-theme="light"] is set by the inline head script. */
:root {
  color-scheme: dark;
  --bg: #090d2e;
  --text: #f8f8ff;
  --muted: #bcc5df;
  --faint: rgba(188, 197, 223, 0.78);
  --purple: #7b61ff;
  --accent: #a793ff;
  --teal: #2bc5b0;
  --teal-text: #56e3cf;
  --yellow: #ffd469;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(167, 147, 255, 0.28);
  --panel: rgba(28, 36, 65, 0.82);
  --panel-strong: rgba(31, 40, 70, 0.94);
  --panel-media: rgba(8, 12, 38, 0.86);
  --chip: rgba(255, 255, 255, 0.06);
  --header-bg: rgba(9, 13, 46, 0.72);
  --footer-bg: rgba(7, 10, 34, 0.82);
  --shadow-card: 0 24px 70px rgba(3, 6, 28, 0.45);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.22);
  --sky-1: rgba(255, 255, 255, 0.18);
  --sky-2: rgba(67, 226, 204, 0.24);
  --sky-3: rgba(174, 151, 255, 0.3);
  --sky-glow: 0 0 22px rgba(123, 97, 255, 0.25);
  --gradient-text: linear-gradient(90deg, #b7a6ff, #7b61ff 45%, #47d9c4);
  --backdrop-shade: linear-gradient(180deg, rgba(5, 8, 28, 0.04) 0%, rgba(8, 12, 42, 0.22) 48%, rgba(8, 12, 35, 0.74) 100%);
  --backdrop-glow:
    radial-gradient(circle at 16% 18%, rgba(123, 97, 255, 0.2), transparent 30rem),
    radial-gradient(circle at 82% 34%, rgba(43, 197, 176, 0.12), transparent 28rem);
  --backdrop-image: url("/assets/media/bg-night.webp");
  --reel-bg: #14162e;
  --video-bg: #070a22;
}

:root[data-theme="light"] {
  /* Light = the forest ruins of the LinHug intro: warm stone, moss and sunlight. Accents are forest green with a touch of gold. */
  color-scheme: light;
  --bg: #efe9d6;
  --text: #1b261c;
  --muted: #414c3c;
  --faint: #5b6552;
  --purple: #2f7d3b;
  --accent: #2a6b2e;
  --teal: #12917f;
  --teal-text: #0a6c60;
  --yellow: #e0a526;
  --border: rgba(62, 56, 30, 0.14);
  --border-strong: rgba(47, 125, 59, 0.32);
  --panel: rgba(252, 249, 239, 0.88);
  --panel-strong: #fcf9ef;
  --panel-media: #fcf9ef;
  --chip: rgba(74, 92, 42, 0.09);
  --header-bg: rgba(250, 246, 233, 0.82);
  --footer-bg: rgba(247, 243, 229, 0.9);
  --shadow-card: 0 20px 50px rgba(28, 44, 20, 0.18), 0 2px 6px rgba(28, 44, 20, 0.06);
  --shadow-soft: 0 10px 26px rgba(28, 44, 20, 0.16);
  --sky-1: #3c4f78;
  --sky-2: #3c4f78;
  --sky-3: #3c4f78;
  --sky-glow: 0 1px 0 rgba(255, 255, 255, 0.6);
  --gradient-text: linear-gradient(90deg, #1d6b37, #3a9a3e 52%, #b8861c);
  --backdrop-shade: linear-gradient(180deg, #e9e6cf 0%, #dfe3c6 100%);
  --backdrop-glow: none;
  --backdrop-image: none;
  --reel-bg: #2c3a22;
  --video-bg: #1f2a18;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 92px; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background-color 240ms ease, color 240ms ease;
}

a { color: inherit; }
img, video { max-width: 100%; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--purple);
  color: #fff;
  font-weight: 800;
}
.skip-link:focus { top: 12px; }

/* Backdrop */
.game-backdrop {
  position: fixed;
  inset: 0;
  z-index: -3;
  background: var(--backdrop-shade), var(--bg);
}
.game-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--backdrop-image) center top / cover no-repeat;
  filter: saturate(1.12) brightness(1.06);
}
/* Light theme: places where the dark palette is written out directly get forest tones. */
:root[data-theme="light"] .nav-cta { box-shadow: 0 8px 22px rgba(36, 96, 44, 0.32); }
:root[data-theme="light"] .hero-reel { box-shadow: 0 40px 100px rgba(28, 44, 20, 0.35), 0 0 70px rgba(58, 154, 62, 0.22); }
:root[data-theme="light"] .feature-icon { background: rgba(47, 125, 59, 0.14); }
:root[data-theme="light"] .feature-card:nth-child(3n) .feature-icon { background: rgba(224, 165, 38, 0.2); }
:root[data-theme="light"] .cta { background: linear-gradient(135deg, rgba(58, 154, 62, 0.18), rgba(224, 165, 38, 0.12)), var(--panel-strong); }
:root[data-theme="light"] .brand-name span { color: #6a4ff0; }
:root[data-theme="light"] :is(.hero-meta, .text-link) { text-shadow: 0 0 14px rgba(246, 241, 224, 0.95), 0 0 3px rgba(246, 241, 224, 0.9); }

/* Light theme: three forest scenes from the intro cross-fade as the page scrolls (site.js marks the active one). */
.forest-scenes { display: none; }
:root[data-theme="light"] .forest-scenes { display: block; position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.scene {
  position: absolute;
  inset: -6% -3%;
  background: center / cover no-repeat;
  opacity: 0;
  transform: scale(var(--zoom, 1.04));
  transform-origin: var(--focus, 50% 50%);
  transition: opacity 1400ms ease, transform 900ms cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
.scene.is-active { opacity: 1; }
/* --focus is the landmark each scene zooms toward: the library towers, the castle, the LINHUG stones.
   Images load only once site.js marks a scene .is-loaded (the active one and the next). Portrait phones get
   pre-cropped slices (-m) that keep the full resolution of the part they actually show. */
.scene.is-loaded { background-image: var(--img); }
.scene-1 { --img: url("/assets/media/forest-scene-1.webp"); background-position: 58% 40%; --focus: 58% 30%; }
.scene-2 { --img: url("/assets/media/forest-scene-2.webp"); background-position: 32% 45%; --focus: 30% 38%; }
.scene-3 { --img: url("/assets/media/forest-scene-3.webp"); background-position: 50% 40%; --focus: 50% 45%; }
@media (max-width: 700px) and (orientation: portrait) {
  .scene { background-position: 50% 40%; }
  .scene-1 { --img: url("/assets/media/forest-scene-1-m.webp"); --focus: 50% 30%; }
  .scene-2 { --img: url("/assets/media/forest-scene-2-m.webp"); --focus: 50% 38%; }
  .scene-3 { --img: url("/assets/media/forest-scene-3-m.webp"); --focus: 50% 45%; }
}
/* Data saver or low-memory devices: keep the scenes, drop the continuous animations. */
:root.lite .game-backdrop::before, :root.lite .sky-word { animation: none !important; }
:root.lite .sky-word { display: none; }
:root.lite .scene { transition: opacity 600ms ease; }
:root[data-theme="light"] .game-backdrop::before {
  /* Sun shafts through the canopy. */
  z-index: 1;
  inset: -20% -10%;
  background: repeating-linear-gradient(112deg, transparent 0 70px, rgba(255, 246, 200, 0.14) 70px 120px, transparent 120px 230px);
  filter: blur(6px);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.5) 45%, transparent 80%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.5) 45%, transparent 80%);
  animation: sunshafts 18s ease-in-out infinite alternate;
}
@keyframes sunshafts {
  from { transform: translate3d(-3%, 0, 0); opacity: 0.65; }
  to { transform: translate3d(3%, 0, 0); opacity: 1; }
}
:root[data-theme="light"] .game-backdrop::after {
  /* A light veil behind the hero copy only, so the scenes stay crisp. */
  z-index: 2;
  background:
    radial-gradient(ellipse 50% 60% at 22% 48%, rgba(246, 241, 224, 0.62), transparent 74%),
    linear-gradient(180deg, rgba(244, 239, 221, 0.06), rgba(244, 239, 221, 0.18));
}
.game-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--backdrop-glow);
}
@media (max-width: 700px) {
  :root:not([data-theme="light"]) { --backdrop-image: url("/assets/media/bg-night-small.webp"); }
}

.word-sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}
.sky-word {
  position: absolute;
  left: var(--left);
  bottom: -4rem;
  color: var(--sky-1);
  font-size: var(--size);
  font-weight: 900;
  letter-spacing: 0.08em;
  animation: rise var(--duration) linear var(--delay) infinite;
  text-shadow: var(--sky-glow);
  will-change: transform, opacity;
}
.sky-word:nth-child(3n) { color: var(--sky-2); }
.sky-word:nth-child(4n) { color: var(--sky-3); }
:root[data-theme="light"] :is(.section-heading, .hero > div:first-child) :is(h1, h2, p) { text-shadow: 0 0 18px rgba(246, 241, 224, 0.95), 0 0 4px rgba(246, 241, 224, 0.8); }
:root[data-theme="light"] .gradient { text-shadow: none; }
:root[data-theme="light"] .sky-word {
  /* The floating words become the carved puzzle stones from the intro. */
  padding: 0.22em 0.5em 0.28em;
  border: 1px solid rgba(96, 84, 52, 0.28);
  border-radius: 0.32em;
  background: linear-gradient(180deg, #f3eedd, #d8cfb4);
  box-shadow: 0 8px 18px rgba(32, 44, 20, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.75), inset 0 -3px 0 rgba(120, 104, 66, 0.28);
  font-size: calc(var(--size) * 0.72);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  animation-name: rise-stone;
}
@keyframes rise-stone {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(-7deg); }
  12% { opacity: 0.62; }
  84% { opacity: 0.5; }
  100% { opacity: 0; transform: translate3d(var(--drift), -115vh, 0) rotate(9deg); }
}
@keyframes rise {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(-7deg); }
  12% { opacity: 1; }
  84% { opacity: 0.8; }
  100% { opacity: 0; transform: translate3d(var(--drift), -115vh, 0) rotate(9deg); }
}

.shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.site-nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.04em;
  text-decoration: none;
}
.brand img {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: var(--shadow-soft);
}
.brand-name span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 750; }
.nav-links a:hover, .nav-links a:focus-visible, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-tools { display: flex; align-items: center; gap: 8px; }
.nav-cta {
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--purple);
  color: #fff !important;
  box-shadow: 0 8px 22px rgba(106, 79, 240, 0.35);
}
.nav-cta:hover, .nav-cta:focus-visible { filter: brightness(1.1); }

.icon-button, .lang-switch {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--chip);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}
.icon-button { width: 38px; padding: 0; }
.lang-switch { padding: 0 12px; }
.lang-short { display: none; }
.icon-button:hover, .icon-button:focus-visible, .lang-switch:hover, .lang-switch:focus-visible {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.icon-button svg, .lang-switch svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu[open] > summary { border-color: var(--border-strong); }
.lang-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 190px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-strong);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
}
.lang-list a {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}
.lang-list a:hover, .lang-list a:focus-visible { background: var(--chip); color: var(--text); }
.lang-list a[aria-current="true"] { color: var(--text); background: var(--chip); }
.lang-list a[aria-current="true"]::after { content: "✓"; float: right; margin-left: 12px; color: var(--teal-text); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Hero */
.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(40px, 7vw, 92px);
  padding: 70px 0 92px;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 20px;
  padding: 8px 13px;
  border: 1px solid rgba(43, 197, 176, 0.3);
  border-radius: 999px;
  background: rgba(43, 197, 176, 0.1);
  color: var(--teal-text);
  font-size: 13px;
  font-weight: 850;
}
.kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 18px var(--teal);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.45; transform: scale(0.75); } }

h1 {
  max-width: 690px;
  margin: 0;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 0.96;
  letter-spacing: -0.065em;
}
h1 .gradient, h2 .gradient {
  color: transparent;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
}
h1 .gradient { display: block; }
.hero-copy {
  max-width: 600px;
  margin: 26px 0 30px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.7;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.hero-meta li::before { content: "✓ "; color: var(--teal); font-weight: 900; }

.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.store-button {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, filter 180ms ease;
}
.store-button:hover, .store-button:focus-visible { transform: translateY(-3px); filter: brightness(1.12); }
.store-button img { display: block; width: 168px; height: 56px; }

.hero-visual { position: relative; min-height: 650px; display: grid; place-items: center; }
.orbit {
  position: absolute;
  width: min(490px, 88vw);
  aspect-ratio: 1;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  animation: spin 28s linear infinite;
}
.orbit::before, .orbit::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 22px var(--yellow);
}
.orbit::before { top: 13%; left: 12%; }
.orbit::after { right: 3%; bottom: 34%; background: var(--teal); box-shadow: 0 0 22px var(--teal); }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-reel {
  position: relative;
  width: min(360px, 86vw);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 42px;
  background: var(--reel-bg);
  box-shadow: 0 40px 100px rgba(4, 7, 30, 0.45), 0 0 70px rgba(123, 97, 255, 0.2);
  transform: rotate(2deg);
  animation: card-float 5s ease-in-out infinite;
}
.hero-reel video { background: center / cover no-repeat url("/assets/media/linhug-logo-reveal.webp"); }
:root[data-theme="light"] .hero-reel video { background-image: url("/assets/media/linhug-walk.webp"); }
.hero-reel video { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; }
.hero-reel::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  height: 150px;
  background: linear-gradient(180deg, transparent, rgba(20, 22, 46, 0.96) 78%, #14162e);
  pointer-events: none;
}
.hero-reel-badge {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(9, 13, 46, 0.76);
  color: #f8f8ff;
  font-size: 12px;
  font-weight: 850;
  backdrop-filter: blur(14px);
}
@keyframes card-float { 50% { transform: rotate(-1deg) translateY(-12px); } }

/* Sections */
section { padding: 100px 0; }
.section-heading { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.section-heading p { margin: 12px 0 0; color: var(--muted); font-size: 18px; line-height: 1.7; }
h2 { margin: 0; font-size: clamp(34px, 5vw, 56px); line-height: 1.04; letter-spacing: -0.045em; }
.eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card { padding: 28px; transition: transform 180ms ease, border-color 180ms ease; }
.feature-card:hover { transform: translateY(-6px); border-color: var(--border-strong); }
.feature-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(123, 97, 255, 0.15);
  font-size: 25px;
}
.feature-card:nth-child(3n + 2) .feature-icon { background: rgba(43, 197, 176, 0.14); }
.feature-card:nth-child(3n) .feature-icon { background: rgba(255, 212, 105, 0.2); }
.feature-card h3 { margin: 22px 0 10px; font-size: 23px; letter-spacing: -0.02em; }
.feature-card p { margin: 0; color: var(--muted); line-height: 1.7; }
.mode-tag {
  display: inline-block;
  margin-top: 18px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; padding: 0; margin: 0; list-style: none; }
.steps li { position: relative; padding: 26px 24px 24px; counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--purple);
  color: #fff;
  font-weight: 900;
}
.steps h3 { margin: 0 0 8px; font-size: 19px; }
.steps p { margin: 0; color: var(--muted); line-height: 1.65; }

.chain-demo {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0 auto 44px;
  padding: 0;
  list-style: none;
}
.chain-demo li {
  padding: 10px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--panel-strong);
  box-shadow: var(--shadow-soft);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0.02em;
}
.chain-demo li b { color: var(--teal-text); }
.chain-demo .arrow { padding: 0; border: 0; background: none; box-shadow: none; color: var(--accent); }

/* Screenshots */
.screen-showcase { width: min(1440px, 100%); margin: 0 auto; }
.screen-carousel { position: relative; isolation: isolate; }
.screen-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 22vw);
  gap: 30px;
  overflow-x: auto;
  padding: 52px max(76px, calc((100vw - 1160px) / 2)) 70px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.screen-track::-webkit-scrollbar { display: none; }
.screen-track.is-dragging { cursor: grabbing; scroll-behavior: auto; scroll-snap-type: none; }
.screen-card {
  position: relative;
  margin: 0;
  overflow: hidden;
  scroll-snap-align: center;
  border: 1px solid var(--border-strong);
  border-radius: 30px;
  background: var(--panel-media);
  box-shadow: var(--shadow-card);
  transform: translateY(var(--lift, 0)) rotate(var(--tilt, 0deg));
  animation: screen-float 4.8s ease-in-out var(--delay, 0s) infinite alternate;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.screen-card:hover { animation-play-state: paused; border-color: rgba(71, 217, 196, 0.62); }
.screen-card:nth-child(1) { --tilt: -4deg; --lift: 12px; --delay: -1.2s; }
.screen-card:nth-child(2) { --tilt: 3deg; --lift: -16px; --delay: -3.7s; }
.screen-card:nth-child(3) { --tilt: -2deg; --lift: 20px; --delay: -2.1s; }
.screen-card:nth-child(4) { --tilt: 4deg; --lift: -10px; --delay: -4.3s; }
.screen-card:nth-child(5) { --tilt: -3deg; --lift: 16px; --delay: -2.8s; }
.screen-card:nth-child(6) { --tilt: 2deg; --lift: -14px; --delay: -0.6s; }
.screen-card:nth-child(7) { --tilt: -4deg; --lift: 10px; --delay: -3.2s; }
@keyframes screen-float { to { transform: translateY(calc(var(--lift, 0px) - 14px)) rotate(var(--tilt, 0deg)); } }
.screen-card img { display: block; width: 100%; height: auto; }
.screen-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
  font-size: 31px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
  transform: translateY(-50%);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}
.screen-arrow:hover, .screen-arrow:focus-visible { background: var(--purple); color: #fff; transform: translateY(-50%) scale(1.08); }
.screen-arrow-left { left: clamp(10px, 3vw, 46px); }
.screen-arrow-right { right: clamp(10px, 3vw, 46px); }
.swipe-note { display: none; margin: -18px 0 0; color: var(--muted); text-align: center; font-size: 13px; }

/* Videos */
.video-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; max-width: 920px; margin: 0 auto; }
.video-card { overflow: hidden; border-radius: 28px; }
.video-card video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; background: var(--video-bg); }
.video-copy { padding: 22px 24px 25px; }
.video-copy h3 { margin: 0 0 7px; font-size: 21px; }
.video-copy p { margin: 0; color: var(--muted); line-height: 1.6; }

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { padding: 0; border-radius: 18px; }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 26px; font-weight: 500; transition: transform 180ms ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0; padding: 0 24px 22px; color: var(--muted); line-height: 1.7; }
.faq a { color: var(--accent); }

/* Word tools teaser */
.word-teaser { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 32px; align-items: center; padding: clamp(28px, 5vw, 52px); }
.word-teaser p { color: var(--muted); font-size: 17px; line-height: 1.7; }
.letter-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.letter-grid a {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-strong);
  color: var(--text);
  font-weight: 900;
  font-size: 17px;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}
.letter-grid a:hover, .letter-grid a:focus-visible { transform: translateY(-2px); border-color: var(--purple); background: var(--purple); color: #fff; }
.letter-grid a[aria-current="page"] { background: var(--purple); border-color: var(--purple); color: #fff; }
.letter-grid.wide a { font-size: 14px; }
.text-link { color: var(--accent); font-weight: 800; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* CTA */
.cta {
  margin-bottom: 90px;
  padding: clamp(32px, 7vw, 72px);
  border: 1px solid var(--border-strong);
  border-radius: 34px;
  background: linear-gradient(135deg, rgba(123, 97, 255, 0.2), rgba(43, 197, 176, 0.11)), var(--panel-strong);
  text-align: center;
  box-shadow: var(--shadow-card);
}
.cta p { max-width: 600px; margin: 16px auto 28px; color: var(--muted); font-size: 18px; }
.cta .store-buttons { justify-content: center; }
.cta-icon { display: block; width: 94px; height: 94px; margin: 0 auto 24px; border: 1px solid var(--border); border-radius: 25px; box-shadow: var(--shadow-soft); }

/* Content pages (how to play, word lists, legal) */
.page { padding: 56px 0 90px; }
.breadcrumbs { margin: 0 0 22px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 14px; }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; opacity: 0.6; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text); }
.page-head { max-width: 820px; margin-bottom: 36px; }
.page-head h1 { max-width: none; font-size: clamp(40px, 6vw, 68px); line-height: 1.02; letter-spacing: -0.05em; }
.lead { margin: 18px 0 0; color: var(--muted); font-size: 19px; line-height: 1.7; }
.prose { padding: clamp(24px, 5vw, 48px); line-height: 1.7; }
.prose h2 { margin: 38px 0 12px; font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -0.03em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 26px 0 8px; font-size: 20px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; color: var(--muted); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 8px 0; }
.prose strong { color: var(--text); }
.prose a { color: var(--accent); text-underline-offset: 4px; }
.prose .updated { margin: 12px 0 30px; font-size: 15px; }
.prose .contact, .prose .notice, .callout {
  margin: 20px 0;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--chip);
}
.prose .notice { border-color: var(--border-strong); }
.prose .contact p:last-child, .prose .notice p:last-child, .callout p:last-child { margin-bottom: 0; }
.legal { max-width: 880px; margin: 0 auto; }
.legal h1 { font-size: clamp(36px, 7vw, 64px); letter-spacing: -0.04em; }
.score-table { width: 100%; border-collapse: collapse; margin: 8px 0 20px; font-size: 15px; }
.score-table th, .score-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: center; }
.score-table th { color: var(--text); }
.score-table td { color: var(--muted); }

.stat-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 0; padding: 0; list-style: none; }
.stat-row li { padding: 12px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); color: var(--muted); font-size: 14px; }
.stat-row strong { display: block; color: var(--text); font-size: 22px; }

.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; padding: 0; list-style: none; }
.toc a { display: inline-block; padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--chip); color: var(--text); font-size: 14px; font-weight: 750; text-decoration: none; }
.toc a:hover { border-color: var(--purple); }

.word-group { padding: 26px clamp(20px, 4vw, 34px); margin-bottom: 16px; }
.word-group h2 { margin: 0 0 16px; font-size: 22px; letter-spacing: -0.02em; }
.word-group h2 small { color: var(--muted); font-size: 14px; font-weight: 700; letter-spacing: 0; }
.words { columns: 5 150px; column-gap: 24px; margin: 0; padding: 0; list-style: none; }
.words li { padding: 3px 0; break-inside: avoid; color: var(--text); font-size: 15.5px; }
.word-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.word-aside { position: sticky; top: 92px; display: grid; gap: 16px; }
.word-aside .card { padding: 22px; }
.word-aside h2 { margin: 0 0 12px; font-size: 18px; letter-spacing: -0.01em; }
/* Negative tracking breaks Devanagari conjuncts and the headline bar, so Hindi headings keep normal spacing. */
:lang(hi) :is(h1, h2, h3) { letter-spacing: normal; line-height: 1.25; }
.word-aside p { margin: 0 0 14px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.word-aside .letter-grid a { min-width: 36px; height: 36px; font-size: 15px; border-radius: 10px; }
.mini-cta .store-buttons { gap: 8px; }
.mini-cta .store-button img { width: 120px; height: 40px; }
.source-note { margin-top: 28px; color: var(--faint); font-size: 13px; line-height: 1.6; }
.source-note a { color: inherit; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--footer-bg); backdrop-filter: blur(16px); }
.footer-inner { padding: 28px 0; color: var(--muted); font-size: 14px; }
.footer-main { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-actions { display: flex; align-items: center; gap: 26px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover, .footer-links a:focus-visible { color: var(--text); }
.social-links { display: flex; align-items: center; gap: 10px; }
.social-links a {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--chip);
  color: var(--muted);
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.social-links a:hover, .social-links a:focus-visible { border-color: var(--purple); background: var(--purple); color: #fff; transform: translateY(-2px); }
.social-links svg { width: 18px; height: 18px; fill: currentColor; }
.legal-notice { max-width: 980px; margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--border); color: var(--faint); font-size: 12px; line-height: 1.7; }

/* Responsive */
@media (max-width: 1000px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .word-layout { grid-template-columns: minmax(0, 1fr); }
  .word-aside { position: static; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 64px; }
  .hero-copy { margin-left: auto; margin-right: auto; }
  .hero-meta { justify-content: center; }
  .store-buttons { justify-content: center; }
  .feature-grid { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: 1fr; max-width: 520px; }
  .word-teaser { grid-template-columns: 1fr; }
  .nav-links a:not(.nav-cta) { display: none; }
  /* The hero copy is centred here, so the light-theme veil follows it. */
  :root[data-theme="light"] .game-backdrop::after {
    background:
      radial-gradient(ellipse 110% 58% at 50% 36%, rgba(246, 241, 224, 0.86), rgba(246, 241, 224, 0.5) 62%, transparent 100%),
      linear-gradient(180deg, rgba(244, 239, 221, 0.06), rgba(244, 239, 221, 0.18));
  }
}
@media (max-width: 600px) {
  .score-table { font-size: 14px; }
  .score-table th, .score-table td { padding: 8px 3px; }
  .score-table tr > th:first-child { padding-right: 8px; font-size: 12px; text-align: left; }
  .shell { width: calc(100% - 32px); }
  .site-nav { gap: 10px; }
  .nav-links { margin-left: auto; }
  .lead { font-size: 17px; }
  .brand { font-size: 21px; }
  .brand img { width: 36px; height: 36px; }
  .nav-cta { padding: 8px 12px; font-size: 13px; }
  .lang-switch { padding: 0 10px; }
  .lang-switch .lang-label { display: none; }
  .lang-short { display: inline; }
  .hero { min-height: auto; padding: 44px 0 64px; }
  .hero-visual { min-height: 560px; }
  .hero-reel { width: min(310px, 82vw); border-radius: 34px; }
  section { padding: 72px 0; }
  .steps { grid-template-columns: 1fr; }
  .screen-track { grid-auto-columns: minmax(250px, 78vw); gap: 24px; padding: 46px 48px 64px; }
  .screen-arrow { width: 46px; height: 46px; font-size: 25px; }
  .screen-arrow-left { left: 5px; }
  .screen-arrow-right { right: 5px; }
  .swipe-note { display: block; }
  .store-button img { width: 156px; height: 52px; }
  .footer-main, .footer-actions { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
  .footer-actions { gap: 16px; }
  .legal-notice { text-align: center; }
  .sky-word:nth-child(even) { display: none; }
  .words { columns: 2; }
  .words li { overflow-wrap: anywhere; }
  .footer-links a { display: inline-block; padding: 8px 4px; }
  .faq summary { padding: 18px; font-size: 16px; }
  .faq details p { padding: 0 18px 18px; }
}
@media (max-width: 380px) {
  .card.prose { padding-left: 18px; padding-right: 18px; }
  .score-table th, .score-table td { padding-left: 2px; padding-right: 2px; }
  .brand-name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sky-word, .orbit, .hero-reel, .kicker::before, .screen-card, .game-backdrop::before { animation: none !important; }
  .scene { transition: opacity 600ms ease; transform: none !important; }
}

/* Themed cursors for mouse users: a rocket at night, a sword in the forest. The hotspot is the nose / tip.
   Links and buttons get the "active" variant (bigger flame, glowing blade); text fields and the carousel keep
   their usual cursors. Each rule falls back to the system cursor if the image cannot load. */
@media (hover: hover) and (pointer: fine) {
  :root { cursor: url("/assets/cursors/rocket.svg") 4 4, auto; }
  :root :is(a, button, summary, label, select, [role="button"], .icon-button, .lang-switch, .faq summary) { cursor: url("/assets/cursors/rocket-hover.svg") 4 4, pointer; }
  :root[data-theme="light"] { cursor: url("/assets/cursors/sword.svg") 3 3, auto; }
  :root[data-theme="light"] :is(a, button, summary, label, select, [role="button"], .icon-button, .lang-switch, .faq summary) { cursor: url("/assets/cursors/sword-hover.svg") 3 3, pointer; }
  :root :is(input, textarea, [contenteditable="true"]) { cursor: text; }
}

/* Theme switch: the new theme grows as a circle from the toggle (see site.js); the old one stays still underneath. */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }
:root.theme-switching, :root.theme-switching body { transition: none; }
.theme-toggle svg { transition: transform 500ms cubic-bezier(0.22, 0.7, 0.2, 1); }
:root[data-theme="light"] .theme-toggle svg { transform: rotate(180deg); }

/* Language suggestion (English pages, browser prefers another supported language) */
.lang-suggest {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100% - 32px);
  padding: 6px;
  transform: translateX(-50%);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-strong);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
}
.lang-suggest a { padding: 8px 14px; border-radius: 999px; color: var(--text); font-size: 14px; font-weight: 750; text-decoration: none; }
.lang-suggest a:hover, .lang-suggest a:focus-visible { background: var(--chip); }
.lang-suggest button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.lang-suggest button:hover, .lang-suggest button:focus-visible { background: var(--chip); color: var(--text); }
