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

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-strong: #eef2ff;
  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #64748b;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.12);
  --brand: #1d4ed8;
  --brand-dark: #1e3a8a;
  --brand-soft: rgba(29, 78, 216, 0.08);
  --accent: #f97316;
  --shadow-sm: 0 10px 30px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 18px 50px rgba(15, 23, 42, 0.08);
  --radius: 20px;
  --radius-sm: 14px;
  --max-width: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
  color: var(--text);
  background: linear-gradient(to bottom, #f8fbff 0%, #f5f7fb 32%, #ffffff 100%);
  line-height: 1.7;
}

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

a:hover {
  color: var(--brand);
}

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

.container {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.84);
  border-bottom: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.site-header .container {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(30, 58, 138, 0.14);
}

.brand h1 {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand h1 a { color: var(--text); }
.brand h1 a:hover { color: var(--brand-dark); }

nav {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a {
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 500;
}

nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-cart {
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--text) !important;
}

/* Hero */
.hero {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  background: #0f172a;
}

.hero img {
  width: 100%;
  height: 100%;
  min-height: 620px;
  object-fit: cover;
  object-position: center;
  opacity: 0.72;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.26), transparent 34%),
    linear-gradient(to top, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.18));
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: flex-end;
}

.hero-panel {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto 3.5rem;
  padding: 2rem;
  color: white;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 80px rgba(2, 8, 23, 0.28);
}

.hero-kicker,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.72rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-kicker {
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  margin-bottom: 1rem;
}

.hero h2 {
  max-width: 10ch;
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin-bottom: 1rem;
}

.hero p {
  max-width: 640px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.5rem;
}

.hero-stats {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.hero-stat {
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-stat strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
}

.hero-stat span {
  display: block;
  margin-top: 0.2rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
}

/* Buttons */
.btn,
.btn-small,
.buy-btn,
.cart-checkout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn:hover,
.btn-small:hover,
.buy-btn:hover,
.cart-checkout-btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn {
  min-height: 46px;
  padding: 0 1.15rem;
  font-size: 0.95rem;
}

.btn-small,
.buy-btn {
  min-height: 40px;
  padding: 0 0.95rem;
  font-size: 0.87rem;
}

.btn-primary,
.buy-btn,
.cart-checkout-btn {
  background: var(--brand);
  color: white;
  box-shadow: 0 14px 30px rgba(29, 78, 216, 0.22);
}

.btn-primary:hover,
.buy-btn:hover,
.cart-checkout-btn:hover {
  background: var(--brand-dark);
  color: white;
}

.btn-secondary,
.btn-small {
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover,
.btn-small:hover {
  background: white;
  color: var(--text);
}

.buy-btn:disabled,
.cart-checkout-btn:disabled {
  cursor: not-allowed;
  background: #cbd5e1;
  box-shadow: none;
}

/* General page blocks */
.home-shell {
  padding: 4rem 0 5rem;
}

.home-section + .home-section {
  margin-top: 4rem;
}

.section-copy {
  max-width: 760px;
  margin-bottom: 1.6rem;
}

.section-copy-inline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: none;
}

.section-copy h2,
.content-page h1,
.section-header h1 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-top: 0.55rem;
}

.section-copy p,
.section-intro,
.rich-intro,
.feature-card p,
.card .description,
.shop-description,
.product-desc,
.cta-card p,
.footer-inner p {
  color: var(--text-muted);
}

.section-kicker {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.intro-section {
  display: grid;
  gap: 1.75rem;
}

.feature-grid,
.card-grid,
.shop-grid,
.cta-grid {
  display: grid;
  gap: 1.25rem;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.shop-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.card,
.feature-card,
.shop-card,
.cta-card,
.success-box,
.panel-soft,
.clean-cta,
.run-item {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card,
.feature-card,
.cta-card,
.panel-soft {
  padding: 1.4rem;
}

.feature-card {
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 56px;
  background: linear-gradient(to bottom, rgba(219, 234, 254, 0.55), transparent);
  pointer-events: none;
}

.feature-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.feature-card h3,
.card h3,
.cta-card h3,
.shop-info h3,
.product-info h1 {
  font-size: 1.1rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
}

.card h3 a,
.shop-info h3 a {
  color: var(--text);
}

.card h3 a:hover,
.shop-info h3 a:hover,
.back-link:hover {
  color: var(--brand);
}

.meta {
  color: var(--text-muted);
  font-size: 0.87rem;
}

.description { font-size: 0.95rem; }
.card-actions { margin-top: 1rem; }

/* Events on homepage */
.event-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.event-date {
  width: 64px;
  flex: 0 0 64px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  text-align: center;
  padding: 0.7rem 0.4rem;
}

.event-date span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.event-date strong {
  display: block;
  margin-top: 0.18rem;
  font-size: 1.4rem;
  letter-spacing: -0.04em;
  color: var(--brand-dark);
}

.event-body { flex: 1; }

/* Split section */
.split-section {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
}

.cta-stack {
  display: grid;
  gap: 1.25rem;
}

.panel-soft {
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,250,252,0.96));
}

.run-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.4rem;
}

.run-item {
  padding: 1rem 1rem 0.95rem;
}

.run-time {
  color: var(--brand-dark);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.run-title {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.run-meta,
.run-distance {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.run-distance { margin-top: 0.12rem; }

.clean-cta {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

/* Section pages */
.section-header {
  margin-bottom: 0.8rem;
}

.section-header h1 {
  font-size: clamp(1.9rem, 3vw, 2.5rem);
}

.section-intro,
.rich-intro {
  margin-bottom: 1.5rem;
  max-width: 760px;
}

.rich-intro p { margin-bottom: 0.75rem; }

.rich-intro blockquote,
.donate-box,
.empty-state,
.mock-success {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 1rem 1.1rem;
}

.empty-state {
  color: var(--text-muted);
}

/* Content pages */
.content-page {
  width: min(calc(100% - 2rem), 780px);
  margin: 0 auto;
  padding: 3.5rem 0 4.5rem;
}

.content-page .meta {
  margin-bottom: 1.4rem;
}

.content-page h2 {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  margin: 2rem 0 0.8rem;
}

.content-page h3 {
  font-size: 1.05rem;
  margin: 1.4rem 0 0.55rem;
}

.content-page p,
.content-page ul,
.content-page ol,
.content-page table,
.content-page blockquote {
  margin-bottom: 1rem;
}

.content-page ul,
.content-page ol,
.compact-list {
  padding-left: 1.25rem;
}

.content-page li,
.compact-list li {
  margin-bottom: 0.4rem;
}

.content-page table,
.runs-table,
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.content-page th,
.content-page td,
.runs-table th,
.runs-table td,
.comparison-table th,
.comparison-table td {
  text-align: left;
  padding: 0.88rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.content-page th,
.runs-table th,
.comparison-table th {
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 700;
}

.content-page tr:last-child td,
.runs-table tr:last-child td,
.comparison-table tr:last-child td {
  border-bottom: none;
}

.content-page img,
.product-image img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.content-page blockquote {
  border-left: 3px solid var(--brand);
  padding-left: 1rem;
}

/* Shop */
.shop-card {
  overflow: hidden;
}

.shop-image {
  aspect-ratio: 1 / 1;
  background: linear-gradient(180deg, #f8fafc, #eef2ff);
}

.shop-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-info {
  padding: 1rem 1rem 1.1rem;
}

.shop-price {
  color: var(--brand-dark);
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.45rem;
}

.shop-description {
  min-height: 3rem;
  font-size: 0.92rem;
  margin-bottom: 0.9rem;
}

.size-tag,
.stock-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.75rem;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text-muted);
}

.buy-form {
  margin-top: 0.25rem;
}

.size-select,
.product-info .size-select {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: white;
  padding: 0 0.9rem;
  font: inherit;
  margin-bottom: 0.75rem;
}

.buy-status {
  margin-top: 0.6rem;
  font-size: 0.82rem;
}

.buy-status.error { color: #b91c1c; }

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  padding: 3rem 0 4rem;
}

.product-info .shop-price {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.size-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.7rem;
}

/* Cart */
#cart-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(80px);
  z-index: 1000;
  border-radius: 999px;
  background: #0f172a;
  color: white;
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
  font-size: 0.88rem;
}

#cart-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(15, 23, 42, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

#cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

#cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  height: 100vh;
  z-index: 80;
  background: white;
  box-shadow: -20px 0 60px rgba(15, 23, 42, 0.16);
  transform: translateX(100%);
  transition: transform 0.26s ease;
  display: flex;
  flex-direction: column;
}

#cart-drawer.open {
  transform: translateX(0);
}

.cart-header,
.cart-footer {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.cart-footer {
  border-bottom: none;
  border-top: 1px solid var(--line);
}

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

.cart-close,
.cart-item-remove,
.qty-btn {
  border: 1px solid var(--line);
  background: white;
  color: var(--text-soft);
  border-radius: 12px;
  cursor: pointer;
}

.cart-close {
  width: 36px;
  height: 36px;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
}

.cart-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 3rem 1.5rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.cart-item-name {
  font-size: 0.92rem;
  font-weight: 600;
}

.cart-item-sku {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.qty-btn {
  width: 28px;
  height: 28px;
}

.qty-val {
  min-width: 1.6rem;
  text-align: center;
  font-size: 0.9rem;
}

.cart-item-price {
  min-width: 60px;
  text-align: right;
  font-weight: 700;
}

.cart-item-remove {
  width: 30px;
  height: 30px;
}

.cart-total {
  margin-bottom: 0.85rem;
  text-align: right;
}

/* Footer */
.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.92);
}

.footer-inner {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-brand {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-soft);
  font-size: 0.92rem;
}

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

/* Responsive */
@media (max-width: 980px) {
  .hero-stats,
  .feature-grid,
  .split-section {
    grid-template-columns: 1fr 1fr;
  }

  .split-section {
    grid-template-columns: 1fr;
  }

  .section-copy-inline {
    display: block;
  }

  .section-copy-inline p {
    margin-top: 0.9rem;
  }

  .product-detail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-header .container {
    padding: 0.95rem 0;
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 0.2rem;
  }

  .hero {
    min-height: 560px;
  }

  .hero img {
    min-height: 560px;
  }

  .hero-panel {
    margin-bottom: 2rem;
    padding: 1.4rem;
  }

  .hero h2 {
    max-width: none;
  }

  .hero-stats,
  .feature-grid,
  .shop-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    gap: 0.75rem;
  }

  .event-card {
    flex-direction: column;
  }

  .event-date {
    width: 82px;
  }

  .footer-inner {
    padding: 1.2rem 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .runs-table,
  .content-page table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .cart-item {
    grid-template-columns: 1fr auto;
  }
}
