/* ----------------------------------------------------------
   MM Studio — Legal pages
   Modern, accessible, responsive CSS
---------------------------------------------------------- */

:root {
  --bg:            #0b0d10;
  --bg-elev:       #111418;
  --surface:       #ffffff;
  --surface-2:     #f7f8fb;
  --surface-3:     #eef0f5;
  --border:        #e5e7ee;
  --border-strong: #d3d7e0;
  --text:          #0f1115;
  --text-muted:    #5a6472;
  --text-subtle:   #8a93a2;
  --brand:         #5b5bf7;
  --brand-2:       #8b5cf6;
  --brand-ink:     #1e1b4b;
  --accent:        #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(15, 17, 21, 0.04), 0 1px 1px rgba(15, 17, 21, 0.03);
  --shadow:    0 10px 30px -12px rgba(15, 17, 21, 0.18), 0 2px 6px rgba(15, 17, 21, 0.04);
  --shadow-lg: 0 30px 60px -20px rgba(15, 17, 21, 0.25);

  --container: 1120px;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Inter", "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface:       #0f1216;
    --surface-2:     #13171c;
    --surface-3:     #1a1f26;
    --border:        #232932;
    --border-strong: #2e3541;
    --text:          #e8ecf2;
    --text-muted:    #a5adbb;
    --text-subtle:   #7a8394;
    --brand:         #8b8bff;
    --brand-2:       #b794f6;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.35);
    --shadow:    0 10px 30px -12px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.3);
    --shadow-lg: 0 30px 60px -20px rgba(0,0,0,0.7);
  }
}

* { box-sizing: border-box; }
*::selection { background: color-mix(in oklab, var(--brand) 30%, transparent); }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; display: block; }

a {
  color: var(--brand);
  text-decoration: none;
  transition: color .15s ease, opacity .15s ease;
}
a:hover { color: var(--brand-2); }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  z-index: 1000;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--surface) 85%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1rem;
}
.brand:hover { color: var(--text); }

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 14px -6px color-mix(in oklab, var(--brand) 70%, transparent);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(255,255,255,.65), rgba(255,255,255,0));
  mix-blend-mode: overlay;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  padding: .5rem .8rem;
  border-radius: 10px;
  font-size: .925rem;
}
.nav-links a:hover {
  color: var(--text);
  background: var(--surface-2);
}
.nav-links a.active {
  color: var(--text);
  background: var(--surface-2);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .9rem;
  border-radius: 10px;
  background: var(--text);
  color: var(--surface) !important;
  font-weight: 600;
  font-size: .9rem;
  border: 1px solid var(--text);
}
.nav-cta:hover { opacity: .9; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .45rem .55rem;
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav.open .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .1rem;
    padding: .75rem 1rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3.5rem, 9vw, 6rem) 0 clamp(2rem, 5vw, 3rem);
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto -20%;
  height: 520px;
  background:
    radial-gradient(600px 280px at 20% 30%, color-mix(in oklab, var(--brand) 35%, transparent), transparent 60%),
    radial-gradient(520px 260px at 80% 10%, color-mix(in oklab, var(--brand-2) 30%, transparent), transparent 60%);
  filter: blur(8px);
  z-index: -1;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in oklab, var(--text) 6%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in oklab, var(--text) 6%, transparent) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at top, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at top, #000 20%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .02em;
  box-shadow: var(--shadow-sm);
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 20%, transparent);
}

h1, h2, h3, h4 {
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 .5rem;
}
h1 {
  font-size: clamp(2.1rem, 4.8vw, 3.4rem);
  font-weight: 800;
  margin-top: 1rem;
}
h2 { font-size: clamp(1.35rem, 2.2vw, 1.6rem); font-weight: 700; margin-top: 2.25rem; }
h3 { font-size: 1.075rem; font-weight: 650; margin-top: 1.25rem; color: var(--text); }

.lede {
  color: var(--text-muted);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  max-width: 60ch;
  margin: 1rem 0 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.1rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .1s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); color: var(--text); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border-color: transparent;
}
.btn-primary:hover { color: #fff; filter: brightness(1.05); }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 2.5rem;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1.25rem 1.25rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .2s ease, border-color .15s ease;
  color: var(--text);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
  color: var(--text);
}
.card .icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: color-mix(in oklab, var(--brand) 14%, var(--surface-2));
  color: var(--brand);
}
.card h3 { margin: .35rem 0 .1rem; }
.card p { color: var(--text-muted); margin: 0; font-size: .95rem; }
.card .arrow {
  margin-top: .75rem;
  color: var(--brand);
  font-weight: 600;
  display: inline-flex;
  gap: .35rem;
  align-items: center;
  font-size: .9rem;
}

/* ---------- Legal article layout ---------- */
.legal {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 3rem;
  padding: clamp(2rem, 5vw, 3.5rem) 0 4rem;
  align-items: start;
}
@media (max-width: 960px) {
  .legal { grid-template-columns: 1fr; gap: 1.5rem; }
}

.toc {
  position: sticky;
  top: 84px;
  align-self: start;
  padding: 1rem 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: .9rem;
}
.toc h4 {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-subtle);
  margin: 0 0 .75rem;
  font-weight: 700;
}
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: .35rem .5rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.4;
  border-left: 2px solid transparent;
}
.toc a:hover { color: var(--text); background: color-mix(in oklab, var(--surface) 60%, transparent); }
.toc a.active {
  color: var(--text);
  background: var(--surface);
  border-left-color: var(--brand);
}

@media (max-width: 960px) {
  .toc { position: static; }
}

.article h1 {
  margin-top: 0;
  font-size: clamp(2rem, 4.4vw, 2.75rem);
}
.article .meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  color: var(--text-muted);
  font-size: .9rem;
  margin: .25rem 0 1.25rem;
}
.article .meta .pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: .15rem .6rem;
  border-radius: 999px;
}

.article p, .article li { color: var(--text); }
.article ul { padding-left: 1.15rem; }
.article li { margin: .25rem 0; }
.article strong { color: var(--text); }

.section {
  padding-top: 1rem;
  scroll-margin-top: 88px;
}
.section h2 {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  border-top: 1px solid var(--border);
  padding-top: 1.6rem;
}
.section h2 .num {
  font-size: .8rem;
  color: var(--text-subtle);
  font-weight: 600;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.section:first-of-type h2 { border-top: 0; padding-top: 0; }

/* ---------- Callouts ---------- */
.callouts {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 1.25rem 0 0;
}
.callout {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.callout .check {
  flex: none;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 18%, var(--surface));
  color: var(--accent);
}
.callout p { margin: 0; font-size: .9rem; color: var(--text-muted); }
.callout strong { color: var(--text); }

.note {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  background: color-mix(in oklab, var(--brand) 6%, var(--surface-2));
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  font-size: .95rem;
  color: var(--text-muted);
}
.note strong { color: var(--text); }

/* ---------- Contact block ---------- */
.contact-card {
  margin-top: 1rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}
.contact-card .k { color: var(--text-subtle); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.contact-card .v { color: var(--text); font-weight: 600; }
.contact-card a.v { color: var(--brand); }
.contact-card .contact-item { display: grid; gap: .15rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.25rem 0 3rem;
  margin-top: 2rem;
  background: var(--surface-2);
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: space-between;
  align-items: center;
}
.footer-grid p { margin: 0; color: var(--text-muted); font-size: .9rem; }
.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-links a { color: var(--text-muted); font-weight: 500; font-size: .9rem; }
.footer-links a:hover { color: var(--text); }

/* ---------- Utilities ---------- */
.center { text-align: center; }
.muted { color: var(--text-muted); }
.small { font-size: .875rem; }

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--text);
  color: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  transform: translateY(8px);
}
.back-to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { color: var(--surface); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
