/* قيود للطاقة المتعددة: بوسترات بتكسر القيود */

:root {
  --navy: #0E1A3A;
  --amber: #F5A524;
  --ice: #EEF3FA;
  --cell: #2F7DE1;
  --cell-light: #A9CBFF;
  --black: #000;
  --white: #fff;

  --font-ar: "Kufam", "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-num: "Big Shoulders Display", "Kufam", sans-serif;

  --gutter: clamp(16px, 4.5vw, 64px);
  --maxw: 1320px;
  --bar-h: 64px;
  --dock-h: 0px;

  /* خط الكسر: نفس النقاط للنص الفوقاني والتحتاني والشق البرتقالي */
  --crack-top: polygon(0 0, 100% 0, 100% 55%, 93% 60%, 86% 53%, 78% 63%, 70% 54%, 61% 62%, 53% 51%, 46% 61%, 37% 53%, 29% 64%, 21% 55%, 13% 63%, 7% 52%, 0 58%);
  --crack-bottom: polygon(0 58%, 7% 52%, 13% 63%, 21% 55%, 29% 64%, 37% 53%, 46% 61%, 53% 51%, 61% 62%, 70% 54%, 78% 63%, 86% 53%, 93% 60%, 100% 55%, 100% 100%, 0 100%);
  --crack-band: polygon(0 54%, 7% 48%, 13% 59%, 21% 51%, 29% 60%, 37% 49%, 46% 57%, 53% 47%, 61% 58%, 70% 50%, 78% 59%, 86% 49%, 93% 56%, 100% 51%, 100% 59%, 93% 64%, 86% 57%, 78% 67%, 70% 58%, 61% 66%, 53% 55%, 46% 65%, 37% 57%, 29% 68%, 21% 59%, 13% 67%, 7% 56%, 0 62%);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--bar-h);
}

body {
  margin: 0;
  padding-bottom: var(--dock-h);
  font-family: var(--font-ar);
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--navy);
  background: var(--navy);
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
figure { margin: 0; }
b { font-weight: 800; }
button { font: inherit; }

:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; inset-inline-start: 16px; top: -100px; z-index: 100;
  padding: 10px 16px; background: var(--amber); color: var(--navy); font-weight: 800;
}
.skip:focus { top: 12px; }

.num {
  font-family: var(--font-num);
  font-weight: 800;
  font-variant-numeric: lining-nums;
  line-height: 1;
  unicode-bidi: isolate;
}

/* رقم ووحدة لاتينية لحالهم بسطر: بينقروا من الشمال لليمين زي "4.34 kW"، وبيضلوا ملزوقين ليمين البوستر */
.ltr { direction: ltr; unicode-bidi: isolate; text-align: right; }

/* ---------- الشريط العلوي ---------- */

.bar {
  position: sticky; top: 0; z-index: 50;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 20px;
  /* على الشاشات الكبيرة حواف الشريط بتمشي مع حواف المحتوى */
  padding-inline: max(var(--gutter), calc((100% - var(--maxw)) / 2));
  background: var(--navy);
  color: var(--white);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1rem; text-decoration: none; white-space: nowrap;
}
.brand img {
  width: 38px; height: 38px; padding: 3px;
  background: var(--white); border-radius: 6px;
}

.chain { margin-inline-start: auto; }
.chain ol { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.chain a {
  display: grid; place-items: center;
  width: 34px; height: 40px;
  color: rgb(255 255 255 / .4);
}
.chain svg { width: 20px; height: 22px; overflow: visible; }
.chain polygon { fill: none; stroke: currentColor; stroke-width: 2; }
.chain a:hover, .chain a[aria-current="true"] { color: var(--amber); }
.chain a.is-passed { color: var(--amber); }
.chain a.is-passed polygon { fill: var(--amber); }

.bar__wa {
  padding: 8px 18px;
  background: var(--amber); color: var(--navy);
  font-weight: 800; text-decoration: none;
}

/* ---------- الهيرو ---------- */

.hero {
  position: relative;
  overflow: clip;
  padding: 0 var(--gutter) clamp(48px, 7vw, 104px);
  background: var(--navy);
  color: var(--white);
}

/* الكلمة أعرض من ما هي طويلة، فالارتفاع بيتبع العرض على الموبايل */
.hero__stage {
  position: relative;
  height: clamp(240px, min(58vh, 64vw), 640px);
  margin-inline: calc(var(--gutter) * -1);
}

.hero__mosaic {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  touch-action: pan-y;
}

.hero__fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  margin: 0;
  font-weight: 900;
  font-size: min(40vw, 48vh);
  line-height: 1;
  color: var(--cell);
}
/* الخلايا نفسها هي الانتقال، فالكلمة الاحتياطية بتختفي فوراً */
.hero.is-ready .hero__fallback { visibility: hidden; }

.hero__body {
  max-width: var(--maxw);
  margin-inline: auto;
}

.hero h1 {
  max-width: 14em;
  margin: 0 0 .35em;
  font-size: clamp(2.1rem, 6.2vw, 5rem);
  font-weight: 900;
  line-height: 1.3;
}

.hero__lede {
  max-width: 34em;
  margin-bottom: 1.6em;
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  color: rgb(255 255 255 / .8);
}

/* زر على شكل كعب فاتورة */
.ticket {
  --notch: 11px;
  display: inline-block;
  padding: 18px 34px;
  background: var(--amber);
  color: var(--navy);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  font-weight: 800;
  text-decoration: none;
  -webkit-mask:
    radial-gradient(circle var(--notch) at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle var(--notch) at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
  mask:
    radial-gradient(circle var(--notch) at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle var(--notch) at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
}
.ticket:hover { background: #ffb63d; }

/* ---------- البوسترات ---------- */

/* المحتوى بيتوسّط عن طريق الحشوة، عشان أي سطر عرضه محدود يضل لازق ببداية السطر (اليمين) */
.poster {
  position: relative;
  overflow: clip;
  padding-block: clamp(56px, 8vw, 128px);
  padding-inline: max(var(--gutter), calc((100% - var(--maxw)) / 2));
  background: var(--bg);
  color: var(--fg);
}

.poster--ice   { --bg: var(--ice);   --fg: var(--navy);  --rule: rgb(14 26 58 / .16); }
.poster--black { --bg: var(--black); --fg: var(--white); --rule: rgb(255 255 255 / .16); }
.poster--amber { --bg: var(--amber); --fg: var(--navy);  --rule: rgb(14 26 58 / .22); }
.poster--navy  { --bg: var(--navy);  --fg: var(--white); --rule: rgb(255 255 255 / .16); }

.say {
  max-width: 19em;
  margin-bottom: .9em;
  font-size: clamp(1.45rem, 3.1vw, 2.5rem);
  font-weight: 700;
  line-height: 1.5;
}

.intro, .outro { max-width: 40em; font-size: clamp(1.05rem, 1.6vw, 1.25rem); }
.outro { margin: clamp(40px, 6vw, 72px) 0 0; font-weight: 800; }

.sub {
  margin: 0 0 .35em;
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  font-weight: 800;
  line-height: 1.4;
}

.poster__grid {
  display: grid;
  gap: clamp(32px, 5vw, 80px);
}
@media (min-width: 900px) {
  .poster__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: start; }
}

/* الكلمة المكسورة: ثلاث نسخ فوق بعض، نص فوقاني ونص تحتاني وشق برتقالي بينهم */
.crack {
  margin-top: 0;
  margin-bottom: clamp(28px, 4vw, 60px);
  font-weight: 900;
  line-height: 1;
}
.crack__word {
  display: inline-grid;
  font-size: clamp(3.6rem, 17vw, 14rem);
  line-height: 1.2;
  white-space: nowrap;
}
.crack__word > span { grid-area: 1 / 1; }
.crack__word > :nth-child(1) { clip-path: var(--crack-band); color: var(--amber); }
.crack__word > :nth-child(2) { clip-path: var(--crack-top); transform: translate(-.012em, -.034em) rotate(-.7deg); }
.crack__word > :nth-child(3) { clip-path: var(--crack-bottom); transform: translate(.012em, .03em) rotate(.45deg); }
.crack--b .crack__word > :nth-child(2) { transform: translate(.016em, -.03em) rotate(.6deg); }
.crack--b .crack__word > :nth-child(3) { transform: translate(-.01em, .034em) rotate(-.5deg); }
.poster--amber .crack__word > :nth-child(1) { color: var(--white); }

/* ---------- الحاسبة ---------- */

.calc { margin-top: clamp(20px, 3vw, 40px); }

.calc__q { display: block; font-weight: 700; font-size: 1.15rem; }

.calc__bill {
  display: block;
  margin: 4px 0 18px;
  font-family: var(--font-num);
  font-size: clamp(4.5rem, 11vw, 8rem);
  font-weight: 900;
  line-height: 1;
}
.calc__bill .num { font-weight: 900; }

.calc__range {
  --p: 8.6%;
  width: 100%;
  height: 44px;
  margin: 0 0 28px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.calc__range::-webkit-slider-runnable-track {
  height: 14px;
  background: linear-gradient(to right, var(--amber) var(--p), var(--navy) var(--p));
}
.calc__range::-moz-range-track {
  height: 14px;
  background: linear-gradient(to right, var(--amber) var(--p), var(--navy) var(--p));
}
.calc__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 38px; height: 38px;
  margin-top: -12px;
  background: var(--amber);
  border: 5px solid var(--navy);
  border-radius: 50%;
}
.calc__range::-moz-range-thumb {
  width: 28px; height: 28px;
  background: var(--amber);
  border: 5px solid var(--navy);
  border-radius: 50%;
}
.calc__range:focus-visible { outline-offset: 6px; }

.calc__mode {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin: 0; padding: 0; border: 0;
}
.calc__mode legend { width: 100%; padding: 0; margin-bottom: 8px; font-weight: 700; }
.calc__mode label { position: relative; cursor: pointer; }
.calc__mode input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.calc__mode span {
  display: inline-block;
  padding: 10px 20px;
  border: 2px solid var(--navy);
  font-weight: 700;
}
.calc__mode input:checked + span { background: var(--navy); color: var(--white); }
.calc__mode input:focus-visible + span { outline: 3px solid var(--amber); outline-offset: 3px; }

.result {
  padding: clamp(24px, 3.5vw, 44px);
  background: var(--navy);
  color: var(--white);
}
.result__lead { margin: 0; font-weight: 700; color: rgb(255 255 255 / .75); }
.result__kw {
  margin: 0 0 18px;
  font-family: var(--font-num);
  font-size: clamp(4.5rem, 10vw, 7.5rem);
  font-weight: 900;
  line-height: 1;
  color: var(--amber);
}
.result__kw .num { font-weight: 900; }
.result__kw .unit { font-size: .45em; }

.cells {
  display: flex; flex-wrap: wrap; gap: 3px;
  min-height: 26px;
  margin-bottom: 18px;
}
.cells i {
  width: 22px; height: 25px;
  background: var(--cell);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.cells i.batt { background: var(--amber); }
.cells i.is-new { animation: cell-in .35s ease-out both; }
@keyframes cell-in { from { transform: scale(.2); opacity: 0; } }

.result__list { margin: 0 0 24px; padding: 0; list-style: none; font-weight: 700; }
.result__list li { padding: 6px 0; border-bottom: 1px solid rgb(255 255 255 / .15); }

.fine { margin: 18px 0 0; font-size: .875rem; line-height: 1.7; color: rgb(255 255 255 / .65); }

.btn {
  display: inline-block;
  padding: 14px 26px;
  font-weight: 800;
  text-decoration: none;
}
.btn--amber { background: var(--amber); color: var(--navy); }
.btn--amber:hover { background: #ffb63d; }
.btn--navy { background: var(--navy); color: var(--white); }
.btn--navy:hover { background: #1b2a57; }

/* ---------- العتمة ---------- */

.spec { font-size: clamp(1.1rem, 1.8vw, 1.35rem); font-weight: 700; line-height: 2; }
.spec .num { font-size: 2.4em; font-weight: 900; color: var(--amber); vertical-align: -.12em; }

.switch {
  display: inline-flex; align-items: center; gap: 14px;
  margin-top: 12px;
  padding: 10px 0;
  background: none; border: 0;
  color: inherit; font-weight: 800; font-size: 1.1rem;
  cursor: pointer;
}
.switch__track {
  position: relative;
  width: 64px; height: 34px;
  background: var(--amber);
  border-radius: 17px;
}
.switch__knob {
  position: absolute; top: 4px; inset-inline-start: 4px;
  width: 26px; height: 26px;
  background: var(--navy);
  border-radius: 50%;
  transition: inset-inline-start .25s;
}
.switch[aria-checked="true"] .switch__track { background: #3a3a3a; }
.switch[aria-checked="true"] .switch__knob { inset-inline-start: 34px; background: var(--white); }

.status { min-height: 1.8em; margin: 4px 0 0; font-weight: 800; color: var(--amber); }

.street { display: block; width: 100%; height: auto; }
.street .wall { fill: #18234a; transition: fill .4s; }
.street .tank { fill: #0b0f1d; }
.street .win { fill: var(--amber); transition: fill .4s; }
.street .door { fill: #2a3766; }
.street .ground { fill: #10162c; }
.street .pv { fill: var(--cell); }
.street .pv-grid { stroke: var(--navy); stroke-width: 2; fill: none; }
.street .batt { fill: var(--white); }
.street .batt-level { fill: var(--amber); transform-origin: 389px 265px; transition: transform 6s linear; }

.dim { transition: opacity .4s; }
#dark.is-cut { --bg: #000; }
#dark.is-cut .dim { opacity: .35; }
#dark.is-cut .house:not(.house--ours) .win { fill: #151515; }
#dark.is-cut .house:not(.house--ours) .wall { fill: #0c0c0c; }
#dark.is-cut .batt-level { transform: scaleY(.7); }

/* ---------- رسومات بتنفتح: البطارية، لوحة الكهربا، اللوح ---------- */

.anatomy { margin-top: clamp(64px, 9vw, 128px); }
.anatomy__head { max-width: 40em; margin-bottom: clamp(20px, 3vw, 36px); }
.anatomy__head p { margin: 0; opacity: .8; }
.anatomy__body { display: grid; gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (min-width: 900px) {
  .anatomy__body { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
}

.anatomy__svg { display: block; width: 100%; height: auto; overflow: visible; }
.anatomy__svg .part {
  cursor: pointer;
  transition: opacity .25s, filter .25s, transform .7s cubic-bezier(.2, .8, .2, 1);
}
.anatomy.has-active .anatomy__svg .part { opacity: .28; }
.anatomy .anatomy__svg .part.is-active { opacity: 1; filter: drop-shadow(0 0 5px rgb(245 165 36 / .95)); }

.anatomy__toggle {
  margin-top: 16px;
  padding: 12px 22px;
  background: none;
  border: 2px solid var(--amber);
  color: inherit;
  font-weight: 800;
  cursor: pointer;
}
.anatomy__toggle[aria-pressed="true"] { background: var(--amber); color: var(--navy); }

.fine-print { margin-top: 12px; font-size: .85rem; opacity: .6; }
.hint { margin: 0 0 12px; opacity: .7; }

.parts { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.parts li { border-bottom: 1px solid var(--rule); }
.parts button {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%;
  padding: 13px 0;
  background: none; border: 0;
  color: inherit; font-weight: 800; text-align: start;
  cursor: pointer;
}
.parts button::after { content: "+"; font-family: var(--font-num); font-size: 1.4rem; line-height: 1; opacity: .6; }
.parts button[aria-pressed="true"] { color: var(--amber); }
.parts button[aria-pressed="true"]::after { content: "−"; opacity: 1; }
.poster--ice .parts button[aria-pressed="true"] { color: #b86e00; }
.parts__desc { margin: 0 0 14px; line-height: 1.85; opacity: .85; }

.specs {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px;
  margin: 28px 0 0;
}
.specs div { padding-top: 8px; border-top: 3px solid var(--amber); }
.specs dt { font-size: .9rem; opacity: .75; }
.specs dd { margin: 0; font-family: var(--font-num); font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 900; line-height: 1.15; }

/* البطارية */
.bat__floor { fill: #1a2033; }
.bat__chassis { fill: #121a33; stroke: #2a3560; stroke-width: 2; }
/* مسكّرة بتوقف بالنص، ولما تنفتح الغطا بيروح يسار وجسمها يمين */
.bat__body { transform: translateX(-120px); transition: transform .7s cubic-bezier(.2, .8, .2, 1); }
.bat__cover { transform-box: fill-box; transform-origin: center; transform: translate(-120px, 0) rotate(0deg); }
.anatomy.is-open .bat__body { transform: translateX(16px); }
.anatomy.is-open .bat__cover { transform: translate(-236px, 12px) rotate(-5deg); }
.bat text { font-family: var(--font-num); text-anchor: middle; }
.bat__brand { font-size: 30px; font-weight: 900; fill: #1c2a52; letter-spacing: 1px; }
.bat__power { font-size: 17px; font-weight: 800; fill: #3c9d4b; letter-spacing: 2px; }
.bat__label { font-size: 12px; font-weight: 800; fill: #5b6475; }
.bat__warranty { font-size: 15px; font-weight: 900; fill: #1c2a52; }
.anatomy.is-open [data-part="cells"] use { animation: cell-on .5s ease-out both; animation-delay: calc(var(--i) * 45ms); }
@keyframes cell-on { from { opacity: .12; } }

/* اللوح الشمسي: كل طبقة بتطلع أو بتنزل بمسافتها (--open) */
.anatomy.is-open .pvx__layer { transform: translateY(var(--open)); }

/* ---------- المنظومة: نهار، ليل، قطعت ---------- */

.flow { --sky: #cfe2fb; --ground: #b9cbe3; --ink: var(--navy); margin-top: clamp(48px, 7vw, 96px); }
.flow[data-mode="night"], .flow[data-mode="cut"] { --sky: #0b1430; --ground: #18223f; --ink: #EEF3FA; }

.flow__head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px;
  margin-bottom: 18px;
}
.flow__head .sub { margin: 0; }

.segmented { display: inline-flex; flex-wrap: wrap; border: 2px solid var(--navy); }
.segmented button {
  padding: 10px 18px;
  background: none; border: 0;
  color: var(--navy); font-weight: 800;
  cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--navy); color: var(--white); }

.flow__svg { display: block; width: 100%; height: auto; }
.flow__sky { fill: var(--sky); transition: fill .5s; }
.flow__ground { fill: var(--ground); transition: fill .5s; }
.flow__sun, .flow__moon, .flow__stars, .flow__cut, .flow__grid { transition: opacity .4s; }
.flow:not([data-mode="day"]) .flow__sun,
.flow:not([data-mode="day"]) .flow__ray { opacity: 0; }
.flow[data-mode="day"] .flow__moon, .flow[data-mode="day"] .flow__stars { opacity: 0; }
.flow__cut { opacity: 0; }
.flow[data-mode="cut"] .flow__cut { opacity: 1; }
.flow[data-mode="cut"] .flow__grid { opacity: .35; }
.flow__base { stroke: var(--ink); stroke-opacity: .2; stroke-width: 5; transition: stroke .5s; }
.flow__live {
  stroke: var(--amber); stroke-width: 5; stroke-dasharray: 3 11;
  opacity: 0;
  transition: opacity .3s;
  animation: flow-dash .8s linear infinite;
}
@keyframes flow-dash { to { stroke-dashoffset: -14; } }
.flow[data-mode="day"] .flow__live[data-on~="day"],
.flow[data-mode="night"] .flow__live[data-on~="night"],
.flow[data-mode="cut"] .flow__live[data-on~="cut"] { opacity: 1; }
.flow__label { font-family: var(--font-ar); font-size: 15px; font-weight: 800; fill: var(--ink); text-anchor: middle; transition: fill .5s; }
.flow__status { min-height: 1.8em; margin: 14px 0 0; font-weight: 800; }
/* الرسمة بتصغر على الشاشات الصغيرة، فالأسماء بتكبر عشان تضل مقروءة */
@media (max-width: 899px) { .flow__label { font-size: 18px; } }
@media (max-width: 599px) {
  .flow__label { font-size: 25px; }
  /* اسم البطارية بيطلع فوقها عشان ما يلزق باسم الانفيرتر */
  .flow__label--bat { transform: translateY(-110px); }
}

/* ---------- الماركات ---------- */

.brands { display: grid; gap: clamp(24px, 3vw, 40px); margin: clamp(8px, 2vw, 24px) 0 clamp(28px, 4vw, 48px); }
@media (min-width: 900px) { .brands { grid-template-columns: 1.45fr 1fr .8fr; align-items: start; } }
.brands__group h3 { margin: 0 0 6px; font-size: 1rem; font-weight: 800; opacity: .7; }
.brands__group ul { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 0; padding: 0; list-style: none; }
.brands__group li {
  font-family: var(--font-num);
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  font-weight: 900;
  line-height: 1.2;
  direction: ltr;
}
.brands__group--star { padding: 16px 20px; border: 2px solid var(--amber); }
.brands__group--star li { color: var(--amber); }
.brands__group--star p { margin: 4px 0 0; font-weight: 800; }

/* ---------- الحدود والأعمال ---------- */

/* حجم الرقم متناسب مع جذر القدرة (--s)، عشان الـ 10 kW يضل مقروء جنب الـ 180 */
.scale {
  margin: clamp(32px, 5vw, 64px) auto 0;
  padding: 0;
  list-style: none;
}
.scale li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: clamp(14px, 2.5vw, 36px);
  padding-block: .2em;
}
.scale__n {
  display: inline-flex; align-items: baseline; gap: .06em;
  font-family: var(--font-num);
  font-size: max(2.4rem, calc(var(--s) * clamp(5.5rem, 15vw, 13rem)));
  font-weight: 900;
  line-height: .9;
  direction: ltr;
}
.scale__n .num { font-weight: 900; }
.scale__n small { font-size: max(.9rem, .3em); color: var(--amber); }
.scale__t { padding-bottom: .6em; line-height: 1.6; color: rgb(255 255 255 / .7); }
.scale__t b { display: block; color: var(--white); font-size: clamp(1rem, 1.6vw, 1.2rem); }

.works { margin-top: clamp(64px, 9vw, 128px); }
.works__head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px;
  margin-bottom: 22px;
}
.works__head .sub { margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  padding: 8px 16px;
  background: none;
  border: 2px solid rgb(255 255 255 / .35);
  color: inherit; font-weight: 800;
  cursor: pointer;
}
.chips button[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--navy); }

.works__grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  margin: 0; padding: 0; list-style: none;
}
.work[hidden] { display: none; }
.work__btn {
  display: block; width: 100%;
  padding: 0;
  background: none; border: 0;
  color: inherit; text-align: start;
  cursor: pointer;
}

/* كل الصور بنفس القص وبلونين من الهوية (كحلي وثلجي)، والصورة بألوانها الحقيقية بالعارض */
.work__img {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--ice);
  isolation: isolate;
}
.work__img img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.12) brightness(1.05);
  mix-blend-mode: multiply;
  transition: transform .5s;
}
.work__img::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--navy);
  mix-blend-mode: lighten;
  pointer-events: none;
}
.work__btn:hover .work__img img, .work__btn:focus-visible .work__img img { transform: scale(1.05); }
.work__btn:hover .work__name, .work__btn:focus-visible .work__name { color: var(--amber); }

.work__num {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  padding: 2px 10px 4px;
  background: var(--amber);
  color: var(--navy);
  font-family: var(--font-num);
  font-size: 1.6rem; font-weight: 900; line-height: 1.1;
}
.work__num small { font-size: .6em; }
.work__meta { display: block; padding: 12px 2px 0; }
.work__tag { display: block; color: var(--amber); font-size: .85rem; font-weight: 800; }
.work__name { display: block; font-size: 1.05rem; font-weight: 800; line-height: 1.5; transition: color .2s; }
.work__note { display: block; font-size: .9rem; line-height: 1.6; opacity: .7; }

@media (max-width: 899px) {
  /* على الجوال والتابلت الأعمال صف بينسحب بالإصبع */
  .works__grid {
    grid-auto-flow: column;
    grid-auto-columns: 42%;
    grid-template-columns: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    margin-inline: calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 8px;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: thin;
    scrollbar-color: var(--amber) transparent;
  }
  .work { scroll-snap-align: start; }
}
@media (max-width: 599px) { .works__grid { grid-auto-columns: 72%; } }

.lightbox {
  width: min(94vw, 1100px);
  max-height: 94vh;
  padding: 0;
  border: 0;
  background: var(--black);
  color: var(--white);
}
.lightbox::backdrop { background: rgb(7 11 22 / .9); }
.lightbox img { width: 100%; max-height: 76vh; object-fit: contain; background: #000; }
.lightbox figcaption { padding: 14px 18px 4px; font-weight: 700; line-height: 1.7; }
.lightbox__bar { display: flex; gap: 8px; padding: 10px 18px 18px; }
.lightbox__bar button {
  padding: 10px 18px;
  background: none;
  border: 2px solid rgb(255 255 255 / .35);
  color: inherit; font-weight: 800;
  cursor: pointer;
}
.lightbox__bar .lightbox__close { margin-inline-start: auto; background: var(--amber); border-color: var(--amber); color: var(--navy); }

/* ---------- الديزل ---------- */

.farmers {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: .1em .25em;
  margin: .1em 0 .2em;
  font-size: clamp(2rem, 6vw, 4.8rem);
  font-weight: 900;
  line-height: 1;
}
.farmers .num { font-size: 3.6em; font-weight: 900; line-height: .85; }

.lede { max-width: 36em; font-size: clamp(1.05rem, 1.7vw, 1.3rem); font-weight: 500; }
.lede .num { font-size: 1.3em; font-weight: 900; }

.duo {
  display: grid; gap: clamp(28px, 4vw, 64px);
  margin-top: clamp(32px, 5vw, 72px);
}
@media (min-width: 760px) { .duo { grid-template-columns: 1fr 1fr; } }
.duo__n {
  margin-bottom: .2em;
  font-family: var(--font-num);
  font-size: clamp(3.2rem, 7vw, 5.5rem);
  font-weight: 900;
  line-height: 1;
}
.duo__n .num { font-weight: 900; }

/* ---------- الخاتمة ---------- */

.finale__title {
  margin: 0 0 .2em;
  font-weight: 900;
  line-height: 1.2;
}
.fit { display: inline-block; font-size: clamp(3.2rem, 14vw, 12rem); white-space: nowrap; }

.phones {
  display: flex; flex-wrap: wrap; gap: 4px clamp(20px, 4vw, 56px);
  margin: 0 0 clamp(32px, 5vw, 64px);
  padding: 0;
  list-style: none;
}
.phones a {
  display: inline-block;
  font-size: clamp(2.6rem, 6.5vw, 5.2rem);
  font-weight: 900;
  text-decoration: none;
}
.phones a:hover { text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 6px; }

.finale__grid { display: grid; gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (min-width: 900px) { .finale__grid { grid-template-columns: auto 1fr 1fr; } }

address, .hours { margin: 0; font-style: normal; font-weight: 700; line-height: 2; }
.hours b { font-weight: 900; }

/* صفحة 404 */
.lost { min-height: 100vh; }

/* ---------- الفوتر ---------- */

.foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px;
  padding: 32px var(--gutter);
  background: var(--white);
  color: var(--navy);
  font-size: .9rem;
}
.foot img { width: 120px; }
.foot p { margin: 0; }
.credit { margin-top: 4px !important; font-weight: 700; }
.credit a { text-decoration: none; }
.credit a:hover { text-decoration: underline; }

/* ---------- شريط الموبايل السفلي ---------- */

.dock { display: none; }

@media (max-width: 899px) {
  :root { --bar-h: 56px; --dock-h: calc(60px + env(safe-area-inset-bottom)); }
  .bar { gap: 12px; }
  .bar__wa { display: none; }
  .brand span { font-size: .9rem; }
  .chain a { width: 24px; }
  .chain svg { width: 15px; height: 17px; }

  .dock {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
    display: grid; grid-template-columns: 1fr 1fr;
    height: var(--dock-h);
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--navy);
  }
  .dock a {
    display: grid; place-items: center;
    color: var(--white);
    font-weight: 800; font-size: 1.05rem;
    text-decoration: none;
  }
  .dock a + a { background: var(--amber); color: var(--navy); }
}

@media (max-width: 420px) {
  .brand span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
