/* First-visit intent modal — choose "Contact Harith" or "Explore the portfolio".
   Shows once per browser (localStorage gate), behind a frosted backdrop, and
   auto-dismisses as "Explore" after 60s of inactivity. */

.intent {
  position: fixed;
  inset: 0;
  z-index: 200; /* above the floating dock (z 80) */
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 2rem);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms var(--ease), visibility 0s linear 280ms;
}
.intent.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 280ms var(--ease), visibility 0s;
}
.intent::-webkit-scrollbar, .intent__card::-webkit-scrollbar { display: none; }

/* Frosted, privacy-preserving backdrop that blurs the live portfolio behind. */
.intent__scrim {
  position: absolute;
  inset: 0;
  background: rgba(8, 20, 34, 0.5);
  background: color-mix(in srgb, var(--bg) 60%, rgba(8, 20, 34, 0.62));
  -webkit-backdrop-filter: blur(16px) saturate(118%);
  backdrop-filter: blur(16px) saturate(118%);
}

/* The decision card — inherits text direction from <html> (RTL in AR, LTR in EN). */
.intent__card {
  position: relative;
  width: min(446px, 100%);
  max-height: calc(100dvh - 2rem);
  overflow-x: hidden;
  overflow-y: auto;
  margin: auto;
  background: var(--surface);
  border: var(--border-w) solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  padding: clamp(1.6rem, 4.4vw, 2.4rem);
  text-align: center;
  transform: translateY(18px) scale(0.975);
  opacity: 0;
  transition: transform 380ms var(--ease), opacity 320ms var(--ease);
}
.intent.is-open .intent__card {
  transform: none;
  opacity: 1;
}

/* Soft accent glow bleeding from the top edge of the card. */
.intent__glow {
  position: absolute;
  inset-inline: -1px;
  top: -1px;
  height: 150px;
  background: radial-gradient(120% 100% at 50% 0%,
    color-mix(in srgb, var(--accent) 18%, transparent), transparent 72%);
  pointer-events: none;
}

.intent__title {
  position: relative;
  font-size: var(--step-1);
  font-weight: 800;
  line-height: 1.5;
  color: var(--text);
}

/* Two decisions. DOM order is explore → contact; in RTL this places
   "استكشاف" on the right and "تواصل" on the left per the requested layout.
   In LTR we mirror so explore stays on the right. */
.intent__actions {
  position: relative;
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
[dir="rtl"] .intent__actions { flex-direction: row; }
[dir="ltr"] .intent__actions { flex-direction: row-reverse; }

.intent__btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1rem;
  border-radius: var(--radius-md);
  border: var(--border-w) solid transparent;
  font-size: var(--step-0);
  font-weight: 700;
  white-space: nowrap;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease),
              border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              color var(--dur) var(--ease);
}
.intent__btn svg { width: 18px; height: 18px; flex: none; }
.intent__btn:hover { transform: translateY(-2px); }
.intent__btn:active { transform: translateY(0) scale(0.98); }

/* Explore = the safe default (also the 60s timeout action) → filled primary. */
.intent__btn--primary {
  background: var(--accent);
  color: var(--accent-on);
  box-shadow: var(--shadow);
}
.intent__btn--primary:hover { background: var(--accent-deep); }

/* Contact = outline secondary. */
.intent__btn--accent {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.intent__btn--accent:hover { background: var(--accent-soft); }

@media (max-width: 380px) {
  .intent__card { padding: 1.4rem 1.2rem; }
}

/* Respect users who prefer less motion: no entrance/scale, static bar. */
@media (prefers-reduced-motion: reduce) {
  .intent,
  .intent__card { transition-duration: 0.01ms !important; }
  .intent__card { transform: none; }
  .intent__btn { transition: none; }
}
