/* ============================================================
   OrgSense — Legal & Privacy
   "Document desk": bookmark rail (left) · document (center) · on-this-page map (right)
   ============================================================ */

/* ---- Hero (compact) ---------------------------------------- */
.legal-hero {
  position: relative;
  padding: clamp(124px, 15vh, 180px) 0 clamp(34px, 5vw, 60px);
}
.legal-hero .eyebrow { margin-bottom: 22px; }
.legal-hero h1 {
  max-width: 16ch;
  margin: 0;
}
.legal-hero .lead { margin-top: 24px; }
.legal-meta {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
}
.legal-meta .lm {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--text-soft);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.legal-meta .lm svg { width: 14px; height: 14px; color: var(--accent); }
.legal-meta .lm .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: lm-pulse 2.4s var(--ease) infinite;
}
@keyframes lm-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--accent) 55%, transparent); }
  70%,100% { box-shadow: 0 0 0 7px transparent; }
}
[data-motion="off"] .legal-meta .lm .pulse { animation: none; }

/* ---- Layout shell ------------------------------------------ */
.legal-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 210px;
  gap: clamp(26px, 3.6vw, 60px);
  align-items: start;
  padding-bottom: var(--section);
}

/* ============================================================
   BOOKMARK RAIL (left)
   ============================================================ */
.rail {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rail-head {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding: 0 4px 8px;
}
.bm {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  transition: transform .45s var(--ease), border-color .35s var(--ease),
              box-shadow .45s var(--ease), background .35s var(--ease);
}
.bm::before {
  content: "";
  position: absolute;
  left: -1px; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform .45s var(--ease);
}
.bm:hover { border-color: var(--line-strong); transform: translateX(2px); }
.bm.active {
  background: var(--surface);
  border-color: color-mix(in oklch, var(--accent) 42%, var(--line));
  box-shadow: var(--shadow-card);
  transform: translateX(6px);
}
.bm.active::before { transform: scaleY(1); }

.bm-n {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text-mute);
  transition: color .35s var(--ease);
}
.bm.active .bm-n { color: var(--accent); }
.bm-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bm-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.bm-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.bm-ic {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--text-mute);
  background: var(--bg-2);
  transition: color .35s var(--ease), background .35s var(--ease);
  flex: none;
}
.bm-ic svg { width: 17px; height: 17px; }
.bm.active .bm-ic { color: var(--accent); background: var(--accent-soft); }

/* plain rail variant (tweak) */
[data-rail="plain"] .bm { grid-template-columns: 1fr auto; padding: 13px 16px; }
[data-rail="plain"] .bm-n,
[data-rail="plain"] .bm-meta { display: none; }
[data-rail="plain"] .bm-ic { width: 28px; height: 28px; border-radius: 8px; background: transparent; }

/* rail note under bookmarks */
.rail-note {
  margin-top: 8px;
  padding: 14px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-mute);
}
.rail-note a { color: var(--accent); border-bottom: 1px solid color-mix(in oklch, var(--accent) 40%, transparent); }

/* ============================================================
   DOCUMENT (center)
   ============================================================ */
.docs { min-width: 0; position: relative; }
.policy { display: none; }
.policy.active { display: block; }
.policy.swap-in { animation: policy-in .55s var(--ease-out) both; }
@keyframes policy-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
[data-motion="off"] .policy.swap-in { animation: none; }

/* doc header */
.policy-head {
  padding-bottom: 30px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.policy-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.policy-kicker .pk-n {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--accent);
}
.policy-kicker .pk-line { flex: 1; height: 1px; background: var(--line); }
.policy-kicker .pk-date {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.policy-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -.03em;
  line-height: 1.02;
}
.policy-summary {
  margin-top: 18px;
  font-size: clamp(16px, 1.4vw, 18.5px);
  color: var(--text-soft);
  line-height: 1.6;
  max-width: 62ch;
  text-wrap: pretty;
}

/* at a glance */
.glance {
  margin: 26px 0 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.g-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
}
.g-item .g-ic {
  width: 22px; height: 22px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
  flex: none;
  margin-top: 1px;
}
.g-item .g-ic svg { width: 13px; height: 13px; }

/* sections */
.policy-body { max-width: 70ch; }
[data-reading="wide"] .policy-body { max-width: none; }

.sec {
  padding: 30px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 92px;
}
.sec-n {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--accent);
}
.sec h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(20px, 2vw, 25px);
  letter-spacing: -.02em;
  line-height: 1.2;
  margin: 9px 0 16px;
}
.sec p {
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.68;
  margin-bottom: 14px;
  text-wrap: pretty;
}
.sec p:last-child { margin-bottom: 0; }
.sec p strong, .sec li strong { color: var(--text); font-weight: 600; }

/* definition-style list (label + description) */
.deflist { display: flex; flex-direction: column; gap: 14px; margin: 4px 0; }
.def {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.def b {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -.01em;
  color: var(--text);
  margin-bottom: 5px;
}
.def span { font-size: 14.5px; color: var(--text-soft); line-height: 1.6; }

/* bullet list */
.sec ul.bul { list-style: none; display: flex; flex-direction: column; gap: 11px; margin: 6px 0; }
.sec ul.bul li {
  position: relative;
  padding-left: 26px;
  font-size: 15.5px;
  color: var(--text-soft);
  line-height: 1.6;
}
.sec ul.bul li::before {
  content: "";
  position: absolute;
  left: 4px; top: 9px;
  width: 7px; height: 7px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg);
}

/* callout (key statement) */
.callout {
  margin: 6px 0;
  display: flex;
  gap: 15px;
  align-items: flex-start;
  padding: 18px 22px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
}
.callout svg { width: 20px; height: 20px; color: var(--accent); flex: none; margin-top: 2px; }
.callout p {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16.5px;
  letter-spacing: -.01em;
  color: var(--text);
  line-height: 1.45;
}

/* doc footer (contact / back to top) */
.policy-foot {
  margin-top: 38px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.policy-foot .pf-tx { font-size: 14.5px; color: var(--text-soft); }
.policy-foot .pf-tx b { display: block; font-family: var(--font-display); font-size: 16px; color: var(--text); margin-bottom: 3px; font-weight: 600; }
.policy-foot a.pf-mail { color: var(--accent); font-weight: 500; }

/* ============================================================
   ON THIS PAGE (right map)
   ============================================================ */
.toc {
  position: sticky;
  top: 96px;
}
.toc-h {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 14px;
  padding-left: 15px;
}
.toc-list { display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.toc-list a {
  position: relative;
  display: block;
  padding: 7px 0 7px 15px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-mute);
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.toc-list a:hover { color: var(--text-soft); }
.toc-list a.active { color: var(--text); border-color: var(--accent); }
.toc-list a .tn { font-family: var(--font-mono); font-size: 11px; color: var(--accent); margin-right: 7px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1160px) {
  .legal-layout { grid-template-columns: 240px minmax(0,1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .legal-layout { grid-template-columns: 1fr; gap: 22px; }
  .rail {
    position: static;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-inline: calc(var(--pad) * -1);
    padding-inline: var(--pad);
    scrollbar-width: none;
  }
  .rail::-webkit-scrollbar { display: none; }
  .rail-head { display: none; }
  .rail-note { display: none; }
  .bm {
    flex: 0 0 auto;
    width: 230px;
    transform: none !important;
  }
  .bm.active { transform: none !important; }
  .bm::before { left: 14px; right: 14px; top: auto; bottom: -1px; width: auto; height: 3px; border-radius: 3px 3px 0 0; transform: scaleX(0); }
  .bm.active::before { transform: scaleX(1); }
  .glance { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .policy-foot { flex-direction: column; align-items: flex-start; }
}
