/* Saltlane rework 4: the first screen's one big object. The plate stands in FRONT of the whole name, the largest
   object on the first screen, crossing the feet of the letters (as the reference's burger crosses its headline);
   every prop whole, lit, clear of the letters. Three arrangements were tried (data-lay on <html>: a, b, c); the
   AFTER.md records the frames of each and which one stands. */

/* layer order: both words behind the plate, every prop in front */
.c-back { z-index: 1; } .n-salt { z-index: 2; } .n-lane { z-index: 3; } .slh-plate, .slh-rim { z-index: 4; } .c-mid { z-index: 5; } .c-front { z-index: 6; }
.slh { --tilt: 42; --roll: 0; }

@media (min-width: 701px) {
  /* ---------- a: the name on one line, the plate large and centred, low, its far rim crossing the feet of the letters ---------- */
  .slh { --nt: 11vh; --pw: min(48vw, 76vh); --cy: calc(var(--nt) + 0.7 * var(--nh, 30vh) + 0.36 * var(--pw)); }
  .slh-name { top: var(--nt); }
  .slh-plate, .slh-rim { left: 50%; width: var(--pw); top: var(--cy); }
  /* the copy moves to the two lower corners, either side of the plate: the line and the prices at the left, the two routes at the right */
  .slh-copy { left: 4vw; right: 4vw; padding: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "h b" "p b"; align-items: end; justify-items: start; text-align: left; column-gap: 2vw; }
  .slh-h1 { grid-area: h; max-width: 22vw; font-size: clamp(30px, 2.7vw, 42px); line-height: 1.02; }
  .slh-h1 .l2 { display: block; }
  .slh-copy .price { grid-area: p; max-width: 22vw; font-size: 15px; line-height: 1.35; }
  .slh-copy .routes-btns { grid-area: b; justify-self: end; flex-direction: column; align-items: flex-end; gap: 10px; }
  /* stickers belong to the plate: "37 dishes" on its left rim, "Cooked on steel" on its right rim, "50 to 500" by the line */
  .slh-stk .stk-b { left: calc(50% - 0.5 * var(--pw) - 6px); top: calc(var(--cy) - 0.1 * var(--pw)); }
  .slh-stk .stk-a { left: calc(50% + 0.5 * var(--pw) - 112px); top: calc(var(--cy) + 0.06 * var(--pw)); width: 118px; height: 118px; padding: 14px; font-size: 17px; }
  .slh-stk .stk-c { left: 4.4vw; right: auto; top: calc(var(--cy) - 0.24 * var(--pw)); }

  /* ---------- b: the name on two lines at the left, the plate large at the right crossing the ends of both words ---------- */
  [data-lay="b"] .slh { --nt: 9vh; --pw: min(50vw, 84vh); --cy: calc(var(--nt) + 1.05 * var(--nh, 30vh)); }
  [data-lay="b"] .n-lane { top: calc(var(--nt) + 1.06 * var(--nh, 30vh)); left: 4vw; right: auto; }
  [data-lay="b"] .slh-plate, [data-lay="b"] .slh-rim { left: 70%; }
  [data-lay="b"] .slh-copy { grid-template-columns: 1fr; grid-template-areas: "h" "b" "p"; left: auto; right: 4vw; width: 30vw; justify-items: end; text-align: right; }
  [data-lay="b"] .slh-copy .routes-btns { flex-direction: row; }
  [data-lay="b"] .slh-h1, [data-lay="b"] .slh-copy .price { max-width: 30vw; }
  [data-lay="b"] .slh-stk .stk-b { left: calc(70% - 0.5 * var(--pw)); }
  [data-lay="b"] .slh-stk .stk-a { left: calc(70% + 0.5 * var(--pw) - 160px); top: calc(var(--cy) - 0.36 * var(--pw)); }
  [data-lay="b"] .slh-stk .stk-c { display: none; }

  /* ---------- c: as a, the plate turned on the table (a roll of 12 degrees) and tipped further toward the reader ---------- */
  [data-lay="c"] .slh { --tilt: 46; --roll: -10; --pw: min(46vw, 72vh); --cy: calc(var(--nt) + 0.64 * var(--nh, 30vh) + 0.38 * var(--pw)); }
}

/* ================= phone: SALT over LANE, the plate large in front of LANE's feet, the stickers on its rim ================= */
@media (max-width: 700px) {
  .slh { --pw: min(94vw, 400px); --lt: calc(76px + 1.02 * var(--nh, 110px)); --cy: calc(var(--lt) + 0.62 * var(--nh, 110px) + 0.36 * var(--pw)); }
  .n-lane { left: 5vw; right: auto; }
  .n-lane { top: var(--lt); }
  .slh-plate, .slh-rim { left: 50%; width: var(--pw); top: var(--cy); }
  /* the badges sit on the plate's lower rim, small, their words still 14 px */
  .slh-stk .stk-b { left: 2vw; top: calc(var(--cy) + 0.04 * var(--pw)); font-size: 14px; padding: 7px 12px 6px; }
  .slh-stk .stk-a, .slh-stk .stk-a[class] { left: auto; right: 5vw; top: calc(var(--cy) - 0.2 * var(--pw)); width: 86px; height: 86px; padding: 8px; font-size: 14px; }
  .slh-stk .stk-a b { font-size: 1.15em; }
}
@media (max-width: 379px) {
  .slh-stk .stk-a, .slh-stk .stk-a[class] { left: auto; right: 5vw; top: calc(var(--cy) - 0.2 * var(--pw)); width: 86px; height: 86px; padding: 8px; font-size: 14px; }
  .slh-stk .stk-a b { font-size: 1.15em; }
}

/* fault 4: arriving home through the wave, the wave waits (paused at its first frame, the page you left still on
   screen) until the 3D first screen has drawn its first frame with every prop; index.html sets and clears vt-hold */
:root.vt-hold::view-transition-new(root), :root.vt-hold::view-transition-old(root) { animation-play-state: paused; }
