/* Art of the Day: header slot banner for AltAir.
   Started from Claude Design's banner; simplified for AltAir on 2026-11-19 (see README.md).
   All sizes are designed at a 100px-tall slot and scale with the slot's height
   (1cqh = 1px at 100px tall). The px value before each cqh line is the fallback
   for browsers without container query units. */

.aotd {
  --aotd-w: 400px;
  --aotd-h: 100px;
  --aotd-bg: #1d1912;
  --aotd-gold: #d4a945;
  --aotd-cream: #f4ead2;
  --aotd-serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --aotd-sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --aotd-soft: cubic-bezier(.25,.1,.25,1);

  position: relative;
  display: block;
  width: var(--aotd-w);
  height: var(--aotd-h);
  overflow: hidden;
  border-radius: 8px;
  background: var(--aotd-bg);
  color: var(--aotd-cream);
  text-decoration: none;
  isolation: isolate;
  container-type: size;
  -webkit-tap-highlight-color: transparent;
}
.aotd::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(212,169,69,.25);
  pointer-events: none;
}
.aotd *, .aotd *::before, .aotd *::after { box-sizing: border-box; }

/* The painting. Until play() sizes it, it just covers the slot; then art-of-the-day.js sets its
   width and height (the whole painting, zoomed) and pans it with a transform. */
.aotd-art {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  will-change: transform;
}
.aotd-art.is-sized { object-fit: fill; }
/* Darkens the painting toward the middle, so the title reads on any painting */
.aotd-scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 90% at 50% 50%, rgba(10,8,5,.6), rgba(10,8,5,.25));
}

.aotd-ttl {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 2px rgba(0,0,0,.8), 0 0 14px rgba(0,0,0,.6);
}
.aotd-tt {
  font-family: var(--aotd-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 38px; font-size: 38cqh;
  line-height: 1;
  white-space: nowrap;
  color: var(--aotd-cream);
}
.aotd-ru {
  display: block;
  width: 145px; width: 145cqh;
  height: 1.5px; height: 1.5cqh;
  margin-top: 6px; margin-top: 6cqh;
  background: linear-gradient(90deg, rgba(212,169,69,0), var(--aotd-gold), rgba(212,169,69,0));
}
.aotd-cta {
  margin-top: 8px; margin-top: 8cqh;
  font: 600 12px/1 var(--aotd-sans);
  font-size: 12cqh;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #f6e3ae;
}
.aotd:focus-visible { outline: 2px solid var(--aotd-gold); outline-offset: 2px; }
.aotd:hover .aotd-cta, .aotd:focus-visible .aotd-cta { color: #fff3cf; }

/* ---------- The sequence (12 s), runs while .is-playing is on ----------
   0-12     the painting pans along random legs (art-of-the-day.js, not CSS)
   0.3-2.2  the title clears slowly from a soft blur; the rule draws out from the middle
   2.0-2.8  "Click to view" fades in under it and stays */
.aotd.is-playing .aotd-scrim { animation: aotd-fade 1.2s ease-out both; }
.aotd.is-playing .aotd-tt { animation: aotd-elegant 1.9s var(--aotd-soft) .3s both; }
.aotd.is-playing .aotd-ru { animation: aotd-grow 1.4s var(--aotd-soft) 1s both; }
.aotd.is-playing .aotd-cta { animation: aotd-fade .8s ease-out 2s both; }

@keyframes aotd-elegant {
  /* no movement: the words appear exactly where they stay */
  from { opacity: 0; filter: blur(3px); }
  60% { filter: blur(0); }
  to { opacity: 1; filter: none; }
}
@keyframes aotd-grow { from { transform: scaleX(0); } to { transform: none; } }
@keyframes aotd-fade { from { opacity: 0; } to { opacity: 1; } }

/* Reduced motion: no pan (art-of-the-day.js centres the painting) or blur. The still painting with the title, and "Click to
   view" appears at two seconds. */
@media (prefers-reduced-motion: reduce) {
  .aotd.is-playing .aotd-scrim,
  .aotd.is-playing .aotd-tt,
  .aotd.is-playing .aotd-ru { animation: none; }
  .aotd.is-playing .aotd-cta { animation: aotd-fade .01s linear 2s both; }
}
