/* ============================================================
   CROSSFIT TIGARD — Global Stylesheet
   styles.css
   ============================================================ */

/* ----- Reset ----- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--gray-200);
  background: var(--black);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  opacity: 0;
  transition: opacity 400ms ease;
}

body.is-loaded {
  opacity: 1;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

/* ----- Custom Properties ----- */
:root {
  /* Accent: #058CCA */
  --accent-50:  #e6f4fb;
  --accent-100: #b3ddf3;
  --accent-200: #80c6eb;
  --accent-300: #4dafe3;
  --accent-400: #2699db;
  --accent-500: #058CCA;
  --accent-600: #047bb2;
  --accent-700: #036a9a;
  --accent-800: #025982;
  --accent-900: #013d5a;

  --accent:        var(--accent-500);
  --accent-bright: var(--accent-300);
  --accent-glow:   rgba(5, 140, 202, 0.3);
  --accent-subtle: rgba(5, 140, 202, 0.1);

  /* Neutrals */
  --gray-50:  #fafafa;
  --gray-100: #f4f4f5;
  --gray-200: #e4e4e7;
  --gray-300: #d4d4d8;
  --gray-400: #a1a1aa;
  --gray-500: #71717a;
  --gray-600: #52525b;
  --gray-700: #3f3f46;
  --gray-800: #27272a;
  --gray-900: #18181b;
  --gray-950: #0d0d0f;
  --black:    #000000;
  --white:    #ffffff;

  /* Typography */
  --font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --font-body:    'Inter', 'Helvetica Neue', Arial, sans-serif;

  /* Transitions */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-base: 300ms;
  --duration-slow: 600ms;
}

/* ----- Container ----- */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 768px) {
  .container { padding: 0 40px; }
}

@media (min-width: 1024px) {
  .container { padding: 0 60px; }
}

/* ----- Utilities ----- */
.text-gradient {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent), var(--accent-700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 20px;
}

.section-tag::before {
  content: '';
  display: block;
  width: 32px;
  height: 2px;
  background: var(--accent);
}

.section-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  color: var(--white);
  margin-bottom: 24px;
}

.section-subtitle {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--gray-400);
  line-height: 1.7;
  max-width: 560px;
}

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

/* ----- Scroll Animations ----- */
[data-animate] {
  opacity: 0;
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

[data-animate="fade-up"] {
  transform: translateY(30px);
}

[data-animate="fade-left"] {
  transform: translateX(30px);
}

[data-animate="fade-right"] {
  transform: translateX(-30px);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translate(0, 0);
}

[data-delay="100"] { transition-delay: 100ms; }
[data-delay="200"] { transition-delay: 200ms; }
[data-delay="300"] { transition-delay: 300ms; }
[data-delay="400"] { transition-delay: 400ms; }
[data-delay="500"] { transition-delay: 500ms; }
[data-delay="600"] { transition-delay: 600ms; }

/* ----- Cursor Glow ----- */
#cursorGlow {
  position: fixed;
  top: 0;
  left: 0;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity var(--duration-slow) ease;
  transform: translate(-50%, -50%);
  will-change: transform;
}

body:hover #cursorGlow {
  opacity: 1;
}

@media (max-width: 768px) {
  #cursorGlow { display: none; }
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: top var(--duration-base) var(--ease-out),
              padding var(--duration-base) var(--ease-out);
}

.nav__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: opacity var(--duration-base) var(--ease-out),
              border-radius var(--duration-base) var(--ease-out);
}

.nav__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  transition: all var(--duration-base) var(--ease-out);
}

@media (min-width: 768px) {
  .nav__inner { padding: 16px 40px; }
}

@media (min-width: 1024px) {
  .nav__inner { padding: 16px 60px; }
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2;
}

.nav__logo img {
  height: 48px;
  width: auto;
  transition: height var(--duration-base) var(--ease-out);
}

.nav__links {
  display: none;
  align-items: center;
  gap: 32px;
}

@media (min-width: 768px) {
  .nav__links { display: flex; }
}

.nav__link {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  transition: color var(--duration-fast) ease;
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width var(--duration-base) var(--ease-out);
}

.nav__link:hover,
.nav__link--active {
  color: var(--white);
}

.nav__link:hover::after,
.nav__link--active::after {
  width: 100%;
}

.nav__cta {
  display: none;
  z-index: 2;
}

@media (min-width: 768px) {
  .nav__cta { display: inline-flex; }
}

/* Scrolled State — Floating Pill */
.nav--scrolled {
  top: 12px;
}

.nav--scrolled .nav__backdrop {
  opacity: 0;
}

.nav--scrolled .nav__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 32px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.03);
}

.nav--scrolled .nav__logo img {
  height: 36px;
}

.nav--scrolled .nav__cta .btn {
  padding: 8px 20px;
  font-size: 0.75rem;
}

/* ----- Burger ----- */
.nav__burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  gap: 6px;
  z-index: 1001;
  cursor: pointer;
}

@media (min-width: 768px) {
  .nav__burger { display: none; }
}

.nav__burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all var(--duration-base) var(--ease-out);
  transform-origin: center;
}

.nav__burger.is-active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav__burger.is-active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav__burger.is-active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ----- Mobile Menu ----- */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-out);
}

.mobile-menu.is-open {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.mobile-menu__link {
  font-family: var(--font-display);
  font-size: 3rem;
  text-transform: uppercase;
  color: var(--gray-400);
  transition: color var(--duration-fast) ease;
  letter-spacing: 0.02em;
}

.mobile-menu__link:hover,
.mobile-menu__link--active {
  color: var(--white);
}

.mobile-menu__cta {
  margin-top: 24px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    all var(--duration-base) var(--ease-spring);
  position: relative;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  transition: transform var(--duration-base) var(--ease-out);
}

.btn:hover svg {
  transform: translateX(3px);
}

/* Primary */
.btn--primary {
  background: var(--accent);
  color: var(--black);
  border-color: var(--accent);
}

.btn--primary:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Outline */
.btn--outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn--outline:hover {
  background: var(--accent-subtle);
  border-color: var(--accent-bright);
}

/* Size Modifiers */
.btn--lg {
  padding: 18px 40px;
  font-size: 0.875rem;
}

.btn--full {
  width: 100%;
}

/* Arrow icon helper */
.btn__arrow {
  width: 16px;
  height: 16px;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gray-400);
  margin-bottom: 8px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--gray-700);
  border-radius: 10px;
  color: var(--white);
  font-size: 0.9375rem;
  transition:
    border-color var(--duration-base) ease,
    background var(--duration-base) ease,
    box-shadow var(--duration-base) ease;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--gray-600);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(5, 140, 202, 0.05);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23a1a1aa' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

.form-row {
  display: grid;
  gap: 20px;
}

@media (min-width: 480px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-consent {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--gray-400);
  margin-top: 12px;
  text-align: center;
}

.form-consent a {
  color: var(--gray-300);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-consent a:hover {
  color: var(--accent);
}

/* ============================================================
   LEAD FORM MODAL
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-out);
}

.modal.is-open {
  opacity: 1;
  pointer-events: all;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--gray-900);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  overflow: hidden;
  transform: scale(0.95) translateY(20px);
  transition: transform var(--duration-base) var(--ease-out);
}

.modal.is-open .modal__dialog {
  transform: scale(1) translateY(0);
}

.modal__accent-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--accent-700), var(--accent), var(--accent-bright));
}

.modal__content {
  padding: 40px 32px 32px;
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--gray-400);
  transition: all var(--duration-fast) ease;
  z-index: 1;
}

.modal__close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.modal__title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--white);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.modal__subtitle {
  font-size: 0.9375rem;
  color: var(--gray-400);
  margin-bottom: 28px;
}

/* Modal Success State */
.modal__success {
  display: none;
  text-align: center;
  padding: 40px 0;
}

.modal__success.is-active {
  display: block;
}

.modal__success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  background: var(--accent-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  animation: successPop 0.5s var(--ease-spring) forwards;
  transform: scale(0);
}

@keyframes successPop {
  to { transform: scale(1); }
}

.modal__success-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--white);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.modal__success-text {
  font-size: 0.9375rem;
  color: var(--gray-400);
}

.modal__form.is-hidden {
  display: none;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--gray-950);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding: 80px 0 0;
}

.footer__grid {
  display: grid;
  gap: 48px;
  margin-bottom: 60px;
}

@media (min-width: 768px) {
  .footer__grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
  }
}

.footer__brand-logo {
  height: 40px;
  margin-bottom: 16px;
}

.footer__brand-tagline {
  font-size: 0.9375rem;
  color: var(--gray-400);
  line-height: 1.6;
  max-width: 280px;
}

.footer__socials {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.footer__social {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--gray-400);
  transition:
    color var(--duration-base) ease,
    background var(--duration-base) ease,
    border-color var(--duration-base) ease,
    transform var(--duration-base) var(--ease-spring);
}

.footer__social:hover {
  color: var(--white);
  background: var(--accent-subtle);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.footer__social svg {
  width: 18px;
  height: 18px;
}

.footer__heading {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--white);
  margin-bottom: 20px;
}

.footer__link {
  display: block;
  font-size: 0.875rem;
  color: var(--gray-400);
  padding: 4px 0;
  transition: color var(--duration-fast) ease;
}

.footer__link:hover {
  color: var(--accent);
}

/* Footer Address (NAP block) */
.footer__address {
  font-style: normal;
  font-size: 0.875rem;
  color: var(--gray-400);
  line-height: 1.8;
}

.footer__address a {
  transition: color var(--duration-fast) ease;
}

.footer__address a:hover {
  color: var(--accent);
}

/* Footer Bottom Bar */
.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer__copy {
  font-size: 0.8125rem;
  color: var(--gray-600);
}

.footer__legal {
  display: flex;
  gap: 24px;
}

.footer__legal-link {
  font-size: 0.8125rem;
  color: var(--gray-600);
  transition: color var(--duration-fast) ease;
}

.footer__legal-link:hover {
  color: var(--gray-400);
}

.footer__credit {
  font-size: 0.6875rem;
  color: var(--gray-700);
  text-align: center;
  padding: 16px 0;
}

.footer__credit a {
  color: var(--gray-600);
  transition: color var(--duration-fast) ease;
}

.footer__credit a:hover {
  color: var(--accent);
}

/* ============================================================
   INNER PAGE HEADER (shared across about, programs, etc.)
   ============================================================ */
.page-header {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 80px;
  overflow: hidden;
}

.page-header__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.page-header__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-header__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.85) 100%
  );
}

.page-header__content {
  position: relative;
  z-index: 1;
}

.page-header__title {
  font-size: clamp(3rem, 8vw, 5.5rem);
  color: var(--white);
}

/* ============================================================
   LOADING / SPINNER
   ============================================================ */
.btn.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn.is-loading .btn__text {
  visibility: hidden;
}

.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
