/* ========================================================================
   Variables
   ======================================================================== */
:root {
  /* Colors */
  --color-background: #050608; /* near-black gym ambiance */
  --color-surface: #101218;    /* card / panel background */
  --color-surface-alt: #181b22;
  --color-text: #f5f5f5;
  --color-text-muted: #9ca3af;

  --color-primary: #e11d48;   /* vibrant red / energy */
  --color-primary-soft: rgba(225, 29, 72, 0.15);
  --color-success: #22c55e;
  --color-warning: #facc15;
  --color-danger: #ef4444;

  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2933;
  --color-gray-900: #111827;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  --font-heading: "Oswald", system-ui, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */
  --font-size-5xl: 3rem;     /* 48px */

  --line-height-tight: 1.1;
  --line-height-snug: 1.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (px) */
  --space-0: 0;
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-5: 10px;
  --space-6: 12px;
  --space-8: 16px;
  --space-10: 20px;
  --space-12: 24px;
  --space-16: 32px;
  --space-20: 40px;
  --space-24: 48px;
  --space-32: 64px;
  --space-40: 80px;
  --space-48: 96px;

  /* Radius */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* Shadows (sharp, gym-like contrast) */
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 25px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 45px rgba(0, 0, 0, 0.65);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-normal: 200ms ease;
  --transition-slow: 320ms ease;

  /* Layout */
  --container-max-width: 1120px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }

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

/* ========================================================================
   Reset / Normalize
   ======================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

picture {
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}

button {
  border: none;
  background: none;
  padding: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

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

/* ========================================================================
   Base
   ======================================================================== */
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  background-color: var(--color-background);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  display: block;
}

/* Headings: bold, condensed, gym-style */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

h1 {
  font-size: clamp(var(--font-size-3xl), 4vw, var(--font-size-5xl));
  margin-bottom: var(--space-16);
}

h2 {
  font-size: clamp(var(--font-size-2xl), 3vw, var(--font-size-4xl));
  margin-bottom: var(--space-12);
}

h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-8);
}

h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-6);
}

h5 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-4);
}

h6 {
  font-size: var(--font-size-base);
  margin-bottom: var(--space-3);
}

p {
  margin-bottom: var(--space-8);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  /* comfortable line length */
  color: var(--color-text-muted);
}

strong,
b {
  font-weight: 600;
}

code,
pre {
  font-family: var(--font-mono);
}

/* Links: subtle, energized hover */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-normal),
              text-shadow var(--transition-fast);
}

a:hover {
  color: #fb7185;
  text-shadow: 0 0 18px rgba(225, 29, 72, 0.65);
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* ========================================================================
   Accessibility & Focus
   ======================================================================== */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Screen-reader only */
.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;
}

/* ========================================================================
   Utilities
   ======================================================================== */
/* Layout containers */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-16);
  padding-right: var(--space-16);
}

.container--wide {
  max-width: 1360px;
}

.section {
  padding-top: var(--space-40);
  padding-bottom: var(--space-40);
}

.section--tight {
  padding-top: var(--space-24);
  padding-bottom: var(--space-24);
}

/* Flex helpers */
.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-xs {
  gap: var(--space-4);
}

.gap-sm {
  gap: var(--space-6);
}

.gap-md {
  gap: var(--space-10);
}

.gap-lg {
  gap: var(--space-16);
}

/* Grid helpers */
.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-16);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-16);
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

.text-right {
  text-align: right;
}

.text-uppercase {
  text-transform: uppercase;
}

/* Spacing utilities */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

.mt-xs { margin-top: var(--space-4); }
.mt-sm { margin-top: var(--space-6); }
.mt-md { margin-top: var(--space-10); }
.mt-lg { margin-top: var(--space-16); }
.mt-xl { margin-top: var(--space-24); }

.mb-xs { margin-bottom: var(--space-4); }
.mb-sm { margin-bottom: var(--space-6); }
.mb-md { margin-bottom: var(--space-10); }
.mb-lg { margin-bottom: var(--space-16); }
.mb-xl { margin-bottom: var(--space-24); }

.pt-xs { padding-top: var(--space-4); }
.pt-sm { padding-top: var(--space-6); }
.pt-md { padding-top: var(--space-10); }
.pt-lg { padding-top: var(--space-16); }
.pt-xl { padding-top: var(--space-24); }

.pb-xs { padding-bottom: var(--space-4); }
.pb-sm { padding-bottom: var(--space-6); }
.pb-md { padding-bottom: var(--space-10); }
.pb-lg { padding-bottom: var(--space-16); }
.pb-xl { padding-bottom: var(--space-24); }

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

.max-w-readable {
  max-width: 70ch;
}

/* ========================================================================
   Components
   ======================================================================== */
/* Buttons: bold, high-contrast, athletic */
.button,
button[type="button"],
button[type="submit"],
button[type="reset"],
input[type="button"],
input[type="submit"],
input[type="reset"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--color-primary), #fb7185);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: var(--font-size-sm);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background var(--transition-normal),
              box-shadow var(--transition-normal),
              transform var(--transition-fast),
              border-color var(--transition-fast);
  box-shadow: var(--shadow-md);
}

.button::after,
button[type="button"]::after,
button[type="submit"]::after,
button[type="reset"]::after,
input[type="button"]::after,
input[type="submit"]::after,
input[type="reset"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0 0, rgba(255,255,255,0.18), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.button:hover,
button[type="button"]:hover,
button[type="submit"]:hover,
button[type="reset"]:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.button:hover::after,
button[type="button"]:hover::after,
button[type="submit"]:hover::after,
button[type="reset"]:hover::after,
input[type="button"]:hover::after,
input[type="submit"]:hover::after,
input[type="reset"]:hover::after {
  opacity: 1;
}

.button:active,
button[type="button"]:active,
button[type="submit"]:active,
button[type="reset"]:active,
input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.button--outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: none;
}

.button--outline:hover {
  background: var(--color-primary-soft);
  box-shadow: var(--shadow-sm);
}

.button--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: rgba(148, 163, 184, 0.5);
}

.button--ghost:hover {
  border-color: var(--color-primary);
  background: rgba(15, 23, 42, 0.8);
}

.button:disabled,
button[disabled],
input[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Inputs: clean, metallic edge */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-gray-700);
  background-color: #05070b;
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  transition: border-color var(--transition-fast),
              box-shadow var(--transition-fast),
              background-color var(--transition-fast);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-gray-500);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary-soft), 0 0 0 1px var(--color-primary);
  background-color: #05070b;
}

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

/* Card: used for memberships, trainers, facilities */
.card {
  background: radial-gradient(circle at top left, rgba(248, 250, 252, 0.05), transparent 55%),
              var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-16);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(148, 163, 184, 0.24);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.28), transparent 55%);
  mix-blend-mode: soft-light;
  opacity: 0.1;
  pointer-events: none;
}

.card--highlight {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(225, 29, 72, 0.45), var(--shadow-lg);
}

.card-header {
  margin-bottom: var(--space-10);
}

.card-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-4);
}

.card-body {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.card-footer {
  margin-top: var(--space-12);
}

/* Media wrappers for high-impact imagery */
.media-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
}

.media-frame img,
.media-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame--angled::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 38%;
  background: linear-gradient(to top, rgba(5, 6, 8, 0.9), transparent);
}

/* Badges / labels for class levels, membership tags */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background-color: rgba(15, 23, 42, 0.8);
}

.badge--primary {
  border-color: var(--color-primary);
  background-color: rgba(225, 29, 72, 0.1);
  color: #fecaca;
}

.badge--success {
  border-color: var(--color-success);
  background-color: rgba(34, 197, 94, 0.15);
}

/* ========================================================================
   Helper: High-contrast section variants
   ======================================================================== */
.section--dark {
  background: radial-gradient(circle at top, rgba(248, 250, 252, 0.06), transparent 60%),
              #02030a;
}

.section--steel {
  background: linear-gradient(145deg, #020617, #111827 50%, #020617 100%);
}

.section--accent {
  background: radial-gradient(circle at top left, rgba(225, 29, 72, 0.2), transparent 65%),
              #020617;
}
