:root {
  color-scheme: dark;
  --bg: #0c0f12;
  --panel: #141922;
  --panel-strong: #1b2230;
  --ink: #f2f1ed;
  --muted: #a7a4a1;
  --accent: #f16c3a;
  --accent-dark: #ff9c7a;
  --mint: #41c5b7;
  --border: #2a3242;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --radius-sm: 12px;
  --pad: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: radial-gradient(circle at top right, rgba(241, 108, 58, 0.15) 0%, transparent 55%),
    radial-gradient(circle at 20% 20%, rgba(65, 197, 183, 0.18) 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.bg-orbit {
  position: fixed;
  inset: -30% auto auto -30%;
  width: 70vmin;
  height: 70vmin;
  background: conic-gradient(from 180deg, rgba(241, 108, 58, 0.2), rgba(65, 197, 183, 0.25), transparent 70%);
  filter: blur(40px);
  opacity: 0.6;
  pointer-events: none;
  z-index: -1;
}

h1,
h2 {
  font-family: "Fraunces", "Times New Roman", serif;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.3rem, 3vw, 2rem);
}

p {
  margin: 0;
}

main {
  max-width: 1100px;
  margin: 0 auto 80px;
  padding: 0 20px;
}

.hero {
  max-width: 1100px;
  margin: 40px auto 30px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--accent-dark);
}

.hero__sub {
  max-width: 600px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 1rem;
}

.hero__stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat {
  background: var(--panel);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  min-width: 120px;
  box-shadow: var(--shadow);
}

.stat__label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.stat__value {
  font-size: 1.5rem;
  font-weight: 700;
}

.controls {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  gap: 20px;
}

.search-section {
  margin-top: 20px;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 20px 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.search__label {
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.search__field {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.search input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 1rem;
  background: #0f141d;
  color: var(--ink);
}

.search input:focus {
  outline: 2px solid rgba(241, 108, 58, 0.3);
  border-color: var(--accent);
}

.filters {
  display: grid;
  gap: 18px;
}

.filter-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.filter-group h2 {
  margin-bottom: 10px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  background: #0f141d;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--ink);
}

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 10px 25px rgba(241, 108, 58, 0.25);
}

.chip-row--equipment .chip.is-active {
  background: var(--mint);
  border-color: var(--mint);
  color: #071113;
  box-shadow: 0 12px 25px rgba(65, 197, 183, 0.3);
}

.chip-row--areas .chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a0f0a;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
}

button {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: white;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(241, 108, 58, 0.25);
}

button.ghost {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--border);
  box-shadow: none;
}

button.ghost:hover {
  background: var(--panel-strong);
  transform: none;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.workout {
  margin-top: 30px;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.workout__controls {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
}

.workout__controls input[type="range"] {
  width: 100%;
}

.workout__controls input[type="number"] {
  width: 70px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #0f141d;
  color: var(--ink);
}

.card-grid--workout {
  grid-template-columns: 1fr;
}

.results {
  margin-top: 30px;
}

.results__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.card-grid {
  display: grid;
  gap: 16px;
}

.exercise-card {
  background: #0f141d;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 0;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
  animation: floatIn 0.4s ease both;
  overflow: hidden;
  cursor: pointer;
}

.exercise-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 4px 10px;
  background: rgba(241, 108, 58, 0.18);
  border: 1px solid rgba(241, 108, 58, 0.4);
  border-radius: 999px;
  font-size: 0.8rem;
  color: #ffb49a;
}

.tag--equipment {
  background: rgba(65, 197, 183, 0.18);
  border-color: rgba(65, 197, 183, 0.5);
  color: #9ff2e7;
}

.tag--muscle {
  background: rgba(241, 108, 58, 0.2);
  border-color: rgba(241, 108, 58, 0.45);
  color: #ffb49a;
}

.card-section {
  font-size: 0.95rem;
  color: var(--muted);
}

.card-section strong {
  color: var(--ink);
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 720px) {
  .controls {
    grid-template-columns: 1fr 1.2fr;
  }

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

  .card-grid--workout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal__body {
    grid-template-columns: 1fr 1.2fr;
    align-items: start;
  }
}

@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  .workout__controls {
    grid-template-columns: 1fr;
  }

  .search__field {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
.exercise-card__media {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0b0f16;
  overflow: hidden;
}

.exercise-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.exercise-card__body {
  padding: 16px 18px 20px;
  display: grid;
  gap: 10px;
}

.exercise-card__meta {
  display: grid;
  gap: 6px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.modal.is-open {
  display: flex;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 14, 0.75);
  backdrop-filter: blur(6px);
}

.modal__content {
  position: relative;
  width: min(960px, 92vw);
  max-height: 88vh;
  overflow: hidden;
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.modal__close {
  align-self: flex-end;
  margin: 16px;
}

.modal__body {
  display: grid;
  gap: 18px;
  padding: 0 20px 24px;
  overflow: auto;
}

.modal__media img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.modal__details h2 {
  margin-top: 0;
}

.modal__section h3 {
  margin: 16px 0 6px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.modal__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.modal__links a {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--accent-dark);
  text-decoration: none;
  background: #0f141d;
}

.modal__links a:hover {
  border-color: var(--accent-dark);
}
.results__footer {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}
