/* Q Products — qproductshub.tech
   التوقيع: خط الإنتاج. يخرج من حلقة Q في الواجهة، ثم يصبح المحور العمودي الذي تتفرع منه محطات المنتجات. */

@font-face { font-family: 'Plex Arabic'; font-weight: 400; font-display: swap; src: url(/static/fonts/plex-arabic-arabic-400.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Plex Arabic'; font-weight: 500; font-display: swap; src: url(/static/fonts/plex-arabic-arabic-500.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Plex Arabic'; font-weight: 600; font-display: swap; src: url(/static/fonts/plex-arabic-arabic-600.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Plex Arabic'; font-weight: 700; font-display: swap; src: url(/static/fonts/plex-arabic-arabic-700.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Plex Arabic'; font-weight: 400; font-display: swap; src: url(/static/fonts/plex-arabic-latin-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Plex Arabic'; font-weight: 500; font-display: swap; src: url(/static/fonts/plex-arabic-latin-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Plex Arabic'; font-weight: 600; font-display: swap; src: url(/static/fonts/plex-arabic-latin-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Plex Arabic'; font-weight: 700; font-display: swap; src: url(/static/fonts/plex-arabic-latin-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Plex Mono'; font-weight: 500; font-display: swap; src: url(/static/fonts/plex-mono-500.woff2) format('woff2'); }
@font-face { font-family: 'Plex Mono'; font-weight: 600; font-display: swap; src: url(/static/fonts/plex-mono-600.woff2) format('woff2'); }
@font-face { font-family: 'Syncopate'; font-weight: 700; font-display: swap; src: url(/static/fonts/syncopate-700.woff2) format('woff2'); }

:root {
  --ink: #13204A;         /* المعمل */
  --ink-deep: #0C1636;    /* خلفية المعمل */
  --out: #0A9E88;         /* المنتج */
  --glow: #3CE0C3;        /* المنتج على الداكن */
  --paper: #F3F6F9;
  --card: #FFFFFF;
  --text: #101B3D;
  --muted: #56647F;
  --steel: #8190AD;
  --rule: #D7DFE9;
  --amber: #B7791F;
  --radius: 18px;
  --wrap: 1120px;
  --rail: 3px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--text); font: 400 1rem/1.75 'Plex Arabic', system-ui, 'Segoe UI', sans-serif; }
.lang-en { line-height: 1.6; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
.lang-ar h1, .lang-ar h2, .lang-ar h3 { letter-spacing: 0; line-height: 1.35; }
p { margin: 0; }
.mono { font-family: 'Plex Mono', ui-monospace, Consolas, monospace; letter-spacing: 0.06em; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--glow); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; inset-inline-start: 16px; top: -60px; z-index: 10; background: var(--glow); color: var(--ink-deep); padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; }

/* ——— الأزرار ——— */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 12px; font: inherit; font-weight: 600; text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: transform .15s ease, background-color .15s ease, border-color .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-glow { background: var(--glow); color: var(--ink-deep); }
.btn-glow:hover { background: #5FEAD1; }
.btn-line { border-color: rgba(255,255,255,.35); color: #fff; }
.btn-line:hover { border-color: var(--glow); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #1C2D63; }
.btn-ghost { border-color: var(--rule); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--out); color: var(--out); }

/* ——— الترويسة ——— */
.top { position: fixed; inset-inline: 0; top: 0; z-index: 20; background: rgba(12,22,54,.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255,255,255,.08); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
/* الترويسة ثابتة: كل قسم يتوقف تحتها لا خلفها */
section[id], [id^="q-"] { scroll-margin-top: 84px; }
.brand svg { height: 30px; width: auto; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: rgba(255,255,255,.78); text-decoration: none; font-weight: 500; padding: 8px 12px; border-radius: 10px; font-size: .95rem; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav .lang { border: 1px solid rgba(255,255,255,.25); margin-inline-start: 6px; }
.nav a[aria-current="page"] { color: #fff; background: rgba(60,224,195,.14); }
.mnav { display: none; }

/* ——— الواجهة: المعمل ——— */
.hero { position: relative; overflow: hidden; background: radial-gradient(900px 480px at 85% 0%, rgba(60,224,195,.10), transparent 60%), var(--ink-deep); color: #fff; padding: 150px 0 0; }
.grid-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(to bottom, #000 40%, transparent 100%); pointer-events: none; }
.hero-in { position: relative; max-width: 760px; margin-inline-start: max(16px, (100% - var(--wrap)) / 2); }
.eyebrow { color: var(--glow); font-size: .78rem; font-weight: 600; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.1rem, 5.2vw, 4.1rem); font-weight: 700; }
.lead { margin-top: 20px; font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: rgba(255,255,255,.76); max-width: 620px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* خط الإنتاج يخرج من حلقة Q ويمتد خارج حافة الشاشة؛ الأسماء تمر عليه بالتتابع */
.line-stage { position: relative; margin-top: 64px; padding-inline-start: max(16px, (100% - var(--wrap)) / 2); padding-bottom: 56px; overflow: hidden; }
.hero-line { height: clamp(92px, 12vw, 164px); width: auto; max-width: none; }
.hero-line path:first-of-type { opacity: 0; animation: fade .6s ease-out .1s forwards; }
.hero-line path:nth-of-type(2) { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 1.8s cubic-bezier(.6,.05,.2,1) .35s forwards; }
.hero-line .hw { opacity: 0; animation: pass calc(var(--n) * 3.2s) linear calc(1.6s + var(--i) * 3.2s) infinite; }
@keyframes fade { to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pass {
  0% { opacity: 0; transform: translateX(-40px); }
  5% { opacity: 1; transform: translateX(0); }
  21% { opacity: 1; transform: translateX(14px); }
  25% { opacity: 0; transform: translateX(170px); }
  100% { opacity: 0; transform: translateX(170px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-line path { animation: none !important; opacity: 1 !important; stroke-dashoffset: 0 !important; }
  .hero-line .hw { animation: none; }
  .hero-line .hw:first-of-type { opacity: 1; }
}

/* ——— خط الإنتاج: المحطات ——— */
.line-sec { padding: 96px 0 64px; }
.sec-head { max-width: 640px; margin-bottom: 48px; }
.sec-head h2, .how h2, .about h2, .contact h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 700; color: var(--ink); }
.sec-head p { margin-top: 12px; color: var(--muted); font-size: 1.08rem; }

.line { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 28px; }
.line::before { content: ''; position: absolute; inset-inline-start: 11px; top: 8px; bottom: 8px; width: var(--rail); border-radius: 3px; background: linear-gradient(to bottom, var(--ink), var(--out)); }
.station { position: relative; display: grid; grid-template-columns: 26px 38px 1fr; align-items: start; }
.node { grid-column: 1; margin-top: 42px; width: 25px; height: 25px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink); position: relative; z-index: 1; }
.branch { grid-column: 2; margin-top: 53px; height: var(--rail); background: var(--ink); }
.card { grid-column: 3; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 26px 28px; box-shadow: 0 1px 2px rgba(19,32,74,.04); }

/* الحالة الحقيقية مرسومة على النقطة والفرع */
.st-live .node { background: var(--out); border-color: var(--out); box-shadow: 0 0 0 6px rgba(10,158,136,.16); }
.st-live .branch { background: var(--out); }
.st-live .card { border-color: rgba(10,158,136,.45); }
.st-ready .node { background: var(--card); border-color: var(--out); }
.st-ready .branch { background: var(--out); }
.st-building .node { border-style: dashed; border-color: var(--amber); }
.st-building .branch { background: repeating-linear-gradient(to right, var(--amber) 0 6px, transparent 6px 11px); }
.st-soon .node { border-color: var(--steel); }
.st-soon .branch { background: var(--steel); }

.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.lockup svg { height: 34px; width: auto; }
.chip { font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.chip-live { background: rgba(10,158,136,.12); color: #07705F; }
.chip-ready { background: rgba(10,158,136,.07); color: #0B6F61; border: 1px solid rgba(10,158,136,.3); }
.chip-building { background: rgba(183,121,31,.12); color: #8A5A12; }
.chip-soon { background: #EDF1F6; color: var(--muted); }
.card h3 { margin-top: 18px; font-size: 1.3rem; font-weight: 700; color: var(--ink); }
.desc { margin-top: 8px; color: var(--muted); max-width: 68ch; }
.plat { margin-top: 14px; font-size: .74rem; color: var(--steel); font-weight: 500; }
.ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* ——— كيف نبني ——— */
.how { padding: 64px 0; }
.how-list { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.how-list li { position: relative; padding-top: 22px; }
.how-list li::before { content: ''; position: absolute; top: 0; inset-inline-start: 0; width: 56px; height: var(--rail); border-radius: 3px; background: var(--out); }
.how-list h3 { font-size: 1.15rem; color: var(--ink); font-weight: 700; }
.how-list p { margin-top: 8px; color: var(--muted); }

/* ——— من نحن ——— */
.about { padding: 64px 0; }
.about-in { display: grid; grid-template-columns: 160px 1fr; gap: 40px; align-items: center; background: var(--card); border: 1px solid var(--rule); border-radius: 24px; padding: 40px; }
.about-mark svg { width: 150px; height: auto; }
.about p { margin-top: 14px; color: var(--muted); font-size: 1.06rem; max-width: 70ch; }

/* ——— تواصل ——— */
.contact { padding: 64px 0 96px; }
.contact-in { display: grid; grid-template-columns: 1fr 1.25fr; gap: 48px; align-items: start; }
.contact-side > p { margin-top: 12px; color: var(--muted); }
.reach { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.reach a { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 12px; background: var(--card); text-decoration: none; font-weight: 600; color: var(--ink); }
.reach a:hover { border-color: var(--out); }
.reach a span { color: var(--muted); font-weight: 500; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; background: var(--card); border: 1px solid var(--rule); border-radius: 22px; padding: 28px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; color: var(--ink); }
.form .full { grid-column: 1 / -1; }
.form input, .form select, .form textarea { font: inherit; font-weight: 400; color: var(--text); background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: 11px 14px; min-height: 46px; width: 100%; }
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--out); box-shadow: 0 0 0 3px rgba(10,158,136,.18); background: #fff; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; opacity: 0; }
.note { grid-column: 1 / -1; padding: 12px 14px; border-radius: 12px; font-weight: 600; }
.note.ok { background: rgba(10,158,136,.1); color: #07705F; }
.note.bad { background: #FDECEC; color: #9B1C1C; }

/* ——— التذييل ——— */
.foot { border-top: 1px solid var(--rule); padding: 28px 0; background: var(--card); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: .9rem; }
.foot-brand svg { height: 24px; width: auto; }
.foot .lang { font-weight: 600; color: var(--ink); text-decoration: none; border: 1px solid var(--rule); padding: 6px 12px; border-radius: 10px; }

/* ——— الشاشات الصغيرة ——— */
@media (max-width: 860px) {
  .nav a:not(.lang) { display: none; }
  /* على الهاتف: صف روابط الأقسام تحت الترويسة، يتمرر أفقياً */
  .mnav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 0 12px 10px; }
  .mnav::-webkit-scrollbar { display: none; }
  .mnav a { flex: none; color: rgba(255,255,255,.82); text-decoration: none; font-size: .9rem; font-weight: 500; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); }
  .mnav a[aria-current="page"] { border-color: var(--glow); color: #fff; }
  section[id], [id^="q-"] { scroll-margin-top: 120px; }
  .top-in { min-height: 60px; }
  .how-list { grid-template-columns: 1fr; }
  .about-in { grid-template-columns: 1fr; padding: 28px; gap: 20px; }
  .about-mark svg { width: 88px; }
  .contact-in { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  .hero { padding-top: 140px; }
  .station { grid-template-columns: 26px 16px 1fr; }
  .card { padding: 20px; }
  .lockup svg { height: 28px; }
  .form { grid-template-columns: 1fr; padding: 20px; }
  .brand svg { height: 24px; }
  /* الاسم يبقى داخل الشاشة: الخط أقصر ارتفاعاً على الهاتف */
  .hero-line { height: 62px; }
  .line-stage { margin-top: 44px; padding-bottom: 40px; }
}
