@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Space+Grotesk:wght@400;500;600&display=swap");

:root {
  color-scheme: light;
  --ink: #1f1b16;
  --muted: #6a6258;
  --sand: #f3ede2;
  --clay: #e0d3c0;
  --amber: #c6763e;
  --forest: #1d4636;
  --sage: #b9c2ad;
  --card: #faf6f0;
  --shadow: 0 20px 50px rgba(30, 25, 20, 0.12);
}

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

body {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: var(--sand);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: "Fraunces", "Georgia", serif;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.4rem, 3vw + 1rem, 3.6rem);
  margin-bottom: 0.6rem;
}

h2 {
  font-size: clamp(1.6rem, 1.5vw + 1rem, 2.2rem);
  margin-bottom: 0.4rem;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

p {
  line-height: 1.6;
  color: var(--muted);
}

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

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
}

.orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0.35;
  filter: blur(0px);
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle at 30% 30%, #f5d8b4, #c5874e);
  top: -140px;
  left: -120px;
}

.orb-2 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle at 70% 30%, #d5e3c4, #5f7c5f);
  bottom: -220px;
  right: -180px;
}

.grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(transparent 96%, rgba(0, 0, 0, 0.04) 97%),
    linear-gradient(90deg, transparent 96%, rgba(0, 0, 0, 0.04) 97%);
  background-size: 48px 48px;
  opacity: 0.35;
}

.hero {
  padding: 4.5rem 6vw 2rem;
}

.hero-inner {
  max-width: 900px;
  margin: 0 auto;
  animation: fadeUp 0.8s ease-out both;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--forest);
  color: #fdf8f2;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

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

.container {
  max-width: 1100px;
  margin: 0 auto 4rem;
  padding: 0 6vw;
}

.card {
  background: var(--card);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  animation: fadeUp 0.9s ease-out both;
}

.app-card {
  display: none;
}

.card-header {
  margin-bottom: 1.5rem;
}

.card-header.split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.actions {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.95rem;
}

.field.compact {
  min-width: 160px;
}

input, select {
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--clay);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}

.btn {
  border: none;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--amber);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 20px rgba(198, 118, 62, 0.24);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 24px rgba(198, 118, 62, 0.28);
}

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

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.2rem;
}

.rules-grid h3 {
  margin-bottom: 0.4rem;
}

.rules-note {
  font-size: 0.85rem;
  color: var(--muted);
}

.mobile-bar {
  display: none;
}

.status {
  min-height: 1.25rem;
  color: var(--forest);
  font-weight: 600;
  margin-bottom: 1rem;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.score-card {
  background: linear-gradient(140deg, #fffdf8, #f1e6d8);
  border-radius: 24px;
  padding: 1.5rem;
  border: 1px solid #e6d7c4;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.goal-line {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.monthly-line {
  font-size: 0.88rem;
  color: var(--forest);
  line-height: 1.4;
  background: #f6efe4;
  border: 1px solid #e6d7c4;
  padding: 0.6rem 0.75rem;
  border-radius: 14px;
}

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

.score-card .role {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.points {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.points span {
  font-size: 2.2rem;
  font-weight: 700;
}

.points small {
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e6d7c4;
  font-size: 0.8rem;
  color: var(--forest);
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem 1rem;
  font-size: 0.9rem;
}

.entries {
  border-top: 1px dashed #d8c8b2;
  padding-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.entry {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.divider {
  margin: 2rem 0;
  height: 1px;
  background: #e4d7c7;
}

.log-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(260px, 1fr);
  gap: 2rem;
}

.workout-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.workout-item {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #eadfce;
  padding: 0.8rem 1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 0.9rem;
}

.workout-item span {
  color: var(--muted);
  font-size: 0.82rem;
}

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

.footer {
  text-align: center;
  padding: 2rem 0 3rem;
  color: var(--muted);
}

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

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

@media (max-width: 700px) {
  body {
    padding-bottom: 5.5rem;
  }

  .container {
    padding: 0 1rem;
  }

  .card {
    padding: 1.25rem;
    border-radius: 20px;
    margin-bottom: 1.25rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-header.split {
    flex-direction: column;
    align-items: flex-start;
  }

  .actions {
    width: 100%;
  }

  .actions .field.compact,
  .actions .btn {
    width: 100%;
  }

  .scoreboard {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
  }

  .score-card {
    min-width: 78vw;
    scroll-snap-align: start;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    gap: 0.6rem;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    background: rgba(250, 246, 240, 0.96);
    border-top: 1px solid #e6d7c4;
    box-shadow: 0 -10px 30px rgba(30, 25, 20, 0.12);
    backdrop-filter: blur(12px);
    z-index: 5;
  }

  .mobile-bar .btn {
    flex: 1;
    padding: 0.65rem 0.9rem;
    font-size: 0.92rem;
  }
}
