/**
 * Shared marketing shell (landing / pricing) — Neural Noir
 * Complements app.css tokens; warm gold accent, no purple neon.
 * Fonts: load via <link> in page templates (avoid CSS @import render-block).
 */

html.i18n-switching body {
  visibility: hidden;
}

.landing-page {
  --deep: #0b1220;
  font-family: 'Manrope', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--canvas, #1b2436);
  color: var(--text, #f1f5f9);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.landing-page .font-display,
.landing-page .landing-nav-brand .auth-logo-text {
  font-family: 'Manrope', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  font-weight: 800;
}

.landing-page .landing-hero-title {
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
  text-wrap: balance;
}

html.ui-script-latin .landing-page .landing-hero-title {
  font-size: clamp(1.85rem, 4.2vw, 3rem);
  line-height: 1.15;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

.landing-container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.landing-container--wide {
  max-width: 1280px;
}

/* Atmosphere */
.landing-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.landing-bg-grid {
  position: absolute;
  inset: 0;
  opacity: 0.6;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at center, black, transparent 80%);
}

.landing-bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  will-change: transform, opacity;
}

.landing-bg-glow--1 {
  top: -20%;
  left: 5%;
  width: 600px;
  height: 600px;
  opacity: 0.1;
  background: radial-gradient(circle, #b8956c 0%, transparent 70%);
  animation: landing-glow-drift-a 22s ease-in-out infinite alternate;
}

.landing-bg-glow--2 {
  bottom: -10%;
  right: 10%;
  width: 500px;
  height: 500px;
  opacity: 0.06;
  background: radial-gradient(circle, #c9a87c 0%, transparent 70%);
  animation: landing-glow-drift-b 28s ease-in-out infinite alternate;
}

@keyframes landing-glow-drift-a {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.09;
  }
  100% {
    transform: translate3d(4%, 3%, 0) scale(1.06);
    opacity: 0.12;
  }
}

@keyframes landing-glow-drift-b {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.05;
  }
  100% {
    transform: translate3d(-3%, -4%, 0) scale(1.08);
    opacity: 0.08;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-bg-glow--1,
  .landing-bg-glow--2,
  .hero-glow-1,
  .hero-glow-2 {
    animation: none !important;
  }
}

/* Landing page hero glows (Tailwind-positioned siblings) */
.hero-glow-1,
.hero-glow-2 {
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  will-change: transform, opacity;
}

.hero-glow-1 {
  background: radial-gradient(circle, #b8956c 0%, transparent 70%);
  opacity: 0.1;
  animation: landing-glow-drift-a 22s ease-in-out infinite alternate;
}

.hero-glow-2 {
  background: radial-gradient(circle, #c9a87c 0%, transparent 70%);
  opacity: 0.06;
  animation: landing-glow-drift-b 28s ease-in-out infinite alternate;
}

.landing-hero-accent {
  background: linear-gradient(120deg, #d4c0a5 0%, #b8956c 55%, #c9a87c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-hero-cta-secondary {
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: rgba(241, 245, 249, 0.72) !important;
  font-weight: 600 !important;
}

.landing-hero-cta-secondary:hover {
  border-color: rgba(255, 255, 255, 0.28) !important;
  color: #f1f5f9 !important;
}

/* Nav */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(11, 18, 32, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.landing-nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
  /* Match homepage glass-nav (Tailwind h-16 = 4rem) */
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Self-contained: landing does not load app.css (.auth-logo lives there). */
.landing-nav .auth-logo,
.landing-nav-brand.auth-logo {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.landing-nav .auth-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: rgba(184, 149, 108, 0.12);
  border: 1px solid rgba(184, 149, 108, 0.28);
  color: var(--accent, #b8956c);
  box-shadow: none;
  flex-shrink: 0;
}

.landing-nav .auth-logo-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.15;
}

.landing-nav .auth-logo-text {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f1f5f9;
}

.landing-nav .auth-logo-tagline {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #94a3b8);
}

.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.landing-nav-links a {
  color: var(--muted, #94a3b8);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

.landing-nav-links a:hover,
.landing-nav-links a[aria-current='page'] {
  color: #f1f5f9;
}

.landing-nav-links a[aria-current='page'] {
  color: var(--accent-soft, #d4c0a5);
}

/* Sticky nav offset for in-page section jumps */
.landing-page #showcase,
.landing-page #workflow,
.landing-page #download {
  scroll-margin-top: 4.75rem;
}

.landing-nav-actions .landing-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.landing-nav-actions .landing-lang-switch svg {
  flex-shrink: 0;
}

.landing-nav-actions {
  position: relative;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Language dropdown — layout.js injects .lang-switch-*; landing-page does not load mobile-nav.css */
.landing-page [data-lang-switch] {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  cursor: pointer;
}

.landing-page [data-lang-switch] svg {
  pointer-events: none;
}

.landing-page .lang-switch-wrap {
  position: relative;
  z-index: 60;
  flex-shrink: 0;
}

.landing-page .lang-switch-wrap--auth .lang-switch-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  inset-inline-end: 0;
  inset-inline-start: auto;
  z-index: 70;
  direction: ltr;
  text-align: left;
  display: grid;
  grid-auto-flow: row;
  grid-auto-rows: minmax(2.4rem, max-content);
  align-content: start;
  gap: 0.2rem;
  box-sizing: border-box;
  width: 12.75rem;
  min-width: 12.75rem;
  max-width: min(14rem, calc(100vw - 1.5rem));
  max-height: min(18rem, 55vh);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.45rem;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  background: #273041;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
  -webkit-overflow-scrolling: touch;
}

.landing-page .lang-switch-menu[hidden],
.landing-page .lang-switch-menu:not(.is-open) {
  display: none;
}

.landing-page .lang-switch-menu-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: left;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 100%;
  min-height: 2.4rem;
  height: auto;
  margin: 0;
  padding-block: 0.65rem;
  padding-inline: 1.05rem 0.95rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.landing-page .lang-switch-menu-item-label {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}

.landing-page .lang-switch-menu-item:hover,
.landing-page .lang-switch-menu-item:focus-visible {
  background: rgba(255, 255, 255, 0.045);
  color: #fff;
  outline: none;
}

.landing-page .lang-switch-menu-item[aria-selected="true"] {
  padding-inline-start: 1.15rem;
  background: rgba(184, 149, 108, 0.07);
  color: #d4c0a5;
  font-weight: 600;
}

.landing-page .lang-switch-menu-item[aria-selected="true"]::before {
  content: '';
  position: absolute;
  inset-inline-start: 0.35rem;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 2px;
  border-radius: 1px;
  background: #b8956c;
}

.landing-nav-actions .btn-ghost-primary,
.landing-nav-actions .btn-outline-primary {
  --tblr-btn-color: var(--muted, #94a3b8);
  --tblr-btn-hover-color: #f1f5f9;
  border-color: transparent;
  color: var(--muted, #94a3b8);
}

.landing-nav-actions .btn-primary {
  --tblr-btn-bg: var(--accent, #b8956c);
  --tblr-btn-border-color: var(--accent, #b8956c);
  --tblr-btn-hover-bg: var(--accent-soft, #d4c0a5);
  --tblr-btn-hover-border-color: var(--accent-soft, #d4c0a5);
  --tblr-btn-color: var(--canvas, #1b2436);
  background: var(--accent, #b8956c) !important;
  border-color: var(--accent, #b8956c) !important;
  color: var(--canvas, #1b2436) !important;
  font-weight: 700;
}

.landing-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
  flex-shrink: 0;
}

.landing-nav-toggle-bar {
  display: block;
  height: 2px;
  width: 1.25rem;
  margin: 0 auto;
  background: currentColor;
  border-radius: 1px;
}

.landing-nav-drawer {
  display: none;
  position: fixed;
  inset-inline: 0;
  top: 4rem;
  z-index: 40;
  padding: 1rem 1.5rem;
  background: rgba(11, 18, 32, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.landing-nav-drawer a {
  display: block;
  padding: 0.55rem 0;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
}

.landing-nav-drawer a:hover,
.landing-nav-drawer a[aria-current='page'] {
  color: #f1f5f9;
}

.landing-nav-drawer-cta {
  display: inline-block !important;
  margin-top: 0.5rem;
  padding: 0.5rem 1rem !important;
  border-radius: 0.375rem;
  background: var(--accent, #b8956c);
  color: var(--canvas, #1b2436) !important;
  font-weight: 700;
}

.landing-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: 4rem;
  z-index: 30;
  background: rgba(0, 0, 0, 0.5);
}

.landing-footer {
  position: relative;
  z-index: 1;
  padding: 2.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(11, 18, 32, 0.4);
}

.landing-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.landing-footer-brand {
  text-align: start;
}

.landing-footer-copy {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted, #94a3b8);
}

.landing-footer-tagline {
  margin: 0.25rem 0 0;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
}

.landing-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1rem 2rem;
}

.landing-footer a {
  color: var(--muted, #94a3b8);
  text-decoration: none;
  font-size: 0.875rem;
}

.landing-footer a:hover {
  color: #f1f5f9;
}

.landing-page .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;
}

/* Fallback when Tabler is not loaded (landing page) */
.landing-nav-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  line-height: 1.25;
  cursor: pointer;
  background: transparent;
  color: inherit;
}

.landing-nav-actions .btn-sm {
  padding: 0.3rem 0.75rem;
  font-size: 0.8125rem;
}

.landing-nav-actions .btn-ghost-secondary {
  color: var(--muted, #94a3b8);
}

.landing-nav-actions .btn-ghost-secondary:hover {
  color: #f1f5f9;
}

@media (max-width: 768px) {
  .landing-nav-links {
    display: none;
  }

  .landing-nav-toggle {
    display: flex;
    order: 2;
  }

  .landing-nav-actions {
    order: 3;
  }

  .landing-nav-actions .btn-ghost-primary {
    display: none;
  }

  .landing-nav .auth-logo-tagline {
    display: none;
  }

  .landing-nav-drawer:not([hidden]),
  .landing-nav-backdrop:not([hidden]) {
    display: block;
  }

  body.landing-nav-open {
    overflow: hidden;
  }

  .landing-footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .landing-footer-brand {
    text-align: center;
  }

  .landing-footer-nav {
    justify-content: center;
  }

  .landing-bg-glow--1 {
    width: 300px;
    height: 300px;
    filter: blur(80px);
    top: -10%;
  }

  .landing-bg-glow--2 {
    display: none;
  }
}

/* —— RTL (Arabic) —— */
html[dir='rtl'],
html[lang='ar'] {
  --landing-text-align-start: right;
}

html[dir='rtl'] .landing-nav-inner,
html[lang='ar'] .landing-nav-inner {
  flex-direction: row;
}

html[dir='rtl'] .landing-nav-links,
html[lang='ar'] .landing-nav-links {
  gap: 1.25rem;
}

html[dir='rtl'] .landing-nav-actions,
html[lang='ar'] .landing-nav-actions {
  gap: 0.625rem;
}

html[dir='rtl'] .landing-hero-title,
html[lang='ar'] .landing-hero-title {
  font-family: 'Noto Sans Arabic', 'Manrope', 'PingFang SC', sans-serif;
  line-height: 1.35;
  letter-spacing: 0;
  text-wrap: pretty;
  overflow-wrap: anywhere;
  hyphens: none;
}

html[dir='rtl'] .landing-hero-title .latin,
html[lang='ar'] .landing-hero-title .latin {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

html[dir='rtl'] .landing-hero-copy,
html[lang='ar'] .landing-hero-copy {
  text-align: start;
}

html[dir='rtl'] .landing-hero-copy .landing-hero-desc-block,
html[lang='ar'] .landing-hero-copy .landing-hero-desc-block {
  text-align: start;
  margin-inline: 0;
}

html[dir='rtl'] .landing-hero-cta-row,
html[lang='ar'] .landing-hero-cta-row {
  justify-content: center;
}

@media (min-width: 1024px) {
  html[dir='rtl'] .landing-hero-cta-row,
  html[lang='ar'] .landing-hero-cta-row {
    justify-content: flex-start;
  }
}

html[dir='rtl'] .landing-hero-grid,
html[lang='ar'] .landing-hero-grid {
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  html[dir='rtl'] .landing-hero-grid,
  html[lang='ar'] .landing-hero-grid {
    gap: 3rem;
    align-items: center;
  }
}

/* Dashboard mock stays LTR; cancel LTR hero translate/scale that overlaps copy */
html[dir='rtl'] .landing-hero-visual,
html[lang='ar'] .landing-hero-visual {
  direction: ltr;
  unicode-bidi: isolate;
  transform: none !important;
  margin-inline-start: auto;
  margin-inline-end: 0;
  max-width: 100%;
  z-index: 10;
}

html[dir='rtl'] .landing-hero-copy,
html[lang='ar'] .landing-hero-copy {
  z-index: 20;
  padding-inline-end: 0;
}

html[dir='rtl'] .landing-mock-ltr,
html[lang='ar'] .landing-mock-ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

html[dir='rtl'] .landing-stat-item,
html[lang='ar'] .landing-stat-item {
  text-align: start;
}

@media (min-width: 768px) {
  html[dir='rtl'] .landing-stat-item,
  html[lang='ar'] .landing-stat-item {
    text-align: start;
  }
}

html[dir='rtl'] .metric-item:not(:last-child)::after,
html[lang='ar'] .metric-item:not(:last-child)::after {
  right: auto;
  inset-inline-end: 0;
}

html[dir='rtl'] .landing-glass-nav-inner,
html[lang='ar'] .landing-glass-nav-inner {
  flex-direction: row;
}

html[dir='rtl'] .landing-glass-nav-links,
html[lang='ar'] .landing-glass-nav-links {
  gap: 1.25rem;
}
