.winter-garland {
  display: none;
}

@media screen {
  .orbital-winter-season .winter-garland {
    --winter-height: clamp(5.4rem, 8.6vw, 7.6rem);
    --wire-depth: 1.5rem;
    --tie: .68rem;
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    width: 100%;
    max-width: 90rem;
    height: var(--winter-height);
    margin: 0 auto;
    background: radial-gradient(ellipse 65% 96% at 50% -24%, #e8e1ed70, transparent);
  }

  .orbital-winter-season .sketch-landing .winter-garland {
    --winter-height: clamp(8rem, 13.5vw, 10.6rem);
  }
  .orbital-winter-season .sketch-landing .lab-front {
    padding-block-start: clamp(.75rem, 1.65vw, 1.5rem);
  }

  .winter-garland::before, .winter-garland::after {
    content: "";
    position: absolute;
    z-index: 2;
    inset-block: 0;
    width: min(33%, calc(var(--winter-height) * 1.12));
    pointer-events: none;
    background-repeat: no-repeat;
    background-size: contain;
  }
  .winter-garland::before {
    left: clamp(0px, 2.1vw, 1.75rem);
    background-image: url("fir-flask.webp");
    background-position: left top;
  }
  .winter-garland::after {
    right: clamp(0px, 2.1vw, 1.75rem);
    background-image: url("fir-water.webp");
    background-position: right top;
  }
  .winter-lights {
    position: absolute;
    inset: 9% 7% auto;
    height: 2.45rem;
    pointer-events: none;
    background: url("lights.svg") repeat-x center top / 16.5rem 2.375rem;
  }

  .winter-flurry {
    --distance: var(--winter-height);
    position: absolute;
    inset: 0;
    z-index: 1;
    display: none;
    overflow: hidden;
    contain: strict;
    pointer-events: none;
    user-select: none;
  }
  .winter-snowing .winter-flurry--garland { display: block; }
  .winter-flurry i {
    position: absolute;
    top: 0;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: #fefeff;
    box-shadow: 0 .5px 2px #9b98b3b0;
    animation: orbital-winter-fall linear infinite both;
  }
  .winter-flurry i.winter-crystal {
    background: url("snowflake.svg") center / contain no-repeat;
    box-shadow: none;
    opacity: .8;
  }
  .winter-tab-hidden .winter-flurry i { animation-play-state: paused; }

  @keyframes orbital-winter-fall {
    from { transform: translate3d(0, -1.1rem, 0) rotate(0); }
    to { transform: translate3d(var(--drift), calc(var(--distance) + 1rem), 0) rotate(var(--turn)); }
  }

  .winter-garland button.winter-snow-toggle {
    position: relative;
    z-index: 3;
    align-self: start;
    top: calc(var(--winter-height) * .09 + var(--wire-depth) + var(--tie));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .42rem;
    min-height: 2.75rem;
    margin: 0;
    padding: .3rem .67rem;
    border: 1px solid #d4c7c9;
    border-radius: .32rem .4rem .42rem .3rem;
    background: #fffaf2;
    color: #594860;
    box-shadow: 0 2px 0 #e9dfe3, 0 3px 7px #73607513;
    font: inherit;
    font-size: .9rem;
    font-weight: 750;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .winter-snow-toggle::before {
    content: "";
    position: absolute;
    bottom: calc(100% - .18rem);
    left: 50%;
    height: calc(var(--tie) + .25rem);
    border-left: 1px solid #ab9675;
  }
  .winter-snow-toggle::after {
    content: "";
    position: absolute;
    top: .15rem;
    left: calc(50% - 1.5px);
    width: 4px;
    height: 4px;
    box-sizing: border-box;
    border: 1px solid #ad9877;
    border-radius: 50%;
    background: #f4e7ce;
  }
  .winter-sample {
    padding-right: .42rem;
    border-right: 1px solid #dcced8;
    color: #745881;
    font: italic 700 1rem/1 Georgia, serif;
  }
  .winter-switch {
    box-sizing: border-box;
    position: relative;
    width: 1.75rem;
    height: 1rem;
    border-radius: 1rem;
    border: 1px solid #8b7b91;
    background: #f2edf2;
  }
  .winter-switch::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 2px;
    width: .625rem;
    height: .625rem;
    border-radius: 50%;
    transform: translateY(-50%);
    background: #76667d;
  }
  .winter-snow-toggle[aria-pressed="true"] .winter-switch {
    border-color: #77568d;
    background: #87669d;
  }
  .winter-snow-toggle[aria-pressed="true"] .winter-switch::before {
    left: auto;
    right: 2px;
    background: #fffdfb;
  }
  .winter-garland button.winter-snow-toggle:focus-visible {
    outline: 2px solid #795489;
    outline-offset: 2px;
  }
  @media (hover: hover) {
    .winter-garland button.winter-snow-toggle:hover { background: #f7eff7; }
  }

  /* On wide pages the extra snow stays inside the outer page margins. */
  @media (min-width: 56rem) {
    .winter-snowing .winter-flurry--left, .winter-snowing .winter-flurry--right {
      --distance: 100vh;
      display: block;
      position: fixed;
      top: 0;
      bottom: 0;
      width: clamp(.7rem, calc((100vw - 83rem) / 2), 6rem);
    }
    .winter-flurry--left { right: auto; }
    .winter-flurry--right { left: auto; }
  }
  @media (max-width: 43.75rem) {
    .orbital-winter-season .winter-garland {
      --winter-height: 4.9rem;
      --wire-depth: 1.14rem;
      --tie: .45rem;
    }
    .orbital-winter-season .sketch-landing .winter-garland { --winter-height: clamp(5.7rem, 22vw, 7.3rem); }
    .winter-garland::before { left: 0; }
    .winter-garland::after { right: 0; }
    .winter-lights { inset-inline: 9%; height: 1.85rem; background-size: 12.5rem 1.8rem; }
    .winter-flurry i:nth-child(even) { display: none; }
    .orbital-winter-season .sketch-landing .lab-front { padding-block-start: .6rem; }
  }
  @media (max-width: 23rem) {
    .winter-garland::before, .winter-garland::after { width: 28%; }
    .winter-garland button.winter-snow-toggle { padding-inline: .48rem; }
  }

  /* These sections switch to an exercise in place. */
  .training-page:has(#training-picker[hidden]) .winter-garland,
  #orbital-design[data-mode]:not([data-mode="practice"]) .winter-garland {
    display: none;
  }
}

@media print {
  .winter-garland { display: none !important; }
}
