/* Liwan, second option: the futuristic layer. Loaded last on every page. */

html {
  background: var(--brick);
  scrollbar-color: #2a3160 var(--brick);
}
body {
  background: var(--brick);
  color: var(--ink);
  font-weight: 350;
  letter-spacing: 0.005em;
}
:lang(ar) body {
  letter-spacing: 0;
  font-weight: 380;
}

/* A slow aurora behind everything, and film grain over it. */
body::before {
  content: '';
  position: fixed;
  inset: -20vmax;
  z-index: -2;
  background:
    radial-gradient(38vmax 30vmax at 12% 8%, rgba(139, 92, 255, 0.22), transparent 70%),
    radial-gradient(34vmax 28vmax at 88% 18%, rgba(34, 230, 255, 0.14), transparent 70%),
    radial-gradient(40vmax 30vmax at 70% 92%, rgba(255, 61, 154, 0.12), transparent 70%),
    var(--brick);
  animation: aurora 28s ease-in-out infinite alternate;
  pointer-events: none;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes aurora {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  100% {
    transform: translate3d(-4vmax, 3vmax, 0) rotate(8deg);
  }
}

::selection {
  background: var(--cyan);
  color: #04050a;
}
.night ::selection {
  background: var(--cyan);
  color: #04050a;
}
:focus-visible {
  outline-color: var(--cyan);
}
::-webkit-scrollbar-track {
  background: var(--brick);
}
::-webkit-scrollbar-thumb {
  background: #2a3160;
  border-color: var(--brick);
}

/* ---------- Type ---------- */

h1,
h2,
h3,
h4 {
  font-weight: 600;
  letter-spacing: -0.025em;
}
h1 {
  font-size: clamp(2.3rem, 4.6vw, 4.9rem);
  line-height: 1.04;
}
h2 {
  font-size: clamp(1.8rem, 3.2vw, 3.3rem);
  line-height: 1.08;
}
h3 {
  font-size: clamp(1.1rem, 1.4vw, 1.3rem);
  letter-spacing: -0.01em;
}
:lang(ar) h1,
:lang(ar) h2,
:lang(ar) h3,
:lang(ar) h4 {
  font-family: 'Readex Pro', sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}
.lead {
  color: var(--ink-soft);
  font-weight: 300;
}
.label {
  font-stretch: 100%;
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}
.soft,
.plaster .soft {
  color: var(--ink-soft);
}
/* Vivid accents carried by one word. */
.hl {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.c-cyan {
  color: var(--cyan);
}
.c-lime {
  color: var(--lime);
}
.c-magenta {
  color: var(--magenta);
}
.c-amber {
  color: var(--amber);
}
.c-violet {
  color: var(--violet);
}

/* ---------- Header: glass bar, pill stations ---------- */

.route,
.route[data-tone='night'] {
  background: rgba(6, 7, 13, 0.62);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  color: var(--ink);
  border-block-end: 1px solid var(--line);
}
.stations::before {
  display: none;
}
.stations li,
.stations li:first-child,
.stations li:last-child {
  flex: none;
  justify-content: center;
}
.stations {
  justify-content: center;
  gap: 0.2rem;
}
.stations a,
.route[data-tone='night'] .stations a {
  --station-bg: transparent;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  color: var(--ink-soft);
  font-size: 0.93rem;
}
.stations a::before {
  display: none;
}
.stations a:hover {
  color: var(--ink);
  background: rgba(160, 175, 255, 0.08);
}
.stations a[aria-current='page'] {
  color: var(--ink);
  background: rgba(34, 230, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(34, 230, 255, 0.4);
}
.lang {
  border-color: var(--line);
  border-radius: 999px;
}
.lang button[aria-pressed='true'],
.route[data-tone='night'] .lang button[aria-pressed='true'] {
  background: var(--ink);
  color: #04050a;
  border-radius: 999px;
}
.brand-mark {
  color: var(--ink);
}
.brand-word {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.brand-word small {
  color: var(--cyan);
  opacity: 1;
}
@media (max-width: 1080px) {
  .route.open .stations,
  .route[data-tone='night'].open .stations {
    background: rgba(6, 7, 13, 0.97);
    align-items: stretch;
  }
  .route.open .stations a {
    justify-content: flex-start;
  }
  .menu-btn {
    border-color: var(--line);
    border-radius: 999px;
  }
}

/* ---------- Buttons ---------- */

.btn,
.btn-gold,
.route .btn:not(.btn-line),
.route[data-tone='night'] .btn:not(.btn-line),
.hero.night .btn:not(.btn-line) {
  --b-bg: var(--cyan);
  --b-fg: #03040a;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  background: var(--b-bg);
  color: var(--b-fg);
  box-shadow: 0 0 0 1px rgba(34, 230, 255, 0.5), 0 10px 30px -10px rgba(34, 230, 255, 0.6);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%) -150% 0 / 220% 100% no-repeat;
  transition: background-position 0.8s var(--ease-out);
}
.btn:hover::after {
  background-position: 150% 0;
}
.btn:hover {
  box-shadow: 0 0 0 1px rgba(34, 230, 255, 0.7), 0 16px 40px -10px rgba(34, 230, 255, 0.8);
}
.btn-line,
.btn.btn-line {
  --b-bg: transparent;
  --b-fg: var(--ink);
  background: rgba(160, 175, 255, 0.05);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink-line);
}
.btn-line:hover {
  box-shadow: inset 0 0 0 1px var(--cyan), 0 0 24px -8px rgba(34, 230, 255, 0.6);
}
.btn-sm {
  min-height: 38px;
}
.go {
  border-block-end-color: rgba(34, 230, 255, 0.5);
}
.go:hover {
  color: var(--cyan);
}

/* ---------- Fields ---------- */

.input,
.select,
.textarea,
.phone-input,
.night .phone-input,
.hero.night .phone-input {
  background: rgba(13, 17, 36, 0.8);
  border: 1px solid var(--ink-line);
  color: var(--ink);
  border-radius: 14px;
}
.phone-input input,
.night .phone-input input {
  color: var(--ink);
}
.input::placeholder,
.textarea::placeholder,
.phone-input input::placeholder {
  color: #7f87b3;
}
.input:focus,
.select:focus,
.textarea:focus,
.phone-input:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 230, 255, 0.22);
}
.phone-input .cc {
  border-color: var(--ink-line);
  color: var(--cyan);
}
.select option {
  background: #0d1124;
  color: var(--ink);
}

/* ---------- Grounds ---------- */

.day {
  background: transparent;
}
.plaster {
  background: linear-gradient(180deg, rgba(18, 22, 41, 0.55), rgba(10, 12, 24, 0.55));
  border-block: 1px solid var(--line);
}
.night {
  background: rgba(7, 9, 18, 0.85);
  color: var(--ink);
}
.screen-band,
.screen-band.dark {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), var(--magenta), transparent);
  box-shadow: 0 0 22px 2px rgba(139, 92, 255, 0.45);
  opacity: 0.8;
}

/* Glass surfaces for every raised element. */
.tile,
.mini,
.record,
.sheet,
.title-block,
.router,
.reveal,
.hero-dial {
  border-color: var(--line);
}
.tile {
  background: rgba(20, 25, 50, 0.85);
  border-color: var(--line);
  border-radius: 14px;
}
.tile-gold {
  background: var(--cyan);
  color: #04050a;
}
.chip-solid {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #04050a;
}
.chip-ink {
  background: var(--ink);
  border-color: var(--ink);
  color: #04050a;
}

/* Device frames: the app's own navy, set in a glowing bezel. */
.device {
  background: #0b1020;
  border: 9px solid #161b33;
  box-shadow: 0 0 0 1px rgba(160, 175, 255, 0.18), 0 40px 90px -30px rgba(0, 0, 0, 0.9), 0 0 80px -20px rgba(139, 92, 255, 0.45);
}

.schedule th,
.schedule td {
  border-color: var(--ink-line);
}
.schedule thead th {
  border-block-start-color: var(--cyan);
  color: var(--ink-soft);
}
.schedule tbody th {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1rem;
}
:lang(ar) .schedule tbody th {
  font-family: 'Readex Pro', sans-serif;
  font-weight: 600;
}
.coming {
  color: var(--amber);
}
.ticks li .ic,
.night .ticks li .ic {
  color: var(--cyan);
}

/* Close band: a moving colour field instead of brick windows. */
.close-windows {
  background:
    radial-gradient(40% 50% at 70% 50%, rgba(34, 230, 255, 0.55), transparent 70%),
    radial-gradient(40% 50% at 85% 30%, rgba(139, 92, 255, 0.6), transparent 70%),
    radial-gradient(40% 60% at 80% 80%, rgba(255, 61, 154, 0.45), transparent 70%);
  filter: blur(20px);
  opacity: 0.9;
  animation: drift 14s ease-in-out infinite alternate;
}
@keyframes drift {
  to {
    transform: translate3d(-6%, 4%, 0) scale(1.08);
  }
}

/* Next stop. */
.next-stop {
  background: transparent;
  border-color: var(--line);
}
.ns-mark {
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  height: 2px;
}
.ns-mark::before {
  border-color: var(--cyan);
  background: var(--brick);
  box-shadow: 0 0 16px rgba(34, 230, 255, 0.7);
}
.next-stop a:hover .ns-mark::before {
  background: var(--cyan);
}
.ns-title {
  font-weight: 600;
  letter-spacing: -0.03em;
}
.ns-line {
  color: var(--ink-soft);
}

/* Footer. */
.foot {
  background: #04050a;
  color: var(--ink);
  border-block-start: 1px solid var(--line);
}
.foot .soft {
  color: var(--ink-soft);
}
.foot .brand-mark {
  color: var(--ink);
}

/* 3D overlays. */
.plan-label {
  color: var(--ink);
  background: rgba(8, 10, 22, 0.78);
  border: 1px solid rgba(34, 230, 255, 0.35);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  backdrop-filter: blur(6px);
}
.plan-label::after {
  background: rgba(34, 230, 255, 0.6);
}
.tip3d {
  background: rgba(10, 13, 28, 0.92);
  color: var(--ink);
  border: 1px solid rgba(34, 230, 255, 0.4);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 30px -8px rgba(34, 230, 255, 0.5);
}
.tip3d::after {
  background: rgba(10, 13, 28, 0.92);
}

/* ---------- Motion helpers ---------- */

.js-anim [data-rise] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js-anim [data-rise].in {
  opacity: 1;
  transform: none;
}
/* A light that follows the pointer across glass panels. */
.spot {
  position: relative;
  isolation: isolate;
}
.spot::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(34, 230, 255, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.spot:hover::before {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  .close-windows {
    animation: none;
  }
  .js-anim [data-rise] {
    opacity: 1;
    transform: none;
  }
}

/* Zoom buttons on every 3D view for touch and small screens (the map page has its own toolbar). */
.zoomctl {
  position: absolute;
  z-index: 6;
  inset-block-end: 0.9rem;
  inset-inline-end: 0.9rem;
  display: none;
  flex-direction: column;
  gap: 0.4rem;
}
.zoomctl button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(34, 230, 255, 0.45);
  background: rgba(8, 10, 22, 0.82);
  color: var(--ink);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 20px -8px rgba(34, 230, 255, 0.7);
  cursor: pointer;
}
.zoomctl button:active {
  background: rgba(34, 230, 255, 0.2);
}
@media (max-width: 900px), (pointer: coarse) {
  .zoomctl {
    display: flex;
  }
}

.close-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.close-cta .btn {
  min-height: 54px;
  padding-inline: 1.8rem;
  font-size: 1.05rem;
}

/* The hidden attribute always wins over component display rules. */
[hidden] {
  display: none !important;
}

/* ---------- Arabic type room ---------- */

/* The Arabic wordmark: the small «لايف» sits clear of the last letter of «ليوان». */
:lang(ar) .brand-word {
  letter-spacing: 0;
  white-space: nowrap;
}
:lang(ar) .brand-word small {
  display: inline-block;
  margin-inline-start: 0.5em;
  vertical-align: 0.7em;
}
/* Arabic letters reach further above and below the line than Latin: large text gets taller lines. */
:lang(ar) .ns-title {
  line-height: 1.45;
}
:lang(ar) .ns-text {
  gap: 0.5rem;
}
:lang(ar) h1,
:lang(ar) h2 {
  line-height: 1.42;
}
:lang(ar) h3 {
  line-height: 1.45;
}
:lang(ar) .btn {
  line-height: 1.4;
}
:lang(ar) .label,
:lang(ar) caption {
  line-height: 1.6;
}
:lang(ar) .alarm-title,
:lang(ar) .lead {
  line-height: 1.7;
}
:lang(ar) .seg button,
:lang(ar) .lens-tabs button,
:lang(ar) .lens-row button {
  line-height: 1.5;
}
