/* decks.css: "One deck skill, four brand languages" (presentations/CONCEPT.md section 6, SPEC.md B.5).
   Every selector is scoped under .decks. Tokens come from css/site.css.
   No brand colour lives here: brand colour reaches the page only through the
   posters and the deck iframes. */

/* ------------------------------------------------------------ section */
.decks { position: relative; background: var(--bg); padding: clamp(96px, 14vh, 160px) var(--gutter); }
.decks .decks-head { max-width: 760px; }
.decks .nb { white-space: nowrap; }
.decks .decks-head .statement { margin-top: 20px; max-width: 22ch; }
.decks .decks-head .body { margin-top: 16px; }

/* ------------------------------------------------------------ cards */
.decks .decks-list { display: grid; gap: 96px; max-width: 1600px; margin-top: clamp(48px, 8vh, 88px); }
.decks .deck-card { display: grid; gap: 24px; min-width: 0; }
.decks .deck-caption { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.decks .deck-caption .label { color: var(--ink-faint); }
.decks .deck-title { margin: 14px 0 0; font-size: clamp(22px, 2.2vw, 30px); font-weight: 500; letter-spacing: -.02em; line-height: 1.15; color: var(--ink); max-width: 22ch; text-wrap: balance; }
.decks .deck-caption .body { margin-top: 12px; max-width: 40ch; }
.decks .deck-caption .micro { margin-top: 14px; max-width: 44ch; }

/* four decks in a two by two grid from 1024 px: screen above caption, both columns the same (SPEC.md B.5) */
@media (min-width: 1024px) {
  .decks .decks-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(32px, 4vw, 72px); row-gap: clamp(64px, 9vh, 104px); }
  .decks .deck-card { align-content: start; }
}
.decks .deck-card:focus { outline: none; }
.decks .deck-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 8px; border-radius: var(--r-lg); }

/* ------------------------------------------------------------ the screen */
.decks .deck-screen {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden;
  isolation: isolate; transform: translateZ(0);
  transition: transform var(--t-ui) var(--ease-soft);
}
/* the slab: background plus a 1px line. It draws in from the centre on entrance. */
.decks .deck-frame {
  position: absolute; inset: 0; z-index: 0; border-radius: inherit; pointer-events: none;
  background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line);
}
.decks .deck-poster, .decks .deck-live {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; border: 0; margin: 0;
}
.decks .deck-poster { z-index: 1; object-fit: cover; }
.decks .deck-live { z-index: 2; opacity: 0; pointer-events: none; background: transparent; transition: opacity var(--t-ui) var(--ease-soft); }
.decks .deck-live.is-shown { opacity: 1; }
/* a hairline on top of the media so the edge never reads as a hard cut against the page */
.decks .deck-screen::after {
  content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--line);
}
.decks .deck-tag {
  position: absolute; left: 14px; top: 14px; z-index: 4; pointer-events: none;
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 11px;
  border-radius: var(--r-pill); background: rgba(0, 0, 0, .6); color: var(--ink);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; line-height: 1;
}
.decks .deck-open { position: absolute; inset: 0; z-index: 5; cursor: pointer; border-radius: inherit; }

/* focus dimming: only the live deck is lit (one light in a dark room) */
.decks.is-armed .deck-poster, .decks.is-armed .deck-live { transition: opacity var(--t-ui) var(--ease-soft), filter 600ms var(--ease-soft); }
.decks.is-armed .deck-card:not(.is-live) .deck-poster,
.decks.is-armed .deck-card:not(.is-live) .deck-live { filter: brightness(.55) saturate(.85); }

/* play button for data saver and low memory devices */
.decks .deck-play {
  position: absolute; left: 50%; top: 50%; z-index: 6; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: rgba(0, 0, 0, .66); color: var(--ink);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 13px; font-weight: 500; cursor: pointer;
}
.decks .deck-play[hidden] { display: none; }

/* ------------------------------------------------------------ caption meter (live trailer position) */
.decks .deck-meter {
  margin: 22px 0 0; display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; row-gap: 10px;
  width: min(100%, 300px); font-size: 12px; letter-spacing: .04em; line-height: 1.2; color: var(--ink-faint);
  font-variant-numeric: tabular-nums; opacity: 0; transition: opacity var(--t-ui) var(--ease-soft);
}
.decks .deck-card.is-loaded .deck-meter { opacity: 1; }
.decks .deck-meter-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); }
.decks .deck-meter.is-playing .deck-meter-dot { background: var(--accent); box-shadow: 0 0 0 0 var(--accent-glow); animation: decks-pulse 1.6s var(--ease-soft) infinite; }
.decks .deck-meter.is-playing { color: var(--ink-dim); }
.decks .deck-meter-bar { grid-column: 1 / -1; position: relative; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.decks .deck-meter-bar i { position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 700ms var(--ease-out); }
@keyframes decks-pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ------------------------------------------------------------ link */
.decks .deck-link {
  margin-top: 22px; display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500;
  border-bottom: 1px solid var(--line); transition: border-color var(--t-ui) var(--ease-soft), color var(--t-ui) var(--ease-soft);
}
.decks .deck-link .arrow { flex: none; transition: transform var(--t-ui) var(--ease-soft); }
.decks .deck-link:hover, .decks .deck-link:focus-visible { border-color: var(--accent); }
/* the TrustFinance card also points down to the product, section 06 */
.decks .deck-sec { margin-top: 6px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink-dim); text-decoration: none; font-size: 14px; font-weight: 500; transition: color var(--t-ui) var(--ease-soft); }
.decks .deck-sec .arrow { flex: none; transition: transform var(--t-ui) var(--ease-soft); }
.decks .deck-sec:hover, .decks .deck-sec:focus-visible { color: var(--ink); }
.decks .deck-sec:hover .arrow { transform: translateY(3px); }
.decks .deck-sec:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.decks .deck-link:hover .arrow, .decks .deck-link:focus-visible .arrow { transform: translateX(4px); }

@media (hover: hover) and (pointer: fine) {
  .decks .deck-card:hover .deck-screen { transform: scale(1.01); }
  .decks .deck-card:hover .deck-link { border-color: var(--accent); }
  .decks .deck-card:hover .deck-link .arrow { transform: translateX(4px); }
}

/* ------------------------------------------------------------ comparison */
.decks .decks-compare { max-width: 1600px; margin-top: clamp(80px, 12vh, 128px); }
.decks .decks-compare table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.decks .decks-compare th, .decks .decks-compare td { text-align: left; vertical-align: top; padding: 18px 24px 18px 0; border-top: 1px solid var(--line); }
.decks .decks-compare thead th, .decks .decks-compare thead td { border-top: 0; padding-top: 0; padding-bottom: 14px; font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-dim); }
.decks .decks-compare thead td { width: 14%; }
.decks .decks-compare tbody th { font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); padding-top: 21px; }
.decks .decks-compare tbody td { font-size: 15px; line-height: 1.5; color: var(--ink-dim); }
.decks .decks-foot { margin-top: 28px; max-width: 72ch; line-height: 1.55; }
/* the print sheet (fx/riso) replaces the table once it is ready; the table stays for screen readers */
.decks .decks-compare.has-sheet .decks-table { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.decks .decks-compare { position: relative; }
.decks .decks-sheet { margin: 0; }
.decks .decks-join { margin-top: clamp(72px, 10vh, 112px); }

/* ------------------------------------------------------------ entrance (only once JS marks the section) */
.decks.is-ready:not(.is-reduced) .decks-head > * { opacity: 0; transform: translateY(12px); transition: opacity var(--t-reveal) var(--ease-out), transform var(--t-reveal) var(--ease-out); }
.decks.is-ready:not(.is-reduced) .decks-head > :nth-child(2) { transition-delay: 80ms; }
.decks.is-ready:not(.is-reduced) .decks-head > :nth-child(3) { transition-delay: 160ms; }
.decks.is-ready:not(.is-reduced) .decks-head.is-in > * { opacity: 1; transform: none; }

.decks.is-ready:not(.is-reduced) .deck-frame { clip-path: inset(0 50% 0 50% round var(--r-lg)); transition: clip-path var(--t-reveal) var(--ease-out); }
.decks.is-ready:not(.is-reduced) .deck-poster { opacity: 0; transition: opacity 700ms var(--ease-soft) 420ms, filter 600ms var(--ease-soft); }
.decks.is-ready:not(.is-reduced) .deck-tag { opacity: 0; transition: opacity var(--t-ui) var(--ease-soft) 700ms; }
.decks.is-ready:not(.is-reduced) .deck-caption > * { opacity: 0; transform: translateY(12px); transition: opacity var(--t-reveal) var(--ease-out) 200ms, transform var(--t-reveal) var(--ease-out) 200ms; }
.decks.is-ready:not(.is-reduced) .deck-card.is-in .deck-frame { clip-path: inset(0 0 0 0 round var(--r-lg)); }
.decks.is-ready:not(.is-reduced) .deck-card.is-in .deck-poster,
.decks.is-ready:not(.is-reduced) .deck-card.is-in .deck-tag { opacity: 1; }
.decks.is-ready:not(.is-reduced) .deck-card.is-in .deck-caption > * { opacity: 1; transform: none; }
/* the meter's own fade is driven by .is-loaded */
.decks.is-ready:not(.is-reduced) .deck-card.is-in .deck-caption > .deck-meter { opacity: 0; }
.decks.is-ready:not(.is-reduced) .deck-card.is-in.is-loaded .deck-caption > .deck-meter { opacity: 1; }

.decks.is-ready:not(.is-reduced) .decks-compare { opacity: 0; transform: translateY(12px); transition: opacity var(--t-reveal) var(--ease-out), transform var(--t-reveal) var(--ease-out); }
.decks.is-ready:not(.is-reduced) .decks-compare.is-in { opacity: 1; transform: none; }

/* ------------------------------------------------------------ tablet and mobile */
@media (max-width: 1023px) {
  .decks .decks-list { gap: 72px; }
  .decks .deck-caption .body { max-width: 52ch; }
}
@media (max-width: 820px) {
  .decks .decks-list { gap: 64px; }
  .decks .deck-card { gap: 18px; }
  .decks .deck-tag { left: 10px; top: 10px; min-height: 22px; padding: 0 9px; font-size: 10px; }
  .decks .deck-meter { margin-top: 18px; }
  .decks .deck-link { margin-top: 16px; }

  /* comparison becomes one block per row, each answer labelled with its brand */
  .decks .decks-compare table, .decks .decks-compare tbody, .decks .decks-compare tr,
  .decks .decks-compare th, .decks .decks-compare td { display: block; width: auto; }
  .decks .decks-compare thead { display: none; }
  .decks .decks-compare tr { border-top: 1px solid var(--line); padding: 18px 0 6px; }
  .decks .decks-compare tbody th { border: 0; padding: 0 0 10px; }
  .decks .decks-compare tbody td { border: 0; padding: 0 0 12px; font-size: 14px; }
  .decks .decks-compare tbody td::before { content: attr(data-brand); display: block; font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 2px; }
}

/* ------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  .decks .deck-screen, .decks .deck-link, .decks .deck-link .arrow, .decks .deck-live,
  .decks .deck-poster, .decks .deck-meter, .decks .deck-meter-bar i { transition: none; }
  .decks .deck-meter-dot { animation: none; }
  .decks .deck-card:hover .deck-screen { transform: none; }
}
.decks.is-reduced .deck-screen, .decks.is-reduced .deck-poster { transition: none; }
.decks.is-reduced .deck-card:hover .deck-screen { transform: none; }
