/* ==========================================================================
   NUii — legal documents (privacy policy, terms of service)
   Long-form reading layout built entirely from tokens.css. Pages themselves are
   generated by tools/build_legal_pages.py from the .docx originals.
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* Anchor links from the contents list would otherwise tuck a heading right
     against the top edge of the viewport. */
  scroll-padding-top: 24px;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--nuii-font-sans);
  color: var(--nuii-text);
  background: var(--nuii-gray);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:where(a, button, [tabindex]):focus-visible {
  outline: 3px solid var(--nuii-focus);
  outline-offset: 2px;
  border-radius: 3px;
}

.legal {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 255, 255, 0.9), transparent 26%),
    linear-gradient(180deg, var(--nuii-gray-light) 0%, var(--nuii-gray) 100%);
}

/* --- Masthead -----------------------------------------------------------
   Shares the document column's width and centring so the logo lines up with the
   title beneath it. Left-aligning to the page gutter instead leaves the logo
   visibly adrift from the text. */
.legal__masthead {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 34px var(--nuii-gutter) 0;
}

.legal__home {
  display: inline-block;
}

.legal__logo {
  width: 190px;
  max-width: 60vw;
  height: auto;
  display: block;
}

/* --- Document ----------------------------------------------------------- */
.legal__doc {
  flex: 1;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 40px var(--nuii-gutter) 80px;
}

.legal__title {
  margin: 0;
  font-family: var(--nuii-font-serif);
  font-weight: 400;
  font-size: clamp(38px, 5.2vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: var(--nuii-deep);
}

.legal__updated {
  margin: 14px 0 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--nuii-teal);
}

.legal__rule {
  width: 62px;
  height: 2px;
  margin: 28px 0 0;
  background: var(--nuii-lime);
  border: 0;
}

/* --- Contents ----------------------------------------------------------- */
.legal__toc {
  margin: 38px 0 8px;
  padding: 24px 28px 26px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--nuii-line);
  border-radius: var(--nuii-radius);
}

.legal__toc-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--nuii-teal);
}

/* The headings already begin with their own numbers ("1. Information We
   Collect"), so the list must not add a second set. */
.legal__toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 34px;
}

.legal__toc li {
  margin-bottom: 7px;
  break-inside: avoid;
}

.legal__toc a {
  color: var(--nuii-ink);
  text-decoration: none;
  font-size: 14.5px;
  line-height: 1.4;
  border-bottom: 1px solid transparent;
}

.legal__toc a:hover {
  color: var(--nuii-teal);
  border-bottom-color: var(--nuii-lime);
}

/* --- Content ------------------------------------------------------------ */
.legal__content {
  margin-top: 34px;
  /* Comfortable measure for sustained reading; the container is wider than this
     to leave the headings and contents box room to breathe. */
  max-width: 68ch;
}

.legal__content h2 {
  margin: 44px 0 14px;
  font-family: var(--nuii-font-serif);
  font-weight: 400;
  font-size: clamp(23px, 2.4vw, 28px);
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--nuii-teal);
  scroll-margin-top: 20px;
}

.legal__content h2:first-child {
  margin-top: 8px;
}

.legal__content p {
  margin: 0 0 16px;
  font-size: 16.5px;
  line-height: 1.72;
  color: var(--nuii-ink);
}

.legal__content ul {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.legal__content li {
  position: relative;
  margin-bottom: 10px;
  padding-left: 22px;
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--nuii-ink);
}

.legal__content li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--nuii-lime);
}

.legal__content a {
  color: var(--nuii-teal);
  text-decoration: underline;
  text-decoration-color: var(--nuii-lime);
  text-underline-offset: 2px;
}

/* Warranty and liability blocks are capitalised in the source to satisfy
   "conspicuous" disclosure requirements. The text is reproduced verbatim; this
   only keeps it prominent while making a wall of capitals readable — tighter
   size, looser tracking, and a lime rule to set it apart. */
.legal__caps {
  margin: 0 0 18px;
  padding: 16px 18px;
  background: rgba(196, 217, 58, 0.16);
  border-left: 3px solid var(--nuii-lime);
  border-radius: 6px;
  font-size: 14px !important;
  line-height: 1.62 !important;
  letter-spacing: 0.015em;
  color: var(--nuii-ink) !important;
}

/* --- Footer ------------------------------------------------------------- */
.legal__footer {
  background: var(--nuii-teal);
  border-top: 4px solid var(--nuii-lime);
  padding: 28px var(--nuii-gutter) 32px;
}

.legal__footer-tagline {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--nuii-white);
}

.legal__footer-tagline .accent {
  color: var(--nuii-lime);
  font-weight: 700;
}

.legal__footer-links {
  margin: 16px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
}

.legal__footer-links a {
  color: var(--nuii-lime);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.legal__footer-links a:hover {
  text-decoration: underline;
}

.legal__footer-legal {
  margin: 16px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: #b9cdd0;
}

@media (max-width: 900px) {
  .legal__toc ol {
    columns: 1;
  }
}

@media (max-width: 720px) {
  .legal__masthead {
    padding: 26px var(--nuii-gutter-sm) 0;
  }

  .legal__doc {
    padding: 30px var(--nuii-gutter-sm) 60px;
  }

  .legal__logo {
    width: 150px;
  }

  .legal__toc {
    padding: 20px 20px 22px;
  }

  .legal__footer {
    padding: 24px var(--nuii-gutter-sm) 28px;
  }
}

@media print {
  .legal__toc,
  .legal__footer-links {
    display: none;
  }

  body {
    background: #fff;
  }

  .legal {
    background: #fff;
  }

  .legal__content {
    max-width: none;
  }
}
