/* One continuous painted ground. Only the daylight changes when evening arrives. */
#experience[data-theme="sweet-oil"] {
  --oil-field: ellipse 53% 65% at 50% 46%;
  @media (min-aspect-ratio: 3/2) {
    --oil-field: ellipse 80vmin 65% at 50% 46%;
  }
  --oil-paper-rgb: 231 222 208;
  &, &::before {
    --oil-haze: radial-gradient(var(--oil-field),
      transparent 32%, rgb(var(--oil-paper-rgb) / .08) 52%,
      rgb(var(--oil-paper-rgb) / .34) 72%, rgb(var(--oil-paper-rgb) / .70) 95%,
      rgb(var(--oil-paper-rgb) / .88) 117%, rgb(var(--oil-paper-rgb) / .92) 134%);
  }
  --reader-sheet: var(--oil-haze), var(--oil-ground-day, url("sweet-oil-day.webp")) center / cover no-repeat #8e9299;
  --reader-ink: #302c2d;
  --photo-meta-ink: #fff8eb;
  --chapter-note-credit: #604a39;
  --oil-evening: 0;
  --oil-horizontal: linear-gradient(90deg, transparent, #0002 2%, #0007 4.5%, #000c 8%, #000 12%, #000 88%, #000c 92%, #0007 95.5%, #0002 98%, transparent);
  --oil-vertical: linear-gradient(180deg, transparent, #000 5%, #000 90%, #000c 96%, transparent);
  --oil-corners: radial-gradient(ellipse 65% 73% at center, #000 61%, #000e 72%, #000a 84%, #0004 96%, transparent 107%);
  isolation: isolate;
  background: var(--reader-sheet);

  &[data-oil-light="dusk"] { --oil-evening: .43; }
  &[data-oil-light="night"] { --oil-evening: 1; }
  &::before {
    --oil-paper-rgb: 183 164 152;
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background: var(--oil-haze), var(--oil-ground-night, url("sweet-oil-night.webp")) center / cover no-repeat #756056;
    opacity: var(--oil-evening);
    transition: opacity 1100ms ease-in-out;
  }

  & .scene-picture > .scene-art {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    -webkit-mask-image: var(--oil-vertical), var(--oil-corners);
    -webkit-mask-composite: source-in;
    mask-image: var(--oil-vertical), var(--oil-corners);
    mask-composite: intersect;
  }
  /* The horizontal edge follows the image as it dissolves into the fixed oval ground. */
  & :is(.scene-art > .scene-image, .scene-photo-outgoing, .scene-photo-stack) {
    -webkit-mask-image: var(--oil-horizontal);
    mask-image: var(--oil-horizontal);
  }
  @media (pointer: fine) and (hover: hover) and (min-height: 551px) {
    & .experience-head .music-dock {
      inset-block-end: auto;
      inset-inline-end: max(2px, var(--reader-right));
      inline-size: 44px;
    }
    & .experience-head .music-lp-button {
      position: relative;
      display: grid;
      place-items: center;
      inline-size: 44px;
      block-size: 44px;
      border-radius: 50%;
    }
    & .music-lp { inline-size: 25px; }
    & .music-track-window {
      position: absolute;
      inset-inline-end: calc(100% - 3px);
      inset-block-start: 50%;
      transform: translateY(-50%);
      inline-size: max-content;
      max-inline-size: min(60vi, 27rem);
      padding: 4px 9px;
      border-radius: 4px;
      background: #332a29ee;
      visibility: hidden;
      pointer-events: none;
    }
    & .music-track-title {
      writing-mode: horizontal-tb;
      text-orientation: mixed;
      inline-size: auto;
      letter-spacing: normal;
      color: #fff4de;
      text-shadow: none;
      white-space: nowrap;
    }
    & .music-lp-button:is(:focus-visible, [aria-pressed="false"]) .music-track-window {
      visibility: visible;
    }
    &:has(.scene-quote:not([hidden])) .music-track-window {
      inset-inline-end: 0;
      inset-block-start: calc(100% + 1.6rem);
      transform: none;
    }
  }

  &:has(.scene-frame:not([hidden]) > .scene-visual:not([hidden])) {
    background: var(--reader-sheet);
    & .scene-photo-mat {
      margin-block: max(var(--reader-top), 1.5dvh) var(--reader-content-bottom);
      background: transparent;
    }
    & .beat-cut-outgoing {
      /* The ground stays in place beneath both sizes of the paperless image. */
      background: transparent !important;
    }
    & .experience-head::before {
      content: "";
      position: absolute;
      z-index: -1;
      inset: auto 0 0;
      block-size: calc(var(--reader-content-bottom) + 7dvh);
      background: linear-gradient(to top, #251d24db, #30262caf 52%, transparent);
      -webkit-mask-image: radial-gradient(ellipse 72% 190% at 50% 110%, #000 36%, transparent 100%);
      mask-image: radial-gradient(ellipse 72% 190% at 50% 110%, #000 36%, transparent 100%);
      pointer-events: none;
    }
    & #scene-meta #contents-button {
      color: var(--photo-meta-ink);
      padding-inline: .45em;
      background: #312b2b9c;
      border: 0;
    }
    & .experience-head .music-lp-button { color: #fff4de; }
    & #reader-footer-lyrics p {
      color: #fff8eb;
      -webkit-text-stroke: 0;
      text-shadow: 0 1px 3px #30252a;
      text-wrap: balance;
    }
    & #reader-footer-lyrics p + p { color: #faebdf; word-break: keep-all; }
  }
  @media (prefers-reduced-motion: reduce) {
    &::before { transition: none; }
  }
}
