/* ========================================
 * Nizaal Design System
 * Hyper-minimal · Black & White · Beam-driven
 * ======================================== */

:root {
  --bg: #0A0A0A;
  --bg-deep: #000;
  --fg: #FFFFFF;
  --fg-muted: rgba(255,255,255,0.5);
  --fg-faded: rgba(255,255,255,0.4);
  --fg-subtle: rgba(255,255,255,0.3);
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.15);
  --accent-glow: rgba(255,255,255,0.18);
  --accent-glow-soft: rgba(255,255,255,0.06);

  --font-ar: 'Cairo', sans-serif;
  --font-en: 'DM Sans', sans-serif;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 0.2s;
  --dur-base: 0.4s;
  --dur-slow: 0.7s;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ar);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; cursor: pointer; }
.muted { color: var(--fg-muted); }

/* ============== الـ Beam (نواة الهوية) ============== */
.beam {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.beam-line {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255,255,255,0.4) 25%,
    rgba(255,255,255,0.4) 75%,
    transparent 100%
  );
  border-radius: 4px;
}

.beam-dot {
  position: absolute;
  top: 50%;
  right: 50%;
  transform: translate(50%, -50%);
  border-radius: 50%;
  background: var(--fg);
}

.beam-halo {
  position: absolute;
  top: 50%;
  right: 50%;
  transform: translate(50%, -50%);
  border-radius: 50%;
  pointer-events: none;
}

.halo-1 { background: var(--accent-glow); }
.halo-2 { background: var(--accent-glow-soft); }
.halo-3 { background: rgba(255,255,255,0.03); }

/* أحجام الـ Beam */
.beam-large { width: 8px; height: 130px; }
.beam-large .beam-dot { width: 16px; height: 16px; }
.beam-large .halo-1 { width: 40px; height: 40px; }
.beam-large .halo-2 { width: 80px; height: 80px; }
.beam-large .halo-3 { width: 130px; height: 130px; }

.beam-medium { width: 6px; height: 80px; }
.beam-medium .beam-dot { width: 12px; height: 12px; }
.beam-medium .halo-1 { width: 32px; height: 32px; }
.beam-medium .halo-2 { width: 64px; height: 64px; }

.beam-small { width: 4px; height: 28px; }
.beam-small .beam-dot { width: 7px; height: 7px; }
.beam-small .halo-1 { width: 18px; height: 18px; }

.beam-mini { width: 4px; height: 32px; margin-bottom: 24px; }
.beam-mini .beam-dot { width: 7px; height: 7px; }

/* الـ Beam في الـ nav */
.beam-nav { width: 6px; height: 60px; }
.beam-nav .beam-dot { width: 12px; height: 12px; }
.beam-nav .halo-1 { width: 28px; height: 28px; }
.beam-nav .halo-2 { width: 50px; height: 50px; }
.beam-nav .halo-3 { width: 75px; height: 75px; }

/* تنفس مستمر */
.beam-large .beam-dot,
.beam-nav .beam-dot {
  animation: breathe-dot 4s ease-in-out infinite;
}
.beam-large .halo-1,
.beam-nav .halo-1 {
  animation: breathe-halo 4s ease-in-out infinite;
}
.beam-large .halo-2,
.beam-nav .halo-2 {
  animation: breathe-halo-2 4s ease-in-out infinite;
}

@keyframes breathe-dot {
  0%, 100% { transform: translate(50%, -50%) scale(1); }
  50% { transform: translate(50%, -50%) scale(1.12); }
}
@keyframes breathe-halo {
  0%, 100% { transform: translate(50%, -50%) scale(1); opacity: 1; }
  50% { transform: translate(50%, -50%) scale(1.3); opacity: 0.6; }
}
@keyframes breathe-halo-2 {
  0%, 100% { transform: translate(50%, -50%) scale(1); opacity: 1; }
  50% { transform: translate(50%, -50%) scale(1.5); opacity: 0.4; }
}

/* حالة pulse للمعالجة */
.beam-pulse .beam-dot {
  animation: pulse-fast 1s ease-in-out infinite;
}
.beam-pulse .halo-1 {
  animation: pulse-halo-fast 1s ease-in-out infinite;
}
@keyframes pulse-fast {
  0%, 100% { transform: translate(50%, -50%) scale(1); }
  50% { transform: translate(50%, -50%) scale(1.4); }
}
@keyframes pulse-halo-fast {
  0%, 100% { transform: translate(50%, -50%) scale(1); opacity: 0.4; }
  50% { transform: translate(50%, -50%) scale(1.7); opacity: 0.1; }
}

.beam-clickable { cursor: pointer; }

/* ============== الصفحة العامة ============== */
.page { min-height: 100vh; }
.page { display: none; }
.page.page-active { display: block; }

/* ============== Hero Section ============== */
.hero {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.06);
  border: 0.5px solid var(--line-strong);
  border-radius: 9999px;
  padding: 7px 16px;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 50px;
  animation: fade-in 1s var(--ease) 0.5s backwards;
}

.hero-title {
  font-size: clamp(40px, 12vw, 56px);
  font-weight: 400;
  letter-spacing: -2px;
  line-height: 1.1;
  margin: 50px 0 16px;
  animation: fade-up 1s var(--ease) 0.8s backwards;
}

.hero-subtitle {
  font-size: 14px;
  color: var(--fg-muted);
  animation: fade-up 1s var(--ease) 1s backwards;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============== Sections ============== */
.section {
  padding: 80px 32px;
  border-top: 0.5px solid var(--line);
}

.section-promise {
  padding: 100px 32px;
}

.section-cta {
  text-align: center;
  padding: 100px 32px;
}

.section-marker {
  font-size: 11px;
  color: var(--fg-faded);
  letter-spacing: 4px;
  margin-bottom: 24px;
}

.section-title {
  font-size: clamp(28px, 7vw, 36px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -1px;
  margin-bottom: 40px;
}

.section-desc {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.8;
  margin-top: 20px;
}

.section-tag {
  font-size: 10px;
  color: var(--fg-subtle);
  letter-spacing: 3px;
  margin-top: 30px;
}

.divider {
  width: 32px;
  height: 1px;
  background: var(--line-strong);
  margin-top: 40px;
}

/* Promise Section */
.promise-text {
  font-size: clamp(28px, 8vw, 36px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -1px;
  margin-bottom: 24px;
}

/* ============== Word-by-Word Reveal ============== */
.reveal-words span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s var(--ease);
  margin-left: 6px;
}
.reveal-words.visible span { opacity: 1; transform: translateY(0); }

/* ============== Steps ============== */
.steps { display: flex; flex-direction: column; }
.step {
  display: flex;
  gap: 20px;
  padding: 28px 0;
  border-top: 0.5px solid var(--line);
}
.step:last-child { border-bottom: 0.5px solid var(--line); }
.step-num {
  font-family: var(--font-en);
  font-size: 14px;
  color: var(--fg-faded);
  padding-top: 4px;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.step-body { flex: 1; }
.step-title { font-size: 18px; font-weight: 500; margin-bottom: 6px; }
.step-desc { font-size: 13px; color: var(--fg-muted); line-height: 1.7; }

/* ============== Stats ============== */
.stats { display: flex; flex-direction: column; gap: 50px; }
.stat { padding-bottom: 50px; border-bottom: 0.5px solid var(--line); }
.stat:last-child { border-bottom: none; }
.stat-num {
  font-family: var(--font-en);
  font-size: 80px;
  font-weight: 200;
  line-height: 1;
  letter-spacing: -4px;
  margin-bottom: 8px;
}
.stat-unit {
  font-size: 32px;
  opacity: 0.4;
  margin-right: 8px;
}
.stat-label { font-size: 13px; color: var(--fg-muted); }

/* ============== Services ============== */
.services { display: flex; flex-direction: column; }
.service-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0;
  border-top: 0.5px solid var(--line);
  transition: padding 0.3s var(--ease);
}
.service-row:last-child { border-bottom: 0.5px solid var(--line); }
.service-title { font-size: 22px; font-weight: 400; margin-bottom: 8px; }
.service-desc { font-size: 12px; color: var(--fg-muted); line-height: 1.7; }
.service-arrow {
  color: var(--fg-faded);
  font-size: 18px;
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}
.service-row:hover { padding-right: 16px; }
.service-row:hover .service-arrow { color: var(--fg); transform: translateX(-4px); }

/* ============== Footer ============== */
.footer {
  background: var(--bg-deep);
  padding: 60px 32px 40px;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 50px;
}
.logo-text {
  font-family: var(--font-en);
  font-weight: 400;
  font-size: 32px;
  letter-spacing: -1px;
}
.footer-links { display: flex; flex-direction: column; margin-bottom: 40px; }
.footer-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  border-top: 0.5px solid var(--line);
  font-size: 14px;
  color: rgba(255,255,255,0.7);
}
.footer-link:last-child { border-bottom: 0.5px solid var(--line); }
.footer-link .arrow { color: var(--fg-subtle); }
.footer-contact { margin-bottom: 36px; font-family: var(--font-en); font-size: 16px; }
.footer-contact p:first-child { margin-bottom: 8px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  border-top: 0.5px solid var(--line);
  font-size: 11px;
  color: var(--fg-subtle);
}
.footer-bottom span:first-child { font-family: var(--font-en); }

/* ============== Floating Beam Navigation ============== */
.floating-nav {
  position: fixed;
  bottom: 24px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  padding: 0 32px;
  z-index: 50;
}

.nav-link {
  font-size: 12px;
  color: var(--fg-muted);
  cursor: pointer;
  transition: color 0.3s var(--ease);
  padding: 8px 4px;
}
.nav-link.active {
  color: var(--fg);
  font-weight: 500;
}
.nav-link:hover { color: var(--fg); }

.nav-beam-btn {
  background: transparent;
  padding: 0 8px;
  position: relative;
}

/* ============== Recording Overlay ============== */
.recording-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: none;
  flex-direction: column;
}
.recording-overlay.open { display: flex; }

.rec-screen {
  display: none;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  animation: slide-up 0.4s var(--ease);
}
.rec-screen.active { display: flex; }

@keyframes slide-up {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-header {
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.screen-step,
.screen-close {
  font-size: 11px;
  color: var(--fg-muted);
  cursor: pointer;
  letter-spacing: 1px;
}
.screen-body {
  flex: 1;
  padding: 0 32px;
  overflow-y: auto;
}
.screen-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.screen-footer {
  padding: 24px 32px 30px;
  flex-shrink: 0;
}
.screen-footer-row {
  display: flex;
  gap: 10px;
}

.screen-marker {
  font-size: 11px;
  color: var(--fg-faded);
  letter-spacing: 4px;
  margin-bottom: 60px;
}

.screen-title {
  font-size: 26px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}
.screen-title-large {
  font-size: 32px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -1px;
  margin-bottom: 16px;
}
.screen-desc {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.8;
  max-width: 260px;
  margin-bottom: 30px;
}
.screen-hint {
  font-size: 13px;
  color: var(--fg-muted);
  margin-bottom: 50px;
}
.screen-hint-small {
  font-size: 12px;
  color: var(--fg-faded);
}

/* الإذن */
.permission-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 0.5px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 36px;
}
.screen-points {
  list-style: none;
  text-align: right;
  margin-top: 20px;
  background: rgba(255,255,255,0.04);
  border: 0.5px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  width: 100%;
  max-width: 280px;
}
.screen-points li {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  padding: 8px 0;
  display: flex;
  gap: 10px;
  align-items: center;
}
.point-dot { color: var(--fg-faded); }

/* التسجيل */
.rec-indicator { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.rec-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #FF3B30;
  animation: blink 1.2s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.rec-timer {
  font-family: var(--font-en);
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 1px;
}
.wave-visualizer {
  display: flex;
  gap: 4px;
  align-items: center;
  height: 130px;
  margin-bottom: 60px;
}
.wave-bar {
  width: 3px;
  background: var(--fg);
  border-radius: 2px;
  height: 12px;
  transition: height 0.1s ease;
}
.progress {
  width: 240px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 1px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--fg);
  width: 0%;
  transition: width 0.3s linear;
}

/* المعالجة */
.process-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 280px;
  margin-top: 50px;
}
.proc-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  font-size: 12px;
  color: var(--fg-muted);
}
.proc-step.active {
  background: rgba(255,255,255,0.08);
  border: 0.5px solid var(--line-strong);
  color: var(--fg);
  font-weight: 500;
}
.proc-step.done .proc-icon { color: var(--fg); }
.proc-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.spinner {
  border: 1.5px solid var(--fg-subtle);
  border-top-color: var(--fg);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Proposal */
.proposal-desc {
  margin: 0 0 32px;
  max-width: 100%;
}
.proposal-rows { display: flex; flex-direction: column; }
.prop-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 22px 0;
  border-top: 0.5px solid var(--line);
}
.prop-row:last-child { border-bottom: 0.5px solid var(--line); }
.prop-label {
  font-size: 12px;
  color: var(--fg-faded);
  letter-spacing: 0.5px;
}
.prop-value {
  font-size: 14px;
  color: var(--fg);
  font-family: var(--font-ar);
}
.prop-value.numeric { font-family: var(--font-en); font-weight: 300; }

/* Form */
.form-fields { display: flex; flex-direction: column; gap: 28px; }
.field { }
.field-label {
  font-size: 11px;
  color: var(--fg-faded);
  letter-spacing: 1.5px;
  display: block;
  margin-bottom: 12px;
}
.field-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 0.5px solid var(--line-strong);
  padding: 8px 0 14px;
  color: var(--fg);
  font-size: 18px;
  outline: none;
  transition: border-color 0.3s var(--ease);
}
.field-input:focus { border-color: var(--fg); }
.field-input::placeholder { color: var(--fg-subtle); }

/* Success */
.request-code-card {
  background: rgba(255,255,255,0.04);
  border: 0.5px solid var(--line);
  border-radius: 14px;
  padding: 18px 24px;
  margin-top: 30px;
  width: 100%;
  max-width: 280px;
}
.request-code {
  font-family: var(--font-en);
  font-size: 18px;
  letter-spacing: 2px;
  margin-top: 8px;
}
.playback-time {
  font-family: var(--font-en);
  font-size: 16px;
  letter-spacing: 2px;
  font-weight: 300;
  margin: 30px 0 8px;
}

/* ============== Buttons ============== */
.btn {
  width: 100%;
  padding: 16px 24px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-ar);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:active { transform: scale(0.98); }
.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
  border: 0.5px solid var(--line-strong);
  flex: 1;
}
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 0.5px solid rgba(255,255,255,0.2);
}

.screen-footer-row .btn-primary { flex: 1.5; }

/* ============== Reveal on Scroll ============== */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s var(--ease);
}
.reveal-on-scroll.visible { opacity: 1; transform: translateY(0); }

/* ============== Responsive ============== */
@media (min-width: 768px) {
  .hero-title { font-size: 72px; }
  .section-title { font-size: 48px; }
  .stat-num { font-size: 100px; }
  .floating-nav { gap: 36px; }
  .screen-body { max-width: 480px; margin: 0 auto; }
}

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

/* تعطيل scroll body عند فتح overlay */
body.overlay-open {
  overflow: hidden;
}
