/* afitapp home page. The engine's own CSS sits in @layer sw, so these unlayered rules win. */
:root, .sw-root {
  --sw-bg: #0E1330;              /* the scenes' background, so posters and clips sit seamlessly */
  --sw-ink: #F4F6FB;
  --sw-ink-soft: #9AA3C4;
  --sw-accent: #FF6A52;
  --cobalt: #2F4BFF;
  --coral: #FF6A52;
  --sw-font-display: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --sw-font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
html { scroll-behavior: auto; color-scheme: dark; }
body { margin: 0; background: #0E1330; color: #F4F6FB; font-family: var(--sw-font-body); }
a { color: inherit; }

.skip { position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--cobalt); color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }

/* Header. Above the feature grid (z-index 70) that slides up after the film, so Log in stays
   reachable there, with a soft backing so it reads over the grid's text. */
.sw-topbar { z-index: 90; background: linear-gradient(180deg, rgba(14, 19, 48, .82), rgba(14, 19, 48, 0)); transition: background .25s; }
.past-film .sw-topbar { background: rgba(14, 19, 48, .94); backdrop-filter: blur(12px); box-shadow: 0 1px 0 rgba(154, 163, 196, .16); }
.hb { display: flex; align-items: center; }
.hb img { display: block; height: 35px; width: auto; }
.hr { display: flex; align-items: center; gap: 10px; }
.hl { font: inherit; font-size: .85rem; color: #F4F6FB; background: rgba(14, 19, 48, .55); backdrop-filter: blur(10px);
  border: 1px solid rgba(154, 163, 196, .35); border-radius: 999px; padding: 8px 12px; max-width: 11rem; cursor: pointer; }
.hl option { background: #0E1330; color: #F4F6FB; }
.hlogin { text-decoration: none; font-weight: 700; font-size: .92rem; color: #fff; background: var(--cobalt);
  padding: 10px 20px; border-radius: 999px; white-space: nowrap; box-shadow: 0 6px 20px rgba(47, 75, 255, .45); transition: transform .2s, background .2s; }
.hlogin:hover { transform: translateY(-1px); background: #4560ff; }
.sw-nav { background: rgba(14, 19, 48, .5); border-color: rgba(154, 163, 196, .22); }
.sw-nav__item { color: #C9CFE6; }
.sw-nav__item.is-active { color: #0E1330; }
@media (max-width: 1180px) { .sw-nav { display: none; } }
@media (max-width: 520px) {
  .hb img { height: 28px; }
  .hl { max-width: 7.5rem; padding: 7px 9px; font-size: .8rem; }
  .hlogin { padding: 9px 15px; font-size: .86rem; }
}

/* Copy */
.sw-copy__title { font-weight: 800; letter-spacing: -.02em; }
.sw-copy__eyebrow { letter-spacing: .14em; }
.sw-copy__num { color: #9AA3C4; }
.sw-copy__tags li { color: #F4F6FB; background: color-mix(in srgb, var(--sw-accent) 16%, rgba(14, 19, 48, .7));
  border-color: color-mix(in srgb, var(--sw-accent) 45%, transparent); backdrop-filter: blur(6px); }
.sw-btn--primary { background: var(--coral); color: #fff; box-shadow: 0 8px 26px rgba(255, 106, 82, .4); }
.sw-btn--ghost { color: #F4F6FB; border-color: rgba(244, 246, 251, .35); }
.sw-route__label { color: #0E1330; }
.sw-hint { color: #C9CFE6; }

/* Right to left (Arabic): copy, scrim and the route rail swap sides. */
[dir="rtl"] .sw-copy { left: auto; right: clamp(18px, 5vw, 64px); }
[dir="rtl"] .sw-copylayer::before { left: auto; right: 0; transform: scaleX(-1); }
[dir="rtl"] .sw-route { right: auto; left: clamp(14px, 2.4vw, 30px); }
[dir="rtl"] .sw-route__label { right: auto; left: 24px; }
[dir="rtl"] .sw-copy__eyebrow, [dir="rtl"] .sw-copy__num { letter-spacing: 0; }
[dir="rtl"] .sw-copy__num { display: inline-block; direction: ltr; unicode-bidi: isolate; }
@media (max-width: 860px) {
  [dir="rtl"] .sw-copy { left: clamp(18px, 5vw, 64px); right: clamp(18px, 5vw, 64px); }
  [dir="rtl"] .sw-copylayer::before { transform: none; }
  [dir="rtl"] .sw-route { left: 6px; }
}

/* Phones: lift the copy clear of the scroll hint. */
@media (max-width: 860px) {
  .sw-copy { bottom: calc(clamp(96px, 15dvh, 140px) + env(safe-area-inset-bottom)); }
}

/* After the film: the feature grid and the footer, sliding up over the last scene. */
.after { position: relative; z-index: 70; background: linear-gradient(180deg, rgba(14, 19, 48, 0) 0, #0E1330 120px);
  padding: 160px clamp(18px, 5vw, 64px) 48px; }
.after__in { max-width: 1120px; margin: 0 auto; }
.after__title { font: 800 clamp(2rem, 4.4vw, 3.2rem)/1.05 var(--sw-font-display); letter-spacing: -.02em; margin: 0; }
.after__sub { color: #9AA3C4; font-size: 1.1rem; margin: 14px 0 0; }
.grid { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.grid li { background: linear-gradient(160deg, rgba(47, 75, 255, .14), rgba(255, 255, 255, .03)); border: 1px solid rgba(154, 163, 196, .18);
  border-radius: 20px; padding: 22px 22px 24px; position: relative; overflow: hidden; }
.grid li::before { content: ""; display: block; width: 34px; height: 6px; border-radius: 3px; background: var(--c); margin-bottom: 16px; }
.grid h3 { margin: 0; font-size: 1.08rem; font-weight: 700; }
.grid p { margin: 8px 0 0; color: #B4BBD6; line-height: 1.5; font-size: .96rem; }
.after__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.btn { text-decoration: none; font-weight: 700; font-size: .98rem; padding: 14px 26px; border-radius: 999px; transition: transform .2s; }
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--coral); color: #fff; box-shadow: 0 8px 26px rgba(255, 106, 82, .35); }
.btn--ghost { color: #F4F6FB; border: 1.5px solid rgba(244, 246, 251, .3); }
.base { margin-top: 64px; padding-top: 28px; border-top: 1px solid rgba(154, 163, 196, .2); color: #9AA3C4; font-size: .9rem; line-height: 1.7; }
.base img { display: block; height: 32px; width: auto; margin-bottom: 14px; }
.base p { margin: 6px 0 0; }
.base a { color: #C9CFE6; text-decoration: none; }
.base a:hover { color: #fff; text-decoration: underline; }
.nojs { position: relative; z-index: 80; text-align: center; padding: 40px; }

/* The #debug panel (home.js): what the film is doing, for a screenshot from a phone. */
.dbg { position: fixed; left: 4px; right: 4px; top: 76px; z-index: 300; margin: 0; padding: 6px 8px; pointer-events: none;
  font: 11px/1.35 ui-monospace, Menlo, monospace; color: #b6ffb6; background: rgba(0, 0, 0, .78); border-radius: 8px;
  white-space: pre-wrap; word-break: break-all; }

/* The 3D world (world3d.js, home-3d/): its canvas sits under the copy, over the plain sky, and
   fades in once its shaders are ready. The empty clip scenes are not needed. */
.w3d-canvas { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 5; display: block;
  opacity: 0; transition: opacity 1.4s ease; pointer-events: none; }
.w3d-canvas.is-ready { opacity: 1; }
.w3d .sw-stage, .w3d .sw-particles { display: none; }
