/* LiveDeck document engine
   Full screen pages, built mobile first.
   Each document sets its brand with the --ld-* and --deck-* properties in its own brand.css. */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body.deck {
  margin: 0; overflow: hidden;
  background: var(--deck-bg, #F6F6F4); color: var(--ld-ink);
  font-family: var(--ld-font-body); font-size: 1rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh; height: 100dvh;
}
img, svg { max-width: 100%; }
a { color: var(--ld-accent); }

/* Top bar */
.deck__bar {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(16px, 3vw, 28px); background: var(--deck-bar-bg, var(--ld-surface)); color: var(--deck-bar-ink, var(--ld-ink));
  border-bottom: 1px solid var(--ld-line); z-index: 3;
}
.deck__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 0.98rem; min-width: 0; }
.deck__brand svg { width: 30px; height: 30px; flex-shrink: 0; }
.deck__brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck__count { font-size: 0.9rem; font-variant-numeric: tabular-nums; opacity: .85; white-space: nowrap; }
.deck__progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: transparent; }
.deck__progress span { display: block; height: 100%; width: var(--p, 0%); background: var(--deck-progress, var(--ld-accent)); transition: width .5s var(--ld-ease); }

/* Pages */
.deck__track { position: relative; overflow: hidden; touch-action: pan-y; }
.deck__page {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  opacity: 0; visibility: hidden; transform: translateX(6%);
  transition: opacity .45s var(--ld-ease), transform .55s var(--ld-ease), visibility 0s .55s;
  background: var(--page-bg, transparent); color: var(--page-ink, inherit);
}
.deck__page.is-before { transform: translateX(-6%); }
.deck__page.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity .45s var(--ld-ease), transform .55s var(--ld-ease), visibility 0s; }
.deck__inner {
  width: 100%; max-width: 1100px; margin: 0 auto; min-height: 100%;
  padding: clamp(24px, 5vw, 56px) clamp(18px, 5vw, 56px) clamp(28px, 5vw, 56px);
  display: flex; flex-direction: column; justify-content: center; gap: clamp(18px, 3vw, 28px);
}
.deck__cols { display: grid; gap: clamp(20px, 4vw, 48px); align-items: center; }
@media (min-width: 900px) { .deck__cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); } .deck__cols--even { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.deck__eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--deck-eyebrow, var(--ld-accent)); margin: 0; }
.deck__title { font-family: var(--ld-font-display); font-weight: var(--deck-title-weight, 700); font-size: clamp(1.9rem, 5.4vw, 3.4rem); line-height: 1.04; letter-spacing: var(--deck-title-tracking, -0.02em); margin: 0; text-transform: var(--deck-title-case, none); }
.deck__text { font-size: clamp(1rem, 2vw, 1.15rem); color: var(--ld-ink-2); margin: 0; max-width: 40em; }
.deck__small { font-size: 0.82rem; color: var(--ld-ink-2); margin: 0; }
.deck__head { display: flex; flex-direction: column; gap: 10px; }

/* Bottom navigation */
.deck__nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px clamp(12px, 3vw, 24px) max(10px, env(safe-area-inset-bottom));
  background: var(--deck-bar-bg, var(--ld-surface)); border-top: 1px solid var(--ld-line); z-index: 3;
}
.deck__btn {
  font: inherit; font-weight: 700; font-size: 0.95rem; min-height: 48px; min-width: 48px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid var(--ld-line); background: var(--ld-surface); color: var(--ld-ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s, color .2s, border-color .2s, opacity .2s;
}
.deck__btn svg { width: 18px; height: 18px; }
.deck__btn--next { background: var(--ld-accent); border-color: var(--ld-accent); color: var(--ld-accent-ink); }
.deck__btn--next:hover { background: var(--ld-ink); border-color: var(--ld-ink); color: var(--ld-surface); }
.deck__btn--prev:hover { border-color: var(--ld-ink); }
.deck__btn[disabled] { opacity: .35; cursor: default; }
.deck__btn--prev .label { display: none; }
@media (min-width: 640px) { .deck__btn--prev .label { display: inline; } }
.deck__hint { font-size: 0.85rem; color: var(--ld-ink-2); text-align: center; transition: opacity .4s; }
.deck__hint.is-gone { opacity: 0; }
.deck__hint .k { display: none; }
@media (hover: hover) and (pointer: fine) { .deck__hint .k { display: inline; } .deck__hint .t { display: none; } }

.deck :focus-visible { outline: 3px solid var(--ld-focus); outline-offset: 3px; }

.deck__sample {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1px solid currentColor; opacity: .75; white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .deck__page, .deck__page.is-active { transition: none; transform: none; }
}
.deck__btn svg { flex-shrink: 0; }
.deck__hint { font-size: 0.8rem; line-height: 1.3; }
@media (max-width: 360px) { .deck__hint { display: none; } }

/* Compact layout for short screens and small embeds, such as the homepage frame on a phone */
@media (max-height: 760px) {
  .deck__bar { padding-top: 9px; padding-bottom: 9px; }
  .deck__inner { padding-top: 18px; padding-bottom: 20px; gap: 16px; }
  .deck__head { gap: 6px; }
  .deck__title { font-size: clamp(1.6rem, 5vw, 2.7rem); }
  .deck__text { font-size: 0.95rem; }
  .deck__nav { padding-top: 7px; padding-bottom: max(7px, env(safe-area-inset-bottom)); }
  .deck__btn { min-height: 44px; }
  .ld-stat { padding: 14px; }
  .ld-stat__num { font-size: clamp(1.8rem, 4.4vw, 2.8rem); }
  .ld-chart__bars { height: clamp(140px, 26vh, 220px); }
  .ld-calc { gap: 12px; padding: 16px; }
  .ld-calc__result { padding: 12px 14px; }
}
@media (max-width: 330px) { .deck__hint { display: none; } }
@media (min-width: 331px) and (max-width: 360px) { .deck__hint { display: block; font-size: 0.74rem; } }
@media (max-width: 380px) { .deck__sample { display: none; } .deck__brand { font-size: 0.92rem; } }

/* Small screens and phone embeds: keep each page within one screen where we can */
@media (max-width: 560px) and (max-height: 760px) {
  .ld-calc__results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ld-calc__result output { font-size: 1.45rem; }
  .ld-calc__result span { font-size: 0.8rem; }
  .ld-calc__note { font-size: 0.76rem; }
  .ld-timeline { gap: 12px; }
  .ld-timeline__step { padding: 0; min-height: 40px; gap: 12px; }
  .ld-timeline__when { font-size: 0.86rem; }
  .ld-timeline__what { font-size: 0.82rem; }
  .ld-timeline__detail { padding: 12px 14px; font-size: 0.9rem; }
  .ld-check { gap: 10px; }
  .ld-check__list { gap: 6px; }
  .ld-check__item label { min-height: 44px; padding: 8px 12px; font-size: 0.95rem; }
  .ld-flips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ld-flip__btn { min-height: 168px; }
  .ld-flip__face { padding: 14px; gap: 6px; }
  .ld-flip__title { font-size: 1.15rem; }
  .ld-flip__price, .ld-flip__face .deck__small { font-size: 0.85rem; }
  .ld-flip__hint { font-size: 0.74rem; }
  .ld-flip__back .ld-flip__list { font-size: 0.8rem; gap: 4px; }
  .ld-acc summary { min-height: 46px; padding: 10px 14px; font-size: 0.95rem; }
  .ld-quiz__opt { min-height: 46px; padding: 10px 14px; }
  .contact-card { padding: 14px 16px; }
}

/* ===== Photography and document details ===== */
.deck__page--photo { color: #FFFFFF; --ld-ink: #FFFFFF; --ld-ink-2: rgba(255,255,255,0.86); }
.page__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.page__shade { position: absolute; inset: 0; z-index: 0; background: var(--shade, linear-gradient(90deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.45) 50%, rgba(0,0,0,.1) 100%)); }
@media (max-width: 899px) { .page__shade { background: var(--shade-mobile, linear-gradient(180deg, rgba(0,0,0,.2) 0%, rgba(0,0,0,.55) 45%, rgba(0,0,0,.85) 100%)); } }
.deck__page--photo .deck__inner { position: relative; z-index: 1; justify-content: flex-end; }
@media (min-width: 900px) { .deck__page--photo .deck__inner { justify-content: center; } }
.deck__page--photo .deck__inner > * { max-width: 40rem; }

.ph { position: relative; margin: 0; border-radius: var(--ld-radius); overflow: hidden; background: var(--ld-surface-2); }
.ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ph--tall { aspect-ratio: 4 / 5; }
.ph--wide { aspect-ratio: 16 / 10; }
.ph figcaption { position: absolute; left: 12px; bottom: 12px; right: 12px; font-size: 0.78rem; font-weight: 600; color: #FFFFFF; text-shadow: 0 1px 8px rgba(0,0,0,.6); }

.deck__split { display: grid; gap: clamp(18px, 3vw, 32px); align-items: center; }
@media (min-width: 900px) { .deck__split { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); } .deck__split--rev { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); } }

/* Summary table of terms */
.ld-terms { margin: 0; border-top: 2px solid var(--ld-ink); }
.ld-terms > div { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--ld-line); }
.ld-terms dt { color: var(--ld-ink-2); font-size: 0.92rem; }
.ld-terms dd { margin: 0; font-weight: 700; font-size: 0.98rem; font-variant-numeric: tabular-nums; }
.ld-terms dd small { display: block; font-weight: 400; color: var(--ld-ink-2); font-size: 0.82rem; }

.ld-ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ld-ticks li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.45; }
.ld-ticks li::before { content: ""; flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; background: var(--ld-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 10.5l3 3 6-7'/%3E%3C/svg%3E") center / 14px no-repeat; }

.ld-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 0.8rem; color: var(--ld-ink-2); }
.ld-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ld-hotspots__panel .ph { margin: -4px -4px 14px; aspect-ratio: 16 / 9; border-radius: calc(var(--ld-radius) - 6px); }

.deck__foot { margin-top: auto; padding-top: 18px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; font-size: 0.72rem; letter-spacing: 0.04em; color: var(--ld-ink-2); opacity: .8; }
.deck__page--photo .deck__foot { color: rgba(255,255,255,.8); }
.deck__inner > .deck__foot:first-child { margin-top: 0; }
.deck__small-print { font-size: 0.74rem; line-height: 1.5; color: var(--ld-ink-2); margin: 0; max-width: 60em; }

.brand-lockup { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.brand-lockup svg { width: 44px; height: 44px; flex-shrink: 0; }
.brand-lockup span { font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.9rem; line-height: 1.15; }
.brand-lockup span small { display: block; font-weight: 500; letter-spacing: 0.04em; text-transform: none; font-size: 0.78rem; opacity: .85; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.chip-row li { padding: 7px 13px; border-radius: 999px; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22); font-weight: 600; font-size: 0.86rem; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

.ld-ba__layer img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; }

@media (max-height: 760px) and (max-width: 899px) {
  .deck__page--photo .deck__title { font-size: clamp(2rem, 8vw, 2.6rem); }
  .ld-terms > div { padding: 8px 0; }
  .ph--tall { aspect-ratio: 16 / 10; }
}

/* Fit tuning */
@media (min-width: 900px) { .ph--tall { max-height: 60vh; } }
.ld-ba { max-width: min(100%, calc((100dvh - 420px) * 2)); margin-inline: auto; width: 100%; }
@media (max-height: 760px) and (max-width: 899px) { .hide-short { display: none !important; } }

/* ===== Mobile test pass fixes ===== */
.deck__foot { font-size: 0.75rem; }
/* Small embeds: save space for the content */
@media (max-height: 620px) { .is-embedded .deck__foot { display: none; } }
/* Tablets held upright */
@media (min-width: 600px) and (max-width: 899px) and (min-height: 761px) {
  .ph--tall { aspect-ratio: 16 / 10; max-height: 34vh; }
  .ld-flips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ld-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* Phones on their side */
@media (orientation: landscape) and (max-height: 500px) {
  .deck__bar { padding-top: 4px; padding-bottom: 4px; }
  .deck__brand svg { width: 22px; height: 22px; }
  .deck__sample { display: none; }
  .deck__nav { padding: 4px 12px max(4px, env(safe-area-inset-bottom)); }
  .deck__btn { min-height: 40px; }
  .deck__inner { padding: 12px max(20px, env(safe-area-inset-left)) 14px; gap: 12px; justify-content: flex-start; }
  .deck__cols, .deck__split, .deck__split--rev, .ld-hotspots--side { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 20px; align-items: start; }
  .deck__title { font-size: clamp(1.4rem, 4vw, 2rem) !important; }
  .deck__text { font-size: 0.9rem; }
  .ld-stats, .ld-stats--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ld-stat { padding: 10px 12px; }
  .ld-stat__num { font-size: 1.5rem; }
  .ph--tall, .ph--wide { aspect-ratio: 16 / 10; max-height: 58vh; }
  .ld-chart__bars { height: 34vh; }
  .ld-ba { max-width: min(100%, calc((100dvh - 150px) * 2)); }
  .deck__page--photo .deck__inner { justify-content: center; }
  .deck__page--photo .deck__inner > * { max-width: 70%; }
  .deck__foot { display: none; }
  .hide-short { display: none !important; }
}

/* Narrow phones of any height: smaller photos, two flip cards per row */
@media (max-width: 599px) {
  .ph--tall { aspect-ratio: 16 / 10; max-height: 30vh; }
  .shirt { display: none; }
  .ld-flips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ld-flip__btn { min-height: 160px; }
  .ld-flip__face { padding: 14px; gap: 6px; }
  .ld-flip__title { font-size: 1.15rem; }
  .ld-flip__price, .ld-flip__face .deck__small { font-size: 0.85rem; }
  .ld-flip__hint { font-size: 0.75rem; }
  .ld-flip__back .ld-flip__list { font-size: 0.8rem; gap: 4px; }
}
/* Small phones such as the iPhone SE */
@media (max-height: 640px) and (max-width: 599px) {
  .deck__inner { padding-top: 14px; padding-bottom: 14px; gap: 12px; }
  .deck__title { font-size: clamp(1.45rem, 6.6vw, 1.9rem) !important; }
  .deck__page--photo .deck__title { font-size: clamp(1.7rem, 8vw, 2.2rem) !important; }
  .deck__text { font-size: 0.9rem; line-height: 1.45; }
  .deck__eyebrow { font-size: 0.72rem; }
  .ld-terms > div { padding: 6px 0; gap: 10px; }
  .ld-terms dt, .ld-terms dd { font-size: 0.86rem; }
  .ld-stat { padding: 10px 12px; }
  .ld-stat__num { font-size: 1.6rem; }
  .ld-check__item label { min-height: 44px; padding: 6px 12px; font-size: 0.9rem; }
  .ld-check__list { gap: 5px; }
  .contact-card { padding: 12px 14px; gap: 2px; }
  .ld-calc { padding: 14px; gap: 10px; }
  .ld-calc__result output { font-size: 1.3rem; }
  .ld-chart__bars { height: 150px; }
  .ld-timeline__step { min-height: 36px; }
  .ld-flip__btn { min-height: 140px; }
  .chip-row li { padding: 5px 10px; font-size: 0.8rem; }
}
/* Phones on their side: keep flip cards readable */
@media (orientation: landscape) and (max-height: 500px) {
  .ld-flips { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ld-flip__btn { min-height: 130px; }
  .deck__split--rev { grid-template-columns: 1fr !important; }
}

/* "More below" cue for pages taller than the screen */
.deck__more {
  position: sticky; bottom: 10px; left: 0; z-index: 2; display: flex; width: max-content; margin: -44px auto 10px; pointer-events: none;
  align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
  background: var(--ld-ink); color: var(--ld-surface); box-shadow: 0 6px 18px rgba(0,0,0,.25);
  opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s var(--ld-ease);
}
.deck__more svg { width: 14px; height: 14px; }
.deck__page.has-more .deck__more { opacity: 1; transform: none; }
.deck__page--photo .deck__more, .page--navy .deck__more, .page--claret .deck__more { background: #FFFFFF; color: #111; }
@media (max-width: 599px) { .ph--wide { max-height: 26vh; } }
@media (prefers-reduced-motion: reduce) { .deck__more { transition: none; } }
