/* الابتكار الرائع v2 — concrete, steel and laid tile.
   Motion uses transform/opacity only and lives behind
   html.js + prefers-reduced-motion: no-preference. Without either, everything is static and visible.
   Arabic rule: no letter-spacing anywhere; display line-height >= 1.3. */

:root {
  --concrete: #e4e6e2;   /* page */
  --concrete-2: #d6d9d4; /* grout, bands */
  --slab: #f4f5f2;       /* cards */
  --graphite: #1f2326;
  --steel: #4c575d;      /* secondary text, AA on concrete */
  --rule: #bfc4bf;
  --gold: #c69a2e;       /* the logo's gold, marks only */
  --gold-ink: #7a5c12;
  --wa: #1f7a4d;
  --display: "Kufam", "Readex Pro", "Segoe UI", Tahoma, sans-serif;
  --body: "Readex Pro", "Segoe UI", Tahoma, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --bar: 64px;
  --wrap: 1200px;
  --gut: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 12px); }
body {
  margin: 0; background: var(--concrete); color: var(--graphite);
  font: 400 1rem/1.7 var(--body); letter-spacing: normal;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.3; margin: 0; }
p { margin: 0; }
bdi[dir="ltr"] { unicode-bidi: isolate; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }
@media (min-width: 700px) { :root { --gut: 28px; } }

.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--graphite); color: #fff; padding: 8px 14px; z-index: 60; }
.skip:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 3px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 22px;
  font: 700 .98rem/1.2 var(--body); text-decoration: none;
  border: 1.5px solid transparent; border-radius: 0; cursor: pointer;
  transition: transform .18s var(--ease), background-color .18s, color .18s, box-shadow .18s;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn--dark { background: var(--graphite); color: #fff; box-shadow: 4px 4px 0 var(--gold); }
.btn--dark:hover { box-shadow: 6px 6px 0 var(--gold); }
.btn--line { border-color: var(--graphite); color: var(--graphite); background: transparent; }
.btn--line:hover { background: var(--graphite); color: #fff; }
.btn--wa { background: var(--wa); color: #fff; }
.btn--wa:hover { background: #17603c; }
.btn--block { width: 100%; }

/* ---------- header + measuring-tape progress ---------- */
.bar { position: sticky; top: 0; z-index: 30; background: rgba(228, 230, 226, .94); backdrop-filter: blur(8px); }
.bar__in { display: flex; align-items: center; gap: 20px; height: calc(var(--bar) - 8px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-inline-end: auto; }
.brand img { width: 40px; height: 40px; }
.brand__text { display: flex; flex-direction: column; }
.brand__name { font: 800 1.12rem/1.3 var(--display); }
.brand__sub { font-size: .76rem; color: var(--steel); line-height: 1.3; }
.nav { display: none; gap: 28px; }
.nav a { position: relative; text-decoration: none; font-weight: 500; font-size: .95rem; padding-block: 6px; }
.nav a::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: right; transition: transform .25s var(--ease); }
.nav a:hover::after { transform: scaleX(1); }
.bar__wa { min-height: 40px; padding: 8px 14px; }
@media (min-width: 900px) { .nav { display: flex; } }
@media (max-width: 380px) { .bar__wa span { display: none; } .bar__wa { padding-inline: 11px; } }
.tape {
  height: 8px; position: relative; overflow: hidden;
  background: repeating-linear-gradient(to left, var(--rule) 0 1px, transparent 1px 10px) bottom / 100% 4px no-repeat,
              repeating-linear-gradient(to left, var(--steel) 0 1px, transparent 1px 50px) bottom / 100% 8px no-repeat;
  border-bottom: 1px solid var(--rule);
}
.tape__fill { position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--gold); transform: scaleX(0); transform-origin: right; }

/* ---------- section heads with a spirit level ---------- */
.sh { display: grid; gap: 10px; margin-bottom: 30px; }
.sh h2 { font-size: clamp(1.75rem, 5.4vw, 2.9rem); }
.sh p { color: var(--steel); max-width: 60ch; }
.sh--tight { margin-bottom: 16px; }
.mask { display: block; overflow: hidden; padding-block: .1em .18em; margin-block: -.1em -.18em; }
.mask > span { display: inline-block; }
.sh__level { position: relative; display: block; width: 120px; height: 12px; border: 1.5px solid var(--graphite); border-radius: 6px; background: #f1f3ef; }
.sh__level::before { content: ""; position: absolute; top: 1px; bottom: 1px; inset-inline-start: 50%; width: 1px; background: var(--graphite); box-shadow: 18px 0 0 var(--graphite); translate: -9px 0; }
.sh__level::after { content: ""; position: absolute; top: 1.5px; width: 22px; height: 6px; border-radius: 3px; background: var(--gold); inset-inline-start: calc(50% - 11px); }

/* ---------- hero: tile board ---------- */
.hero { padding-block: 34px 44px; }
.hero__in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; }
.hero__in > * { min-width: 0; }
.lay { font-size: clamp(2.1rem, 8.4vw, 3.6rem); line-height: 1.3; }
.lay__line { display: block; }
.w { display: inline-block; }
.hero__lead { margin-top: 18px; font-size: 1.05rem; color: #353c40; max-width: 50ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.hero__where { margin-top: 18px; font-size: .9rem; color: var(--steel); padding-inline-start: 14px; border-inline-start: 3px solid var(--gold); }

.board { perspective: 1100px; }
.board__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  padding: 6px; background: var(--concrete-2);
  box-shadow: inset 0 0 0 1px var(--rule);
}
.tile { position: relative; margin: 0; aspect-ratio: 1; overflow: hidden; background: #cfd2cd; transform-origin: top center; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.tile figcaption {
  position: absolute; inset-inline: 0; bottom: 0; padding: 18px 8px 6px;
  font-size: .78rem; font-weight: 500; color: #fff; line-height: 1.4;
  background: linear-gradient(transparent, rgba(20, 23, 25, .78));
  opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s var(--ease);
}
.tile:hover img { transform: scale(1.07); }
.tile:hover figcaption { opacity: 1; transform: none; }
@media (hover: none) { .tile figcaption { opacity: 1; transform: none; } }

@media (min-width: 900px) {
  .hero { padding-block: 56px 72px; }
  .hero__in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 56px; }
  .board__grid { gap: 8px; padding: 8px; }
}

/* ---------- materials: stacked pallets ---------- */
.materials { position: relative; z-index: 1; padding-block: 56px 24px; background: var(--concrete-2); border-top: 1px solid var(--rule); }
.stack { list-style: none; margin: 0; padding: 0 0 40px; }
.pallet {
  --p: 0;
  position: sticky; top: calc(var(--bar) + 14px + var(--n) * 12px);
  display: grid; grid-template-columns: minmax(0, 1fr);
  background: var(--slab); margin-bottom: 26px;
  border: 1px solid var(--rule); border-top: 6px solid var(--graphite);
  box-shadow: 0 -10px 24px -18px rgba(20, 23, 25, .45);
  transform-origin: top center; overflow: hidden;
}
.pallet::after { /* darkens a pallet as the next one covers it */
  content: ""; position: absolute; inset: 0; background: var(--graphite); opacity: calc(var(--p) * .28); pointer-events: none;
}
.pallet:nth-child(even) { background: #eceeea; }
.pallet__img { width: 100%; height: 190px; object-fit: cover; }
.pallet__body { padding: 18px 18px 22px; display: grid; gap: 6px; align-content: start; }
.pallet__n { font: 800 1rem/1 var(--display); color: var(--gold-ink); }
.pallet h3 { font-size: 1.45rem; }
.pallet p { color: var(--steel); }
.ask { position: relative; justify-self: start; margin-top: 8px; font-weight: 700; text-decoration: none; padding-block: 4px; }
.ask::before { content: "←"; display: inline-block; margin-inline-end: 8px; color: var(--gold-ink); transition: transform .2s var(--ease); }
.ask::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 2px; background: var(--gold); transform: scaleX(.25); transform-origin: right; transition: transform .25s var(--ease); }
.ask:hover::after { transform: scaleX(1); }
.ask:hover::before { transform: translateX(-4px); }
@media (min-width: 900px) {
  .materials { padding-block: 88px 40px; }
  .pallet { grid-template-columns: 46% 1fr; height: 340px; margin-bottom: 44px; }
  .pallet__img { height: 100%; }
  .pallet__body { padding: 34px 40px; align-content: center; }
  .pallet__n { font-size: 1.3rem; }
  .pallet h3 { font-size: 2rem; }
  .pallet p { font-size: 1.05rem; max-width: 40ch; }
}

/* ---------- yard: conveyor ---------- */
.yard { padding-block: 56px; }
.yard__head { display: grid; gap: 8px; }
.yard__hint { display: none; font-size: .85rem; color: var(--steel); }
.belt { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding-inline: var(--gut); margin-top: 6px; }
.belt__track { list-style: none; margin: 0; padding: 0 0 10px; display: flex; gap: 10px; width: max-content; }
.belt__track li { scroll-snap-align: start; flex: none; }
.belt__track button { all: unset; display: block; cursor: zoom-in; height: 100%; }
.belt__track button:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 2px; }
.belt__track img { height: 260px; width: auto; transition: transform .35s var(--ease); }
.belt__track button:hover img { transform: scale(.97); }

/* desktop conveyor: vertical scroll drives the belt (class set by app.js) */
html.conv .yard { padding-block: 0; position: relative; }
html.conv .yard__pin { position: sticky; top: var(--bar); height: calc(100vh - var(--bar)); display: flex; flex-direction: column; justify-content: center; gap: 22px; overflow: hidden; }
html.conv .yard__head { grid-template-columns: 1fr auto; align-items: end; }
html.conv .yard__hint { display: block; }
html.conv .belt { overflow: visible; scroll-snap-type: none; padding-inline: 0; margin: 0; }
html.conv .belt__track { padding-inline: max(var(--gut), calc((100vw - var(--wrap)) / 2 + var(--gut))); will-change: transform; }
html.conv .belt__track img { height: min(52vh, 460px); }

/* ---------- order: bolted steel plate ---------- */
.order { padding-block: 56px; background: var(--concrete-2); border-block: 1px solid var(--rule); }
.order__in { display: grid; gap: 26px; }
.order__intro p { color: #353c40; max-width: 46ch; }
.order__alt { margin-top: 14px; }
.order__alt a { font-weight: 700; }
.plate {
  position: relative; padding: 30px 20px 24px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.35) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, #f6f7f5, #e5e8e4);
  border: 1px solid #b7bcb7;
  box-shadow: 0 1px 0 #fff inset, 0 18px 34px -22px rgba(20, 23, 25, .55);
}
.bolt { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fdfdfc, #9aa19c); box-shadow: 0 1px 1px rgba(0,0,0,.35); }
.bolt::after { content: ""; position: absolute; inset: 6px 2px; background: #6b736e; border-radius: 1px; }
.bolt:nth-of-type(1) { top: 10px; right: 10px; }
.bolt:nth-of-type(2) { top: 10px; left: 10px; }
.bolt:nth-of-type(3) { bottom: 10px; right: 10px; }
.bolt:nth-of-type(4) { bottom: 10px; left: 10px; }
.pick { border: 0; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pick legend { padding: 0; margin-bottom: 8px; font-weight: 500; font-size: .92rem; }
.pick label { position: relative; display: block; }
.pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pick span {
  display: flex; align-items: center; min-height: 52px; padding: 8px 12px;
  background: #fff; border: 1.5px solid #c3c8c3; border-inline-start: 5px solid var(--rule);
  font-weight: 500; font-size: .93rem; line-height: 1.35;
  transition: transform .15s var(--ease), background-color .15s, border-color .15s, color .15s;
}
.pick label:hover span { border-inline-start-color: var(--gold); }
.pick input:active + span { transform: scale(.97); }
.pick input:checked + span { background: var(--graphite); color: #fff; border-color: var(--graphite); border-inline-start-color: var(--gold); }
.pick input:focus-visible + span { outline: 2px solid var(--gold-ink); outline-offset: 2px; }
.f { display: grid; gap: 5px; margin-bottom: 14px; }
.f > span { font-size: .92rem; font-weight: 500; }
.f em { font-style: normal; color: var(--steel); font-weight: 400; }
.f input, .f textarea {
  width: 100%; font: inherit; color: var(--graphite); background: #fff;
  border: 1px solid #b9bfba; border-radius: 0; padding: 10px 12px; min-height: 48px;
}
.f textarea { resize: vertical; min-height: 84px; }
.f input:focus, .f textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.f2 { display: grid; gap: 0 14px; }
.err { color: #a12a1b; font-size: .92rem; margin-bottom: 12px; }
@media (min-width: 560px) { .f2 { grid-template-columns: 1fr 1fr; } .plate { padding: 38px 34px 30px; } .pick { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) {
  .order { padding-block: 88px; }
  .order__in { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 64px; align-items: start; }
}

/* ---------- visit ---------- */
.visit { padding-block: 56px 64px; }
.visit__in { display: grid; gap: 30px; }
.lines { list-style: none; margin: 0 0 22px; padding: 0; border-top: 3px solid var(--graphite); }
.lines li { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding-block: 13px; border-bottom: 1px solid var(--rule); }
.lines span { color: var(--steel); font-size: .92rem; }
.lines strong { font-weight: 500; }
.lines a { font-weight: 500; text-decoration: none; overflow-wrap: anywhere; background: linear-gradient(var(--gold), var(--gold)) bottom right / 100% 1.5px no-repeat; }
.map { position: relative; min-height: 300px; overflow: hidden; background: #d3d6d1; border: 1px solid var(--rule); }
.map__grid { position: absolute; inset: 0;
  background:
    linear-gradient(90deg, transparent 47%, #c3c7c1 47% 53%, transparent 53%) 0 0 / 100% 100%,
    linear-gradient(transparent 62%, #f0f1ee 62% 66%, transparent 66%) 0 0 / 100% 100%,
    repeating-linear-gradient(90deg, #cbcec8 0 1px, transparent 1px 40px),
    repeating-linear-gradient(#cbcec8 0 1px, transparent 1px 40px); }
.map__pin { position: absolute; top: calc(50% - 86px); left: calc(50% - 20px); width: 40px; height: 52px; color: var(--graphite); }
.map__shadow { position: absolute; top: calc(50% - 36px); left: calc(50% - 14px); width: 28px; height: 8px; border-radius: 50%; background: rgba(20, 23, 25, .3); }
.map__label { position: absolute; top: 14px; inset-inline-start: 14px; background: var(--slab); padding: 4px 10px; font-size: .85rem; font-weight: 500; }
.map__btn {
  position: absolute; left: 50%; top: calc(50% + 14px); translate: -50% 0;
  font: 700 1rem/1.2 var(--body); background: var(--graphite); color: #fff; border: 0; padding: 14px 22px; cursor: pointer;
  transition: transform .18s var(--ease);
}
.map__btn:hover { transform: translateY(-2px); }
.map__btn:active { transform: scale(.97); }
.map__note { position: absolute; bottom: 10px; inset-inline: 12px; color: var(--steel); font-size: .8rem; text-align: center; }
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (min-width: 900px) {
  .visit { padding-block: 88px; }
  .visit__in { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 56px; }
  .map { min-height: 440px; }
}

/* ---------- footer ---------- */
.foot { background: var(--graphite); color: #cfd4d0; padding-block: 30px; font-size: .9rem; border-top: 6px solid var(--gold); }
.foot__in { display: grid; gap: 16px; }
.foot__brand { display: flex; gap: 12px; align-items: center; }
.foot__brand img { width: 44px; height: 44px; }
.foot__name { font: 800 1.05rem/1.4 var(--display); color: #fff; }
.foot__copy { color: #a3aaa6; }
.nivo-it { display: inline-flex; align-items: center; gap: 10px; justify-self: start; text-decoration: none; color: #fff; }
.nivo-it img { width: 56px; height: 56px; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.nivo-it__text { display: grid; line-height: 1.35; }
.nivo-it__text [lang="en"] { font-weight: 700; font-size: .95rem; }
.nivo-it__ar { font-size: .78rem; color: #a3aaa6; }
.nivo-it:hover img, .nivo-it:focus-visible img { transform: translateY(-4px) rotate(-6deg); }
@media (prefers-reduced-motion: reduce) { .nivo-it:hover img, .nivo-it:focus-visible img { transform: none; } }
@media (min-width: 900px) { .foot__in { grid-template-columns: 1fr auto auto; align-items: center; gap: 32px; } }

/* ---------- lightbox ---------- */
.lb { padding: 0; border: 0; background: transparent; max-width: 94vw; max-height: 92vh; }
.lb::backdrop { background: rgba(20, 23, 25, .9); }
.lb img { max-width: 94vw; max-height: 88vh; width: auto; height: auto; }
.lb__close { position: fixed; top: 12px; inset-inline-end: 12px; width: 44px; height: 44px; border: 0; background: var(--slab); color: var(--graphite); font: 400 1.8rem/1 var(--body); cursor: pointer; }

/* ---------- 404 ---------- */
.lost { min-height: 72vh; display: grid; align-content: center; gap: 18px; padding-block: 60px; }
.lost h1 { font-size: clamp(2rem, 7vw, 3.4rem); }
.lost p { color: var(--steel); max-width: 46ch; }

/* =====================================================================
   MOTION — only with JS and no reduced-motion preference
   ===================================================================== */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* hero words drop into place like blocks */
  html.js .w { animation: drop .7s var(--ease) both; animation-delay: calc(120ms + var(--i) * 85ms); }
  @keyframes drop {
    0%   { opacity: 0; transform: translateY(-70%) rotate(-5deg); }
    65%  { opacity: 1; transform: translateY(6%) rotate(.5deg); }
    100% { opacity: 1; transform: none; }
  }

  /* tiles are laid one by one, hinged from the top edge */
  html.js .tile { animation: laytile .75s var(--ease) both; animation-delay: calc(300ms + var(--i) * 95ms); }
  @keyframes laytile {
    0%   { opacity: 0; transform: rotateX(-88deg) translateY(-10px); }
    70%  { opacity: 1; transform: rotateX(6deg); }
    100% { opacity: 1; transform: none; }
  }

  /* generic reveal */
  html.js .rv { opacity: 0; transform: translateY(26px); transition: opacity .75s var(--ease) var(--d, 0s), transform .75s var(--ease) var(--d, 0s); }
  html.js .rv.in { opacity: 1; transform: none; }

  /* headings rise out of a mask; the level's bubble settles in the middle */
  html.js .mask > span { transform: translateY(110%); transition: transform .8s var(--ease); }
  html.js .mask.in > span { transform: none; }
  html.js .sh__level::after { transform: translateX(46px); transition: transform 1.1s cubic-bezier(.3, 1.6, .5, 1) .35s; }
  html.js .sh__level.in::after { transform: none; }

  /* pallets: photo slides in from the side, text follows */
  html.js .pallet__img { opacity: 0; transform: translateX(-36px); transition: opacity .7s var(--ease), transform .8s var(--ease); }
  html.js .pallet__body > * { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
  html.js .pallet__body > :nth-child(2) { transition-delay: .08s; }
  html.js .pallet__body > :nth-child(3) { transition-delay: .16s; }
  html.js .pallet__body > :nth-child(4) { transition-delay: .24s; }
  html.js .pallet.in .pallet__img, html.js .pallet.in .pallet__body > * { opacity: 1; transform: none; }

  /* belt photos on phones rise in as the strip enters */
  html.js:not(.conv) .belt__track li { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(var(--k, 0) * 70ms); }
  html.js:not(.conv) .belt.in .belt__track li { opacity: 1; transform: none; }

  /* bolts screw in when the plate arrives */
  html.js .plate .bolt { transform: rotate(-200deg) scale(1.4); opacity: 0; transition: transform .7s var(--ease), opacity .3s; }
  html.js .plate.in .bolt { transform: rotate(0) scale(1); opacity: 1; }
  html.js .plate.in .bolt:nth-of-type(2) { transition-delay: .1s; }
  html.js .plate.in .bolt:nth-of-type(3) { transition-delay: .2s; }
  html.js .plate.in .bolt:nth-of-type(4) { transition-delay: .3s; }

  /* the pin drops onto the plan */
  html.js .map__pin { transform: translateY(-120px); opacity: 0; }
  html.js .map__shadow { transform: scale(.2); opacity: 0; }
  html.js .map.in .map__pin { animation: pin .9s cubic-bezier(.3, 1.4, .5, 1) .25s both; }
  html.js .map.in .map__shadow { animation: shadow .9s var(--ease) .25s both; }
  @keyframes pin { from { transform: translateY(-120px); opacity: 0; } 40% { opacity: 1; } to { transform: none; opacity: 1; } }
  @keyframes shadow { from { transform: scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* reduced motion: no smooth scroll, no hover zoom */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
  .tile:hover img, .belt__track button:hover img { transform: none; }
}
