/* ==========================================================================
   BUSINESS PAGES (raaybon.html, tiun.html, pargar.html, dez.html)
   After the first screen (fa.css): the business in its own words beside a board of its four pictures,
   then its four products and services, each a card of three parts (the title, the client's question,
   the answer) with its own picture. One card is open at a time: on wide windows the titles stand in a
   column and the open card beside them (the page steps through them: fa.js, "BUSINESS PAGES"); on a
   phone the cards fold under their titles. A picture is cut into tiles that come together as its card
   opens. (Markup: build_fa.py line_page(), puzzle(), collage().)
   ========================================================================== */

/* ---------- the first screen: what the business promises, under its name and field ---------- */
.lhero__say { margin-top: clamp(14px, 2.6vh, 26px); padding-inline-start: 20px; border-inline-start: 3px solid var(--blue); font-size: clamp(18px, min(1.7vw, 2.9vh), 26px); font-weight: 500; line-height: 1.75;
  color: var(--white); text-align: start; text-wrap: balance; }
.lhero .actions { margin-inline-start: 0; }

/* ---------- the business in its own words, beside its pictures ---------- */
.labout__wrap { width: 100%; max-width: 1340px; margin: 0 auto; display: grid; gap: 34px; }
.labout__text { display: grid; gap: 16px; align-content: center; min-width: 0; }
.labout__lead { font-size: clamp(20px, 5.4vw, 27px); font-weight: 700; line-height: 1.75; color: var(--navy) !important; text-align: start; text-wrap: pretty; }
.labout__text p:not(.labout__lead) { font-size: 16.5px; line-height: 2.05; }
.labout__media { position: relative; min-width: 0; }

/* a board of four unequal tiles: each tile one picture */
.collage { display: grid; grid-template-columns: 1.22fr 1fr; grid-template-rows: 1.2fr 0.72fr 1fr; gap: 10px; aspect-ratio: 1.12; }
.collage__t { position: relative; overflow: hidden; border-radius: 20px; background: var(--navy); box-shadow: 0 30px 50px -36px rgba(14, 49, 121, 0.8); }
.collage__t:nth-child(1) { grid-area: 1 / 1 / 3 / 2; }
.collage__t:nth-child(2) { grid-area: 1 / 2 / 2 / 3; }
.collage__t:nth-child(3) { grid-area: 2 / 2 / 4 / 3; }
.collage__t:nth-child(4) { grid-area: 3 / 1 / 4 / 2; }
.collage__t img { width: 100%; height: 100%; object-fit: cover; }
/* the tiles come in one after another as the board arrives */
.js .labout__media .collage__t { opacity: 0; transform: scale(0.94); transition: opacity 0.6s var(--ease), transform 0.8s var(--ease); transition-delay: calc(0.12s + var(--i, 0) * 0.09s); }
.js .labout__media.is-in .collage__t { opacity: 1; transform: none; }
.js .labout__media.reveal { opacity: 1; transform: none; }

/* its film, where it has one: a button on the board; the film plays in a box over the page */
.film { position: absolute; inset-inline-start: 18px; bottom: 18px; z-index: 2; display: inline-flex; align-items: center; gap: 12px; height: 54px; padding-inline: 8px 22px; border-radius: 99px;
  background: var(--white); color: var(--navy); font-size: 15.5px; font-weight: 500; box-shadow: 0 20px 40px -18px rgba(4, 14, 44, 0.75); transition: background-color 0.3s; }
.film:hover { background: var(--mist); }
.film__ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: var(--white); }
.film__ico svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.vbox { position: fixed; inset: 0; z-index: 790; display: grid; place-items: center; padding: 20px; background: rgba(6, 18, 52, 0.9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.vbox video { width: min(100%, 1100px); max-height: calc(100vh - 110px); border-radius: 18px; background: #000; box-shadow: 0 50px 90px -40px #000; }
.vbox__x { position: absolute; top: 18px; inset-inline-end: 18px; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-2); color: var(--white); font-size: 28px; line-height: 1; }

/* ---------- a picture cut into tiles (--cols × --rows), each showing its own part; the picture is 4 : 3 ---------- */
.puzzle { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); grid-template-rows: repeat(var(--rows, 3), 1fr); gap: 3px; width: 100%; aspect-ratio: 4 / 3;
  direction: ltr; /* (the pieces lie left to right, as the picture does, on a Persian page too) */
  background-size: 0 0; background-repeat: no-repeat; /* (the box names the picture and shows none of it: its tiles do) */ }
.puzzle i { display: block; border-radius: 3px; background-image: inherit; background-repeat: no-repeat;
  background-size: calc(var(--cols, 4) * 100% + (var(--cols, 4) - 1) * 3px) calc(var(--rows, 3) * 100% + (var(--rows, 3) - 1) * 3px);
  background-position: calc(var(--x) / (var(--cols, 4) - 1) * 100%) calc(var(--y) / (var(--rows, 3) - 1) * 100%); }
/* the pieces come together, corner to corner, as the card opens */
.js .svc .puzzle i { opacity: 0; transform: scale(0.8); transition: opacity 0.2s, transform 0.2s; }
.js .svc.is-on .puzzle i { opacity: 1; transform: none; transition: opacity 0.4s var(--ease), transform 0.55s var(--ease); transition-delay: calc(0.1s + var(--i, 0) * 0.05s); }

/* ---------- the four products and services ---------- */
.svcs { position: relative; padding: 70px var(--gutter) 76px; }
.svcs__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px 24px; }
.svcs__head .eyebrow { grid-column: 1 / -1; }
.svcs__head h2 { font-size: clamp(30px, 8vw, 44px); line-height: 1.3; color: var(--navy); }
.svcs__count { display: flex; align-items: baseline; gap: 8px; font-weight: 700; color: var(--navy); }
.svcs__count b { font-size: 44px; line-height: 1; min-width: 1.1ch; }
.svcs__count span { font-size: 18px; font-weight: 400; color: var(--graphite); }
.svcs__list { display: grid; gap: 10px; margin-top: 24px; }
.svc { border-radius: 22px; background: var(--white); border: 1px solid var(--line-dark); overflow: hidden; transition: border-color 0.4s, box-shadow 0.4s; }
.svc.is-on { border-color: rgba(78, 114, 184, 0.5); box-shadow: 0 34px 60px -44px rgba(14, 49, 121, 0.7); }
.svc__h { margin: 0; font-size: inherit; }
.svc__tab { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 15px 16px; text-align: start; color: var(--navy); }
.svc__n { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(14, 49, 121, 0.22); font-size: 16px; font-weight: 700; line-height: 1; color: var(--blue);
  transition: background-color 0.4s, color 0.4s, border-color 0.4s; }
.svc.is-on .svc__n { background: var(--navy); border-color: var(--navy); color: var(--white); }
.svc__t { font-size: 17px; font-weight: 700; line-height: 1.6; text-wrap: pretty; }
.svc__t small { display: block; margin-top: 1px; font-size: 13.5px; font-weight: 500; color: var(--blue); }
/* a plus that turns into a minus as its card opens */
.svc__x { position: relative; width: 30px; height: 30px; border-radius: 50%; background: var(--mist); }
.svc__x::before, .svc__x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px; border-radius: 2px; background: var(--navy); transition: transform 0.45s var(--ease); }
.svc__x::after { transform: rotate(90deg); }
.svc.is-on .svc__x::after { transform: rotate(0deg); }
.svc__tab:focus-visible { outline: 2px solid var(--blue); outline-offset: -3px; border-radius: 22px; }
/* the card folds: its row goes from nothing to its own height */
.svc__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.5s var(--ease); }
.svc.is-on .svc__panel, .no-js .svc__panel { grid-template-rows: 1fr; }
.svc__in { min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.svc__media { background: var(--navy); }
.svc__text { display: grid; gap: 14px; padding: 20px 18px 24px; }
.svc__q { padding-inline-start: 16px; border-inline-start: 3px solid var(--blue); font-size: 17px; font-weight: 700; line-height: 1.8; color: var(--navy) !important; text-align: start; text-wrap: pretty; }
.svc__q span { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 700; color: var(--blue); }
.svc__p { font-size: 15.5px; line-height: 2; color: #3d4147 !important; }

/* ---------- Wide screens ---------- */
@media (min-width: 900.02px) {
  .labout__wrap { grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr); align-items: center; gap: clamp(36px, 6vw, 110px); }
  .labout__text { gap: clamp(10px, 2.2vh, 22px); }
  .labout__lead { font-size: clamp(19px, min(1.85vw, 3.3vh), 29px); }
  .labout__text p:not(.labout__lead) { font-size: clamp(14.5px, 2vh, 17px); line-height: 2; }
  .collage { aspect-ratio: auto; height: min(62vh, 560px); gap: 12px; }
  .collage__t { border-radius: 24px; }

  /* the stage: the heading above, then the titles in a column and the open card beside them */
  .svcs { padding: 0; }
  .svcs__pin { height: 100vh; height: 100svh; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: clamp(12px, 2.6vh, 30px); width: 100%; max-width: calc(1480px + 2 * var(--gutter)); margin: 0 auto;
    padding: calc(var(--header-h) + clamp(4px, 1.6vh, 22px)) var(--gutter) clamp(20px, 4.6vh, 56px); overflow: hidden; }
  .svcs__head h2 { font-size: clamp(26px, min(3.4vw, 5.4vh), 52px); }
  .svcs__count b { font-size: clamp(40px, 7vh, 66px); }
  .svcs__count span { font-size: 21px; }
  .svcs__list { margin: 0; min-height: 0; grid-template-columns: minmax(236px, 0.29fr) minmax(0, 1fr); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: clamp(6px, 1.1vh, 12px) clamp(16px, 2vw, 34px); }
  .svc { display: contents; }
  .svc__h { grid-column: 1; display: flex; min-height: 0; }
  .svc__tab { flex: 1; grid-template-columns: auto minmax(0, 1fr); gap: clamp(10px, 1vw, 16px); padding: clamp(6px, 1.2vh, 14px) clamp(12px, 1.2vw, 20px); border-radius: 20px; border: 1px solid transparent;
    transition: background-color 0.4s, border-color 0.4s, box-shadow 0.4s; }
  .svc__tab:hover { border-color: var(--line-dark); }
  .svc.is-on .svc__tab { background: var(--white); border-color: rgba(78, 114, 184, 0.45); box-shadow: 0 26px 44px -34px rgba(14, 49, 121, 0.7); }
  .svc__tab:focus-visible { outline-offset: 2px; border-radius: 20px; }
  .svc__n { width: clamp(30px, 4.4vh, 40px); height: clamp(30px, 4.4vh, 40px); font-size: clamp(14px, 2vh, 17px); }
  .svc__t { font-size: clamp(14px, min(1.18vw, 2.15vh), 18.5px); line-height: 1.55; }
  .svc__t small { font-size: 0.8em; }
  .svc__x { display: none; }
  /* every card in the same place beside the titles; the open one shown */
  .svc__panel { grid-column: 2; grid-row: 1 / -1; display: block; min-height: 0; border-radius: 30px; background: var(--white); border: 1px solid var(--line-dark); box-shadow: 0 46px 80px -50px rgba(14, 49, 121, 0.62); overflow: hidden;
    opacity: 0; visibility: hidden; transition: opacity 0.3s var(--ease), visibility 0s 0.3s; }
  .svc.is-on .svc__panel { opacity: 1; visibility: visible; z-index: 1; transition: opacity 0.45s var(--ease) 0.06s; }
  .no-js .svc__panel { opacity: 1; visibility: visible; grid-row: auto; }
  .svc__in { height: 100%; display: grid; grid-template-columns: minmax(0, 0.94fr) minmax(0, 1fr); overflow: visible; }
  .svc__media { order: 2; display: grid; align-items: center; min-height: 0; background: linear-gradient(135deg, #143c8f, #0e3179 55%, #0a2560); }
  .svc__text { order: 1; align-content: center; gap: clamp(10px, 2.2vh, 22px); padding: clamp(18px, 3.6vh, 44px) clamp(20px, 2.2vw, 40px); min-height: 0; }
  .svc__q { padding-inline-start: 20px; font-size: clamp(15.5px, min(1.32vw, 2.5vh), 21.5px); line-height: 1.75; }
  .svc__q span { margin-bottom: 6px; font-size: clamp(12px, 1.7vh, 13.5px); }
  .svc__p { font-size: clamp(13.5px, min(1.04vw, 2vh), 16.5px); line-height: 1.95; }
}
/* narrower desktops: the picture takes a little less of the card */
@media (min-width: 900.02px) and (max-width: 1200px) {
  .svcs__list { grid-template-columns: minmax(210px, 0.3fr) minmax(0, 1fr); }
  .svc__in { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); }
}
@media (prefers-reduced-motion: reduce) {
  .js .svc .puzzle i, .js .labout__media .collage__t { opacity: 1; transform: none; transition: none; }
}
