:root {
  --bg: #f4efe7;
  --bg-soft: #fbf7f1;
  --ink: #13202c;
  --muted: #5b6772;
  --line: rgba(19, 32, 44, 0.1);
  --line-strong: rgba(19, 32, 44, 0.2);
  --card: rgba(255, 255, 255, 0.88);
  --card-strong: rgba(255, 255, 255, 0.96);
  --accent: #f0563d;
  --accent-deep: #bb402c;
  --teal: #0f766e;
  --teal-soft: rgba(15, 118, 110, 0.12);
  --gold: #f2c063;
  --shadow: 0 24px 60px rgba(20, 31, 39, 0.14);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Helvetica Neue", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(240, 86, 61, 0.2), transparent 32%),
    radial-gradient(circle at right 10% top 18%, rgba(15, 118, 110, 0.18), transparent 26%),
    linear-gradient(180deg, #f8f4ee 0%, #f4efe7 52%, #efe7dc 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  z-index: 0;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(12px);
  opacity: 0.6;
}

body::before {
  width: 18rem;
  height: 18rem;
  top: 4rem;
  right: -4rem;
  background: rgba(242, 192, 99, 0.25);
}

body::after {
  width: 14rem;
  height: 14rem;
  bottom: 7rem;
  left: -3rem;
  background: rgba(15, 118, 110, 0.18);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100% - 1.25rem));
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.hero,
.toolbar,
.recorded-panel,
.grid-section {
  animation: rise-in 420ms ease both;
}

.hero {
  display: grid;
  gap: 1.25rem;
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(19, 32, 44, 0.96), rgba(19, 32, 44, 0.82)),
    linear-gradient(120deg, rgba(240, 86, 61, 0.18), rgba(15, 118, 110, 0.15));
  color: #fdfbf8;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-copy {
  max-width: 42rem;
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(253, 251, 248, 0.68);
}

.hero h1,
.section-heading h2 {
  margin: 0;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  letter-spacing: -0.05em;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  line-height: 0.95;
}

.lede {
  margin: 1rem 0 0;
  max-width: 38rem;
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(253, 251, 248, 0.76);
}

.hero-metrics {
  display: grid;
  gap: 1rem;
}

.metric-card {
  display: grid;
  gap: 0.4rem;
  padding: 1.1rem 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.metric-card-primary {
  background:
    linear-gradient(140deg, rgba(240, 86, 61, 0.17), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.08);
}

.metric-label {
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(253, 251, 248, 0.66);
}

.metric-value {
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1;
}

.metric-value-small {
  font-size: 1.5rem;
}

.metric-detail {
  color: rgba(253, 251, 248, 0.74);
}

.toolbar,
.recorded-panel,
.grid-section {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 30px rgba(26, 35, 42, 0.08);
}

.toolbar {
  display: grid;
  gap: 0.9rem;
}

.action-row,
.filter-row,
.recorded-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.control-button,
.filter-button,
.chip {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.control-button,
.filter-button {
  padding: 0.9rem 1rem;
  font-size: 0.96rem;
  font-weight: 600;
}

.control-button:hover,
.filter-button:hover,
.chip:hover,
.card-toggle:hover {
  transform: translateY(-1px);
}

.filter-button.is-active {
  border-color: rgba(19, 32, 44, 0.16);
  background: linear-gradient(145deg, var(--ink), #203241);
  color: #fff;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.section-kicker {
  color: rgba(19, 32, 44, 0.46);
}

.section-copy {
  margin: 0;
  max-width: 36rem;
  color: var(--muted);
  line-height: 1.5;
}

.recorded-chips:empty::before {
  content: "Nothing logged yet. Pick a date and start entering sets.";
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.95rem;
}

.chip strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(240, 86, 61, 0.12);
  color: var(--accent-deep);
  font-size: 0.86rem;
}

.grid-section {
  position: relative;
}

.visible-note {
  color: var(--muted);
}

.empty-state {
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
}

.day-grid {
  display: grid;
  gap: 0.9rem;
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.day-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(252, 248, 241, 0.9));
  box-shadow: 0 14px 28px rgba(26, 35, 42, 0.08);
  overflow: hidden;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.day-card.is-recorded {
  border-color: rgba(15, 118, 110, 0.22);
}

.day-card.is-recorded::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--teal), #61b7a9);
}

.day-card.is-expanded {
  grid-column: 1 / -1;
  box-shadow: 0 22px 40px rgba(26, 35, 42, 0.12);
}

.day-card.is-hidden {
  display: none;
}

.card-toggle {
  width: 100%;
  display: grid;
  gap: 0.65rem;
  padding: 1rem;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
}

.card-step {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(19, 32, 44, 0.46);
}

.card-heading {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: start;
}

.card-heading-text {
  display: grid;
  gap: 0.3rem;
}

.card-date-label {
  font-size: 1rem;
  line-height: 1.2;
}

.card-total-inline {
  color: var(--muted);
  font-size: 0.92rem;
}

.card-toggle-pill {
  flex-shrink: 0;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(19, 32, 44, 0.06);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
}

.card-body {
  display: grid;
  gap: 1rem;
  padding: 0 1rem 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field-label,
.set-note {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(19, 32, 44, 0.52);
}

.date-input,
.set-input {
  width: 100%;
  border: 1px solid rgba(19, 32, 44, 0.12);
  border-radius: var(--radius-sm);
  background: var(--card-strong);
  color: var(--ink);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.date-input {
  min-height: 3.3rem;
  padding: 0.9rem 1rem;
}

.date-input:focus-visible,
.set-input:focus-visible,
.control-button:focus-visible,
.filter-button:focus-visible,
.chip:focus-visible,
.card-toggle:focus-visible {
  outline: none;
  border-color: rgba(240, 86, 61, 0.62);
  box-shadow: 0 0 0 4px rgba(240, 86, 61, 0.14);
}

.total-box {
  display: grid;
  place-items: center;
  gap: 0.45rem;
  min-height: 8rem;
  padding: 1rem;
  border: 1px solid rgba(19, 32, 44, 0.08);
  border-radius: 22px;
  background:
    radial-gradient(circle at top, rgba(240, 86, 61, 0.12), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 241, 233, 0.92));
  text-align: center;
}

.total-box span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 700;
}

.daily-total {
  font-size: clamp(2.2rem, 10vw, 3.4rem);
  line-height: 1;
}

.set-grid {
  display: grid;
  gap: 0.65rem;
}

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

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

.set-input {
  min-height: 3.45rem;
  padding: 0.5rem;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
}

.card-helper {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (min-width: 720px) {
  .app-shell {
    width: min(1440px, calc(100% - 2rem));
    padding-top: 1.25rem;
  }

  .hero {
    grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 22rem);
    align-items: end;
    padding: 1.8rem;
  }

  .toolbar,
  .recorded-panel,
  .grid-section {
    padding: 1.15rem;
  }

  .day-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }

  .day-card.is-expanded {
    grid-column: span 2;
  }
}

@media (min-width: 1120px) {
  .day-grid {
    gap: 1rem;
  }

  .day-card.is-expanded {
    grid-column: span 2;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 0.8rem, 100%);
  }

  .hero,
  .toolbar,
  .recorded-panel,
  .grid-section {
    border-radius: 24px;
    padding: 0.95rem;
  }

  .action-row,
  .filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .control-button:first-child {
    grid-column: 1 / -1;
  }

  .control-button,
  .filter-button {
    justify-content: center;
    text-align: center;
  }

  .card-toggle {
    padding: 0.9rem;
  }

  .card-body {
    padding: 0 0.9rem 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
