/* ==========================================================================
   Glide 2048 — website styles
   One dark "Wood" look, taken from the app's own palette (lib/app/skins.dart).
   No web fonts, no CDN, no trackers: the page is one request plus images.
   ========================================================================== */

:root {
  /* Wood palette, a little deeper than the app so screenshots sit forward */
  --ink:        #26180f;
  --ink-2:      #1d1109;   /* the demo tray: a well below the page */
  --surface:    #1d1109;
  --surface-2:  #31200f00; /* unused slot kept for clarity */
  --card:       #54392a;
  --card-hi:    #654938;
  --board:      #3e2a1c;
  --cell:       #4f382a;

  --gold:       #e6bb55;
  --gold-deep:  #c9a24d;
  --cream:      #f7eee1;
  --muted:      #d5c0a7;
  --muted-dim:  #c0a88f;   /* passes on the page AND on a card */

  --line:       rgba(255, 255, 255, .13);
  --line-soft:  rgba(255, 255, 255, .05);

  --shadow-sm:  0 2px 8px rgba(0, 0, 0, .35);
  --shadow-md:  0 12px 30px rgba(0, 0, 0, .45);
  --shadow-lg:  0 26px 60px rgba(0, 0, 0, .55);

  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --pad: clamp(20px, 5vw, 40px);
  --maxw: 1140px;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

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

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

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--gold); color: #2a1b0e; }

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

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px; top: 16px;
  z-index: 100;
  background: var(--gold);
  color: #2a1b0e;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-weight: 700;
}

/* ---------------------------------------------------------------- type --- */

h1, h2, h3 {
  line-height: 1.12;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
  font-weight: 800;
}

h1 { font-size: clamp(2.3rem, 6.2vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.8vw, 2.5rem); }
h3 { font-size: 1.12rem; letter-spacing: -.01em; }

p { margin: 0 0 1em; }

.lead {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--muted);
  max-width: 60ch;
}

.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 14px;
}

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

/* -------------------------------------------------------------- header --- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(38, 24, 15, .84);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.site-head.is-stuck {
  border-bottom-color: var(--line);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 68px;
}

.crumb {
  color: var(--muted-dim);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  padding-right: 18px;
  border-right: 1px solid var(--line);
}
.crumb:hover { color: var(--gold); text-decoration: none; }
@media (max-width: 620px) { .crumb span { display: none; } }
@media (max-width: 440px) {
  .crumb { padding-right: 10px; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--cream);
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: 1.06rem;
  text-decoration: none;
  flex: 0 0 auto;
}
.brand:hover { text-decoration: none; }
.brand img {
  width: 32px; height: 32px;
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  gap: 26px;
  margin-left: auto;
  font-size: .95rem;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.nav a:hover { color: var(--cream); border-bottom-color: var(--gold-deep); }

.head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

/* the language pill: same size as the CTA, quieter */
.lang {
  font-weight: 600;
  letter-spacing: 0;
}

@media (max-width: 860px) {
  .nav { display: none; }
  .head-actions { margin-left: auto; }
}
@media (max-width: 440px) {
  .site-head .wrap { gap: 10px; }
  /* the wordmark comes off the bar, but stays in the accessibility tree —
     display:none would leave the link with no name at all */
  .brand span {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .btn-sm { padding: 9px 13px; }
}

/* ------------------------------------------------------------- buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .97rem;
  letter-spacing: -.01em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease,
              background .2s ease, border-color .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #2a1b0e;
  box-shadow: 0 6px 18px rgba(201, 162, 77, .22);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(201, 162, 77, .3); }

.btn-ghost {
  background: rgba(255, 255, 255, .04);
  color: var(--cream);
  border-color: var(--line);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .08); }

.btn-sm { padding: 9px 17px; font-size: .9rem; }

.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }

/* ---------------------------------------------------------------- hero --- */

.hero {
  padding: clamp(48px, 8vw, 92px) 0 clamp(40px, 6vw, 72px);
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.hero h1 { margin-bottom: 18px; }
.hero h1 .num {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 22px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: .88rem;
  color: var(--muted);
}
.badges li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
}
.badges li::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold-deep);
}

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 420px; margin: 0 auto; }
}

/* ------------------------------------------------------- playable demo --- */

.demo {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 18px;
  box-shadow: var(--shadow-lg);
}

.demo-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.demo-title {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-dim);
  margin-right: auto;
}

.stat {
  min-width: 76px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  line-height: 1.2;
}
.stat span {
  display: block;
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-dim);
}
.stat b {
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
  color: var(--cream);
}

.board {
  position: relative;
  aspect-ratio: 1;
  background: var(--board);
  border-radius: var(--r-lg);
  border: 1px solid rgba(0, 0, 0, .35);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, .35);
  touch-action: none;
  overflow: hidden;
  container-type: inline-size;
}

.board .cell,
.board .tile {
  position: absolute;
  width: 21.25%;
  height: 21.25%;
  border-radius: 12px;
}

.board .cell { background: var(--cell); opacity: .55; }

.board .tile {
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  font-size: 7.4cqw;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: left .13s ease-in-out, top .13s ease-in-out;
  will-change: left, top;
}

.board .tile.len3 { font-size: 6cqw; }
.board .tile.len4 { font-size: 4.9cqw; }
.board .tile.len5 { font-size: 4.1cqw; }

.tile-new { animation: pop-in .18s ease-out backwards; }
.tile-merged { animation: pop .18s ease-out; }

@keyframes pop-in {
  from { transform: scale(.3); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}
@keyframes pop {
  0%   { transform: scale(1); }
  55%  { transform: scale(1.16); }
  100% { transform: scale(1); }
}

.demo-hint {
  margin: 13px 2px 0;
  font-size: .84rem;
  color: var(--muted-dim);
  display: flex;
  align-items: center;
  gap: 10px;
}
.demo-hint button {
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 13px;
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
}
.demo-hint button:hover { color: var(--cream); border-color: var(--gold-deep); }

.demo-won {
  color: var(--gold);
  font-weight: 700;
}

/* ------------------------------------------------------------ sections --- */

section { padding: clamp(56px, 8vw, 96px) 0; }

.section-head { max-width: 62ch; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.rule { border: 0; border-top: 1px solid var(--line-soft); margin: 0; }

/* ---------------------------------------------------------------- grid --- */

.grid {
  display: grid;
  gap: 18px;
}
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .g-3, .g-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: rgba(230, 187, 85, .32); transform: translateY(-2px); }
.card p { color: var(--muted); margin-bottom: 0; font-size: .96rem; }
.card h3 { margin-bottom: 8px; }

.card-ico {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(230, 187, 85, .12);
  border: 1px solid rgba(230, 187, 85, .22);
  margin-bottom: 16px;
  font-size: 1.15rem;
}
.card-ico svg { width: 21px; height: 21px; stroke: var(--gold); }

/* ------------------------------------------------------------- how-to  --- */

.steps { counter-reset: step; }

.step { position: relative; }
.step .n {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 11px;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #2a1b0e;
  font-weight: 800;
  font-size: .95rem;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

/* -------------------------------------------------------------- themes --- */

.looks { gap: 16px; }

.look {
  border-radius: var(--r);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.look:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.look-board {
  aspect-ratio: 1;
  padding: 11%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7%;
}
.look-board i {
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-weight: 800;
  font-size: clamp(.7rem, 1.9vw, .95rem);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
}

.look-foot {
  padding: 13px 15px 15px;
  border-top: 1px solid var(--line-soft);
}
.look-foot b { display: block; font-size: .98rem; }
.look-foot span { font-size: .82rem; color: var(--muted-dim); }
.look-foot .free { color: var(--gold); }

/* --------------------------------------------------------- screenshots --- */

#screens { padding-bottom: clamp(40px, 6vw, 70px); }
#screens .section-head { margin-bottom: clamp(20px, 3vw, 30px); }

.shots {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 6px var(--pad) 26px;
  margin: 0 calc(var(--pad) * -1);
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--card-hi) transparent;
}
.shots::-webkit-scrollbar { height: 8px; }
.shots::-webkit-scrollbar-thumb {
  background: var(--card-hi);
  border-radius: 999px;
}

.shots figure {
  margin: 0;
  flex: 0 0 auto;
  width: min(62vw, 236px);
  scroll-snap-align: center;
}
.shots img {
  border-radius: var(--r);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  background: var(--card);
}
.shots figcaption {
  margin-top: 11px;
  font-size: .85rem;
  color: var(--muted-dim);
  text-align: center;
}

/* ------------------------------------------------------------ features --- */

.feats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px 34px;
}
.feats li {
  display: flex;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: .97rem;
  color: var(--muted);
}
.feats li b { color: var(--cream); font-weight: 700; }
.feats li::before {
  content: "";
  flex: 0 0 auto;
  width: 18px; height: 18px;
  margin-top: 4px;
  border-radius: 50%;
  background: rgba(230, 187, 85, .14);
  border: 1px solid rgba(230, 187, 85, .3);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e6bb55' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 11px;
  background-repeat: no-repeat;
  background-position: center;
}
@media (max-width: 700px) { .feats { grid-template-columns: 1fr; } }

/* --------------------------------------------------------- play games  --- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.panel {
  background: linear-gradient(160deg, var(--card-hi), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: clamp(26px, 4vw, 40px);
  box-shadow: var(--shadow-md);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}
.chips li {
  font-size: .87rem;
  color: var(--cream);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
}

/* ----------------------------------------------------------------- faq --- */

.faq { max-width: 800px; }
.faq details {
  border-bottom: 1px solid var(--line-soft);
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 40px 20px 0;
  font-weight: 700;
  font-size: 1.02rem;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 6px; top: 50%;
  width: 11px; height: 11px;
  border-right: 2px solid var(--gold-deep);
  border-bottom: 2px solid var(--gold-deep);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p {
  color: var(--muted);
  margin: 0 0 20px;
  max-width: 68ch;
  font-size: .97rem;
}

/* -------------------------------------------------------------- footer --- */

.cta-band { padding-bottom: clamp(56px, 8vw, 96px); }
.cta-band .panel { text-align: center; }
.cta-band .hero-cta { justify-content: center; margin-bottom: 0; }

.site-foot {
  border-top: 1px solid var(--line-soft);
  padding: 40px 0 56px;
  color: var(--muted-dim);
  font-size: .9rem;
}
.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
}
.site-foot nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}
.site-foot nav a {
  color: var(--muted);
  padding: 6px 0;          /* a 36 px tall tap target on a phone */
  display: inline-block;
}
.site-foot a { color: var(--muted); }
.site-foot .fine {
  flex: 1 0 100%;
  margin-top: 8px;
  font-size: .82rem;
  color: var(--muted-dim);
  max-width: 76ch;
}

/* ------------------------------------------------------- legal / prose --- */

.prose {
  max-width: 760px;
  margin: 0 auto;
}
.prose h2 {
  font-size: 1.3rem;
  margin-top: 44px;
  padding-top: 6px;
  scroll-margin-top: 96px;
}
.prose h2:first-of-type { margin-top: 24px; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--cream); font-weight: 700; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: .5em; }

.note {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold-deep);
  border-radius: var(--r);
  padding: 20px 24px;
  margin: 26px 0 8px;
}
.note p:last-child { margin-bottom: 0; }
.note p { color: var(--cream); }

.toc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 24px;
  margin: 30px 0;
}
.toc b {
  display: block;
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-dim);
  margin-bottom: 12px;
}
.toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 30px;
  font-size: .93rem;
}
.toc li { margin-bottom: 6px; break-inside: avoid; }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--gold); }
@media (max-width: 560px) { .toc ol { columns: 1; } }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: .87rem;
  color: var(--muted-dim);
  padding-bottom: 8px;
}

/* ==========================================================================
   Bangla
   Bangla is a joined script: letter-spacing pulls the conjuncts apart and the
   headline tracking looks broken. Turn all tracking off, and give the text a
   little more room for the matras above and below the line.
   ========================================================================== */

html[lang="bn"] body { line-height: 1.8; }

html[lang="bn"] h1,
html[lang="bn"] h2,
html[lang="bn"] h3,
html[lang="bn"] .btn,
html[lang="bn"] .brand { letter-spacing: normal; }

html[lang="bn"] h1,
html[lang="bn"] h2 { line-height: 1.35; }

html[lang="bn"] .eyebrow,
html[lang="bn"] .demo-title,
html[lang="bn"] .stat span,
html[lang="bn"] .toc b {
  letter-spacing: normal;
  text-transform: none;
  font-size: .82rem;
}

html[lang="bn"] .stat span { font-size: .68rem; }

/* the framed screenshots carry English captions of their own */
html[lang="bn"] .shots figcaption { font-size: .82rem; }

/* --------------------------------------------------------- inline links --- */
/* Gold on cream is only a 1.02:1 difference — colour alone is not enough to
   mark a link inside a paragraph, so underline the ones that sit in prose. */
.prose p a,
.prose li a,
.faq p a,
.card p a,
.split p a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
.prose p a:hover,
.faq p a:hover { text-decoration-thickness: 2px; }
