/* Legal pages in the MentVerse app's design language (same tokens as index.html):
   dark title band with the brand glow, Google Sans, light reading area. */
:root {
  --bg: #F4F4F6;
  --ink: #111114;
  --text: #45454F;
  --muted: #62626C;
  --line: #D5D6DB;
  --night: #030303;
  --teal: #13E5D5;
  --blue: #2F66D0;
  --blue-hover: #2A5BC4;
  --radius: 12px;
  --gutter: 20px;
}
@media (min-width: 900px) { :root { --gutter: 80px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Google Sans", "Rubik", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-hover); text-decoration: none; }
a:hover { color: var(--ink); text-decoration: underline; }
a:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
/* Links inside running text need more than color to stand out (WCAG 1.4.1) */
.legal a { text-decoration: underline; text-underline-offset: 2px; }

/* Skip link: hidden until it receives keyboard focus */
.skip-link {
  position: absolute; inset-inline-start: 16px; top: -100px; z-index: 10;
  padding: 12px 18px; border-radius: var(--radius); background: #FFFFFF; color: var(--ink); font-weight: 500; text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--ink); }
main:focus { outline: none; }

.wrap { position: relative; max-width: 1280px; margin: 0 auto; padding-inline: var(--gutter); }

/* Header sits on top of the dark title band */
.site-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 20px; padding-inline: var(--gutter);
}
.brand { display: flex; align-items: center; gap: 10px; color: #FFFFFF; font-weight: 500; font-size: 21px; letter-spacing: -0.2px; }
.brand:hover { color: #FFFFFF; text-decoration: none; }
.brand img { width: 25px; height: 28px; }
.site-nav { display: flex; gap: 24px; font-size: 15px; }
.site-nav a { white-space: nowrap; color: rgba(255, 255, 255, 0.78); }
/* Narrow phones: one header link is enough, the footer lists every document */
@media (max-width: 430px) { .site-nav a + a { display: none; } }
.site-nav a:hover { color: #FFFFFF; }
.site-nav a, .site-footer nav a { display: inline-block; padding-block: 8px; }
.site-header a:focus-visible, .top a:focus-visible { outline-color: var(--teal); }
@media (max-width: 400px) { .brand { font-size: 19px; } .site-nav { gap: 14px; font-size: 14px; } }

/* Dark title band with the app's brand glow */
.top { position: relative; background: var(--night); color: #FFFFFF; border-radius: 0 0 30px 30px; }
.glow-clip { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
.glow {
  position: absolute; left: -10%; top: -260px; width: 120%; height: 620px; opacity: 0.5; filter: blur(100px);
  background:
    radial-gradient(ellipse 45% 40% at 80% 40%, rgba(60, 124, 243, 1), transparent 70%),
    radial-gradient(ellipse 40% 45% at 15% 30%, rgba(19, 229, 213, 0.7), transparent 70%),
    radial-gradient(ellipse 40% 35% at 55% 85%, rgba(176, 83, 127, 0.8), transparent 70%);
}
.legal-head { padding-block: 112px 44px; }
.legal-head h1 { position: relative; margin: 0; font-size: clamp(36px, 6vw, 64px); font-weight: 700; line-height: 1.05; letter-spacing: -1px; }
.legal-head .updated { position: relative; margin: 12px 0 0; color: rgba(255, 255, 255, 0.72); font-size: 15px; }
@media (min-width: 900px) { .legal-head { padding-block: 128px 56px; } }

.draft { margin: 8px 0 0; padding: 12px 16px; border: 1.5px solid #B42318; border-radius: var(--radius); color: #B42318; font-size: 15px; }

.legal { max-width: 720px; padding-block: 40px 64px; }
.legal h2 { margin: 40px 0 8px; font-size: 21px; font-weight: 700; padding-top: 24px; border-top: 1px solid var(--line); }
.legal h2.summary { margin: 0 0 8px; padding-top: 0; border-top: 0; font-size: 17px; }
.legal h3 { margin: 20px 0 4px; font-size: 17px; font-weight: 700; }
.legal p, .legal li { color: var(--text); }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-inline-start: 22px; display: grid; gap: 6px; }
.legal strong { color: var(--ink); font-weight: 700; }

.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 24px 32px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; column-gap: 20px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }
/* Phones and tablets: footer centred like the home page, 44px tap targets */
@media (max-width: 899px) {
  .site-footer { flex-direction: column-reverse; align-items: center; gap: 8px; text-align: center; }
  .site-footer nav { justify-content: center; column-gap: 24px; }
  .site-footer nav a { padding-block: 12px; }
}

/* Tables in the legal pages scroll inside their box on narrow screens. */
.legal .table { overflow-x: auto; margin: 8px 0 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #FFFFFF; }
.legal table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.55; }
.legal th, .legal td { padding: 10px 12px; text-align: start; vertical-align: top; color: var(--text); border-top: 1px solid var(--line); }
.legal th { color: var(--ink); font-weight: 700; background: #E7E8EC; border-top: 0; }
.legal td:first-child { color: var(--ink); font-weight: 500; min-width: 120px; }
.legal td { min-width: 110px; }
/* Phones: each row becomes a card, the column name above each value. */
@media (max-width: 600px) {
  .legal .table { border: 0; overflow: visible; background: none; }
  /* Hidden visually but kept for screen readers */
  .legal thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .legal table, .legal tbody, .legal tr, .legal td { display: block; min-width: 0; }
  .legal tr { border: 1px solid var(--line); border-radius: var(--radius); background: #FFFFFF; padding: 12px 14px; margin-bottom: 10px; }
  .legal td { border: 0; padding: 0; }
  .legal td + td { margin-top: 8px; }
  .legal td:first-child { font-weight: 700; font-size: 16px; }
  .legal td + td::before { content: attr(data-label); display: block; font-size: 13px; color: var(--muted); }
}

/* A detail still missing before publishing. */
.legal .todo { background: #FFF1C2; color: #7A4B00; padding: 0 3px; }
.legal h3[id] { scroll-margin-top: 16px; }
