/* ==========================================================
   SHARED COMPONENTS
   Small cross-page primitives. This sheet is loaded LAST on
   every page so its rules win the cascade over page CSS
   without needing !important.
========================================================== */


/* ----------------------------------------------------------
   SECTION EYEBROW  —  orange dot + small uppercase label
   Canonical version of the About page's .about-eyebrow, made
   global so every section label across the site matches.

   Usage: add `dz-eyebrow` alongside the element's existing
   class. Spacing (margin) is intentionally left to the
   context / existing class.
---------------------------------------------------------- */
.dz-eyebrow {
  /* inline-flex so it centres inside text-align:center sections
     yet still sits flush-left in normal left-aligned ones */
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  vertical-align: middle;

  margin-bottom: var(--dz-eyebrow-gap, 1.25rem);   /* eyebrow -> heading */

  font-size: var(--dz-eyebrow-size, 0.75rem);
  line-height: 1;
  letter-spacing: var(--dz-eyebrow-tracking, 0.15em);
  text-transform: uppercase;
  font-weight: var(--dz-medium-weight);

  color: rgba(var(--dz-fg-rgb), calc(0.7 + var(--dz-text-lift)));
}

.dz-eyebrow::before {
  content: "";
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dz-accent, #FF6500);
}


/* ----------------------------------------------------------
   TEXT BUTTON  —  the site's one text CTA
   At rest the arrow sits AFTER the label; on hover it swaps to
   BEFORE it and an underline wipes in from the left. The width
   hugs the content, so the underline ends exactly at the arrow.

   Canonical version of the footer's "Start Project" button,
   made global so every text CTA behaves identically. Colour and
   font-size are inherited, so the surrounding context still
   owns sizing and spacing (see .button-footer, .button-about).

   Two pieces are optional, so one component covers every CTA
   on the site:
     · the arrows       — leave them out for a plain text label
     · a doubled label  — see the roll-up block below

   Markup (the arrow form, used by the footer + home text links):
     <a class="dz-text-btn">
       <span class="dz-text-btn__arrow dz-text-btn__arrow--pre"  aria-hidden="true"><i class="ri-arrow-right-line"></i></span>
       <span class="dz-text-btn__label">Label</span>
       <span class="dz-text-btn__arrow dz-text-btn__arrow--post" aria-hidden="true"><i class="ri-arrow-right-line"></i></span>
     </a>
---------------------------------------------------------- */

.dz-text-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: -moz-fit-content;
  width: fit-content;

  /* the arrows carry their own margins, and the underline sits
     below the box — so neither a gap nor clipping is wanted */
  gap: 0;
  overflow: visible;

  font-family: var(--dz-font-button);
  text-decoration: none;
  line-height: 1;
}

/* ---- ARROWS -----------------------------------------------
   Both collapse to zero width when inactive, so the label never
   shifts more than the arrow itself and the button holds its
   width right through the swap.
------------------------------------------------------------ */

.dz-text-btn__arrow {
  display: inline-flex;
  align-items: center;
  max-width: 1.4em;
  opacity: 1;
  overflow: hidden;
  transition: max-width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.3s ease,
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.dz-text-btn__arrow i {
  font-size: 1.15em;
}

.dz-text-btn__arrow--pre {
  max-width: 0;
  opacity: 0;
  transform: translateX(-6px);
  margin-right: 0;
}

.dz-text-btn__arrow--post {
  margin-left: 8px;
  transform: translateX(0);
}

.dz-text-btn:hover .dz-text-btn__arrow--pre,
.dz-text-btn:focus-visible .dz-text-btn__arrow--pre {
  max-width: 1.4em;
  opacity: 1;
  transform: translateX(0);
  margin-right: 8px;
}

.dz-text-btn:hover .dz-text-btn__arrow--post,
.dz-text-btn:focus-visible .dz-text-btn__arrow--post {
  max-width: 0;
  opacity: 0;
  transform: translateX(6px);
  margin-left: 0;
}

/* ---- LABEL: doubled roll-up (optional) --------------------
   Used by the boxed CTAs, which carry no arrow. Same effect as
   .footer-link and the nav menu — two copies of the word stacked
   in a mask; on hover the top one rides out and its twin rides
   in from below.

   The 1.3 line-height is load-bearing: it gives the mask room so
   descenders (the j in "Project") are not shaved, and it keeps
   both copies exactly the same height, so the one leaving and
   the one arriving travel the same distance.

   Markup:
     <span class="dz-text-btn__label"><span>Label</span><span>Label</span></span>
   A plain text label still works — it just does not roll.
------------------------------------------------------------ */

.dz-text-btn__label {
  position: relative;
  display: block;
  overflow: hidden;
}

.dz-text-btn__label span {
  display: block;
  line-height: 1.3;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.dz-text-btn:hover .dz-text-btn__label span:first-child,
.dz-text-btn:focus-visible .dz-text-btn__label span:first-child {
  transform: translateY(-100%);
}

.dz-text-btn:hover .dz-text-btn__label span:last-child,
.dz-text-btn:focus-visible .dz-text-btn__label span:last-child {
  transform: translateY(0);
}


/* underline wipe — spans the fit-content width, so it ends at the arrow */
.dz-text-btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.55s cubic-bezier(0.65, 0, 0.35, 1);
}

.dz-text-btn:hover::after,
.dz-text-btn:focus-visible::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.dz-text-btn:focus-visible {
  outline: none;
}


/* ---- BOXED MODIFIER ----------------------------------------
   For a CTA that already has a shape of its own (a filled or
   outlined button). Keeps the label roll, drops the underline —
   a rule under the label reads as a mistake inside a solid
   button — and hands the shape back its own box behaviour.
   Pair it with the shape's class, e.g.
   `class="cta-btn primary dz-text-btn dz-text-btn--boxed"`.
------------------------------------------------------------ */

.dz-text-btn--boxed {
  width: auto;
  justify-content: center;
  overflow: hidden;
}

.dz-text-btn--boxed::after {
  content: none;
}


/* ---- BAR MODIFIER ------------------------------------------
   Full-width row: label hard left, arrow hard right, a hairline
   above. At rest it reads as plain text on the page; on hover
   white sweeps across from the left and the text flips to black
   to sit on it.

   The fill is a ::before scaled on X, so it animates on the
   compositor and the sweep direction is a one-word change
   (transform-origin). `isolation` keeps its z-index: -1 behind
   the label but still in front of whatever is behind the bar.

   Markup:
     <a class="dz-text-btn dz-text-btn--bar">
       <span class="dz-text-btn__label">Label</span>
       <span class="dz-text-btn__arrow" aria-hidden="true"><i class="ri-arrow-right-line"></i></span>
     </a>
------------------------------------------------------------ */

.dz-text-btn--bar {
  width: 100%;
  justify-content: space-between;
  gap: 1.5rem;

  padding: 1.15rem 1.25rem;
  border-top: 1px solid rgba(var(--dz-fg-rgb), 0.14);

  overflow: hidden;
  isolation: isolate;

  transition: color 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

/* the underline belongs to the inline form, not to a filled bar */
.dz-text-btn--bar::after {
  content: none;
}

.dz-text-btn--bar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;

  background: var(--dz-fg);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

.dz-text-btn--bar:hover::before,
.dz-text-btn--bar:focus-visible::before {
  transform: scaleX(1);
}

.dz-text-btn--bar:hover,
.dz-text-btn--bar:focus-visible {
  color: var(--dz-bg);
}

/* a bare arrow (no --pre / --post) sits still; nudge it with the
   sweep so the row feels like it is moving in one direction */
.dz-text-btn--bar .dz-text-btn__arrow {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.dz-text-btn--bar:hover .dz-text-btn__arrow,
.dz-text-btn--bar:focus-visible .dz-text-btn__arrow {
  transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
  .dz-text-btn__arrow,
  .dz-text-btn__label span,
  .dz-text-btn::after,
  .dz-text-btn--bar,
  .dz-text-btn--bar::before {
    transition: none;
  }
}
