/* The recipes page's seasonal hero (assets/season/season-hero.js).
 * A sky in the season's colours that melts into the page, one tree through the year on the right
 * (.sh-scene) and, across the whole band, whatever the season lets fall (.sh-fall). */
.sh {
  --sh-a: #f4e4d1; --sh-b: #e6c3a3; --sh-ink: #3a2219; --sh-soft: #6b4a3a; --sh-accent: #a8552b;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: clamp(480px, 70vh, 680px);
  color: var(--sh-ink);
  background:
    radial-gradient(60% 70% at 85% 10%, var(--sh-b) 0%, transparent 70%),
    linear-gradient(to bottom, var(--sh-a) 0%, var(--sh-a) 45%, var(--ivory, #f5f2ee) 100%);
}
.sh[data-season="spring"] { --sh-a: #e9f0de; --sh-b: #f6dfe4; --sh-ink: #2e3a2a; --sh-soft: #556252; --sh-accent: #8a5f86; }
.sh[data-season="summer"] { --sh-a: #dcebf2; --sh-b: #f8e7c2; --sh-ink: #1e3341; --sh-soft: #45606f; --sh-accent: #b8702f; }
.sh[data-season="autumn"] { --sh-a: #f4e2cc; --sh-b: #ebc39d; --sh-ink: #3a2219; --sh-soft: #6b4a3a; --sh-accent: #a8552b; }
.sh[data-season="winter"] { --sh-a: #d3dbe7; --sh-b: #bcc7d8; --sh-ink: #1f2636; --sh-soft: #46506a; --sh-accent: #4f6694; }

.sh > .container { width: 100%; }
.sh-inner {
  flex: 1;
  display: flex;
  align-items: center;
  padding-top: clamp(24px, 4vw, 48px);
  padding-bottom: clamp(56px, 8vw, 110px);
}
.sh-inner[hidden] { display: none; }
.sh-copy { max-width: min(560px, 48%); }

/* ── The tree ── */
.sh-scene {
  position: absolute; z-index: -1; pointer-events: none;
  right: max(0px, calc((100% - var(--max, 1440px)) / 2));
  bottom: 0; width: min(58%, 760px); height: 96%;
  /* fades out at the foot (into the page) and at the left (into the sky behind the words) */
  -webkit-mask-image: linear-gradient(to bottom, #000 91%, transparent 100%), linear-gradient(to right, transparent 0%, #000 22%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, #000 91%, transparent 100%), linear-gradient(to right, transparent 0%, #000 22%);
  mask-composite: intersect;
}
.sh-scene svg { display: block; width: 100%; height: 100%; }
.sh-tree { transform-box: fill-box; transform-origin: 50% 100%; animation: sh-sway 9s ease-in-out infinite alternate; }
@keyframes sh-sway { from { transform: rotate(-0.6deg); } to { transform: rotate(0.6deg); } }
.sh-rays { animation: sh-spin 60s linear infinite; }
@keyframes sh-spin { to { transform: rotate(360deg); } }
.sh-bloom { transform-box: fill-box; transform-origin: center; animation: sh-bloom 1.4s cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes sh-bloom { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── What falls: each <i> is the band's full height and slides down by its own height ── */
.sh-fall {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
}
.sh-fall i { position: absolute; top: 0; left: var(--x); width: 0; height: 100%; animation: sh-fall var(--d) linear var(--l) infinite; }
.sh-fall b { display: block; width: max-content; margin: -20px 0 0 -8px; animation: sh-flutter calc(var(--d) / 3) ease-in-out var(--l) infinite alternate; }
.sh-fall svg { display: block; }
.sh-fall[data-kind="winter"] svg { filter: drop-shadow(0 0 1.5px rgba(40, 55, 90, 0.35)); }
.sh-fall[data-kind="winter"] b { animation-name: sh-drift; }
@keyframes sh-fall { from { transform: translateY(-4%); } to { transform: translateY(104%); } }
@keyframes sh-flutter { from { transform: translateX(-18px) rotate(-40deg); } to { transform: translateX(18px) rotate(50deg); } }
@keyframes sh-drift { from { transform: translateX(-8px); } to { transform: translateX(8px); } }

/* ── The words ── */
.sh-eyebrow {
  display: inline-flex; align-items: center; gap: 12px; margin: 0 0 22px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sh-soft);
}
.sh-eyebrow::before { content: ''; width: 28px; height: 1px; background: var(--sh-accent); }
.sh h1 {
  margin: 0 0 18px; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(42px, 6vw, 80px); line-height: 0.98; letter-spacing: -0.025em; color: var(--sh-ink);
}
.sh h1 em { font-style: italic; color: var(--sh-accent); }
.sh-sub { margin: 0 0 28px; max-width: 460px; font-size: 17px; line-height: 1.6; color: var(--sh-soft); }
.sh-all {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--sh-ink); color: #fbf8f4; font: inherit; font-size: 14px; font-weight: 500; transition: transform .2s, opacity .2s;
}
.sh-all:hover { transform: translateY(-1px); opacity: .92; }

@media (max-width: 860px) {
  .sh { min-height: 0; }
  .sh-inner { align-items: flex-start; padding-top: 20px; padding-bottom: min(84vw, 340px); }
  .sh-copy { max-width: none; }
  .sh-sub { margin-bottom: 22px; }
  .sh-scene { width: 100%; height: min(90vw, 360px); right: 0;
    -webkit-mask-image: linear-gradient(to bottom, #000 91%, transparent 100%); mask-image: linear-gradient(to bottom, #000 91%, transparent 100%); }
}
@media (prefers-reduced-motion: reduce) {
  .sh-tree, .sh-rays, .sh-bloom, .sh-fall b { animation: none; }
  .sh-fall i { animation: none; transform: translateY(var(--r)); }
  .sh-all { transition: none; }
}
