/* AG Holdings — scroll and image motion (pairs with assets/ag-motion.js).
   Everything is gated behind html.ag-motion, which the script only adds when
   motion is allowed, so content is always visible without JavaScript. */

:root {
  --ag-ease: cubic-bezier(.2, .7, .2, 1);
  --ag-ease-soft: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Scroll reveals ---------- */
html.ag-motion [data-ag] {
  transition:
    opacity .85s var(--ag-ease) var(--ag-d, 0ms),
    transform 1s var(--ag-ease) var(--ag-d, 0ms);
  will-change: opacity, transform;
}
html.ag-motion [data-ag="up"]    { opacity: 0; transform: translate3d(0, 34px, 0); }
html.ag-motion [data-ag="fade"]  { opacity: 0; }
html.ag-motion [data-ag="start"] { opacity: 0; transform: translate3d(-44px, 0, 0); }
html.ag-motion [data-ag="end"]   { opacity: 0; transform: translate3d(44px, 0, 0); }
html.ag-motion[dir="rtl"] [data-ag="start"] { transform: translate3d(44px, 0, 0); }
html.ag-motion[dir="rtl"] [data-ag="end"]   { transform: translate3d(-44px, 0, 0); }
html.ag-motion [data-ag="zoom"]  { opacity: 0; transform: scale(.94); }

/* Image reveal: the photo wipes open while it settles from a slight zoom.
   (The wipe sits on the <img>, not the frame, so the frame stays measurable on scroll.) */
html.ag-motion [data-ag="image"] { overflow: hidden; }
html.ag-motion [data-ag="image"] img {
  clip-path: inset(0 0 100% 0);
  transform: scale(1.16);
  transition:
    clip-path 1.2s var(--ag-ease-soft) var(--ag-d, 0ms),
    transform 1.7s var(--ag-ease-soft) var(--ag-d, 0ms);
  will-change: clip-path, transform;
}
html.ag-motion[dir="rtl"] .founder-portrait[data-ag="image"] img { transform: scaleX(-1) scale(1.16); }

html.ag-motion [data-ag].ag-in {
  opacity: 1;
  transform: none;
}
html.ag-motion [data-ag="image"].ag-in img { clip-path: inset(0 0 0 0); transform: none; }
html.ag-motion[dir="rtl"] .founder-portrait[data-ag="image"].ag-in img { transform: scaleX(-1); }

/* ---------- Page banners: slow settle on load + text entrance ---------- */
html.ag-motion .page-banner-image,
html.ag-motion .company-banner {
  animation: ag-banner-settle 2.4s var(--ag-ease-soft) both;
}
@keyframes ag-banner-settle {
  from { transform: scale(1.12); opacity: .55; }
  to   { transform: scale(1);    opacity: 1; }
}
html.ag-motion .inner-hero .wrap > *,
html.ag-motion .company-hero-content > * {
  animation: ag-rise .9s var(--ag-ease) both;
}
html.ag-motion .inner-hero .wrap > :nth-child(2),
html.ag-motion .company-hero-content > :nth-child(2) { animation-delay: .12s; }
html.ag-motion .inner-hero .wrap > :nth-child(3),
html.ag-motion .company-hero-content > :nth-child(3) { animation-delay: .24s; }
html.ag-motion .inner-hero .wrap > :nth-child(n+4),
html.ag-motion .company-hero-content > :nth-child(n+4) { animation-delay: .36s; }
@keyframes ag-rise {
  from { opacity: 0; transform: translate3d(0, 26px, 0); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Hover polish on images and cards ---------- */
@media (hover: hover) {
  .directory-card:hover .directory-image img,
  .portfolio-visual:hover img { transform: scale(1.06); }
  .portfolio-visual { overflow: hidden; }
  .portfolio-visual img { transition: transform 1.1s var(--ag-ease-soft); }
  .ag-partnership-image img { transition: transform 1.2s var(--ag-ease-soft); }
  .ag-partnership-image:hover img { transform: scale(1.04); }
  .interior-card { transition: transform .35s var(--ag-ease), box-shadow .35s var(--ag-ease), background .25s; }
  .interior-card:hover { box-shadow: 0 18px 40px -22px rgba(40, 55, 92, .45); }
  .interior-card .card-arrow { display: inline-block; transition: transform .35s var(--ag-ease); }
  .interior-card:hover .card-arrow { transform: translate(4px, -4px); }
  [dir="rtl"] .interior-card:hover .card-arrow { transform: translate(-4px, -4px); }
}

/* ---------- Career form: CV upload + status ---------- */
.application-grid .application-file input[type="file"] {
  border: 1px dashed #c7c3b9;
  padding: 14px;
  min-height: 56px;
  cursor: pointer;
  font-size: 14px;
}
.application-grid .application-file input[type="file"]::file-selector-button {
  margin-inline-end: 14px;
  padding: 9px 16px;
  border: 1px solid var(--gold, #b49c74);
  background: transparent;
  color: var(--ink, #28375c);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .25s;
}
.application-grid .application-file input[type="file"]::file-selector-button:hover { background: #b49c7426; }
.application-status[data-state="success"] { color: #1f6b4a; }
.application-status[data-state="error"] { color: #9b2c2c; }
.career-application .button[disabled] { opacity: .6; cursor: progress; }

@media (prefers-reduced-motion: reduce) {
  html.ag-motion [data-ag],
  html.ag-motion [data-ag] img {
    opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none !important;
  }
  html.ag-motion .page-banner-image,
  html.ag-motion .company-banner,
  html.ag-motion .inner-hero .wrap > *,
  html.ag-motion .company-hero-content > * { animation: none !important; }
}
