/* =============================================================================
   BeautyCita — legal documents
   =============================================================================
   These read as BeautyCita pages first and legal documents second.

   The token block below is a MIRROR of web-static/registrar/onboard.css, which
   is the live design language for BeautyCita's static pages: Inter for body,
   Poppins for display, the pink→violet→blue brand gradient, cream and lilac
   surfaces, and the shimmer wordmark. If the brand identity changes, update
   BOTH files — the same convention beautycitaPalette already uses between core
   and mobile.

   (A first pass set these in Public Sans / Instrument Serif / IBM Plex Mono on
   a neutral violet-grey. It read as a well-made legal document belonging to no
   one in particular. Brand first.)

   What is specific to THESE pages, rather than inherited: the § spine. Nobody
   reads a privacy notice top to bottom — they arrive looking for clause 13 and
   need to send someone else to clause 13. So every section carries its number,
   is individually addressable, and can be copied as a link. On a phone that
   rail becomes a sticky bar that names the clause you are currently inside.
   ============================================================================= */

:root {
  /* ── MIRROR of registrar/onboard.css — keep in sync ─────────────────────── */
  --pink: #EC4899; --pink-deep: #DB2777;
  --violet: #8B5CF6; --violet-deep: #7C3AED; --violet-soft: #C084FC;
  --blue: #3B82F6; --lila-soft: #F3E8FF;
  --cream: #FCF5F0; --cream-deep: #F8EFE6;
  --surface: #FFFFFF;
  --ink: #1B1424; --text: #0F0F12; --text-mid: #4B5563; --text-light: #6B7280;
  --line: rgba(27, 20, 36, .08);
  --line-strong: rgba(27, 20, 36, .14);

  --grad-brand: linear-gradient(90deg, #EC4899 0%, #A855F7 50%, #3B82F6 100%);
  --grad-shimmer: linear-gradient(90deg, #EC4899 0%, #9333EA 33%, #3B82F6 66%, #EC4899 100%);
  --grad-cta: linear-gradient(135deg, #C084FC 0%, #8B5CF6 50%, #6366F1 100%);
  --grad-icon: linear-gradient(135deg, #EC4899 0%, #8B5CF6 100%);

  --shadow-card: 0 4px 24px rgba(15, 15, 18, .05);
  --shadow-lift: 0 18px 56px rgba(124, 58, 237, .16);
  --ring: 0 0 0 3px rgba(139, 108, 204, .28);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Poppins', var(--font-body);

  --pad-inline: clamp(18px, 5vw, 40px);
  --maxw: 1120px;
  /* ── legal-specific ─────────────────────────────────────────────────────── */
  --measure: 68ch;
  --rail: 16rem;
  --tap: 44px;          /* minimum comfortable touch target */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

/* Long RFCs, URLs and emails must never push the page sideways on a phone. */
p, li, dd, h1, h2, .rail a { overflow-wrap: break-word; }

a { color: var(--violet-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--pink-deep); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: #fff;
  padding: .7rem 1.1rem; border-radius: 10px; z-index: 60; font-weight: 600;
}
.skip:focus { left: 1rem; top: 1rem; }

/* The wordmark shimmer, identical to every other BeautyCita surface. */
@keyframes bc-shimmer { 0% { background-position: 0% 50%; } 100% { background-position: -200% 50%; } }
.grad {
  background: var(--grad-shimmer); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: bc-shimmer 6s linear infinite;
}

.eyebrow {
  font-family: var(--font-display); font-weight: 700; font-size: .74rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--violet-deep);
  margin: 0 0 .9rem;
}

/* ── Masthead ────────────────────────────────────────────────────────────── */
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }
.masthead::before { content: ""; display: block; height: 3px; background: var(--grad-brand); }
.masthead__in {
  max-width: var(--maxw); margin: 0 auto;
  padding: 1rem var(--pad-inline);
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.brand {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.28rem; letter-spacing: -.01em; text-decoration: none;
}
.masthead nav { display: flex; gap: .35rem; flex-wrap: wrap; }
.masthead nav a {
  font-size: .86rem; font-weight: 600; color: var(--text-mid);
  text-decoration: none; padding: .5rem .75rem; border-radius: 999px;
  transition: background .18s var(--ease-soft), color .18s var(--ease-soft);
}
.masthead nav a:hover { background: var(--lila-soft); color: var(--violet-deep); }
.masthead nav a[aria-current="page"] { background: var(--lila-soft); color: var(--violet-deep); }

/* ── Cover ───────────────────────────────────────────────────────────────── */
.cover {
  background: linear-gradient(180deg, var(--cream) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--line);
}
.cover__in { max-width: var(--maxw); margin: 0 auto; padding: clamp(2.25rem, 6vw, 4rem) var(--pad-inline) clamp(1.75rem, 4vw, 2.75rem); }
.cover h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.08; letter-spacing: -.02em;
  margin: 0; max-width: 20ch; color: var(--ink);
}
.cover__lede { margin: 1rem 0 0; max-width: 52ch; color: var(--text-mid); font-size: 1.05rem; }

.filing {
  margin: 1.9rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: .6rem;
}
.filing > div {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: .8rem .95rem; box-shadow: var(--shadow-card);
}
.filing dt {
  font-family: var(--font-display); font-weight: 700;
  font-size: .63rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--violet-deep); margin: 0 0 .25rem;
}
.filing dd { margin: 0; font-size: .9rem; font-weight: 600; color: var(--text); }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.layout {
  max-width: var(--maxw); margin: 0 auto;
  padding: 2.5rem var(--pad-inline) 5rem;
  display: grid; grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 3rem; align-items: start;
}

/* ── The § rail ──────────────────────────────────────────────────────────── */
.rail { position: sticky; top: 1.25rem; }
.rail__bar { display: none; }
.rail__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: .66rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--violet-deep); margin: 0 0 .7rem;
}
.rail ol {
  list-style: none; margin: 0; padding: .4rem;
  max-height: 72vh; overflow-y: auto;
  background: var(--cream); border: 1px solid var(--line); border-radius: 16px;
}
.rail a {
  display: grid; grid-template-columns: 2.1rem 1fr; gap: .25rem; align-items: start;
  padding: .55rem .6rem; border-radius: 10px;
  font-size: .85rem; line-height: 1.35; color: var(--text-mid);
  text-decoration: none;
  transition: background .16s var(--ease-soft), color .16s var(--ease-soft);
}
.rail a span { font-weight: 700; font-size: .76rem; color: var(--violet-soft); }
.rail a:hover { background: var(--surface); color: var(--text); }
.rail a.is-current { background: var(--surface); color: var(--violet-deep); font-weight: 650; box-shadow: var(--shadow-card); }
.rail a.is-current span { color: var(--pink); }

/* ── Document ────────────────────────────────────────────────────────────── */
.doc { max-width: var(--measure); }
.sec { padding: 2.4rem 0; border-top: 1px solid var(--line); scroll-margin-top: 1.5rem; }
.sec:first-of-type { border-top: 0; padding-top: 0; }

.sec__head { display: flex; align-items: baseline; gap: .8rem; margin: 0 0 .9rem; }
.sec__n {
  font-family: var(--font-display); font-weight: 800; font-size: .9rem;
  background: var(--grad-icon); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  flex: none; padding-top: .15rem;
}
.sec h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.3rem; line-height: 1.32; letter-spacing: -.01em;
  margin: 0; color: var(--ink);
}

/* Cite one clause. Visible on hover with a pointer; ALWAYS visible on touch,
   where there is no hover to reveal it — the affordance was invisible on
   phones in the first build, which is where it is most useful. */
.sec__link {
  margin-left: auto; flex: none; align-self: center;
  font-size: .75rem; font-weight: 600; color: var(--violet-soft);
  text-decoration: none; white-space: nowrap;
  padding: .45rem .7rem; border-radius: 999px;
  background: var(--lila-soft);
  opacity: 0; transition: opacity .16s var(--ease-soft), color .16s var(--ease-soft);
}
.sec:hover .sec__link, .sec__link:focus-visible { opacity: 1; }
.sec__link:hover { color: var(--violet-deep); }
.sec__link.is-copied { opacity: 1; color: var(--violet-deep); background: var(--lila-soft); }
/* Two triggers, deliberately. `hover: none` is the correct test and catches
   real touch devices; the width query is the belt, because a narrow window on
   a hybrid device still reports `hover: hover` and would hide the affordance
   at exactly the size where the reader most needs it. */
@media (hover: none), (max-width: 900px) {
  .sec__link { opacity: 1; }
}

.sec p { margin: 0 0 1rem; }
.sec ul, .sec ol { margin: 0 0 1rem; padding-left: 0; list-style: none; }
.sec li { position: relative; padding-left: 1.3rem; margin-bottom: .55rem; }
.sec li::before {
  content: ""; position: absolute; left: .1rem; top: .62em;
  width: .42rem; height: .42rem; border-radius: 50%; background: var(--grad-icon);
}
.sec strong { font-weight: 700; color: var(--ink); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.foot { background: var(--cream); border-top: 1px solid var(--line); }
.foot__in {
  max-width: var(--maxw); margin: 0 auto; padding: 2.25rem var(--pad-inline) 3rem;
  display: flex; gap: 1.75rem; flex-wrap: wrap; justify-content: space-between;
  font-size: .875rem; color: var(--text-mid);
}
.foot nav { display: flex; gap: .35rem; flex-wrap: wrap; }
.foot nav a {
  color: var(--text-mid); text-decoration: none; font-weight: 600;
  padding: .5rem .75rem; border-radius: 999px;
}
.foot nav a:hover { background: var(--surface); color: var(--violet-deep); }
.foot__legal { font-size: .78rem; color: var(--text-light); max-width: 46ch; line-height: 1.6; }

/* ── Phone ───────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding-top: 0; }

  /* The rail stops being a column and becomes a bar that tells you which
     clause you are inside — the one thing the desktop rail gives you that a
     collapsed list cannot. It sticks; the list opens over the page. */
  .rail { position: sticky; top: 0; z-index: 30; margin: 0 calc(-1 * var(--pad-inline)); }
  .rail__title { display: none; }
  .rail__bar {
    display: flex; align-items: center; gap: .7rem; width: 100%;
    min-height: var(--tap);
    padding: .7rem var(--pad-inline);
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border: 0; border-bottom: 1px solid var(--line);
    font-family: var(--font-body); font-size: .88rem; color: var(--text-mid);
    text-align: left; cursor: pointer;
  }
  .rail__bar-n {
    font-family: var(--font-display); font-weight: 800; font-size: .82rem;
    background: var(--grad-icon); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; flex: none;
  }
  .rail__bar-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text); }
  .rail__bar-caret { flex: none; color: var(--violet); transition: transform .2s var(--ease); }
  .rail[data-open="true"] .rail__bar-caret { transform: rotate(180deg); }

  .rail ol {
    max-height: min(60vh, 26rem);
    margin: 0 var(--pad-inline);
    border-radius: 0 0 16px 16px;
    box-shadow: var(--shadow-lift);
    background: var(--surface);
  }
  .rail[data-open="false"] ol { display: none; }
  /* Comfortable targets: these were 28px tall, which is a miss on a phone. */
  .rail a { min-height: var(--tap); align-items: center; padding: .6rem .7rem; }

  .layout > .doc { padding-top: 2rem; }
  .sec { scroll-margin-top: 4rem; }   /* clear the sticky bar */
  .cover__in { padding-bottom: 1.5rem; }
  /* Two up, so the cover does not become a column of four cards. */
  .filing { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .filing dd { font-size: .84rem; }
}

@media (max-width: 380px) {
  .filing { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grad { animation: none; }
  * { transition-duration: .01ms !important; }
}

/* ── Print ───────────────────────────────────────────────────────────────── */
@media print {
  .masthead nav, .rail, .skip, .sec__link, .foot nav { display: none !important; }
  body { font-size: 11pt; background: #fff; color: #000; }
  .cover { background: #fff; }
  .layout { display: block; padding: 0; }
  .doc { max-width: none; }
  .grad { -webkit-text-fill-color: #1B1424; color: #1B1424; animation: none; }
  .sec__n { -webkit-text-fill-color: #7C3AED; color: #7C3AED; }
  .sec { padding: 1rem 0; }
  .sec__head { break-after: avoid; }
  .filing { break-inside: avoid; }
  .doc a[href^="http"]::after, .doc a[href^="mailto"]::after {
    content: " (" attr(href) ")"; font-size: 9pt; color: #555;
  }
}
