/* FACHS Insurance Brokers (fachsinsurance.co.za) holding page. Layout and motion only; type, colour and links come from brand.css.
   Designed and developed by FTK Technologies, ftktechnologies@gmail.com */
html, body { height: 100%; }
body { min-height: 100vh; min-height: 100svh; overflow-x: hidden; }

/* Still background: fine horizontal lines (the rows of the logo mark) and a soft glow from the bottom corners. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, var(--fachs-night-50) 0 2px, transparent 2px 28px);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 55% at 0% 100%, var(--fachs-night-50), transparent 70%),
    radial-gradient(60% 55% at 100% 100%, var(--fachs-night-50), transparent 70%);
}

.stage {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(1rem, 3.5vh, 2rem);
  padding: clamp(1.5rem, 5vh, 3rem) 1rem;
  text-align: center;
}
.logo { width: min(34rem, 84vw); line-height: 0; }
.mark { display: block; width: 100%; height: auto; overflow: visible; }
.title { max-width: 18ch; }
.note { margin: 0; max-width: 34rem; color: var(--fachs-grey-700); }
.contact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem 1.75rem;
  font-weight: 600;
}
.contact a { text-decoration-thickness: 1px; }
.fsp { margin: 0; max-width: 34rem; font-size: var(--fachs-font-size-small, .875rem); color: var(--fachs-grey-700); }
.credit { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* The one moving element: the logo, cut from the supplied artwork (images/fachs-insurance.svg) into the logo and its tagline, nothing redrawn.
   On load it rises into place. Every few seconds it glitches for a split second, like a broken signal: the real logo blinks out,
   six horizontal slices of it (.gs) tear sideways by different amounts, and a sky and a purple copy (.gx) split left and right behind them.
   It jumps between frames with no easing (steps), then snaps back clean. A smaller hit comes halfway through the loop.
   Units are the logo grid, 1362 x 439. */
.mark g { transform-box: view-box; }
.main { animation: in 1.3s cubic-bezier(.2, .7, .2, 1) both, g-main 3.4s steps(1, end) 1.8s infinite; }
@keyframes in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.gs, .gx { opacity: 0; animation: 3.4s steps(1, end) 1.8s infinite; }
.gs { animation-name: g-slice; }
.gx { animation-name: g-split; }
.gs--1 { --a: 46px;  --b: -24px; --c: 70px;  --d: 0px; }
.gs--2 { --a: -62px; --b: 38px;  --c: -18px; --d: 34px; }
.gs--3 { --a: 18px;  --b: -74px; --c: 40px;  --d: 0px; }
.gs--4 { --a: -38px; --b: 56px;  --c: -60px; --d: -40px; }
.gs--5 { --a: 66px;  --b: -14px; --c: 26px;  --d: 0px; }
.gs--6 { --a: -30px; --b: 48px;  --c: -52px; --d: 28px; }
.gx--sky    { --s: -22px; }
.gx--purple { --s: 22px; }
@keyframes g-main { 0% { opacity: 1; } 44% { opacity: 0; } 45.5% { opacity: 1; } 86% { opacity: 0; } 92% { opacity: 1; } }
@keyframes g-slice {
  0%    { opacity: 0; transform: none; }
  44%   { opacity: 1; transform: translateX(var(--d)); }
  45.5% { opacity: 0; transform: none; }
  86%   { opacity: 1; transform: translateX(var(--a)); }
  88%   { opacity: 1; transform: translateX(var(--b)); }
  90%   { opacity: 1; transform: translateX(var(--c)); }
  92%   { opacity: 0; transform: none; }
}
@keyframes g-split {
  0%    { opacity: 0; transform: none; }
  86%   { opacity: .9; transform: translateX(var(--s)); }
  88%   { opacity: .9; transform: translateX(calc(var(--s) * -1.6)); }
  90%   { opacity: .9; transform: translateX(calc(var(--s) * .6)); }
  92%   { opacity: 0; transform: none; }
}

/* The tagline line drifts slowly left and right, a few units each way, all the time. */
.tag { animation: in 1.3s .3s cubic-bezier(.2, .7, .2, 1) both, drift 5s 1.6s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-9px); } to { transform: translateX(9px); } }

.title, .note, .contact, .fsp { animation: rise 1.1s .7s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .main, .tag, .gs, .gx, .title, .note, .contact, .fsp { animation: none; }
  .gs, .gx { opacity: 0; }
}
