@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,340..560&family=IBM+Plex+Mono:wght@400;500&family=Inter:wght@400..600&display=swap');

/* legal.css, single design source for NEXRAY legal pages.
 * Aesthetic: Qoves-inspired editorial / premium-clinical.
 *   Cool slate-teal ink on light grey · serif display (Fraunces) +
 *   neutral grotesque body (Inter) + mono micro-labels (IBM Plex Mono) ·
 *   amber used only as a rare accent (progress, active TOC, badge dot).
 * Layout: sticky left table-of-contents (scroll-spy) + wide prose.
 * The TOC is generated from the section headings by nexray-legal.js.
 */

:root {
  --bg:#F7F7F2; --bg2:#EFEFE9; --card:#ffffff; --card2:#EFEFE9;
  --ink:#20201E; --ink-deep:#1A1916;
  --body:#57564F; --grey:#979691; --grey-lt:#B8B8B0;
  --accent:#20201E; --accent2:#38382F;
  --border:rgba(32,32,30,0.10); --border2:rgba(32,32,30,0.16);
  --ease-out:cubic-bezier(0.23,1,0.32,1);
  --ease-out-quint:cubic-bezier(0.22,1,0.36,1);
  --serif:'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:'IBM Plex Mono', ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { text-decoration: none; color: inherit; }

/* Reading progress */
.legal-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--accent2), var(--accent)); z-index: 400; transition: width 90ms linear; will-change: width; pointer-events: none; }

/* Shell + grid */
.legal-shell { max-width: 1100px; margin: 0 auto; padding: 150px 32px 120px; }
.legal-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 76px; align-items: start; }

/* ── Sticky table of contents ──────────────────────────────── */
.legal-toc { position: sticky; top: 116px; align-self: start; max-height: calc(100vh - 150px); overflow-y: auto; padding-right: 8px; }
.legal-toc .toc-label { font-family: var(--mono); font-size: 0.64rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--grey-lt); margin-bottom: 18px; }
.legal-toc ol { list-style: none; counter-reset: toc; }
.legal-toc li { counter-increment: toc; }
.legal-toc a {
  display: grid; grid-template-columns: 24px 1fr; gap: 4px; align-items: baseline;
  padding: 7px 0; font-size: 0.82rem; line-height: 1.35; color: var(--grey);
  border-left: 1.5px solid transparent; padding-left: 16px; margin-left: -16px;
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.legal-toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--mono); font-size: 0.64rem; color: var(--grey-lt); transition: color 160ms var(--ease-out); }
.legal-toc a:hover { color: var(--ink); }
.legal-toc a.active { color: var(--ink); font-weight: 500; border-left-color: var(--accent); }
.legal-toc a.active::before { color: var(--accent2); }

/* ── Main column ───────────────────────────────────────────── */
.legal-main { min-width: 0; }

.lg-hero { margin-bottom: 8px; }
.lg-badge { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.64rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent2); }
.lg-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.lg-hero h1 { margin-top: 18px; font-family: var(--serif); font-size: clamp(2.6rem, 5.6vw, 4rem); font-weight: 430; font-optical-sizing: auto; letter-spacing: -0.018em; line-height: 1.04; color: var(--ink-deep); text-wrap: balance; }
.lg-meta { margin-top: 20px; font-family: var(--mono); font-size: 0.7rem; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--grey-lt); }
.lg-desc { margin-top: 22px; max-width: 60ch; font-size: 1.08rem; color: var(--grey); line-height: 1.62; text-wrap: pretty; }
.lg-disclaimer { margin-top: 28px; max-width: 64ch; background: var(--card2); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; font-size: 0.84rem; color: var(--grey); line-height: 1.55; }
.lg-disclaimer strong { color: var(--ink); font-weight: 600; }

/* ── Document prose ────────────────────────────────────────── */
.legal-doc { counter-reset: sec; margin-top: 56px; }
.legal-doc section { counter-increment: sec; padding: 44px 0; border-top: 1px solid transparent; border-image: linear-gradient(90deg, transparent, rgba(32,32,30,0.06) 28%, rgba(32,32,30,0.06) 72%, transparent) 1; scroll-margin-top: 110px; }
.legal-doc section:first-child { border-image: none; border-top: none; }
.legal-doc h2 { font-family: var(--sans); font-size: clamp(1.35rem, 2.4vw, 1.65rem); font-weight: 540; letter-spacing: -0.015em; line-height: 1.22; color: var(--ink); max-width: 32ch; }
.legal-doc h2::before { content: counter(sec, decimal-leading-zero); display: block; font-family: var(--mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.1em; color: var(--accent2); margin-bottom: 14px; }
.legal-doc h3 { font-size: 0.98rem; font-weight: 600; color: var(--ink); margin: 28px 0 10px; }
.legal-doc p { font-size: 0.96rem; color: var(--body); line-height: 1.75; margin-top: 14px; max-width: 70ch; }
.legal-doc ul, .legal-doc ol.body-list { margin: 14px 0 4px 22px; color: var(--body); font-size: 0.96rem; max-width: 70ch; }
.legal-doc li { margin-bottom: 9px; line-height: 1.65; }
.legal-doc strong { color: var(--ink); font-weight: 600; }
.legal-doc a { color: var(--ink); box-shadow: inset 0 -1px 0 rgba(235,133,10,0.45); transition: box-shadow 180ms var(--ease-out), color 180ms var(--ease-out); }
.legal-doc a:hover { color: var(--accent2); box-shadow: inset 0 -2px 0 var(--accent2); }

/* Placeholder chips */
.ph { color: var(--accent2); background: rgba(235,133,10,0.10); padding: 1px 6px; border-radius: 4px; font-size: 0.92em; font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Tables */
.legal-doc table { width: 100%; border-collapse: collapse; margin: 18px 0 6px; font-size: 0.88rem; }
.legal-doc th, .legal-doc td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.legal-doc th { color: var(--ink); font-weight: 600; background: var(--card2); }

/* Impressum contact card */
.contact-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 6px 22px; margin: 16px 0 6px; max-width: 60ch; }
.contact-row { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.contact-row:last-child { border-bottom: none; }
.contact-row .label { min-width: 160px; color: var(--grey); }
.contact-row .value { color: var(--ink); font-weight: 500; }

/* ── Footer ────────────────────────────────────────────────── */
.legal-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 40px 32px; max-width: 1100px; margin: 0 auto; border-top: 1px solid var(--border); }
.legal-foot .foot-logo { display: flex; align-items: center; }
.legal-foot .foot-logo img { height: 30px; width: auto; display: block; mix-blend-mode: multiply; }
.legal-foot .foot-copy { font-size: 0.7rem; color: var(--grey); }
.legal-foot .foot-links { display: flex; gap: 20px; flex-wrap: wrap; }
.legal-foot .foot-links a { font-size: 0.7rem; color: var(--grey); transition: color 160ms var(--ease-out), transform 140ms var(--ease-out); display: inline-block; }
.legal-foot .foot-links a:hover { color: var(--ink); }
.legal-foot .foot-links a:active { transform: scale(0.96); }

/* ── Injected site header (nexray-header.js), retuned for the cool light
 *    legal background. The default header was tuned for cream and washes
 *    out on grey: the chrome logo's `multiply` blend disappears, and the
 *    white-on-white glass pill loses its edges. These overrides live in
 *    legal.css (loaded on legal pages only) and use `.nxh-nav` specificity
 *    so they beat the JS-injected styles that load later in the cascade. */

/* Chrome wordmark: drop `multiply` (which erases the bright metal on light
   grey) and lift it off the page with contrast + a faint slate shadow. */
.nxh-nav .nxh-sig img { mix-blend-mode: normal; filter: brightness(0.95) contrast(1.06) drop-shadow(0 1px 1.5px rgba(32,32,30,0.22)); }

/* Nav links sit directly on the frosted pill (matching the homepage). The
   inner <ul> must stay transparent, giving it a background paints a hard
   white rectangle behind the links, since it has no radius or padding. */
.nxh-nav .nxh-links { background: none; box-shadow: none; }
.nxh-nav .nxh-links a { color: var(--grey); }
.nxh-nav .nxh-links a:hover, .nxh-nav .nxh-links a.nxh-active { background: rgba(255,255,255,0.78); color: var(--ink); }

/* CTA + hamburger: slate to match the legal palette (were warm near-black). */
.nxh-nav .nxh-cta { background: var(--ink); color: #EFEFE9; border-color: rgba(255,255,255,0.12); }
.nxh-nav .nxh-cta:hover { background: var(--ink-deep); }
.nxh-nav .nxh-burger { background: rgba(255,255,255,0.66); border-color: var(--border2); box-shadow: 0 4px 16px rgba(32,32,30,0.10), inset 0 1px 0 rgba(255,255,255,0.85); }
.nxh-nav .nxh-burger span { background: var(--ink); }

/* Mobile menu overlay: cool frosting + slate CTA (out-specifies via body). */
body .nxh-mobile { background: rgba(242,243,243,0.6); }
body .nxh-mobile a { color: var(--ink); }
body .nxh-mobile a.nxh-cta-m { background: var(--ink); color: #EFEFE9; }

a:focus-visible, button:focus-visible { outline: 2px solid var(--accent2); outline-offset: 3px; border-radius: 4px; }

/* Gentle hero entrance (JS on only) */
html.js-anim .lg-hero { opacity: 0; transform: translateY(12px); }
html.js-anim .lg-hero.in { opacity: 1; transform: none; transition: opacity 600ms var(--ease-out-quint), transform 600ms var(--ease-out-quint); }

/* ── Responsive: collapse the sidebar ──────────────────────── */
@media (max-width: 900px) {
  .legal-shell { padding: 124px 22px 80px; }
  .legal-grid { grid-template-columns: 1fr; gap: 0; }
  .legal-toc { display: none; }
  .legal-doc p, .legal-doc ul, .legal-doc table { max-width: none; }
  .legal-foot { flex-direction: column; align-items: flex-start; padding: 32px 22px; }
  .legal-doc table, .legal-doc thead, .legal-doc tbody, .legal-doc th, .legal-doc td, .legal-doc tr { display: block; }
  .legal-doc thead { display: none; }
  .legal-doc td { border: none; padding: 3px 0; }
  .legal-doc tr { border-bottom: 1px solid var(--border); padding: 12px 0; }
  .contact-row { flex-direction: column; gap: 2px; }
  .contact-row .label { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html.js-anim .lg-hero { opacity: 1; transform: none; }
  .legal-progress { display: none; }
  html { scroll-behavior: auto; }
}
