/* KARAT site. Tokens mirror lib/src/theme/theme.dart (AppColors). */
:root {
  --bg-top: #2A1D78;
  --bg-mid: #5A2DB5;
  --bg-deep: #1C1350;
  --bg-night: #140D3A;
  --glow: rgba(217, 138, 78, .35);
  --glass: rgba(28, 19, 80, .6);
  --glass-strong: rgba(28, 19, 80, .82);
  --stroke: rgba(255, 255, 255, .18);
  --stroke-soft: rgba(255, 255, 255, .08);
  --gold: #E8C15A;
  --gold-light: #F6DB8A;
  --gold-deep: #C99A35;
  --on-gold: #241A5C;
  --ink: #FFFFFF;
  --ink-2: #C9C0E8;
  --ink-3: #C4BAE8;
  --live: #7EE0A1;

  --serif: "Amiri", "Traditional Arabic", serif;
  --kufi: "Reem Kufi", "Amiri", sans-serif;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(72px, 11vw, 140px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 18px/1.55 var(--serif);
  color: var(--ink);
  background: var(--bg-night);
  -webkit-font-smoothing: antialiased;
}
:lang(ar) body, html[lang="ar"] body { line-height: 1.8; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
::selection { background: var(--gold); color: var(--on-gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
html { scrollbar-color: var(--bg-mid) var(--bg-night); }
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--bg-night); }
::-webkit-scrollbar-thumb { background: var(--bg-mid); border-radius: 12px; border: 3px solid var(--bg-night); }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.ico { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#i-apple, #i-play { fill: currentColor; stroke: none; }
.ico use[href="#i-apple"], .ico use[href="#i-play"] { fill: currentColor; stroke: none; }
.muted { color: var(--ink-3); }

.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--gold); color: var(--on-gold); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* Buttons: pills, gold for the action, a hairline ghost for the second path. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 52px; padding: 0 28px; border-radius: 999px;
  font: 700 17px/1 var(--serif); text-decoration: none; white-space: nowrap;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), background-color .3s, border-color .3s;
}
.btn-sm { min-height: 42px; padding: 0 20px; font-size: 16px; }
.btn-gold {
  color: var(--on-gold);
  background: linear-gradient(135deg, var(--gold-light), var(--gold-deep));
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-gold:active { transform: translateY(0); }
.btn-ghost { color: var(--ink); border: 1px solid var(--stroke); background: rgba(255, 255, 255, .03); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-light); }

/* Nav: the app's glass bar. */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(28, 19, 80, .55);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s, background-color .3s;
}
.nav.scrolled { background: rgba(20, 13, 58, .82); border-bottom-color: var(--stroke-soft); box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .7); }
.nav-in { display: flex; align-items: center; gap: 20px; height: 72px; width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.wordmark { font: 700 26px/1 var(--kufi); color: var(--gold); letter-spacing: .01em; }
.links { display: flex; gap: 4px; margin-inline-start: auto; }
.links a { padding: 10px 14px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-size: 17px; transition: color .2s, background-color .2s; }
.links a:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.lang {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--stroke); background: transparent; color: var(--ink);
  font: 700 16px/1 var(--serif); cursor: pointer; transition: border-color .2s, color .2s;
}
.lang:hover { border-color: var(--gold); color: var(--gold-light); }
.lang[lang="ar"] span { font-family: var(--serif); }
.lang .short { display: none; }

/* Hero */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  background:
    radial-gradient(60% 55% at 85% 30%, var(--glow), transparent 70%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 100%);
  padding: clamp(40px, 7vw, 96px) 0 clamp(64px, 9vw, 120px);
  margin-top: -72px; padding-top: calc(72px + clamp(40px, 7vw, 96px));
}
[dir="rtl"] .hero { background: radial-gradient(60% 55% at 15% 30%, var(--glow), transparent 70%), linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 100%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
h1, h2, h3 { margin: 0; font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(2.75rem, 1.6rem + 4.2vw, 5.25rem); line-height: 1.02; letter-spacing: -.02em; }
[lang="ar"] h1 { line-height: 1.35; letter-spacing: 0; font-size: clamp(2.5rem, 1.5rem + 3.6vw, 4.5rem); }
.lede { margin: 24px 0 0; font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); color: var(--ink-2); max-width: 34em; text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* Live rate board: the page's proof. */
.rate {
  margin-top: 44px; max-width: 520px; padding: 20px 22px 18px;
  border-radius: 24px; background: var(--glass);
  border: 1px solid var(--stroke-soft); border-top-color: var(--stroke);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, .8);
}
.rate-head { display: flex; align-items: center; gap: 12px; font-size: 16px; color: var(--ink-2); flex-wrap: wrap; }
.rate-unit { margin-inline-start: auto; color: var(--ink-3); font-size: 15px; }
.live { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 9px; border-radius: 999px; background: rgba(126, 224, 161, .12); color: var(--live); font-weight: 700; font-size: 14px; }
[dir="rtl"] .live { padding: 4px 9px 4px 11px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.live.off { background: rgba(255, 255, 255, .06); color: var(--ink-3); }
.rate-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 14px 0 0; }
.rate-row div { padding: 10px 4px 2px; border-inline-start: 1px solid var(--stroke-soft); padding-inline-start: 14px; }
.rate-row div:first-child { border-inline-start: 0; padding-inline-start: 0; }
.rate-row dt { font-size: 14px; color: var(--ink-3); font-weight: 700; }
.rate-row dd { margin: 2px 0 0; font-size: clamp(1.35rem, 1rem + 1vw, 1.75rem); font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; line-height: 1.2; direction: ltr; text-align: start; }
[dir="rtl"] .rate-row dd { text-align: right; }
.rate-row dd.tick { animation: tick .9s var(--ease); }
@keyframes tick { from { color: var(--ink); } }
[data-rate-time] { color: var(--ink-3); }
.rate-note { margin: 10px 0 0; font-size: 14px; color: var(--ink-3); }

/* Phones: the app's real screens in a plain device frame. */
.phone {
  margin: 0; position: relative; width: min(330px, 100%); aspect-ratio: 390 / 844;
  border-radius: 46px; padding: 10px; background: #0E0A26;
  background-image: linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 32%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 40px 80px -30px rgba(0, 0, 0, .85), 0 18px 40px -20px rgba(0, 0, 0, .6);
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 36px; background: var(--bg-top); }

.hero-art { position: relative; display: grid; place-items: center; min-height: 640px; }
.hero-art .glow { position: absolute; inset: 10% 5%; background: radial-gradient(closest-side, rgba(232, 193, 90, .28), transparent); filter: blur(30px); z-index: -1; }
.phone-front { width: min(320px, 70%); z-index: 1; translate: 12% 0; }
.phone-back { position: absolute; width: min(270px, 58%); translate: -42% -4%; rotate: -6deg; opacity: .9; filter: saturate(.9) brightness(.8); }
[dir="rtl"] .phone-front { translate: -12% 0; }
[dir="rtl"] .phone-back { translate: 42% -4%; rotate: 6deg; }

/* Entrance: once, on the hero only. Content is visible without JS. */
.js .hero-copy > *, .js .hero-art .phone { animation: rise 1.1s var(--ease) both; }
.js .hero-copy > :nth-child(2) { animation-delay: .08s; }
.js .hero-copy > :nth-child(3) { animation-delay: .16s; }
.js .hero-copy > :nth-child(4) { animation-delay: .26s; }
.js .hero-art .phone-front { animation-delay: .18s; }
.js .hero-art .phone-back { animation: riseBack 1.3s var(--ease) .32s both; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); filter: blur(6px); } }
@keyframes riseBack { from { opacity: 0; transform: translateY(40px) scale(.96); } }

/* Feature sections: Z-pattern. */
.feature { padding: var(--section) 0; background: linear-gradient(180deg, #241978, #2E1F8C); }
.feature.alt { background: linear-gradient(180deg, #33228F, #4426A6); }
.z { display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); gap: clamp(40px, 7vw, 110px); align-items: center; }
.z.flip { grid-template-columns: minmax(0, 54fr) minmax(0, 46fr); }
.z.flip .z-copy { order: 2; }
/* Each feature: the app screen on the canvas, lit by the same amber glow as the hero. */
.art { position: relative; display: grid; justify-items: center; align-content: center; gap: 16px; padding: 40px 0; }
.art::before {
  content: ""; position: absolute; width: min(520px, 100%); aspect-ratio: 1; inset-block-start: 8%;
  background: radial-gradient(closest-side, var(--glow), transparent 72%);
}
.art .phone { position: relative; width: min(320px, 72%); }

.z-copy h2 { font-size: clamp(2rem, 1.3rem + 2.4vw, 3.25rem); line-height: 1.08; letter-spacing: -.015em; }
[lang="ar"] .z-copy h2 { line-height: 1.4; letter-spacing: 0; }
.z-copy > p { margin: 20px 0 0; color: var(--ink-2); font-size: clamp(1.08rem, 1rem + .3vw, 1.22rem); max-width: 32em; text-wrap: pretty; }

/* Price breakdown: the signature interaction. */
.calc { margin-top: 32px; max-width: 460px; padding: 22px; border-radius: 24px; background: var(--glass-strong); border: 1px solid var(--stroke-soft); border-top-color: var(--stroke); }
.karats { display: flex; gap: 6px; margin: 0 0 18px; padding: 4px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .05); width: fit-content; }
.karats legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.karats label { position: relative; }
.karats input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.karats span { display: block; padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 16px; color: var(--ink-2); transition: background-color .25s, color .25s; }
.karats input:checked + span { background: var(--ink); color: var(--on-gold); }
.karats input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.field { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px 12px; margin-bottom: 14px; }
.field label { color: var(--ink-2); font-size: 16px; }
.field output { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.field input[type="range"] { grid-column: 1 / -1; width: 100%; height: 28px; margin: 0; cursor: pointer; -webkit-appearance: none; appearance: none; background: transparent; }
.field input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--gold) var(--fill, 0%), rgba(255, 255, 255, .14) var(--fill, 0%)); }
.field input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .14); }
.field input[type="range"]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--gold); }
.field input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: var(--gold-light); border: 2px solid var(--on-gold); box-shadow: 0 2px 6px -1px rgba(0, 0, 0, .6); }
.field input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--gold-light); border: 2px solid var(--on-gold); box-shadow: 0 2px 6px -1px rgba(0, 0, 0, .6); }
[dir="rtl"] .field input[type="range"] { direction: rtl; }
[dir="rtl"] .field input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient(270deg, var(--gold) var(--fill, 0%), rgba(255, 255, 255, .14) var(--fill, 0%)); }
.sum { margin: 6px 0 0; border-top: 1px solid var(--stroke-soft); padding-top: 12px; }
.sum div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; color: var(--ink-2); }
.sum dd { margin: 0; font-variant-numeric: tabular-nums; color: var(--ink); }
.sum .total { margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--stroke-soft); }
.sum .total dt { color: var(--ink); font-weight: 700; }
.sum .total dd { color: var(--gold); font-size: 1.6rem; font-weight: 700; line-height: 1.1; transition: opacity .25s var(--ease); }
.sum .total dd.swap { opacity: .25; }
.calc.off .sum dd { color: var(--ink-3); }

/* Jewellers: a quieter, wider band with its own ground. */
.jewellers { padding: var(--section) 0; background: radial-gradient(70% 60% at 80% 50%, rgba(122, 64, 214, .5), transparent 70%), linear-gradient(180deg, #2A1D78, #241978); border-top: 1px solid var(--stroke-soft); }
[dir="rtl"] .jewellers { background: radial-gradient(70% 60% at 20% 50%, rgba(122, 64, 214, .5), transparent 70%), linear-gradient(180deg, #2A1D78, #241978); }
.perks { list-style: none; margin: 28px 0 36px; padding: 0; display: grid; gap: 16px; max-width: 32em; }
.perks li { display: flex; gap: 14px; align-items: flex-start; color: var(--ink-2); font-size: 1.1rem; }
.perks .ico { margin-top: .3em; color: var(--gold); width: 1.25em; height: 1.25em; }

/* Download close */
.download { padding: var(--section) 0; text-align: center; background: radial-gradient(50% 70% at 50% 100%, var(--glow), transparent 75%), linear-gradient(180deg, #241978, var(--bg-mid)); }
.download-in { display: flex; flex-direction: column; align-items: center; }
.download-word { display: flex; align-items: center; gap: 16px; margin: 0 0 28px; }
.download-word img { filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .45)); }
.download-word span { font: 700 clamp(3rem, 2rem + 3vw, 4.5rem)/1.1 var(--kufi); color: var(--gold); letter-spacing: .02em; }
.download-word .wm-ar { display: none; }
[lang="ar"] .download-word .wm-en { display: none; }
[lang="ar"] .download-word .wm-ar { display: inline; }
.download h2 { font-size: clamp(2.2rem, 1.4rem + 3vw, 3.75rem); line-height: 1.08; max-width: 14em; }
[lang="ar"] .download h2 { line-height: 1.4; }
.download p { margin: 18px 0 0; color: var(--ink-2); font-size: 1.2rem; max-width: 30em; }
.stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 36px 0 22px; }
.store {
  display: inline-flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 26px 10px 20px; border-radius: 999px;
  border: 1px solid var(--stroke); background: rgba(14, 10, 38, .55); color: var(--ink); text-align: start;
}
[dir="rtl"] .store { padding: 10px 20px 10px 26px; }
.store .ico { width: 26px; height: 26px; }
.store small { display: block; font-size: 13px; color: var(--gold); line-height: 1.2; }
.store b { display: block; font-size: 19px; line-height: 1.2; }

/* Footer */
.foot { background: var(--bg-deep); padding: 72px 0 0; color: var(--ink-2); }
.foot-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 40px; }
.foot-brand p { margin: 16px 0 0; max-width: 22em; font-size: 16px; color: var(--ink-3); }
.foot h3 { font-size: 16px; color: var(--ink); margin-bottom: 14px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 16px; }
.foot ul a { text-decoration: none; color: var(--ink-2); }
.foot ul a:hover { color: var(--gold-light); text-decoration: underline; }
.foot-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 56px; padding: 22px 0 28px; border-top: 1px solid var(--stroke-soft); font-size: 15px; color: var(--ink-3); }
.foot-bar p { margin: 0; }

/* Tablet */
@media (max-width: 960px) {
  .links { display: none; }
  .lang { margin-inline-start: auto; }
  .hero-grid, .z, .z.flip { grid-template-columns: 1fr; }
  .z.flip .z-copy { order: 0; }
  .hero-art { min-height: 0; padding: 12px 0 8px; }
  .foot-grid { grid-template-columns: repeat(2, 1fr); }
  .foot-brand { grid-column: 1 / -1; }
}

/* Phone */
@media (max-width: 560px) {
  body { font-size: 17px; }
  .nav-in { gap: 10px; height: 64px; }
  .wordmark { font-size: 22px; }
  .brand img { width: 30px; height: 30px; }
  .lang .long { display: none; }
  .lang .short { display: inline; }
  .lang { gap: 6px; padding: 0 12px; }
  .nav-cta { padding: 0 16px; }
  .lang { min-height: 40px; padding: 0 14px; }
  .hero { margin-top: -64px; padding-top: calc(64px + 36px); }
  .actions .btn { flex: 1 1 auto; }
  .rate { padding: 16px; }
  .rate-head { gap: 8px; }
  .rate-unit { margin-inline-start: 0; width: 100%; }
  .rate-row div { padding-inline-start: 8px; }
  .phone-front { width: 62%; translate: 14% 0; }
  .phone-back { width: 50%; translate: -48% -2%; }
  [dir="rtl"] .phone-front { translate: -14% 0; }
  [dir="rtl"] .phone-back { translate: 48% -2%; }
  .art { padding: 28px 0; }
  .art .phone { width: min(270px, 70%); }
  .calc { padding: 18px 16px; }
  .karats span { padding: 8px 13px; }
  .stores { flex-direction: column; width: 100%; }
  .store { justify-content: center; }
  .foot-bar { flex-direction: column-reverse; align-items: flex-start; }
  .foot-bar .lang { margin-inline-start: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------------------
   Sub-pages: support, privacy, delete account. The landing page's world at
   reading width. Everything here is scoped to .doc, which index.html never
   uses, so none of it can reach the landing page.
--------------------------------------------------------------------------- */
.doc {
  padding: clamp(44px, 7vw, 88px) 0 clamp(64px, 10vw, 120px);
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(90, 45, 181, .42), transparent 72%),
    var(--bg-night);
}
.doc-in { width: min(760px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.doc h1 { font-size: clamp(2.25rem, 1.5rem + 2.2vw, 3.25rem); line-height: 1.08; }
[lang="ar"] .doc h1 { line-height: 1.4; letter-spacing: 0; }
.doc-lead {
  margin: 18px 0 0; max-width: 34em;
  font-size: clamp(1.05rem, 1rem + .35vw, 1.25rem); color: var(--ink-2);
}
.doc-card {
  margin-top: 36px; padding: clamp(22px, 4vw, 36px);
  border: 1px solid var(--stroke); border-radius: 24px;
  background: var(--glass);
}
.doc-card h2 { font-size: 1.3rem; }
.doc-card > p { margin: 12px 0 0; color: var(--ink-2); }
.doc-mail {
  display: inline-block; margin-top: 4px;
  font: 700 clamp(1.15rem, 1rem + .7vw, 1.6rem)/1.3 var(--kufi);
  color: var(--gold-light); word-break: break-word;
}
.doc-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.doc-meta {
  list-style: none; margin: 34px 0 0; padding: 0;
  display: grid; gap: 14px; font-size: 1rem; color: var(--ink-3);
}
.doc-meta a { color: var(--gold-light); }
.doc-meta a:hover { color: var(--gold); }
.doc-note { margin: 30px 0 0; font-size: .95rem; color: var(--ink-3); }

/* Long-form policy prose: privacy and delete account. A .doc-card suits the
   support page's single short block; these two run to nine sections, where a
   stack of cards reads as heavier than the text it holds. Wrapped in
   .doc-body so .doc-card's own headings are never caught by these rules. */
.doc-body { margin-top: 34px; }
.doc-body > h2 {
  margin: 40px 0 0;
  font-size: clamp(1.15rem, 1rem + .5vw, 1.45rem);
  color: var(--gold-light);
}
.doc-body > h2:first-child { margin-top: 0; }
.doc-body p, .doc-body li { margin: 12px 0 0; color: var(--ink-2); }
.doc-body ol { margin: 12px 0 0; padding-inline-start: 1.4em; }
.doc-body a { color: var(--gold-light); }
.doc-body a:hover { color: var(--gold); }
