/* ============================================
   Section Styles — All 8 sections
   ============================================ */

/* --- Generic section padding --- */
.section {
  padding: var(--space-4xl) 0;
}

@media (max-width: 1023px) {
  .section { padding: var(--space-3xl) 0; }
}

@media (max-width: 767px) {
  .section { padding: var(--space-2xl) 0; }
}

/* --- Two-column layout --- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.split--55-45 {
  grid-template-columns: 55fr 45fr;
}

.split--40-60 {
  grid-template-columns: 40fr 60fr;
}

@media (max-width: 767px) {
  .split,
  .split--55-45,
  .split--40-60 {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
}


/* ============================================
   SECTION 1: Hero
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  background-image: url('../../public/assets/images/webp/team-gcmiami-walkout.webp');
  background-image: image-set(
    url('../../public/assets/images/webp/team-gcmiami-walkout.webp') type('image/webp'),
    url('../../public/assets/images/team-gcmiami-walkout.PNG') type('image/png')
  );
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.65) 0%,
    rgba(0, 0, 0, 0.30) 50%,
    rgba(0, 0, 0, 0.70) 100%
  );
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 640px;
}

.hero__logo {
  width: 180px;
  height: auto;
  margin: 0 auto var(--space-lg);
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-sm);
}

.hero__tagline {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-white);
  margin-bottom: var(--space-lg);
}

.hero__form-wrap {
  margin-bottom: var(--space-sm);
}

.hero__form-note {
  font-size: var(--text-caption);
  color: rgba(255, 255, 255, 0.6);
}

.hero__scroll-indicator {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  animation: pulse-fade 2s ease-in-out infinite;
}

.hero__scroll-indicator svg {
  width: 24px;
  height: 24px;
  stroke: rgba(255, 255, 255, 0.6);
}

@keyframes pulse-fade {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* Hero entrance animation */
.hero__content {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out 0.3s, transform 0.8s ease-out 0.3s;
}

.hero__content.is-loaded {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1023px) {
  .hero__logo { width: 150px; }
  .hero__tagline { font-size: 44px; }
}

@media (max-width: 767px) {
  .hero {
    min-height: 100svh;
    background-position: center 30%;
  }
  .hero__logo { width: 120px; }
  .hero__tagline { font-size: 32px; }
  .hero__scroll-indicator { display: none; }
}


/* ============================================
   SECTION 2: What Is Gridball
   ============================================ */
.what-is {
  background-color: var(--color-navy-deep);
}

.what-is__text h2 {
  margin-bottom: var(--space-md);
}

.what-is__text p {
  margin-bottom: var(--space-sm);
}

.what-is__stats {
  margin-top: var(--space-xl);
}

@media (max-width: 767px) {
  .what-is .split {
    text-align: center;
  }
  .what-is__text p {
    margin-left: auto;
    margin-right: auto;
  }
}


/* ============================================
   SECTION 3: The Grid
   ============================================ */
.the-grid {
  background-color: var(--color-white);
}

.the-grid__intro {
  max-width: var(--max-width-narrow);
  margin: 0 auto var(--space-xl);
  text-align: center;
}

.the-grid__intro h2 {
  margin-bottom: var(--space-sm);
}

.the-grid__intro p {
  margin: 0 auto;
}

.the-grid__schematic {
  max-width: 720px;
  margin: 0 auto var(--space-xl);
}

.the-grid__schematic img {
  width: 100%;
  height: auto;
}

.the-grid__cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  max-width: 800px;
  margin: 0 auto var(--space-xl);
}

@media (max-width: 767px) {
  .the-grid__cards {
    grid-template-columns: 1fr;
  }
}

.the-grid__photo {
  max-width: 960px;
  margin: 0 auto;
}

.the-grid__photo img {
  width: 100%;
  border-radius: var(--border-radius);
}

.the-grid__photo figcaption {
  text-align: center;
  font-size: var(--text-caption);
  color: var(--color-gray-400);
  font-style: italic;
  margin-top: var(--space-xs);
}


/* ============================================
   SECTION 4: Origin Story
   ============================================ */
.origin {
  background-color: var(--color-navy);
}

.origin__text h2 {
  margin-bottom: var(--space-md);
}

.origin__text p {
  margin-bottom: var(--space-sm);
}

@media (max-width: 767px) {
  .origin .split--40-60 {
    direction: ltr;
  }

  .origin__image {
    order: -1;
  }
}


/* ============================================
   SECTION 5: Rulebook
   ============================================ */
.rulebook {
  position: relative;
  background-color: var(--color-off-white);
  text-align: center;
  overflow: hidden;
}

.rulebook__bg {
  position: absolute;
  inset: 0;
  background-image: url('../../public/assets/images/webp/referee-on-court-pointing.webp');
  background-image: image-set(
    url('../../public/assets/images/webp/referee-on-court-pointing.webp') type('image/webp'),
    url('../../public/assets/images/referee-on-court-pointing.PNG') type('image/png')
  );
  background-size: cover;
  background-position: center;
  opacity: 0.08;
}

.rulebook__content {
  position: relative;
  z-index: 1;
}

.rulebook h2 {
  color: var(--color-navy);
  margin-bottom: var(--space-sm);
}

.rulebook__desc {
  color: var(--color-gray-500);
  font-size: var(--text-body-sm);
  max-width: 560px;
  margin: 0 auto var(--space-lg);
}

.rulebook__buttons {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-sm);
}

.rulebook .btn--outline {
  color: var(--color-navy);
  border-color: var(--color-navy);
}

.rulebook .btn--outline:hover {
  background: var(--color-navy);
  color: var(--color-white);
}

.rulebook__note {
  font-size: var(--text-overline);
  color: var(--color-gray-400);
  margin-top: var(--space-sm);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}


/* ============================================
   SECTION 6: Vision & Roadmap
   ============================================ */
.vision {
  position: relative;
  background-image: url('../../public/assets/images/webp/arena-overhead-empty-v1.webp');
  background-image: image-set(
    url('../../public/assets/images/webp/arena-overhead-empty-v1.webp') type('image/webp'),
    url('../../public/assets/images/arena-overhead-empty-v1.PNG') type('image/png')
  );
  background-size: cover;
  background-position: center;
}

.vision::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
}

.vision__content {
  position: relative;
  z-index: 1;
}

.vision__intro {
  text-align: center;
  max-width: var(--max-width-narrow);
  margin: 0 auto var(--space-xl);
}

.vision__intro h2 {
  margin-bottom: var(--space-md);
}


/* ============================================
   SECTION 7: Want To Play
   ============================================ */
.play {
  background-color: var(--color-navy-deep);
}

.play__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.play__text h2 {
  margin-bottom: var(--space-md);
}

.play__text p {
  margin-bottom: var(--space-sm);
}

.play__form-wrap {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: var(--space-lg);
}

.player-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.player-form__input {
  width: 100%;
  height: 52px;
  padding: 0 var(--space-md);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--border-radius);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.player-form__input::placeholder {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
}

.player-form__input:focus {
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.player-form__select {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.55);
}

.player-form__select option {
  background: var(--color-navy-deep);
  color: var(--color-white);
}

.player-form__select:has(option:checked:not([disabled])) {
  color: var(--color-white);
}

.player-form__btn {
  width: 100%;
  height: 52px;
  background-color: var(--color-red);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--text-caption);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.player-form__btn:hover {
  background-color: var(--color-red-hover);
  box-shadow: var(--shadow-red-glow);
}

.player-form__success {
  display: none;
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 600;
  padding: var(--space-lg) 0;
  text-align: center;
}

.player-form__success::before {
  content: '';
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-sm);
  border-radius: 50%;
  border: 2px solid var(--color-red);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D42B2B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/24px no-repeat;
}

.player-form__success.is-visible {
  display: block;
}

.player-form__note {
  font-size: var(--text-overline);
  color: rgba(255, 255, 255, 0.5);
  margin-top: var(--space-sm);
}

/* --- Custom Select Dropdown --- */
.custom-select {
  position: relative;
  width: 100%;
}

.custom-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 52px;
  padding: 0 var(--space-md);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.custom-select__trigger:hover {
  border-color: rgba(255, 255, 255, 0.5);
}

.custom-select.is-open .custom-select__trigger {
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.custom-select__label {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
}

.custom-select.has-value .custom-select__label {
  color: var(--color-white);
  font-weight: 500;
}

.custom-select__arrow {
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.5);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.custom-select.is-open .custom-select__arrow {
  transform: rotate(180deg);
}

.custom-select__options {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-navy-deep);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-top: none;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 10;
  overflow: hidden;
}

.custom-select.is-open .custom-select__options {
  display: block;
}

.custom-select__option {
  padding: 14px var(--space-md);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.custom-select__option:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
}

.custom-select__option.is-selected {
  color: var(--color-white);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.08);
}

.player-form__link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.player-form__link:hover {
  color: var(--color-white);
}

@media (max-width: 767px) {
  .play__layout {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
}


/* ============================================
   SECTION 8: Gallery
   ============================================ */
.gallery {
  background-color: var(--color-near-black);
}

.gallery__header {
  text-align: center;
  margin-bottom: var(--space-xl);
}


/* ============================================
   SECTION 8: Email Capture + Footer
   ============================================ */
.cta-footer {
  background-color: var(--color-navy);
}

.cta-footer__capture {
  text-align: center;
  padding: var(--space-4xl) 0 var(--space-xl);
}

.cta-footer__capture h2 {
  margin-bottom: var(--space-sm);
}

.cta-footer__capture p {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--text-body-sm);
  max-width: var(--max-width-text);
  margin: 0 auto var(--space-lg);
}

.cta-footer__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer {
  padding: var(--space-xl) 0;
  text-align: center;
}

.footer__logo {
  width: 80px;
  height: auto;
  margin: 0 auto var(--space-sm);
}

.footer__links {
  margin-bottom: var(--space-sm);
}

.footer__links a {
  font-size: var(--text-caption);
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: var(--tracking-normal);
  transition: color var(--transition-fast);
}

.footer__links a:hover {
  color: var(--color-white);
}

.footer__links span {
  color: rgba(255, 255, 255, 0.3);
  margin: 0 var(--space-xs);
}

.footer__socials {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.footer__socials a {
  color: rgba(255, 255, 255, 0.4);
  transition: color var(--transition-fast);
}

.footer__socials a:hover {
  color: var(--color-white);
}

.footer__socials svg {
  width: 22px;
  height: 22px;
}

.footer__copy {
  font-size: var(--text-fine);
  color: rgba(255, 255, 255, 0.35);
}


/* ============================================
   Contact Modal
   ============================================ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.is-open {
  display: flex;
}

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

.modal__content {
  position: relative;
  background: var(--color-navy-deep);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: var(--space-xl);
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  transition: color var(--transition-fast);
}

.modal__close:hover {
  color: var(--color-white);
}

.modal__title {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-white);
  margin-bottom: var(--space-xs);
}

.modal__desc {
  font-size: var(--text-caption);
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: var(--space-md);
}

.modal__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal__input {
  width: 100%;
  height: 52px;
  padding: 0 var(--space-md);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--border-radius);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.modal__textarea {
  height: auto;
  padding: var(--space-sm) var(--space-md);
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.modal__input::placeholder {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
}

.modal__input:focus {
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.modal__btn {
  width: 100%;
  height: 52px;
  background-color: var(--color-red);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--text-caption);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.modal__btn:hover {
  background-color: var(--color-red-hover);
  box-shadow: var(--shadow-red-glow);
}

.modal__success {
  display: none;
  color: var(--color-white);
  font-size: var(--text-caption);
  font-weight: 500;
  padding: var(--space-sm) 0 0;
}

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

/* Lock body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

/* ============================================
   HOMEPAGE PHONE-PORTRAIT POLISH (≤420px)
   Existing breakpoints at 1023px and 767px cover tablet/landscape.
   This block tightens typography, padding, and form touch targets
   specifically for iPhone-portrait and narrow Android viewports.
   ============================================ */
@media (max-width: 520px) {
  .container { padding: 0 16px; }
  .section { padding: var(--space-xl) 0; }

  .hero__logo { width: 96px; }
  .hero__subtitle { font-size: 11px; letter-spacing: 2px; }
  .hero__tagline { font-size: 26px; line-height: 1.1; }

  .play__form-wrap { padding: 18px; }
  .vision__intro h2 { font-size: 28px; }

  /* Rulebook buttons stretch full-width on narrow phones so they're
     tappable without hunting for the hit target */
  .rulebook__buttons .btn { width: 100%; }
}

@media (max-width: 420px) {
  /* Section headings scale down further */
  .section h2 { font-size: 24px; letter-spacing: 0.5px; }

  /* Hero even tighter */
  .hero__logo { width: 80px; margin-bottom: 16px; }
  .hero__tagline { font-size: 22px; }

  /* Timeline year label doesn't need 2 lines at this size */
  .timeline__year { font-size: 14px; }
  .timeline__desc { font-size: 13px; line-height: 1.5; }

  /* Footer */
  .footer { padding: 32px 0; }
}
