/* ==========================================================================
   IPS — direction pages (/facade, /interior)
   hero · what we do · materials · process · projects · brands · finale (contact + the other direction)
   Few words, big photos: every block is a title plus pictures, items carry one short line at most.
   Builds on main.css + extra.css + system.css; only page-specific pieces live here.
   ========================================================================== */

/* ---------- Rhythm: one gap between blocks (sections pad the top only) ---------- */
.dsec { padding-top: var(--sec); }
/* a heading's last word and its (counter) wrap together */
.dnw { white-space: nowrap; }
/* two-word section titles ("ფასადის პროექტები") stay on one line on desktop */
.dsec .t-display, .dproc .t-display { font-size: clamp(32px, 4.4vw, 76px); }

/* ==========================================================================
   1. Hero — framed like the home hero (10px inset, rounded, photo)
   ========================================================================== */
.dhero { position: relative; height: calc(var(--vh, 1vh) * 82); min-height: 600px; max-height: 1080px; padding: 10px; }
.dhero__frame {
  position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 24px;
  padding: calc(var(--header-h) + 4px) var(--pad) clamp(18px, 2vw, 28px);
  border-radius: var(--radius); overflow: hidden; clip-path: inset(0 round var(--radius));
  background: var(--ink); color: var(--white); isolation: isolate;
}
.dhero__media { position: absolute; inset: 0; z-index: -2; overflow: hidden; will-change: transform; }
.dhero__media img { width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); }
.js .dhero__media img { transform: scale(1.07); transition: transform 2.8s var(--ease), opacity .5s var(--ease); }
.js .dhero.is-in .dhero__media img { transform: none; }
/* arriving through a card that grows into this photo: no intro zoom, so the morph lands on the final framing,
   and the large file fades in over the card's photo once it has loaded (never a half-loaded wipe) */
.js .dhero--morph .dhero__media img { transform: none; opacity: 0; }
.js .dhero--morph .dhero__media.is-loaded img { opacity: 1; }
.dhero--facade { --focus: 50% 38%; }
.dhero--interior { --focus: 50% 56%; }
/* legibility: darker under the header and behind the copy */
.dhero__frame::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(20, 28, 45, .58) 0%, rgba(20, 28, 45, .1) 24%, rgba(20, 28, 45, .14) 48%, rgba(20, 28, 45, .84) 100%);
}

.dhero__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px clamp(24px, 3.4vw, 64px); }
.dhero__title { font-weight: 700; font-size: clamp(56px, 10.4vw, 188px); line-height: .94; letter-spacing: -.005em; }
html[lang="ka"] .dhero__title { line-height: 1.04; }
html[lang="en"] .dhero__title { font-family: var(--f-latin); font-weight: 800; letter-spacing: -.02em; font-size: clamp(52px, 9.6vw, 172px); }
.dhero__lead { max-width: 340px; padding-bottom: 1.2em; font-size: clamp(15px, 1.2vw, 19px); line-height: 1.45; color: rgba(255, 255, 255, .92); }
html[lang="en"] .dhero__lead { padding-bottom: 1em; }

.dhero__bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 20px clamp(24px, 3vw, 56px); margin-top: clamp(10px, 1.6vw, 24px); }
/* stats size to their content (a long area figure gets the room it needs), then share the rest */
.dhero__stats { display: flex; gap: 0 clamp(14px, 1.6vw, 28px); margin: 0; }
.dstat { flex: 1 1 auto; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .26); }
.dstat dt { font-size: 12.5px; line-height: 1.35; color: rgba(255, 255, 255, .72); }
.dstat dd { margin: 0; font-family: var(--f-latin); font-weight: 200; font-size: clamp(30px, 3vw, 52px); line-height: 1.04; letter-spacing: -.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dstat dd small { margin-left: .16em; font-size: .4em; font-weight: 300; letter-spacing: 0; }
.dhero__cta { display: flex; gap: 10px; }

/* intro: copy fades in after the title has risen (page script adds .is-in once the page is revealed) */
.js .dhero [data-hero-fade] { opacity: 0; transform: translate3d(0, 18px, 0); transition: opacity 1.1s var(--ease), transform 1.25s var(--ease); transition-delay: var(--hd, 0s); }
.js .dhero.is-in [data-hero-fade] { opacity: 1; transform: none; }
.qa .dhero [data-hero-fade] { opacity: 1 !important; transform: none !important; }
.qa .dhero__media img { transform: none !important; opacity: 1 !important; }

/* ==========================================================================
   2. What we do — a tall photo and four short numbered rows
   ========================================================================== */
.dsvc { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: center; }
.dsvc__media { grid-column: 1 / span 5; margin: 0; aspect-ratio: 4 / 5; max-height: calc(var(--vh, 1vh) * 78); width: 100%; }
.dsvc__list { grid-column: 7 / span 6; border-top: 1px solid var(--line); }
.dsvc__row { position: relative; display: grid; grid-template-columns: clamp(44px, 4.6vw, 76px) minmax(0, 1fr); gap: 0 12px; padding: clamp(22px, 2.5vw, 38px) 0; border-bottom: 1px solid var(--line); }
.dsvc__row::before { content: ""; position: absolute; left: 0; top: -1px; width: 100%; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .9s var(--ease); }
.dsvc__row:hover::before { transform: scaleX(1); }
.dsvc__num { padding-top: .2em; font-family: var(--f-latin); font-weight: 300; font-size: clamp(14px, 1.1vw, 17px); letter-spacing: .04em; color: var(--steel); }
.dsvc__body { min-width: 0; }
.dsvc__title { margin-bottom: 8px; font-weight: 500; font-size: clamp(21px, 1.9vw, 32px); line-height: 1.2; transition: color .4s; }
html[lang="en"] .dsvc__title { font-family: var(--f-latin); font-weight: 600; letter-spacing: -.015em; }
.dsvc__row:hover .dsvc__title { color: var(--slate); }
.dsvc__text { max-width: 520px; font-size: 15px; line-height: 1.55; color: var(--text-2); }

/* a dark full-width band between the light blocks (facade page: the ventilated facade, layer by layer) */
.dband { margin-top: var(--sec); padding: clamp(56px, 6vw, 104px) 0; }

/* ==========================================================================
   3. Materials — photo cards: the picture, a name and how many projects use it
   ========================================================================== */
.mgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(26px, 2.8vw, 44px) var(--gap); }
.mgrid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mcard { display: flex; flex-direction: column; gap: 3px; min-width: 0; color: inherit; }
.mcard__media { aspect-ratio: 4 / 3; margin-bottom: 12px; }
.mgrid--3 .mcard__media { aspect-ratio: 3 / 2; }
.mcard__media img { transition: transform 1.4s var(--ease), opacity .9s var(--ease); }
.mcard:hover .mcard__media img { transform: scale(1.05); }
.mcard__arrow {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; background: var(--white); color: var(--ink);
  display: grid; place-items: center; opacity: 0; transform: scale(.6) rotate(-45deg); transition: opacity .5s var(--ease), transform .7s var(--ease);
}
.mcard__arrow svg { width: 14px; height: 14px; }
.mcard:hover .mcard__arrow { opacity: 1; transform: none; }
.mcard__name { font-weight: 500; font-size: clamp(16.5px, 1.3vw, 20px); line-height: 1.3; transition: color .4s; }
html[lang="en"] .mcard__name { font-family: var(--f-latin); font-weight: 600; letter-spacing: -.01em; }
.mcard:hover .mcard__name { color: var(--slate); }
.mcard__count { font-size: 13px; line-height: 1.4; color: var(--text-3); }

/* ==========================================================================
   4. Process — dark framed band; a thin line draws itself through four steps
   ========================================================================== */
.dproc { margin-top: var(--sec); padding: 0 10px; }
.dproc__frame {
  position: relative; overflow: hidden; isolation: isolate; border-radius: var(--radius); background: var(--ink); color: var(--white);
  padding: clamp(44px, 5.2vw, 88px) calc(var(--pad) - 10px) clamp(44px, 5vw, 84px);
}
.dproc .sup { color: rgba(255, 255, 255, .45); }
.dproc__ghost { position: absolute; right: -6%; bottom: -46%; z-index: -1; width: min(50vw, 740px); pointer-events: none; }
.dproc__ghost svg { width: 100%; height: auto; }
.dproc__ghost .logo-symbol--ghost path { stroke: rgba(255, 255, 255, .08); }
.dproc__track { position: relative; }
.dproc__line { position: absolute; left: 0; right: 0; top: 6px; height: 1px; background: rgba(255, 255, 255, .18); }
.dproc__line i { position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: 0 0; will-change: transform; }
.dproc__steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px var(--gap); }
.dstep { position: relative; min-width: 0; padding: 42px clamp(4px, 1.4vw, 24px) 0 0; }
.dstep__dot {
  position: absolute; left: 0; top: 0; width: 13px; height: 13px; border-radius: 50%; background: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); transition: background-color .5s var(--ease), box-shadow .5s var(--ease), transform .6s var(--ease);
}
.dstep.is-on .dstep__dot { background: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 6px rgba(255, 114, 18, .16); }
.dstep__num { display: block; margin-bottom: clamp(14px, 1.8vw, 26px); font-family: var(--f-latin); font-weight: 200; font-size: clamp(38px, 3.6vw, 62px); line-height: 1; letter-spacing: -.02em; color: rgba(255, 255, 255, .36); transition: color .7s var(--ease); }
.dstep.is-on .dstep__num { color: var(--white); }
.dstep__title { margin-bottom: 8px; font-weight: 500; font-size: clamp(18px, 1.4vw, 23px); line-height: 1.3; }
html[lang="en"] .dstep__title { font-family: var(--f-latin); font-weight: 600; letter-spacing: -.01em; }
.dstep__text { max-width: 260px; font-size: 14.5px; line-height: 1.55; color: rgba(255, 255, 255, .66); }

/* ==========================================================================
   5. Selected projects — 3 × 2, equal tiles
   ========================================================================== */
.dproj { gap: var(--gap); }
.dproj__item { min-width: 0; }
.dproj .pcard--ov { height: 100%; }

/* ==========================================================================
   6. Brands — 12 logo tiles in a regular 6 / 4 / 3 grid
   ========================================================================== */
.dbrands { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* ==========================================================================
   7. Finale — "let's discuss" next to a big card of the other direction
      (its photo is that page's cover, so a click grows it straight into it)
   ========================================================================== */
.dfin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: var(--sec) 10px var(--sec); }
.dfin__cta, .dfin__next { min-height: clamp(360px, 34vw, 540px); border-radius: var(--radius); }
.dfin__cta { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: clamp(26px, 3vw, 48px) calc(var(--pad) - 10px) clamp(26px, 3vw, 44px); background: var(--white); }
.dfin__cta .marker { display: flex; }
.dfin__body { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.dfin__title { max-width: 13ch; font-weight: 600; font-size: clamp(32px, 3.6vw, 62px); line-height: 1.08; letter-spacing: -.005em; }
html[lang="ka"] .dfin__title { line-height: 1.16; }
html[lang="en"] .dfin__title { font-family: var(--f-latin); font-weight: 700; letter-spacing: -.025em; }
.dfin__text { max-width: 400px; font-size: 16px; line-height: 1.55; color: var(--text-2); }
.dfin__body .btn { margin-top: 10px; }

.dfin__next { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(22px, 2.6vw, 40px); overflow: hidden; isolation: isolate; clip-path: inset(0 round var(--radius)); background: var(--ink); color: var(--white); }
.dfin__media { position: absolute; inset: 0; z-index: -2; overflow: hidden; border-radius: 0; background: var(--ink); }
.dfin__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.8s var(--ease), opacity .9s var(--ease); }
.dfin__next--facade .dfin__media img { object-position: 50% 38%; }
.dfin__next--interior .dfin__media img { object-position: 50% 56%; }
.dfin__next:hover .dfin__media img { transform: scale(1.05); }
.dfin__next::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(180deg, rgba(20, 28, 45, .34) 0%, rgba(20, 28, 45, 0) 34%, rgba(20, 28, 45, .1) 56%, rgba(20, 28, 45, .74) 100%); }
.dfin__icon { width: clamp(40px, 3.3vw, 50px); height: auto; }
.dfin__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.dfin__name { min-width: 0; font-weight: 700; font-size: clamp(40px, 4.7vw, 86px); line-height: 1; }
html[lang="ka"] .dfin__name { line-height: 1.08; }
html[lang="en"] .dfin__name { font-family: var(--f-latin); font-weight: 800; letter-spacing: -.02em; }
.dfin__go { flex: none; display: grid; place-items: center; width: clamp(52px, 4.6vw, 72px); height: clamp(52px, 4.6vw, 72px); border-radius: 50%; background: var(--white); color: var(--ink); transition: transform .8s var(--ease); }
.dfin__go svg { width: 32%; height: 32%; }
.dfin__next:hover .dfin__go { transform: translateX(6px); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
  .dhero__bar { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1024px) {
  .dsvc__media { grid-column: 1 / span 5; aspect-ratio: 3 / 4; }
  .dsvc__list { grid-column: 6 / span 7; }
  .dproc__steps { gap: 28px var(--gap); }
  .dbrands { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* ==========================================================================
   Phones: compact and thumb-friendly, same patterns as the home page
   (materials become a swipe rail with progress dots, the process line runs down the left edge,
   projects two per row, brand tiles three per row; every tap target >= 44px)
   ========================================================================== */
.rail-dots { display: none; }
@media (max-width: 860px) {
  /* swipe rail (materials): cards snap to the page margin, the next one peeks in */
  .drail {
    --rail-pad: var(--pad);
    display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding: 0 var(--rail-pad);
    margin: 0 calc(var(--rail-pad) * -1); padding: 0 0 4px var(--rail-pad);
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .drail::-webkit-scrollbar { display: none; }
  /* trailing space = leading space in every browser (end padding of a scroller is not reliable) */
  .drail::after { content: ""; flex: 0 0 calc(var(--rail-pad) - 10px); }
  .drail > * { flex: 0 0 min(70%, 340px); min-width: 0; scroll-snap-align: start; }
  .rail-dots { display: flex; justify-content: center; gap: 6px; margin-top: 18px; }
  .rail-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--mist-2); transition: background-color .3s, transform .3s var(--ease); }
  .rail-dots i.is-on { background: var(--ink); transform: scale(1.25); }
}
@media (max-width: 760px) {
  /* hero: one screen, readable copy, numbers two per row */
  .dhero { height: auto; min-height: 0; max-height: none; padding: 6px; }
  .dhero__frame { height: auto; min-height: max(560px, calc(calc(var(--vh, 1vh) * 84) - 12px)); gap: 20px; }
  /* the long Mtavruli word (9 wide capitals) scales with the screen so it never runs off the edge */
  html[lang="ka"] .dhero--interior .dhero__title { font-size: min(54px, calc((100vw - 44px) / 7)); }
  html[lang="ka"] .dhero--facade .dhero__title { font-size: min(72px, calc((100vw - 44px) / 5.2)); }
  .dhero__lead { max-width: none; padding-bottom: 0; font-size: 15.5px; }
  .dhero__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px var(--gap); }
  .dstat dt { font-size: 13px; }
  .dstat dd { font-size: 28px; }
  .dhero__cta { flex-direction: column; }
  .dhero__cta .btn { width: 100%; height: 50px; }

  /* what we do: the photo on top, then the rows */
  .dsvc__media { grid-column: 1 / -1; aspect-ratio: 16 / 10; max-height: none; }
  .dsvc__list { grid-column: 1 / -1; margin-top: 22px; }
  .dsvc__row { grid-template-columns: 34px minmax(0, 1fr); padding: 18px 0 20px; }
  .dsvc__title { font-size: 19px; margin-bottom: 6px; }
  .dsvc__text { font-size: 15px; }

  /* materials: rail cards */
  .mcard__media { aspect-ratio: 3 / 2; margin-bottom: 10px; }
  .mcard__name { font-size: 16.5px; }

  /* process: the line runs down the left edge, steps stack beside it */
  .dproc { padding: 0 6px; }
  .dproc__frame { padding: 44px 20px 40px; }
  .dproc__ghost { width: 130vw; right: -45%; bottom: -14%; }
  .dproc__line { left: 6px; right: auto; top: 8px; bottom: 8px; width: 1px; height: auto; }
  .dproc__line i { transform: scaleY(0); }
  .dproc__steps { grid-template-columns: 1fr; gap: 26px; }
  .dstep { padding: 0 0 0 34px; }
  .dstep__dot { top: 4px; }
  .dstep__num { margin-bottom: 8px; font-size: 30px; }
  .dstep__title { font-size: 18px; margin-bottom: 4px; }
  .dstep__text { max-width: none; font-size: 15px; }

  /* "all projects / all brands": full-width buttons like the hero's; a long label wraps instead of losing its padding */
  .dsec .more-row .btn { width: 100%; height: auto; min-height: 52px; padding: 10px 18px; white-space: normal; text-align: center; line-height: 1.3; }

  /* brands: three logo tiles per row */
  .dbrands { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .dbrands .btile { padding: 12% 9%; }
  .dbrands .btile__logo { inset: 18% 12%; }

  /* finale: stacked, the other direction as a big tappable photo */
  .dfin { grid-template-columns: 1fr; gap: 6px; padding: var(--sec) 6px var(--sec); }
  .dfin__cta { min-height: 0; padding: 32px 20px 26px; }
  .dfin__body .btn { width: 100%; height: 50px; }
  .dfin__next { min-height: 300px; padding: 20px; }
  /* the arrow moves to the top corner, so the long Mtavruli word gets the whole width */
  .dfin__go { position: absolute; top: 20px; right: 20px; }
  .dfin__name { font-size: min(60px, calc((100vw - 60px) / 7)); }
}
@media (max-width: 640px) {
  /* selected projects: two per row, portrait tiles, the title over a deeper shade */
  .cards.dproj { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dproj .pcard--ov .media { aspect-ratio: 4 / 5; }
  .dproj .pcard--ov .media::after { background: linear-gradient(180deg, rgba(20, 28, 45, 0) 30%, rgba(20, 28, 45, .88) 100%); }
  .dproj .pcard--ov .pcard__info { left: 12px; right: 12px; bottom: 11px; }
  .dproj .pcard--ov .pcard__meta { gap: 7px; margin-bottom: 4px; font-size: 11px; }
  .dproj .pcard--ov .pcard__title { font-size: 15px; line-height: 1.25; }
}
@media (max-width: 380px) {
  .dstat dd { font-size: 26px; }
  .dsec .more-row .btn { gap: 10px; padding: 10px 14px; font-size: 13px; }
  .dproj .pcard--ov .pcard__title { font-size: 14.5px; }
}
