/* ===============================
   FOOTER LAYOUT
================================ */
.footer {
  width: 100%;
  min-height: 100vh;
  /* safer than height */
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
}

/* ===============================
   TOP SECTION
================================ */
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6vw;
  padding-bottom: 4rem;
}

.footer-heading {
  font-size: clamp(120px, 20vw, 170px);
  font-weight: var(--dz-regular-weight);
  line-height: 0.9;
}

/* 🔥 MASK WRAPPER */
.footer-line-wrapper {
  overflow: hidden;
  display: block;
}

/* smooth rendering */
.footer-heading .line {
   display: block; /* ❗ THIS WAS MISSING */
  will-change: transform;
}

.arrow-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: transparent;
  border: none;
  color: var(--dz-fg);
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
}

/* Text Animation */
.btn-text {
  transition: transform 0.4s cubic-bezier(.76, 0, .24, 1);
}

.arrow-btn:hover .btn-text {
  transform: translateX(-8px);
}

/* Icon Container */
.btn-icon {
  position: relative;
  display: flex;
  align-items: center;
  transition: transform 0.4s cubic-bezier(.76, 0, .24, 1);
}

.arrow-btn:hover .btn-icon {
  transform: translateX(4px);
}

/* Optional smooth feel */
.arrow-btn i {
  font-size: 18px;
}



/* ===============================
   RIGHT MENUS
================================ */
.footer-right-top {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 5rem;
  padding: 2rem 0 0 0;
}

.footer-col,
.footer-col2 {
  display: flex;
  flex-direction: column;

  /* Without this, flex stretches every child to the width of the
     column — which is set by the widest thing in it, the "SITE INDEX"
     heading. The links then reach far past their own text, so hovering
     the empty space beside a word runs its hover and clicks it. Hugging
     the content keeps each link's hit area on the word itself. */
  align-items: flex-start;
}

.footer-col {
  gap: 15px;
}

.footer-col2 {
  margin-top: 20px;
}

/* ===============================
   HEADINGS
================================ */
.footer-col h3,
.footer-col2 h3 {
  font-size: 20px;
  font-weight: var(--dz-medium-weight);
  margin-bottom: 8px;
  opacity: 1;
}

/* ===============================
   LINK TYPOGRAPHY
================================ */
.footer-col>a span,
.footer-col2>a span {
  font-size: 13px;
  font-weight: var(--dz-regular-weight);
  text-transform: none;
}

/* ===============================
   SLIDE TEXT HOVER EFFECT
================================ */
.footer-link {
  position: relative;
  display: inline-block;
  height: 18px;
  overflow: hidden;
  text-decoration: none;
  color: var(--dz-fg);
}

.footer-link span {
  display: block;
  font-size: 18px;
  line-height: 18px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-link span:nth-child(2) {
  position: absolute;
  inset: 0;
  transform: translateY(100%);
}

.footer-link:hover span:first-child {
  transform: translateY(-100%);
}

.footer-link:hover span:last-child {
  transform: translateY(0);
}

/* SMALL LINKS */
.footer-link.small span {
  font-size: 13px;
}

/* ===============================
   BIG LOGO
================================ */
.footer-logo-anim {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 5rem 0 2rem;
  overflow: hidden;
}

#dzignzFooterLogo svg {
  width: 1860px;
  max-width: 100%;
  height: auto;
  display: block;
}

/* the shapes carry fill="#fff" in the markup — follow the theme instead */
#dzignzFooterLogo svg :is(polygon, path) {
  fill: var(--dz-fg);
}

.footer-left {
  display: flex;
  flex-direction: column;
}

.footer-col2 {
  order: 2;
  margin-top: 1.25rem;
}


/* ===============================
   TEXT ARROW BUTTON Footer
================================ */

/* Behaviour is the shared .dz-text-btn component (bar variant) in
   /css/components.css — label left, arrow right, accent sweeping in
   from the left on hover. This rule only sets where the bar sits in
   the footer and how big it reads. It spans the left column, so no
   align-self / left offset here. */
.button-footer {
  align-self: stretch;
  font-size: 18px;
  font-weight: var(--dz-medium-weight);
  color: var(--dz-fg);
  margin-top: 1.6rem;
}

/* ===============================
   LOGO ANIMATION STATES
   Motion is owned by js/main.js -> revealFooterLogo():
   each letter's shapes are moved into an inner <g> that
   slides up from behind a static per-letter clip window
   (a true masked reveal, matching the heading animations).
   The letters stay hidden until JS adds .fl-ready, so the
   wordmark never flashes before the reveal is wired.
================================ */
.footer-logo-anim .letter {
  opacity: 0;
  will-change: transform;
}

.footer-logo-anim.fl-ready .letter {
  opacity: 1;
}

.footer-logo-anim .fl-inner {
  will-change: transform;
}

/* ===============================
   BOTTOM BAR
================================ */
.footer-bottom {
  margin-top: auto;
  /* bottom-aligned */
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: var(--dz-regular-weight);
}

/* everything in the bar reads at the same strength; the Back to top
   button lifts to full on hover */
.footer-bottom-left,
.footer-bottom .copyright,
.footer-bottom .footer-to-top {
  opacity: calc(0.6 + var(--dz-text-lift));
}

.footer-bottom .footer-to-top {
  transition: opacity 0.3s ease;
}

.footer-bottom .footer-to-top:hover,
.footer-bottom .footer-to-top:focus-visible {
  opacity: 1;
}

.footer-bottom-left {
  display: flex;
  gap: 38px;
}

.footer-bottom-right {
  display: flex;
  align-items: center;
  gap: 38px;
}

/* ===============================
   BACK TO TOP
   Right end of the bottom bar: a label, then the arrow in a round
   outline. On hover the label rolls up like the footer links, the
   circle fills white and the arrow leaves through the top and comes
   back in from below. Scrolling is wired in js/main.js
   (initBackToTop).
================================ */
.footer-to-top {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;

  /* same type as the copyright and the links beside it */
  font: inherit;
  color: var(--dz-fg);

  background: none;
  border: 0;
  cursor: pointer;
}

.footer-to-top:focus-visible {
  outline: none;
}

.footer-to-top__label {
  position: relative;
  display: block;
  height: 18px;
  overflow: hidden;
}

.footer-to-top__label span {
  display: block;
  line-height: 18px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-to-top__label span:nth-child(2) {
  position: absolute;
  inset: 0;
  transform: translateY(100%);
}

.footer-to-top:hover .footer-to-top__label span:first-child,
.footer-to-top:focus-visible .footer-to-top__label span:first-child {
  transform: translateY(-100%);
}

.footer-to-top:hover .footer-to-top__label span:last-child,
.footer-to-top:focus-visible .footer-to-top__label span:last-child {
  transform: translateY(0);
}

/* the round outline — also the clip window for the arrow's loop */
.footer-to-top__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  overflow: hidden;

  border: 1px solid rgba(var(--dz-fg-rgb), 0.4);
  border-radius: 50%;

  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}

.footer-to-top__icon i {
  display: block;
  font-size: 14px;
  line-height: 1;
}

.footer-to-top:hover .footer-to-top__icon,
.footer-to-top:focus-visible .footer-to-top__icon {
  color: var(--dz-bg);
  background: var(--dz-fg);
  border-color: var(--dz-fg);
}

/* the site's white cursor dot (.cursor, main.css) would sit right on
   the arrow once the circle turns white — hide it over the button;
   the native pointer still shows */
body:has(.footer-to-top:hover) .cursor {
  opacity: 0;
}

/* keyboard focus ring sits on the circle */
.footer-to-top:focus-visible .footer-to-top__icon {
  outline: 1px solid var(--dz-fg);
  outline-offset: 3px;
}

.footer-to-top:hover .footer-to-top__icon i,
.footer-to-top:focus-visible .footer-to-top__icon i {
  animation: footerArrowUp 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 24px clears the 30px circle from the arrow's resting spot */
@keyframes footerArrowUp {
  0%   { transform: translateY(0); }
  40%  { transform: translateY(-24px); }
  41%  { transform: translateY(24px); }
  100% { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .footer-to-top__label span,
  .footer-to-top__icon {
    transition: none;
  }

  .footer-to-top:hover .footer-to-top__icon i,
  .footer-to-top:focus-visible .footer-to-top__icon i {
    animation: none;
  }
}

/* ===============================
   EMAIL LINK
================================ */
.email {
  position: relative;
  display: inline-block;
  color: var(--dz-fg);
  text-decoration: none;
  font-size: 15px;
  line-height: 1.2;
  padding-bottom: 2px;
}

/* underline — full width now that the link hugs its text rather than
   being stretched to the width of the column (the old 46.8% was
   guesswork at where the address actually ended) */
.email::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--dz-fg);

  transform: scaleX(0);
  transform-origin: bottom right;

  transition: transform 0.55s cubic-bezier(0.65, 0, 0.35, 1);
}

/* hover */
.email:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* small variant if needed */
.email.small {
  font-size: 15px;
}

/* ===============================
   MOBILE FOOTER — AGENCY STRUCTURE
================================ */
@media (max-width: 1024px) {

  /* Base cleanup */
  .footer {
    min-height: auto;
    padding: 2.5rem 1.25rem 1.5rem;
  }

  /* Stack top cleanly */
  .footer-top {
    flex-direction: column;
    gap: 2.5rem;
  }

  /* BIG HEADLINE */
  .footer-left h2 {
    font-size: clamp(44px, 12vw, 64px);
    line-height: 1.05;
    max-width: 14ch;
  }

  /* HELLO = NEW BUSINESS */
  .footer-col2 {
    margin-top: 0.5rem;
  }

  .footer-col2 h3 {
    font-size: 13px;
    letter-spacing: 0.06em;
    opacity: calc(0.7 + var(--dz-text-lift));
  }

  .email {
    font-size: 15px;
  }

  /* NAVIGATION BLOCK */
  .footer-right-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 1.5rem;
  }

  .footer-col {
    align-items: flex-start;
    text-align: left;
    gap: 14px;
  }

  .footer-col h3 {
    font-size: 13px;
    letter-spacing: 0.06em;
    opacity: calc(0.7 + var(--dz-text-lift));
    margin-bottom: 0.5rem;
  }

  .footer-link span {
    font-size: 14px;
  }

  /* BIG LOGO */
  .footer-logo-anim {
    padding: 4rem 0 2rem;
  }

  #dzignzFooterLogo svg {
    width: 100%;
  }

  /* META INFO (BOTTOM) */
  .footer-bottom {
    margin-top: 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 13px;
  }

  .footer-bottom-left {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
  }

  /* copyright, then Back to top on its own line */
  .footer-bottom-right {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* ===============================
   PHONE (≤ 767px)
   Headline and the Start Project bar run the full width; the
   two link columns sit side by side with Hello as a full-width
   row under them; the bottom bar closes with copyright on the
   left and Back to top on the right.
================================ */
@media (max-width: 1024px) {
  .footer {
    padding: var(--dz-section-py) var(--dz-gutter) 1.5rem;
  }

  .footer-top {
    gap: 3rem;
    padding-bottom: 0;
  }

  .footer-left {
    width: 100%;
  }

  .footer-left h2 {
    font-size: clamp(2.75rem, 13vw, 4rem);
    max-width: none;
  }

  .button-footer {
    margin-top: 2rem;
  }

  .footer-right {
    width: 100%;
  }

  .footer-right-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 0;
    padding-top: 0;
  }

  .footer-col {
    gap: 16px;
  }

  .footer-col h3,
  .footer-col2 h3 {
    font-family: var(--dz-font-body);
    font-size: 11px;
    letter-spacing: 0.15em;
  }

  .footer-col2 {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(var(--dz-fg-rgb), 0.1);
  }

  .footer-col2 .email {
    font-family: var(--dz-font-display);
    font-size: clamp(1.6rem, 7.5vw, 2rem);
    font-weight: var(--dz-heading-weight);
  }

  .footer-logo-anim {
    padding: 3.5rem 0 1.75rem;
  }

  .footer-bottom {
    margin-top: 0;
    gap: 1.25rem;
    font-size: 11px;
  }

  .footer-bottom-left {
    gap: 1.25rem;
  }

  .footer-bottom-right {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(var(--dz-fg-rgb), 0.1);
  }
}

/* ===============================
   LANDSCAPE TABLETS + SMALL LAPTOPS (1025px – 1279px)
   The desktop footer runs a 20vw headline beside the link columns,
   which crushes both at this width (a 1024px iPad in landscape
   wrapped the headline onto five lines). Stack it instead: headline and
   Start Project bar on top, link columns + Hello in a row beneath.
================================ */
@media (min-width: 1025px) and (max-width: 1279px) {
  .footer {
    min-height: auto;
    padding: 4rem 2rem 1.75rem;
  }

  .footer-top {
    flex-direction: column;
    gap: 3rem;
    padding-bottom: 1rem;
  }

  .footer-left,
  .footer-right {
    width: 100%;
  }

  .footer-left .footer-heading {
    font-size: clamp(4.5rem, 12.5vw, 8rem);
    line-height: 0.98;
  }

  .button-footer {
    max-width: 32rem;
  }

  /* link columns + Hello share one three-up row */
  .footer-right {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
  }

  .footer-right-top {
    display: contents;
  }

  .footer .footer-col2 {
    order: 0;
    margin-top: 0;
    padding-top: 0;
  }

  .footer-logo-anim {
    padding: 3rem 0 1.75rem;
  }

  #dzignzFooterLogo svg {
    width: 100%;
    height: auto;
  }

  .footer-bottom {
    flex-wrap: wrap;
    gap: 1rem 2rem;
  }
}

/* ===============================
   LAPTOP (1280px – 1599px)
   The 170px headline needs ~850px of the footer's left column, which
   a 1280–1440px laptop does not have once the link columns take their
   share (it wrapped onto 3–4 lines). Scale it with the screen until
   it reaches its 170px cap.
================================ */
@media (min-width: 1280px) {
  .footer-heading {
    font-size: clamp(120px, 10.8vw, 170px);
  }
}
