:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --text: #1c1917;
  --muted: #57534e;
  --line: #e7e5e4;
  --accent: #0f766e;
  --accent-hover: #0d9488;
  --shadow: 0 1px 2px rgb(28 25 23 / 6%), 0 8px 24px rgb(28 25 23 / 6%);
  --content: min(1120px, calc(100% - 2rem));
  --radius: 12px;
  --font: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --ui: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ui);
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -10%, #dbeafe 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, #fde68a55 0%, transparent 50%),
    var(--bg);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent-hover);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  width: var(--content);
  margin: 0 auto;
  padding: 1.1rem 0 1rem;
}

.brand {
  margin: 0 0 0.35rem;
  font-family: var(--font);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand a {
  color: inherit;
  text-decoration: none;
}

.site-header h1 {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 500;
  color: var(--muted);
}

.lede {
  margin: 0.45rem 0 0;
  color: var(--muted);
  max-width: 42rem;
  line-height: 1.45;
}

.toolbar {
  width: var(--content);
  margin: 1rem auto 0;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

#album-search {
  flex: 1 1 16rem;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

main {
  width: var(--content);
  margin: 1.25rem auto 2.5rem;
}

.status {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  box-shadow: var(--shadow);
}

.status.error {
  color: #9f1239;
  border-color: #fecdd3;
  background: #fff1f2;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.album-card {
  display: block;
  color: inherit;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.album-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgb(28 25 23 / 8%), 0 14px 28px rgb(28 25 23 / 10%);
}

.album-cover {
  aspect-ratio: 1;
  background:
    linear-gradient(145deg, #e7e5e4, #f5f5f4 45%, #d6d3d1);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.album-cover .placeholder {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1rem;
  text-align: center;
}

.album-meta {
  padding: 0.75rem 0.85rem 0.9rem;
}

.album-meta h2 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.3;
  font-weight: 600;
}

.album-meta p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.media-tile {
  margin: 0;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #e7e5e4;
  border: 1px solid var(--line);
}

.media-tile img,
.media-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.back-link {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
}

@media (prefers-reduced-motion: reduce) {
  .album-card {
    transition: none;
  }
}
