/* Interior public pages ((site)/(pages)): the dark document ground, the planet behind the heading
   and the base look of plain elements. The markup is Tailwind utilities (app/site-pages.css); the
   element rules here sit in :where(.page), so any utility class on the element wins over them.
   Scoped to .page so the homepage is untouched. */

.page {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding: calc(var(--nav) + clamp(28px, 4vw, 56px)) 0 clamp(72px, 8vw, 120px);
  background:
    radial-gradient(90vw 280px at 50% 0, color-mix(in oklab, var(--accent) 28%, transparent), transparent 72%),
    var(--bg);
  color: var(--ink);
}
/* the same planet as the homepage; it fades out under the page heading, no hard edge where it ends */
.page::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: calc(var(--nav) - 8px);
  left: 50%;
  width: var(--planet-w);
  aspect-ratio: 1;
  translate: -50% 0;
  border-radius: 50%;
  box-shadow: inset 0 2px 0 color-mix(in oklab, var(--ink) 55%, transparent), inset 0 42px 72px -30px color-mix(in oklab, var(--accent) 55%, transparent);
  -webkit-mask-image: linear-gradient(#000 0, #000 clamp(40px, 5vw, 90px), transparent clamp(120px, 14vw, 240px));
  mask-image: linear-gradient(#000 0, #000 clamp(40px, 5vw, 90px), transparent clamp(120px, 14vw, 240px));
  pointer-events: none;
}
html[data-theme="dark"] .page::before {
  box-shadow: inset 0 2px 0 rgb(255 255 255 / .92), inset 0 42px 72px -30px rgb(88 116 255 / .8);
}
/* No more specificity than a bare element here and below: Next's CSS (the pages' Tailwind) may load
   before or after this file, so a utility has to win on specificity, and this file still beats the
   kit's element rules because it always loads after system.css. */
:where(.page > *) { position: relative; z-index: 1; }
/* a section is a block of the page, not a locked screen (the kit sizes sections to the screen) */
.page > section { height: auto; min-height: 0; }
/* the first band is see-through, so the planet fades out behind it instead of ending on a band edge */
.page > section:first-child { background: transparent; }

/* ---- plain elements: the reading rhythm of the text pages ---- */
/* an element's specificity: level with the kit's `p { margin: 0 }` (this file loads later and wins),
   below a utility such as my-8 */
:where(.page) :is(p, ul, ol, table, figure, blockquote) { margin-block: 0.85em 0; }
:where(.page) h1 {
  font-size: clamp(36px, 4.6vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
:where(.page) h2 { margin-top: 1.5em; font-size: clamp(26px, 3vw, 36px); line-height: 1.15; text-wrap: balance; }
:where(.page) h3 { margin-top: 1.6em; font-size: 19px; line-height: 1.3; }
:where(.page) :is(h2, h3):where(:first-child) { margin-top: 0; }
:where(.page) h1 + p { max-width: 62ch; margin-top: 1rem; font-size: 19px; line-height: 1.5; color: var(--muted); }
/* the kit strips list markers; a running list gets them back (a flex or grid list has none anyway) */
:where(.page) ul:where(:not(.list-none)) { list-style: disc; padding-left: 1.25rem; }
:where(.page) ol:where(:not(.list-none)) { list-style: decimal; padding-left: 1.25rem; }
:where(.page) :where(ul, ol) > li + li { margin-top: 0.35em; }
:where(.page) a { color: var(--hl); text-underline-offset: 3px; }
:where(.page) a:where(:hover) { text-decoration: underline; }
/* the kit's focus ring without specificity (system.css leaves .page to this rule); no kit rule sets
   an outline on a bare element, so it shows wherever a utility does not replace it */
:where(.page :focus-visible) {
  outline: 2px solid var(--action);
  outline-offset: 2px;
  border-radius: 2px;
}
:where(.page) :where(b, strong) { font-weight: 650; }
:where(.page) img { max-width: 100%; height: auto; }
:where(.page) table { width: 100%; border-collapse: collapse; }
:where(.page) :where(th, td) { text-align: left; vertical-align: top; }
:where(.page) summary { list-style: none; cursor: pointer; }
:where(.page) summary::-webkit-details-marker { display: none; }
:where(.page) :where(input, textarea, select) { font: inherit; color: inherit; }
:where(.page) [role="alert"] { color: #ffb4b4; font-weight: 600; }
:where(html[data-theme="light"] .page) [role="alert"] { color: #9f1239; }
