/* ============================================================
   Clementine Labs - Main stylesheet
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --orange:        #e99923;
  --orange-deep:   #d17f29;
  --yellow:        #f8c97b;
  --yellow-bright: #fbc321;
  --cream:         #f9e9d3;
  --cream-soft:    #fdf3e4;
  --cream-lift:    #fffaf1;
  --brown:         #683f1e;
  --brown-soft:    #8a5c34;
  --blue:          #2b56a6;
  --blue-deep:     #1e4493;
  --ink:           #22386e;

  --maxw: 1180px;
  --radius: 22px;
  --radius-lg: 34px;
  --shadow-sm: 0 6px 20px rgba(104, 63, 30, .08);
  --shadow-md: 0 18px 50px rgba(104, 63, 30, .14);
  --shadow-blue: 0 24px 60px rgba(30, 68, 147, .28);

  --serif: "Orange Squash", Georgia, "Times New Roman", serif;
  --sans:  "IBM Plex Sans Arabic", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  color: var(--brown);
  background: var(--cream);
  line-height: 1.65;
  font-size: 18px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Language visibility ----------
   Uses html[data-lang=…] + !important so these always win over
   component rules that also set `display` on spans/links. */
html[data-lang="en"] .lang-ar { display: none !important; }
html[data-lang="ar"] .lang-en { display: none !important; }
html[data-lang="ar"] { direction: rtl; }
html[data-lang="ar"] body { font-weight: 400; }
/* Latin brand terms inside Arabic stay LTR */
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
section { position: relative; }
.eyebrow {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: .74rem;
  color: var(--orange-deep);
  margin: 0 0 18px;
}
html[data-lang="ar"] .eyebrow { letter-spacing: 0; font-size: .9rem; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.02; margin: 0; }
h2.section-title {
  font-size: clamp(2.3rem, 5.5vw, 3.9rem);
  color: var(--brown);
  letter-spacing: -0.01em;
}
html[data-lang="ar"] h1,
html[data-lang="ar"] h2,
html[data-lang="ar"] h3 { font-family: var(--sans); font-weight: 600; line-height: 1.25; }

.lede { font-size: 1.18rem; color: var(--brown-soft); max-width: 60ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6em;
  padding: 15px 28px;
  border-radius: 999px;
  font-weight: 600; font-size: 1rem;
  border: 2px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, color .25s;
  white-space: nowrap;
}
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 10px 24px rgba(233,153,35,.35); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(233,153,35,.45); }
.btn-ghost { background: transparent; color: var(--brown); border-color: rgba(104,63,30,.28); }
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--brown); background: rgba(104,63,30,.05); }
.btn-white { background: #fff; color: var(--blue-deep); }
.btn-white:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.btn-outline-white { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn-outline-white:hover { transform: translateY(-3px); background: rgba(255,255,255,.12); border-color:#fff; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  transition: background .3s, box-shadow .3s, padding .3s;
  padding: 18px 0;
}
.site-header.scrolled {
  background: rgba(249, 233, 211, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(104,63,30,.08);
  padding: 10px 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .brand-logo { height: 40px; width: auto; transition: height .3s; }
.site-header.scrolled .brand .brand-logo { height: 34px; }
.brand .logo-ar { display: none; }
html[data-lang="ar"] .brand .logo-en { display: none; }
html[data-lang="ar"] .brand .logo-ar { display: block; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  padding: 9px 15px; border-radius: 999px; font-weight: 500; font-size: .96rem;
  color: var(--brown); transition: background .2s, color .2s;
}
.nav a:hover { background: rgba(233,153,35,.16); color: var(--orange-deep); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 2px solid rgba(104,63,30,.22);
  color: var(--brown); border-radius: 999px; padding: 8px 16px;
  font-weight: 600; font-size: .9rem; transition: border-color .2s, background .2s;
}
.lang-toggle:hover { border-color: var(--brown); background: rgba(104,63,30,.05); }
.lang-toggle svg { width: 16px; height: 16px; }

.nav-toggle { display: none; background: transparent; border: 0; padding: 8px; color: var(--brown); }
.nav-toggle svg { width: 28px; height: 28px; }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(60px, 9vw, 120px); overflow: hidden; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center;
}
.hero-copy { max-width: 620px; }
.hero h1 {
  font-size: clamp(2.9rem, 6.4vw, 5rem);
  color: var(--brown);
  letter-spacing: -0.015em;
  margin-bottom: 26px;
}
.hero h1 .hl { color: var(--orange); font-style: italic; }
html[data-lang="ar"] .hero h1 .hl { font-style: normal; }
.hero .lede { margin-bottom: 34px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* Hero sticker collage */
.hero-visual { position: relative; min-height: 460px; }
.hero-visual .blob {
  position: absolute; inset: 6% 4%;
  background: radial-gradient(circle at 50% 42%, var(--cream-lift), var(--cream-soft) 60%, transparent 72%);
  border-radius: 50%;
}
.hero-clementine {
  position: absolute;
  inset: 50% auto auto 50%;
  /*width: min(82%, 460px);*/
  width: min(112%, 560px);
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 20px 34px rgba(104,63,30,.16));
}
.float-sticker {
  position: absolute;
  filter: drop-shadow(0 14px 26px rgba(104,63,30,.20));
  animation: floaty 6s ease-in-out infinite;
  will-change: transform;
}
.float-sticker img { width: 100%; height: auto; }
.fs-1 { width: 47%; top: 2%;  left: 26%;  animation-delay: -0.5s; z-index: 3; }
.fs-2 { width: 33%; top: 30%; left: -2%;  animation-delay: -2.2s; z-index: 2; }
.fs-3 { width: 30%; top: 4%;  right: 0%;  animation-delay: -3.4s; z-index: 2; }
.fs-4 { width: 40%; bottom: 2%; left: 8%; animation-delay: -1.4s; z-index: 4; }
.fs-5 { width: 34%; bottom: 6%; right: 2%; animation-delay: -4.1s; z-index: 3; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50%      { transform: translateY(-16px) rotate(var(--rot, 0deg)); }
}
.fs-2 { --rot: -8deg; }
.fs-3 { --rot: 7deg; }
.fs-4 { --rot: -4deg; }
.fs-5 { --rot: 6deg; }

/* ============================================================
   MARQUEE (disciplines)
   ============================================================ */
.marquee {
  background: var(--brown); color: var(--cream);
  padding: 16px 0; overflow: hidden; white-space: nowrap;
  direction: ltr;
}
.marquee-track { display: inline-flex; gap: 0; animation: scrollx 85s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-set { display: inline-flex; align-items: center; }
.marquee-item {
  font-family: var(--serif); font-size: 1.35rem; padding: 0 26px;
  display: inline-flex; align-items: center; gap: 26px;
}
html[data-lang="ar"] .marquee-item { font-family: var(--sans); font-weight: 500; font-size: 1.15rem; }
.marquee-track .dot { color: var(--orange); }
@keyframes scrollx { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============================================================
   ABOUT
   ============================================================ */
.about { padding: clamp(70px, 10vw, 130px) 0; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.about-copy p { color: var(--brown-soft); font-size: 1.12rem; }
.about-copy p + p { margin-top: 18px; }
.about-copy strong { font-weight: 600; color: var(--brown); }
.about-copy .signature {
  margin-top: 28px; font-family: var(--serif); font-size: 1.5rem; color: var(--orange-deep);
}
html[data-lang="ar"] .about-copy .signature { font-family: var(--sans); font-weight: 600; }
.about-copy .signature small { display: block; font-family: var(--sans); font-size: .82rem; color: var(--brown-soft); font-weight: 500; letter-spacing: .04em; margin-top: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  background: var(--cream-lift); border: 1.5px solid rgba(233,153,35,.35);
  border-radius: 999px; padding: 10px 18px; font-weight: 500; font-size: .96rem;
  color: var(--brown); box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), border-color .2s, background .2s;
}
.chip:hover { transform: translateY(-3px); border-color: var(--orange); background: #fff; }
.about-visual .chips { justify-content: flex-start; }
.about-visual-label {
  font-family: var(--serif); font-size: 1.05rem; color: var(--brown-soft);
  margin-bottom: 20px; font-style: italic;
}
html[data-lang="ar"] .about-visual-label { font-family: var(--sans); font-style: normal; }

/* Credentials card */
.cred-card {
  background: var(--cream-lift);
  border: 1px solid rgba(233,153,35,.30);
  border-radius: var(--radius);
  padding: 30px 30px 26px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 34px;
  position: relative;
}
.cred-card::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 26px; bottom: 26px;
  width: 4px; border-radius: 4px;
  background: linear-gradient(var(--orange), var(--blue));
}
.cred-label {
  font-family: var(--sans); font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  font-size: .72rem; color: var(--orange-deep); margin: 0 0 18px; padding-inline-start: 18px;
}
html[data-lang="ar"] .cred-label { letter-spacing: 0; font-size: .9rem; }
.cred-list { list-style: none; margin: 0; padding: 0 0 0 18px; }
html[data-lang="ar"] .cred-list { padding: 0 18px 0 0; }
.cred-list li { padding: 11px 0; border-bottom: 1px solid rgba(104,63,30,.10); }
.cred-list li:first-child { padding-top: 0; }
.cred-inst {
  display: block; font-family: var(--serif); font-size: 1.32rem; color: var(--brown); line-height: 1.1;
}
html[data-lang="ar"] .cred-inst { font-family: var(--sans); font-weight: 600; font-size: 1.15rem; }
.cred-deg { display: block; font-size: .92rem; color: var(--brown-soft); margin-top: 3px; }
.cred-note {
  margin: 16px 0 0; padding-inline-start: 18px; font-size: .9rem; color: var(--brown-soft); line-height: 1.5;
}
.cred-note em { color: var(--brown); font-style: italic; }
html[data-lang="ar"] .cred-note em { font-style: normal; font-weight: 600; }

/* ============================================================
   SERVICES
   ============================================================ */
.services { padding: clamp(70px, 10vw, 130px) 0; background: var(--cream-soft); }
.section-head { max-width: 640px; margin: 0 auto clamp(44px, 6vw, 68px); text-align: center; }
.section-head .lede { margin: 18px auto 0; }

.svc-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px;
}
.svc-card {
  background: var(--cream-lift);
  border-radius: var(--radius);
  padding: 34px 30px 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(104,63,30,.06);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  position: relative; overflow: hidden;
}
.svc-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); }
.svc-sticker {
  height: 118px; display: flex; align-items: center; justify-content: flex-start;
  margin-bottom: 18px;
}
html[data-lang="ar"] .svc-sticker { justify-content: flex-end; }
.svc-sticker img {
  height: 100%; width: auto; object-fit: contain;
  transition: transform .4s var(--ease);
  filter: drop-shadow(0 8px 16px rgba(104,63,30,.14));
}
.svc-card:hover .svc-sticker img { transform: rotate(-4deg) scale(1.06); }
.svc-card h3 { font-size: 1.42rem; color: var(--brown); margin-bottom: 10px; line-height: 1.12; }
html[data-lang="ar"] .svc-card h3 { font-size: 1.3rem; }
.svc-card p { color: var(--brown-soft); font-size: 1rem; margin: 0; }
.svc-card .num {
  position: absolute; top: 18px; right: 22px;
  font-family: var(--serif); font-size: 1.1rem; color: rgba(233,153,35,.5); font-weight: 400;
}
html[data-lang="ar"] .svc-card .num { right: auto; left: 22px; }

/* ============================================================
   SELECTED WORK
   ============================================================ */
.work { padding: clamp(70px, 10vw, 130px) 0; }
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.work-card {
  background: var(--cream-lift);
  border-radius: var(--radius);
  padding: 34px 34px 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(104,63,30,.07);
  position: relative; overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.work-card::before {
  content: ""; position: absolute; top: 0; inset-inline-start: 0; width: 100%; height: 5px;
  background: linear-gradient(90deg, var(--orange), var(--blue));
  transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease);
}
html[data-lang="ar"] .work-card::before { transform-origin: right; }
.work-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); }
.work-card:hover::before { transform: scaleX(1); }
.work-tag {
  display: inline-block; font-family: var(--sans); font-weight: 600;
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--blue-deep); background: rgba(43,86,166,.10);
  padding: 6px 13px; border-radius: 999px; margin-bottom: 16px;
}
html[data-lang="ar"] .work-tag { letter-spacing: 0; text-transform: none; font-size: .82rem; }
.work-card h3 { font-size: 1.55rem; color: var(--brown); margin-bottom: 12px; line-height: 1.12; }
html[data-lang="ar"] .work-card h3 { font-size: 1.34rem; }
.work-card p { color: var(--brown-soft); font-size: 1.02rem; margin: 0; }

/* ============================================================
   APPROACH
   ============================================================ */
.approach { padding: clamp(70px, 10vw, 130px) 0; }
.approach-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(40px, 6vw, 84px); align-items: start; }
.approach-intro { position: sticky; top: 120px; }
.approach-intro .lede { margin-top: 20px; }
.steps { display: flex; flex-direction: column; gap: 8px; }
.step {
  display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start;
  padding: 28px 4px; border-top: 1.5px solid rgba(104,63,30,.14);
}
.step:last-child { border-bottom: 1.5px solid rgba(104,63,30,.14); }
.step-num {
  font-family: var(--serif); font-size: 2.4rem; color: var(--orange);
  line-height: 1; min-width: 54px;
}
.step h3 { font-size: 1.5rem; color: var(--brown); margin-bottom: 8px; }
html[data-lang="ar"] .step h3 { font-size: 1.3rem; }
.step p { margin: 0; color: var(--brown-soft); font-size: 1.05rem; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact { padding: clamp(40px, 6vw, 70px) 0 clamp(70px, 9vw, 120px); }
.contact-card {
  background: linear-gradient(140deg, var(--blue) 0%, var(--blue-deep) 100%);
  border-radius: var(--radius-lg);
  padding: clamp(44px, 6vw, 84px);
  color: #fff; position: relative; overflow: hidden;
  box-shadow: var(--shadow-blue);
  text-align: center;
}
.contact-card .mark-watermark {
  position: absolute; width: 260px; opacity: .12; right: -40px; bottom: -50px; transform: rotate(-10deg);
}
html[data-lang="ar"] .contact-card .mark-watermark { right: auto; left: -40px; }
.contact-card .eyebrow { color: var(--yellow); position: relative; }
.contact-card h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.03; margin-bottom: 20px;
  position: relative;
}
html[data-lang="ar"] .contact-card h2 { font-family: var(--sans); font-weight: 600; line-height: 1.25; }
.contact-card p { color: rgba(255,255,255,.86); font-size: 1.18rem; max-width: 54ch; margin: 0 auto 34px; position: relative; }
.contact-cta { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; position: relative; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--brown); color: var(--cream); padding: 64px 0 34px; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; align-items: flex-start; }
.footer-brand { max-width: 340px; }
.footer-brand .footer-logo { height: 42px; margin-bottom: 18px; }
.footer-brand .logo-ar { display: none; }
html[data-lang="ar"] .footer-brand .logo-en { display: none; }
html[data-lang="ar"] .footer-brand .logo-ar { display: block; }
.footer-brand p { color: rgba(249,233,211,.7); font-size: .98rem; margin: 0; }
.footer-links { display: flex; gap: 60px; flex-wrap: wrap; }
.footer-col h4 {
  font-family: var(--sans); font-weight: 600; font-size: .78rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--orange); margin: 0 0 16px;
}
html[data-lang="ar"] .footer-col h4 { letter-spacing: 0; font-size: .92rem; }
.footer-col a, .footer-col span { display: block; color: rgba(249,233,211,.82); padding: 5px 0; font-size: .98rem; transition: color .2s; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(249,233,211,.16);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  color: rgba(249,233,211,.6); font-size: .88rem;
}
.footer-bottom .fruit-nod { color: rgba(249,233,211,.72); }

/* ============================================================
   Reveal-on-scroll
   ============================================================ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 20px; }
  .hero-visual { min-height: 360px; order: -1; max-width: 460px; margin: 0 auto; width: 100%; }
  .about-grid { grid-template-columns: 1fr; }
  .approach-grid { grid-template-columns: 1fr; }
  .approach-intro { position: static; }
  .svc-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  body { font-size: 17px; }
  .nav { display: none; }
  .nav.open {
    display: flex; position: absolute; top: 100%; inset-inline: 12px;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--cream-lift); padding: 14px; border-radius: 18px;
    box-shadow: var(--shadow-md); margin-top: 8px;
  }
  .nav.open a { padding: 12px 16px; }
  .nav-toggle { display: inline-flex; }
  .header-actions .lang-label-full { display: none; }
  .svc-grid { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: 1fr; }
  .hero-cta .btn, .contact-cta .btn { flex: 1 1 auto; justify-content: center; }
  .footer-links { gap: 32px; }
}

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