/* ══════════════════════════════════════════════════════════
   Marketing shell — scoped tokens, typography, primitives
   ──────────────────────────────────────────────────────────
   Scope: every selector below is qualified with .opd-marketing
   so the design tokens NEVER leak into the authenticated app.

   Token strategy — two-layer approach:
     CORE CHROME  (--mkt-bg, --mkt-ink, --mkt-card)
       Derives from semantic tokens so holiday themes propagate
       automatically to marketing surfaces.
     SET-PIECE PALETTE  (--mkt-sun, --mkt-sky, --mkt-sage, etc.)
       Literal values — these are the marketing whimsy colors
       intentionally distinct from Golden Hour. Do NOT derive;
       holiday themes must not inadvertently alter them.

   DARK BLOCK keeps the #14161E family as literal values
   (UPPERCASE) — the marketing dark look is a designed identity,
   not a derivation from the app dark palette.

   CTA/accent usages inside nav (tab active states, CTA buttons
   that are amber-accented) derive from --accent so holiday themes
   reach marketing CTAs. Set-piece decorative usages stay on
   --mkt-* tokens.
   ══════════════════════════════════════════════════════════ */

/* ── Marketing palette tokens (light) ────────────────────── */
.opd-marketing {
  /* Core chrome — derives from semantic tokens.
     Holiday themes propagate here automatically. */
  --mkt-bg:   var(--surface);
  --mkt-bg-2: var(--surface-sunken);
  --mkt-bg-3: var(--border-strong);
  --mkt-card: var(--surface-raised);
  --mkt-ink:  var(--text);
  --mkt-ink-2: var(--text-soft);
  --mkt-ink-3: var(--text-muted);

  /* Set-piece / marketing palette — intentionally literal.
     These whimsy pastels are distinct from Golden Hour tokens;
     do NOT derive or holiday themes will alter the hero palette. */
  --mkt-card-2:   #FFFAF0;
  --mkt-line:     rgba(31, 34, 48, 0.08);
  --mkt-sky:      #6FB6E0;
  --mkt-sky-deep: #4A95C2;
  --mkt-sun:      #F4C141;
  --mkt-sun-deep: #E0A920;
  --mkt-sage:     #B8C9A8;
  --mkt-rose:     #E8A29B;

  background: var(--mkt-bg);
  color: var(--mkt-ink);
  font-family:
    "DM Sans",
    "Nunito",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* Fill the flex-column body so the footer inside this shell
     is pushed to the bottom of the viewport on short pages. */
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}

/* DARK BLOCK — designed distinct identity; keep literal (UPPERCASE).
   Core chrome re-points intentionally to the #14161E family (not
   the app's --surface/#1E2D40 family). Set-piece accent updates. */
[data-theme="dark"] .opd-marketing {
  --mkt-bg:   #14161E;
  --mkt-bg-2: #1B1E28;
  --mkt-bg-3: #232735;
  --mkt-card: #1E2230;
  --mkt-card-2: #232838;
  --mkt-ink:  #F5EFE2;
  --mkt-ink-2: #C8C4B7;
  --mkt-ink-3: #8E8B83;
  --mkt-line: rgba(245, 239, 226, 0.1);
  --mkt-sky:  #7CC0E8;
  --mkt-sun:  #F8CB54;
}

/* ── Typography helpers (scoped) ─────────────────────────── */
.opd-marketing .opd-display {
  font-family: "Fredoka", "DM Sans", sans-serif;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.02;
}

.opd-marketing .opd-mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.opd-marketing .opd-italic {
  font-family: "Fraunces", "DM Sans", serif;
  font-style: italic;
  font-weight: 400;
}

.opd-marketing .opd-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--mkt-bg-3);
  color: var(--mkt-ink-2);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Reset (scoped, light touch) ─────────────────────────── */
.opd-marketing *,
.opd-marketing *::before,
.opd-marketing *::after {
  box-sizing: border-box;
}

.opd-marketing button {
  font-family: inherit;
  cursor: pointer;
}

.opd-marketing a {
  color: inherit;
}

/* ── Buttons ─────────────────────────────────────────────── */
.opd-marketing .mkt-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  border: none;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.opd-marketing .mkt-btn--primary {
  background: var(--mkt-ink);
  color: var(--mkt-bg);
}
.opd-marketing .mkt-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(31, 34, 48, 0.15);
}

/* Set-piece CTA — intentionally stays on --mkt-sun (marketing whimsy palette), NOT --accent; holiday themes do not re-skin it. */
.opd-marketing .mkt-btn--sun {
  background: var(--mkt-sun);
  /* Fixed dark ink — the button is yellow in both themes, so text must
     never follow --mkt-ink (which flips light in dark mode). */
  color: #1F2230;
}
.opd-marketing .mkt-btn--sun:hover {
  background: var(--mkt-sun-deep);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(244, 193, 65, 0.5);
}

.opd-marketing .mkt-btn--ghost {
  background: transparent;
  color: var(--mkt-ink);
  border: 1.5px solid var(--mkt-line);
}
.opd-marketing .mkt-btn--ghost:hover {
  background: var(--mkt-bg-2);
}

/* ── Card primitive ──────────────────────────────────────── */
.opd-marketing .mkt-card {
  background: var(--mkt-card);
  border-radius: 28px;
  border: 1px solid var(--mkt-line);
}

/* ── Photo placeholder ───────────────────────────────────── */
.opd-marketing .photo-ph {
  position: relative;
  border-radius: 24px;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(31, 34, 48, 0.04) 0 12px,
      rgba(31, 34, 48, 0.07) 12px 24px
    ),
    var(--mkt-bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
[data-theme="dark"] .opd-marketing .photo-ph {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(245, 239, 226, 0.04) 0 12px,
      rgba(245, 239, 226, 0.08) 12px 24px
    ),
    var(--mkt-bg-3);
}
.opd-marketing .photo-ph .lbl {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--mkt-ink-3);
  background: var(--mkt-bg);
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Drop-in marketing images (MarketingImage view component): the resolved
   <img> fills the .photo-ph box; label chip sits above it via z-index. */
.opd-marketing .mkt-img-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.opd-marketing .photo-ph .lbl {
  position: relative;
  z-index: 1;
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes mkt-drift {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(8px, -12px) rotate(8deg);
  }
}
@keyframes mkt-drift-2 {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(-10px, 10px) rotate(-6deg);
  }
}
@keyframes mkt-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
@keyframes mkt-fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes mkt-wag {
  0%,
  100% {
    transform: rotate(-4deg);
  }
  50% {
    transform: rotate(4deg);
  }
}

.opd-marketing .drift {
  animation: mkt-drift 7s ease-in-out infinite;
}
.opd-marketing .drift-2 {
  animation: mkt-drift-2 9s ease-in-out infinite;
}
.opd-marketing .marquee-track {
  display: flex;
  gap: 48px;
  animation: mkt-marquee 40s linear infinite;
  width: max-content;
}
.opd-marketing .reveal {
  animation: mkt-fade-up 0.6s ease-out both;
}
.opd-marketing .wag {
  animation: mkt-wag 1.2s ease-in-out infinite;
  transform-origin: bottom center;
}

/* Respect users who don't want motion */
@media (prefers-reduced-motion: reduce) {
  .opd-marketing .drift,
  .opd-marketing .drift-2,
  .opd-marketing .marquee-track,
  .opd-marketing .reveal,
  .opd-marketing .wag {
    animation: none !important;
  }
}

/* ── Hover lift utility ──────────────────────────────────── */
.opd-marketing .lift {
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}
.opd-marketing .lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(31, 34, 48, 0.1);
}

/* ── Section primitives ──────────────────────────────────── */
.opd-marketing .mkt-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 56px;
}

/* ── Emoji sticker — round chip with drop shadow ────────── */
.opd-marketing .mkt-sticker {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(31, 34, 48, 0.15);
  will-change: transform;
}
.opd-marketing .mkt-sticker__emoji {
  font-size: 26px;
  line-height: 1;
}

/* ──────────────────────────────────────────────────────────
   Sticky marketing top nav
   ────────────────────────────────────────────────────────── */
.opd-marketing .mkt-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--mkt-bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--mkt-line);
}
/* Match the authenticated _TopNav.cshtml treatment so the chrome
   feels like the same product across logged-in and logged-out views:
     - 60px bar height, 36px logo, 24px horizontal padding ceiling
     - Tabs centered via auto-margin, pill 50px radius, 8x16 padding
     - Muted default text, cream-mid hover, amber-tinted active
   See `wwwroot/css/components/topnav.css` for the canonical reference. */
.opd-marketing .mkt-nav__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 56px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.opd-marketing .mkt-nav__logo {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.opd-marketing .mkt-nav__logo img {
  /* One-line wordmark (~4.5:1). */
  height: 30px;
  width: auto;
}
.opd-marketing .mkt-nav__tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
}
.opd-marketing .mkt-nav__tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--mkt-ink-2);
  border: none;
  padding: 8px 16px;
  border-radius: 50px;
  min-height: 44px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}
.opd-marketing .mkt-nav__tab:hover {
  background: var(--mkt-bg-2);
  color: var(--mkt-ink);
}
/* Active tab — derives from --accent so holiday themes propagate */
.opd-marketing .mkt-nav__tab--active {
  background: var(--accent-soft);
  color: var(--accent);
}
.opd-marketing .mkt-nav__tab svg {
  width: 20px;
  height: 20px;
}
.opd-marketing .mkt-nav__cta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}
.opd-marketing .mkt-nav__cta .mkt-btn {
  padding: 10px 18px;
  font-size: 14px;
  min-height: 40px;
}

/* Footer rules live in components/site-footer.css so the
   same _MarketingFooter.cshtml partial can render under
   _Layout (authenticated) without requiring this shell. */

/* ── Narrow viewports ────────────────────────────────────── */
@media (max-width: 1100px) {
  .opd-marketing .mkt-nav__inner,
  .opd-marketing .mkt-section {
    padding-left: 24px;
    padding-right: 24px;
  }
}
@media (max-width: 640px) {
  .opd-marketing .mkt-nav__tabs {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════════
   Page scatter — floating blobs + emoji stickers for tall
   marketing pages (Product, For Business). Ornamental only.
   Rendered by Views/Shared/_MarketingScatter.cshtml inside a
   .mkt-scatter-page wrapper; sections sit above at z-index 1.
   ══════════════════════════════════════════════════════════ */
.opd-marketing .mkt-scatter-page {
  position: relative;
}
.opd-marketing .mkt-scatter-page > section {
  position: relative;
  z-index: 1;
}
.opd-marketing .mkt-scatter {
  /* Centered band matching the content column (.mkt-section) so blob
     offsets hug the content, not the viewport edges. */
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1520px;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.opd-marketing .mkt-scatter__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.55;
  will-change: transform;
}
.opd-marketing .mkt-scatter__blob--sun  { background: var(--mkt-sun); }
.opd-marketing .mkt-scatter__blob--sky  { background: var(--mkt-sky); }
.opd-marketing .mkt-scatter__blob--sage { background: var(--mkt-sage); }
.opd-marketing .mkt-scatter__blob--rose { background: var(--mkt-rose); }

/* Blob positions — percentages of full page height so they
   distribute regardless of the page's exact length. */
.opd-marketing .mkt-scatter__blob--p1 { width: 160px; height: 160px; top: 6%;  left: 18px; }
.opd-marketing .mkt-scatter__blob--p2 { width: 110px; height: 110px; top: 21%; right: 26px; }
.opd-marketing .mkt-scatter__blob--p3 { width: 90px;  height: 90px;  top: 38%; left: 40px; }
.opd-marketing .mkt-scatter__blob--p4 { width: 150px; height: 150px; top: 56%; right: 34px; }
.opd-marketing .mkt-scatter__blob--p5 { width: 104px; height: 104px; top: 73%; left: 30px; }
.opd-marketing .mkt-scatter__blob--p6 { width: 130px; height: 130px; top: 89%; right: 44px; }

/* Emoji stickers reuse the .mkt-sticker base (round chip + shadow) */
.opd-marketing .mkt-scatter__sticker { position: absolute; }
.opd-marketing .mkt-scatter__sticker--s1 { top: 13%; right: 7%;  background: var(--mkt-sky); }
.opd-marketing .mkt-scatter__sticker--s2 { top: 46%; left: 6%;   background: var(--mkt-sun); }
.opd-marketing .mkt-scatter__sticker--s3 { top: 80%; right: 9%;  background: var(--mkt-sage); }

@media (max-width: 1100px) {
  /* Thin the decoration on narrow viewports to avoid clutter */
  .opd-marketing .mkt-scatter__blob--p2,
  .opd-marketing .mkt-scatter__blob--p5,
  .opd-marketing .mkt-scatter__sticker { display: none; }
}

/* ══════════════════════════════════════════════════════════
   Set-piece panels — dark-mode contrast fix.
   The panel backgrounds (--mkt-sun/sky/sage/rose) are literal
   pastels that do NOT flip for dark, but --mkt-ink DOES — which
   would render light text on a light panel. Re-point the ink
   tokens to fixed dark within these panels so text stays legible
   in BOTH themes (a no-op in light, where --mkt-ink is already
   dark). Keeps the CTA buttons dark-pill + light-text.
   ══════════════════════════════════════════════════════════ */
.opd-marketing .mkt-hero__eyebrow,
.opd-marketing .mkt-bigquote,
.opd-marketing .mkt-finalcta,
.opd-marketing .mkt-bizteaser,
.opd-marketing .mkt-product-cta__panel,
.opd-marketing .mkt-biz-cta__panel,
.opd-marketing .mkt-biz-plan {
  --mkt-ink: #1F2230;
  --mkt-ink-2: rgba(31, 34, 48, 0.82);
  --mkt-ink-3: rgba(31, 34, 48, 0.6);
}
.opd-marketing .mkt-finalcta .mkt-btn--primary,
.opd-marketing .mkt-bizteaser .mkt-btn--primary,
.opd-marketing .mkt-product-cta__panel .mkt-btn--primary,
.opd-marketing .mkt-biz-cta__panel .mkt-btn--primary {
  background: #1F2230;
  color: #FBF7EE;
}
