/*
  SportGearTrader — hand-written CSS, no framework.
  Design tokens adapted from the "Interactive Community Sports Website" Figma reference.
*/

/* ---------- Fonts (self-hosted, no external requests) ---------- */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/bricolage-grotesque-700.woff2") format("woff2");
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/bricolage-grotesque-800.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/dm-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/dm-sans-500.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/dm-sans-700.woff2") format("woff2");
}

/* ---------- Design tokens ---------- */
:root {
  /* Brand teal ramp, pulled from the Figma reference */
  --color-primary: #1a8a72;        /* darker teal — used for text/links on white (WCAG AA) */
  --color-primary-mid: #3db89e;    /* mid teal — buttons, large surfaces */
  --color-primary-light: #60cdb5;  /* light teal — gradients, accents */
  --color-primary-pale: #92ddd1;   /* pale teal — gradients, soft backgrounds */

  --color-bg: #ffffff;
  --color-bg-muted: #f4faf8;
  --color-card: #ffffff;
  --color-border: #e2e8e6;
  --color-text: #16221f;
  --color-text-muted: #5b6b67;
  --color-white: #ffffff;

  --font-heading: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 3px rgba(16, 40, 34, 0.08);
  --shadow-md: 0 8px 24px rgba(16, 40, 34, 0.10);
  --shadow-lg: 0 20px 45px rgba(16, 40, 34, 0.16);

  --container-width: 1120px;
  --nav-height: 64px;
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

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

a {
  color: var(--color-primary);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--color-text);
}

h3, h4 {
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

ul, ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

button {
  font-family: inherit;
}

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

@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;
  }
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding-block: clamp(48px, 8vw, 96px);
}

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

.section-bg-card {
  background: var(--color-card);
  border-block: 1px solid var(--color-border);
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 0.75em;
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

/* Large display heading, used for every major H2 on the site */
.display-heading {
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem);
}

.lede {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.section-cta {
  margin-top: 1.75em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85em 1.6em;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
  line-height: 1.2;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--color-primary-mid);
  color: var(--color-white);
}

.btn-primary:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn-outline:hover {
  background: var(--color-bg-muted);
}

.btn-outline-invert {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--color-white);
}

.btn-outline-invert:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-white {
  background: var(--color-white);
  color: var(--color-primary);
}

.btn-white:hover {
  background: var(--color-bg-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  padding: 0.85em 0.5em;
}

.btn-ghost:hover {
  color: var(--color-text);
}

.btn-block {
  width: 100%;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  cursor: pointer;
}

.nav-toggle svg {
  width: 20px;
  height: 20px;
}

.nav-toggle .icon-close {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-open {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

.nav-panel {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 28px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 899px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-panel {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 24px 20px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
  }

  .nav-panel.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-links a {
    display: block;
    padding: 14px 4px;
    border-bottom: 1px solid var(--color-border);
    font-size: 1rem;
    color: var(--color-text);
  }

  .nav-actions {
    flex-direction: column;
    align-items: stretch;
    padding-top: 14px;
    gap: 10px;
  }

  .nav-actions .btn {
    width: 100%;
  }
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(48px, 9vw, 108px);
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}

.hero-blob-a {
  width: 460px;
  height: 460px;
  top: -140px;
  right: -100px;
  background: radial-gradient(circle, var(--color-primary-light) 0%, transparent 70%);
  opacity: 0.25;
}

.hero-blob-b {
  width: 340px;
  height: 340px;
  bottom: -100px;
  left: -80px;
  background: radial-gradient(circle, var(--color-primary-mid) 0%, transparent 70%);
  opacity: 0.18;
}

.hero-grid {
  position: relative;
  display: grid;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: 24px;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-bg-muted);
  color: var(--color-text);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5em 1em;
  border-radius: var(--radius-full);
  margin-bottom: 1.25em;
}

.hero-badge svg {
  width: 14px;
  height: 14px;
  color: var(--color-primary-mid);
}

.hero h1 {
  font-size: clamp(2.5rem, 1.9rem + 3vw, 4.25rem);
  margin-bottom: 0.35em;
}

.hero h1 .accent {
  color: var(--color-primary-mid);
}

.hero-lede {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 46ch;
  margin-bottom: 2em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-proof {
  margin-top: 2.5em;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.hero-proof svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.hero-proof strong {
  color: var(--color-text);
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

.hero-visual-logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  border: 4px solid var(--color-white);
  overflow: hidden;
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-visual-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-primary-mid), transparent);
  opacity: 0.12;
}

/* ---------- Stats strip ---------- */
.stats {
  background: var(--color-primary-mid);
  padding-block: clamp(36px, 5vw, 56px);
}

.stats-grid {
  max-width: 880px;
  margin-inline: auto;
  padding-inline: 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  text-align: center;
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-value {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  font-weight: 800;
  color: var(--color-white);
  margin-bottom: 0.15em;
}

.stat-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.78);
}

/* ---------- Steps ---------- */
.steps-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 760px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step-card {
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-card);
}

.step-number {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 1.5em;
}

.step-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25em;
}

.step-icon svg {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
}

.step-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5em;
}

.step-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ---------- Pillars ---------- */
.pillars-grid {
  display: grid;
  gap: clamp(32px, 6vw, 64px);
  align-items: center;
}

@media (min-width: 860px) {
  .pillars-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.pillars-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pillar {
  display: flex;
  gap: 18px;
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.pillar-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pillar-icon svg {
  width: 18px;
  height: 18px;
  color: var(--color-primary);
}

.pillar h4 {
  margin-bottom: 0.3em;
}

.pillar p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ---------- Sports category grid ---------- */
.category-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (min-width: 560px) {
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .category-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.category-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--color-border);
  background: var(--color-bg-muted);
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-card-label {
  position: absolute;
  inset: auto 0 0 0;
  padding: 14px 12px;
  background: linear-gradient(0deg, rgba(10, 30, 25, 0.82) 0%, rgba(10, 30, 25, 0) 100%);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
}

/* ---------- FAQ ---------- */
.faq-list {
  max-width: 760px;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-item:first-child {
  border-top: 1px solid var(--color-border);
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 4px;
  font-weight: 700;
  font-size: 1rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary .chev {
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-item[open] summary .chev {
  transform: rotate(180deg);
}

.faq-item p {
  padding: 0 4px 20px;
  color: var(--color-text-muted);
  max-width: 65ch;
}

/* ---------- CTA band ---------- */
.cta-band {
  border-radius: var(--radius-lg);
  padding: clamp(40px, 7vw, 72px) clamp(24px, 6vw, 64px);
  text-align: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-primary-mid) 0%, var(--color-primary-light) 60%, var(--color-primary-pale) 100%);
}

.cta-band h2,
.cta-band p {
  color: var(--color-white);
}

.cta-band .lede {
  color: rgba(255, 255, 255, 0.85);
  max-width: 46ch;
  margin-inline: auto;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 1.5em;
}

.cta-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25em;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: 48px;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  text-decoration: none;
  color: var(--color-text);
}

.footer-brand img {
  width: 28px;
  height: 28px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
}

.footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-text);
}

.footer-fine {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ---------- Interior page header (About / How It Works / FAQ / Privacy) ---------- */
.page-hero {
  padding-block: clamp(40px, 7vw, 72px) clamp(24px, 4vw, 40px);
  background: var(--color-bg-muted);
  border-bottom: 1px solid var(--color-border);
}

.page-hero h1 {
  font-size: clamp(2rem, 1.6rem + 2vw, 3rem);
  max-width: 20ch;
}

.page-hero .lede {
  max-width: 60ch;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1em;
}

.breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--color-text);
}

/* ---------- Prose (content pages: about / privacy) ---------- */
.prose {
  max-width: 72ch;
}

.prose h2 {
  font-size: 1.5rem;
  margin-top: 1.75em;
}

.prose h3 {
  font-size: 1.15rem;
  margin-top: 1.5em;
}

.prose p,
.prose li {
  color: var(--color-text-muted);
}

.prose ul {
  margin-bottom: 1.5em;
}

.prose strong {
  color: var(--color-text);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95rem;
}

.prose th {
  text-align: left;
  padding: 10px 12px 10px 0;
  border-bottom: 2px solid var(--color-border);
}

.prose td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.callout {
  background: var(--color-bg-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 1.75em 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* ---------- Icon-feature list (used on how-it-works / about) ---------- */
.feature-list {
  display: grid;
  gap: 20px;
  margin: 2em 0;
}

@media (min-width: 700px) {
  .feature-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.feature-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 22px;
}

.feature-item h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4em;
}

.feature-item p {
  margin: 0;
  font-size: 0.95rem;
}

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 100;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}
