/* T.A. Polymers — Custom Styles */

/* ─── Grain texture overlay ──────────────────────────────── */
.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.grain::before {
  content: '';
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* ─── Scroll reveal animations ───────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ─── Hero entrance animations ───────────────────────────── */
@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroLine {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(6px); }
}

.hero-title {
  animation: heroFadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.hero-line {
  animation: heroLine 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.7s both;
  transform-origin: left center;
}

.hero-subtitle {
  animation: heroFadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.9s both;
}

.hero-image {
  animation: heroFadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) 1.1s both;
}

.hero-scroll {
  animation: scrollPulse 2.5s ease-in-out infinite;
  animation-delay: 2s;
  opacity: 0;
}

/* ─── Navigation ─────────────────────────────────────────── */
.nav-solid {
  background-color: rgba(12, 26, 16, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ─── Link hover underline ───────────────────────────────── */
.link-hover {
  position: relative;
}

.link-hover::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.link-hover:hover::after {
  transform: scaleX(1);
}

/* ─── Image hover zoom ───────────────────────────────────── */
.img-zoom {
  overflow: hidden;
}

.img-zoom img {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.img-zoom:hover img {
  transform: scale(1.03);
}

/* ─── Stat card accent line ──────────────────────────────── */
.stat-accent {
  position: relative;
}

.stat-accent::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 2px;
  background-color: #00845A;
}

/* ─── Lightbox ───────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(4, 13, 7, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 2rem;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.2s ease;
  z-index: 101;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.2s ease;
  z-index: 101;
}

.lightbox-nav:hover {
  opacity: 1;
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

/* ─── Mobile menu ────────────────────────────────────────── */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  background-color: rgba(12, 26, 16, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-menu.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu a {
  font-size: 1.5rem;
  color: white;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}

.mobile-menu a:hover {
  color: #2DB87A;
}

/* ─── Gallery grid ───────────────────────────────────────── */
.gallery-item {
  cursor: pointer;
  overflow: hidden;
  border-radius: 4px;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* ─── Sponsor logos ──────────────────────────────────────── */
.sponsor-logo {
  filter: brightness(0) invert(1);
  opacity: 0.5;
  transition: opacity 0.3s ease;
  max-height: 40px;
  width: auto;
}

.sponsor-logo:hover {
  opacity: 0.9;
}

/* ─── Smooth scroll behavior ─────────────────────────────── */
/* scroll-behavior: smooth is intentionally NOT set on html.
   It causes "magnetic" jank on macOS trackpads at section boundaries.
   Smooth scrolling for anchor clicks is handled in JS instead. */

/* ─── Selection color ────────────────────────────────────── */
::selection {
  background-color: #00845A;
  color: white;
}

/* ─── Responsive typography with clamp ───────────────────── */
.text-hero {
  font-size: clamp(2.75rem, 7.5vw, 6.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.text-section {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.text-body-lg {
  font-size: clamp(1rem, 1.1vw, 1.125rem);
  line-height: 1.7;
}
