/* Field-atlas layer for the public site (home and docs are intentionally
   excluded). It adds chapter numbering, hairlines and hover depth; page-specific
   grids, nav and the daisy-bloom footer remain owned by their own files. */

:root {
  --atlas-rule: color-mix(in srgb, currentColor 12%, transparent);
  --atlas-brass: color-mix(in srgb, #c6a66b 48%, transparent);
  --atlas-glow: color-mix(in srgb, #c6a66b 26%, transparent);
}

main {
  position: relative;
  isolation: isolate;
  counter-reset: atlas-chapter;
}

main :where(h1, h2) { text-wrap: balance; }
main :where(p) { text-wrap: pretty; }

main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(90deg, transparent calc(100% - 1px), var(--atlas-rule) calc(100% - 1px)),
    linear-gradient(0deg, transparent calc(100% - 1px), var(--atlas-rule) calc(100% - 1px));
  background-size: calc(100% / 12) 5.5rem;
  opacity: .22;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent, black 12%, black 78%, transparent);
  mask-image: linear-gradient(180deg, transparent, black 12%, black 78%, transparent);
}

main > section {
  position: relative;
  counter-increment: atlas-chapter;
}

main > section::before {
  content: "";
  position: absolute;
  top: 0;
  right: max(20px, calc((100% - 1240px) / 2));
  left: max(20px, calc((100% - 1240px) / 2));
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--atlas-rule) 18%, var(--atlas-brass) 50%, var(--atlas-rule) 82%, transparent);
  pointer-events: none;
}

main > section::after {
  content: counter(atlas-chapter, decimal-leading-zero);
  position: absolute;
  top: clamp(18px, 2.4vw, 34px);
  right: max(20px, calc((100% - 1240px) / 2));
  color: color-mix(in srgb, currentColor 6%, transparent);
  font: italic 400 clamp(62px, 8vw, 118px)/.72 Georgia, "Times New Roman", serif;
  letter-spacing: -.08em;
  -webkit-text-stroke: 1px color-mix(in srgb, currentColor 14%, transparent);
  pointer-events: none;
  user-select: none;
}

main > section:first-child::before {
  display: none;
}

.wrap {
  position: relative;
}

:where(.card, .dl__card, .tier, .plan-card, .market-card, .work-card, .asset-card, .product-card) {
  transition:
    transform var(--t) var(--ease),
    border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  :where(.card, .dl__card, .tier, .plan-card, .market-card, .work-card, .asset-card, .product-card):hover {
    transform: translateY(-3px);
    border-color: var(--atlas-brass);
    box-shadow:
      0 18px 44px -30px var(--atlas-glow),
      inset 0 1px color-mix(in srgb, currentColor 10%, transparent);
  }
}

:where(.btn, .btn--solid, .btn--ghost) {
  transition:
    border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease),
    transform var(--t) var(--ease);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  :where(.btn, .btn--solid, .btn--ghost):hover {
    box-shadow: 0 10px 28px -22px var(--atlas-glow);
  }
}

:where(.eyebrow, .dl__k) {
  letter-spacing: .18em;
}

::selection {
  background: color-mix(in srgb, #c6a66b 34%, transparent);
}

@media (max-width: 720px) {
  main::before {
    background-size: calc(100% / 6) 4.5rem;
    opacity: .14;
  }

  main > section::before {
    right: 16px;
    left: 16px;
  }

  main > section::after {
    top: 14px;
    right: 16px;
    font-size: 54px;
    opacity: .7;
  }
}

@media (prefers-reduced-motion: reduce) {
  main::before {
    opacity: .12;
  }
}
