/* Nikosa — legal / policy page chrome.
   Self-contained layout for the four legal pages. Every colour, type, spacing
   and motion value resolves from the design-system tokens loaded by styles.css;
   nothing hard-codes a brand value here. */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  font-family: var(--font-body);
  font-size: var(--text-base, 16px);
  line-height: var(--leading-body);
  color: var(--text-body);
  background-color: var(--surface-page);
  /* Same restrained blue glow as the landing hero — no purple, no busy gradients. */
  background-image:
    radial-gradient(120% 60% at 50% -10%, rgba(47, 116, 224, 0.12), transparent 60%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Keyboard focus — explicit ring that reads on the dark ground (blue, never amber) ---- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ---- Sticky top bar: brand lockup home + back link ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  background: color-mix(in srgb, var(--surface-raised) 84%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}
.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}
.topbar__mark { width: 30px; height: 30px; display: block; }
.topbar__word {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.02em;
  color: var(--text-strong);
  font-size: 20px;
  line-height: 1;
}
.topbar__word .dot { color: var(--color-accent); }
.topbar__back {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  /* --nk-text (#9aa7bd) so the 13px link clears WCAG AA on the translucent bar;
     --text-muted lands ~4:1 once the bar's blur/transparency is composited. */
  color: var(--nk-text);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-standard);
}
.topbar__back:hover { color: var(--text-strong); }

/* ---- Document column ---- */
.doc {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: var(--space-16) var(--space-6) var(--space-12);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.doc__head {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0;
}
.doc__title {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  color: var(--text-strong);
  font-size: clamp(30px, 5vw, var(--text-h1));
  margin: 0;
  text-wrap: balance;
}
.doc__intro {
  font-size: clamp(var(--text-base, 16px), 1.4vw, var(--text-lg));
  line-height: var(--leading-body);
  color: var(--text-body);
  margin: 0;
  max-width: 62ch;
}
.doc__actions {
  margin-top: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}
.doc__note {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  color: var(--text-faint);
}

/* ---- Buttons (ghost is the right register for these utility links — keeps
        the one amber spark reserved for the landing CTA / logo) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  padding: 12px 18px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-standard),
              background-color var(--dur-fast) var(--ease-standard),
              color var(--dur-fast) var(--ease-standard);
}
.btn--ghost {
  border-color: var(--border-default);
  color: var(--text-strong);
  background: color-mix(in srgb, var(--surface-card) 60%, transparent);
}
.btn--ghost:hover {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
}
.btn .arr { font-size: 0.95em; line-height: 1; }

/* ---- Light "document" card holding the embedded Termly policy.
        The policy renders on light per Termly's own styling, so we frame it on
        the design system's on-light surface — reads as an intentional document,
        not a leak. ---- */
.policy {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.policy__card {
  background: var(--nk-light-surface);
  border: 1px solid var(--nk-light-border);
  border-radius: var(--radius-panel);
  padding: clamp(var(--space-3), 1.5vw, var(--space-6));
  box-shadow: var(--shadow-card);
  min-height: 360px;
  color: var(--nk-ink-on-light);
}
.policy__card [name="termly-embed"] { width: 100%; display: block; }
.policy__card iframe { width: 100% !important; border: 0; display: block; }
/* Visible until Termly's script swaps in the iframe (or permanently, if the
   embed is blocked / offline) — the prominent link above is the real guarantee. */
.policy__placeholder {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--nk-ink-on-light);
  text-align: center;
  padding: var(--space-16) var(--space-6);
  margin: 0;
}
.policy__placeholder a { color: var(--nk-blue-deep); font-weight: var(--weight-semibold); }
.policy__hint {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  color: var(--text-faint);
  text-align: center;
}
.policy__hint a { color: var(--text-muted); }
.policy__hint a:hover { color: var(--text-strong); }

/* ---- Footer ---- */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
  padding: var(--space-6) var(--space-8);
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-faint);
}
.foot__links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}
.foot__links a {
  color: var(--text-faint);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color var(--dur-fast) var(--ease-standard);
}
.foot__links a:hover,
.foot__links a[aria-current="page"] { color: var(--text-strong); }
.foot__meta { color: var(--text-muted); }

@media (max-width: 600px) {
  .doc { padding-top: var(--space-12); }
  .foot { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  body { background-attachment: scroll; }
  .btn, .topbar__back, .foot__links a { transition: none; }
}
