:root {
  --bg: #fff8ec;
  --ink: #2b1d0e;
  --muted: #7a6249;
  --card: #ffffff;
  --line: #f1e0c4;
  --sun: #ffb020;
  --sun-deep: #ff7a1a;
  --sky: #3a7bff;
  --radius: 18px;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17120c; --ink: #fbefe0; --muted: #c4a988;
    --card: #231b12; --line: #3a2d1e; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: inherit; }

.hero { text-align: center; padding: 40px 16px 16px; position: relative; overflow: hidden; }
.sun {
  width: 84px; height: 84px; margin: 0 auto 8px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fff3b0, var(--sun) 55%, var(--sun-deep));
  box-shadow: 0 0 0 10px #ffb02033, 0 0 0 22px #ffb02018, 0 0 60px #ff7a1a66;
  animation: glow 4s ease-in-out infinite;
}
@keyframes glow { 50% { box-shadow: 0 0 0 14px #ffb02033, 0 0 0 30px #ffb02014, 0 0 80px #ff7a1a88; } }
@media (prefers-reduced-motion: reduce) { .sun { animation: none; } }
h1 { font-size: clamp(2rem, 7vw, 3.4rem); margin: 8px 0 4px; letter-spacing: -0.02em; }
.tagline { margin: 0; color: var(--muted); font-size: 1.1rem; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button {
  font: inherit; font-weight: 700; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--line); background: var(--card); color: var(--ink);
}
.chips button[aria-pressed="true"] { background: var(--sun); border-color: var(--sun); color: #2b1d0e; }
#search {
  font: inherit; padding: 10px 14px; border-radius: 999px; min-width: 0; flex: 1 1 200px; max-width: 320px;
  border: 2px solid var(--line); background: var(--card); color: var(--ink);
}

.status { text-align: center; color: var(--muted); padding: 40px 0; }
.grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card a {
  display: flex; flex-direction: column; height: 100%; text-decoration: none;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card a:hover, .card a:focus-visible { transform: translateY(-4px); box-shadow: 0 10px 24px #ff7a1a2a; outline: none; border-color: var(--sun); }
.art { position: relative; aspect-ratio: 16 / 10; background: var(--line); }
.art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art.fallback {
  display: grid; place-items: center; font-size: 3.4rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 85% 58%), hsl(calc(var(--h) + 40) 85% 48%));
}
.badge {
  position: absolute; top: 10px; left: 10px; background: var(--sky); color: #fff;
  font-size: .75rem; font-weight: 800; padding: 4px 9px; border-radius: 999px; letter-spacing: .05em;
}
.body { padding: 12px 14px 16px; }
.body h2 { font-size: 1.15rem; margin: 0 0 2px; }
.by { margin: 0 0 6px; color: var(--sun-deep); font-weight: 700; font-size: .9rem; }
.desc { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.35; }

.foot { text-align: center; padding: 32px 16px 48px; color: var(--muted); font-size: .9rem; }
.tip {
  display: inline-block; margin-bottom: 14px; padding: 12px 22px; border-radius: 999px; text-decoration: none;
  background: var(--sun); color: #2b1d0e; font-weight: 800;
}
.tip[hidden] { display: none; }

.page { max-width: 680px; margin: 0 auto; padding: 32px 16px 64px; line-height: 1.6; }
.page h1 { font-size: 2rem; }
