/* ============================================================
   El Captain Sports Management — Base Styles
   Reset · Typography · Layout primitives · Utilities
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

/* ----------------------------------------------------------
   Reset & Normalize
---------------------------------------------------------- */

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

html {
  direction: rtl;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 100%; /* 16px base */
  hanging-punctuation: first last;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--ink-primary);
  background-color: var(--bg-body);
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Images & media */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Form elements inherit font */
input,
button,
textarea,
select {
  font: inherit;
}

/* Lists */
ul,
ol {
  list-style: none;
}

/* Tables */
table {
  border-collapse: collapse;
}

/* Quotes */
blockquote,
q {
  quotes: none;
}

/* HR */
hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin-block: var(--space-lg);
}

/* Button reset */
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Selection */
::selection {
  background-color: rgba(8, 145, 178, 0.18);
  color: var(--ink-primary);
}

/* Focus ring — accessible, unobtrusive */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ----------------------------------------------------------
   Links
---------------------------------------------------------- */

a {
  color: var(--ink-link);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--ink-link-hover);
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* ----------------------------------------------------------
   Typography — Headings
---------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-primary);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-snug);
  color: var(--ink-primary);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-5xl);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  line-height: 1.1;
}

h2 {
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  line-height: 1.15;
}

h3 {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1.25;
}

h4 {
  font-size: var(--text-2xl);
  font-weight: 700;
}

h5 {
  font-size: var(--text-xl);
  font-weight: 600;
}

h6 {
  font-size: var(--text-lg);
  font-weight: 600;
}

/* Heading color overrides for dark sections */
.on-dark h1,
.on-dark h2,
.on-dark h3,
.on-dark h4,
.on-dark h5,
.on-dark h6 {
  color: var(--ink-on-dark);
}

/* Body copy */
p {
  color: var(--ink-secondary);
  line-height: var(--leading-loose);
  text-wrap: pretty;
  max-width: var(--content-max);
}

p.lead {
  font-size: var(--text-lg);
  color: var(--ink-secondary);
  line-height: var(--leading-relaxed);
}

/* ----------------------------------------------------------
   Layout — Container
---------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: 720px;
}

/* ----------------------------------------------------------
   Layout — Section
---------------------------------------------------------- */

.section {
  padding-block: var(--space-section);
  position: relative;
}

.section--sm {
  padding-block: var(--space-2xl);
}

.section--lg {
  padding-block: calc(var(--space-section) * 1.4);
}

/* Alternate background for visual rhythm */
.section--muted {
  background-color: var(--bg-muted);
}

.section--dark {
  background-color: var(--bg-dark);
  color: var(--ink-on-dark);
}

.section--dark p {
  color: var(--ink-on-dark-muted);
}

/* ----------------------------------------------------------
   Section Header Pattern: tag → title → description
---------------------------------------------------------- */

.section-header {
  margin-block-end: var(--space-2xl);
}

.section-header--center {
  text-align: center;
}

.section-header--center p {
  margin-inline: auto;
}

.section-header__tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-accent);
  background-color: var(--color-accent-ghost);
  border: 1px solid var(--border-accent);
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-full);
  margin-block-end: var(--space-md);
}

.section--dark .section-header__tag {
  color: var(--color-accent-light);
  background-color: rgba(8, 145, 178, 0.15);
  border-color: rgba(8, 145, 178, 0.30);
}

.section-header__title {
  margin-block-end: var(--space-md);
}

.section-header__desc {
  font-size: var(--text-lg);
  color: var(--ink-secondary);
  max-width: 58ch;
  line-height: var(--leading-relaxed);
}

.section-header--center .section-header__desc {
  margin-inline: auto;
}

.section--dark .section-header__desc {
  color: var(--ink-on-dark-muted);
}

/* ----------------------------------------------------------
   Buttons
---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding-inline: var(--space-lg);
  height: var(--btn-height-md);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: var(--btn-font-weight);
  line-height: 1;
  border-radius: var(--btn-radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background-color var(--duration-normal) var(--ease-out),
    color            var(--duration-normal) var(--ease-out),
    border-color     var(--duration-normal) var(--ease-out),
    box-shadow       var(--duration-normal) var(--ease-out),
    transform        var(--duration-fast)   var(--ease-out);
  position: relative;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Primary — Accent Teal */
.btn--primary {
  background-color: var(--color-accent);
  color: #FFFFFF;
  border-color: var(--color-accent);
  box-shadow: var(--shadow-accent);
}

.btn--primary:hover {
  background-color: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(8, 145, 178, 0.30);
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-accent);
}

/* Secondary — Outlined navy */
.btn--secondary {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary-light);
}

.btn--secondary:hover {
  background-color: var(--color-primary-ghost);
  color: var(--color-primary);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

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

/* Secondary on dark backgrounds */
.section--dark .btn--secondary,
.on-dark .btn--secondary {
  color: var(--ink-on-dark);
  border-color: rgba(248, 250, 251, 0.30);
}

.section--dark .btn--secondary:hover,
.on-dark .btn--secondary:hover {
  background-color: rgba(248, 250, 251, 0.08);
  border-color: rgba(248, 250, 251, 0.55);
  color: var(--ink-on-dark);
}

/* Ghost — minimal */
.btn--ghost {
  background-color: transparent;
  color: var(--ink-secondary);
  border-color: transparent;
}

.btn--ghost:hover {
  background-color: var(--bg-muted);
  color: var(--ink-primary);
}

/* Gold — premium/highlight */
.btn--gold {
  background-color: var(--color-gold);
  color: #FFFFFF;
  border-color: var(--color-gold);
  box-shadow: var(--shadow-gold);
}

.btn--gold:hover {
  background-color: var(--color-gold-dark);
  border-color: var(--color-gold-dark);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(201, 149, 43, 0.35);
}

/* WhatsApp */
.btn--whatsapp {
  background-color: var(--color-whatsapp);
  color: #FFFFFF;
  border-color: var(--color-whatsapp);
  gap: var(--space-sm);
}

.btn--whatsapp:hover {
  background-color: var(--color-whatsapp-dark);
  border-color: var(--color-whatsapp-dark);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.30);
}

/* Sizes */
.btn--sm {
  height: var(--btn-height-sm);
  padding-inline: var(--space-md);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.btn--large,
.btn--lg {
  height: var(--btn-height-lg);
  padding-inline: var(--space-xl);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

/* Icon-only button */
.btn--icon {
  padding-inline: 0;
  width: var(--btn-height-md);
  flex-shrink: 0;
}

.btn--icon.btn--lg {
  width: var(--btn-height-lg);
}

/* ----------------------------------------------------------
   Stat Component
---------------------------------------------------------- */

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
}

.stat--center {
  align-items: center;
  text-align: center;
}

.stat__value {
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: 1;
  color: var(--color-primary);
  letter-spacing: var(--tracking-tight);
}

.stat__value--accent {
  color: var(--color-accent);
}

.stat__value--gold {
  color: var(--color-gold);
}

/* Gradient variant */
.stat__value--gradient {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat__label {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  font-weight: 500;
  line-height: var(--leading-snug);
}

.on-dark .stat__value,
.section--dark .stat__value {
  color: var(--ink-on-dark);
}

.on-dark .stat__label,
.section--dark .stat__label {
  color: var(--ink-on-dark-muted);
}

/* ----------------------------------------------------------
   Utilities
---------------------------------------------------------- */

/* Text alignment */
.text-center { text-align: center; }
.text-start   { text-align: start; }
.text-end     { text-align: end; }

/* Text colors */
.text-primary   { color: var(--ink-primary); }
.text-secondary { color: var(--ink-secondary); }
.text-muted     { color: var(--ink-muted); }
.text-accent    { color: var(--color-accent); }
.text-gold      { color: var(--color-gold); }
.text-on-dark   { color: var(--ink-on-dark); }

/* Gradient text */
.text-gradient {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-accent) 60%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient--gold {
  background: linear-gradient(135deg, var(--color-gold-dark) 0%, var(--color-gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Font weights */
.font-normal  { font-weight: 400; }
.font-medium  { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold    { font-weight: 700; }
.font-extrabold { font-weight: 800; }

/* Display helpers */
.d-flex    { display: flex; }
.d-grid    { display: grid; }
.d-block   { display: block; }
.d-inline  { display: inline; }
.d-none    { display: none; }

.items-center  { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap     { flex-wrap: wrap; }
.gap-sm        { gap: var(--space-sm); }
.gap-md        { gap: var(--space-md); }
.gap-lg        { gap: var(--space-lg); }

/* Spacing helpers */
.mt-auto   { margin-block-start: auto; }
.mb-auto   { margin-block-end: auto; }
.mx-auto   { margin-inline: auto; }
.mt-lg     { margin-block-start: var(--space-lg); }
.mb-lg     { margin-block-end: var(--space-lg); }

/* Width helpers */
.w-full    { width: 100%; }

/* Max-width for prose */
.prose     { max-width: var(--content-max); }
.prose--wide { max-width: 80ch; }

/* Decorative divider */
.divider {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  border-radius: var(--radius-full);
  margin-block: var(--space-md);
}

.divider--center {
  margin-inline: auto;
}

.divider--gold {
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light));
}

/* Visually hidden (accessibility) */
.visually-hidden,
.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;
}

/* Skip to main content */
.skip-link {
  position: absolute;
  top: -100%;
  inset-inline-start: var(--space-md);
  z-index: var(--z-tooltip);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-primary);
  color: #FFFFFF;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  top: var(--space-md);
}

/* Responsive images in text content */
figure {
  margin-inline: 0;
}

figcaption {
  font-size: var(--text-xs);
  color: var(--ink-muted);
  margin-block-start: var(--space-xs);
  text-align: center;
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-muted);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-xs);
  color: var(--color-primary);
}

pre {
  font-family: var(--font-mono);
  background: var(--bg-dark);
  color: var(--ink-on-dark);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ----------------------------------------------------------
   CLS Prevention — hide reveal elements before JS runs
---------------------------------------------------------- */

[data-reveal] {
  opacity: 0;
}
