/* FAST Calm Glass — shared styles for the FAST sub-pages.
   Tokens mirror fast_flutter lib/core/theme/calm_glass.dart. The home page (/index.html) keeps its own inline copy. */
@font-face { font-family: Tajawal; src: url('/assets/Tajawal-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Tajawal; src: url('/assets/Tajawal-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: Tajawal; src: url('/assets/Tajawal-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: Tajawal; src: url('/assets/Tajawal-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }

:root {
  color-scheme: light;
  --bd-1: #c9d1da; --bd-2: #d6d4e1; --bd-3: #e3dce8; --bd-4: #d3dcd6;
  --warm-field: #ead9ef; --cool-field: #d2e2e8;
  --frame: #ffffff6b; --card: #ffffff99; --control: #ffffff99; --badge: #ffffffeb;
  --border: #ffffffa6; --shadow: #282e4623; --shadow-soft: 0 20px 60px #282e461a;
  --opaque-frame: #e8e8ef; --opaque-card: #f1f1f5; --opaque-control: #fafafc;
  --dock: #ffffffd1;
  --ink: #1f2430; --muted: #51596a; --focus: #838996; --note: #72798935;
  --action: #262a33; --on-action: #fff; --action-hover: #3a3f4b;
  --pill-scheduled: #e4eaf4; --pill-scheduled-ink: #34538f;
  --pill-success: #d9ede1; --pill-success-ink: #245a41;
  --pill-active: #e9e2f2; --pill-active-ink: #514279;
  --pill-confirmed: #d4eae8; --pill-confirmed-ink: #215b60;
  --pill-warning: #f3e3b6; --pill-warning-ink: #5e440a;
  --grid: #51596a29;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bd-1: #121b2a; --bd-2: #1b2334; --bd-3: #292538; --bd-4: #222f31;
    --warm-field: #362b43; --cool-field: #263a48;
    --frame: #ffffff14; --card: #ffffff1f; --control: #ffffff0d; --badge: #e3e7ef;
    --border: #ffffff33; --shadow: #0c101940; --shadow-soft: 0 20px 60px #0c101952;
    --opaque-frame: #30384a; --opaque-card: #404959; --opaque-control: #505969;
    --dock: #2a3140e6;
    --ink: #f5f6fa; --muted: #d5dbe6; --focus: #b7c2d6; --note: #dbe2f070;
    --action: #e3e7ef; --on-action: #1f2430; --action-hover: #ffffff;
    --pill-scheduled: #31466b; --pill-scheduled-ink: #dce7ff;
    --pill-success: #244a3c; --pill-success-ink: #d7f3e3;
    --pill-active: #483b62; --pill-active-ink: #f1e6ff;
    --pill-confirmed: #244b53; --pill-confirmed-ink: #d0f2f0;
    --pill-warning: #59471f; --pill-warning-ink: #ffebb3;
    --grid: #eaeff829;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--ink); font: 400 18px/1.75 Tajawal, Inter, Arial, sans-serif; background: var(--bd-2); overflow-x: hidden; }
a { color: inherit; }
img { display: block; max-width: 100%; }
svg { display: block; }
[hidden] { display: none !important; }
.wrap { width: min(100% - 48px, 1200px); margin-inline: auto; }
.narrow { width: min(100% - 48px, 960px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; z-index: 80; top: -100px; inset-inline-start: 20px; padding: 12px 18px; border-radius: 999px; background: var(--badge); color: #1f2430; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
main, footer { position: relative; z-index: 1; overflow-x: clip; }

/* Backdrop */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(135deg, var(--bd-1) 0%, var(--bd-2) 45%, var(--bd-3) 70%, var(--bd-4) 100%); pointer-events: none; }
.field { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .85; will-change: transform; }
.field-warm { width: 560px; height: 560px; inset-inline-end: 4%; bottom: -14%; background: var(--warm-field); }
.field-cool { width: 520px; height: 520px; inset-inline-start: 2%; top: -12%; background: var(--cool-field); }

/* Glass */
.glass-frame { background: var(--frame); border: 1px solid var(--border); border-radius: 38px; box-shadow: var(--shadow-soft); -webkit-backdrop-filter: blur(26px); backdrop-filter: blur(26px); }
.glass-card { background: var(--card); border: 1px solid var(--border); border-radius: 26px; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-frame { background: var(--opaque-frame); }
  .glass-card { background: var(--opaque-card); }
  .site-header .nav { background: var(--opaque-card); }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .glass-frame { background: var(--opaque-frame); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .glass-card { background: var(--opaque-card); }
  .site-header .nav { background: var(--opaque-card); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Header dock */
.site-header { position: sticky; top: 0; z-index: 40; padding-top: 14px; }
.nav { display: flex; align-items: center; gap: 20px; min-height: 68px; padding: 10px 12px; padding-inline-start: 18px; border-radius: 999px; background: var(--dock); border: 1px solid var(--border); box-shadow: 0 10px 30px var(--shadow); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; text-decoration: none; }
.brand img { width: 42px; height: 42px; }
.brand-name { display: grid; direction: ltr; line-height: 1; }
.brand-name strong { font-size: 25px; font-weight: 800; letter-spacing: -.04em; }
.brand-name small { margin-top: 4px; color: var(--muted); font-size: 11px; letter-spacing: .14em; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-inline: auto; font-size: 15px; font-weight: 500; color: var(--muted); }
.nav-links a { padding: 10px 16px; border-radius: 999px; text-decoration: none; transition: background .2s, color .2s; }
.nav-links a:hover { background: var(--control); color: var(--ink); }
.nav > .btn { margin-inline-start: auto; }
.nav-links + .btn { margin-inline-start: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 26px; border-radius: 999px; font: inherit; font-size: 16px; font-weight: 700; line-height: 1.3; text-decoration: none; cursor: pointer; border: 0; transition: background .2s, box-shadow .25s, translate .25s var(--ease-out); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--action); color: var(--on-action); box-shadow: 0 10px 24px var(--shadow); }
.btn-primary:hover { background: var(--action-hover); translate: 0 -2px; }
.btn-secondary, .btn-ghost { background: var(--control); color: var(--ink); border: 1px solid var(--border); }
.btn-secondary:hover, .btn-ghost:hover { background: var(--badge); color: #1f2430; }
.btn-sm { min-height: 44px; padding: 8px 20px; font-size: 15px; }
.btn:active { scale: .98; }
.store-link { display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 22px; border-radius: 999px; background: var(--action); color: var(--on-action); text-decoration: none; transition: background .2s, translate .25s var(--ease-out); }
.store-link:hover { background: var(--action-hover); translate: 0 -2px; }
.store-link.alt, .store-link.android-link { background: var(--control); color: var(--ink); border: 1px solid var(--border); }
.store-link.alt:hover, .store-link.android-link:hover { background: var(--badge); color: #1f2430; }
.store-link svg { width: 24px; height: 24px; fill: currentColor; }
.store-link small { display: block; font-size: 12px; opacity: .8; }
.store-link strong { display: block; font-size: 18px; line-height: 1.2; }

/* Type */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--control); border: 1px solid var(--border); color: var(--muted); font-size: 14px; font-weight: 500; }
.eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(135deg, #ff7a00, #e82d62 40%, #075df5 70%, #02bf86); flex: none; }
h1 { font-size: clamp(36px, 4.4vw, 58px); font-weight: 700; line-height: 1.2; letter-spacing: -.035em; margin: 18px 0 14px; }
h1 .soft, .subtitle { display: block; color: var(--muted); font-weight: 500; }
h2 { margin: 14px 0 12px; font-size: clamp(28px, 3vw, 40px); font-weight: 700; line-height: 1.3; letter-spacing: -.03em; }
h3 { margin: 0 0 8px; font-size: 21px; font-weight: 700; line-height: 1.4; }
p { margin: 0 0 12px; }
.lead { color: var(--muted); font-size: 19px; line-height: 1.85; max-width: 640px; }
.muted { color: var(--muted); }
.text-link, .prose a { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--note); text-underline-offset: 5px; text-decoration-thickness: 1.5px; }
.text-link:hover, .prose a:hover { text-decoration-color: currentColor; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.pill-scheduled { background: var(--pill-scheduled); color: var(--pill-scheduled-ink); }
.pill-success { background: var(--pill-success); color: var(--pill-success-ink); }
.pill-active { background: var(--pill-active); color: var(--pill-active-ink); }
.pill-confirmed { background: var(--pill-confirmed); color: var(--pill-confirmed-ink); }
.pill-warning { background: var(--pill-warning); color: var(--pill-warning-ink); }
.badge-circle { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--badge); color: #1f2430; box-shadow: 0 8px 20px var(--shadow); margin-bottom: 18px; font-weight: 800; }
.badge-circle svg { width: 24px; height: 24px; }

/* Layout pieces */
.section { padding-block: 40px; scroll-margin-top: 90px; }
.page-hero { padding: clamp(28px, 5vw, 56px); margin-top: 28px; }
.section-head { max-width: 700px; margin-bottom: 30px; }
.section-head p { color: var(--muted); }
.prose { padding: clamp(24px, 4.5vw, 46px); }
.prose h2 { margin-top: 0; }
.prose h3 { margin: 28px 0 8px; }
.prose p, .prose li { color: var(--muted); }
.prose ul { padding-inline-start: 1.3em; margin: 8px 0 16px; }
.prose li { margin: 6px 0; padding-inline-start: .15em; }
.callout { margin-top: 20px; padding: 16px 20px; border-radius: 18px; background: var(--card); border: 1px solid var(--border); border-inline-start: 4px solid var(--ink); color: var(--ink); }
.lang-nav { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
.lang-nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 18px; border-radius: 999px; background: var(--control); border: 1px solid var(--border); text-decoration: none; font-size: 15px; font-weight: 700; }
.lang-nav a:hover { background: var(--badge); color: #1f2430; }
.stack { display: grid; gap: 18px; }

/* Footer */
footer { padding-block: 32px 40px; }
.footer-frame { padding: 28px 32px 20px; }
.footer-grid { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.footer-copy { margin: 12px 0 0; color: var(--muted); font-size: 15px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 15px; max-width: 560px; color: var(--muted); }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }
.copyright { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--grid); color: var(--muted); font-size: 14px; }
.motion-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--control); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.motion-toggle:hover { background: var(--card); }
.motion-toggle svg { width: 16px; height: 16px; }

/* ═════════ Motion ═════════ */
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes frame-in { from { opacity: 0; transform: translateY(30px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes drift-a { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-60px, 40px) scale(1.08); } 100% { transform: translate(30px, -30px) scale(.96); } }
@keyframes drift-b { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(70px, -30px) scale(.94); } 100% { transform: translate(-30px, 40px) scale(1.06); } }
@keyframes spin-in { from { opacity: 0; transform: rotate(-200deg) scale(.3); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(0); } 70% { transform: scale(1.25); } 100% { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: no-preference) {
  .field-warm { animation: drift-a 34s ease-in-out infinite alternate; }
  .field-cool { animation: drift-b 40s ease-in-out infinite alternate; }
  .site-header .nav { animation: rise .7s var(--ease-out) backwards; }
  .page-hero { animation: frame-in .9s var(--ease-out) .05s backwards; }
  .page-hero > * { animation: rise .8s var(--ease-out) backwards; }
  .page-hero > :nth-child(2) { animation-delay: .12s; }
  .page-hero > :nth-child(3) { animation-delay: .22s; }
  .page-hero > :nth-child(4) { animation-delay: .32s; }
  .page-hero > :nth-child(5) { animation-delay: .42s; }
  .page-hero > :nth-child(n+6) { animation-delay: .5s; }
  .spin-in { animation: spin-in 1.1s var(--ease-out) .2s backwards; }
  .motion-paused *, .motion-paused *::before, .motion-paused *::after { animation-play-state: paused !important; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .motion-toggle { display: none; }
}

/* Scroll-driven motion — html.scrolly is set only when motion is allowed */
.scroll-progress { position: fixed; top: 0; inset-inline: 0; z-index: 70; height: 3px; transform-origin: right; transform: scaleX(var(--sp, 0)); background: linear-gradient(270deg, #ff7a00, #e82d62 35%, #4a45cf 60%, #075df5 80%, #02bf86); pointer-events: none; }
.flyers { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
html:not(.scrolly) .scroll-progress, html:not(.scrolly) .flyers { display: none; }
.fb { position: absolute; top: 0; left: 0; border-radius: 50%; will-change: transform; box-shadow: inset -4px -6px 12px #0000002e, 0 12px 26px #282e4626; }
.fb-red { background: radial-gradient(circle at 30% 25%, #fff9d9, #ffb92f 25%, #ff6505 52%, #d90d00); }
.fb-blue { background: radial-gradient(circle at 30% 25%, #e4fbff, #23befc 28%, #0479f6 56%, #0032bd); }
.fb-yellow { background: radial-gradient(circle at 30% 25%, #fffde0, #ffd83f 28%, #ffb800 56%, #e96900); }
.fb-green { background: radial-gradient(circle at 30% 25%, #e4ffe9, #47e47e 28%, #0ac756 56%, #007b2c); }
.fb.far { filter: blur(2px); opacity: .6; }

html.scrolly [data-fly] { --r: 1; --o: 0; --p: 0; transform: perspective(1200px) translate3d(calc(var(--fx, 0px) * var(--r)), calc(var(--fy, 0px) * var(--r) + var(--p) * var(--py, 0px) - var(--o) * 110px), 0) rotateX(calc(var(--rx, 0deg) * var(--r) - var(--o) * 34deg)) rotateY(calc(var(--ry, 0deg) * var(--r) + var(--p) * var(--pry, 0deg))) rotate(calc(var(--rz, 0deg) * var(--r))) skewY(calc(var(--v, 0) * 1deg)) scale(calc(1 - var(--fs, 0) * var(--r) - var(--o) * .18)); opacity: calc(1 - var(--r) * var(--fo, 1) - var(--o) * .6); will-change: transform, opacity; }
[data-fly="rise"] { --fy: 180px; --fs: .14; --rx: 32deg; transform-origin: 50% 100%; }
[data-fly="soft"] { --fy: 120px; --fs: .06; --rx: 12deg; transform-origin: 50% 0; }
[data-fly="flip-up"] { --fy: 160px; --rx: 100deg; --rz: 8deg; --fo: .9; transform-origin: 50% 100%; }
[data-fly="from-start"] { --fx: 520px; --ry: -60deg; --rz: 14deg; --py: 50px; }
[data-fly="from-end"] { --fx: -520px; --ry: 60deg; --rz: -14deg; --py: -50px; }
[data-fly="page-start"] { --ry: 120deg; --fy: 60px; --fo: .4; transform-origin: 100% 50%; }
[data-fly="page-end"] { --ry: -120deg; --fy: 60px; --fo: .4; transform-origin: 0 50%; }
[data-fly="zoom-tilt"] { --fx: -380px; --ry: -70deg; --rz: -10deg; --fs: .45; --pry: -16deg; --py: 70px; }
html.scrolly .badge-circle { rotate: calc(var(--r, 0) * -180deg); }
html.scrolly h1 .w, html.scrolly h2 .w { display: inline-block; transform-origin: 50% 100%; transform: translate3d(calc(var(--r, 0) * var(--wx, 0px)), calc(var(--r, 0) * (70px + var(--i) * 34px)), 0) rotate(calc(var(--r, 0) * var(--wr, 14deg))) scale(calc(1 - var(--r, 0) * .45)); opacity: calc(1 - var(--r, 0) * 1.6); }

/* Responsive */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav { justify-content: space-between; }
  .footer-grid { flex-direction: column; }
  [data-fly="from-start"] { --fx: 240px; }
  [data-fly="from-end"] { --fx: -240px; }
  [data-fly="zoom-tilt"] { --fx: -160px; }
}
@media (max-width: 560px) {
  .wrap, .narrow { width: calc(100% - 24px); }
  body { font-size: 17px; }
  .site-header { padding-top: 10px; }
  .nav { min-height: 60px; padding: 8px; padding-inline-start: 14px; gap: 10px; }
  .brand img { width: 36px; height: 36px; }
  .brand-name strong { font-size: 22px; }
  .brand-name small { font-size: 10px; }
  .nav > .btn { font-size: 13px; padding-inline: 14px; }
  .glass-frame { border-radius: 30px; }
  .glass-card { border-radius: 22px; }
  .page-hero { padding: 26px 18px; margin-top: 16px; }
  .prose { padding: 24px 18px; }
  .lead { font-size: 17px; }
  .section { padding-block: 22px; }
  .footer-frame { padding: 22px 18px 16px; }
  .store-link { width: 100%; }
}
