/* Custom properties and animations that are complex for Tailwind */

:root {
  --yellow: #F5C800;
  --black: #0A0A0A;
  --white: #FFFFFF;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 68px; /* For fixed nav */
}

body {
  font-family: 'Inter', sans-serif;
  color: #0A0A0A;
  background-color: #FAFAFA;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .font-display {
  font-family: 'Barlow Condensed', sans-serif;
}

em {
  font-style: normal;
  color: var(--yellow);
}

/* Navbar */
.nav-scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  background-color: rgba(10, 10, 10, 0.95) !important;
  backdrop-filter: blur(12px);
}

/* Animations */
@keyframes ticker {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

.animate-ticker {
  animation: ticker 30s linear infinite;
  display: inline-block;
  white-space: nowrap;
}
.animate-ticker:hover {
  animation-play-state: paused;
}

/* Custom Gradients & Overlays */
.hero-bg {
  background-color: #0A0A0A;
  background-image: 
    radial-gradient(ellipse 80% 60% at 60% 50%, rgba(245, 200, 0, 0.08), transparent),
    linear-gradient(to right, rgba(245, 200, 0, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(245, 200, 0, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 60px 60px, 60px 60px;
}

.hero-accent {
  background: linear-gradient(to bottom, var(--yellow), transparent);
}

.bento-card {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.bento-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  z-index: 1;
}

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 64px rgba(0,0,0,0.15);
}

.bento-card-content {
  position: relative;
  z-index: 2;
}

/* Stat Cards */
.stat-card {
  transition: all 0.3s ease;
}
.stat-card .accent-bar {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.stat-card:hover .accent-bar {
  transform: scaleX(1);
}

/* Product Cards */
.product-card {
  transition: all 0.3s ease;
}
.product-card:hover {
  background-color: #1A1A1A;
}
.product-card .accent-bar {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.product-card:hover .accent-bar {
  transform: scaleX(1);
}
.product-card:hover .icon-bg {
  background-color: var(--yellow) !important;
  color: var(--black) !important;
}

/* Scroll Fade Up */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Mix Blend Logo */
.blend-multiply {
  mix-blend-mode: screen; /* Using screen for white logo on black background */
}

/* Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Custom Loader Animations */
@keyframes fadeLoaderText {
  0% { opacity: 0; transform: translateY(10px); }
  15% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

@keyframes fadeLoaderLogo {
  0% { opacity: 0; transform: scale(0.9); }
  20% { opacity: 1; transform: scale(1); }
  80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05); }
}

@keyframes fadeLoaderBg {
  0% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}

/* Grid background: used by the loader and every white page/section background */
.loader-pattern,
body.bg-brand-white,
main.bg-brand-white,
section.bg-brand-white,
header.bg-brand-white {
  background-color: #FFFFFF;
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

#cface-loader {
  animation: fadeLoaderBg 0.4s ease-out forwards;
  animation-delay: 4.6s;
}

.loader-text {
  opacity: 0;
  animation: fadeLoaderText 1.15s ease-in-out forwards;
}

.loader-text-1 { animation-delay: 0.15s; }
.loader-text-2 { animation-delay: 1.3s; }
.loader-text-3 { animation-delay: 2.45s; }

.loader-logo-anim {
  opacity: 0;
  animation: fadeLoaderLogo 1.2s ease-in-out forwards;
  animation-delay: 3.5s;
}

/* ==========================================================================
   Footer Site Search (js/site-search.js + data/search-index.json)
   Colours reuse the existing footer palette: yellow #F5C800, black #0A0A0A,
   charcoal #18181B, border #27272A, zinc-500 #71717A, hover yellow #FFD700.
   ========================================================================== */
.site-search {
  max-width: 640px;
}

.site-search__form {
  position: relative;
  display: flex;
  gap: 8px;
}

.site-search__field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.site-search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: #71717A;
  pointer-events: none;
  transition: color 0.2s ease;
}

.site-search__input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 42px;
  background-color: #18181B;
  border: 1px solid #27272A;
  border-radius: 8px;
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-size: 16px; /* 16px stops iOS from zooming on focus */
  line-height: 1.25;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.site-search__input::placeholder {
  color: #71717A;
  opacity: 1;
}
.site-search__input:hover {
  border-color: #3F3F46;
}
.site-search__input:focus,
.site-search__input:focus-visible {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(245, 200, 0, 0.22), 0 0 24px rgba(245, 200, 0, 0.12);
  background-color: #111113;
}
.site-search__field:focus-within .site-search__icon {
  color: var(--yellow);
}

.site-search__clear {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #71717A;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.site-search__clear[hidden] {
  display: none;
}
.site-search__clear:hover {
  color: #FFFFFF;
  background-color: #27272A;
}
.site-search__clear:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 1px;
  color: #FFFFFF;
}

.site-search__submit {
  flex: 0 0 auto;
  min-width: 48px;
  height: 48px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background-color: var(--yellow);
  color: var(--black);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.site-search__submit:hover {
  background-color: #FFD700;
}
.site-search__submit:active {
  transform: scale(0.97);
}
.site-search__submit:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
}
.site-search__submit-text {
  display: none;
}

@media (min-width: 640px) {
  .site-search__input {
    font-size: 14px;
  }
  .site-search__submit {
    padding: 0 20px;
  }
  .site-search__submit-text {
    display: inline;
  }
}

/* Results panel — opens UPWARD above the input */
.site-search__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 40;
  max-height: var(--ss-max-h, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background-color: #111113;
  border: 1px solid #27272A;
  border-radius: 12px;
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}
.site-search__panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
}

.site-search__meta {
  padding: 10px 14px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #71717A;
}

.site-search__list {
  list-style: none;
  margin: 0;
  padding: 4px 6px 6px;
}

.site-search__option {
  position: relative;
  display: block;
  padding: 10px 12px 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.site-search__option::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 2px;
  background-color: var(--yellow);
  transform: scaleY(0);
  transition: transform 0.15s ease;
}
.site-search__option:hover,
.site-search__option.is-active {
  background-color: #1F1F23;
}
.site-search__option.is-active::before {
  transform: scaleY(1);
}
.site-search__option.is-active {
  outline: 1px solid rgba(245, 200, 0, 0.35);
}

.site-search__cat {
  display: block;
  margin-bottom: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--yellow);
}
.site-search__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #FFFFFF;
  line-height: 1.35;
}
.site-search__title mark {
  background: transparent;
  color: var(--yellow);
  font-weight: 700;
}
.site-search__desc {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #71717A;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-search__empty {
  padding: 18px 16px;
  text-align: left;
}
.site-search__empty p {
  margin: 0 0 12px;
  font-size: 14px;
  color: #A1A1AA;
  line-height: 1.5;
}
.site-search__empty a {
  display: inline-flex;
  padding: 8px 18px;
  border-radius: 9999px;
  background-color: var(--yellow);
  color: var(--black);
  font-size: 13px;
  font-weight: 700;
  transition: background-color 0.2s ease;
}
.site-search__empty a:hover {
  background-color: #FFD700;
}
.site-search__empty a:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
}

.site-search__status {
  padding: 16px;
  font-size: 13px;
  color: #71717A;
}

.site-search__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .site-search__panel,
  .site-search__panel.is-open {
    transform: none;
    transition: none;
  }
}
