/* Atlan public pages: the legal documents, contact and the error pages (404, 403, the CSRF failure, 500, 400).
   Needs tokens.css, fonts.css and base.css before it. Ported from the website prototype (docs/redesign/website/pages.css);
   its container queries are media queries here, at the same widths (900, 760, 600, 420), and cqi is vw.
   Long reading: a 68ch measure, numbered sections with their numbers hanging in a gutter, a sticky contents list on a
   desktop and a folded one on a phone. Rows and separators, no cards. The maintenance page and the emails carry their
   own inline styles (deploy/maintenance/index.html, templates/emails/). Every class here starts with pg-. */

/* ---------- legal documents ---------- */
.pg-doc .wrap { padding-block: clamp(56px, 7vw, 104px) 136px; }
.pg-dh { display: grid; justify-items: start; gap: 18px; }
.pg-dh h1 { max-width: 15em; font-weight: 650; font-size: clamp(40px, 5.4vw, 76px); line-height: 1; letter-spacing: -.04em; color: var(--blush); text-wrap: balance; }
.pg-ver { font-size: 15px; color: var(--dust); }
.pg-split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 56px; margin-top: 64px; padding-top: 48px; box-shadow: inset 0 1px 0 var(--line); }

/* the contents: numbers in a column, the current section lit by a short red line on its square row */
.pg-toc { position: sticky; top: calc(var(--hd) + 32px); align-self: start; }
.pg-toc h2 { font-size: 13px; font-weight: 650; color: var(--dust); }
.pg-toc ol, .pg-tocm ol { display: grid; }
.pg-toc ol { margin-top: 14px; }
.pg-toc a, .pg-tocm a { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: baseline; padding: 7px 0 7px 14px; font-size: 14px; line-height: 1.38; color: var(--rose); box-shadow: inset 1px 0 0 var(--line); transition: color .12s, box-shadow .2s; }
.pg-toc a span, .pg-tocm a span { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--dust); transition: color .12s; }
.pg-toc a:hover, .pg-tocm a:hover { color: var(--white); }
.pg-toc a[aria-current="true"] { color: var(--blush); box-shadow: inset 2px 0 0 var(--signal); }
.pg-toc a[aria-current="true"] span { color: var(--signal-hi); }
.pg-toc a:focus-visible, .pg-tocm a:focus-visible { outline-offset: -2px; }
.pg-tocm { display: none; }

/* the text: 68 characters a line, the section's number hanging in its own gutter */
.pg-art { --nw: 52px; min-width: 0; max-width: calc(68ch + var(--nw)); font-size: 17px; line-height: 1.7; color: var(--rose); }
.pg-art .lnk { overflow-wrap: anywhere; }
.pg-sec { padding-block: 36px; box-shadow: inset 0 1px 0 var(--line); scroll-margin-top: calc(var(--hd) + 24px); }
.pg-art > .pg-sec:first-child { padding-top: 0; box-shadow: none; }
.pg-art > .pg-sec:last-child { padding-bottom: 0; }
.pg-sec h2 { display: grid; grid-template-columns: var(--nw) minmax(0, 1fr); align-items: baseline; font-weight: 650; font-size: clamp(21px, 1.9vw, 25px); line-height: 1.25; letter-spacing: -.02em; color: var(--blush); text-wrap: balance; }
.pg-n { font-size: 15px; font-weight: 700; letter-spacing: 0; color: var(--signal); font-variant-numeric: tabular-nums; }
.pg-bd { margin-top: 14px; padding-left: var(--nw); }
.pg-bd p + p, .pg-bd p + ul, .pg-bd ul + p { margin-top: 14px; }
.pg-bd li { position: relative; padding-left: 22px; }
.pg-bd li + li { margin-top: 10px; }
.pg-bd li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 6px; height: 6px; background: var(--deep); }
.pg-bd b { font-weight: 650; color: var(--blush); }
/* the terms number their paragraphs, which they cite ("sekcja 8 ust. 6"); a paragraph that opens a list keeps it inside */
.pg-bd ol.pg-ust { counter-reset: ust; }
.pg-bd ol.pg-ust > li { counter-increment: ust; padding-left: 30px; }
.pg-bd ol.pg-ust > li::before { content: counter(ust) "."; left: 0; top: 0; width: auto; height: auto; background: none; font-weight: 650; color: var(--blush); font-variant-numeric: tabular-nums; }
.pg-bd li > ul, .pg-bd div > ul { margin-top: 10px; }
.pg-bd p + div, .pg-bd div + p, .pg-bd div + div { margin-top: 14px; }
.pg-bd .pg-act { margin-top: 20px; }
.pg-bd .pg-act .ic { width: 14px; height: 14px; }
/* the privacy policy's summary leads the text, larger, before its first section */
.pg-tldr { display: grid; gap: 10px; padding-bottom: 40px; }
.pg-tldr b { justify-self: start; font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--signal-hi); }
.pg-tldr p { max-width: 42ch; font-size: clamp(19px, 1.75vw, 23px); line-height: 1.48; font-weight: 550; letter-spacing: -.01em; color: var(--blush); text-wrap: pretty; }

@media (max-width: 900px) {
  .pg-doc .wrap { padding-bottom: 96px; }
  .pg-dh { gap: 14px; }
  .pg-split { grid-template-columns: minmax(0, 1fr); margin-top: 0; padding-top: 36px; box-shadow: none; }
  .pg-toc { display: none; }
  /* on a phone the contents fold into one row under the title */
  .pg-tocm { display: block; margin-top: 32px; box-shadow: inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line); }
  .pg-tocm summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 16px 0; list-style: none; cursor: pointer; font-weight: 650; font-size: 15px; color: var(--blush); }
  .pg-tocm summary::-webkit-details-marker { display: none; }
  .pg-tocm summary .ic { color: var(--dust); transition: transform .2s var(--ease-out); }
  .pg-tocm[open] summary .ic { transform: rotate(90deg); }
  .pg-tocm ol { padding-bottom: 14px; }
  /* each section a 44 px tap target (desktop's list keeps its 7 px rows) */
  .pg-tocm a { min-height: 44px; padding-block: 11px; }
  .pg-art { --nw: 34px; font-size: 16px; line-height: 1.68; }
  .pg-sec { padding-block: 28px; }
  .pg-n { font-size: 14px; }
  .pg-tldr { padding-bottom: 32px; }
}
@media (max-width: 420px) {
  /* the hanging gutter goes; numbers stay beside their heads */
  .pg-art { --nw: 30px; }
  /* "Regulamin korzystania z Atlana" took three lines at 360 px at 40 px: 36 px there keeps every title to two */
  .pg-dh h1 { font-size: clamp(32px, 10vw, 40px); }
  .pg-bd { padding-left: 0; }
}

/* ---------- contact ---------- */
.pg-contact .wrap { padding-block: clamp(56px, 7vw, 104px) 160px; }
.pg-contact h1 { font-weight: 650; font-size: clamp(56px, 8.6vw, 124px); line-height: .95; letter-spacing: -.045em; color: var(--blush); }
.pg-rows { margin-top: clamp(48px, 6vw, 88px); box-shadow: inset 0 -1px 0 var(--line); }
.pg-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px 32px; padding-block: 36px; box-shadow: inset 0 1px 0 var(--line); }
.pg-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--raise); color: var(--signal-hi); transition: background-color .2s, color .2s; }
.pg-ico .ic { width: 24px; height: 24px; }
.pg-row:hover .pg-ico { background: var(--signal); color: var(--black); }
.pg-rm { display: grid; justify-items: start; gap: 8px; min-width: 0; }
.pg-rm p { font-size: 16px; line-height: 1.5; color: var(--rose); text-wrap: pretty; }
.pg-big { display: inline-flex; align-items: center; gap: 12px; max-width: 100%; font-weight: 650; font-size: clamp(26px, 3.4vw, 46px); line-height: 1.12; letter-spacing: -.03em; color: var(--blush); overflow-wrap: anywhere; text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 2px; text-underline-offset: 7px; transition: color .12s, text-decoration-color .2s; }
.pg-big:hover { color: var(--white); text-decoration-color: var(--signal); }
.pg-big .ic { width: .5em; height: .5em; color: var(--dust); }
.pg-copy span { display: inline-flex; align-items: center; gap: 8px; }
.pg-copy .pg-c2 { display: none; }
.pg-copy.done .pg-c1 { display: none; }
.pg-copy.done .pg-c2 { display: inline-flex; }
.pg-copy.done .ic { color: var(--signal-hi); }
@media (max-width: 760px) {
  .pg-contact .wrap { padding-bottom: 112px; }
  .pg-row { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-block: 28px; }
  .pg-ico { width: 44px; height: 44px; border-radius: 12px; }
  .pg-ico .ic { width: 20px; height: 20px; }
  .pg-copy { justify-self: start; }
  /* no hover on a phone: the address shows it is a link at rest, and its line is a 44 px tap target */
  .pg-big { min-height: 44px; text-decoration-color: var(--line-2); }
}
@media (max-width: 600px) {
  /* the icon tile only repeats the link beside it (the address, Discord's name), so a phone row starts with the link */
  .pg-ico { display: none; }
}

/* ---------- error pages: 404, 403, the CSRF failure, 500 and 400 share one layout ---------- */
.pg-err .wrap { display: grid; justify-items: center; padding-block: clamp(40px, 5vw, 72px) 136px; text-align: center; }
/* the code drawn in the site's characters; without the script the canvas stays empty and keeps its place */
.pg-glyph { display: block; width: 100%; height: clamp(150px, 26vw, 350px); }
.pg-errc { display: grid; justify-items: center; width: 100%; margin-top: 32px; }
.pg-errc h1 { font-weight: 650; font-size: clamp(34px, 4.4vw, 60px); line-height: 1.04; letter-spacing: -.035em; color: var(--blush); text-wrap: balance; }
.pg-errc p { max-width: 44ch; margin-top: 18px; font-size: 18px; line-height: 1.55; color: var(--rose); text-wrap: pretty; }
.pg-errc .lnk { overflow-wrap: anywhere; }
.pg-errc .acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 36px; }
/* a page rendered without a request: the logo alone in the bar, the legal line alone in the footer */
.pg-bar .wrap { justify-content: space-between; }
.pg-bft .wrap { padding-top: 0; }
.pg-bft .flegal { margin-top: 0; }
@media (max-width: 760px) {
  .pg-err .wrap { padding-bottom: 96px; }
  .pg-errc { margin-top: 24px; }
  .pg-errc p { font-size: 16px; }
  .pg-errc .acts { width: 100%; }
  .pg-errc .acts .btn { flex: 1 1 100%; }
}

/* under reduced motion nothing turns or fades on these pages */
@media (prefers-reduced-motion: reduce) {
  .pg-tocm summary .ic, .pg-toc a, .pg-big, .pg-ico { transition: none; }
}

/* Windows high contrast: the hairlines and the current section are box-shadows there, so they become borders */
@media (forced-colors: active) {
  .pg-split, .pg-sec, .pg-row, .pg-tocm { border-top: 1px solid CanvasText; }
  .pg-art > .pg-sec:first-child { border-top: 0; }
  .pg-toc a[aria-current="true"] { text-decoration: underline; }
}
