/* Shared styles for Nvnest legal pages.
   Tokens, type, navigation and footer mirror index.html. */

/* ============================================================
   Tokens
   ============================================================ */
:root {
  color-scheme: light;
  --ink: #16171B;
  --ink2: #5B5A54;
  --ink3: #66645D;
  --ink4: #6B6962;
  --ground: #F3F1EB;
  --alt: #ECE9E1;
  --surface: #FBFAF7;
  --rule: #DDD9CE;
  --rule-soft: #E7E3D9;
  --accent: #9B2B2B;
  --accent-soft: #F4E7E3;
  --pos: #2E6B4F;
  --pos-soft: #E5EDE6;
  --dsp: 'Newsreader', Georgia, serif;
  --body: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #F3F1EB;
    --ink2: #C9C6BE;
    --ink3: #97948B;
    --ink4: #96938A;
    --ground: #16171B;
    --alt: #1C1D22;
    --surface: #212227;
    --rule: #3A3B42;
    --rule-soft: #2F3037;
    --accent: #E5736B;
    --accent-soft: #3A2624;
    --pos: #6FBF98;
    --pos-soft: #1F3329;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #F3F1EB;
  --ink2: #C9C6BE;
  --ink3: #97948B;
  --ink4: #96938A;
  --ground: #16171B;
  --alt: #1C1D22;
  --surface: #212227;
  --rule: #3A3B42;
  --rule-soft: #2F3037;
  --accent: #E5736B;
  --accent-soft: #3A2624;
  --pos: #6FBF98;
  --pos-soft: #1F3329;
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(84px + env(safe-area-inset-top, 0px));
  -webkit-text-size-adjust: 100%;
}
body {
  background: var(--ground);
  color: var(--ink2);
  font: 16.5px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
h1, h2, h3, h4 {
  font-family: var(--dsp);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -.02em;
  line-height: 1.08;
  text-wrap: balance;
}
p { text-wrap: pretty; }
h1 { font-size: clamp(40px, 4.6vw, 53px); }
h2 { font-size: clamp(29px, 3.8vw, 42px); }
h3 { font-size: 21px; line-height: 1.25; }
em { font-style: italic; font-weight: 300; }
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); color: var(--ink); }

.w {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 28px;
}
.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--ink3);
}
.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink3);
}
.sr {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 12px; top: -100px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--ground);
  border-radius: 3px;
  font-size: 13px;
  text-decoration: none;
  transition: top .15s;
}
.skip-link:focus { top: 12px; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: var(--ground);
  font: 500 14.5px/1 var(--body);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-1px); opacity: .93; }
.btn:active { transform: none; }
.btn.sm { height: 44px; padding: 0 16px; font-size: 13.5px; }

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  padding-top: env(safe-area-inset-top, 0px);
  transition: box-shadow .2s ease;
}
.nav.scrolled { box-shadow: 0 10px 30px -26px rgba(0, 0, 0, .45); }
.nav-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  min-height: 44px;
  font: 500 16px/1 var(--dsp);
  letter-spacing: .19em;
  flex: none;
}
.mark {
  width: 20px;
  height: 20px;
  display: block;
  flex: none;
  color: var(--ground);
  fill: currentColor;
}
.mark .mark-bg { fill: var(--ink); }
.nav-links { display: flex; gap: 24px; margin-left: 26px; }
.nav-links a {
  font-size: 13.5px;
  text-decoration: none;
  color: var(--ink2);
  transition: color .15s;
}
.nav-links a:hover { color: var(--ink); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: transparent;
  color: var(--ink2);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.theme-toggle:hover { background: var(--surface); color: var(--ink); border-color: var(--ink3); }
.theme-toggle svg { width: 16px; height: 16px; }
.menu-btn {
  display: none;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}
.menu-btn i {
  display: block;
  width: 14px; height: 1px;
  background: currentColor;
  box-shadow: 0 4px 0 currentColor, 0 -4px 0 currentColor;
}
.mnav {
  position: fixed;
  left: 0; right: 0;
  top: calc(69px + env(safe-area-inset-top, 0px));
  z-index: 39;
  background: var(--ground);
  border-bottom: 1px solid var(--rule);
  padding: 10px 28px calc(22px + env(safe-area-inset-bottom, 0px));
  max-height: calc(100dvh - 69px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 24px 40px -30px rgba(0, 0, 0, .4);
}
.mnav a:not(.btn) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 2px;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink);
  font-size: 15px;
  text-decoration: none;
}
.mnav .btn { width: 100%; margin-top: 14px; color: var(--ground); }

/* ============================================================
   Legal document
   ============================================================ */
.legal-wrap { max-width: 940px; margin: 0 auto; padding: 72px 28px 96px; }
.legal-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.legal-top a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink3);
  text-decoration: none;
}
.legal-top a:hover { color: var(--accent); }
.legal > h1 { margin-top: 4px; }
.legal > h1 + p {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink3);
}
.legal > h1 + p strong { font-weight: 500; color: var(--ink3); }
.legal h2 {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: clamp(25px, 3vw, 31px);
}
.legal h2:first-of-type { margin-top: 40px; }
.legal p { margin-top: 16px; max-width: 76ch; font-size: 16.5px; line-height: 1.7; }
.legal ul, .legal ol {
  margin-top: 16px;
  padding-left: 24px;
  max-width: 76ch;
}
.legal li { margin-top: 10px; padding-left: 4px; font-size: 16px; line-height: 1.7; }
.legal li::marker { color: var(--accent); font-family: var(--mono); font-size: 12px; }
.legal li > ul, .legal li > ol { margin-top: 10px; margin-bottom: 4px; }
.legal p + p { margin-top: 14px; }
.legal strong { color: var(--ink); font-weight: 600; }
.legal a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
}
.legal a:hover { text-decoration-color: var(--accent); color: var(--accent); }
.legal .back-link {
  display: inline-block;
  margin-top: 40px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink3);
  text-decoration: none;
}
.legal .back-link:hover { color: var(--accent); }
.legal-note {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink3);
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  background: var(--alt);
  border-top: 1px solid var(--rule);
  padding: 30px 0;
}
.footer-inner { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.footer .brand { font-size: 15px; }
.footer a { font-size: 14px; text-decoration: none; color: var(--ink2); }
.footer a:hover { color: var(--ink); }
.footer .copy {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--ink3);
  margin-left: auto;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-actions .btn { display: none; }
  .menu-btn { display: inline-flex; }
}
@media (max-width: 720px) {
  .w { padding: 0 20px; }
  .mnav { padding-left: 20px; padding-right: 20px; }
  .nav-inner { gap: 12px; }
  .theme-toggle, .menu-btn { height: 44px; }
  .theme-toggle { width: 44px; }
  .legal-wrap { padding: 48px 20px 72px; }
  .legal h2 { margin-top: 40px; padding-top: 20px; }
  .footer a:not(.brand) { padding: 5px 0; }
  .footer .copy { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
