*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--page);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at top, var(--page-glow), var(--page) 60%) no-repeat;
  color: var(--text);
  /* Same stack as the main site's body text. */
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    'Noto Sans',
    sans-serif;
  line-height: 1.4;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Header and piano mirror src/components/Header.tsx and PianoKeyBrand.tsx: 16px padding, a 36px
   row, a 24px bold title and a 52px piano starting 10px above the title's bottom edge. */
.site-header {
  border-bottom: 1px solid var(--border);
  border-bottom-color: color-mix(in srgb, var(--border) 50%, transparent);
  background: var(--page);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 34rem;
  /* 36px row plus 16px padding above and below. */
  min-height: 4.25rem;
  margin: 0 auto;
  padding: 1rem max(1rem, env(safe-area-inset-right)) 1rem max(1rem, env(safe-area-inset-left));
}

.brand-link {
  position: relative;
  display: inline-block;
  text-decoration: none;
}

.brand-name {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.5rem;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.brand-accent {
  color: var(--accent);
}

.brand-piano {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 52px;
  margin-top: -10px;
  min-width: 100px;
}

.brand-piano svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-label {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.5rem;
  color: var(--text-muted);
}

.links-page {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: 2.25rem max(1rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
}

.slogan {
  margin: 0 0 1rem;
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--text-muted);
  text-align: center;
}

/* One row that scrolls sideways when the tags do not fit; auto margins keep it centered otherwise. */
.tag-filters {
  display: flex;
  gap: 0.375rem;
  margin: -0.25rem -1rem 0.625rem;
  padding: 0.25rem 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.tag-filters::-webkit-scrollbar {
  display: none;
}

.tag-filters button:first-child {
  margin-left: auto;
}

.tag-filters button:last-child {
  margin-right: auto;
}

.tag-filters[hidden] {
  display: none;
}

.tag-filters button {
  flex: none;
  min-height: 2.25rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.tag-filters button[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.link-list {
  display: grid;
  gap: 0.625rem;
}

.link-card {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.625rem 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--card);
  box-shadow: 0 0.5rem 1.5rem var(--shadow);
}

.link-card[hidden] {
  display: none;
}

.thumb {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 0.375rem;
  object-fit: cover;
  background: var(--surface);
}

.card-body {
  min-width: 0;
  align-self: center;
}

.card-body p {
  margin: 0;
}

.tag {
  color: var(--accent-text);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-title {
  margin: 0.1rem 0;
  font-size: 1rem;
  line-height: 1.25;
}

.card-copy {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
}

.action {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  height: 2.25rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
}

/* Calm outline style: the red stays an accent instead of filling the button. */
.action-primary {
  border-color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  background: var(--card);
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  color: var(--text);
}

.action-primary:hover {
  border-color: var(--accent);
  background: var(--surface);
  background: color-mix(in srgb, var(--accent) 22%, var(--card));
}

/* Spotify and Apple Music match the main site's streaming buttons. */
.action-spotify,
.action-apple-music {
  color: var(--on-streaming);
  font-size: 10px;
}

.action-spotify {
  background: var(--spotify);
}

.action-spotify:hover {
  background: var(--spotify-hover);
}

.action-apple-music {
  background: var(--apple-music);
}

.action-apple-music:hover {
  background: var(--apple-music-hover);
}

.action-icon {
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  fill: currentColor;
}

footer {
  margin-top: 1.75rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

footer p {
  margin: 0 0 0.5rem;
}

footer nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .action,
  .tag-filters button {
    transition:
      background-color 150ms ease,
      border-color 150ms ease;
  }
}
