/* هبوط لوحة — فوق tokens.css. داكن فاخر افتراضيًا، وفاتح حقيقي كامل.
   قواعد العربية الملزمة: لا letter-spacing، line-height ≥ 1.4، لا وزن فوق 700. */

body { min-height: 100dvh; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 22px; position: relative; }

/* ─── طبقة الفن السينمائية (مولدة) خلف البطل — بارالاكس ناعم بالتمرير ─── */
.hero-art {
  position: absolute; inset: 0 0 auto 0; height: 130vh; z-index: -1;
  background: url('/assets/hero-art.webp') center -8vh / cover no-repeat;
  opacity: 0.5;
  transform: translateY(calc(var(--par, 0) * -0.16px));
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 46%, transparent 92%);
  mask-image: linear-gradient(180deg, #000 0%, #000 46%, transparent 92%);
  pointer-events: none;
}
:root[data-theme='light'] .hero-art { opacity: 0.14; }

/* ─── ظهور تدريجي بالتمرير ─── */
.io { opacity: 0; transform: translateY(22px); transition: opacity 0.65s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.65s cubic-bezier(0.2, 0.7, 0.2, 1); }
.io.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .io { opacity: 1; transform: none; } .hero-art { transform: none; } }

.top .enter {
  margin-inline-start: auto; color: var(--text-2); font-size: 13.5px; font-weight: 700;
  text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px;
  transition: border-color 0.2s, color 0.2s;
}
.top .enter:hover { border-color: var(--primary); color: var(--text); }
.top .enter + .from { margin-inline-start: 0; }

/* ─── الترويسة ─── */
.top {
  display: flex; align-items: center; gap: 12px; padding: 22px 0 8px; min-width: 0;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.brand .mark-img {
  width: 34px; height: 34px; display: block;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* لوح خلفي يضمن قراءة العلامة فوق الفن السينمائي */
.brand .mark-plate {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line-2);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), 0 0 24px var(--mint-glow);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand:hover .mark-img { transform: rotate(-4deg) scale(1.08); }
.bthr-sym { display: block; }
.brand b { font-size: 19px; }
.brand small { display: block; color: var(--text-3); font-size: 11.5px; font-weight: 400; }
.top .from {
  margin-inline-start: auto; color: var(--text-3); font-size: 13px; text-decoration: none;
  display: flex; align-items: center; gap: 8px; flex: none;
}
.top .from:hover { color: var(--text-2); }
.top .from .b-dot {
  width: 24px; height: 24px; border-radius: 8px;
  background: linear-gradient(145deg, var(--mint), var(--primary));
  display: grid; place-items: center; color: var(--on-primary); font-size: 12px; font-weight: 700;
}

/* ─── البطل ─── */
.hero { text-align: center; padding: 52px 0 26px; }
.hero h1 { font-size: clamp(30px, 5.4vw, 50px); font-weight: 700; line-height: 1.45; }
.hero h1 .glow {
  background: linear-gradient(120deg, var(--mint), var(--primary-ink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub {
  color: var(--text-2); font-size: clamp(15.5px, 2.2vw, 18.5px); line-height: 1.8;
  max-width: 620px; margin: 14px auto 0;
}

/* ─── صندوق الوصف ─── */
.composer {
  max-width: 700px; margin: 30px auto 0; text-align: start;
  background: var(--glass); border: 1px solid var(--line-2); border-radius: 22px;
  box-shadow: var(--shadow); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  padding: 18px; animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both 0.1s;
}
.composer textarea {
  width: 100%; min-height: 96px; resize: vertical; border: 0; background: none;
  color: var(--text); font-family: inherit; font-size: 17.5px; line-height: 1.8; outline: none;
  padding: 6px 4px;
}
.composer textarea::placeholder { color: var(--text-3); }
.c-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line-3); }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line-3); border-radius: 999px; padding: 3px; gap: 3px; }
.seg-btn {
  border: 0; background: none; color: var(--text-2); font-family: inherit;
  font-size: 13px; font-weight: 600; padding: 7px 15px; border-radius: 999px; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-soft); }
.go {
  margin-inline-start: auto; border: 0; cursor: pointer; font-family: inherit;
  background: linear-gradient(160deg, var(--mint), var(--primary)); color: var(--on-primary);
  font-size: 15.5px; font-weight: 700; border-radius: 999px; padding: 12px 26px;
  box-shadow: 0 10px 26px var(--mint-glow); display: inline-flex; align-items: center; gap: 8px;
  transition: transform 0.15s, box-shadow 0.2s;
}
.go:hover { transform: translateY(-1px); box-shadow: 0 14px 32px var(--mint-glow); }
.go:active { transform: scale(0.985); }
.go:disabled { opacity: 0.6; transform: none; cursor: default; }
.go svg { width: 17px; height: 17px; }
.quota-note { color: var(--text-3); font-size: 12.5px; width: 100%; }
.c-error { color: var(--danger); font-size: 13.5px; line-height: 1.7; padding-top: 8px; display: none; }

/* ─── الأمثلة ─── */
.examples { max-width: 700px; margin: 16px auto 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ex {
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2);
  font-family: inherit; font-size: 13px; font-weight: 600; border-radius: 999px;
  padding: 8px 16px; cursor: pointer; transition: border-color 0.15s, color 0.15s, transform 0.15s;
  display: inline-flex; align-items: center; gap: 7px;
}
.ex svg { width: 15px; height: 15px; color: var(--primary); }
.ex:hover { border-color: var(--primary); color: var(--text); transform: translateY(-1px); }

/* ─── المعاينة ─── */
.preview { padding: 60px 0 10px; text-align: center; }
.preview h2 { font-size: clamp(22px, 3.4vw, 30px); font-weight: 700; line-height: 1.5; }
.preview .p-sub { color: var(--text-2); font-size: 15.5px; margin-top: 8px; }
.shot {
  margin: 26px auto 0; max-width: 920px; border-radius: 22px; overflow: hidden;
  border: 1px solid var(--line-2); box-shadow: var(--shadow);
  background: var(--surface);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s;
  transform: perspective(1200px) rotateX(calc(var(--ty, 0) * 1deg)) rotateY(calc(var(--tx, 0) * 1deg));
}
.shot:hover { box-shadow: 0 26px 70px rgba(0, 0, 0, 0.45), 0 0 40px var(--mint-glow); }
.shot img { display: block; width: 100%; height: auto; }

/* الأزرار الرئيسة مغناطيسية — تتبع المؤشر بلطف */
.go, .try-now { transform: translate(calc(var(--mx, 0) * 1px), calc(var(--my, 0) * 1px)); will-change: transform; }
.try-now {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 14.5px; font-weight: 700; border-radius: 999px;
  padding: 11px 24px; cursor: pointer; transition: border-color 0.2s, transform 0.15s;
}
.try-now:hover { border-color: var(--primary); transform: translateY(-1px); }
.try-now svg { width: 16px; height: 16px; color: var(--primary); }

/* ─── كيف تعمل ─── */
.how { padding: 60px 0 0; }
.how h2, .feats h2 { font-size: clamp(22px, 3.4vw, 30px); font-weight: 700; text-align: center; line-height: 1.5; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 28px; }
.step {
  background: var(--glass); border: 1px solid var(--line-2); border-radius: 20px; padding: 22px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); min-width: 0;
}
.step .s-n {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--mint-glow); color: var(--primary-ink); font-weight: 700; font-size: 15px;
  margin-bottom: 12px; font-variant-numeric: tabular-nums;
}
.step h3 { font-size: 16.5px; font-weight: 700; line-height: 1.5; }
.step p { color: var(--text-2); font-size: 13.5px; line-height: 1.8; margin-top: 6px; }

/* ─── الميزات ─── */
.feats { padding: 60px 0 0; }
.f-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-top: 28px; }
.feat {
  display: flex; gap: 12px; align-items: flex-start; min-width: 0;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 16px 18px;
}
.feat svg { width: 20px; height: 20px; color: var(--primary); flex: none; margin-top: 2px; }
.feat b { font-size: 14.5px; display: block; line-height: 1.5; }
.feat span { color: var(--text-2); font-size: 12.5px; line-height: 1.7; }

/* ─── الخاتمة ─── */
.closer { text-align: center; padding: 70px 0 30px; }
.closer h2 { font-size: clamp(24px, 3.8vw, 34px); font-weight: 700; line-height: 1.5; }
.closer .go { margin: 22px auto 0; }
footer {
  text-align: center; color: var(--text-3); font-size: 13px; padding: 30px 0 38px; line-height: 1.9;
  border-top: 1px solid var(--line-3); margin-top: 30px;
}
.foot-lockup {
  display: inline-flex; align-items: center; gap: 13px; text-decoration: none;
  color: var(--text-2); text-align: start;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.foot-lockup:hover { transform: translateY(-2px); }
.foot-lockup img { filter: drop-shadow(0 6px 18px rgba(0, 212, 184, 0.25)); }
.foot-lockup b { display: block; font-size: 16px; color: var(--text); line-height: 1.5; }
.foot-lockup small { display: block; font-size: 11.5px; color: var(--text-3); }
.foot-line { margin-top: 14px; color: var(--text-3); }

/* وهج يتبع المؤشر — طبقة فخامة هادئة */
.cursor-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(340px 340px at calc(var(--cx, 50) * 1px) calc(var(--cy, -200) * 1px),
    var(--mint-glow), transparent 70%);
  opacity: 0.8;
}
@media (pointer: coarse) { .cursor-glow { display: none; } }
.wrap { z-index: 1; }

/* ─── مسرح التوليد ─── */
.theater {
  position: fixed; inset: 0; z-index: 50; display: none; place-items: center; padding: 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.theater.on { display: grid; }
.t-card {
  width: 100%; max-width: 460px; text-align: center;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 24px;
  box-shadow: var(--shadow); padding: 34px 28px;
  animation: rise 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.t-mark {
  width: 62px; height: 62px; border-radius: 19px; margin: 0 auto 18px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--mint), var(--primary)); color: var(--on-primary);
  box-shadow: 0 14px 36px var(--mint-glow);
}
.t-mark svg { width: 30px; height: 30px; }
.t-card.working .t-mark { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); box-shadow: 0 18px 44px var(--mint-glow); } }
.t-steps { display: grid; gap: 13px; text-align: start; margin: 20px 0 4px; }
.t-step { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 15px; font-weight: 600; transition: color 0.3s; }
.t-step .t-dot {
  width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; flex: none;
  border: 1px solid var(--line); color: transparent; transition: all 0.3s;
}
.t-step .t-dot svg { width: 14px; height: 14px; }
.t-step.now { color: var(--text); }
.t-step.now .t-dot { border-color: var(--primary); background: var(--mint-glow); color: var(--primary); animation: pulse 1.2s ease-in-out infinite; }
.t-step.done { color: var(--text-2); }
.t-step.done .t-dot { border-color: var(--primary); background: var(--primary); color: var(--on-primary); animation: none; }
.t-reveal h2 { font-size: 22px; font-weight: 700; line-height: 1.5; margin-bottom: 4px; }
.t-reveal p { color: var(--text-2); font-size: 14px; line-height: 1.8; }
.t-reveal .t-name { color: var(--primary-ink); }
.t-open {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; width: 100%;
  justify-content: center; border: 0; cursor: pointer; font-family: inherit;
  background: linear-gradient(160deg, var(--mint), var(--primary)); color: var(--on-primary);
  font-size: 16px; font-weight: 700; border-radius: 999px; padding: 14px 26px;
  box-shadow: 0 10px 26px var(--mint-glow); text-decoration: none;
  transition: transform 0.15s;
}
.t-open:hover { transform: translateY(-1px); }
.t-err { color: var(--danger); font-size: 14px; line-height: 1.8; margin-top: 14px; display: none; }
.t-cancel { border: 0; background: none; color: var(--text-3); font-family: inherit; font-size: 13px; margin-top: 14px; cursor: pointer; }
.t-cancel:hover { color: var(--text-2); }

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

@media (max-width: 640px) {
  .hero { padding-top: 34px; }
  .composer { padding: 14px; }
  .go { width: 100%; justify-content: center; }
  .c-foot { flex-direction: column; align-items: stretch; }
  .seg { justify-content: center; }
}
