/* Fèsì legal site. Colours come from the app's own tokens. */
:root {
  --bg: #2F1A1A;
  --surface: #3B2121;
  --surface-2: #4E2E2E;
  --line: #6A4644;
  --text: #F6EBE4;
  --muted: #C9B3A9;
  --accent: #FEC835;
  --accent-ink: #3B2121;
  --link: #FEC835;
  --danger: #FF8A7A;
  --glow: rgba(254, 200, 53, 0.14);
  --pattern: 0.07;
  --radius: 18px;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #FBF4EE;
    --surface: #FFFFFF;
    --surface-2: #F4E7DD;
    --line: #E6D5C9;
    --text: #2E1B1B;
    --muted: #6E564F;
    --link: #8F4F00;
    --danger: #B3321F;
    --glow: rgba(254, 200, 53, 0.35);
    --pattern: 0.06;
  }
}
:root[data-theme="light"] {
  --bg: #FBF4EE; --surface: #FFFFFF; --surface-2: #F4E7DD; --line: #E6D5C9;
  --text: #2E1B1B; --muted: #6E564F; --link: #8F4F00; --danger: #B3321F;
  --glow: rgba(254, 200, 53, 0.35); --pattern: 0.06;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: 16px; top: -60px; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 10px; z-index: 50; font-weight: 600; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; }
.brand svg { width: 38px; height: 38px; flex: none; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--line); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 300px at 80% -10%, var(--glow), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23FEC835' stroke-opacity='0.10' stroke-width='1.2'%3E%3Ccircle cx='28' cy='28' r='5'/%3E%3Ccircle cx='28' cy='28' r='13'/%3E%3Ccircle cx='28' cy='28' r='21'/%3E%3Ccircle cx='0' cy='0' r='7'/%3E%3Ccircle cx='56' cy='0' r='7'/%3E%3Ccircle cx='0' cy='56' r='7'/%3E%3Ccircle cx='56' cy='56' r='7'/%3E%3C/g%3E%3C/svg%3E");
  opacity: 1;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
          mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
}
.hero .wrap { position: relative; padding-top: 72px; padding-bottom: 72px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
:root[data-theme="light"] .eyebrow, :root:not([data-theme="dark"]) .eyebrow { }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .eyebrow { color: var(--link); } }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(38px, 7vw, 68px); line-height: 1.04; letter-spacing: -0.025em; margin: 18px 0 18px; max-width: 14ch; }
.hero h1 em { font-style: italic; color: var(--accent); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .hero h1 em { color: var(--link); } }
.lead { font-size: clamp(18px, 2.4vw, 21px); color: var(--muted); max-width: 54ch; margin: 0; }

/* ---------- cards ---------- */
.section { padding: 56px 0; }
.section h2 { font-family: var(--display); font-size: clamp(26px, 4vw, 34px); letter-spacing: -0.015em; line-height: 1.15; margin: 0 0 8px; }
.section .sub { color: var(--muted); margin: 0 0 28px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; color: var(--text); text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}
a.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); margin-bottom: 6px; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .card .icon { color: var(--link); } }
.card .icon svg { width: 22px; height: 22px; }
.card h3 { margin: 0; font-family: var(--display); font-size: 21px; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.55; }
.card .more { margin-top: auto; padding-top: 10px; font-weight: 600; font-size: 15px; color: var(--link); }

.strip { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.points { display: grid; gap: 28px; margin-top: 22px !important; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 8px; }
.points h3 { font-family: var(--display); font-size: 19px; margin: 0 0 6px; }
.points p { margin: 0; color: var(--muted); font-size: 15.5px; }

/* ---------- document pages ---------- */
.doc-head { border-bottom: 1px solid var(--line); background: linear-gradient(to bottom, var(--surface), var(--bg)); }
.doc-head .wrap { padding-top: 52px; padding-bottom: 40px; }
.doc-head h1 { font-family: var(--display); font-size: clamp(34px, 6vw, 52px); line-height: 1.08; letter-spacing: -0.025em; margin: 10px 0 12px; }
.meta { color: var(--muted); font-size: 15px; margin: 0; }

.doc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; padding-top: 40px; padding-bottom: 80px; }
@media (min-width: 900px) { .doc { grid-template-columns: 240px minmax(0, 1fr); } }

.toc { font-size: 14.5px; }
.toc summary { cursor: pointer; font-weight: 600; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.toc a { display: block; padding: 6px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--text); background: var(--surface-2); }
@media (min-width: 900px) {
  .toc { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; }
  .toc summary { pointer-events: none; background: none; border: 0; padding: 0 12px 6px; text-transform: uppercase; letter-spacing: .07em; font-size: 12.5px; color: var(--muted); }
}

.prose { max-width: 70ch; }
.prose h2 { font-family: var(--display); font-size: 26px; line-height: 1.2; letter-spacing: -0.015em; margin: 44px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 18px; margin: 26px 0 6px; }
.prose p, .prose li { color: var(--text); }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 650; }

.callout { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 14px; padding: 18px 20px; margin: 0 0 28px; }
.callout h2, .callout h3 { margin: 0 0 8px !important; font-size: 18px !important; font-family: var(--body) !important; letter-spacing: 0 !important; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }

table.data { width: 100%; border-collapse: collapse; margin: 6px 0 20px; font-size: 15.5px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: block; overflow-x: auto; }
table.data th, table.data td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data td:first-child { font-weight: 600; white-space: nowrap; }

/* ---------- help ---------- */
.faq { display: grid; gap: 10px; margin-bottom: 36px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--accent); flex: none; transition: transform .15s; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .faq summary::after { color: var(--link); } }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 18px 18px; color: var(--muted); }
.faq .answer p { margin: 0 0 10px; }
.faq .answer p:last-child { margin: 0; }
.faq .answer strong { color: var(--text); }
.faq .answer ol, .faq .answer ul { margin: 0 0 10px; padding-left: 22px; }
.group-title { font-family: var(--display); font-size: 24px; margin: 38px 0 14px; letter-spacing: -0.01em; }
.group-title:first-child { margin-top: 0; }

/* ---------- contact ---------- */
.contact-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 10px 0 30px; }
.contact-grid .card .mail { font-weight: 600; color: var(--link); overflow-wrap: anywhere; }

/* ---------- shared-profile page ---------- */
.center { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 60px 20px; }
.center .panel { max-width: 460px; }
.avatar-ring { width: 96px; height: 96px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 3px solid var(--accent); }
.avatar-ring svg { width: 44px; height: 44px; color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 22px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 700; border: 0; }
.btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
code.id { display: inline-block; max-width: 100%; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--line); padding: 4px 10px; border-radius: 8px; font-size: 14px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.site-footer .wrap { padding-top: 36px; padding-bottom: 36px; display: grid; gap: 20px; }
@media (min-width: 720px) { .site-footer .wrap { grid-template-columns: 1fr auto; align-items: start; } }
.site-footer p { margin: 0; color: var(--muted); font-size: 14.5px; }
.foot-links { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.foot-links a { color: var(--text); text-decoration: none; font-size: 15px; }
.foot-links a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .site-header .wrap { padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .nav { justify-content: flex-start; margin-left: -8px; }
  .hero .wrap { padding-top: 48px; padding-bottom: 48px; }
  .section { padding: 40px 0; }
}
@media print {
  .site-header, .site-footer, .toc { display: none; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .doc { display: block; }
}

[hidden] { display: none !important; }
