/* ==========================================================================
   Pages C: privacy.html, terms.html, 404.html (redesign)
   Loaded after redesign.css on these three pages only. Builds on the shared
   island (.rs-island), the prose rules (.prose) and the ambient gutter layer
   (.blog-ambient) from redesign.css; nothing here changes a shared rule.
   ========================================================================== */

/* ---------- Legal pages (privacy, terms) ---------- */
/* One measure for the head and the document: about 70 characters of 18 px
   Rubik per line, the same as a blog post. */
.rs-legal { --measure: 620px; --card-pad: 20px; display: block; padding-bottom: 88px; }
@media (min-width: 640px) { .rs-legal { --card-pad: 40px; } }
@media (min-width: 900px) { .rs-legal { --card-pad: 56px; padding-bottom: 120px; } }

.legal-head-inner {
  position: relative;
  z-index: 1;
  max-width: calc(var(--measure) + 2 * var(--card-pad));
  margin-inline: auto;
  padding-inline: var(--card-pad);
}
@media (max-width: 639px) { .legal-head-inner { padding-inline: 20px; } }
.legal-updated {                        /* caption role, on dark */
  margin-top: 18px;
  font-size: var(--text-caption);
  line-height: 22px;
  color: var(--color-signal-blue);
}

/* The document: a white card on the pale canvas */
.legal-doc {
  max-width: calc(var(--measure) + 2 * var(--card-pad));
  margin: 24px var(--island-gap) 0;
  padding: 24px var(--card-pad) 40px;
  border-radius: var(--radius-cards);
  background: var(--color-white-surface);
  box-shadow: var(--shadow-xl);
  color: var(--color-edge-navy);
  font-size: var(--text-body);
  line-height: 1.55;
}
@media (min-width: 640px) {
  .legal-doc { margin: 40px auto 0; width: calc(100% - 2 * var(--gutter)); padding-block: 40px 56px; }
}

.legal-doc section { scroll-margin-top: 24px; }
.legal-doc section > * + * { margin-top: 18px; }
.legal-doc section > h2 + * { margin-top: 12px; }
.legal-doc section:first-of-type > h2 { margin-top: 40px; }

/* Table of contents: a small ice panel at the top of the card */
.legal-toc {
  padding: 18px 20px 20px;
  border-radius: var(--radius-cards);
  background: var(--color-ice-surface);
}
.prose .legal-toc-title {
  margin: 0;
  font-size: var(--text-caption);
  line-height: 22px;
  font-weight: 700;
}
.prose .legal-toc ol {
  margin: 8px 0 0;
  padding-left: 26px;
  font-size: 16px;
  line-height: 1.4;
}
.prose .legal-toc li + li { margin-top: 10px; }
.prose .legal-toc ol li::marker { font-weight: 500; font-size: 14px; color: var(--color-edge-navy); }
.prose .legal-toc a {
  font-weight: 400;
  text-decoration-color: rgba(139, 179, 218, .8);
}
.prose .legal-toc a:hover { text-decoration-color: currentColor; }
@media (min-width: 640px) {
  .prose .legal-toc ol { columns: 2; column-gap: 36px; }
  .prose .legal-toc li { break-inside: avoid; }
  .prose .legal-toc li + li { margin-top: 0; }
  .prose .legal-toc li { padding-bottom: 6px; }
}

/* A short aside inside a section */
.legal-note {
  padding: 14px 18px;
  border-left: 3px solid var(--color-signal-blue);
  border-radius: 0 var(--radius-cards) var(--radius-cards) 0;
  background: var(--color-ice-surface);
  font-size: 16px;
  line-height: 1.45;
}

/* Unwritten copy (CLAUDE.md, "Placeholder system"): a visible dashed block */
.rs-legal .pending,
.rs-notfound .pending {
  padding: 16px 18px;
  border: 1.5px dashed rgba(24, 61, 109, .35);
  border-radius: var(--radius-cards);
  background: var(--color-ice-surface);
  color: var(--color-edge-navy);
  font-size: var(--text-caption);
  line-height: 22px;
}

/* Wide screens: the ambient gutter layer shares the card's grid row, as on a
   blog post (stars and fireflies in the pale gutters, never over the text). */
@media (min-width: 1100px) {
  .legal-body { display: grid; grid-template-columns: minmax(0, 1fr); }
  .legal-body > * { grid-column: 1; grid-row: 1; min-width: 0; }
  .legal-body .blog-ambient { position: relative; margin-top: 40px; }
  .legal-body .legal-doc { position: relative; z-index: 1; }
}

/* ---------- 404 ---------- */
.rs-notfound { display: block; padding-bottom: 88px; }
@media (min-width: 900px) { .rs-notfound { padding-bottom: 128px; } }

.nf-island { padding-bottom: 40px; }
.nf-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 28px;
  justify-items: center;
  text-align: center;
}
.nf-copy { max-width: 640px; }
.nf-island .eyebrow {
  font-size: var(--text-caption);
  line-height: 22px;
  color: var(--color-signal-blue);
}
.nf-island h1.nf-code {
  margin-top: 0;
  font-size: clamp(96px, 30vw, 168px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.02em;
}
.nf-island .lede { margin-top: 12px; }
.nf-cta { margin-top: 28px; }
@media (max-width: 479px) {
  .nf-cta .rs-btn { width: 100%; justify-content: space-between; }
}

/* Links to the main pages: small white links with a chevron */
.nf-links ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 20px;
  margin-top: 22px;
}
.nf-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  color: var(--color-white-surface);
  font-size: 16px;
  line-height: 19px;
  text-decoration: underline;
  text-decoration-color: rgba(139, 179, 218, .6);
  text-underline-offset: 4px;
  transition: text-decoration-color var(--t-fast) var(--ease);
}
.nf-links a:hover { text-decoration-color: currentColor; }
.nf-links svg {
  width: 14px; height: 14px;
  color: var(--color-signal-blue);
  transition: transform var(--t-mid) var(--ease);
}
.nf-links a:hover svg { transform: translateX(3px); }

.nf-art { width: min(56%, 210px); }
.nf-art .rs-char-slot { animation: rs-float 7s ease-in-out infinite; }

/* Tablet and up: copy on the left, the character on the right. */
@media (min-width: 900px) {
  .nf-island { padding-bottom: 64px; }
  .nf-inner {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: center;
    justify-items: start;
    text-align: left;
    gap: 48px;
    min-height: 420px;
  }
  .nf-links ul { justify-content: flex-start; }
  .nf-art { width: 100%; align-self: end; justify-self: end; margin: 0 0 -112px; }  /* crosses the island's bottom edge */
}
@media (min-width: 1200px) {
  .nf-inner { grid-template-columns: minmax(0, 1fr) 340px; padding-inline: calc(var(--gutter) + 40px); }
}

@media (prefers-reduced-motion: reduce) {
  .nf-links a:hover svg { transform: none; }
}

.nf-art .rs-char-art { animation: rs-float 7s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .nf-art .rs-char-art { animation: none; } }
