/* ==========================================================================
   Footer (js/footer.js). A services ticker, the brand and link columns, the
   app badges and a giant "gigify" wordmark lit by a
   drifting green spotlight, with a spinning sticker above the y.
   Everything reads and works without JavaScript; the script only adds the
   Valletta clock, the spotlight and the back-to-top progress.
   ========================================================================== */

.site-footer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-bottom: var(--space-5);
  background: var(--gg-forest);
  color: var(--gg-white);
  --color-focus: var(--gg-white);
}

.foot-heading {
  margin-bottom: var(--space-3);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--gg-green);
}

/* Ambient loops (ticker, badge, clock dot) do not wait for the scroll engine: they run
   unless the visitor prefers reduced motion or switched motion off in the footer. */

/* ---- Ticker ------------------------------------------------------------ */
.foot-ticker {
  overflow: hidden;
  padding-block: var(--space-3);
  background: var(--gg-green);
  color: var(--gg-ink);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.foot-ticker__track {
  display: flex;
  width: max-content;
}

.foot-ticker span {
  display: inline-flex;
  align-items: center;
  font-size: clamp(1rem, 0.85rem + 0.8vw, 1.5rem);
  font-weight: var(--fw-heavy);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.foot-ticker span::after {
  content: "";
  width: 0.5em;
  height: 0.5em;
  margin-inline: 0.9em;
  border-radius: 50%;
  border: 3px solid currentColor;
}

:root:not(.motion-off) .foot-ticker__track {
  animation: foot-ticker 38s linear infinite;
}

.foot-ticker:hover .foot-ticker__track {
  animation-play-state: paused;
}

@keyframes foot-ticker {
  to { transform: translateX(-50%); }
}

/* ---- Columns ----------------------------------------------------------- */
.foot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
  padding-block: var(--space-7) var(--space-6);
}

.foot-brand {
  grid-column: 1 / -1;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: var(--space-3);
}

.foot-brand .logo {
  grid-area: auto;
}

.foot-brand__tag {
  max-width: 34ch;
  color: #E0E0E0;
}

.foot-clock {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-pill);
  font-size: var(--fs-small);
  color: #E0E0E0;
}

.foot-clock[hidden] {
  display: none;
}

.foot-clock time {
  font-variant-numeric: tabular-nums;
  font-weight: var(--fw-bold);
  color: var(--gg-white);
}

.foot-clock__dot {
  position: relative;
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--gg-green);
}

:root:not(.motion-off) .foot-clock__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  animation: foot-ping 2s ease-out infinite;
}

@keyframes foot-ping {
  to { transform: scale(3); opacity: 0; }
}

.foot-col ul {
  display: grid;
  gap: 0;
}

/* links: an underline that sweeps in and a small arrow that slides along */
.foot-col a,
.foot-bottom .site-footer__legal-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  color: #E0E0E0;
  text-decoration: none;
  transition: color var(--ease), transform var(--ease);
}

.foot-col a::before,
.foot-bottom .site-footer__legal-nav a::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.3rem;
  height: 2px;
  background: var(--gg-green);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 260ms ease;
}

.foot-col a::after {
  content: "\2192";
  margin-left: 0.4em;
  color: var(--gg-green);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity var(--ease), transform var(--ease);
}

.foot-col a:hover,
.foot-col a:focus-visible,
.foot-bottom .site-footer__legal-nav a:hover {
  color: var(--gg-white);
}

.foot-col a:hover::before,
.foot-col a:focus-visible::before,
.foot-bottom .site-footer__legal-nav a:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

.foot-col a:hover::after,
.foot-col a:focus-visible::after {
  opacity: 1;
  transform: none;
}

/* ---- App ------------------------------------------------------------- */
.foot-app {
  grid-column: 1 / -1;
}

.foot-app__text {
  max-width: 26ch;
  margin-bottom: var(--space-3);
  font-size: var(--fs-small);
  color: #E0E0E0;
}

.foot-app .stores {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.foot-app .store--img {
  border-radius: 12px;
  transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow var(--ease);
}

.foot-app .store--img:hover,
.foot-app .store--img:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), 0 0 0 2px var(--gg-green);
}

.foot-app .store--img img {
  height: 2.75rem;
}

/* ---- Giant wordmark ---------------------------------------------------- */
.foot-mark {
  padding-inline: var(--gutter);
  margin-bottom: var(--space-5);
  line-height: 0;
  user-select: none;
}

.foot-mark__inner {
  position: relative;
  max-width: 72rem;
  margin-inline: auto;
}

.foot-mark__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.foot-mark__word {
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 0.12;
}

.has-motion .foot-mark__svg {
  clip-path: inset(100% 0 0 0);
  transform: translateY(18%);
  transition: clip-path 1.1s cubic-bezier(0.22, 1, 0.36, 1), transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.has-motion .foot-mark.is-in .foot-mark__svg {
  clip-path: inset(-10% 0 -10% 0);
  transform: none;
}

/* spinning sticker in the empty space above the y */
.foot-badge {
  display: none; /* too small to read on phones */
  position: absolute;
  top: 0;
  right: 1.5%;
  width: 11%;
  height: auto;
  aspect-ratio: 1;
  user-select: none;
}

.foot-badge text {
  font-size: 17px;
  font-weight: var(--fw-heavy);
  letter-spacing: 0.08em;
  fill: var(--gg-white);
}

.foot-badge__ring {
  transform-origin: 100px 100px;
}

:root:not(.motion-off) .foot-badge__ring {
  animation: foot-spin 22s linear infinite;
}

.foot-badge:hover .foot-badge__ring {
  animation-duration: 6s;
}

.foot-badge__core {
  fill: var(--gg-forest);
  stroke: rgba(255, 255, 255, 0.2);
}

@keyframes foot-spin {
  to { transform: rotate(360deg); }
}

/* ---- Bottom bar -------------------------------------------------------- */
.foot-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.foot-bottom__copy {
  font-size: var(--fs-small);
  color: #E0E0E0;
}

.foot-bottom .site-footer__legal-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-4);
}

.foot-bottom .site-footer__legal-nav a,
.foot-bottom .link-button {
  min-height: 2.25rem;
  font-size: var(--fs-small);
  line-height: inherit;
  color: #E0E0E0;
  text-decoration: none;
}

.foot-bottom .link-button:hover {
  color: var(--gg-white);
}

.foot-top {
  --p: 0;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  color: var(--gg-white);
  transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1), background var(--ease);
}

.foot-top svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.foot-top__track {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 2;
}

.foot-top__bar {
  stroke: var(--gg-green);
  stroke-width: 2.5;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--p) * 100);
  transform: rotate(-90deg);
  transform-origin: 24px 24px;
}

.foot-top__arrow {
  stroke: currentColor;
  stroke-width: 2.5;
  transition: transform var(--ease);
}

.foot-top:hover {
  background: rgba(81, 186, 108, 0.16);
  transform: translateY(-3px);
}

.foot-top:hover .foot-top__arrow {
  transform: translateY(-2px);
}

.site-footer__legal {
  position: relative;
  z-index: 1;
  margin-top: var(--space-3);
  font-size: var(--fs-small);
  color: #BDBDBD;
}

/* ---- Larger screens ---------------------------------------------------- */
@media (min-width: 768px) {
  .foot-badge {
    display: block;
  }
  .foot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .foot-grid {
    grid-template-columns: 1.5fr repeat(3, minmax(0, 0.8fr)) auto;
    gap: var(--space-6);
  }
  .foot-brand,
  .foot-app {
    grid-column: auto;
  }
  .foot-app .stores {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .foot-ticker__track,
  .foot-badge__ring,
  .foot-clock__dot::after {
    animation: none !important;
  }
}
