/* MBOX website
   Design tokens mirror the app (src/theme/colors.ts, tokens.ts):
   near-black canvas, hairline borders, a four-step text hierarchy and seven accent palettes.
   Logical properties are used throughout so Arabic (RTL) mirrors correctly. */

@font-face {
  font-family: "Poppins";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/poppins-Medium.woff") format("woff");
}
@font-face {
  font-family: "Poppins";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/poppins-Bold.woff") format("woff");
}

/* ---------- Tokens ---------- */
:root {
  --bg: #060606;
  --card: #0f0f0f;
  --surface: #141414;
  --surface-hover: #1c1c1c;
  --elevated: #1f1f1f;
  --text: #ffffff;
  --muted: #8c8c93;
  --dim: #4a4a50;
  --faint: #2e2e33;
  --border: rgba(255, 255, 255, 0.09);
  --border-2: rgba(255, 255, 255, 0.14);
  --hairline: rgba(255, 255, 255, 0.07);
  --success: #3dd68c;
  --on-success: #04140c;
  --warning: #f5a524;
  --error: #ff453a;
  --glass: rgba(10, 10, 10, 0.72);
  --bezel: #1a1a1a;
  --knob-off: #8c8c93;
  --shadow-lg: 0 40px 80px -30px rgba(0, 0, 0, 0.8);

  /* accent (mono by default) */
  --primary: #ffffff;
  --primary-dark: #e4e4e4;
  --btn: #ffffff;
  --btn-hover: #e4e4e4;
  --on-primary: #060606;
  --accent-text: #ffffff;
  --on-dark: #ffffff; /* accent used on always-dark surfaces (video) */
  --glow: rgba(255, 255, 255, 0.08);

  /* film strip stays dark in both themes, like real film */
  --film: #111111;
  --film-rail: #262629;
  --film-line: rgba(255, 255, 255, 0.1);
  --film-text: #8c8c93;
  --strip-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-xxl: 26px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 68px;
  --maxw: 1200px;

  --font-display: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Noto Sans Arabic", Arial, sans-serif;

  --end: right; /* gradient "end" side, flipped in RTL */
  color-scheme: dark;
}

:root[dir="rtl"] { --end: left; }

:root[data-theme="light"] {
  --bg: #ffffff;
  --card: #ffffff;
  --surface: #f4f4f5;
  --surface-hover: #eaeaec;
  --elevated: #ffffff;
  --text: #060606;
  --muted: #5c5c64;
  --dim: #9a9aa2;
  --faint: #d4d4da;
  --border: rgba(6, 6, 6, 0.09);
  --border-2: rgba(6, 6, 6, 0.16);
  --hairline: rgba(6, 6, 6, 0.07);
  --success: #0e9f6e;
  --on-success: #ffffff;
  --warning: #b45309;
  --error: #dc2626;
  --glass: rgba(255, 255, 255, 0.82);
  --bezel: #d9d9de;
  --knob-off: #ffffff;
  --shadow-lg: 0 40px 80px -30px rgba(6, 6, 6, 0.35);

  --primary: #0a0a0a;
  --primary-dark: #000000;
  --btn: #0a0a0a;
  --btn-hover: #242424;
  --on-primary: #ffffff;
  --accent-text: #060606;
  --glow: rgba(6, 6, 6, 0.06);
  --strip-shadow: 0 30px 60px -30px rgba(6, 6, 6, 0.5);
}

/* Accent palettes (primary / primaryDark / onPrimary / accentText from the app) */
:root[data-accent="crimson"] { --primary: #e4142f; --primary-dark: #b20f26; --btn: #e4142f; --btn-hover: #b20f26; --on-primary: #fff; --accent-text: #ff4b63; --on-dark: #e4142f; }
:root[data-accent="gold"]    { --primary: #f5a524; --primary-dark: #b45309; --btn: #f5a524; --btn-hover: #ffc24d; --on-primary: #060606; --accent-text: #ffc24d; --on-dark: #f5a524; }
:root[data-accent="purple"]  { --primary: #a855f7; --primary-dark: #7e22ce; --btn: color-mix(in srgb, #a855f7 88%, #000); --btn-hover: #7e22ce; --on-primary: #fff; --accent-text: #c084fc; --on-dark: #a855f7; }
:root[data-accent="cyan"]    { --primary: #06b6d4; --primary-dark: #0e7490; --btn: #06b6d4; --btn-hover: #22d3ee; --on-primary: #060606; --accent-text: #22d3ee; --on-dark: #06b6d4; }
:root[data-accent="indigo"]  { --primary: #6366f1; --primary-dark: #4338ca; --btn: color-mix(in srgb, #6366f1 88%, #000); --btn-hover: #4338ca; --on-primary: #fff; --accent-text: #818cf8; --on-dark: #6366f1; }
:root[data-accent="emerald"] { --primary: #10b981; --primary-dark: #047857; --btn: #10b981; --btn-hover: #34d399; --on-primary: #060606; --accent-text: #34d399; --on-dark: #10b981; }
:root[data-accent]:not([data-accent="mono"]) { --glow: color-mix(in srgb, var(--primary) 16%, transparent); }
:root[data-theme="light"][data-accent="crimson"] { --accent-text: #b20f26; }
:root[data-theme="light"][data-accent="gold"]    { --accent-text: #b45309; }
:root[data-theme="light"][data-accent="purple"]  { --accent-text: #7e22ce; }
:root[data-theme="light"][data-accent="cyan"]    { --accent-text: #0e7490; }
:root[data-theme="light"][data-accent="indigo"]  { --accent-text: #4338ca; }
:root[data-theme="light"][data-accent="emerald"] { --accent-text: #047857; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* The HTML hidden attribute must always win over any display rule below
   (a class setting display: grid/flex would otherwise un-hide the element —
   this is what keeps the optional Android TV row truly invisible). */
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--header-h);
  scrollbar-color: var(--faint) transparent;
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
html.i18n-pending body { visibility: hidden; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
::selection { background: var(--primary); color: var(--on-primary); }
:lang(ar) { letter-spacing: 0 !important; }

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

.skip {
  position: fixed; inset-block-start: 8px; inset-inline-start: 8px; z-index: 100;
  padding: 10px 16px; border-radius: 999px; background: var(--btn); color: var(--on-primary);
  font-weight: 600; text-decoration: none; transform: translateY(-200%);
}
.skip:focus { transform: none; }

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

.i {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.i-solid { fill: currentColor; }
[dir="rtl"] .i-dir { transform: scaleX(-1); }

.display, .h2, .wordmark, .mega { font-family: var(--font-display); font-weight: 700; }
.display {
  font-size: clamp(2.25rem, 4.7vw, 3.5rem);
  line-height: 1.04; letter-spacing: -0.035em;
  text-wrap: balance; overflow-wrap: break-word; hyphens: auto;
}
.h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  line-height: 1.1; letter-spacing: -0.03em; text-wrap: balance; overflow-wrap: break-word;
}
.lead { font-size: clamp(1.0625rem, 1.5vw, 1.1875rem); line-height: 1.6; color: var(--muted); max-width: 58ch; text-wrap: pretty; }
:lang(ar) .display, :lang(ar) .h2 { line-height: 1.3; }
:lang(ar) .lead { line-height: 1.8; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px;
  border: 1px solid transparent; background: transparent; color: var(--text);
  font-size: 15px; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background-color 0.18s, border-color 0.18s, transform 0.18s;
}
.btn .i { width: 18px; height: 18px; }
.btn-primary { background: var(--btn); color: var(--on-primary); }
.btn-primary:hover { background: var(--btn-hover); }
.btn-ghost { border-color: var(--border-2); }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-lg { min-height: 54px; padding: 0 28px; font-size: 16px; }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn:active { transform: scale(0.98); }
.btn[aria-disabled="true"], .btn:disabled { opacity: 0.5; pointer-events: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent; color: var(--text); padding: 0;
  transition: background-color 0.18s;
}
.icon-btn:hover { background: var(--surface-hover); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; inset-block-start: 0; z-index: 50; height: var(--header-h);
  border-block-end: 1px solid transparent;
  transition: background-color 0.2s, border-color 0.2s;
}
.site-header.is-scrolled, .site-header[data-menu="open"] {
  background: var(--glass); border-block-end-color: var(--border);
  -webkit-backdrop-filter: saturate(1.5) blur(18px); backdrop-filter: saturate(1.5) blur(18px);
}
.bar { height: 100%; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-inline-end: auto; }
.brand-icon { width: 32px; height: 32px; border-radius: 9px; }
.wordmark { font-size: 1.25rem; letter-spacing: 0.02em; line-height: 1; }

.nav { display: flex; align-items: center; gap: 4px; position: absolute; inset-inline: 0; justify-content: center; pointer-events: none; }
.nav > * { pointer-events: auto; }
.nav-link {
  padding: 8px 14px; border-radius: 999px; text-decoration: none; font-size: 14.5px; font-weight: 500; color: var(--muted);
  transition: color 0.18s, background-color 0.18s;
}
.nav-link:hover { color: var(--text); background: var(--surface-hover); }
.nav-link[aria-current="true"] { color: var(--text); }
.nav-cta-mobile { display: none; }
.tools { display: flex; align-items: center; gap: 8px; position: relative; z-index: 1; }
.menu-btn { display: none; }
.menu-btn .i-close { display: none; }
.site-header[data-menu="open"] .menu-btn .i-open { display: none; }
.site-header[data-menu="open"] .menu-btn .i-close { display: block; }

.lang { position: relative; display: inline-flex; }
.lang-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 12px; border-radius: 999px;
  border: 1px solid var(--border); font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
  transition: background-color 0.18s;
}
[dir="rtl"] .lang-chip { padding: 0 12px 0 14px; }
.lang:hover .lang-chip { background: var(--surface-hover); }
.lang select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.lang:focus-within .lang-chip { outline: 2px solid var(--accent-text); outline-offset: 3px; }

#theme-btn .i-moon { display: none; }
:root[data-theme="light"] #theme-btn .i-sun { display: none; }
:root[data-theme="light"] #theme-btn .i-moon { display: block; }

@media (max-width: 1020px) {
  .nav-link { padding-inline: 10px; }
}
@media (max-width: 899px) {
  .menu-btn { display: inline-grid; }
  .nav { pointer-events: auto; }
  .js .nav {
    display: none; position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 24px; background: var(--bg); border-block-end: 1px solid var(--border);
    max-height: calc(100svh - var(--header-h)); overflow-y: auto;
  }
  .js .site-header[data-menu="open"] .nav { display: flex; }
  .js .nav-link { padding: 16px 4px; border-radius: 0; font-size: 18px; border-block-end: 1px solid var(--hairline); color: var(--text); }
  .js .nav-link:hover { background: transparent; }
  .js .nav-cta-mobile { display: inline-flex; margin-block-start: 20px; }
  html:not(.js) .nav { position: static; flex-wrap: wrap; justify-content: flex-start; order: 3; }
}
@media (max-width: 639px) {
  .nav-cta { display: none; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(48px, 7vw, 92px); position: relative; }
.section-head { max-width: 720px; margin-block-end: clamp(32px, 5vw, 56px); display: grid; gap: 16px; }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; padding-block: clamp(24px, 4vw, 56px) clamp(56px, 8vw, 96px); overflow: clip; }
.hero::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset-block-start: -15%; inset-inline-end: -15%; width: 75%; height: 100%;
  background: radial-gradient(closest-side, var(--glow), transparent 85%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(32px, 5vw, 72px); align-items: center; min-height: min(760px, calc(100svh - var(--header-h) - 24px)); }
.hero-copy { display: grid; gap: 24px; justify-items: start; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: 14px; }
.fact { display: inline-flex; align-items: center; gap: 8px; }
.fact .i { width: 18px; height: 18px; }

/* Film reel built from the app's own screens */
.hero-art { --fw: clamp(150px, 15.5vw, 200px); --rail: 18px; }
.reel {
  display: flex; gap: 20px; align-items: flex-start; height: min(700px, calc(100svh - var(--header-h) - 24px)); overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 9%, #000 88%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 9%, #000 88%, transparent);
}
.reel-col { translate: 0 var(--py, 0px); animation: reel-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.reel-col-b { margin-block-start: 120px; animation-delay: 0.12s; }
@keyframes reel-in { from { opacity: 0; transform: translateY(48px); } to { opacity: 1; transform: none; } }

.strip {
  position: relative; display: flex; border-radius: 20px; overflow: hidden; background: var(--film); box-shadow: var(--strip-shadow);
}
.strip::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--film-line); pointer-events: none; }
.rail {
  flex: 0 0 var(--rail); background: var(--film-rail);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='30' viewBox='0 0 18 30'%3E%3Cpath fill-rule='evenodd' d='M0 0h18v30H0z M7 9h4a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2z'/%3E%3C/svg%3E") 0 0 / 18px 30px repeat-y;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='30' viewBox='0 0 18 30'%3E%3Cpath fill-rule='evenodd' d='M0 0h18v30H0z M7 9h4a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2z'/%3E%3C/svg%3E") 0 0 / 18px 30px repeat-y;
}
.strip-body { display: flex; flex-direction: column; gap: 16px; padding: 12px 4px; }
.frame { display: grid; gap: 10px; }
.frame img {
  width: var(--fw); aspect-ratio: 709 / 1470; height: auto; border-radius: 14px; background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.frame figcaption { color: var(--film-text); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; text-align: center; }

@media (max-width: 899px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 40px; }
  .hero-art { --fw: clamp(140px, calc((100vw - 150px) / 4), 200px); margin-inline: calc(-1 * var(--gutter)); }
  .reel {
    display: block; height: auto; overflow-x: auto; overflow-y: hidden; padding: 4px var(--gutter) 20px;
    -webkit-mask-image: none; mask-image: none; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter);
    scrollbar-width: thin; scrollbar-color: var(--faint) transparent; overscroll-behavior-x: contain;
  }
  .reel:focus-visible { outline-offset: -4px; border-radius: 0; }
  .reel-col { translate: none; width: max-content; }
  .reel-col-b { display: none; }
  .strip { display: grid; grid-template-rows: var(--rail) auto var(--rail); width: max-content; }
  .rail {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='18' viewBox='0 0 30 18'%3E%3Cpath fill-rule='evenodd' d='M0 0h30v18H0z M9 5h12a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2z'/%3E%3C/svg%3E") 0 0 / 30px 18px repeat-x;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='18' viewBox='0 0 30 18'%3E%3Cpath fill-rule='evenodd' d='M0 0h30v18H0z M9 5h12a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2z'/%3E%3C/svg%3E") 0 0 / 30px 18px repeat-x;
  }
  .strip-body { flex-direction: row; padding: 4px 12px; }
  .frame { scroll-snap-align: center; }
}

/* Self-running reel (JS adds .is-auto; without it, or with reduced motion, the strips stay still / swipeable) */
.reel { direction: ltr; }
@keyframes reel-run-y { from { transform: translate3d(0, var(--from, 0px), 0); } to { transform: translate3d(0, var(--to, 0px), 0); } }
@keyframes reel-run-x { from { transform: translate3d(var(--from, 0px), 0, 0); } to { transform: translate3d(var(--to, 0px), 0, 0); } }
.reel.is-auto .strip { animation: reel-run-y var(--dur, 60s) linear infinite; will-change: transform; }
.reel.is-auto:focus-within .strip, .reel.is-held .strip, .reel.is-off .strip { animation-play-state: paused; }
@media (hover: hover) { .reel.is-auto:hover .strip { animation-play-state: paused; } }
@media (max-width: 899px) {
  .reel.is-auto { overflow: hidden; scroll-snap-type: none; touch-action: pan-y; }
  .reel.is-auto .strip { animation-name: reel-run-x; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* hero copy arrives line by line */
  .hero-copy > * { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-copy > :nth-child(2) { animation-delay: 0.08s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.16s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.24s; }
  @keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

  /* scroll reveal (classes are added by JS and removed again once shown) */
  .js-anim .rv {
    opacity: 0; transform: translateY(28px) scale(0.985);
    transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: calc(var(--i, 0) * 70ms);
  }
  .js-anim .rv.in { opacity: 1; transform: none; }

  /* small signs of life */
  .btn-primary .i { animation: nudge 2.6s ease-in-out 1.5s infinite; }
  @keyframes nudge { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(2px); } 90% { transform: translateY(-1px); } }
  .dl-icon { animation: float 5s ease-in-out infinite; }
  @keyframes float { 50% { transform: translateY(-6px); } }
  .tile, .build, .qa { transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .tile:hover { transform: translateY(-3px); border-color: var(--border-2); }
  .build:hover { transform: translateY(-2px); }
}

/* ---------- Bento ---------- */
.bento { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.tile {
  --pad: clamp(20px, 3vw, 30px);
  position: relative; display: flex; flex-direction: column; gap: 22px; padding: var(--pad); padding-block-end: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 28px; overflow: hidden; min-width: 0;
}
.tile-copy { display: grid; gap: 8px; max-width: 52ch; }
.tile h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.3125rem; line-height: 1.25; letter-spacing: -0.02em; text-wrap: balance; }
.tile p { color: var(--muted); font-size: 15px; line-height: 1.6; text-wrap: pretty; }
:lang(ar) .tile p { line-height: 1.8; }

.mock {
  flex: 1 1 auto; margin: 0 calc(-1 * var(--pad)); padding: 18px var(--pad) var(--pad);
  background: var(--bg); border-block-start: 1px solid var(--border);
  display: grid; gap: 14px; align-content: start; min-width: 0;
}

/* Real app screens inside feature tiles: the phone is cut off by the tile edge and fades into it */
.mock-shot { position: relative; display: block; min-height: 400px; padding: 0; overflow: hidden;
  background: radial-gradient(120% 70% at 50% 0%, var(--surface-hover), var(--bg) 70%); }
.mock-shot::after { content: ""; position: absolute; inset: auto 0 0; height: 96px; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.shot { position: absolute; top: 26px; inset-inline: 0; margin-inline: auto; display: block; width: min(calc(100% - 2 * var(--pad)), 300px); height: auto;
  border-radius: 26px 26px 0 0; border: 1px solid var(--border-2); border-bottom: 0; box-shadow: 0 -12px 50px rgb(0 0 0 / 0.35); }
@media (prefers-reduced-motion: no-preference) { .shot { transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); } .tile:hover .shot { transform: translateY(-6px); } }

.t-small { padding-block-end: var(--pad); gap: 14px; }
.t-small > p { flex: 1; }

@media (min-width: 680px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-discover, .t-subs, .t-details { grid-column: 1 / -1; }
}
@media (min-width: 1040px) {
  .bento { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .t-discover { grid-column: span 7; }
  .t-library { grid-column: span 5; }
  .t-player { grid-column: span 5; }
  .t-subs { grid-column: span 7; }
  .t-act, .t-dl { grid-column: span 6; }
  .t-details, .t-sync, .t-lang { grid-column: span 4; }
}

/* posters: abstract tonal blocks (no third-party artwork inside the mini UIs) */
.poster, .ui-pop { display: block; background-color: #222; }
.p1 { background-image: linear-gradient(155deg, #5b6b8c 0%, #2a3148 55%, #14161f 100%); }
.p2 { background-image: linear-gradient(155deg, #a2745a 0%, #5a3a2c 55%, #1c1210 100%); }
.p3 { background-image: linear-gradient(155deg, #3f8a8a 0%, #1f4a52 55%, #0b1a1e 100%); }
.p4 { background-image: linear-gradient(155deg, #a04a5c 0%, #5a2234 55%, #1b0b11 100%); }
.p5 { background-image: linear-gradient(155deg, #8a8f4e 0%, #4a4e26 55%, #14160a 100%); }
.p6 { background-image: linear-gradient(155deg, #7a5a9a 0%, #3d2a5a 55%, #130d1f 100%); }
.poster { aspect-ratio: 2 / 3; border-radius: 6px; }

.sk { display: block; height: 8px; border-radius: 4px; background: var(--faint); width: 100%; }
.sk-s { width: 45%; }
.sk-m { width: 70%; }

/* shared mini-UI parts */
.ui-search { display: flex; gap: 10px; }
.ui-field {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 44px; padding-inline: 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden;
}
.ui-field .i { width: 17px; height: 17px; }
.ui-sq { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.ui-sq .i { width: 18px; height: 18px; }
.ui-chips {
  display: flex; gap: 8px; overflow: hidden;
  -webkit-mask-image: linear-gradient(to var(--end), #000 80%, transparent); mask-image: linear-gradient(to var(--end), #000 80%, transparent);
}
.ui-chip { flex: none; display: inline-flex; align-items: center; height: 30px; padding-inline: 13px; border-radius: 999px; border: 1px solid var(--border-2); font-size: 12px; font-weight: 600; }
.ui-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.ui-head b { font-weight: 600; }
.ui-see { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--muted); }
.ui-see .i { width: 14px; height: 14px; }

.ui-discover { grid-template-rows: auto auto auto 1fr; }
.ui-genres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(68px, auto); align-content: start; gap: 10px; }
.ui-genre {
  position: relative; overflow: hidden; height: 68px; padding: 10px 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; line-height: 1.25;
}
.ui-genre > span { position: relative; z-index: 1; display: block; overflow-wrap: break-word; hyphens: auto; }
@media (min-width: 480px) { .ui-genres { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ui-pop { position: absolute; width: 28px; height: 40px; border-radius: 5px; inset-block-end: -10px; inset-inline-end: 8px; rotate: 8deg; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
.ui-pop + .ui-pop { inset-inline-end: 26px; rotate: -7deg; inset-block-end: -14px; }
[dir="rtl"] .ui-pop { rotate: -8deg; }
[dir="rtl"] .ui-pop + .ui-pop { rotate: 7deg; }

.ui-seg { display: flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.ui-seg span { flex: 1; text-align: center; white-space: nowrap; padding: 8px 6px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ui-seg span.on { background: var(--btn); color: var(--on-primary); }

/* library */
.ui-add { display: flex; align-items: center; gap: 8px; height: 46px; padding-inline: 14px; border-radius: 12px; border: 1px dashed var(--border-2); font-size: 13px; font-weight: 600; }
.ui-add .i { width: 17px; height: 17px; }
.ui-pls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ui-pl { display: grid; gap: 4px; align-content: start; min-width: 0; }
.ui-pl b { font-size: 13px; font-weight: 600; margin-block-start: 6px; }
.ui-pl small { font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.ui-collage { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; border-radius: 12px; overflow: hidden; aspect-ratio: 1.6; background: var(--surface); }
.ui-collage .poster { aspect-ratio: auto; height: 100%; border-radius: 0; }

/* player */
.ui-screen {
  position: relative; aspect-ratio: 16 / 7.5; border-radius: 14px; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(110% 100% at 25% 15%, #3a4257 0%, #14171f 60%, #07080b 100%);
}
.ui-round { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.16); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.ui-round .i { width: 20px; height: 20px; }
.ui-seek { position: absolute; inset-inline: 12px; inset-block-end: 10px; display: flex; align-items: center; gap: 8px; direction: ltr; color: #fff; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.ui-seek .bar, .ph-thumb .bar { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.28); overflow: hidden; }
.ui-seek .bar i, .ph-thumb .bar i { display: block; height: 100%; width: var(--p); background: var(--on-dark); border-radius: inherit; }
.ui-rows li { display: flex; align-items: center; gap: 12px; min-height: 44px; border-block-end: 1px solid var(--hairline); font-size: 13.5px; }
.ui-rows li:last-child { border-block-end: 0; }
.ui-rows .i { width: 18px; height: 18px; color: var(--muted); }
.ui-rows em { margin-inline-start: auto; font-style: normal; font-size: 12.5px; color: var(--muted); }
.ui-rows li > .i:last-child { width: 16px; height: 16px; color: var(--dim); }
.ui-note { font-size: 11.5px; line-height: 1.4; color: var(--muted); padding-block-start: 2px; }

/* ---------- Subtitle demo ---------- */
.sd-screen {
  --sd-fs: 16px; --sd-c: #fff; --sd-bg: rgba(0, 0, 0, 0.82);
  position: relative; aspect-ratio: 16 / 8; border-radius: 14px; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; padding: 0 14px 5%;
  background:
    radial-gradient(60% 45% at 78% 28%, rgba(255, 214, 150, 0.85), transparent 70%),
    linear-gradient(180deg, #5d7ba6 0%, #8da6c6 42%, #d3b58a 66%, #2c2a29 67%, #151413 100%);
}
.sd-screen::before {
  content: ""; position: absolute; inset-inline: 0; inset-block-end: 33%; height: 18%;
  background: linear-gradient(90deg, transparent 0 6%, #2b2a2c 6% 14%, transparent 14% 22%, #2b2a2c 22% 27%, transparent 27% 40%, #2b2a2c 40% 50%, transparent 50% 58%, #2b2a2c 58% 63%, transparent 63% 78%, #2b2a2c 78% 90%, transparent 90%);
  opacity: 0.8; clip-path: polygon(0 100%, 0 40%, 100% 10%, 100% 100%);
}
.sd-screen[data-size="small"] { --sd-fs: 13px; }
.sd-screen[data-size="medium"] { --sd-fs: 16px; }
.sd-screen[data-size="large"] { --sd-fs: 20px; }
.sd-screen[data-size="extraLarge"] { --sd-fs: 24px; }
.sd-screen[data-color="white"] { --sd-c: #ffffff; }
.sd-screen[data-color="yellow"] { --sd-c: #fff36b; }
.sd-screen[data-color="cyan"] { --sd-c: #7fe7ff; }
.sd-screen[data-bg="none"] { --sd-bg: transparent; }
.sd-screen[data-bg="light"] { --sd-bg: rgba(0, 0, 0, 0.48); }
.sd-screen[data-bg="dark"] { --sd-bg: rgba(0, 0, 0, 0.82); }
.sd-line { position: relative; max-width: 92%; text-align: center; }
.sd-line span {
  padding: 3px 10px; border-radius: 4px; background: var(--sd-bg); color: var(--sd-c); font-size: var(--sd-fs); line-height: 1.7; font-weight: 500;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.35);
  transition: font-size 0.18s, color 0.18s, background-color 0.18s;
}

.sd-timing { display: grid; gap: 10px; }
.sd-timeline { position: relative; direction: ltr; height: 64px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.sd-track { position: absolute; inset-inline: 0; height: 50%; }
.sd-wave { inset-block-start: 0; }
.sd-cues { inset-block-end: 0; }
.sd-seg { position: absolute; inset-block: 7px; border-radius: 6px; transition: left 0.22s cubic-bezier(0.3, 0.7, 0.2, 1), background-color 0.2s; }
.sd-wave .sd-seg {
  background: repeating-linear-gradient(90deg, var(--muted) 0 2px, transparent 2px 5px);
  -webkit-mask-image: linear-gradient(0deg, transparent 10%, #000 10% 90%, transparent 90%); mask-image: linear-gradient(0deg, transparent 10%, #000 10% 90%, transparent 90%);
  opacity: 0.9; transition: none;
}
.sd-cues .sd-seg { background: var(--faint); border: 1px solid var(--border-2); }
.sd-timeline.is-synced .sd-cues .sd-seg { background: var(--primary); border-color: transparent; }
.sd-sync { display: flex; align-items: center; justify-content: space-between; gap: 8px; direction: ltr; }
.sd-sync .i-dir { transform: none !important; }
.sd-step { white-space: nowrap; justify-content: center; }
.opts input[name="sd-step"] + span { direction: ltr; unicode-bidi: isolate; }
@media (max-width: 519px) {
  .sd-sync { display: grid; grid-template-columns: 1fr 1fr; }
  .sd-offset { grid-column: 1 / -1; order: -1; }
  .sd-controls { grid-template-columns: minmax(0, 1fr); }
}
.sd-step {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border-2); background: transparent; transition: background-color 0.18s;
}
.sd-step:hover { background: var(--surface-hover); }
.sd-step .i { width: 16px; height: 16px; }
.sd-offset { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; min-width: 6ch; text-align: center; direction: ltr; unicode-bidi: isolate; }
.sd-hint { min-height: 24px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sd-hint[data-state="synced"] { color: var(--success); }
.sd-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 8px; border-radius: 999px; font-weight: 600; font-size: 12.5px; background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.sd-badge .i { width: 14px; height: 14px; }
.sd-badge[hidden] { display: none; }

.sd-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.sd-group, .ctl { border: 0; padding: 0; margin: 0; min-width: 0; }
.sd-group legend { padding: 0; margin-block-end: 8px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opts label, .seg-radios label, .swatches label { position: relative; display: inline-flex; cursor: pointer; }
.opts input, .seg-radios input, .swatches input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.opts label > span {
  display: inline-grid; place-items: center; min-width: 40px; min-height: 38px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border-2); transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.opts label:hover > span { background: var(--surface-hover); }
.opts input:checked + span { background: var(--btn); color: var(--on-primary); border-color: transparent; }
.opts input:focus-visible + span, .seg-radios input:focus-visible + span, .swatches input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.opts-dots label > span.dot { min-width: 0; width: 38px; padding: 0; background: var(--c); border: 2px solid var(--border-2); }
.opts-dots label:hover > span.dot { background: var(--c); }
.opts-dots input:checked + span.dot { background: var(--c); color: inherit; border-color: transparent; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }

/* ---------- Activity demo ---------- */
.ad-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ad-stat {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
}
.ad-stat .i { grid-row: 1 / 3; width: 40px; height: 40px; padding: 11px; border-radius: 12px; background: var(--surface-hover); }
.ad-stat b { font-size: 1.375rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ad-stat span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.ad-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.ad-item .poster { width: 44px; flex: none; border-radius: 8px; }
.ad-item-main { flex: 1; min-width: 0; display: grid; gap: 8px; }
.ad-prog { display: block; height: 4px; border-radius: 2px; background: var(--faint); overflow: hidden; }
.ad-prog i { display: block; height: 100%; width: var(--p); background: var(--primary); border-radius: inherit; }
.ad-time { white-space: nowrap; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; direction: ltr; text-align: start; unicode-bidi: isolate; }
.ad-resume { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding-inline: 14px; border-radius: 999px; background: var(--btn); color: var(--on-primary); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ad-resume .i { width: 12px; height: 12px; }
.ad-chart { padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); display: grid; gap: 14px; }
.ad-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ad-head > b { font-size: 14px; font-weight: 600; }
.ad-total { display: grid; justify-items: end; text-align: end; }
.ad-total small { font-size: 11px; color: var(--muted); }
.ad-total strong { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ad-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; height: 128px; }
.ad-bar { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; padding: 0; border: 0; background: none; color: var(--muted); font-size: 11px; border-radius: 8px; }
.ad-bar .track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.ad-bar .fill { width: 100%; max-width: 28px; height: var(--h); border-radius: 8px 8px 4px 4px; background: var(--faint); transition: height 0.4s cubic-bezier(0.2, 0.7, 0.2, 1), background-color 0.15s; }
.ad-bar:hover .fill { background: var(--dim); }
.ad-bar[aria-pressed="true"] { color: var(--text); font-weight: 600; }
.ad-bar[aria-pressed="true"] .fill { background: var(--primary); }
.ad-readout { min-height: 20px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ad-readout b { color: var(--text); font-weight: 600; }
.ad-foot { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-pill { padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface); border: 1px solid var(--border); }

/* ---------- Downloads demo ---------- */
.dd-list { display: grid; gap: 10px; }
.dd-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.dd-item .poster { width: 44px; flex: none; border-radius: 8px; }
.dd-main { flex: 1; min-width: 0; display: grid; gap: 7px; }
.dd-main small { font-size: 12px; color: var(--muted); }
.ring {
  --p: 0; position: relative; flex: none; display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%;
  color: var(--text); background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--faint) 0);
}
.ring::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--surface); }
.ring .i { position: relative; width: 16px; height: 16px; }
button.ring:hover::before { background: var(--surface-hover); }
.ring-idle { color: var(--muted); }
.ring-done { background: var(--success); color: var(--on-success); }
.ring-done::before { display: none; }
.dd-quality { display: grid; gap: 8px; margin-block-start: 4px; }
.dd-quality b { font-size: 13px; font-weight: 600; }
.dd-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; border-block-start: 1px solid var(--hairline); font-size: 13.5px; }
.dd-switch > span { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dd-switch .i { width: 18px; height: 18px; color: var(--muted); }
.sw { position: relative; flex: none; width: 42px; height: 26px; border-radius: 13px; background: var(--faint); }
.sw::after { content: ""; position: absolute; inset-block-start: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--knob-off); transition: inset-inline-start 0.2s; }
.sw.on { background: var(--btn); }
.sw.on::after { inset-inline-start: 19px; background: var(--on-primary); }

/* ---------- Small tiles ---------- */
.tile-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--surface-hover); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li, .tags button {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-2); background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 500; line-height: 1.4;
}
.tags button { color: var(--text); min-height: 36px; padding-inline: 14px; transition: background-color 0.15s; }
.tags button:hover { background: var(--surface-hover); }
.tags button[aria-current="true"] { background: var(--btn); color: var(--on-primary); border-color: transparent; }

/* ---------- Customize ---------- */
.customize { border-block: 1px solid var(--border); background: linear-gradient(180deg, var(--surface), var(--bg) 70%); }
.cust-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: clamp(40px, 7vw, 96px); align-items: center; }
.cust-copy { display: grid; gap: 16px; }
.controls { margin-block-start: 16px; display: grid; gap: 4px; }
.ctl { margin-block-end: 24px; }
.ctl legend { padding: 0; margin-block-end: 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg-radios { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-radios label > span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--border-2);
  font-size: 14px; font-weight: 600; transition: background-color 0.15s, color 0.15s;
}
.seg-radios label:hover > span { background: var(--surface-hover); }
.seg-radios input:checked + span { background: var(--btn); color: var(--on-primary); border-color: transparent; }
.seg-radios .i { width: 18px; height: 18px; }
.swatches { display: flex; flex-wrap: wrap; gap: clamp(8px, 2.6vw, 14px); }
.swatch { display: block; width: clamp(34px, 10vw, 40px); height: clamp(34px, 10vw, 40px); border-radius: 50%; background: var(--sw); border: 1px solid var(--border-2); transition: transform 0.15s; }
.swatches input[value="mono"] + .swatch { background: linear-gradient(135deg, #ffffff 50%, #0a0a0a 50%); }
.swatches label:hover .swatch { transform: scale(1.08); }
.swatches input:checked + .swatch { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text); }
.swatch-name { margin-block-start: 12px; font-size: 13px; color: var(--muted); min-height: 20px; }
.link-btn { display: inline-flex; align-items: center; gap: 8px; justify-self: start; min-height: 44px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 600; }
.link-btn:hover { color: var(--text); }
.link-btn .i { width: 16px; height: 16px; }

.phone {
  position: relative; width: 100%; max-width: 310px; margin-inline: auto; aspect-ratio: 9 / 19; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 42px; background: var(--bg); border: 1px solid var(--border-2); box-shadow: 0 0 0 7px var(--bezel), var(--shadow-lg);
}
.ph-screen { flex: 1; min-height: 0; overflow: hidden; }
.ph-hero { position: relative; height: 56%; background: radial-gradient(90% 70% at 72% 18%, #54487a 0%, transparent 70%), linear-gradient(180deg, #1f2433, #0d0e14); }
.ph-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg) 0%, transparent 55%); }
.ph-top { position: absolute; z-index: 2; inset-block-start: 14px; inset-inline: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #fff; }
.ph-logo { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 0.02em; }
.ph-search { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.ph-search .i { width: 15px; height: 15px; }
.ph-tabs-top { display: none; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(10, 10, 10, 0.55); border: 1px solid rgba(255, 255, 255, 0.12); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: 11px; font-weight: 600; }
.ph-tabs-top > * { padding: 5px 9px; border-radius: 999px; color: rgba(255, 255, 255, 0.7); }
.ph-tabs-top b { background: #fff; color: #060606; font-weight: 600; }
:root[data-tabs="top"] .ph-tabs-top { display: flex; }
:root[data-tabs="top"] .ph-seg { display: none; }
:root[data-tabs="top"] .ph-logo { display: none; }
.ph-info { position: absolute; z-index: 2; inset-inline: 16px; inset-block-end: 12px; display: grid; gap: 10px; justify-items: start; }
.ph-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(255, 255, 255, 0.16); }
.ph-badge .i { width: 12px; height: 12px; color: #ffc24d; }
.ph-info .sk-title { width: 62%; height: 16px; border-radius: 6px; background: rgba(255, 255, 255, 0.9); }
.ph-cta { display: flex; align-items: center; gap: 8px; }
.ph-play { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding-inline: 16px; border-radius: 999px; background: var(--btn); color: var(--on-primary); font-size: 13px; font-weight: 600; transition: background-color 0.2s; }
.ph-play .i { width: 14px; height: 14px; }
.ph-i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); color: #fff; }
.ph-i .i { width: 17px; height: 17px; }
.ph-dots { display: flex; gap: 5px; }
.ph-dots i { width: 5px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.35); }
.ph-dots i.on { width: 16px; background: #fff; }
.ph-sec { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 16px 10px; font-size: 12.5px; }
.ph-sec b { font-weight: 600; }
.ph-sec > span { display: inline-flex; align-items: center; font-size: 11px; color: var(--muted); }
.ph-sec .i { width: 13px; height: 13px; }
.ph-rail { display: flex; gap: 10px; padding-inline: 16px; }
.ph-card { flex: 1; min-width: 0; display: grid; gap: 6px; }
.ph-card .sk { height: 7px; }
.ph-thumb { position: relative; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; }
.ph-thumb .bar { position: absolute; inset-inline: 8px; inset-block-end: 7px; height: 3px; }
.ph-seg { margin: 14px 16px 0; }
.ph-bar { display: flex; align-items: center; justify-content: space-around; height: 58px; flex: none; border-block-start: 1px solid var(--hairline); background: var(--glass); color: var(--dim); }
.ph-bar .i { width: 22px; height: 22px; }
.ph-bar .i.on { color: var(--text); }

@media (max-width: 899px) {
  .cust-grid { grid-template-columns: minmax(0, 1fr); }
  .phone { max-width: 270px; }
}

/* ---------- Download ---------- */
.dl-card {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); padding: clamp(24px, 5vw, 56px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 36px;
}
.dl-intro { display: grid; gap: 16px; align-content: start; justify-items: start; }
.dl-icon { width: 104px; height: 104px; border-radius: 26px; box-shadow: 0 0 0 1px var(--border-2), 0 18px 40px -16px rgba(0, 0, 0, 0.6); margin-block-end: 8px; }
.dl-facts { display: grid; gap: 10px; margin-block-start: 8px; color: var(--muted); font-size: 14.5px; }
.dl-facts li { display: flex; align-items: flex-start; gap: 10px; }
.dl-facts .i { width: 18px; height: 18px; margin-block-start: 2px; color: var(--text); }
.dl-main { display: grid; gap: 20px; align-content: start; min-width: 0; }
.builds { display: grid; gap: 12px; }
.build {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 18px;
  border-radius: 22px; background: var(--bg); border: 1px solid var(--border); transition: border-color 0.2s;
}
.build[data-state="ready"] { border-color: var(--border-2); }
.build-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--surface-hover); }
.build-info { display: grid; gap: 2px; min-width: 0; }
.build-info strong { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }
.build-sub { font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.build-status { font-size: 12.5px; font-weight: 600; color: var(--muted); display: flex; align-items: center; margin-block-start: 4px; min-height: 18px; }
.build[data-state="ready"] .build-status { color: var(--success); }
.build[data-state="error"] .build-status, .build[data-state="deploying"] .build-status { color: var(--warning); }
.build-status { overflow-wrap: anywhere; line-height: 1.4; }
.dl-debug { margin: 0; padding: 12px 14px; border: 1px dashed var(--border-2); border-radius: 12px; font: 12px/1.55 ui-monospace, Menlo, Consolas, monospace; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.build[data-state="checking"] .build-status::before {
  content: ""; width: 11px; height: 11px; margin-inline-end: 8px; border-radius: 50%; border: 2px solid currentColor; border-inline-end-color: transparent; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.build-action .btn { min-width: 132px; }
.dl-tip { font-size: 14px; color: var(--muted); }
.install { display: grid; gap: 14px; padding-block-start: 20px; border-block-start: 1px solid var(--border); }
.install h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.125rem; letter-spacing: -0.01em; }
.steps { counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 14.5px; line-height: 1.5; }
.steps li::before {
  content: counter(s); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-hover); border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
:lang(ar) .steps li::before { content: counter(s, arabic-indic); }
.dl-warn { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; color: var(--muted); background: color-mix(in srgb, var(--warning) 9%, transparent); border: 1px solid color-mix(in srgb, var(--warning) 28%, transparent); }
.dl-warn .i { width: 18px; height: 18px; margin-block-start: 1px; color: var(--warning); }

@media (max-width: 899px) {
  .dl-card { grid-template-columns: minmax(0, 1fr); border-radius: 28px; }
}
@media (max-width: 559px) {
  .build { grid-template-columns: auto minmax(0, 1fr); }
  .build-action { grid-column: 1 / -1; }
  .build-action .btn { width: 100%; }
  .build-action:empty { display: none; }
}

/* ---------- FAQ ---------- */
.faq-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.faq-grid > .h2 { position: sticky; inset-block-start: calc(var(--header-h) + 32px); }
.qa { border-block-end: 1px solid var(--border); }
.qa:first-child { border-block-start: 1px solid var(--border); }
.qa summary {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 22px; cursor: pointer; list-style: none;
  font-size: 1.0625rem; font-weight: 600; line-height: 1.4; letter-spacing: -0.01em;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary .i { width: 22px; height: 22px; color: var(--muted); transition: transform 0.25s, color 0.2s; }
.qa summary:hover .i { color: var(--text); }
.qa[open] summary .i { transform: rotate(45deg); color: var(--text); }
.qa p { padding-block-end: 24px; max-width: 64ch; color: var(--muted); font-size: 15.5px; line-height: 1.7; animation: fade-in 0.3s ease both; text-wrap: pretty; }
@keyframes fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (max-width: 899px) {
  .faq-grid { grid-template-columns: minmax(0, 1fr); }
  .faq-grid > .h2 { position: static; }
}

/* ---------- Footer ---------- */
.site-footer { position: relative; overflow: hidden; border-block-start: 1px solid var(--border); padding-block-start: clamp(48px, 7vw, 80px); }
.credits-title { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-block-end: 20px; }
.credits-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 32px; }
.credits-list dt { font-size: 13px; color: var(--muted); margin-block-end: 4px; }
.credits-list dd { font-size: 15.5px; font-weight: 500; }
.gh { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; border-block-end: 1px solid var(--border-2); }
.gh:hover { border-block-end-color: var(--text); }
.gh .i { width: 18px; height: 18px; }
.mega {
  margin-block: clamp(32px, 6vw, 64px) -0.14em; font-size: clamp(5rem, 27vw, 21rem); line-height: 0.82; letter-spacing: -0.04em; text-align: center;
  color: var(--surface-hover); user-select: none; pointer-events: none; white-space: nowrap;
}
.legal { position: relative; z-index: 1; display: grid; gap: 14px; padding-block: 22px 28px; border-block-start: 1px solid var(--border); background: var(--bg); font-size: 13px; color: var(--muted); }
.legal p { max-width: 72ch; line-height: 1.6; }
.legal-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.to-top { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; color: var(--text); min-height: 32px; }
.to-top .i { width: 16px; height: 16px; }
@media (max-width: 679px) {
  .credits-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Previous release line (fed by the release manifest) ---------- */
.dl-previous { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.dl-previous span { font-weight: 500; }
.dl-previous a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 3px; font-weight: 600; }
.dl-previous a:hover { text-decoration-color: currentColor; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reel-col { translate: none !important; }
}

@media (forced-colors: active) {
  .btn, .icon-btn, .lang-chip, .opts label > span, .seg-radios label > span { border: 1px solid ButtonText; }
  .opts input:checked + span, .seg-radios input:checked + span, .swatches input:checked + .swatch { outline: 2px solid Highlight; }
}
