/* The atmosphere belongs to the landscape, behind the untouched product photo. */
.island-atmosphere, .weather-controls[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .weather-track.weather-enabled::after { content: ''; display: block; height: clamp(540px, 138svh, 1220px); }
  .weather-enabled .origin-grid { position: sticky; top: calc(var(--weather-pin, 80px) - var(--weather-pan, 0px)); }
  .weather-enabled .origin-coast {
    filter: brightness(var(--daylight, 1)) saturate(var(--colour, 1)) sepia(var(--warmth, 0));
  }
  .weather-enabled .island-atmosphere {
    display: block;
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
  }
  .island-atmosphere > div, .weather-rain { position: absolute; inset: 0; }
  .weather-sea-haze {
    background: linear-gradient(180deg, transparent 4%, rgba(223,226,218,.46) 10%, transparent 27%);
    opacity: var(--haze, .35);
  }
  .island-atmosphere .weather-clouds {
    inset: -1.4% -15% auto; height: 12%;
    opacity: var(--cloud-cover, .9);
    transform: translateX(var(--breeze, -4%));
    -webkit-mask-image: linear-gradient(#000 52%,rgba(0,0,0,.96) 77%,transparent);
    mask-image: linear-gradient(#000 52%,rgba(0,0,0,.96) 77%,transparent);
  }
  .weather-clouds i {
    position: absolute; inset: 2% auto 0 -105%; width: 225%;
    background: url('/assets/weather/atlantic-clouds.webp') repeat-x 0 50% / 50% 100%;
    animation: azor-cloud-drift 78s linear infinite;
    animation-play-state: paused;
  }
  .weather-clouds i + i {
    inset: auto auto -9% -105%; height: 52%; width: 240%;
    opacity: .5;
    animation-duration: 122s; animation-delay: -41s;
  }
  @keyframes azor-cloud-drift { to { transform: translateX(50%); } }
  .weather-shadow {
    background: radial-gradient(ellipse 66% 20% at 24% 42%, rgba(34,56,66,.55), transparent 84%),
                radial-gradient(ellipse 58% 20% at 79% 64%, rgba(40,61,65,.37), transparent 82%);
    mix-blend-mode: multiply;
    opacity: var(--cloud-shade, .64);
    animation: azor-meadow-shade 40s ease-in-out infinite alternate;
    animation-play-state: paused;
  }
  @keyframes azor-meadow-shade { from { transform: translateX(-9%); } to { transform: translateX(11%); } }
  .weather-playing .weather-clouds i, .weather-playing .weather-shadow { animation-play-state: running; }
  .weather-sun {
    background: radial-gradient(ellipse 63% 24% at 65% 44%,#fff4b7 2%,rgba(255,227,155,.65) 39%,transparent 85%),
                linear-gradient(133deg,transparent 39%,rgba(255,245,207,.53) 54%,transparent 66%);
    mix-blend-mode: soft-light;
    opacity: var(--sun, 0);
  }
  .weather-storm {
    background: linear-gradient(180deg,rgba(41,57,80,.63),rgba(103,133,148,.40) 36%,rgba(36,58,69,.28) 78%,rgba(42,58,65,.17));
    opacity: var(--storm, 0);
  }
  .weather-gold {
    background: radial-gradient(ellipse at 87% 22%, rgba(255,223,164,.73),rgba(255,196,93,.24) 38%,transparent 71%),
                linear-gradient(115deg,rgba(80,66,94,.18),transparent 43%,rgba(250,194,112,.42));
    mix-blend-mode: soft-light;
    opacity: var(--gold-hour, 0);
  }
  .weather-rain { width: 100%; height: 100%; pointer-events: none; }
  .weather-controls {
    display: flex; align-items: center; gap: .75rem; margin-top: .45rem;
    color: #584d3a;
  }
  .weather-chapters { display: flex; flex: 1; min-width: 0; gap: .45rem; }
  .weather-chapters button, .weather-pause {
    appearance: none; border: 0; color: inherit; background: transparent; font: inherit;
    min-height: 44px; padding: 0; cursor: pointer;
  }
  .weather-chapters button {
    flex: 1; position: relative; text-align: left; line-height: 1.15;
    font-size: clamp(.70rem, .86vw, .81rem); white-space: nowrap;
  }
  .weather-chapters button::before {
    content: ''; position: absolute; top: 1px; left: 0; right: 0;
    height: 1px; background: #bfb59f;
  }
  .weather-chapters button[aria-current="step"] { color: #654919; font-weight: 700; }
  .weather-chapters button[aria-current="step"]::before { height: 2px; background: #876b38; }
  .weather-pause { width: 44px; display: grid; place-items: center; }
  .weather-pause span { width: 9px; height: 12px; border-inline: 3px solid currentColor; }
  .weather-paused .weather-pause span {
    width: 0; height: 0; border: 0; border-block: 6px solid transparent; border-left: 9px solid currentColor;
  }
  .weather-controls button:focus-visible { outline: 2px solid #806230; outline-offset: 2px; }
  @media (max-width: 760px), (max-height: 520px) {
    .weather-track.weather-enabled::after { height: clamp(345px, 82svh, 650px); }
    .weather-clouds i + i { display: none; }
  }
}
@media print {
  .weather-track.weather-enabled::after { display: none; }
  .weather-track .origin-grid { position: static; }
  .weather-track .island-atmosphere, .weather-track .weather-controls { display: none; }
  .weather-track .origin-coast { filter: none; }
}

@media screen and (prefers-reduced-motion: no-preference) {
  .origin.section-light { overflow: visible; }
  .origin .weather-enabled .origin-grid.page-width {
    position: sticky;
    top: calc(var(--weather-pin, 80px) - var(--weather-pan, 0px));
  }
  .origin .weather-enabled .origin-coast {
    filter: brightness(1.13) saturate(1.04) contrast(.98)
            brightness(var(--daylight, 1)) saturate(var(--colour, 1)) sepia(var(--warmth, 0));
  }
  .origin .weather-controls {
    width: min(100%, 380px);
    margin: 1.1rem 0 0;
    gap: .45rem;
    color: #fff9ec;
    text-shadow: 0 1px 4px #172015;
  }
  .origin .weather-chapters button, .origin .weather-pause { text-shadow: inherit; }
  .origin .weather-chapters button::before { background: rgba(255,249,236,.62); }
  .origin .weather-chapters button[aria-current="step"] { color: #ffe2a6; }
  .origin .weather-chapters button[aria-current="step"]::before { background: #ffe2a6; }
  .origin .weather-controls button:focus-visible { outline-color: #ffe2a6; }
  @media (max-width: 760px) {
    .origin .weather-enabled .origin-copy { padding-bottom: 0; }
    .origin .weather-enabled .origin-grid.page-width {
      min-height: max(900px, calc((var(--weather-copy-height, 0px) + 12px) / .56));
    }
    .origin .weather-controls { margin-top: .65rem; }
  }
  @media (max-width: 420px) {
    .origin .weather-enabled .origin-grid.page-width {
      min-height: max(870px, calc((var(--weather-copy-height, 0px) + 12px) / .6));
    }
  }
}
