/* AL MAHA v3 — style layer «روح v2» (?style=v2, <html data-style="v2">, set in <head> before the first paint).
   What it takes from ChatGPT's v2 (analysis-v2/v2-extract.json): the warm yellow-neutral surfaces, one flat band per
   chapter, copper on the night chapter, the tighter section rhythm (≈105 / 95 px desktop, 65 / 61 px phones) and the
   approach as tabs 01-04 with a big numeral. What it keeps from v3: the brand reds (#EB070D / #8E1028), the type sizes,
   Arabic never tracked, the seams, the vector oryx, the markup. Default (no parameter) stays the v3 style. */

[data-style="v2"] {
  /* surfaces: v2's ladder */
  --ivory: #F6F2EC;          /* page, hero, about, vision */
  --paper-2: #F0ECE6;        /* works band */
  --dusk: #ECE6DD;           /* services band, last light before the night */
  --v2-soft: #F7F4EF;        /* sectors, clients */
  --v2-contact: #FBF8F3;     /* contact */
  --card: #F8F6F1;
  --card-line: #DBD2C9;
  --cover-base: #E5DFD4;
  --line: rgba(36, 34, 31, .15);
  --muted: #5C534C;          /* 6.4:1 on #F6F2EC, 6.0:1 on #ECE6DD */
  /* night chapter: copper */
  --on-dark-muted: #C3B5A6;  /* 8.2:1 on night */
  --line-dark: rgba(119, 97, 81, .9);   /* #776151 */
  /* rhythm: v2's tighter chapters */
  --section-y: clamp(61px, calc(50.14px + 3.81vw), 105px);   /* 65 / 89 / 105 / 105 */
  --space-head: clamp(32px, calc(1.6rem + 1.6vw), 52px);
}

/* ------------------------------------------------------------ surfaces (flat bands, v2's ledger) */
[data-style="v2"] #edge-spill stop:nth-child(-n+2), [data-style="v2"] #vedge-spill stop:nth-child(-n+2) { stop-color: #F6F2EC; }
[data-style="v2"] .pillars::before {
  background:
    linear-gradient(180deg, rgba(246, 242, 236, 0) 0, rgba(246, 242, 236, .5) clamp(110px, 12vw, 170px), rgba(246, 242, 236, .86) clamp(190px, 21vw, 300px), var(--ivory) 100%),
    linear-gradient(90deg, #F6F2EC 0, #F6F2EC 40%, #F8E8DA 77%, #F8EDE3 100%);
}
[data-style="v2"] .about { padding-bottom: var(--section-y); }
[data-style="v2"] .services { background: var(--dusk); padding-bottom: var(--section-y); }
[data-style="v2"] .svc__link::before { background: #E4DDD2; }
[data-style="v2"] .sectors {
  background: linear-gradient(180deg, var(--v2-soft) 0, var(--v2-soft) 55%, var(--dusk) 100%);
  padding-bottom: calc(var(--section-y) + .45 * var(--seam-h));
}
[data-style="v2"] .sectors .label { margin-bottom: var(--space-head); }
[data-style="v2"] .seam--out .seam__shape path { fill: var(--v2-soft); }
[data-style="v2"] .clients { background: var(--v2-soft); border-top: 0; }
[data-style="v2"] .works { background: var(--paper-2); padding-top: var(--section-y); }
[data-style="v2"] .work__info { background: #FCFAF6; }
[data-style="v2"] .contact {
  background: linear-gradient(180deg, rgb(251 248 243 / 0) 0, var(--v2-contact) clamp(200px, 22vw, 320px), var(--v2-contact) calc(100% - clamp(220px, 24vw, 340px)), var(--dusk) 100%);
}
[data-style="v2"] .form { background: #FFFDF9; border-color: #DDD6CB; }
[data-style="v2"] .form__status { background: var(--paper-2); }
html[data-style="v2"] { scrollbar-color: var(--bordeaux) var(--dusk); }

/* ------------------------------------------------------------ night chapter: copper accents (red stays on the display accent) */
[data-style="v2"] .on-dark .label { color: var(--copper); }
[data-style="v2"] .on-dark .label::before { background: #C9A58E; }
[data-style="v2"] .on-dark .label .lat { color: #C7B8A3; }
[data-style="v2"] .step__no { color: var(--copper-2); }

/* ------------------------------------------------------------ approach as tabs (v2): structural CSS on the same markup.
   The steps become a 4-up tablist (ui.js initApproachTabs adds the ARIA and the keys); the active step's text opens in one
   panel under the tabs with its big numeral. No pin: the chapter is about one screen tall. */
.approach__pin { min-height: 0; display: block; padding-block: var(--section-y) calc(var(--section-y) + .8 * var(--seam-h)); }
.approach__grid { display: block; }
.approach__head { max-width: 40rem; }
.steps-wrap { padding: 0; margin-top: var(--space-head); }
.steps__track { display: none; }
.steps { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.step { display: contents; }
.step::before { display: none; }
.step:nth-child(1) > .step__no, .step:nth-child(1) > .step__title { grid-column: 1; }
.step:nth-child(2) > .step__no, .step:nth-child(2) > .step__title { grid-column: 2; }
.step:nth-child(3) > .step__no, .step:nth-child(3) > .step__title { grid-column: 3; }
.step:nth-child(4) > .step__no, .step:nth-child(4) > .step__title { grid-column: 4; }
.step__no { grid-row: 1; align-self: center; justify-self: start; z-index: 1; pointer-events: none; margin-inline-start: 18px; text-align: right; }
.step__title {
  grid-row: 1; position: relative; display: flex; align-items: center; flex-wrap: nowrap; gap: 14px;
  min-height: 87px; padding: 18px; padding-inline-start: 58px;
  font: 500 var(--fs-h3)/1.3 var(--f-ar); color: var(--on-dark-muted); cursor: pointer;
  border-bottom: 1px solid #776151; transition: color .3s var(--ease), background-color .3s var(--ease);
}
.step__title .lat { display: none; }
.step__title::after {
  content: ""; flex: none; width: 21px; height: 21px; margin-inline-start: 2px; background: currentColor; opacity: .3;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 17 7 7M7 17V7h10'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 17 7 7M7 17V7h10'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: opacity .3s var(--ease), transform .45s var(--ease-expo);
}
.step__title:hover { color: var(--on-dark); }
.step__title:hover::after { opacity: .6; transform: translate(-3px, -3px); }
.step.is-active > .step__title { color: var(--on-dark); background: rgba(255, 243, 232, .024); box-shadow: inset 0 -2px 0 var(--copper); }
.step.is-active > .step__title::after { opacity: 1; background: var(--copper); }
.step__title:focus-visible { outline-offset: -2px; }
/* the panel: big numeral + the step's sentence; every panel shares one cell, only the active one shows */
.step__body {
  grid-row: 2; grid-column: 1 / -1; display: flex; align-items: center; gap: clamp(24px, 3.6vw, 52px);
  min-height: 210px; padding-top: var(--s-5); visibility: hidden; opacity: 0; transition: opacity .35s var(--ease), visibility 0s .35s;
}
.step.is-active > .step__body { visibility: visible; opacity: 1; transition: opacity .45s var(--ease); }
.step__body::before {
  content: attr(data-n); flex: none; min-width: 1.2em; direction: ltr; text-align: right;
  font: 350 clamp(86px, 10.4vw, 150px)/1 var(--f-lat); letter-spacing: -.07em; color: #5A4335;
}
.step__body > div { overflow: visible; }
.step__body p { padding: 0; font: 500 var(--fs-h3)/1.6 var(--f-ar); color: var(--on-dark); max-width: 22em; }
.step.is-active > .step__body::before, .step.is-active > .step__body > div { animation: v2-arrive .55s var(--ease) both; }
.step.is-active > .step__body > div { animation-delay: .06s; }
@keyframes v2-arrive { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
/* the quiet Latin note at the far end of the panel */
.steps::after {
  content: "CLARITY\A IN EVERY STEP."; white-space: pre; grid-row: 2; grid-column: 4; justify-self: end; align-self: center;
  padding-top: var(--s-5); direction: ltr; text-align: left; pointer-events: none;
  font: 560 var(--fs-micro)/2 var(--f-lat); letter-spacing: var(--tr-micro); color: #A58C77;
}
@media (max-width: 1150px) {
  .steps::after { display: none; }
}
@media (max-width: 860px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step:nth-child(odd) > .step__no, .step:nth-child(odd) > .step__title { grid-column: 1; }
  .step:nth-child(even) > .step__no, .step:nth-child(even) > .step__title { grid-column: 2; }
  .step:nth-child(n+3) > .step__no, .step:nth-child(n+3) > .step__title { grid-row: 2; }
  .step__body { grid-row: 3; align-items: flex-start; min-height: 0; padding-top: var(--s-6); gap: var(--s-5); }
  .step__title { min-height: 74px; padding: 14px 10px; padding-inline-start: 44px; gap: 10px; font-size: 20px; }
  .step__no { margin-inline-start: 10px; }
  .step__ico { --ico-s: 24px; }
  .step__title::after { width: 17px; height: 17px; }
  .step__body::before { font-size: 86px; letter-spacing: -.06em; }
  .step__body p { font-size: var(--fs-lead); line-height: var(--lh-lead); }
}
@media (max-width: 480px) {
  /* phones: number + verb only, so «نقيس الأثر» stays on one line */
  .step__ico { display: none; }
  .step__title { padding-inline-start: 38px; font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .step.is-active > .step__body::before, .step.is-active > .step__body > div { animation: none; }
}
