/* mdPV — palette and styling derived from the app icon:
   parchment squircle (#f2e5b5), olive star (#a89e7b), dark quill (#2a2922). */

.mdpv-scope {
  --mdpv-parchment: #f7f0d8;
  --mdpv-parchment-deep: #ece0b4;
  --mdpv-olive: #a89e7b;
  --mdpv-olive-dark: #8a8160;
  --mdpv-quill: #2a2922;
  --mdpv-quill-soft: #4a4839;
  --mdpv-ink-muted: #6b6553;
  --mdpv-paper: #fffdf5;
  --mdpv-shadow: 0 18px 44px rgba(138, 129, 96, 0.28);
}

/* Section shell */

.mdpv-section {
  position: relative;
  overflow: hidden;
  padding-block: 3.4rem 3.6rem;
  background:
    radial-gradient(circle at 50% -10%, #fffae6 0, var(--mdpv-parchment) 42%, var(--mdpv-parchment-deep) 100%);
  border-block: 1px solid rgba(168, 158, 123, 0.4);
  color: var(--mdpv-quill);
}

/* Oversized watermark star, echoing the icon's background glyph. */
.mdpv-section::before {
  content: "";
  position: absolute;
  top: -14%;
  right: -8%;
  width: 480px;
  height: 480px;
  background: url("../assets/mdpv/icon/mdpv-star.svg") no-repeat center / contain;
  opacity: 0.14;
  pointer-events: none;
}

.mdpv-section > .container {
  position: relative;
  z-index: 1;
}

/* Header */

.mdpv-header {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-bottom: 0.4rem;
}

.mdpv-app-icon {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  flex-shrink: 0;
  box-shadow: 0 10px 22px rgba(138, 129, 96, 0.45);
}

.mdpv-section h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: -0.02em;
  color: var(--mdpv-quill);
}

.mdpv-eyebrow {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.15rem 0.7rem;
  border-radius: var(--radius-pill);
  background: rgba(42, 41, 34, 0.08);
  border: 1px solid rgba(138, 129, 96, 0.4);
  color: var(--mdpv-quill-soft);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.mdpv-lede {
  max-width: 46rem;
  margin: 0.6rem 0 1.6rem;
  color: var(--mdpv-ink-muted);
  font-size: 1rem;
}

/* Feature grid */

.mdpv-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2.2rem;
}

.mdpv-feature {
  padding: 1.1rem 1.2rem;
  border-radius: 14px;
  background: rgba(255, 253, 245, 0.72);
  border: 1px solid rgba(168, 158, 123, 0.45);
  box-shadow: 0 8px 20px rgba(168, 158, 123, 0.18);
}

.mdpv-feature h3 {
  margin: 0 0 0.35rem;
  font-size: 0.98rem;
  color: var(--mdpv-quill);
}

.mdpv-feature p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--mdpv-ink-muted);
}

/* Carousel */

.mdpv-carousel {
  position: relative;
  margin-bottom: 1.4rem;
}

.mdpv-viewport {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(138, 129, 96, 0.5);
  box-shadow: var(--mdpv-shadow);
  background: var(--mdpv-parchment);
  touch-action: pan-y pinch-zoom;
}

.mdpv-track {
  display: flex;
  transition: transform 420ms cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

.mdpv-slide {
  flex: 0 0 100%;
  min-width: 100%;
}

.mdpv-slide button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.mdpv-slide img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

/* Arrows */

.mdpv-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(138, 129, 96, 0.55);
  background: rgba(255, 253, 245, 0.92);
  color: var(--mdpv-quill);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(138, 129, 96, 0.35);
  transition:
    background var(--transition-fast),
    transform var(--transition-fast),
    opacity var(--transition-fast);
}

.mdpv-arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.06);
}

.mdpv-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.mdpv-prev { left: 12px; }
.mdpv-next { right: 12px; }

/* Caption + dots */

.mdpv-caption {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--mdpv-ink-muted);
  min-height: 1.4em;
}

.mdpv-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 0.7rem;
}

.mdpv-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(138, 129, 96, 0.35);
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.mdpv-dot.is-active {
  background: var(--mdpv-quill);
  box-shadow: 0 0 0 4px rgba(42, 41, 34, 0.14);
}

/* Buttons */

.mdpv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.8rem;
}

.btn-quill {
  background: linear-gradient(135deg, var(--mdpv-quill-soft), var(--mdpv-quill));
  color: var(--mdpv-parchment);
  box-shadow: 0 14px 30px rgba(42, 41, 34, 0.32);
}

.btn-quill:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(42, 41, 34, 0.42);
}

.btn-parchment {
  background: rgba(255, 253, 245, 0.9);
  color: var(--mdpv-quill);
  border-color: rgba(138, 129, 96, 0.55);
}

.btn-parchment:hover {
  background: #fff;
}

.mdpv-note {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--mdpv-ink-muted);
}

/* Lightbox */

.mdpv-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(29, 28, 22, 0.9);
  backdrop-filter: blur(6px);
}

.mdpv-lightbox.is-open {
  display: flex;
}

.mdpv-lightbox-panel {
  display: grid;
  gap: 12px;
  justify-items: center;
  width: min(1180px, 100%);
}

.mdpv-lightbox img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(242, 229, 181, 0.35);
}

.mdpv-lightbox-caption {
  color: rgba(247, 240, 216, 0.9);
  font-size: 0.92rem;
  text-align: center;
}

.mdpv-lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(242, 229, 181, 0.4);
  background: rgba(42, 41, 34, 0.7);
  color: var(--mdpv-parchment);
  font-size: 1.2rem;
  cursor: pointer;
}

/* Whole-page parchment treatment.

   `.mdpv-page` is set on <body> for every /mdpv route, so the landing page
   and its support/privacy subpages share one palette. The landing page
   paints its own gradient inside `.mdpv-section`; here we tint the page
   chrome (body, header, footer) so nothing reverts to the site's blue. */

.mdpv-page {
  /* `fixed` keeps the radial centre anchored to the viewport rather than
     repeating down a long page, and paints the full canvas even when the
     document is taller than one screen. */
  background: radial-gradient(circle at top, #fffae6 0, var(--mdpv-parchment) 45%, var(--mdpv-parchment-deep) 100%)
    fixed no-repeat;
  background-color: var(--mdpv-parchment-deep);
  min-height: 100vh;
  color: var(--mdpv-quill);
}

.mdpv-page .site-header {
  background: linear-gradient(
    to bottom,
    rgba(247, 240, 216, 0.95),
    rgba(247, 240, 216, 0.85),
    transparent
  );
  border-bottom-color: rgba(168, 158, 123, 0.5);
}

.mdpv-page .site-brand a {
  color: var(--mdpv-quill);
}

.mdpv-page .site-nav a {
  color: var(--mdpv-ink-muted);
}

.mdpv-page .site-nav li.active a,
.mdpv-page .site-nav a:hover {
  color: var(--mdpv-quill);
  background: rgba(42, 41, 34, 0.07);
  border-color: rgba(138, 129, 96, 0.5);
}

.mdpv-page .site-footer {
  background: rgba(236, 224, 180, 0.55);
  border-top-color: rgba(168, 158, 123, 0.5);
}

.mdpv-page .site-footer p {
  color: var(--mdpv-ink-muted);
}

/* Long-form subpages (support, privacy) */

.mdpv-page .page-content h1,
.mdpv-page .page-content h2,
.mdpv-page .page-content h3 {
  color: var(--mdpv-quill);
}

.mdpv-page .page-content p,
.mdpv-page .page-content li {
  color: var(--mdpv-ink-muted);
}

.mdpv-page .page-content strong {
  color: var(--mdpv-quill);
}

.mdpv-page .page-content a {
  color: var(--mdpv-quill);
  text-decoration-color: rgba(138, 129, 96, 0.6);
  text-underline-offset: 2px;
}

.mdpv-page .page-content a:hover {
  text-decoration-color: var(--mdpv-quill);
}

/* Inline code on parchment: paper tile rather than the default grey. */
.mdpv-page .page-content code {
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: rgba(255, 253, 245, 0.9);
  border: 1px solid rgba(168, 158, 123, 0.45);
  color: var(--mdpv-quill);
}

.mdpv-page .page-content h2 {
  margin-top: 2rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(168, 158, 123, 0.35);
}

/* Footer nav, mirroring the SudokuFlow pattern. */

.mdpv-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.mdpv-footer-nav a {
  color: var(--mdpv-ink-muted);
  text-decoration: none;
}

.mdpv-footer-nav a:hover {
  color: var(--mdpv-quill);
  text-decoration: underline;
}

.mdpv-footer-nav span {
  color: rgba(138, 129, 96, 0.65);
}

/* Responsive */

@media (max-width: 768px) {
  .mdpv-section::before {
    width: 300px;
    height: 300px;
    opacity: 0.1;
  }

  .mdpv-header {
    gap: 0.8rem;
  }

  .mdpv-app-icon {
    width: 58px;
    height: 58px;
    border-radius: 14px;
  }

  .mdpv-arrow {
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mdpv-track {
    transition: none;
  }
}
