:root {
  color-scheme: light;
  --legal-bg: #f5f3ed;
  --legal-surface: #fffefb;
  --legal-ink: #19221d;
  --legal-muted: #68716b;
  --legal-faint: #8b938d;
  --legal-line: #d9ddd7;
  --legal-green: #16734f;
  --legal-green-soft: #e7f2ec;
  --legal-header: rgba(255,254,251,.92);
  --legal-shadow: 0 20px 70px rgba(25,34,29,.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--legal-bg); color: var(--legal-ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.legal-skip { position: fixed; z-index: 20; top: 10px; left: 12px; transform: translateY(-150%); padding: 9px 13px; border-radius: 8px; background: var(--legal-ink); color: var(--legal-surface); font-weight: 700; }
.legal-skip:focus { transform: translateY(0); }

.legal-header { position: sticky; z-index: 10; top: 0; height: 70px; border-bottom: 1px solid var(--legal-line); background: var(--legal-header); backdrop-filter: blur(18px); }
.legal-header-inner { width: min(1280px, calc(100% - 48px)); height: 100%; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.legal-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.legal-brand img { display: block; width: 112px; height: auto; }
.legal-badge { padding: 5px 8px; border-radius: 6px; background: var(--legal-green-soft); color: var(--legal-green); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.legal-back { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 13px; border: 1px solid var(--legal-line); border-radius: 10px; text-decoration: none; font-size: .84rem; font-weight: 700; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.legal-back:hover { border-color: var(--legal-green); background: var(--legal-green-soft); transform: translateY(-1px); }
.legal-back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.legal-layout { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 64px 0 96px; display: grid; grid-template-columns: 230px minmax(0, 760px); justify-content: center; gap: 88px; }
.legal-nav { position: sticky; top: 112px; align-self: start; }
.legal-nav-label { margin: 0 0 18px; color: var(--legal-faint); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.legal-nav-links { display: grid; border-top: 1px solid var(--legal-line); }
.legal-nav-links a { position: relative; padding: 13px 4px; border-bottom: 1px solid var(--legal-line); color: var(--legal-muted); text-decoration: none; font-size: .84rem; line-height: 1.35; transition: color .18s ease, padding-left .18s ease; }
.legal-nav-links a:hover { padding-left: 6px; color: var(--legal-green); }
.legal-nav-links a[aria-current="page"] { color: var(--legal-ink); font-weight: 750; }
.legal-nav-links a[aria-current="page"]::before { content: ""; position: absolute; top: 50%; left: -14px; width: 6px; height: 6px; border-radius: 50%; background: var(--legal-green); transform: translateY(-50%); }
.legal-company { margin-top: 28px; color: var(--legal-faint); font-size: .76rem; line-height: 1.65; }

.legal-document { min-width: 0; }
.legal-document-header { padding-bottom: 42px; border-bottom: 1px solid var(--legal-line); animation: legal-rise .45s cubic-bezier(.22,1,.36,1) both; }
.legal-eyebrow { margin: 0 0 18px; color: var(--legal-green); font-size: .74rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.legal-document h1 { max-width: 720px; margin: 0; font-size: clamp(2.55rem, 5vw, 4.65rem); line-height: .98; letter-spacing: -.055em; }
.legal-summary { max-width: 650px; margin: 25px 0 0; color: var(--legal-muted); font-size: 1.08rem; line-height: 1.7; }
.legal-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 25px; color: var(--legal-faint); font-size: .78rem; }
.legal-notice { margin: 30px 0 0; padding: 16px 18px; border-left: 2px solid var(--legal-green); background: var(--legal-green-soft); color: var(--legal-muted); font-size: .82rem; line-height: 1.65; }

.legal-section { scroll-margin-top: 100px; padding: 42px 0 0; animation: legal-rise .45s .04s cubic-bezier(.22,1,.36,1) both; }
.legal-section + .legal-section { margin-top: 10px; }
.legal-section h2 { margin: 0 0 15px; font-size: 1.35rem; line-height: 1.25; letter-spacing: -.025em; }
.legal-section h3 { margin: 28px 0 10px; font-size: 1rem; line-height: 1.35; }
.legal-section p, .legal-section li { color: var(--legal-muted); font-size: .94rem; line-height: 1.78; }
.legal-section p { margin: 0 0 15px; }
.legal-section ul, .legal-section ol { margin: 13px 0 18px; padding-left: 22px; }
.legal-section li + li { margin-top: 8px; }
.legal-section a { color: var(--legal-green); text-underline-offset: 3px; }
.legal-defined { color: var(--legal-ink); font-weight: 750; }
.legal-contact { margin-top: 42px; padding: 24px 0 0; border-top: 1px solid var(--legal-line); }
.legal-contact address { color: var(--legal-muted); font-size: .9rem; font-style: normal; line-height: 1.7; }

.legal-footer { border-top: 1px solid var(--legal-line); background: var(--legal-surface); }
.legal-footer-inner { width: min(1180px, calc(100% - 48px)); min-height: 118px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.legal-footer p { margin: 0; color: var(--legal-faint); font-size: .78rem; }
.legal-footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 22px; }
.legal-footer-links a { color: var(--legal-muted); font-size: .78rem; text-decoration: none; }
.legal-footer-links a:hover { color: var(--legal-green); }

@keyframes legal-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .legal-header { height: 64px; }
  .legal-header-inner { width: calc(100% - 30px); }
  .legal-brand img { width: 101px; }
  .legal-back span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .legal-back { width: 40px; padding: 0; justify-content: center; }
  .legal-layout { width: 100%; padding: 0 0 68px; display: block; }
  .legal-nav { position: sticky; z-index: 8; top: 64px; padding: 0 16px; overflow-x: auto; border-bottom: 1px solid var(--legal-line); background: var(--legal-header); backdrop-filter: blur(18px); scrollbar-width: none; }
  .legal-nav::-webkit-scrollbar { display: none; }
  .legal-nav-label, .legal-company { display: none; }
  .legal-nav-links { width: max-content; display: flex; border: 0; }
  .legal-nav-links a { min-height: 48px; padding: 0 14px; border: 0; display: inline-flex; align-items: center; white-space: nowrap; }
  .legal-nav-links a:first-child { padding-left: 2px; }
  .legal-nav-links a[aria-current="page"]::before { top: auto; right: 14px; bottom: 0; left: 14px; width: auto; height: 2px; border-radius: 1px; transform: none; }
  .legal-document { padding: 42px 20px 0; }
  .legal-document-header { padding-bottom: 34px; }
  .legal-document h1 { font-size: clamp(2.5rem, 13vw, 3.6rem); }
  .legal-summary { font-size: 1rem; }
  .legal-section { scroll-margin-top: 126px; padding-top: 34px; }
  .legal-footer-inner { width: calc(100% - 40px); padding: 26px 0; align-items: flex-start; flex-direction: column; }
  .legal-footer-links { justify-content: flex-start; }
}

@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --legal-bg: #11171b; --legal-surface: #192027; --legal-ink: #ece9e1; --legal-muted: #b3bbc3; --legal-faint: #8d98a3; --legal-line: #303b45; --legal-green: #72caa4; --legal-green-soft: #1c392f; --legal-header: rgba(17,23,27,.91); --legal-shadow: none; }
  .legal-brand img { content: url("assets/kunoi-wordmark-dark.png"); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
