/* ==========================================================================
   leb.ai — under construction
   One stylesheet for both languages. Arabic (RTL) is the default document.
   No JS, no build step. Brand tokens match the leb.ai visual direction.
   ========================================================================== */

:root {
  --cedar: #165a4a;
  --cedar-2: #0d4236;
  --cedar-3: #0a332a;
  --cedar-mist: #edf5f1;
  --sand: #f7f2e8;
  --terracotta: #c96a4b;
  --gold: #d9a441;
  --ink: #17211e;
  --ink-2: #35423d;
  --muted: #55625c;
  --line: #ddd3c3;
  --white: #fffdf8;

  --font-ar: "IBM Plex Sans Arabic", "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-latin: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  --radius: clamp(20px, 4vw, 32px);
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--sand);
  background-image:
    radial-gradient(1100px 700px at 88% -8%, rgba(201, 106, 75, 0.11), transparent 62%),
    radial-gradient(900px 800px at 0% 108%, rgba(22, 90, 74, 0.1), transparent 60%),
    radial-gradient(700px 500px at 50% 45%, rgba(217, 164, 65, 0.07), transparent 70%);
  font-family: var(--font-ar);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Faint graph paper, faded towards the edges. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.85;
  background-image:
    linear-gradient(to right, rgba(22, 90, 74, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(22, 90, 74, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, #000 15%, transparent 80%);
  mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, #000 15%, transparent 80%);
}

html[lang="en"] body {
  font-family: var(--font-latin);
}

::selection {
  background: var(--cedar);
  color: var(--white);
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--cedar-2);
  outline-offset: 3px;
  border-radius: 6px;
}

.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;
}

/* ---------- shell -------------------------------------------------------- */

.page {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(1.25rem, 4vh, 2.75rem);
  min-height: 100vh;
  min-height: 100svh;
  max-width: 1180px;
  margin-inline: auto;
  padding: clamp(1.1rem, 3vw, 2rem) clamp(1.1rem, 4vw, 2.5rem);
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.site-header {
  justify-content: space-between;
}

/* ---------- brand -------------------------------------------------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.25rem 0.1rem;
  color: var(--cedar-3);
  text-decoration: none;
  border-radius: 10px;
}

.brand img {
  display: block;
  width: 26px;
  height: auto;
}

.brand-name {
  font-family: var(--font-latin);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand:hover .brand-name {
  color: var(--cedar);
}

/* ---------- language switch --------------------------------------------- */

.lang-switch a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.9rem;
  border: 1px solid rgba(22, 90, 74, 0.18);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.6);
  color: var(--cedar-2);
  font-family: var(--font-latin);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

html[lang="ar"] .lang-switch a[lang="en"],
html[lang="en"] .lang-switch a[lang="ar"] {
  font-family: var(--font-ar);
}

.lang-switch svg {
  width: 15px;
  height: 15px;
  opacity: 0.65;
}

.lang-switch a:hover {
  background: var(--white);
  border-color: rgba(22, 90, 74, 0.32);
  transform: translateY(-1px);
}

/* ---------- stage + card ------------------------------------------------- */

.stage {
  display: grid;
  place-items: center;
  padding-block: 0.5rem;
}

.card {
  position: relative;
  width: min(100%, 700px);
  margin: 0;
  padding: clamp(1.6rem, 4.4vw, 3rem) clamp(1.25rem, 4.4vw, 3.25rem)
    clamp(1.5rem, 3.4vw, 2.4rem);
  overflow: hidden;
  text-align: center;
  background: var(--white);
  border: 1px solid rgba(23, 33, 30, 0.09);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 2px 6px rgba(23, 33, 30, 0.03),
    0 24px 60px -26px rgba(23, 33, 30, 0.22),
    0 70px 130px -70px rgba(22, 90, 74, 0.4);
  animation: rise 0.75s var(--ease) both;
}

/* Warm halo behind the cedar. */
.card::before {
  content: "";
  position: absolute;
  inset: -10% -20% auto;
  height: 62%;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(217, 164, 65, 0.16), transparent 78%);
}

/* Hairline of brand colours along the top edge. */
.card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--cedar) 0%,
    var(--cedar) 38%,
    var(--terracotta) 38%,
    var(--terracotta) 66%,
    var(--gold) 66%
  );
  opacity: 0.9;
}

.card > * {
  position: relative;
}

/* ---------- digitized cedar --------------------------------------------- */

.cedar {
  position: relative;
  width: clamp(160px, 33vw, 236px);
  margin: -0.35rem auto 0.35rem;
  overflow: hidden;
  isolation: isolate;
  animation: fade-in 0.9s 0.1s var(--ease) both;
}

.cedar img {
  display: block;
  width: 100%;
  height: auto;
}

/* A slow scanline sweeping down the dotted canopy. */
.cedar .scan {
  position: absolute;
  inset-inline: -8%;
  top: 0;
  height: 1.5px;
  z-index: 2;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(201, 106, 75, 0.5) 18%,
    rgba(217, 164, 65, 0.75) 50%,
    rgba(201, 106, 75, 0.5) 82%,
    transparent
  );
  box-shadow: 0 0 10px 2px rgba(201, 106, 75, 0.16);
  opacity: 0;
  animation: scan 6.5s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

/* ---------- copy --------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0 0.85rem;
  padding: 0.38rem 0.9rem;
  border: 1px solid rgba(22, 90, 74, 0.16);
  border-radius: 999px;
  background: rgba(22, 90, 74, 0.07);
  color: var(--cedar-2);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  animation: rise 0.6s 0.2s var(--ease) both;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--terracotta);
  box-shadow: 0 0 0 0 rgba(201, 106, 75, 0.5);
  animation: pulse 2.6s ease-out infinite;
}

html[lang="en"] .badge {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7.2vw, 3.3rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--cedar-3);
  text-wrap: balance;
  animation: rise 0.65s 0.28s var(--ease) both;
}

html[lang="en"] h1 {
  font-size: clamp(2.25rem, 8vw, 3.8rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.lead {
  max-width: 34ch;
  margin: 0.95rem auto 0;
  color: var(--ink-2);
  font-size: clamp(1rem, 1.7vw, 1.1rem);
  line-height: 1.85;
  text-wrap: balance;
  animation: rise 0.65s 0.36s var(--ease) both;
}

.lead bdi {
  font-family: var(--font-latin);
  font-weight: 600;
  color: var(--cedar-2);
}

html[lang="en"] .lead {
  max-width: 44ch;
}

/* ---------- working dots ------------------------------------------------- */

.progress {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.5rem 0 0;
  padding: 0;
  animation: fade-in 0.7s 0.5s var(--ease) both;
}

.progress span:not(.sr-only) {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cedar);
  opacity: 0.2;
  animation: work 1.6s ease-in-out infinite;
}

.progress span:nth-child(2) {
  animation-delay: 0.18s;
}

.progress span:nth-child(3) {
  animation-delay: 0.36s;
}

/* ---------- credit ------------------------------------------------------- */

.divider {
  height: 1px;
  margin: clamp(1.4rem, 3vw, 1.9rem) auto 1.25rem;
  border: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(23, 33, 30, 0.14) 18%,
    rgba(23, 33, 30, 0.14) 82%,
    transparent
  );
  animation: fade-in 0.7s 0.5s var(--ease) both;
}

.credit {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  animation: rise 0.6s 0.58s var(--ease) both;
}

.credit-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

html[lang="ar"] .credit-label {
  font-size: 0.8rem;
  letter-spacing: 0;
  text-transform: none;
}

.credit-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.05rem;
  border: 1px solid rgba(22, 90, 74, 0.2);
  border-radius: 999px;
  background: var(--cedar-mist);
  color: var(--cedar-2);
  font-family: var(--font-latin);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease,
    box-shadow 0.2s ease;
}

.credit-link:hover {
  background: #e3efe9;
  border-color: rgba(22, 90, 74, 0.34);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -10px rgba(22, 90, 74, 0.5);
}

.credit-domain {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.92em;
}

.credit-sep {
  color: rgba(22, 90, 74, 0.35);
}

.credit-arrow {
  width: 14px;
  height: 14px;
  color: var(--cedar);
  opacity: 0.65;
}

/* ---------- footer ------------------------------------------------------- */

.site-footer {
  justify-content: center;
  padding-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer .sep {
  margin-inline: 0.4rem;
  opacity: 0.5;
}

html[lang="ar"] .site-footer {
  font-size: 0.82rem;
}

/* ---------- motion ------------------------------------------------------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(201, 106, 75, 0.45);
  }
  70%,
  100% {
    box-shadow: 0 0 0 7px rgba(201, 106, 75, 0);
  }
}

@keyframes work {
  0%,
  100% {
    opacity: 0.2;
    transform: translateY(0) scale(0.9);
  }
  40% {
    opacity: 0.85;
    transform: translateY(-3px) scale(1);
  }
}

@keyframes scan {
  0% {
    top: 4%;
    opacity: 0;
  }
  14%,
  86% {
    opacity: 0.9;
  }
  100% {
    top: 94%;
    opacity: 0;
  }
}

/* ---------- responsive --------------------------------------------------- */

@media (max-width: 520px) {
  .page {
    gap: 1rem;
  }

  .cedar {
    width: min(176px, 52vw);
  }

  .brand img {
    width: 23px;
  }

  .credit-link {
    font-size: 0.9rem;
    padding: 0.45rem 0.85rem;
  }
}

@media (max-height: 720px) {
  .page {
    gap: 1rem;
  }

  .cedar {
    width: min(150px, 28vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .cedar .scan {
    display: none;
  }
}
