/* ABOUTME: Carries variant B's system (docs/DESIGN.md) onto existing pages without rewriting them: ground, ink, display */
/* ABOUTME: face, one radius, one shadow. Scoped under .dp-page; linked only by DesignSystemPage when the flag is 'b'. */

/* Every rule is scoped under .dp-page, so this file changes nothing outside a page wrapped in DesignSystemPage, and that
   wrapper renders its children unchanged (no element, no link) when NEXT_PUBLIC_DESIGN_PASS is not 'b'. The tokens and
   the display face come from /design-pass-2026-11-17.css, which the wrapper links first (.dp-root). Colours: every text
   token maps to an ink that passes AA on both grounds below (ink-3 #4A5850 on #D2DED5 is about 5.6:1). */

.dp-page {
  --dp-ground-2: #d2ded5; /* the muted band: one step down from the ground, same hue */
}

/* Grounds and surfaces. */
.dp-page .bg-bg-base,
.dp-page .bg-white {
  background-color: var(--dp-ground);
}
.dp-page .bg-bg-muted,
.dp-page .bg-primary-50\/40 {
  background-color: var(--dp-ground-2);
}
.dp-page .bg-bg-surface,
.dp-page .bg-bg-card {
  background-color: var(--dp-leaf);
}
/* W14: body size for the legal text (a 14px container in LegalDocument) and the gift page's list. Both selectors are
   narrow on purpose: no other wrapped page carries these class combinations. */
.dp-page .space-y-6.text-sm.leading-7,
.dp-page .space-y-6.text-sm.leading-7 h3,
.dp-page ul.space-y-2.text-sm {
  font-size: 16px;
}
/* W12: the /explore page's two translucent bars (only that page uses these classes). */
.dp-page .bg-bg-surface\/80 {
  background-color: var(--dp-leaf);
}
.dp-page .bg-bg-muted\/50 {
  background-color: var(--dp-ground-2);
}

/* Ink. */
.dp-page .text-text-primary {
  color: var(--dp-ink);
}
.dp-page .text-text-secondary {
  color: var(--dp-ink-2);
}
.dp-page .text-text-muted {
  color: var(--dp-ink-3);
}

/* Type: headings in the display face at its one weight; body stays Sen. */
.dp-page h1,
.dp-page h2,
.dp-page h3 {
  font-family: var(--dp-display);
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* The 2026 tell DESIGN.md names: uppercase tracked micro-labels. Same words, set as plain small text. */
.dp-page .uppercase.tracking-\[0\.08em\] {
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  color: var(--dp-ink-2);
}

/* One radius (a leaf has cut ends) and one shadow. */
.dp-page .rounded-lg,
.dp-page .rounded-xl,
.dp-page .rounded-2xl,
.dp-page .rounded-3xl,
.dp-page .rounded-full {
  border-radius: var(--dp-radius);
}
.dp-page .shadow-card,
.dp-page .shadow-soft {
  box-shadow: var(--dp-shadow);
}
.dp-page .border-border\/60,
.dp-page .border-border,
.dp-page .border-primary-100 {
  border-color: var(--dp-rule);
}

/* Codex r4 (W1): the brand green as TEXT (#3A7159) measures 4.45:1 on the ground, under AA. Green text moves to the
   pressed accent (#2F5B49, about 6.1:1 on the ground and 7.3:1 on a leaf). Fills keep the accent itself. */
.dp-page .text-primary-500,
.dp-page .text-primary-600,
.dp-page .text-primary-700,
.dp-page .group:hover .group-hover\:text-primary-600,
.dp-page .hover\:text-primary-600:hover,
.dp-page .hover\:text-primary-700:hover {
  color: var(--dp-accent-press);
}

/* Batch W2: blog prose (app/globals.css .prose) sets its own colours. Its links are brand green as text, the same
   4.45:1 failure as above; its text and headings move to the ink scale. */
.dp-page .prose {
  color: var(--dp-ink-2);
}
.dp-page .prose h2,
.dp-page .prose h3,
.dp-page .prose strong {
  color: var(--dp-ink);
}
.dp-page .prose a,
.dp-page .prose a:hover {
  color: var(--dp-accent-press);
}
.dp-page .prose blockquote {
  color: var(--dp-ink-2);
  border-left-color: var(--dp-rule);
}
/* The 404 page's large decorative number (text-primary-300) was about 1.4:1 on the ground; large text needs 3:1. */
.dp-page .text-primary-300 {
  color: var(--dp-accent);
}

/* Codex r4: the carousel's inactive dots (#E5E5E5) all but vanished on the ground. Non-text controls need 3:1. */
.dp-page .bg-border {
  background-color: var(--dp-ink-3);
}

/* Codex r4: one accent action per view. On a field-guide entry the entry's own "Ask BuddhaUR" is the one green
   action; the sutta story's ask button (the only filled button with min-h-[44px], components/SuttaStory.tsx) is set
   as a secondary, outlined like the story's "Read ... yourself" link beside it. Same element, same target. */
.dp-page .bg-primary-600.min-h-\[44px\] {
  background-color: var(--dp-leaf);
  color: var(--dp-ink);
  border: 1px solid var(--dp-ink-3);
  font-weight: 700;
}
.dp-page .bg-primary-600.min-h-\[44px\]:hover {
  background-color: var(--dp-ground);
}

/* Codex r4 (LOW): body text is 16 px or larger in the system. 14 px paragraph and list text is raised. */
.dp-page p.text-sm,
.dp-page li.text-sm {
  font-size: 16px;
  line-height: 1.6;
}

/* Codex r6 (W2), also true of the W1 pages: the site's focus outline (#6EA98A, app/globals.css) is 2.13:1 on the
   ground and 1.97:1 on ground-2, under the 3:1 a focus indicator needs; and the store badges suppress the outline
   (focus:outline-none) while the skin's .shadow-soft replaced their focus ring. Inside the system every focused
   control gets one ink outline (about 13:1 on every ground here). The second selector out-ranks focus:outline-none. */
.dp-page :focus-visible,
.dp-page .focus\:outline-none:focus-visible {
  outline: 3px solid var(--dp-ink, #14201a);
  outline-offset: 2px;
}
/* Codex r7: a focused video sits in an overflow-hidden frame (components/SuttaStory.tsx), which clipped an outline drawn
   outside it. Drawn inside the video instead. */
.dp-page video:focus-visible {
  outline-offset: -3px;
}

/* Batch W3 (2026-11-18): the challenge quiz (app/challenge/ChallengeQuiz.tsx) sets its own warm ground, surfaces, inks
   and borders as hex values, which the token rules above never reach. Each maps to the system here; the quiz file is
   not edited, so what it does (answers, stats, sharing) cannot change. */
.dp-page .bg-\[\#F6F2EA\],
.dp-page .bg-\[\#FAF7F0\] {
  background-color: var(--dp-ground);
}
.dp-page .bg-\[\#FFFDF9\] {
  background-color: var(--dp-leaf);
}
.dp-page .text-\[\#3F3A34\] {
  color: var(--dp-ink);
}
.dp-page .text-\[\#5E5850\],
.dp-page .hover\:text-\[\#5E5850\]:hover {
  color: var(--dp-ink-2);
}
.dp-page .text-\[\#6E675E\],
.dp-page .text-\[\#776D5F\] {
  color: var(--dp-ink-3);
}
.dp-page .border-\[\#E9E3DA\],
.dp-page .border-\[\#E4DCCF\],
.dp-page .border-\[\#EFE9DF\],
.dp-page .border-\[\#D9CFC3\] {
  border-color: var(--dp-rule);
}
/* Codex r1: an answer choice and the share buttons are identified by their outline, which needs 3:1. The rule colour is
   about 1.75:1 on the ground, so a control's border takes ink-3 (about 7:1 on a leaf). */
.dp-page button.border-\[\#E4DCCF\] {
  border-color: var(--dp-ink-3);
}
/* Codex r1: after an answer, the unchosen choices were dimmed to half opacity (about 2.3:1). Their text already takes
   ink-3; the dimming is dropped, and the correct choice keeps its green fill and border. */
.dp-page button.opacity-50:disabled {
  opacity: 1;
}
/* The quiz's two micro-labels ("Daily Sutta Challenge", "Share your result"): the same tell as above, set plain. */
.dp-page .uppercase.tracking-\[0\.24em\],
.dp-page .uppercase.tracking-\[0\.18em\] {
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  color: var(--dp-ink-2);
}
/* One accent action per view: after an answer the quiz shows two filled green buttons. "Ask the app" stays the accent;
   "Get result image" (the only filled button with mb-3) is set as a secondary. Same element, same handler. */
.dp-page button.mb-3.bg-primary-600 {
  background-color: var(--dp-leaf);
  color: var(--dp-ink);
  border: 1px solid var(--dp-ink-3);
}
.dp-page button.mb-3.bg-primary-600:hover {
  background-color: var(--dp-ground);
}

/* Batch W5 (2026-11-19): the header, mobile menu and footer (components/designPass/DesignChrome.tsx) carry .dp-page
   themselves. Their own classes the token rules above do not reach: the header's 90% ground under the blur, hover
   grounds. (No rule for border-border/40: blog and field-guide pages use it too, so it would restyle DONE pages;
   Codex r1. The footer's divider takes the already-mapped /60.) The brand mark stays round (the one-radius rule would square it); this rule sits
   after .rounded-full so it wins at the same specificity. */
.dp-page .bg-bg-base\/90 {
  background-color: rgb(220 230 222 / 0.9);
}
.dp-page .hover\:bg-bg-muted:hover {
  background-color: var(--dp-ground-2);
}
.dp-page .hover\:text-text-primary:hover {
  color: var(--dp-ink);
}
.dp-page .dp-brand {
  border-radius: 9999px;
}

/* No float on hover: the system's one motion is inking. */
.dp-page .hover\:-translate-y-1:hover,
.dp-page .hover\:scale-\[1\.02\]:hover {
  transform: none;
}
