/* ============================================================
   EVERLAST CUSTOMZ — Design System v5
   Reference language: modern dark shop. Neutral ink #101012,
   #ededed type, white-alpha hairlines, #161618 cards, soft
   rounded corners, Geist type, tight semibold headings, one
   brand ink (red) with a light accent tint.
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-base);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

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

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

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

input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
  width: 100%;
}

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

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

/* --- Custom Properties ---
   Legacy token names are kept as aliases so every page and
   stylesheet picks up the new skin with zero markup changes. */
:root {
  /* Type — Geist everywhere, mono for data only */
  --font-display: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  /* Surfaces — neutral ink, layered by value */
  --bg-base: #101012;
  --bg-surface: #141416;
  --bg-card: #161618;
  --bg-elevated: #1b1b1e;
  --bg-input: #141416;
  --bg-hover: #1d1d20;
  --bg-glass: rgba(16, 16, 18, 0.7);

  /* Hairlines — white at low alpha */
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-focus: var(--brand-primary);
  --hairline: rgba(255, 255, 255, 0.06);
  --hairline-strong: rgba(255, 255, 255, 0.12);

  /* Text */
  --text-primary: #f1f1ef;
  --text-secondary: #adadad;
  --text-muted: #79787b;
  --text-inverse: #101012;

  /* Brand ink — deep red with a light accent tint */
  --brand-primary: #e8402a;
  --brand-accent: #ff9c85;
  --brand-deep: #8f1f10;
  --brand-glow: rgba(232, 64, 42, 0.16);

  --red-50: #fff1ed;
  --red-100: #ffd9d0;
  --red-200: #ffb4a3;
  --red-300: #ff9c85;
  --red-400: #ff6b4d;
  --red-500: #e8402a;
  --red-600: #c72f1c;
  --red-700: #a02415;
  --red-800: #71180e;
  --red-900: #2a0d08;
  --red-glow: var(--brand-glow);

  /* Status — tuned for neutral ink */
  --success: #7ed99a;
  --success-bg: #12241a;
  --warning: #e8c078;
  --warning-bg: #261d0e;
  --error: #ff8a75;
  --error-bg: #2a1210;
  --info: #8ab4e8;
  --info-bg: #121a26;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Section rhythm */
  --section-y: clamp(4rem, 8vw, 7.5rem);
  --section-y-sm: clamp(2.5rem, 4.5vw, 4rem);

  /* Radius — soft, modern */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-3xl: 20px;
  --radius-full: 9999px;

  /* Shadows — soft and black, never glowy */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 34px rgba(0, 0, 0, 0.35);
  --shadow-red: 0 8px 24px rgba(232, 64, 42, 0.22);
  --shadow-red-lg: 0 14px 40px rgba(232, 64, 42, 0.28);
  --shadow-card-hover: 0 18px 44px rgba(0, 0, 0, 0.45);

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 450ms;
  --duration-glacial: 650ms;

  /* Z scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-tooltip: 600;

  /* Layout */
  --container-max: 1200px;
  --container-wide: 1400px;
  --container-padding: var(--space-6);
  --navbar-height: 88px;

  /* Glass (nav chrome) */
  --glass-blur: 12px;
  --glass-bg: rgba(16, 16, 18, 0.6);
  --glass-border: rgba(255, 255, 255, 0.06);
}

/* --- Typography Scale --- */
.text-display {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 6vw, 5.75rem);
  font-weight: 500;
  line-height: 1.0;
  letter-spacing: -0.045em;
}

.text-h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.6vw, 3.875rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.025em;
}

.text-h2 {
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 3.4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.text-h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.text-h4 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.text-body {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
}

.text-body-sm {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.55;
}

.text-caption {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.text-mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.text-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

/* Kicker — the accent line above headings */
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--brand-accent);
}

.eyebrow-red {
  color: var(--brand-primary);
}

/* Section heading block */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-10);
  flex-wrap: wrap;
}

.section-head .eyebrow {
  margin-bottom: var(--space-3);
}

.section-head-left {
  max-width: 640px;
}

.section-head p {
  margin-top: var(--space-3);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.container-sm {
  max-width: 640px;
}

.container-md {
  max-width: 768px;
}

.container-lg {
  max-width: 1024px;
}

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

/* --- Section spacing --- */
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.section-lg {
  padding-top: calc(var(--section-y) * 1.2);
  padding-bottom: calc(var(--section-y) * 1.2);
}

.section-sm {
  padding-top: var(--section-y-sm);
  padding-bottom: var(--section-y-sm);
}

.section-surface {
  background: var(--bg-surface);
}

.section-rule {
  height: 1px;
  background: var(--hairline);
  width: 100%;
}

/* --- Grid system --- */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

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

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

/* --- Flex utilities --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* --- Spacing utilities --- */
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mt-16 { margin-top: var(--space-16); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

/* --- Text utilities --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-red { color: var(--brand-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Inline arrow link */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--duration-fast) var(--ease-smooth);
}

.link-arrow svg {
  width: 15px;
  height: 15px;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.link-arrow:hover {
  color: var(--text-primary);
}

.link-arrow:hover svg {
  transform: translateX(4px);
}

/* --- Visibility --- */
.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;
}

.hidden { display: none; }

@media (max-width: 768px) {
  .hide-mobile { display: none; }
}

@media (min-width: 769px) {
  .hide-desktop { display: none; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

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

/* --- Selection --- */
::selection {
  background: var(--brand-primary);
  color: #fff;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: #2a2a2e;
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-base);
}

::-webkit-scrollbar-thumb:hover {
  background: #3a3a3f;
}

/* --- Page wrapper --- */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-content {
  flex: 1;
  padding-top: var(--navbar-height);
}

/* --- Loading bar --- */
.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--brand-primary);
  z-index: var(--z-toast);
  transition: width 0.4s var(--ease-out-expo);
}

/* --- Legacy textures (kept, neutralized) --- */
.grid-texture {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
}

.grid-texture-fade {
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, #000 30%, transparent 75%);
}

.noise-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* --- Dividers --- */
.section-divider {
  width: 100%;
  height: 1px;
  background: var(--hairline);
}

.section-divider-red {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 64, 42, 0.5), transparent);
}

/* --- Scroll progress --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 1px;
  width: 0;
  background: var(--brand-primary);
  z-index: calc(var(--z-sticky) + 1);
  pointer-events: none;
}
