/* static/css/marketing/pages/report.css
   Homepage only: the Vision & Technology Report section and its flipbook
   reader (native <dialog>; marketing.js sizes the book and turns pages).
   Kept out of marketing.css so the shared core stays within its budget.
   Tokens (--mk-*) come from marketing.css. No inline styles (CSP). */

/* Vision & technology report: same split + glow frame as the intelligence
   section; the cover is the PDF's first page, shown whole (no crop). */
.mk-site .mk-report__name {
  margin-top: 24px;
  color: var(--mk-ink-2);
  font-weight: 600;
  line-height: 1.5;
}

.mk-site .mk-report__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 32px;
}

.mk-site .mk-report__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--mk-subtle);
  font-size: 0.9rem;
  font-weight: 600;
}

.mk-site .mk-report__frame {
  max-width: 520px;
  margin-inline: auto;
}

.mk-site .mk-report__cover {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--mk-line);
  border-radius: var(--mk-radius-md);
  background: var(--mk-surface);
  box-shadow: var(--mk-shadow-md);
  transition: transform 0.6s var(--mk-ease), box-shadow 0.6s var(--mk-ease);
}

.mk-site .mk-report__img {
  display: block;
  width: 100%;
  height: auto;
}

.mk-site .mk-report__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 22px;
}

/* Report flipbook: native <dialog>; marketing.js sizes the book and turns
   the pages (transform only, so a turn stays on the compositor). */
html.mk-flipbook-open {
  overflow: hidden;
}

.mk-site .mk-flipbook {
  width: min(1320px, calc(100vw - 48px));
  height: min(920px, calc(100vh - 48px));
  height: min(920px, calc(100dvh - 48px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  border: 1px solid var(--mk-on-dark-line);
  border-radius: var(--mk-radius-lg);
  background: var(--mk-navy-950);
  color: var(--mk-on-dark);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.6);
}

.mk-site .mk-flipbook[open] {
  display: block;
}

.mk-site .mk-flipbook__panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  background: var(--mk-navy-950);
  color: var(--mk-on-dark);
}

.mk-site .mk-flipbook::backdrop {
  background: rgba(3, 12, 28, 0.84);
}

.mk-site .mk-flipbook__panel.is-fullscreen {
  width: 100vw;
  height: 100vh;
}

.mk-site .mk-flipbook__bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px 10px 24px;
  border-bottom: 1px solid var(--mk-on-dark-line);
}

.mk-site .mk-flipbook__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--mk-on-dark-soft);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mk-site .mk-flipbook__tools {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}

.mk-site .mk-flipbook__tool,
.mk-site .mk-flipbook__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s var(--mk-ease), opacity 0.2s var(--mk-ease);
}

.mk-site .mk-flipbook__tool[hidden] {
  display: none;
}

.mk-site .mk-flipbook__tool:hover,
.mk-site .mk-flipbook__arrow:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.mk-site .mk-flipbook__tool[aria-disabled="true"],
.mk-site .mk-flipbook__arrow[aria-disabled="true"] {
  opacity: 0.35;
  cursor: default;
}

.mk-site .mk-flipbook__close {
  margin-left: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.mk-site .mk-flipbook__zoom {
  min-width: 48px;
  color: var(--mk-on-dark-soft);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.mk-site .mk-flipbook__fs-on,
.mk-site .mk-flipbook__fs-off {
  display: inline-flex;
}

.mk-site .mk-flipbook__fs-off,
.mk-site [aria-pressed="true"] > .mk-flipbook__fs-on {
  display: none;
}

.mk-site [aria-pressed="true"] > .mk-flipbook__fs-off {
  display: inline-flex;
}

.mk-site .mk-flipbook__stage {
  position: relative;
  display: flex;
  overflow: hidden;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 40%, rgba(43, 107, 224, 0.2), transparent 70%);
  /* horizontal swipes reach the script; vertical pan and pinch stay native */
  touch-action: pan-y pinch-zoom;
}

.mk-site .mk-flipbook__stage.is-zoomed {
  overflow: auto;
  touch-action: auto;
}

.mk-site .mk-flipbook__book {
  position: relative;
  flex: 0 0 auto;
  margin: auto;
  perspective: 2400px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.mk-site .mk-flipbook__stage.is-zoomed .mk-flipbook__book {
  cursor: default;
}

.mk-site .mk-flipbook__page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 6px;
  background: #eef2f8;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
}

.mk-site .mk-flipbook__page.is-blank {
  background: transparent;
  box-shadow: none;
}

.mk-site .mk-flipbook__book.is-double .mk-flipbook__page {
  width: 50%;
}

.mk-site .mk-flipbook__page--left {
  border-radius: 6px 0 0 6px;
}

.mk-site .mk-flipbook__book.is-double .mk-flipbook__page--right {
  left: 50%;
  border-radius: 0 6px 6px 0;
}

/* Spine shading where the two pages meet. */
.mk-site .mk-flipbook__page--left:not(.is-blank)::after,
.mk-site .mk-flipbook__page--right:not(.is-blank)::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10%;
  pointer-events: none;
}

.mk-site .mk-flipbook__page--left:not(.is-blank)::after {
  right: 0;
  background: linear-gradient(to left, rgba(6, 22, 49, 0.2), transparent);
}

.mk-site .mk-flipbook__page--right:not(.is-blank)::after {
  left: 0;
  background: linear-gradient(to right, rgba(6, 22, 49, 0.2), transparent);
}

.mk-site .mk-flipbook__img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mk-site .mk-flipbook__leaf {
  position: absolute;
  top: 0;
  z-index: 2;
  height: 100%;
  transform-style: preserve-3d;
  pointer-events: none;
}

.mk-site .mk-flipbook__leaf.is-turning {
  transition: transform 0.65s cubic-bezier(0.45, 0.05, 0.25, 1);
  will-change: transform;
}

.mk-site .mk-flipbook__leaf--right {
  left: 50%;
  width: 50%;
  transform-origin: left center;
}

.mk-site .mk-flipbook__leaf--left {
  left: 0;
  width: 50%;
  transform-origin: right center;
}

.mk-site .mk-flipbook__leaf--single {
  left: 0;
  width: 100%;
  transform-origin: left center;
}

.mk-site .mk-flipbook__leaf .mk-flipbook__face {
  left: 0;
  width: 100%;
  border-radius: 6px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.mk-site .mk-flipbook__leaf .mk-flipbook__face--back {
  transform: rotateY(180deg);
}

/* The sheet darkens slightly mid-turn (opacity only). */
.mk-site .mk-flipbook__leaf.is-turning .mk-flipbook__face::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(6, 22, 49, 0.28), rgba(6, 22, 49, 0.06));
  opacity: 0;
  pointer-events: none;
  animation: mk-flipbook-shade 0.65s ease-in-out;
}

@keyframes mk-flipbook-shade {
  50% {
    opacity: 1;
  }
}

.mk-site .mk-flipbook__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--mk-on-dark-line);
}

.mk-site .mk-flipbook__arrow {
  width: 48px;
  height: 48px;
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: var(--mk-radius-pill);
  background: rgba(255, 255, 255, 0.06);
}

.mk-site .mk-flipbook__status {
  min-width: 128px;
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

@media (max-width: 639px) {
  .mk-site .mk-flipbook {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .mk-site .mk-flipbook__bar {
    gap: 8px;
    padding: 8px 8px 8px 16px;
  }

  .mk-site .mk-flipbook__stage {
    padding: 12px;
  }

  .mk-site .mk-flipbook__zoom {
    display: none;
  }
}

@media (max-width: 479px) {
  /* The toolbar needs the width; the title stays for assistive tech. */
  .mk-site .mk-flipbook__title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .mk-site .mk-flipbook__bar {
    justify-content: flex-end;
  }

  .mk-site .mk-flipbook__tool {
    width: 40px;
    height: 40px;
  }

  .mk-site .mk-flipbook__close {
    margin-left: 4px;
  }
}

@media (max-width: 639px) {
  .mk-site .mk-report__actions .mk-btn {
    width: 100%;
    height: auto;
    min-height: 54px;
    padding-block: 14px;
    white-space: normal;
    line-height: 1.3;
    text-align: center;
  }
}

@media (min-width: 992px) {
  .mk-site .mk-report__cover:hover {
    transform: translateY(-6px);
    box-shadow: var(--mk-shadow-md), var(--mk-shadow-glow);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mk-site .mk-report__cover,
  .mk-site .mk-report__cover:hover {
    transition: none;
    transform: none;
  }

  .mk-site .mk-flipbook__leaf.is-turning {
    transition: none;
  }
}
