/* 04 Pick your beach (js/desk-options.js): a centred headline card, the four postcards in the corners, a living surface
   (sand, shore or water) and Lift off into 05. The images are set from the script, so their paths resolve against the page. */

html[data-desk] .desk__top { background-color: #F4ECDD; background-size: cover; background-position: center; }

/* ---------- the life on the surface ---------- */
/* palm shadows (tools/palm-shade.py): two sheets of soft, cool-tinted fronds, each swaying about its own crown off the
   edge of the frame. Multiplied: the multiply sits on the container (its own stacking group), the sheets sway inside it.
   Kept subtle (Sam, Nov 21): faint and tinted on water, a touch more on dry sand. */
.dk-shade { position: absolute; inset: 0; z-index: 6; pointer-events: none; mix-blend-mode: multiply; opacity: .36; }   /* subtle: Sam, Nov 21 */
html[data-desk="water"] .dk-shade { opacity: .36; }   /* Sam, Nov 21: "just slightly" lighter */   /* teal on turquoise needs a little more to read than on sand */
.dk-shade__l { position: absolute; inset: 0; background-size: 100% 100%; background-repeat: no-repeat; will-change: transform; }
.dk-shade__l--top { transform-origin: 50% -78%; }
.dk-shade__l--low { transform-origin: -12% 130%; }
/* on the shore the shadows fall on the dry sand, not on the water */
html[data-desk="shore"] .dk-shade { -webkit-mask-image: linear-gradient(to right, #000 0, #000 48%, transparent 62%); mask-image: linear-gradient(to right, #000 0, #000 48%, transparent 62%); }

/* water that moves: two copies of the picture, brightened to their caustics only, drifting against each other and added
   on top as light. On the shore it is held to the water's side, past the foam. */
.dk-sheen { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.dk-sheen i { position: absolute; inset: -4%; background-size: cover; background-position: center; mix-blend-mode: screen; opacity: .34;
  filter: contrast(1.9) brightness(.62) saturate(1.2); will-change: transform; animation: dk-drift-a 11s ease-in-out infinite alternate; }
.dk-sheen i + i { opacity: .26; animation: dk-drift-b 14s ease-in-out infinite alternate; }
@keyframes dk-drift-a { from { transform: translate(-0.8%, 0.5%) scale(1.03); } to { transform: translate(0.9%, -0.6%) scale(1.06); } }
@keyframes dk-drift-b { from { transform: translate(0.7%, -0.4%) scale(1.07) rotate(.4deg); } to { transform: translate(-0.9%, 0.7%) scale(1.04) rotate(-.3deg); } }
html[data-desk="shore"] .dk-sheen { -webkit-mask-image: linear-gradient(to right, transparent 0, transparent 66%, #000 80%); mask-image: linear-gradient(to right, transparent 0, transparent 66%, #000 80%); }
html[data-desk="shore"] .dk-sheen i { animation-name: dk-wash-a; }
@keyframes dk-wash-a { from { transform: translate(1.4%, 0) scale(1.03); } to { transform: translate(-0.6%, 0.4%) scale(1.05); } }
.desk.is-asleep .dk-sheen i { animation-play-state: paused; }

/* the fronds near the lens (Kelingking's leaf): each hangs in from an edge, turns on its stem, its shadow on the surface */
.dk-fronds { position: absolute; inset: 0; z-index: 8; pointer-events: none; transform-origin: 50% 50%; }
.dk-frond { position: absolute; width: 30vw; aspect-ratio: 1; }
.dk-frond img { position: absolute; inset: 0; width: 100%; height: 100%; transform-origin: 0 1.2%; will-change: rotate; }
.dk-frond__sh { filter: brightness(0) blur(13px); opacity: .13; translate: 30px 50px; }
.dk-frond img:first-child { z-index: 1; filter: drop-shadow(0 6px 8px rgba(20, 50, 30, .18)) saturate(1.05); }
.dk-frond--a { left: -6vw; top: 30%; transform: rotate(-34deg); }
.dk-frond--b { right: -5vw; bottom: -6%; transform: scaleX(-1) rotate(-22deg); }

/* ---------- the layout: a centred headline card, four postcards in the corners ---------- */
html[data-desk] .desk__grid { left: 0; right: 0; top: 0; bottom: 0; height: auto; display: block; }
html[data-desk] .dcell { position: absolute; aspect-ratio: 4 / 3; display: block; will-change: transform; }   /* the float: js/desk-options.js */
html[data-desk] .dcard { width: 100%; height: 100%; }
/* on the water a card keeps only a tight contact shadow, its real shadow lies on the bottom (.dk-csh), and hovering
   lifts it off the water (the script), so the hover shadow goes too */
html[data-desk] .dcard, html[data-desk] .dcard:hover { box-shadow: 0 1px 2px rgba(10, 60, 66, .2), 0 5px 12px rgba(10, 60, 66, .1); }

/* ---------- the postcards float: their shadows on the bottom of the lagoon ----------
   Soft, tinted lagoon teal and multiplied, so the water's own light and colour come through them, like the palm shadows.
   Each one is a core inside its card's outline with a wide blur reaching out (a box-shadow, painted once, so the float
   only moves and fades it). Placed, turned and faded every frame by js/desk-options.js. */
.dk-csh { position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: multiply; }
.dk-csh__s { --c: rgb(62, 146, 156); position: absolute; left: 0; top: 0; opacity: 0; background: var(--c); will-change: transform, opacity; }
html[data-desk="sand"] .dk-csh__s, html[data-desk="shore"] .dk-csh__s { --c: rgb(176, 158, 136); }
html[data-desk] .desk__head {
  left: 50%; right: auto; top: 50%; width: min(440px, 31vw); translate: -50% -50%; rotate: -1deg; z-index: 5; text-align: center;
  padding: 34px 36px 32px; box-shadow: 0 2px 4px rgba(10, 60, 66, .16), 0 8px 18px rgba(10, 60, 66, .1);   /* its shadow on the water is .dk-csh */
  will-change: transform;
}
html[data-desk] .desk__head .h2 { font-size: clamp(40px, 3.6vw, 64px); }
html[data-desk] .desk__hint { transform: rotate(-2deg); transform-origin: 50% 50%; margin-top: 18px; }

/* ---------- Lift off ---------- */
.desk { transform-origin: 50% 50%; }
.desk.is-card {
  z-index: 3; outline: calc(16px * var(--lift)) solid #FFFDF8;
  /* the shadow: long while it's in the air, short and tight as it lands on the chart */
  box-shadow: 0 calc(14px * var(--lift) + 70px * var(--air)) calc(22px * var(--lift) + 120px * var(--air)) rgba(15, 59, 64, calc(.16 + .16 * var(--air))),
    0 calc(2px * var(--lift)) calc(6px * var(--lift)) rgba(15, 59, 64, calc(.18 * var(--lift)));
}
.lo-pm { position: absolute; right: 5%; bottom: 6%; width: 24vw; z-index: 9; color: rgba(15, 59, 64, .78); opacity: 0; visibility: hidden; transform: rotate(-10deg); pointer-events: none; }
.lo-pm .pm { color: inherit; }
.lo-haze { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(255, 253, 246, .9), rgba(240, 250, 249, .75)); }
.lo-wait { position: absolute; left: 0; top: 0; width: 100vw; height: 100%; z-index: 0; pointer-events: none; opacity: 0; transform-origin: 50% 50%; }
.lo-card { position: absolute; width: 13vw; aspect-ratio: 4 / 3; padding: 7px; background: #FFFDF8; box-shadow: 0 14px 30px rgba(15, 59, 64, .16), 0 2px 5px rgba(15, 59, 64, .1); }
.lo-card img { display: block; width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 760px) {
  html[data-desk] .desk__head { width: 80vw; padding: 20px 20px 18px; top: 47%; }
  html[data-desk] .desk__head .h2 { font-size: 31px; }
  html[data-desk] .desk__hint { font-size: 13px; margin-top: 10px; }
  html[data-desk] .dcard { padding: 5px; }
  html[data-desk] .dcard .pstamp { width: 42px; height: 50px; right: -8px; top: -10px; --r: 2.2px; }
  html[data-desk] .dcard .pstamp__price { font-size: 10px; }
  html[data-desk] .dcard .pstamp__top, html[data-desk] .dcard .pstamp__bot { font-size: 5.5px; letter-spacing: .06em; }
  html[data-desk] .dcard .pm { width: 46px; right: 18px; top: 18px; }
  html[data-desk] .dcard__greet { left: 7px; bottom: 4px; }
  html[data-desk] .dcard__greet small { font-size: 8px; }
  html[data-desk] .dcard__greet b { font-size: 19px; }
  .dk-frond { width: 62vw; }
  .dk-shade__l--top { transform-origin: 60% -42%; }
  .dk-shade__l--low { transform-origin: -25% 116%; }
  .dk-frond--a { left: auto; right: -30vw; top: 56%; transform: scaleX(-1) rotate(-38deg); }
  .desk.is-card { outline-width: calc(9px * var(--lift)); }
  .lo-pm { width: 34vw; }
  .lo-card { width: 30vw; padding: 4px; }
}
@media (prefers-reduced-motion: reduce) { .dk-shade__l, .dk-frond img { transform: none !important; rotate: none !important; } .dk-sheen i { animation: none; } }
