/* Animations, hover states and shadows, loaded after base.css on the home and
   privacy pages. Entrance and hover animations only run when the visitor hasn't
   asked for reduced motion. */

:root {
  --gold-ink: #a8832f; /* the regular gold is too light for small text on the card */
  --gold-light: #f0d48a;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

::selection {
  color: var(--navy-950);
  background: var(--gold);
}

/* === Sticky header === */
.site-header {
  position: fixed;
  transition: background-color 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.site-header__inner {
  transition: padding 0.35s var(--ease-out);
}

.site-header.is-scrolled {
  background: rgba(7, 18, 40, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 1px 0 rgba(217, 178, 83, 0.18), 0 10px 30px -12px rgba(0, 0, 0, 0.5);
}

.site-header.is-scrolled .site-header__inner {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.site-header__cta {
  display: inline-flex;
  padding: 0.6rem 1rem;
  font-size: 0.7rem;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), visibility 0.3s;
}

.site-header.is-scrolled .site-header__cta {
  visibility: visible;
  opacity: 1;
  transform: none;
}

/* no room for it next to the wordmark */
@media (max-width: 399px) {
  .site-header__cta {
    display: none;
  }
}

/* so the fixed header doesn't cover the form when jumping to it */
#get-started {
  scroll-margin-top: 5.5rem;
}

/* === Hero === */
.hero__bg::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 10%;
  width: 50%;
  aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(217, 178, 83, 0.16), transparent);
  transform: translateY(-50%);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero__line--gold {
    display: inline-block;
    color: transparent;
    background: linear-gradient(100deg, #c99a3a 0%, #f3d98e 30%, #d9b253 50%, #f3d98e 70%, #b8862e 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero__logo {
    animation:
      logo-in 1.6s var(--ease-out) both,
      logo-drift 24s ease-in-out 1.6s infinite alternate;
  }

  .hero__bg::before {
    animation: glow 6s ease-in-out infinite alternate;
  }

  .pill,
  .hero__line,
  .hero__content .eyebrow,
  .hero__mission,
  .hero__cta {
    animation: rise 0.9s var(--ease-out) both;
  }

  .pill { animation-delay: 0.1s; }
  .hero__line:nth-child(1) { animation-delay: 0.25s; }
  .hero__line:nth-child(3) { animation-delay: 0.55s; }
  .hero__content .eyebrow { animation-delay: 0.75s; }
  .hero__mission { animation-delay: 0.85s; }
  .hero__cta { animation-delay: 1s; }

  .hero__line--gold {
    animation:
      rise 0.9s var(--ease-out) 0.4s both,
      sheen 8s ease-in-out 2s infinite;
  }
}

/* don't scale past 1 or the trucks get cut off */
@keyframes logo-in {
  from {
    opacity: 0;
    scale: 0.94;
  }
}

@keyframes logo-drift {
  from { scale: 1; }
  to { scale: 0.96; }
}

@keyframes glow {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 18px;
  }
}

@keyframes sheen {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* === Buttons === */
.btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.btn--gold {
  background: linear-gradient(180deg, #e2be63, #d2a847);
  box-shadow: 0 6px 18px -8px rgba(217, 178, 83, 0.55);
}

/* shine that sweeps across on hover */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  translate: -120% 0;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .btn--gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -10px rgba(217, 178, 83, 0.7);
  }

  .btn--gold:hover::after {
    translate: 120% 0;
    transition: translate 0.8s var(--ease-out);
  }
}

.btn--gold:active {
  transform: translateY(0);
}

/* spinner in place of the label while the form is sending */
.btn.is-loading {
  color: transparent;
}

.btn.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin: auto;
  border: 2px solid rgba(7, 18, 40, 0.25);
  border-top-color: var(--navy-950);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { rotate: 360deg; }
}

/* === Form card === */
.card {
  padding-bottom: clamp(1.5rem, 4vw, 2.25rem);
  border-top: 3px solid var(--gold);
  box-shadow: 0 1px 2px rgba(7, 18, 40, 0.04), 0 24px 48px -24px rgba(7, 18, 40, 0.28);
}

.card__title {
  margin-bottom: clamp(1.75rem, 5vw, 2.5rem);
}

.field input {
  transition: border-color 0.2s, box-shadow 0.2s;
}

@media (hover: hover) {
  .field input:hover {
    border-color: #b9bfca;
  }
}

.field input:focus,
.field input:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217, 178, 83, 0.3);
}

.field input[aria-invalid="true"]:focus {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.18);
}

/* === Success dialog === */
.form-success {
  border-top: 3px solid var(--gold);
  box-shadow: 0 32px 72px -24px rgba(0, 0, 0, 0.65);
}

.form-success::backdrop {
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

@media (prefers-reduced-motion: no-preference) {
  .form-success[open] {
    animation: pop 0.45s var(--ease-out) both;
  }

  .form-success[open]::backdrop {
    animation: fade 0.3s ease-out both;
  }

  .form-success__icon path {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    animation: draw 0.5s var(--ease-out) 0.35s forwards;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    scale: 0.92;
    translate: 0 16px;
  }
}

@keyframes fade {
  from { opacity: 0; }
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

/* === Who we work with === */
.band {
  position: relative;
}

/* === Contact === */
.contact__value a,
.contact__privacy a {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: color 0.25s, text-decoration-color 0.25s;
}

@media (hover: hover) {
  .contact__value a:hover,
  .contact__privacy a:hover {
    color: var(--gold-light);
    text-decoration-color: var(--gold);
  }
}

/* === Scroll reveal (.has-reveal comes from polish.js) === */
.has-reveal [data-reveal] {
  opacity: 0;
  translate: 0 28px;
  transition: opacity 0.9s var(--ease-out), translate 0.9s var(--ease-out);
}

.has-reveal [data-reveal="2"] {
  transition-delay: 0.15s;
}

.has-reveal [data-reveal].is-visible {
  opacity: 1;
  translate: 0 0;
}
