:root {
  --bg: #fffdf6;
  --bg-soft: #f5f9ff;
  --text: #15233b;
  --muted: #4f5f79;
  --surface: #ffffff;
  --border: #dde5f3;
  --accent: #0c7a6a;
  --accent-soft: #d7f4ec;
  --button: #eef3fd;
  --button-hover: #dfe9fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Avenir Next", "Trebuchet MS", "Gill Sans", sans-serif;
  background:
    radial-gradient(circle at 12% 12%, #e5f3ff 0, #e5f3ff 22%, transparent 26%),
    radial-gradient(circle at 88% 0%, #e7f8ef 0, #e7f8ef 18%, transparent 24%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
}

.background-shape {
  position: fixed;
  inset: auto -8rem -12rem auto;
  width: 22rem;
  height: 22rem;
  border-radius: 40% 60% 56% 44%;
  background: linear-gradient(180deg, #f3fbff, #d9efff);
  opacity: 0.6;
  pointer-events: none;
}

.container {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  padding: 2.5rem 0 1rem;
  position: relative;
}

.coffee-link {
  position: absolute;
  right: 0;
  top: 0.4rem;
  text-decoration: none;
  color: #083f70;
  font-weight: 700;
  font-size: 0.88rem;
  background: linear-gradient(180deg, #f2f8ff, #ddedff);
  border: 1px solid #b7d9ff;
  border-radius: 999px;
  padding: 0.45rem 0.78rem;
  box-shadow: 0 6px 14px rgba(24, 93, 153, 0.2);
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.coffee-link:hover {
  background: linear-gradient(180deg, #e8f4ff, #d4e9ff);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(24, 93, 153, 0.24);
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.82rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.05;
  font-family: "Rockwell", "Georgia", serif;
}

.subhead {
  margin: 0.8rem 0 0;
  color: var(--muted);
  max-width: 62ch;
}

.layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: 320px 1fr;
  padding: 1rem 0 2rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 10px 24px rgba(43, 66, 112, 0.08);
}

.controls {
  position: sticky;
  top: 1rem;
  align-self: start;
}

.field-row {
  margin-bottom: 0.9rem;
}

.field-row label {
  display: block;
  font-size: 0.84rem;
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-weight: 700;
}

input[type="search"],
select,
input[type="range"] {
  width: 100%;
}

input[type="search"],
select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.62rem 0.7rem;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.year-btn {
  border: 1px solid var(--border);
  background: var(--button);
  color: var(--text);
  cursor: pointer;
  transition: background-color 120ms ease;
}

.year-btn:hover {
  background: var(--button-hover);
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
  max-height: 290px;
  overflow: auto;
  padding-right: 0.2rem;
}

.year-btn {
  border-radius: 8px;
  padding: 0.4rem 0.3rem;
  font-size: 0.84rem;
}

.year-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: #9cd9cc;
  font-weight: 700;
}

.summary {
  display: flex;
  gap: 0.7rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.summary h2 {
  margin: 0;
  font-size: 1.42rem;
}

#year-meta {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.number-one {
  min-width: 210px;
  border: 1px solid #b8e6da;
  background: linear-gradient(145deg, #f5fffc, #e9fbf3);
  border-radius: 12px;
  padding: 0.7rem;
}

.small-label {
  margin: 0;
  color: #2e5f56;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#number-one-song {
  margin: 0.35rem 0 0.2rem;
  font-weight: 700;
}

#number-one-artist {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 0.52rem 0.35rem;
  border-bottom: 1px solid #edf1f8;
}

.rank-col {
  width: 78px;
}

tbody tr:hover {
  background: #f8fbff;
}

.song-title {
  font-weight: 700;
}

.site-footer {
  padding: 0 0 2.2rem;
  color: var(--muted);
}

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

  .controls {
    position: static;
  }

  .summary {
    flex-direction: column;
  }

  .number-one {
    width: 100%;
    min-width: 0;
  }

  .coffee-link {
    position: static;
    display: inline-block;
    margin-bottom: 0.8rem;
  }
}
