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

:root {
  --bg: #0a0a0d;
  --bg-elev: #14141a;
  --bg-card: #18181f;
  --bg-input: #1e1e27;
  --border: #252530;
  --border-hover: #3a3a48;
  --text: #f0ede8;
  --text-dim: #9a968e;
  --text-mute: #5a5660;
  --accent: #d85a30;
  --accent-glow: rgba(216, 90, 48, 0.15);
  --accent-dim: rgba(216, 90, 48, 0.5);
  --success: #5dcaa5;
  --warning: #ef9f27;
  --danger: #e24b4a;
  --radius: 10px;
  --radius-lg: 16px;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

html {
  scrollbar-gutter: stable;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body {
  background:
    radial-gradient(ellipse at top, rgba(216, 90, 48, 0.08), transparent 50%),
    radial-gradient(ellipse at bottom, rgba(216, 90, 48, 0.03), transparent 40%),
    var(--bg);
  background-attachment: fixed;
}

/* ========= HOME HERO (compact, sits under the top bar) ========= */
.home-hero {
  text-align: center;
  max-width: 940px;
  margin: 12px auto 26px;
  padding: 0 24px;
}

.home-hero-eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.home-hero-title {
  font-family: var(--serif);
  font-size: clamp(36px, 6vw, 62px);
  font-weight: 600;
  letter-spacing: -1.5px;
  line-height: 1.02;
  color: var(--text);
  margin-bottom: 16px;
}

.home-hero-sub {
  max-width: 680px;
  margin: 0 auto;
  font-size: 16px;
  color: var(--text-dim);
}

.home-offers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--border);
  text-align: left;
}

.home-offers a {
  min-width: 0;
  padding: 16px 18px;
  background: rgba(20, 20, 26, 0.92);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s;
}

.home-offers a:hover {
  background: var(--bg-card);
}

.home-offers a:hover strong {
  color: var(--accent);
}

.home-offers strong,
.home-offers span {
  display: block;
}

.home-offers strong {
  margin-bottom: 3px;
  color: var(--text);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.home-offers span {
  color: var(--text-mute);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .home-hero {
    margin: 0 auto 14px;
    padding: 0 16px;
  }

  .home-hero-eyebrow {
    margin-bottom: 6px;
    font-size: 9px;
  }

  .home-hero-title {
    margin-bottom: 10px;
    font-size: clamp(30px, 9.5vw, 38px);
    letter-spacing: -0.8px;
    line-height: 1.04;
  }

  .home-hero-sub {
    font-size: 13px;
    line-height: 1.5;
  }

  .home-offers {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 14px;
    border-radius: var(--radius);
  }

  .home-offers a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 42px;
    padding: 8px 5px;
    text-align: center;
  }

  .home-offers strong {
    margin: 0;
    font-family: var(--sans);
    font-size: 11px;
    line-height: 1.2;
  }

  .home-offers span {
    display: none;
  }
}

.progress-wrap {
  max-width: 420px;
  /* Space before the search below, and keep it off the screen edges on mobile so
     it doesn't span wider than the search input (which is inset 16px). */
  margin: 0 auto 30px;
  padding: 0 16px;
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.progress-stats strong {
  color: var(--accent);
  font-weight: 500;
}

.progress-track {
  height: 4px;
  background: var(--bg-elev);
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #f5a17a);
  border-radius: 2px;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ========= CONTROLS ========= */
.controls {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.search-wrap {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  font-family: var(--sans);
  outline: none;
  transition: border-color 0.15s;
}

.search-input::placeholder { color: var(--text-mute); }
.search-input:focus { border-color: var(--accent); }

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-mute);
  font-size: 16px;
  pointer-events: none;
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.status-group {
  display: flex;
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 3px;
  border: 1px solid var(--border);
}

.status-btn {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 500;
  background: transparent;
  border: none;
  color: var(--text-mute);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.5px;
}

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

.status-btn.active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.region-nav {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  gap: 8px;
  align-items: center;
}

.region-scroll-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  transition: all 0.15s;
}

.region-scroll-btn:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--accent-glow);
}

.region-scroll-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.region-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  min-width: 0;
}
.region-scroll::-webkit-scrollbar { display: none; }

.region-scroll:focus {
  outline: 1px solid var(--accent-dim);
  outline-offset: 4px;
  border-radius: var(--radius);
}

.chip {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.chip:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.chip.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

/* ========= GRID ========= */
.results-meta {
  max-width: 1100px;
  margin: 0 auto 16px;
  padding: 0 24px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-mute);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sort-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 8px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
}

.grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.muscle-card {
  appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: inherit;
  font: inherit;
  padding: 18px 20px;
  min-height: 88px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.muscle-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.muscle-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.muscle-card:hover::before { opacity: 1; }

.muscle-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-status {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.card-status.done { background: var(--success); }
.card-status.pending { background: var(--text-mute); }

.card-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
  padding-right: 16px;
  letter-spacing: 0;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.card-region {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 24px;
  color: var(--text-mute);
}

.empty-title {
  font-family: var(--serif);
  font-size: 24px;
  font-style: italic;
  margin-bottom: 8px;
  color: var(--text-dim);
}

.load-more-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 48px;
  display: flex;
  justify-content: center;
}

.load-more-wrap.hidden {
  display: none;
}

.load-more-btn {
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}

.load-more-btn:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--accent-glow);
}

/* ========= MODAL ========= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  margin: auto;
  padding: 32px;
  position: relative;
  animation: slideUp 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

.modal-title {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 4px;
  padding-right: 48px;
}

.modal-region {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 24px;
}

.modal-image-wrap {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  touch-action: none;
}

.modal-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 0 0;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

.image-placeholder {
  color: var(--text-mute);
  font-size: 13px;
  font-family: var(--mono);
  text-align: center;
  padding: 24px;
}

/* Zoom cursors: default at rest, grab/grabbing once enlarged */
.modal-image-wrap.zoomed .modal-image { cursor: grab; }
.modal-image-wrap.grabbing .modal-image { cursor: grabbing; }

.zoom-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: 2;
}

.zoom-controls button {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.zoom-controls button:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.zoom-hint {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 8px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.modal-image-wrap.zoomable:hover .zoom-hint {
  opacity: 1;
}

.fun-fact {
  background: linear-gradient(135deg, var(--accent-glow), rgba(216, 90, 48, 0.05));
  border: 1px solid rgba(216, 90, 48, 0.25);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 20px;
  position: relative;
}

.fun-fact::before {
  content: '★';
  position: absolute;
  top: 12px;
  left: 14px;
  color: var(--accent);
  font-size: 12px;
}

.fun-fact-text {
  padding-left: 22px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.6;
  color: #f0cfba;
}

.detail-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.detail-value {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}

/* ========= MODAL CROSS-LINKS ========= */
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.modal-action-btn {
  flex: 1;
  min-width: 150px;
  text-align: center;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.15s;
}

.modal-action-btn:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--accent-glow);
}

/* ========= INTRO HINT ========= */
.intro-hint {
  width: calc(100% - 48px);
  max-width: 1052px;
  margin: 0 auto 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--accent-glow), rgba(216, 90, 48, 0.04));
  border: 1px solid rgba(216, 90, 48, 0.25);
  border-radius: var(--radius);
}

.intro-hint[hidden] { display: none; }

.intro-hint-text {
  flex: 1;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}

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

.intro-hint-cta {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  padding: 8px 12px;
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  transition: all 0.15s;
}

.intro-hint-cta:hover { background: var(--accent-glow); }

.intro-hint-close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-mute);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.intro-hint-close:hover { color: var(--text); border-color: var(--border-hover); }

@media (max-width: 640px) {
  .intro-hint { width: calc(100% - 32px); flex-wrap: wrap; }
}

/* ========= FOOTER ========= */
.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 24px 48px;
}

.footer-card {
  background:
    linear-gradient(180deg, rgba(216, 90, 48, 0.06), transparent 28%),
    var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  color: var(--text-mute);
  line-height: 1.8;
  position: relative;
  overflow: hidden;
}

.footer-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.7;
}

.footer-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.footer-title {
  font-family: var(--serif);
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 10px;
}

.footer-copy {
  max-width: 620px;
  margin: 0 auto 20px;
  font-size: 14px;
}

.footer-title strong {
  color: var(--text-dim);
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-social {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  flex-wrap: wrap;
}

.footer-social a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.5px;
  transition: all 0.15s;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
}

.footer-social a:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--accent-glow);
}

.footer-disclaimer {
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 560px;
  margin: 0 auto 18px;
  padding: 14px 16px;
}

.footer-disclaimer-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.footer-disclaimer p {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0;
}

.footer-contact {
  font-size: 13px;
  margin: 0;
}

/* ========= TOAST ========= */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 300;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }

/* ========= MOBILE ========= */
@media (max-width: 640px) {
  .progress-wrap {
    margin-bottom: 12px;
    padding: 0 16px;
  }
  .progress-stats {
    justify-content: center;
    gap: 8px;
    margin: 0;
    font-size: 10px;
  }
  .progress-stats span + span::before { content: "\00b7\00a0"; }
  .progress-track { display: none; }
  .controls { gap: 9px; padding: 0 16px 12px; }
  .search-input { padding-top: 11px; padding-bottom: 11px; font-size: 14px; }
  .filter-row { display: none; }
  .region-nav { grid-template-columns: 32px minmax(0, 1fr) 32px; }
  .region-scroll-btn { width: 32px; height: 32px; font-size: 18px; }
  .region-scroll { gap: 6px; padding-bottom: 1px; }
  .chip { padding: 6px 11px; font-size: 12px; }
  .results-meta { margin-bottom: 10px; padding: 0 16px; }
  .grid { padding: 0 16px 20px; grid-template-columns: 1fr; }
  .load-more-wrap { padding: 0 16px 40px; }
  .modal { padding: 24px 20px; }
  .modal-title { font-size: 26px; }
  .site-footer { padding: 0 16px 40px; }
  .footer-card { padding: 24px 18px; }
}
