/* Servorya landing — brand tokens mirror web/app/globals.css + mobile/lib/core/theme.dart */

:root {
  --brand-50: #fdeee8;
  --brand-100: #fad3c4;
  --brand-400: #ea6b42;
  --brand-500: #e8562a;
  --brand-600: #cf451b;
  --brand-700: #b23a12;
  --accent: #f5b841;

  --ink-900: #14181f;
  --ink-700: #1f2937;
  --ink-500: #6b7280;
  --ink-300: #9aa3af;

  --bg: #faf9f6;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --border: #e5e7eb;
  --ink-900-rgb: 20, 24, 31;

  --wa: #25d366;

  --shadow-card: 0 1px 2px rgba(20, 24, 31, 0.05), 0 1px 1px rgba(20, 24, 31, 0.04);
  --shadow-float: 0 20px 40px -12px rgba(20, 24, 31, 0.18), 0 4px 12px rgba(20, 24, 31, 0.06);

  --font-latin: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --font-arabic: "Cairo", ui-sans-serif, system-ui, sans-serif;

  --container: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-700);
  font-family: var(--font-latin);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

:lang(ar) body,
[dir="rtl"] body { font-family: var(--font-arabic); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink-900);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

.wrap {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

.icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-600);
  margin-bottom: 10px;
}
.eyebrow.center { display: flex; justify-content: center; width: 100%; }

.center { text-align: center; }

.section-sub {
  color: var(--ink-500);
  font-size: 17px;
  max-width: 620px;
  margin: 10px auto 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.btn .icon { font-size: 18px; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-primary {
  background: var(--brand-500);
  color: #fff;
  box-shadow: var(--shadow-card);
}
.btn-primary:hover { background: var(--brand-600); }
.btn-primary:active { transform: translateY(1px); }
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--ink-900);
}
.btn-outline:hover { background: var(--surface-2); }

.whatsapp-link .icon path:first-child { fill: currentColor; opacity: .16; }
.whatsapp-link .wa-fg { fill: currentColor; stroke: none; }

.hero-cta .whatsapp-link.btn-primary,
.final-cta .whatsapp-link.btn-primary {
  position: relative;
}
.hero-cta .whatsapp-link.btn-primary::after,
.final-cta .whatsapp-link.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse-ring 2.6s cubic-bezier(.4, 0, .3, 1) infinite;
  pointer-events: none;
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(232, 86, 42, .35); }
  70% { box-shadow: 0 0 0 14px rgba(232, 86, 42, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 86, 42, 0); }
}
.final-cta .whatsapp-link.btn-primary::after { animation-name: pulse-ring-light; }
@keyframes pulse-ring-light {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .45); }
  70% { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.ico-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--brand-50);
  color: var(--brand-600);
  flex-shrink: 0;
}
.ico-badge .icon { font-size: 18px; }
.ico-badge.lg { width: 48px; height: 48px; border-radius: 14px; }
.ico-badge.lg .icon { font-size: 22px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 249, 246, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(20, 24, 31, 0);
  transition: box-shadow .25s ease, background-color .25s ease;
}
.site-header.is-scrolled {
  background: rgba(250, 249, 246, 0.96);
  box-shadow: 0 8px 24px -12px rgba(20, 24, 31, 0.16);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  flex-shrink: 0;
}
.brand-mark { width: 32px; height: 32px; border-radius: 9px; }

.main-nav {
  display: flex;
  gap: 26px;
  margin-inline-start: 8px;
  flex: 1;
}
.main-nav a {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-500);
}
.main-nav a:hover { color: var(--ink-900); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.lang-switch button {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--ink-500);
  cursor: pointer;
}
.lang-switch button.active {
  background: var(--ink-900);
  color: #fff;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle span {
  width: 16px;
  height: 2px;
  background: var(--ink-900);
  border-radius: 1px;
}

/* ---------- Hero ---------- */
.hero { padding: 64px 0 60px; overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(34px, 4.6vw, 52px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--ink-900);
}
.hero-sub {
  margin-top: 18px;
  font-size: 18px;
  color: var(--ink-500);
  max-width: 500px;
}
.hero-cta {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}
.hero-points {
  margin-top: 38px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hero-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--ink-700);
  font-weight: 500;
}

.hero-visual { position: relative; }
.hero-glow {
  position: absolute;
  inset: -10% -20% auto auto;
  width: 60%;
  aspect-ratio: 1;
  background: radial-gradient(closest-side, var(--brand-100), transparent 70%);
  z-index: -1;
  filter: blur(10px);
  animation: drift 9s ease-in-out infinite;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-16px, 18px) scale(1.06); }
}
.browser-frame {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-float);
  transform: rotate(0.4deg);
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.browser-url {
  margin-inline-start: 10px;
  font-size: 12px;
  color: var(--ink-500);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px;
  font-family: ui-monospace, monospace;
}
.browser-frame img { width: 100%; height: auto; }

/* ---------- Trust strip ---------- */
.trust {
  background: var(--ink-900);
  color: rgba(255, 255, 255, 0.85);
  padding: 16px 0;
}
.trust p {
  text-align: center;
  font-size: 14.5px;
  font-weight: 500;
}

/* ---------- Features ---------- */
.features { padding: 88px 0; }
.features h2, .roles h2, .about h2, .final-cta h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-900);
}
.feature-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-float);
  border-color: var(--brand-100);
}
.feature-card h3 {
  margin-top: 16px;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink-900);
}
.feature-card p {
  margin-top: 8px;
  font-size: 14.5px;
  color: var(--ink-500);
  line-height: 1.55;
}

/* ---------- Screenshots ---------- */
.shots { padding: 88px 0; }
.shot-tabs {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.shot-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px 8px 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-500);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.shot-tab .ico-badge { width: 30px; height: 30px; border-radius: 999px; }
.shot-tab .ico-badge .icon { font-size: 15px; }
.shot-tab:hover { border-color: var(--brand-400); color: var(--ink-900); }
.shot-tab.is-active {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: #fff;
}
.shot-tab.is-active .ico-badge { background: rgba(255, 255, 255, 0.15); color: #fff; }

.shot-panel {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 44px;
  align-items: center;
}
.shot-frame img {
  width: 100%;
  height: auto;
  display: block;
}
.shot-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.shot-frame.is-mobile {
  max-width: 260px;
  border: 7px solid var(--ink-900);
  border-radius: 34px;
  overflow: hidden;
  box-shadow: var(--shadow-float);
}
.shot-frame.is-mobile .browser-bar { display: none; }

.device-toggle[hidden] { display: none; }
.device-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  background: var(--surface);
}
.device-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 999px;
  color: var(--ink-500);
  cursor: pointer;
}
.device-btn .icon { font-size: 15px; }
.device-btn:hover { color: var(--ink-900); }
.device-btn.is-active { background: var(--ink-900); color: #fff; }
.shot-copy h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink-900);
  letter-spacing: -0.01em;
}
.shot-copy p {
  margin-top: 12px;
  color: var(--ink-500);
  font-size: 15.5px;
  line-height: 1.6;
}

/* ---------- Roles ---------- */
.roles { padding: 88px 0; background: var(--surface-2); }
.role-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.role-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.role-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-float);
}
.role-card h3 {
  margin-top: 16px;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink-900);
}
.role-card ul { margin-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.role-card li {
  font-size: 14px;
  color: var(--ink-500);
  padding-inline-start: 16px;
  position: relative;
}
.role-card li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-500);
}

/* ---------- Mobile spotlight ---------- */
.mobile-spotlight {
  padding: 96px 0;
  background: var(--ink-900);
  color: rgba(255, 255, 255, 0.9);
  overflow: hidden;
}
.mobile-spotlight-grid {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.mobile-spotlight .eyebrow { color: var(--accent); }
.mobile-spotlight h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}
.mobile-spotlight .section-sub { margin-inline: 0; color: rgba(255, 255, 255, 0.6); max-width: 460px; }

.mobile-feature-list {
  margin: 34px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.mobile-feature-list li { display: flex; gap: 14px; align-items: flex-start; }
.mobile-feature-list .ico-badge { background: rgba(255, 255, 255, 0.1); color: var(--accent); }
.mobile-feature-list h3 { font-size: 15.5px; font-weight: 700; color: #fff; }
.mobile-feature-list p { margin-top: 4px; font-size: 14px; color: rgba(255, 255, 255, 0.55); line-height: 1.55; }

.mobile-spotlight-visual {
  position: relative;
  display: flex;
  justify-content: center;
  padding-block: 20px;
}
.phone-mock {
  width: 230px;
  border: 7px solid #fff;
  border-radius: 34px;
  overflow: hidden;
  box-shadow: var(--shadow-float);
  background: #fff;
}
.phone-mock img { width: 100%; height: auto; display: block; }
.phone-mock-bar { display: none; }
.phone-mock-back {
  position: absolute;
  inset-inline-start: calc(50% - 40px);
  top: -30px;
  transform: rotate(-6deg);
  opacity: 0.85;
  z-index: 1;
}
.phone-mock-front {
  position: relative;
  inset-inline-start: 40px;
  transform: rotate(4deg);
  z-index: 2;
}

/* ---------- About ---------- */
.about { padding: 96px 0; }
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: start;
}
.about h2 { margin-bottom: 18px; }
.about p { color: var(--ink-500); font-size: 16px; margin-bottom: 14px; }
.about-card {
  background: var(--ink-900);
  color: #fff;
  border-radius: 20px;
  padding: 32px;
}
.about-card-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 16px;
}
.about-card ul { display: flex; flex-direction: column; gap: 14px; }
.about-card li {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.9);
  padding-inline-start: 20px;
  position: relative;
}
.about-card li::before {
  content: "✓";
  position: absolute;
  inset-inline-start: 0;
  color: var(--accent);
  font-weight: 800;
}

/* ---------- Final CTA ---------- */
.final-cta {
  padding: 90px 0;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500) 55%, var(--accent) 130%);
}
.final-cta-inner { text-align: center; }
.final-cta h2 { color: #fff; }
.final-cta p {
  color: rgba(255, 255, 255, 0.92);
  font-size: 17px;
  max-width: 520px;
  margin: 14px auto 30px;
}
.final-cta .btn-primary {
  background: #fff;
  color: var(--brand-600);
}
.final-cta .btn-primary:hover { background: var(--brand-50); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-900); color: rgba(255, 255, 255, 0.7); padding: 56px 0 0; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
}
.footer-brand .brand { color: #fff; }
.footer-brand p { margin-top: 10px; font-size: 14px; color: rgba(255, 255, 255, 0.55); max-width: 260px; }
.footer-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-nav a { font-size: 14px; color: rgba(255, 255, 255, 0.7); }
.footer-nav a:hover { color: #fff; }
.footer-lang button { color: rgba(255, 255, 255, 0.6); }
.footer-lang { border-color: rgba(255, 255, 255, 0.18); }
.footer-lang button.active { background: rgba(255, 255, 255, 0.14); color: #fff; }
.footer-bottom {
  padding: 20px 0 28px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.footer-bottom p { font-size: 13px; color: rgba(255, 255, 255, 0.45); }
.footer-bottom a { color: rgba(255, 255, 255, 0.7); text-decoration: underline; }
.footer-bottom a:hover { color: #fff; }

/* ---------- Hero entrance ----------
   Pure CSS animation, no JS involved: if animations aren't supported the
   `animation` property is simply ignored and the element renders at its
   normal opacity (1) — there's no separate "hidden" base state that could
   get stuck, unlike a JS-driven class toggle would risk. */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-copy { animation: fade-up .6s ease both; }
.hero-visual { animation: fade-up .6s ease .12s both; }
@media (prefers-reduced-motion: reduce) {
  .hero-copy, .hero-visual { animation: none; }
}

/* ---------- Scroll reveal ----------
   Visible by default (no-JS / not-yet-run state). main.js adds
   html.reveal-ready only once it has actually attached an
   IntersectionObserver to every [data-reveal] element — so the hidden
   state is only ever reachable together with the code that clears it. A
   slow script, a JS error earlier in the file, or no JS at all just means
   the page renders instantly with no animation instead of staying blank. */
html.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s ease, transform .55s ease;
  transition-delay: var(--reveal-delay, 0s);
}
html.reveal-ready [data-reveal].is-visible { opacity: 1; transform: translateY(0); }

.feature-grid > *:nth-child(1) { --reveal-delay: 0s; }
.feature-grid > *:nth-child(2) { --reveal-delay: .05s; }
.feature-grid > *:nth-child(3) { --reveal-delay: .1s; }
.feature-grid > *:nth-child(4) { --reveal-delay: .15s; }
.feature-grid > *:nth-child(5) { --reveal-delay: .05s; }
.feature-grid > *:nth-child(6) { --reveal-delay: .1s; }
.feature-grid > *:nth-child(7) { --reveal-delay: .15s; }
.feature-grid > *:nth-child(8) { --reveal-delay: .2s; }
.role-grid > *:nth-child(1) { --reveal-delay: 0s; }
.role-grid > *:nth-child(2) { --reveal-delay: .06s; }
.role-grid > *:nth-child(3) { --reveal-delay: .12s; }
.role-grid > *:nth-child(4) { --reveal-delay: .18s; }

@media (prefers-reduced-motion: reduce) {
  html.reveal-ready [data-reveal] { transition: none; }
}

/* ---------- RTL ---------- */
[dir="rtl"] .hero-grid { direction: rtl; }
[dir="rtl"] .browser-frame { transform: rotate(-0.4deg); }
[dir="rtl"] .hero-glow { inset: -10% auto auto -20%; }
[dir="rtl"] .about-card li::before,
[dir="rtl"] .role-card li::before { content: "✓"; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .main-nav {
    display: flex;
    position: absolute;
    inset-inline: 0;
    top: 68px;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 20px 16px;
    gap: 4px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
  }
  .main-nav a { padding: 10px 0; border-bottom: 1px solid var(--surface-2); }
  .main-nav.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-toggle { display: flex; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding-top: 40px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .role-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .shot-panel { grid-template-columns: 1fr; }
  .shot-copy { order: -1; }
  .mobile-spotlight-grid { grid-template-columns: 1fr; }
  .mobile-spotlight-visual { order: -1; margin-bottom: 20px; }
}

@media (max-width: 600px) {
  .header-inner { height: 60px; }
  .brand-word { display: none; }
  .header-actions .whatsapp-link span { display: none; }
  .header-actions .whatsapp-link { padding: 8px; }
  .feature-grid { grid-template-columns: 1fr; }
  .role-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .footer-inner { flex-direction: column; }
}
