/* ===== هوية Lingua Studio ===== */
:root {
  --paper: #f7f3ec;
  --paper-2: #ece4d6;
  --ink: #1d2430;
  --ink-soft: #55606e;
  --primary: #1f5a7a;
  --primary-2: #2a7396;
  --saffron: #d9a441;
  --clay: #b5532f;
  --wa: #1f8f55;
  --radius: 18px;
  --shadow: 0 18px 40px -18px rgba(29, 36, 48, .45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: "Cairo", system-ui, sans-serif;
  background: var(--paper); color: var(--ink); line-height: 1.85; overflow-x: hidden;
  /* ورق مسطّر خفيف */
  background-image: linear-gradient(rgba(31,90,122,.05) 1px, transparent 1px);
  background-size: 100% 34px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* الرأس */
.site-header {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 5vw; background: rgba(247,243,236,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(29,36,48,.08);
}
.logo { display: flex; align-items: center; gap: .6rem; }
.logo-mark { position: relative; width: 44px; height: 38px; }
.logo-mark b, .logo-mark i {
  position: absolute; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  font-style: normal; font-weight: 800; font-size: 1rem;
}
.logo-mark b { left: 0; top: 0; background: var(--primary); color: #fff; }
.logo-mark i { right: 0; bottom: 0; background: var(--saffron); color: var(--ink); box-shadow: 0 0 0 3px var(--paper); }
.logo-text { font-size: 1.45rem; font-weight: 800; color: var(--primary); letter-spacing: .3px; }
.logo-text em, .footer-logo em { font-style: normal; font-weight: 400; color: var(--clay); }
.nav { display: flex; align-items: center; gap: 1.6rem; font-weight: 600; }
.nav a[aria-current="page"] { color: var(--primary); box-shadow: 0 2px 0 var(--saffron); }
.nav-wa { background: var(--wa); color: #fff; padding: .35rem 1.1rem; border-radius: 99px; }
.menu-btn { display: none; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--ink); }

/* أزرار */
.btn { display: inline-block; font: inherit; font-weight: 700; padding: .75rem 1.6rem; border-radius: 99px; border: 0; cursor: pointer; transition: transform .25s, box-shadow .25s, background .25s, color .25s; }
.btn:hover { transform: translateY(-3px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 10px 24px -10px var(--primary); }
.btn-ghost { border: 2px solid var(--primary); color: var(--primary); }
.btn-ghost:hover { background: var(--primary); color: #fff; }
.btn-wa { background: var(--wa); color: #fff; box-shadow: 0 10px 22px -12px var(--wa); }
.btn-light { background: var(--paper); color: var(--ink); }

/* الأقسام */
.section { padding: 5rem 6vw; }
.section-title { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 800; margin-bottom: 2rem; position: relative; display: inline-block; }
.section-title::after { content: ""; position: absolute; right: 0; bottom: .1em; width: 60%; height: .35em; background: var(--saffron); opacity: .35; z-index: -1; border-radius: 4px; }
.kicker { font-family: "Aref Ruqaa", serif; color: var(--clay); font-size: 1.45rem; }
.muted { color: var(--ink-soft); font-size: .95rem; }

/* البطل */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center; padding: 3.5rem 6vw 4.5rem; min-height: calc(100vh - 70px); overflow-x: clip; }
.hero h1 { font-size: clamp(2.2rem, 4.8vw, 3.8rem); line-height: 1.3; font-weight: 800; color: var(--primary); }
.hero h1 span { color: var(--ink); }
.lead { font-size: 1.15rem; color: var(--ink-soft); margin: 1.2rem 0 2rem; max-width: 48ch; }
.lead b { color: var(--primary); }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-facts { list-style: none; display: flex; gap: 2rem; margin-top: 2.4rem; flex-wrap: wrap; }
.hero-facts li { color: var(--ink-soft); font-size: .95rem; }
.hero-facts strong { display: block; font-size: 1.45rem; color: var(--clay); }

/* مكعب الكلمات ثلاثي الأبعاد */
.cube-scene { position: relative; height: 440px; perspective: 1000px; display: grid; place-items: center; cursor: grab; touch-action: pan-y; }
.cube-scene:active { cursor: grabbing; }
.word-cube { --s: 200px; width: var(--s); height: var(--s); position: relative; transform-style: preserve-3d; transform: rotateX(-18deg) rotateY(30deg); }
.wf {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 22px;
  font-weight: 800; font-size: 2.1rem; color: #fff; border: 3px solid rgba(255,255,255,.7);
  background: linear-gradient(145deg, var(--primary), var(--primary-2));
  box-shadow: inset 0 0 40px rgba(0,0,0,.18); backface-visibility: hidden;
}
.wf span { backface-visibility: hidden; }
.w2, .w4 { background: linear-gradient(145deg, var(--saffron), #e8bd6b); color: var(--ink); }
.w5, .w6 { background: linear-gradient(145deg, var(--clay), #cf6c45); font-size: 4.5rem; }
.w1 { transform: translateZ(calc(var(--s) / 2)); }
.w2 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.w3 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.w4 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.w5 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.w6 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.chip {
  position: absolute; background: #fff; border-radius: 14px; padding: .35rem .9rem; font-weight: 700; font-size: .9rem;
  box-shadow: var(--shadow); animation: bob 5s ease-in-out infinite; pointer-events: none;
}
.chip::after { content: ""; position: absolute; bottom: -7px; right: 18px; border: 7px solid transparent; border-top-color: #fff; border-bottom: 0; }
.c1 { top: 12%; right: 8%; color: var(--primary); }
.c2 { top: 22%; left: 4%; color: var(--clay); animation-delay: -1.2s; }
.c3 { bottom: 16%; right: 2%; color: var(--clay); animation-delay: -2.4s; }
.c4 { bottom: 8%; left: 10%; color: var(--primary); animation-delay: -3.6s; }
@keyframes bob { 50% { transform: translateY(-12px); } }

/* الخدمات */
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.service { background: #fff; border-radius: var(--radius); padding: 2rem 1.6rem; box-shadow: var(--shadow); border-top: 6px solid var(--primary); transform-style: preserve-3d; transition: transform .2s ease-out; }
.service:nth-child(2) { border-color: var(--saffron); }
.service:nth-child(3) { border-color: var(--clay); }
.service-ico { font-size: 2.6rem; transform: translateZ(40px); }
.service h3 { font-size: 1.3rem; margin: .6rem 0; transform: translateZ(25px); }
.service p { color: var(--ink-soft); margin-bottom: 1rem; }
.service a { color: var(--primary); font-weight: 700; }

/* تجربة الترجمة: بطاقة تنقلب */
.demo { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; background: var(--ink); color: var(--paper); }
.demo p { font-size: 1.1rem; }
.demo .muted { color: #b9c2cc; margin-top: 1rem; }
.flip-wrap { text-align: center; }
.flip { width: 100%; max-width: 440px; height: 240px; border: 0; background: none; cursor: pointer; perspective: 1000px; font: inherit; }
.flip-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: .6rem;
  padding: 1.6rem; border-radius: 22px; font-size: 1.45rem; font-weight: 700; line-height: 1.6;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 25px 45px -20px rgba(0,0,0,.6);
}
.flip-face small { font-size: .8rem; font-weight: 600; opacity: .7; }
.flip-face.en { background: var(--paper); color: var(--primary); }
.flip-face.ar { background: var(--saffron); color: var(--ink); transform: rotateY(180deg); }
.flip-hint { margin-top: 1rem; color: #b9c2cc; font-size: .9rem; }

/* لماذا */
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.why-item { background: var(--paper-2); border-radius: var(--radius); padding: 1.6rem 1.3rem; border: 2px dashed rgba(29,36,48,.15); }
.why-item span { font-size: 2rem; }
.why-item h3 { font-size: 1.15rem; margin: .3rem 0; }
.why-item p { color: var(--ink-soft); font-size: .95rem; }

/* المؤسسة */
.founder-card {
  display: grid; grid-template-columns: 180px 1fr; gap: 2.5rem; align-items: center;
  background: linear-gradient(140deg, var(--primary), var(--primary-2)); color: var(--paper);
  border-radius: 28px; padding: 3rem; box-shadow: var(--shadow); transform-style: preserve-3d; transition: transform .2s ease-out;
}
.founder-card .kicker { color: var(--saffron); }
.founder-card h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
.founder-card p { margin: .5rem 0 1.4rem; max-width: 56ch; color: #dbe8ef; }
.founder-mark { position: relative; width: 170px; height: 150px; transform: translateZ(50px); }
.founder-mark b, .founder-mark i { position: absolute; display: grid; place-items: center; width: 110px; height: 110px; border-radius: 26px; font-style: normal; font-weight: 800; font-size: 3.4rem; box-shadow: 0 20px 30px -14px rgba(0,0,0,.5); }
.founder-mark b { left: 0; top: 0; background: var(--paper); color: var(--primary); }
.founder-mark i { right: 0; bottom: 0; background: var(--saffron); color: var(--ink); }

/* الصفحات الداخلية */
.page-hero { text-align: center; padding: 4rem 6vw 1rem; }
.page-hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); color: var(--primary); }
.page-hero p { color: var(--ink-soft); max-width: 62ch; margin: .8rem auto 0; font-size: 1.1rem; }

.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; padding-top: 2.5rem; }
.svc { background: #fff; border-radius: var(--radius); padding: 2rem 1.6rem; box-shadow: var(--shadow); display: flex; flex-direction: column; transform-style: preserve-3d; transition: transform .2s ease-out; scroll-margin-top: 90px; }
.svc-head { display: flex; align-items: center; gap: .8rem; }
.svc-ico { font-size: 2rem; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--paper-2); transform: translateZ(40px); }
.svc h2 { font-size: 1.3rem; }
.svc-desc { color: var(--ink-soft); margin: 1rem 0; }
.svc-list { list-style: none; flex: 1; margin-bottom: 1.4rem; }
.svc-list li { padding: .3rem 1.5rem .3rem 0; position: relative; }
.svc-list li::before { content: "✓"; position: absolute; right: 0; color: var(--wa); font-weight: 800; }
.svc-foot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; border-top: 1px dashed rgba(29,36,48,.2); padding-top: 1rem; }
.from { color: var(--ink-soft); font-size: .9rem; }
.from strong { font-size: 1.6rem; color: var(--primary); }
.svc-foot .btn { padding: .55rem 1.2rem; }

.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.steps li { background: var(--paper-2); border-radius: var(--radius); padding: 1.6rem 1.3rem; border: 2px dashed rgba(29,36,48,.15); }
.step-n { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--primary); color: var(--saffron); font-weight: 800; font-size: 1.3rem; margin-bottom: .6rem; }
.steps h3 { font-size: 1.15rem; }
.steps p { color: var(--ink-soft); font-size: .95rem; }

/* التواصل */
.contact-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: start; padding-top: 2.5rem; }
.order-form { background: #fff; border-radius: 24px; padding: 2rem; box-shadow: var(--shadow); display: grid; gap: 1rem; transform-style: preserve-3d; transition: transform .2s ease-out; }
.order-form h2 { font-size: 1.4rem; color: var(--primary); }
.order-form label { display: grid; gap: .3rem; font-weight: 600; font-size: .95rem; }
.order-form input, .order-form select {
  font: inherit; font-weight: 400; padding: .65rem .9rem; border-radius: 12px; border: 2px solid var(--paper-2); background: var(--paper); color: var(--ink);
}
.order-form input:focus, .order-form select:focus { outline: none; border-color: var(--primary); }
.order-form .btn { justify-self: start; margin-top: .4rem; }
.contact-side { display: grid; gap: 1.2rem; }
.contact-card { background: #fff; border-radius: var(--radius); padding: 1.5rem 1.4rem; text-align: center; box-shadow: var(--shadow); transform-style: preserve-3d; transition: transform .2s ease-out; }
.contact-card.wa { background: linear-gradient(150deg, var(--primary), var(--primary-2)); color: var(--paper); }
.contact-card.wa p { color: #dbe8ef; }
.c-ico { font-size: 2rem; transform: translateZ(40px); }
.contact-card h2 { font-size: 1.2rem; margin: .2rem 0; }
.contact-card .btn { margin-top: .8rem; }
.contact-card a[dir] { color: var(--primary); font-weight: 700; }
.faq details { background: #fff; border-radius: 14px; margin-bottom: .9rem; box-shadow: 0 8px 20px -16px rgba(0,0,0,.5); overflow: hidden; }
.faq summary { cursor: pointer; padding: 1rem 1.3rem; font-weight: 700; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; left: 1.3rem; color: var(--clay); font-size: 1.4rem; line-height: 1.4; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 1.3rem 1.2rem; color: var(--ink-soft); }

/* التذييل */
.site-footer { background: var(--ink); color: #c5ccd5; margin-top: 3rem; border-top: 6px solid var(--saffron); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.6fr; gap: 2rem; padding: 3rem 6vw 1.5rem; }
.footer-grid a, .footer-grid > div > span { display: block; margin-bottom: .3rem; }
.footer-grid a span { display: inline; }
.footer-grid a:hover { color: var(--saffron); }
.footer-grid p a { display: inline; color: var(--saffron); }
.footer-logo { font-size: 1.8rem; font-weight: 800; color: #fff; text-align: right; }
.footer-h { color: #fff; font-weight: 700; margin-bottom: .5rem; }
.copy { text-align: center; padding: 1rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .85rem; }

.wa-float { position: fixed; bottom: 20px; left: 20px; z-index: 60; width: 56px; height: 56px; border-radius: 50%; background: var(--wa); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 25px -8px rgba(0,0,0,.5); transition: transform .25s; }
.wa-float:hover { transform: scale(1.1) rotate(-8deg); }
.wa-float svg { width: 30px; height: 30px; }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s ease; }
.reveal.shown { opacity: 1; transform: none; }

/* الجوال */
@media (max-width: 1000px) {
  .svc-grid, .service-grid { grid-template-columns: 1fr; }
  .steps, .why-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav { position: absolute; top: 100%; right: 0; left: 0; flex-direction: column; gap: 1rem; background: var(--paper); padding: 1.2rem; border-bottom: 1px solid rgba(29,36,48,.1); display: none; }
  .nav.open { display: flex; }
  .hero, .demo { grid-template-columns: 1fr; }
  .hero { text-align: center; min-height: auto; padding-top: 1.5rem; }
  .lead { margin-inline: auto; }
  .hero-actions, .hero-facts { justify-content: center; }
  .cube-scene { height: 300px; order: -1; }
  .word-cube { --s: 140px; }
  .wf { font-size: 1.5rem; }
  .w5, .w6 { font-size: 3rem; }
  .chip { font-size: .8rem; }
  .section { padding: 3.5rem 6vw; }
  .steps, .why-grid { grid-template-columns: 1fr; }
  .flip { height: 220px; }
  .flip-face { font-size: 1.2rem; }
  .founder-card { grid-template-columns: 1fr; text-align: center; padding: 2.2rem 1.4rem; }
  .founder-mark { margin: 0 auto; width: 140px; height: 120px; }
  .founder-mark b, .founder-mark i { width: 88px; height: 88px; font-size: 2.6rem; }
  .founder-card p { margin-inline: auto; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-logo { text-align: center; }
  .order-form .btn { justify-self: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
