:root {
  --primary-red: #cf0304;
  --primary-red-hover: #b00203;
  --primary-red-light: rgba(207, 3, 4, 0.08);
  --primary-red-glow: rgba(207, 3, 4, 0.25);
  --bg-pattern-width: 320px;
  --bg-duration: 20s;
  --items-duration: 70s;
  --font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: var(--font-family);
  background-color: #fdfaf9;
  color: #1a1a1a;
  direction: rtl;
  touch-action: manipulation;
}

/* 1. Step & Repeat Background Pattern (linear move right only) */
.bg-pattern {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background-image: url('assets/pat.webp');
  background-repeat: repeat;
  background-size: var(--bg-pattern-width) auto;
  opacity: 0.90;
  animation: moveBgRight var(--bg-duration) linear infinite;
  will-change: background-position;
  pointer-events: none;
}

@keyframes moveBgRight {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: var(--bg-pattern-width) 0;
  }
}

/* 2. Rain Canvas */
#rainCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* 3. Main Page Layout */
.page-container {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: clamp(12px, 3vh, 24px) 0 clamp(16px, 3vh, 28px) 0;
  gap: clamp(12px, 2.2vh, 20px);
  overflow-x: hidden;
}

.content-box {
  width: 100%;
  max-width: 440px;
  padding: 0 16px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2vh, 18px);
}

/* Header & Logo */
.logo-wrapper {
  margin-top: clamp(2px, 1.5vh, 10px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-img {
  width: clamp(88px, 14vh, 106px);
  height: clamp(88px, 14vh, 106px);
  border-radius: 50%;
  border: 3.5px solid var(--primary-red);
  box-shadow: 0 8px 24px var(--primary-red-glow), 0 2px 8px rgba(0, 0, 0, 0.08);
  object-fit: cover;
  background-color: #fff;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.logo-img:active {
  transform: scale(0.92) rotate(4deg);
}

/* Quote Section (Interactive) */
.quote-section {
  width: 100%;
}

.quote-card {
  position: relative;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  padding: clamp(16px, 2.5vh, 22px) 20px;
  border: 1.5px solid rgba(207, 3, 4, 0.22);
  border-right: 6px solid var(--primary-red);
  box-shadow: 0 10px 28px rgba(207, 3, 4, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.quote-card:active {
  transform: scale(0.97);
  box-shadow: 0 4px 14px rgba(207, 3, 4, 0.16);
}

.quote-icon {
  position: absolute;
  top: 6px;
  left: 12px;
  font-size: 32px;
  line-height: 1;
  color: var(--primary-red);
  opacity: 0.22;
  font-family: serif;
}

.quote-text {
  font-size: clamp(1.05rem, 2.5vh, 1.22rem);
  font-weight: 700;
  line-height: 1.55;
  color: #1a1a1a;
  text-align: center;
  min-height: clamp(48px, 6.5vh, 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.quote-text.changing {
  opacity: 0;
  transform: translateY(6px);
}

/* Continuous Moving Items Strip (1.2x Background Speed - Centered full-width) */
.items-ticker-section {
  width: 100%;
  overflow: hidden;
  padding: clamp(6px, 1.4vh, 12px) 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ticker-wrapper {
  width: 100%;
  overflow: hidden;
  user-select: none;
  direction: ltr; /* Keeps consistent LTR coordinate space for translateX */
}

.ticker-track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: itemsMoveRight var(--items-duration) linear infinite;
}

/* Pause on direct touch hold for inspectability */
.ticker-wrapper:active .ticker-track {
  animation-play-state: paused;
}

.ticker-set {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px;
}

.ticker-item {
  width: clamp(94px, 13vh, 112px);
  height: clamp(94px, 13vh, 112px);
  border-radius: 16px;
  border: 3px solid var(--primary-red);
  box-shadow: 0 6px 18px rgba(207, 3, 4, 0.2), 0 2px 6px rgba(0, 0, 0, 0.08);
  object-fit: cover;
  flex-shrink: 0;
  background-color: #fff;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ticker-item:hover, .ticker-item:active {
  transform: scale(1.05);
}

/* Continuous translation strictly to the right with 4 sets, guaranteeing NO edges are EVER visible */
@keyframes itemsMoveRight {
  0% {
    transform: translateX(-50%);
  }
  100% {
    transform: translateX(-25%);
  }
}

/* Contact / Action Links Section */
.links-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(9px, 1.6vh, 13px);
  margin-bottom: clamp(4px, 1vh, 8px);
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: clamp(12px, 1.8vh, 15px) 18px;
  border-radius: 16px;
  font-size: clamp(0.98rem, 2.2vh, 1.08rem);
  font-weight: 700;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--primary-red);
  color: var(--primary-red);
  box-shadow: 0 6px 18px rgba(207, 3, 4, 0.12), 0 2px 4px rgba(0, 0, 0, 0.04);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  user-select: none;
}

.action-btn:active {
  transform: scale(0.96);
  background: var(--primary-red);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(207, 3, 4, 0.3);
}

.btn-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  stroke: currentColor;
}

.btn-text {
  letter-spacing: 0.3px;
}

/* Subtle individual button tints */
.phone-btn {
  background: var(--primary-red);
  color: #ffffff;
  border-color: var(--primary-red);
  box-shadow: 0 8px 24px rgba(207, 3, 4, 0.28);
}

.phone-btn:active {
  background: var(--primary-red-hover);
  color: #ffffff;
}

/* Accessibility & Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .bg-pattern {
    animation-duration: 120s;
  }
  .ticker-track {
    animation-duration: 200s;
  }
}
