/* XONEMI — product site
 *
 * The palette is not chosen here. It is lifted from the application's own
 * token file (lib/ui/design_system/app_colors.dart) so that the page and the
 * product cannot drift apart: the gold, the proof cyan and the near-black
 * ground are the same values the app paints with.
 *
 * Two typefaces, one register. Inter carries the Latin, IBM Plex Sans Arabic
 * the Arabic; both are neutral technical grotesques, so the two language
 * editions read as one product rather than as a translation.
 */

:root {
  /* --- from the app --- */
  --gold: #d5a657;
  --gold-light: #edc77a;
  --gold-dark: #8d6838;
  --cyan: #52dce8;
  --cyan-soft: #72eaf3;
  --cyan-deep: #0e6f7c;
  --green: #44d99a;

  --bg: #050a10;
  --bg-deep: #08111a;
  --surface: #0a121b;
  --card: #111c27;
  --card-2: #16212d;
  --line: #27313c;

  --ink: #f4efe5;
  --muted: #a7adb4;
  --faint: #6f7a84;

  /* --- type --- */
  --latin: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --arabic: "IBM Plex Sans Arabic", "Noto Sans Arabic", var(--latin);

  /* --- scale: 1.25 major third, density dial 4/10 --- */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;

  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1120px;

  color-scheme: dark;
}

/* The light edition uses the app's light tokens. Gold fails contrast as text
 * on a light ground (about 2:1), so the darker gold carries text and the
 * bright gold is kept for fills only. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f2efe9;
    --bg-deep: #ede9e1;
    --surface: #f7f5f1;
    --card: #ffffff;
    --card-2: #edeae4;
    --line: #d5cfc4;
    --ink: #1a1f24;
    --muted: #4e5862;
    --faint: #6f7a84;
    --gold: #8d6838;
    --gold-light: #a97f45;
    --cyan: #0e6f7c;
    --cyan-soft: #0a5a65;
    --green: #1f7a52;
    color-scheme: light;
  }
}

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

html {
  scroll-behavior: smooth;
}

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

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

body[dir="rtl"] {
  font-family: var(--arabic);
  line-height: 1.85; /* Arabic needs more leading than Latin at the same size */
}

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

a {
  color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Focus must stay visible for keyboard users — priority 1 in the checklist. */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.skip {
  position: absolute;
  inset-inline-start: var(--s-4);
  top: -100px;
  z-index: 100;
  background: var(--card);
  color: var(--ink);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  transition: top 160ms ease-out;
}
.skip:focus {
  top: var(--s-4);
}

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

header.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.bar .wrap {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  margin-inline-end: auto;
}
.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.langs {
  display: flex;
  gap: var(--s-1);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.langs a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding-inline: var(--s-3);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: background 180ms ease-out, color 180ms ease-out;
}
.langs a:hover {
  color: var(--ink);
}
.langs a[aria-current="true"] {
  background: var(--gold);
  color: #101010;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .langs a[aria-current="true"] {
    color: #ffffff;
  }
}

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

.hero {
  padding-block: var(--s-8) var(--s-7);
  position: relative;
  overflow: hidden;
}

/* One decorative wash, sized to the content rather than the viewport so the
 * page never opens on an empty screen. */
.hero::before {
  content: "";
  position: absolute;
  inset-inline-start: 50%;
  top: -180px;
  width: 900px;
  height: 520px;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--gold) 16%, transparent),
    transparent 68%
  );
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-7);
  align-items: center;
}

@media (min-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1.05fr 0.95fr;
    gap: var(--s-8);
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid color-mix(in srgb, var(--cyan) 40%, transparent);
  border-radius: 999px;
  padding: 6px var(--s-3);
  margin: 0 0 var(--s-5);
}
body[dir="rtl"] .eyebrow {
  letter-spacing: 0; /* Arabic must never be letter-spaced: it breaks joins */
  text-transform: none;
}

h1 {
  margin: 0 0 var(--s-4);
  font-size: clamp(2.25rem, 5.6vw, 3.9rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 700;
  text-wrap: balance;
}
body[dir="rtl"] h1 {
  letter-spacing: 0;
  line-height: 1.28;
}

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

.lede {
  margin: 0 0 var(--s-6);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  color: var(--muted);
  max-width: 46ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px; /* touch target floor */
  padding: 0 var(--s-5);
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 180ms ease-out, background 180ms ease-out,
    border-color 180ms ease-out, color 180ms ease-out;
}
.btn:active {
  transform: scale(0.98);
}
@media (prefers-reduced-motion: reduce) {
  .btn:active {
    transform: none;
  }
}

.btn-primary {
  background: var(--gold);
  color: #101010;
}
.btn-primary:hover {
  background: var(--gold-light);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .btn-primary {
    color: #ffffff;
  }
}

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.note {
  font-size: 14px;
  color: var(--faint);
  margin: var(--s-4) 0 0;
}

/* -------------------------------------------------------------- device --- */

.device {
  position: relative;
  justify-self: center;
  width: min(300px, 78vw);
  border-radius: 34px;
  padding: 9px;
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--gold) 55%, transparent),
    var(--line) 45%,
    color-mix(in srgb, var(--cyan) 35%, transparent)
  );
}
.device img {
  border-radius: 26px;
  width: 100%;
  background: var(--bg-deep);
}

/* ---------------------------------------------------------------- proof --- */

section {
  padding-block: var(--s-8);
}

.section-head {
  max-width: 62ch;
  margin: 0 auto var(--s-7);
  text-align: center;
}
.section-head.start {
  margin-inline: 0;
  text-align: start;
}

h2 {
  margin: 0 0 var(--s-3);
  font-size: clamp(1.6rem, 3.4vw, 2.35rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}
body[dir="rtl"] h2 {
  letter-spacing: 0;
  line-height: 1.4;
}

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

/* The claim strip: the one idea the whole product rests on. */
.claim {
  background: var(--bg-deep);
  border-block: 1px solid var(--line);
}
.claim .wrap {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: 1fr;
}
@media (min-width: 780px) {
  .claim .wrap {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-7);
  }
}

.claim-item h3 {
  margin: 0 0 var(--s-2);
  font-size: 1.08rem;
  font-weight: 600;
}
.claim-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
}
.claim-item .num {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-bottom: var(--s-3);
  font-variant-numeric: tabular-nums;
}
body[dir="rtl"] .claim-item .num {
  letter-spacing: 0;
}

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

.grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1000px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--s-5);
  transition: border-color 200ms ease-out, transform 200ms ease-out;
}
.card:hover {
  border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
}
@media (prefers-reduced-motion: no-preference) {
  .card:hover {
    transform: translateY(-2px);
  }
}

.card .ico {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--gold) 14%, transparent);
  color: var(--gold);
  margin-bottom: var(--s-4);
}
.card .ico svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card h3 {
  margin: 0 0 var(--s-2);
  font-size: 1.06rem;
  font-weight: 600;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

/* --------------------------------------------------------------- shots --- */

.shots {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 760px) {
  .shots {
    grid-template-columns: repeat(4, 1fr);
  }
}

.shot figure {
  margin: 0;
}
.shot img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-deep);
}
.shot figcaption {
  margin-top: var(--s-3);
  font-size: 0.88rem;
  color: var(--faint);
  text-align: center;
}

/* --------------------------------------------------------------- honest --- */

.honest {
  background: var(--bg-deep);
  border-block: 1px solid var(--line);
}
.honest ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--s-3);
  grid-template-columns: 1fr;
  max-width: 70ch;
  margin-inline: auto;
}
@media (min-width: 760px) {
  .honest ul {
    grid-template-columns: repeat(2, 1fr);
    max-width: none;
  }
}
.honest li {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s-4);
  color: var(--muted);
  font-size: 0.96rem;
}
.honest li svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  stroke: var(--faint);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* ------------------------------------------------------------------ cta --- */

.final {
  text-align: center;
}
.final .inner {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--s-8) var(--s-5);
}
.final h2 {
  margin-bottom: var(--s-3);
}
.final p {
  color: var(--muted);
  max-width: 52ch;
  margin: 0 auto var(--s-6);
}
.final .cta-row {
  justify-content: center;
}

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

footer {
  border-top: 1px solid var(--line);
  padding-block: var(--s-6);
  color: var(--faint);
  font-size: 0.9rem;
}
footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  align-items: center;
  justify-content: space-between;
}
footer nav {
  display: flex;
  gap: var(--s-4);
  flex-wrap: wrap;
}
footer a {
  color: var(--muted);
  text-decoration: none;
}
footer a:hover {
  color: var(--gold);
  text-decoration: underline;
}

/* --------------------------------------------------------------- motion --- */

/* Standard tier: a short reveal on scroll, staggered by the element's own
 * index. Every element is fully visible before the script runs, so the page
 * reads correctly with JavaScript disabled and never opens blank. */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(14px);
  }
  .js .reveal.in {
    opacity: 1;
    transform: none;
    transition: opacity 460ms cubic-bezier(0.22, 1, 0.36, 1),
      transform 460ms cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--d, 0ms);
  }
}
