/* ============================================
   Tabayun Real Estate Services
   Custom Stylesheet
   ============================================ */

/* Base */
:root {
  --brand-primary: #0e355c;
  --brand-secondary: #4c718e;
  --brand-neutral: #808080;
  --brand-accent: #452a17;
  --brand-cream: #f8f6f2;
  --brand-ink: #081e35;
}

/* ============================================
   Force Arial on ALL digits across the site
   (covers Latin 0-9, Arabic-Indic ٠-٩, and
   Extended Arabic-Indic ۰-۹)
   ============================================ */
@font-face {
  font-family: 'TabayunDigits';
  src: local('Arial'), local('Arial Regular'), local('ArialMT');
  font-weight: 100 900;
  font-style: normal;
  unicode-range: U+0030-0039, U+0660-0669, U+06F0-06F9;
}
@font-face {
  font-family: 'TabayunDigits';
  src: local('Arial Bold'), local('Arial-BoldMT');
  font-weight: 700 900;
  font-style: normal;
  unicode-range: U+0030-0039, U+0660-0669, U+06F0-06F9;
}

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[lang="en"] body {
  font-family: 'TabayunDigits', 'Montserrat', system-ui, sans-serif;
}

html[lang="ar"] body {
  font-family: 'TabayunDigits', 'IBM Plex Sans Arabic', 'Tajawal', system-ui, sans-serif;
}

/* Headings use Tajawal for stronger display weight in Arabic */
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] .hero-title {
  font-family: 'TabayunDigits', 'Tajawal', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  font-weight: 900;
}

html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3,
html[lang="en"] .hero-title {
  font-family: 'TabayunDigits', 'Montserrat', system-ui, sans-serif;
}

/* Selection */
::selection {
  background: var(--brand-primary);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--brand-cream);
}
::-webkit-scrollbar-thumb {
  background: var(--brand-secondary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-primary);
}

/* ============ Navigation ============ */
#navbar.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(14, 53, 92, 0.08), 0 10px 30px -10px rgba(14, 53, 92, 0.1);
}

.nav-link {
  position: relative;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brand-ink);
  transition: color 0.3s;
  padding: 0.25rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand-primary);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.nav-link:hover {
  color: var(--brand-primary);
}

.nav-link:hover::after {
  width: 100%;
}

.mobile-link {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brand-ink);
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(14, 53, 92, 0.08);
  transition: color 0.3s;
}

.mobile-link:hover {
  color: var(--brand-primary);
}

/* ============ Hero ============ */
.hero-title {
  letter-spacing: -0.02em;
}

html[lang="en"] .hero-title {
  letter-spacing: -0.04em;
}

.hero-underline {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: draw-line 2s ease-out 1.5s forwards;
}

@keyframes draw-line {
  to { stroke-dashoffset: 0; }
}

.hero-shape {
  animation: float-slow 12s ease-in-out infinite;
}

.hero-shape:nth-child(2) {
  animation-delay: -4s;
}

.hero-shape:nth-child(3) {
  animation-delay: -8s;
}

@keyframes float-slow {
  0%, 100% { transform: translate(0, 0) rotate(45deg); }
  50% { transform: translate(20px, -30px) rotate(50deg); }
}

.floating-card {
  animation: floating 4s ease-in-out infinite;
}

@keyframes floating {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Scroll indicator */
.scroll-line {
  animation: scroll-indicator 2s ease-in-out infinite;
}

@keyframes scroll-indicator {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(200%); }
}

/* ============ Marquee ============ */
.marquee {
  animation: marquee-scroll 40s linear infinite;
}

html[dir="rtl"] .marquee {
  animation-direction: reverse;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============ Service Cards ============ */
.service-card {
  will-change: transform;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 60px -20px rgba(14, 53, 92, 0.25);
}

/* ============ Why Cards ============ */
.why-card {
  backdrop-filter: blur(10px);
}

/* ============ Reveal Animations ============ */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Service cards stagger reveal */
.service-card,
.why-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--i, 0) * 80ms);
}

.service-card.revealed,
.why-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ============ Forms ============ */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
select:-webkit-autofill,
textarea:-webkit-autofill {
  -webkit-text-fill-color: white;
  -webkit-box-shadow: 0 0 0 1000px rgba(255,255,255,0.05) inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* ============ Scroll to top ============ */
#scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

/* ============ Mobile tap target enhancements ============ */
@media (max-width: 767px) {
  /* Footer list anchors: expand tap area vertically to ~44px minimum */
  footer nav a,
  footer ul a,
  footer li a {
    display: inline-block;
    padding-block: 0.85rem;
    line-height: 1.25;
  }

  /* Contact info anchors (email, phone) on any page */
  a[href^="mailto:"],
  a[href^="tel:"] {
    display: inline-block;
    padding-block: 0.85rem;
    line-height: 1.25;
  }

  /* Breadcrumb anchors — bigger tap area */
  nav[aria-label="Breadcrumb"] a {
    display: inline-block;
    padding: 0.65rem 0.75rem;
    margin: -0.65rem -0.25rem;
  }

  /* Privacy page: inline "back to home" link in prose */
  .prose-tabayun .mt-12 a {
    padding-block: 0.9rem;
  }

  /* Prose in-text anchors (privacy page email/phone in the list) */
  .prose-tabayun li a {
    padding-block: 0.75rem;
  }

  /* Social icons minimum size */
  footer a.w-10 {
    min-width: 44px !important;
    min-height: 44px !important;
  }
}

/* ============ Mobile ============ */
@media (max-width: 1023px) {
  .hero-title {
    font-size: clamp(2rem, 6.5vw, 3.25rem);
  }
}

@media (max-width: 640px) {
  .floating-card {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.75rem;
  }
  .floating-card .w-10 {
    width: 2rem;
    height: 2rem;
  }
}

/* ============ Preloader ============ */
body.loaded #preloader {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease-out;
}

/* ============ RTL fixes ============ */
html[dir="rtl"] .rtl\:rotate-180 {
  transform: rotate(180deg);
}

/* ============ Utility ============ */
.text-balance {
  text-wrap: balance;
}

/* ============ Focus visible ============ */
:focus-visible {
  outline: 2px solid var(--brand-secondary);
  outline-offset: 2px;
  border-radius: 6px;
}

button:focus-visible,
a:focus-visible {
  outline-offset: 4px;
}

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