/**
 * KineticUltra — Kinetic Legal Pages
 * Privacy Policy, Terms of Service, Legal Notice, Cookies…
 * Source de vérité : kinetic-ultra/.stitch/designs/legals-page/privacy-policy-kinetic-ultra.html
 */

/* ---------- Root & layout ---------- */
.k-legal {
  background: var(--k-background);
  color: var(--k-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  position: relative;
}

.k-legal__shell {
  display: flex;
  position: relative;
  align-items: flex-start;
  min-height: 100vh;
}

.k-legal__main {
  flex: 1;
  min-width: 0;
  width: 100%;
}

/* ---------- Sidebar (Table of Contents) ----------
   Sticky rail: collapsed by default (icons only), expands on toggle.
   Using `sticky` + `align-self: flex-start` means the sidebar scrolls out
   naturally when the footer arrives — no overlap with .k-footer. */
.k-legal__side {
  position: sticky;
  top: 64px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding-top: 1rem;
  height: calc(100vh - 64px);
  width: 4rem;                /* collapsed: icons only */
  background: var(--k-background);
  border-right: 1px solid var(--k-hairline);
  z-index: 40;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 260ms cubic-bezier(.2,.8,.2,1);
}

.k-legal__side.is-expanded { width: 16rem; }

/* Small screens: expanded state overlays content instead of pushing it. */
@media (max-width: 767px) {
  .k-legal__side.is-expanded {
    position: fixed;
    left: 0;
    top: 64px;
    bottom: 0;
    height: auto;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.45);
  }
}

/* Toggle button — pinned to the top of the rail. */
.k-legal__side-toggle {
  position: sticky;
  top: 0;
  align-self: flex-end;
  margin: 0 0.5rem 0.5rem;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--k-hairline);
  color: var(--k-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease, transform 260ms ease;
  z-index: 2;
}

.k-legal__side-toggle:hover {
  color: var(--k-cyan);
  border-color: rgba(0, 212, 255, 0.35);
}

.k-legal__side-toggle svg { width: 14px; height: 14px; }

.k-legal__side.is-expanded .k-legal__side-toggle svg { transform: rotate(180deg); }

/* Hide textual chrome when collapsed */
.k-legal__side:not(.is-expanded) .k-legal__side-head,
.k-legal__side:not(.is-expanded) .k-legal__toc-label,
.k-legal__side:not(.is-expanded) .k-legal__side-foot {
  display: none;
}

.k-legal__side:not(.is-expanded) .k-legal__toc-item {
  justify-content: center;
  padding: 0.75rem 0;
  border-left-width: 0;
  border-right: 3px solid transparent;
}

.k-legal__side:not(.is-expanded) .k-legal__toc-item.is-active {
  border-right-color: var(--k-cyan);
}

.k-legal__side-head {
  padding: 0 1.5rem;
  margin-bottom: 2rem;
}

.k-legal__side-title {
  color: var(--k-cyan);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.k-legal__side-sub {
  color: var(--k-muted);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.k-legal__toc {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.k-legal__toc-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--k-muted);
  padding: 0.75rem 1rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  border-left: 4px solid transparent;
  transition: background-color 200ms ease, color 200ms ease;
  white-space: nowrap;
}

.k-legal__toc-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.k-legal__toc-item:hover {
  background: rgba(39, 39, 45, 0.5);
  color: #e4e1e9;
}

.k-legal__toc-item.is-active {
  color: var(--k-cyan);
  background: rgba(0, 212, 255, 0.08);
  border-left-color: var(--k-cyan);
}

.k-legal__toc-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke-width: 1.5;
}

.k-legal__side-foot {
  margin-top: auto;
  padding: 1.5rem;
}

.k-legal__status {
  background: #19191f;
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.k-legal__status-label {
  font-size: 9px;
  color: var(--k-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.k-legal__status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.k-legal__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--k-green);
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
  animation: k-legal-pulse 2s ease-in-out infinite;
}

.k-legal__status-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--k-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@keyframes k-legal-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ---------- Hero ---------- */
.k-legal__hero {
  position: relative;
  padding: 6rem 2rem;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

@media (min-width: 768px) {
  .k-legal__hero { padding: 6rem 4rem; }
}

.k-legal__hero-bg {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(0, 212, 255, 0.35), transparent 70%);
}

.k-legal__hero-inner {
  position: relative;
  z-index: 1;
  max-width: 64rem;
  margin: 0 auto;
}

.k-legal__eyebrow {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--k-cyan);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.k-legal__title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 900;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: #f9f5fd;
  text-shadow: 0 0 18px rgba(0, 212, 255, 0.45);
  margin: 0 0 1.5rem;
}

.k-legal__lead {
  color: var(--k-muted);
  max-width: 36rem;
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0;
}

.k-legal__hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
}

.k-legal__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 1rem 2rem;
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: filter 200ms ease, transform 150ms ease, background-color 200ms ease;
}

.k-legal__btn:active { transform: scale(0.97); }

.k-legal__btn--primary {
  background: linear-gradient(90deg, #00d4ff 0%, #441cc8 100%);
  color: #003642;
}

.k-legal__btn--primary:hover { filter: brightness(1.1); }

.k-legal__btn--ghost {
  background: transparent;
  color: var(--k-cyan);
  border: 1px solid rgba(0, 212, 255, 0.5);
}

.k-legal__btn--ghost:hover { background: rgba(0, 212, 255, 0.08); }

.k-legal__btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.5;
}

/* ---------- Sections body ---------- */
.k-legal__body {
  max-width: 64rem;
  margin: 0 auto;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

@media (min-width: 768px) {
  .k-legal__body { padding: 4rem; }
}

.k-legal__section {
  padding: 2rem;
  transition: background-color 300ms ease;
  scroll-margin-top: 90px;
}

@media (min-width: 768px) {
  .k-legal__section { padding: 3rem; }
}

.k-legal__section:nth-child(odd)  { background: #1b1b20; }
.k-legal__section:nth-child(even) { background: #0e0e13; }

.k-legal__section:hover { background: #19191f; }

.k-legal__section-row {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.k-legal__module {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  color: #3f3f46;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 0.35rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.k-legal__section-main {
  flex: 1;
  min-width: 0;
}

.k-legal__section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--k-cyan);
  margin: 0 0 1.5rem;
}

.k-legal__section:nth-child(even) .k-legal__section-title {
  color: #f9f5fd;
}

/* Contact ("Contact_Terminal") block — formerly hardcoded inline, which
   broke light mode (near-white title on the #FFFFFF contact panel). Scope
   it on the stable #contact id so it stays deterministic regardless of
   the section's nth-child parity, with a proper light override below. */
#contact .k-legal__section-title { color: #f9f5fd; }
#contact .k-legal__module { color: var(--k-cyan); }

/* Prose content (from the_content) */
.k-legal__prose {
  color: #d4d4d8;
  font-size: 0.875rem;
  line-height: 1.7;
  max-width: 42rem;
}

.k-legal__prose > * + * { margin-top: 1rem; }

.k-legal__prose h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: #f9f5fd;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 1.75rem 0 0.5rem;
  padding-left: 1.5rem;
  border-left: 2px solid rgba(0, 212, 255, 0.3);
}

.k-legal__prose h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: #f9f5fd;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 1.25rem 0 0.5rem;
}

.k-legal__prose p { margin: 0.75rem 0; }

.k-legal__prose a {
  color: var(--k-cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.k-legal__prose a:hover { filter: brightness(1.15); }

.k-legal__prose ul,
.k-legal__prose ol {
  padding-left: 1.25rem;
  margin: 0.75rem 0;
}

.k-legal__prose li { margin: 0.4rem 0; }

.k-legal__prose strong { color: #f9f5fd; }

.k-legal__prose code {
  background: rgba(0, 212, 255, 0.08);
  color: var(--k-cyan);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.8rem;
}

.k-legal__prose blockquote {
  border-left: 2px solid rgba(0, 212, 255, 0.4);
  padding: 0.25rem 0 0.25rem 1rem;
  color: var(--k-muted);
  font-style: italic;
  margin: 1rem 0;
}

.k-legal__prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.85rem;
}

.k-legal__prose th,
.k-legal__prose td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.k-legal__prose th {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--k-cyan);
}

/* ---------- Grid cards inside sections (data-log style) ---------- */
.k-legal__cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .k-legal__cards--2 { grid-template-columns: repeat(2, 1fr); }
  .k-legal__cards--3 { grid-template-columns: repeat(3, 1fr); }
}

.k-legal__card {
  background: rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.k-legal__card-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.k-legal__card-label--cyan   { color: var(--k-cyan); }
.k-legal__card-label--green  { color: var(--k-green); }
.k-legal__card-label--muted  { color: var(--k-muted); }

.k-legal__card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.75rem;
  color: var(--k-muted);
}

.k-legal__card li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.k-legal__card li::before {
  content: "";
  width: 4px;
  height: 4px;
  background: currentColor;
  flex-shrink: 0;
}

.k-legal__card--cyan  li { color: #9cb3bd; }
.k-legal__card--cyan  li::before { background: var(--k-cyan); }
.k-legal__card--green li { color: #8faea0; }
.k-legal__card--green li::before { background: var(--k-green); }

/* ---------- Contact terminal ---------- */
.k-legal__contact {
  padding: 2rem;
  background: #25252d;
  border-top: 2px solid var(--k-cyan);
}

@media (min-width: 768px) {
  .k-legal__contact { padding: 3rem; }
}

.k-legal__contact-box {
  background: rgba(0, 0, 0, 0.4);
  padding: 2rem;
  border-radius: 8px;
}

.k-legal__contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .k-legal__contact-grid { grid-template-columns: 1fr 1fr; gap: 3rem; }
}

.k-legal__contact-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 9px;
  color: var(--k-muted);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.k-legal__contact-item + .k-legal__contact-item { margin-top: 1rem; }

.k-legal__contact-item-label {
  font-size: 0.75rem;
  color: var(--k-muted);
  margin-bottom: 0.25rem;
}

.k-legal__contact-item-value {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--k-cyan);
  text-transform: uppercase;
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  word-break: break-word;
}

a.k-legal__contact-item-value:hover { filter: brightness(1.15); }

.k-legal__contact-address {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  line-height: 1.7;
  color: #d4d4d8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: pre-line;
  margin: 0;
}

/* ---------- Light mode ---------- */
html[data-theme="light"] .k-legal { background: #F4F4F8; color: #0E0E13; }

html[data-theme="light"] .k-legal__side {
  background: var(--k-background);
  border-right-color: rgba(14, 14, 19, 0.08);
}

html[data-theme="light"] .k-legal__side-toggle {
  border-color: rgba(14, 14, 19, 0.12);
  color: #585863;
}

html[data-theme="light"] .k-legal__side-toggle:hover {
  color: #0088C7;
  border-color: rgba(0, 136, 199, 0.4);
}

html[data-theme="light"] .k-legal__toc-item { color: #585863; }
html[data-theme="light"] .k-legal__toc-item:hover { background: rgba(14, 14, 19, 0.04); color: #0E0E13; }
html[data-theme="light"] .k-legal__toc-item.is-active {
  color: #0088C7;
  background: rgba(0, 212, 255, 0.1);
  border-left-color: #0088C7;
}
html[data-theme="light"] .k-legal__side:not(.is-expanded) .k-legal__toc-item.is-active {
  border-right-color: #0088C7;
}

html[data-theme="light"] .k-legal__status {
  background: #FFFFFF;
  border-color: rgba(14, 14, 19, 0.08);
}

html[data-theme="light"] .k-legal__hero { border-bottom-color: rgba(14, 14, 19, 0.08); }
html[data-theme="light"] .k-legal__title { color: #0E0E13; text-shadow: none; }
html[data-theme="light"] .k-legal__eyebrow { color: #0088C7; }
html[data-theme="light"] .k-legal__lead { color: #585863; }
html[data-theme="light"] .k-legal__btn--primary { color: #FFFFFF; }
html[data-theme="light"] .k-legal__btn--ghost { color: #0088C7; border-color: rgba(0, 136, 199, 0.4); }
html[data-theme="light"] .k-legal__btn--ghost:hover { background: rgba(0, 136, 199, 0.06); }

html[data-theme="light"] .k-legal__section:nth-child(odd)  { background: #FFFFFF; }
html[data-theme="light"] .k-legal__section:nth-child(even) { background: #ECECF1; }
html[data-theme="light"] .k-legal__section:hover { background: #F8F8FC; }
html[data-theme="light"] .k-legal__module { color: #a1a1aa; }
html[data-theme="light"] .k-legal__section-title { color: #0088C7; }
html[data-theme="light"] .k-legal__section:nth-child(even) .k-legal__section-title { color: #0E0E13; }
html[data-theme="light"] .k-legal__prose { color: #3f3f46; }
html[data-theme="light"] .k-legal__prose strong,
html[data-theme="light"] .k-legal__prose h3,
html[data-theme="light"] .k-legal__prose h4 { color: #0E0E13; }
html[data-theme="light"] .k-legal__card { background: rgba(14, 14, 19, 0.03); border-color: rgba(14, 14, 19, 0.06); }
html[data-theme="light"] .k-legal__contact { background: #FFFFFF; border-top-color: #0088C7; }
html[data-theme="light"] #contact .k-legal__section-title { color: #0E0E13; }
html[data-theme="light"] #contact .k-legal__module { color: #0088C7; }
html[data-theme="light"] .k-legal__contact-box { background: #F4F4F8; }
html[data-theme="light"] .k-legal__contact-item-value { color: #0088C7; }
html[data-theme="light"] .k-legal__contact-address { color: #0E0E13; }
