/* Boxed · boxed.zaplatform.com
   The app's own language: warm paper, dark brown ink, flat muted-pastel boxes,
   Rubik for words (Latin + Arabic), Azeret Mono for labels and numbers. */
:root {
  --paper: #F5F0E8;
  --card: #FFFFFF;
  --ink: #3A2419;
  --mute: #6B5546;
  --line: #E6DCCF;
  --chip: #3A2419;
  --on-chip: #F5F0E8;
  --coral: #EE8A82;
  --apricot: #F3B77E;
  --peri: #88A6DD;
  --sage: #A4CD98;
  --lilac: #D3B3E6;
  --lav: #B5AAE7;
  --on-pastel: #3A2419;
  --font: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Azeret Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --track: .02em;
  --r: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1C1612;
    --card: #2A211B;
    --ink: #F2E8DC;
    --mute: #C2B2A2;
    --line: #3D322A;
    --chip: #F2E8DC;
    --on-chip: #1C1612;
    --coral: #D47A72;
    --apricot: #D9A26E;
    --peri: #7A95C8;
    --sage: #90B585;
    --lilac: #B99DCB;
    --lav: #9F95CC;
    --on-pastel: #22150E;
  }
}
:lang(ar) { --track: 0; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.mono { font-family: var(--mono); letter-spacing: var(--track); }
:lang(ar) .mono { font-family: var(--font); letter-spacing: 0; }
.num { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; letter-spacing: 0; }
.skip { position: absolute; top: 8px; inset-inline-start: 16px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 10;
  clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.skip:focus { clip-path: none; width: auto; height: auto; overflow: visible; }

/* ---- nav ---- */
.nav { display: flex; align-items: center; gap: 16px; padding-block: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.nav ul { list-style: none; display: flex; gap: 6px; margin: 0 0 0 auto; padding: 0; }
[dir="rtl"] .nav ul { margin: 0 auto 0 0; }
.nav ul a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 10px; text-decoration: none; color: var(--mute); font-weight: 500; }
.nav ul a:hover { color: var(--ink); }
.nav .lang { display: inline-flex; align-items: center; min-height: 40px; padding-inline: 14px; border: 1.5px solid var(--line); border-radius: 10px; text-decoration: none; font-weight: 500; }
.nav .lang:hover { border-color: var(--ink); }
@media (max-width: 640px) { .nav ul { display: none; } .nav .lang { margin-inline-start: auto; } }

/* ---- hero ---- */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(24px, 5vw, 64px); align-items: center; padding-block: clamp(24px, 6vw, 72px) clamp(40px, 7vw, 96px); }
.hero .ic { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 1px 0 var(--line); }
.label { font-family: var(--mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); margin: 0 0 10px; }
:lang(ar) .label, .label:lang(ar) { font-family: var(--font); text-transform: none; letter-spacing: 0; font-size: .95rem; font-weight: 500; }
h1 { font-size: clamp(3rem, 8vw, 5rem); line-height: 1; letter-spacing: -.02em; margin: 22px 0 14px; font-weight: 700; }
:lang(ar) h1 { letter-spacing: 0; }
.pitch { font-size: clamp(1.3rem, 2.6vw, 1.7rem); line-height: 1.35; font-weight: 500; margin: 0 0 14px; max-width: 26ch; }
.chip { background: var(--chip); color: var(--on-chip); border-radius: 8px; padding: 0 .3em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.lede { color: var(--mute); max-width: 44ch; margin: 0 0 26px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.store {
  display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 20px 8px 16px;
  background: var(--chip); color: var(--on-chip); border-radius: 14px; text-decoration: none;
}
[dir="rtl"] .store { padding: 8px 16px 8px 20px; }
.store svg { width: 26px; height: 26px; fill: currentColor; flex: none; }
.store small { display: block; font-size: .75rem; line-height: 1.1; opacity: .85; }
.store b { display: block; font-size: 1.15rem; line-height: 1.2; font-weight: 600; }
.store.soon { background: transparent; color: var(--ink); border: 1.5px dashed var(--ink); cursor: default; }
.btn-quiet { display: inline-flex; align-items: center; min-height: 48px; padding-inline: 16px; font-weight: 500; text-decoration: none; border-radius: 12px; }
.btn-quiet:hover { background: var(--card); }
.hero-shots { position: relative; display: flex; justify-content: center; min-height: 420px; }
.phone { width: min(250px, 58vw); border-radius: 34px; overflow: hidden; border: 6px solid var(--ink); background: var(--paper); box-shadow: 0 18px 40px -22px rgba(58, 36, 25, .45); aspect-ratio: 1206 / 2622; }
.phone img { width: 100%; height: 100%; object-fit: cover; }
.hero-shots .phone + .phone { margin-inline-start: -70px; margin-top: 64px; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-shots { min-height: 0; }
  .phone { width: min(200px, 44vw); border-width: 5px; border-radius: 28px; }
  .hero-shots .phone + .phone { margin-inline-start: -40px; margin-top: 40px; }
}

/* ---- sections ---- */
.sec { padding-block: clamp(48px, 8vw, 96px); border-top: 1.5px solid var(--line); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 14px; font-weight: 700; }
:lang(ar) h2 { letter-spacing: 0; line-height: 1.35; }
h3 { font-size: 1.2rem; margin: 0 0 6px; font-weight: 600; }
.intro { color: var(--mute); max-width: 56ch; margin: 0 0 36px; }

/* how it plays: a solved 5x5, drawn with CSS grid. The board never mirrors in RTL, like the app. */
.how { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: clamp(28px, 6vw, 72px); align-items: center; }
.board {
  direction: ltr; display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(5, 1fr);
  gap: 6px; aspect-ratio: 1; width: 100%; max-width: 360px;
}
.board .b { border-radius: 12px; position: relative; color: var(--on-pastel); }
.board .b span { position: absolute; top: 8px; left: 10px; font-family: var(--mono); font-weight: 600; font-size: clamp(.9rem, 2.4vw, 1.05rem); }
.b.c { background: var(--coral); } .b.a { background: var(--apricot); } .b.p { background: var(--peri); }
.b.s { background: var(--sage); } .b.l { background: var(--lilac); } .b.v { background: var(--lav); }
.board-cap { font-size: .9rem; color: var(--mute); margin-top: 12px; }
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; counter-reset: r; }
.rules li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.rules li::before {
  counter-increment: r; content: counter(r); display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 10px; background: var(--chip); color: var(--on-chip); font-family: var(--mono); font-weight: 600;
}
.rules p { margin: 0; color: var(--mute); }
@media (max-width: 760px) { .how { grid-template-columns: 1fr; } .board { max-width: 320px; } }

/* modes */
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.mode { background: var(--card); border-radius: var(--r); padding: 22px; }
.tile { width: 44px; height: 44px; border-radius: 11px; border: 2px solid var(--ink); display: grid; overflow: hidden; margin-bottom: 16px; gap: 2px; background: var(--ink); }
.tile i { display: block; }
.t-daily { grid-template-columns: 1fr 1fr; } .t-daily i:nth-child(1) { background: var(--coral); grid-row: span 2; } .t-daily i:nth-child(2) { background: var(--peri); } .t-daily i:nth-child(3) { background: var(--sage); }
.t-endless { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; } .t-endless i:nth-child(1) { background: var(--sage); } .t-endless i:nth-child(2) { background: var(--apricot); } .t-endless i:nth-child(3) { background: var(--lav); } .t-endless i:nth-child(4) { background: var(--coral); }
.t-journey { grid-template-rows: 1fr 1fr 1fr; } .t-journey i:nth-child(1) { background: var(--lilac); } .t-journey i:nth-child(2) { background: var(--peri); } .t-journey i:nth-child(3) { background: var(--apricot); }
.t-trial { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1.4fr; } .t-trial i:nth-child(1) { background: var(--coral); grid-column: span 2; } .t-trial i:nth-child(2) { background: var(--sage); } .t-trial i:nth-child(3) { background: var(--lav); }
.mode p { margin: 0; color: var(--mute); font-size: .97rem; }
.mode .meta { margin-top: 12px; font-size: .82rem; color: var(--ink); }
.journey-row { display: grid; grid-template-columns: 1fr auto; gap: clamp(24px, 5vw, 56px); align-items: center; margin-top: 40px; }
.journey-row .phone { width: min(230px, 56vw); }
@media (max-width: 760px) { .journey-row { grid-template-columns: 1fr; justify-items: center; } }
.journey-row p { color: var(--mute); max-width: 50ch; }

/* money */
.money { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.money .box { background: var(--card); border-radius: var(--r); padding: 24px; }
.money ul { margin: 10px 0 0; padding-inline-start: 1.2em; color: var(--mute); }
.money li + li { margin-top: 6px; }
@media (max-width: 760px) { .money { grid-template-columns: 1fr; } }

/* faq */
.faq { display: grid; gap: 10px; max-width: 760px; }
.faq details { background: var(--card); border-radius: 12px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 20px; min-height: 44px; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); font-weight: 500; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .faq summary::after { transition: none; } }
.faq .a { padding: 0 20px 18px; color: var(--mute); }
.faq .a p { margin: 0; }
.faq .a p + p { margin-top: 8px; }
.contact { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.contact a.mail { font-family: var(--mono); font-weight: 600; font-size: 1.05rem; letter-spacing: 0; }

/* footer */
.foot { border-top: 1.5px solid var(--line); padding-block: 28px 40px; color: var(--mute); font-size: .92rem; display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.foot a { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.foot a:hover { color: var(--ink); text-decoration: underline; }
.foot .by { margin-inline-end: auto; }

/* ---- legal page ---- */
.legal { max-width: 720px; padding-block: clamp(24px, 5vw, 56px) 56px; }
.legal h1 { font-size: clamp(2.4rem, 6vw, 3.4rem); margin-top: 8px; }
.legal .eff { color: var(--mute); margin: 0 0 28px; }
.legal .summary { background: var(--card); border-radius: var(--r); padding: 20px 22px; margin-bottom: 32px; border-inline-start: 6px solid var(--peri); }
.legal .summary p { margin: 0; }
.legal h2 { font-size: 1.35rem; margin: 36px 0 8px; letter-spacing: 0; }
.legal p, .legal li { color: var(--ink); }
.legal ul { padding-inline-start: 1.3em; }
.legal li + li { margin-top: 6px; }
.legal table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 8px 0; }
.legal th, .legal td { text-align: start; vertical-align: top; padding: 10px 12px; border-bottom: 1.5px solid var(--line); }
.legal th { font-weight: 600; }
.legal .table { overflow-x: auto; }
