/* lift.css — page lift for /services, /about, /contact, /news, /book, /terms-lite,
 * the plain home sections and the error pages (2026-11-19 night).
 *
 * Fits the "Bay Ledger" identity: photographed object cut-outs, flat opaque
 * cards, one glass pane per view and only over art.
 * Loaded only by those pages ({{define "lift_css"}} in each template), never bundled.
 * Colour and type come from the skin tokens only: the line-art plates are grey
 * luminance masks filled with var(--color-link) / var(--color-accent), so a
 * re-skin re-colours them. Motion lives inside prefers-reduced-motion:
 * no-preference; without scroll-driven animation support everything is simply
 * static and complete. Only transform / opacity / clip-path / translate animate.
 */

/* ── Plates: low-opacity line art behind a section ─────────────────── */
.lift-host { position: relative; isolation: isolate; overflow: clip; }
/* Without luminance masks the plate would be a tinted slab, so it only exists where they work. */
.lp { display: none; position: absolute; inset: -10% -4%; z-index: -1; pointer-events: none; }
@supports (mask-mode: luminance) {
  .lp { display: block; background-color: var(--color-link); opacity: 0.16;
    mask: var(--lp-s) center / cover no-repeat; mask-mode: luminance; }
  @media (min-width: 721px) { .lp { mask-image: var(--lp-l); } }
}
.lp--accent { background-color: var(--color-accent); }
.lp--soft { opacity: 0.11; }
@media (min-width: 961px) {
  .lp--right { inset: -10% -18% -10% 38%; }
  .lp--left { inset: -10% 40% -10% -18%; }
}
/* veil: fades the plate out under the reading column so body text never sits on lines */
.lp-veil { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, var(--surface-0) 0%, color-mix(in srgb, var(--surface-0) 70%, transparent) 45%, transparent 75%); }
@media (max-width: 720px) { .lp-veil { background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--surface-0) 55%, transparent) 60%, var(--surface-0) 100%); } }

.lp--services { --lp-s: url("/static/art/lift/plate-services-560.webp?v=1"); --lp-l: url("/static/art/lift/plate-services-800.webp?v=1"); }
.lp--about    { --lp-s: url("/static/art/lift/plate-about-560.webp?v=1");    --lp-l: url("/static/art/lift/plate-about-800.webp?v=1"); }
.lp--contact  { --lp-s: url("/static/art/lift/plate-contact-560.webp?v=1");  --lp-l: url("/static/art/lift/plate-contact-800.webp?v=1"); }
.lp--book     { --lp-s: url("/static/art/lift/plate-book-560.webp?v=1");     --lp-l: url("/static/art/lift/plate-book-800.webp?v=1"); }
.lp--news     { --lp-s: url("/static/art/lift/plate-news-560.webp?v=1");     --lp-l: url("/static/art/lift/plate-news-800.webp?v=1"); }
.lp--terms    { --lp-s: url("/static/art/lift/plate-terms-560.webp?v=1");    --lp-l: url("/static/art/lift/plate-terms-800.webp?v=1"); }
.lp--lost     { --lp-s: url("/static/art/lift/plate-lost-560.webp?v=1");     --lp-l: url("/static/art/lift/plate-lost-800.webp?v=1"); }
.lp--map      { --lp-s: url("/static/art/lift/plate-map-560.webp?v=1");      --lp-l: url("/static/art/lift/plate-map-800.webp?v=1"); }
.lp--circuit  { --lp-s: url("/static/art/lift/plate-circuit-560.webp?v=1");  --lp-l: url("/static/art/lift/plate-circuit-800.webp?v=1"); }

/* ── Hero: plate + glass panel + cut-out on its own parallax layer ─── */
.lift-hero { padding-block: clamp(var(--sp-8), 8vw, var(--sp-11)); }
.lift-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); align-items: center; }
@media (min-width: 961px) { .lift-hero__grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--sp-8); } }

/* The one glass surface per view: only ever over a plate, never on cards. */
.glass {
  position: relative;
  background: color-mix(in srgb, var(--surface-1) 90%, transparent);
  border: 1px solid color-mix(in srgb, var(--ink-high) 12%, transparent);
  border-radius: var(--theme-radius-card);
  padding: clamp(var(--sp-5), 4vw, var(--sp-8));
  box-shadow: var(--shadow-md);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass {
    background: color-mix(in srgb, var(--surface-1) 58%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(1.25); backdrop-filter: blur(14px) saturate(1.25);
  }
}
.glass::before { /* a hairline of light along the top edge, like a pane catching the lamp */
  content: ""; position: absolute; inset: 0 12% auto; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ink-high) 45%, transparent), transparent);
}

.lift-art { position: relative; display: grid; place-items: center; }
.lift-art picture, .lift-art img { display: block; width: 100%; height: auto; }
.lift-art img { filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.35)); }
.lift-art::after { /* floor shadow so the cut-out sits on something */
  content: ""; position: absolute; left: 18%; right: 18%; bottom: 2%; height: 9%; z-index: -1;
  border-radius: 50%; background: rgba(0, 0, 0, 0.35); filter: blur(16px);
}
.lift-art--hero { width: min(100%, 380px); margin-inline: auto; }
@media (max-width: 960px) {
  .lift-art--hero { width: 132px; margin: 0; order: -1; }
}

/* ── Own icon set (static/art/lift/icons.svg) ──────────────────────── */
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.22em; color: var(--color-link); }
.ic--accent { color: var(--color-accent); }
.ic-tile {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 1px solid var(--line-mid); border-radius: var(--theme-radius-inset);
  background: color-mix(in srgb, var(--color-primary) 10%, var(--surface-1));
}
.ic-tile .ic { width: 22px; height: 22px; }
.lift .card__list li { display: flex; gap: var(--sp-2); align-items: flex-start; }
.lift .card__list .ic { margin-top: 0.15em; }

/* ── Kinetic headings: words rise once, by line, on entry ──────────── */
.kw { display: inline-block; }
.kw-clip { display: inline-block; overflow: clip; overflow-clip-margin: 0.12em; padding-bottom: 0.08em; margin-bottom: -0.08em; vertical-align: bottom; }

/* ── Image cards ───────────────────────────────────────────────────── */
.scene { position: relative; overflow: hidden; padding: 0; min-height: 280px; display: flex; flex-direction: column; justify-content: flex-end; }
.scene > picture { position: absolute; inset: 0; }
.scene > picture img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform var(--dur-slow) var(--ease-out-soft); }
.scene:hover > picture img { transform: scale(1.1); }
.scene__body { position: relative; padding: var(--sp-5); background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--surface-0) 88%, transparent) 38%); }
.scene__body .chip { background: var(--surface-1); }
.scene__chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }

.ship { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
@media (min-width: 721px) { .ship { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--theme-bento-gap, var(--sp-4)); } }
.ship__item { position: relative; display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4); overflow: hidden; }
.ship__item .cutout { width: 88px; height: 88px; margin: calc(var(--sp-2) * -1) 0 0 calc(var(--sp-2) * -1); }
.ship__item .cutout img { transition: transform var(--dur-base) var(--ease-out-soft); }
.ship__item:hover .cutout img { transform: translateY(-5px) rotate(-3deg) scale(1.05); }
.ship__item h3 { margin: 0; }
.ship__item p { font-size: var(--fs-sm); color: var(--ink-mid); margin: 0; }
.ship__item--off { opacity: 0.6; }
.ship__item--off .ic-tile { width: 88px; height: 88px; border-style: dashed; background: transparent; }
.ship__item--off .ic-tile .ic { width: 34px; height: 34px; color: var(--ink-low); }

.pic-card { display: flex; gap: var(--sp-4); align-items: center; }
.pic-card .cutout { width: 84px; height: 84px; flex: none; }
.pic-card h2, .pic-card h3 { margin: 0 0 var(--sp-1); }
.pic-card p { margin: 0; }

/* counters: width reserved so counting never shifts the line */
.lift [data-count] { display: inline-block; min-width: var(--count-w, 2ch); font-variant-numeric: tabular-nums; }

/* ── Steps strip (contact "what happens next") ─────────────────────── */
.steps { display: grid; gap: var(--sp-3); grid-template-columns: minmax(0, 1fr); counter-reset: none; }
@media (min-width: 721px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--theme-bento-gap, var(--sp-4)); } }
.steps__item { position: relative; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--sp-3); align-items: start; }
@media (min-width: 721px) { .steps__item { grid-template-columns: minmax(0, 1fr); } }
.steps__item .cutout { width: 72px; height: 72px; }
.steps__n { font-size: var(--fs-xs); color: var(--ink-low); letter-spacing: 0.12em; }

/* ── Prose aids (terms-lite) ───────────────────────────────────────── */
.lift .prose h2 { display: flex; gap: var(--sp-3); align-items: center; }
.lift .prose h2 .ic-tile { width: 36px; height: 36px; }
.lift .prose h2 .ic-tile .ic { width: 18px; height: 18px; }

/* ── Error page ────────────────────────────────────────────────────── */
.lost { min-height: min(78vh, 760px); display: grid; align-items: center; }
.lost__code { display: block; font-family: var(--ff-theme-display); font-weight: var(--wght-display-hero, 700); line-height: 0.9;
  font-size: clamp(5rem, 3rem + 12vw, 11rem); letter-spacing: -0.04em; color: var(--ink-high); }
.lost .lift-art--hero { width: min(100%, 320px); }
@media (max-width: 960px) { .lost .lift-art--hero { width: 160px; } }
.lost__links { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-5); font-size: var(--fs-sm); }
.lost__links a { display: inline-flex; gap: var(--sp-2); align-items: center; }

/* ── Motion (all of it opt-in, all of it decorative) ───────────────── */
@media (prefers-reduced-motion: no-preference) {
  /* Ambient: the plate sways twice, slowly, then rests (no infinite loops). */
  .lp { animation: lp-sway 46s var(--ease-in-out) 2 alternate; }
  @keyframes lp-sway { from { transform: rotate(-1.2deg) scale(1.04); } to { transform: rotate(1.2deg) scale(1.1); } }

  /* Hero words rise inside their clip box; transform only, so they are painted (and count for LCP) at once. */
  .kw-clip > .kw { animation: kw-rise 0.9s var(--ease-out-expo) both; animation-delay: calc(var(--i, 0) * 55ms + 80ms); }
  @keyframes kw-rise { from { transform: translateY(0.62em) rotate(2deg); } to { transform: none; } }

  /* Section headings split by lift.js: rise + fade once on entry. */
  .kin .kw { opacity: 0; transform: translateY(0.5em); transition: opacity 0.5s var(--ease-out-soft), transform 0.7s var(--ease-out-expo); transition-delay: calc(var(--i, 0) * 40ms); }
  .kin.kin-in .kw { opacity: 1; transform: none; }

  .lift-art--hero img { animation: lift-bob 7s var(--ease-in-out) 2 alternate; }
  @keyframes lift-bob { from { transform: translateY(0); } to { transform: translateY(-10px); } }

  @supports (animation-timeline: view()) {
    /* Scroll-linked layers: plate drifts slowest, the cut-out a little faster. */
    .lp { animation: lp-scroll linear both, lp-sway 46s var(--ease-in-out) 2 alternate; animation-timeline: view(), auto; animation-range: cover 0% cover 100%, normal; }
    @keyframes lp-scroll { from { translate: 0 -5%; } to { translate: 0 5%; } }
    .scene > picture img { animation: scene-pan linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
    @keyframes scene-pan { from { translate: 0 -4%; } to { translate: 0 4%; } }
    @media (min-width: 700px) {
      .lift-art--hero { animation: art-par linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
      @keyframes art-par { to { translate: 0 18%; } }
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .lp, .lift-art img, .kw, .scene > picture img { animation: none !important; transition: none !important; }
  .kin .kw { opacity: 1; transform: none; }
}
@media (forced-colors: active) { .lp, .lp-veil { display: none; } .glass { -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* ── Page tweaks ───────────────────────────────────────────────────── */
/* /book: the calendar is the job, so the hero stays short and the hourglass overlaps the panel edge on phones. */
.bk-hero.lift-hero { padding-block: var(--sp-7) var(--sp-6); }
@media (max-width: 960px) {
  .bk-hero .lift-art--hero { width: 96px; justify-self: end; margin-bottom: -56px; position: relative; z-index: 1; }
  .bk-hero .glass { padding-right: calc(var(--sp-5) + 40px); }
}
/* /news: cards without a source image get a tinted line-art panel instead of an empty box. */
.news-fallback { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line-soft); background: color-mix(in srgb, var(--color-primary) 8%, var(--surface-1)); }
.news-fallback .lp { inset: -6%; opacity: 0.32; }
.news-fallback .ic-tile { position: absolute; left: var(--sp-4); bottom: var(--sp-4); background: var(--surface-1); }
.news-card img { transition: transform var(--dur-slow) var(--ease-out-soft); }
.news-card:hover img { transform: scale(1.04); }
/* /news: the hero is short, so the display face's swap (wider than its fallback) moved the list below
   by a line on phones (CLS 0.11). Reserve the two lines the web font takes there. */
@media (max-width: 720px) { .lift-hero h1.h1-2l { min-height: 2lh; } }
