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

:root {
  --burgundy: #6d1a36;
  --wine: #4a0f24;
  --pink: #f4a7c0;
  --blush: #fde4ec;
  --lavender: #ece4f7;
  --white: #ffffff;
  --text: #2a1420;
  --error: #b00020;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--lavender);
}

h1,
h2,
h3 {
  font-family: "Fraunces", serif;
  line-height: 1.15;
}

.skip-link {
  position: absolute;
  left: -999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 999px;
}

:focus-visible {
  outline: 3px solid var(--burgundy);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--pink);
}

.site-header {
  background: var(--burgundy);
  color: var(--white);
  padding: 2rem 1rem 3rem;
  border-radius: 0 0 2rem 2rem;
}

.site-header h1 {
  font-size: clamp(2rem, 7vw, 3.5rem);
  font-weight: 800;
  color: var(--blush);
  margin: 0 0 1rem;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: block;
  color: var(--white);
  text-decoration: none;
  padding: 0.4rem 1rem;
  border: 2px solid var(--pink);
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}

.nav-list a:hover {
  background: var(--pink);
  color: var(--wine);
}

main {
  padding: 1rem;
  margin-top: -1.5rem;
}

section {
  background: var(--white);
  border-left: 6px solid var(--pink);
  border-radius: 1.5rem;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

h2 {
  font-size: 1.75rem;
  color: var(--burgundy);
  margin-top: 0;
}

.site-footer {
  background: var(--wine);
  color: var(--blush);
  text-align: center;
  padding: 1.5rem;
}

.stats-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stat-card {
  background: var(--blush);
  border-radius: 1rem;
  padding: 1rem;
}

.stat-label {
  margin: 0;
}

.stat-value {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--burgundy);
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 140px;
}

.bar {
  flex: 1;
  background: var(--burgundy);
  border-radius: 0.5rem 0.5rem 0 0;
  transition: height 0.5s ease;
}

.cap-message.over {
  color: var(--error);
  font-weight: 600;
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

input,
select {
    font: inherit;
    padding: 0.6rem 0.8rem;
    border: 2px solid var(--lavender);
    border-radius: 0.75rem;
}

button {
  font: inherit;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  background: var(--burgundy);
  color: var(--white);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: var(--wine);
}

.error {
  color: var(--error);
  margin: 0.25rem 0 0;
}

mark {
  background: var(--pink);
  color: var(--wine);
  border-radius: 0.25rem;
}

.records-table thead {
  display: none;
}

.records-table tr {
  display: block;
  border: 2px solid var(--lavender);
  border-radius: 1rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.records-table td {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none;
  }
}

@media (min-width: 360px) {
  main {
    padding: 1.25rem;
  }
}

@media (min-width: 768px) {
  .stats-grid {
    flex-direction: row;
  }

  .stat-card {
    flex: 1;
  }

  .records-table {
    width: 100%;
    border-collapse: collapse;
  }

  .records-table thead {
    display: table-header-group;
  }

  .records-table tr {
    display: table-row;
    border: none;
  }

 .records-table th,
 .records-table td {
    display: table-cell;
    padding: 0.75rem;
    text-align: left;
    border-bottom: 2px solid var(--lavender);
 }
}

@media (min-width: 1024px) {
  main {
    max-width: 960px;
    margin: -1.5rem auto 0;
  }
}