/**
 * Layout for every page except the home page: the legal pages, 404 and the shared-link pages
 * rendered by landing/worker. Load after nightfeed.css. The nav and the scrim below apply to
 * all of them; everything else is scoped to the page it styles (`.legal`, `.nf404`), because
 * this file is linked by pages that must not pick it up.
 */

/* Content sits above the fixed card wall and scrim. */
.app-container {
  position: relative;
  z-index: 2;
}

html { scroll-behavior: smooth; overscroll-behavior-y: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* ===== Nav: a large logo and name, centred over the page; scrolls with it ===== */
.site-nav { position: absolute; justify-content: center; padding: 22px 20px; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border: none; }
.nav-brand { gap: 12px; }
.nav-brand img { width: 46px; height: 46px; filter: drop-shadow(0 0 14px rgba(45, 212, 191, 0.45)); }
.nav-brand span { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6); }
@media (min-width: 761px) {
  .site-nav { padding: 30px 32px; }
  .nav-brand img { width: 54px; height: 54px; }
  .nav-brand span { font-size: 32px; }
}

/* Darker than nightfeed.css's default; the shared-link previews lighten it in share.css. */
.night-scrim { background: rgba(0, 0, 0, 0.8); }

/* =====================================================================
   Legal pages (body.legal) — plain reading layout
   Deliberately quiet: a flat dark page, one text column, ordinary links.
   No moving backdrop, pills, glows, tinted boxes or decorative numbering.
   Teal appears only on links and on the current entry in the contents list.
   /scripts/legal.js adds the document links and the contents list; the
   pages read fine without it. Most visits come from the app's web view,
   so the phone layout is the default and desktop only adds a side column.
   ===================================================================== */
body.legal { background: #080B0B; background-image: none; }
body.legal .card-wall,
body.legal .night-scrim { display: none; }

.legal .app-container { max-width: 680px; min-height: 0; padding: 108px 20px calc(32px + env(safe-area-inset-bottom)); }
.legal .page-header { text-align: left; padding: 0; margin-bottom: 20px; border: none; }
.legal .page-title { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 0; text-shadow: none; }
.legal .page-subtitle { margin-top: 10px; font-size: 16px; line-height: 1.6; color: #a3acb5; }
.legal .last-updated { display: block; margin-top: 10px; padding: 0; border: none; border-radius: 0; font-size: 14px; font-weight: 400; color: #7d8791; }

/* Terms / Privacy / Guidelines: plain links, the current one underlined 8px past its label each side */
.legal .legal-tabs { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 28px; padding: 0 0 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.legal .legal-tabs a { padding: 6px 8px; margin: 0 -8px; font-size: 14.5px; font-weight: 500; color: #a3acb5; text-decoration: none; border-bottom: 1px solid transparent; }
.legal .legal-tabs a:hover { color: #F7F9FA; text-decoration: none; }
.legal .legal-tabs a.is-here { color: #F7F9FA; border-bottom-color: #F7F9FA; }

/* Contents: closed by default on phones */
.legal .legal-toc { margin: 0 0 30px; padding: 0; border: none; background: none; }
.legal .legal-toc summary { display: inline-block; padding: 6px 0; list-style: none; cursor: pointer; font-size: 14.5px; font-weight: 600; color: #F7F9FA; }
.legal .legal-toc summary::-webkit-details-marker { display: none; }
.legal .legal-toc summary::after { content: ' +'; color: #7d8791; font-weight: 400; }
.legal .legal-toc[open] summary::after { content: ' −'; }
.legal .legal-toc a { display: block; padding: 8px 0; font-size: 14.5px; line-height: 1.4; color: #a3acb5; text-decoration: none; }
.legal .legal-toc a:hover { color: #F7F9FA; text-decoration: none; }
.legal .legal-toc a.is-active { color: #5EEAD4; }

/* The document */
.legal .card { background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border: none; border-radius: 0; box-shadow: none; overflow: visible; margin-bottom: 0; }
.legal .card-content { padding: 0; }
.legal .card p, .legal .card li { font-size: 16px; line-height: 1.7; color: #c8ced4; }
.legal .card p { margin-bottom: 14px; }
.legal .card strong { color: #F7F9FA; font-weight: 600; }
.legal .card a { color: #5EEAD4; text-decoration: underline; text-underline-offset: 2px; }
.legal .card ul, .legal .card ol { margin-left: 20px; margin-bottom: 16px; }
.legal .card li { margin-bottom: 6px; }
.legal .card li::marker { color: #7d8791; }
.legal .divider { display: none; }
.legal .section-title { margin: 40px 0 12px; padding: 0; border: none; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; color: #F7F9FA; scroll-margin-top: 20px; }
.legal .card-content > .section-title:first-child { margin-top: 0; }
.legal .section-subtitle { margin: 24px 0 8px; font-family: var(--font-family); font-size: 16px; font-weight: 600; letter-spacing: 0; color: #F7F9FA; }
/* Notes (Do / Don't, disclaimers, "Important") and contact details are plain
   text like the rest of the document: no box, no tint, no coloured title. */
.legal .alert, .legal .alert-info, .legal .contact-box { margin: 18px 0; padding: 0; border: none; border-radius: 0; background: none; }
.legal .alert p:last-child, .legal .contact-box p:last-child { margin-bottom: 0; }
.legal .alert-title, .legal .contact-box h3 { margin: 0 0 8px; font-family: var(--font-family); font-size: 16px; font-weight: 700; letter-spacing: 0; color: #F7F9FA; }
.legal .contact-box { margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.1); }

.legal .page-footer { margin-top: 48px; padding: 20px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.1); text-align: left; font-size: 14px; color: #7d8791; }
.legal .page-footer p { margin-bottom: 6px; }
.legal .page-footer a { display: inline-block; margin: 0 4px 0 0; padding: 4px 0; color: #a3acb5; }

/* Phones: the header block is centred so the page reads symmetrically;
   the document text itself stays left-aligned for readability. */
@media (max-width: 760px) {
  .legal .page-header { text-align: center; }
  .legal .page-subtitle { margin-left: auto; margin-right: auto; }
  .legal .legal-tabs { justify-content: center; gap: 4px 20px; }
  .legal .legal-toc { text-align: center; }
  .legal .legal-toc a { text-align: left; }
  .legal .page-footer { text-align: center; }
  .legal .page-footer a { margin: 0 6px; }
}
@media (min-width: 761px) {
  .legal .app-container { padding: 136px 32px 48px; }
  .legal .page-title { font-size: 40px; }
  .legal .card p, .legal .card li { font-size: 16.5px; }
  .legal .section-title { font-size: 22px; margin-top: 48px; }
}
/* Desktop: contents in a side column, only when the script built it (.has-toc) */
@media (min-width: 1100px) {
  .legal .app-container.has-toc { max-width: 980px; display: grid; grid-template-columns: 220px minmax(0, 680px); column-gap: 80px; align-items: start; }
  .legal .app-container.has-toc > * { grid-column: 1 / -1; }
  .legal .app-container.has-toc > .legal-toc { grid-column: 1; position: sticky; top: 32px; max-height: calc(100vh - 64px); overflow-y: auto; scrollbar-width: none; margin: 0; }
  .legal .app-container.has-toc > .card { grid-column: 2; }
  .legal .legal-toc::-webkit-scrollbar { display: none; }
  .legal .legal-toc summary { pointer-events: none; padding: 0 0 8px; color: #7d8791; font-weight: 500; }
  .legal .legal-toc summary::after, .legal .legal-toc[open] summary::after { content: ''; }
  .legal .legal-toc a { padding: 5px 0; font-size: 14px; }
}

/* ===== 404: a number, a line, a link. The home page's card wall stays behind it. ===== */
.nf404 {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.nf404 .nf404-card { width: 100%; max-width: 520px; }
.nf404 .nf404-code { font-family: var(--font-display); font-size: clamp(88px, 20vw, 144px); font-weight: 800; line-height: 1; letter-spacing: -0.04em; margin-bottom: 8px; color: #F7F9FA; }
.nf404 .nf404-title { font-size: clamp(22px, 4vw, 28px); font-weight: 700; letter-spacing: -0.02em; color: #F7F9FA; margin-bottom: 12px; }
.nf404 .nf404-msg { max-width: 400px; margin: 0 auto 24px; font-size: 16px; line-height: 1.6; color: #c8ced4; text-wrap: balance; }
.nf404 .nf404-cta { display: inline-flex; align-items: center; gap: 8px; padding: 0 0 2px; border-bottom: 1px solid #F7F9FA; color: #F7F9FA; font-size: 16px; font-weight: 600; text-decoration: none; }
.nf404 .nf404-cta .mdi { font-size: 18px; line-height: 1; }
.nf404 .nf404-cta:hover { color: #5EEAD4; border-bottom-color: #5EEAD4; text-decoration: none; }
