/* ==========================================================================
   RepHit Design System & Shared Styles
   A modern, athletic, high-performance aesthetic for serious lifters.
   ========================================================================== */

:root {
  /* Brand Palette - Athletic Ember & Deep Iron */
  --brand: oklch(0.67 0.21 41);
  --brand-strong: oklch(0.58 0.22 39);
  --brand-soft: oklch(0.93 0.055 55);
  --brand-glow: oklch(0.67 0.21 41 / 0.25);
  
  --ink: oklch(0.24 0.018 60);
  --ink-deep: oklch(0.15 0.02 55);
  --paper: oklch(0.985 0.008 75);
  --surface: oklch(0.998 0.004 75);
  --surface-2: oklch(0.965 0.01 72);
  --surface-3: oklch(0.94 0.012 70);
  
  --muted: oklch(0.50 0.015 60);
  --muted-2: oklch(0.64 0.012 60);
  --border: oklch(0.90 0.009 72);
  --border-strong: oklch(0.82 0.014 68);
  
  --cool: oklch(0.64 0.13 235);
  --cool-soft: oklch(0.93 0.04 235);
  --cool-glow: oklch(0.64 0.13 235 / 0.25);
  
  --green: oklch(0.66 0.16 145);
  --green-soft: oklch(0.93 0.05 145);
  --green-glow: oklch(0.66 0.16 145 / 0.25);

  --gold: oklch(0.78 0.16 75);
  --gold-soft: oklch(0.95 0.06 75);

  /* Animation Easing */
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Elevation Shadows */
  --shadow-xs: 0 1px 3px oklch(0.2 0.02 60 / 0.04);
  --shadow-sm: 0 2px 8px -2px oklch(0.2 0.02 60 / 0.06);
  --shadow-md: 0 12px 32px -10px oklch(0.2 0.03 50 / 0.10);
  --shadow-lg: 0 24px 60px -16px oklch(0.2 0.04 45 / 0.16);
  --shadow-glow: 0 16px 40px -10px var(--brand-glow);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 9999px;

  --z-nav: 1000;
  --z-modal: 2000;
  --z-toast: 3000;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--paper);
  color: var(--ink);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

::selection {
  background: oklch(0.67 0.21 41 / 0.22);
  color: var(--ink-deep);
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--paper);
}
::-webkit-scrollbar-thumb {
  background: oklch(0.85 0.01 70);
  border-radius: 999px;
  border: 2px solid var(--paper);
}
::-webkit-scrollbar-thumb:hover {
  background: oklch(0.72 0.01 70);
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Bricolage Grotesque", -apple-system, sans-serif;
  text-wrap: balance;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--ink-deep);
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

.wrap {
  width: min(1180px, 92vw);
  margin-inline: auto;
}

/* Section Spacing */
section {
  padding: 96px 0;
  position: relative;
}

@media (max-width: 768px) {
  section {
    padding: 64px 0;
  }
}

/* Eyebrows & Badges */
.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-strong);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 2.5px;
  background: var(--brand);
  border-radius: 999px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}
.badge-brand {
  background: var(--brand-soft);
  color: var(--brand-strong);
}
.badge-cool {
  background: var(--cool-soft);
  color: var(--cool);
}
.badge-green {
  background: var(--green-soft);
  color: var(--green);
}
.badge-dark {
  background: var(--ink-deep);
  color: oklch(0.99 0.01 75);
}

/* Section Header standard */
.sec-head {
  max-width: 62ch;
  margin-bottom: 48px;
}
.sec-head.center {
  margin-inline: auto;
  text-align: center;
}
.sec-head h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin: 14px 0 16px;
  letter-spacing: -0.03em;
}
.sec-head p {
  font-size: 1.12rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */
nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: oklch(0.985 0.008 75 / 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

nav.scrolled {
  border-bottom-color: var(--border);
  background: oklch(0.992 0.006 75 / 0.94);
  box-shadow: 0 4px 24px -6px oklch(0.2 0.02 60 / 0.07);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--ink-deep);
  text-decoration: none !important;
}

.brand:hover .mark {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 6px 18px oklch(0.17 0.02 62 / 0.25);
}

.mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--ink-deep);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.15), 0 2px 8px oklch(0.17 0.02 62 / 0.15);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
}

.mark-bars {
  display: flex;
  align-items: center;
}

.mark span {
  display: block;
  width: 4px;
  border-radius: 3px;
  background: var(--brand);
}

.mark span:nth-child(1) { height: 12px; }
.mark span:nth-child(2) { height: 20px; margin-inline: 3px; background: oklch(0.985 0.008 75); }
.mark span:nth-child(3) { height: 14px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.94rem;
  font-weight: 500;
}

.nav-links a {
  color: var(--muted);
  padding: 8px 4px;
  position: relative;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--ink-deep);
}

.nav-links a.active {
  color: var(--ink-deep);
  font-weight: 600;
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 0;
  height: 2.5px;
  background: var(--brand);
  border-radius: 999px;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-deep);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.menu-toggle:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

/* Mobile Drawer */
.mobile-drawer {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 4vw 24px;
  box-shadow: 0 16px 32px oklch(0.2 0.02 60 / 0.1);
}

.mobile-drawer.open {
  display: block;
  animation: drawerSlideDown 0.25s var(--ease-out-quint);
}

@keyframes drawerSlideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.mobile-drawer-links a {
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  transition: background 0.15s, color 0.15s;
}

.mobile-drawer-links a:hover,
.mobile-drawer-links a.active {
  background: var(--surface-2);
  color: var(--brand-strong);
}

.mobile-drawer-cta {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.mobile-drawer-cta .btn {
  width: 100%;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.94rem;
  border: none;
  cursor: pointer;
  padding: 11px 22px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-decoration: none !important;
  transition: transform 0.18s var(--ease-out-quint), background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: translateY(0) scale(0.98) !important;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
  transition: transform 0.2s ease;
}

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

.btn-primary {
  background: var(--brand);
  color: oklch(0.99 0.01 75) !important;
  box-shadow: 0 1px 2px oklch(0.4 0.1 40 / 0.2), 0 8px 24px -4px oklch(0.67 0.2 41 / 0.4);
}
.btn-primary:hover {
  background: var(--brand-strong);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px oklch(0.4 0.1 40 / 0.2), 0 12px 28px -4px oklch(0.67 0.2 41 / 0.5);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink-deep);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--ink-deep);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-dark {
  background: var(--ink-deep);
  color: oklch(0.99 0.01 75) !important;
  box-shadow: 0 8px 22px -6px oklch(0.17 0.02 62 / 0.3);
}
.btn-dark:hover {
  background: oklch(0.22 0.02 55);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -6px oklch(0.17 0.02 62 / 0.4);
}

.btn-onbrand {
  background: oklch(0.99 0.01 75);
  color: var(--ink-deep) !important;
  box-shadow: 0 10px 28px -6px oklch(0.2 0.05 40 / 0.35);
}
.btn-onbrand:hover {
  background: oklch(0.95 0.01 75);
  transform: translateY(-2px);
}

.btn-outline-light {
  background: transparent;
  color: oklch(0.99 0.02 75) !important;
  box-shadow: inset 0 0 0 1.5px oklch(0.99 0.02 75 / 0.5);
}
.btn-outline-light:hover {
  background: oklch(1 0 0 / 0.14);
  box-shadow: inset 0 0 0 1.5px oklch(0.99 0.02 75);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 15px 28px;
  font-size: 1.02rem;
  border-radius: 15px;
}

/* ==========================================================================
   REVEAL ON SCROLL (Robust, Progressive Enhancement)
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s var(--ease-out-expo), transform 0.65s var(--ease-out-expo);
  will-change: opacity, transform;
}

.reveal.in {
  opacity: 1 !important;
  transform: none !important;
}

@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;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Fallback: If JavaScript is disabled or delayed */
noscript .reveal {
  opacity: 1 !important;
  transform: none !important;
}

/* ==========================================================================
   SHARED FOOTER
   ========================================================================== */
footer {
  padding: 80px 0 44px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  position: relative;
}

.foot-top {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.foot-brand p {
  color: var(--muted);
  font-size: 0.94rem;
  margin-top: 16px;
  max-width: 32ch;
  line-height: 1.6;
}

.foot-brand .app-badges {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.foot-col h4 {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-deep);
  font-weight: 700;
  margin-bottom: 18px;
}

.foot-col a {
  display: block;
  color: var(--muted);
  font-size: 0.94rem;
  margin-bottom: 11px;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.foot-col a:hover {
  color: var(--brand-strong);
  transform: translateX(2px);
}

.foot-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  font-size: 0.88rem;
  color: var(--muted-2);
  flex-wrap: wrap;
  gap: 14px;
}

.foot-bottom a {
  color: var(--muted);
}
.foot-bottom a:hover {
  color: var(--ink-deep);
}

/* ==========================================================================
   TOAST NOTIFICATION (Universal)
   ========================================================================== */
.toast-msg {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink-deep);
  color: oklch(0.99 0.01 75);
  padding: 13px 26px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s var(--ease-spring);
  z-index: var(--z-toast);
  box-shadow: 0 16px 36px -6px oklch(0.1 0.02 55 / 0.35);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-msg.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   RESPONSIVE BASELINE
   ========================================================================== */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .menu-toggle { display: inline-flex; }
  .foot-top { grid-template-columns: 1fr 1fr; gap: 36px; }
}

@media (max-width: 560px) {
  .foot-top { grid-template-columns: 1fr; gap: 30px; }
  .foot-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}
