/* ============================================================
   Synexian — Legal template (cream theme, home-derived family)
   Hub (pages/legal/) + document pages (pages/legal/<slug>/),
   both driven by the DOCUMENTS registry in ./legal.js — same
   registry pattern as careers OPENINGS / resources LIBRARY.
   Signature elements: manila-folder cards on the hub, a
   letterhead document head with updated/version stamps, auto-
   numbered clauses with a generated TOC, per-clause "In plain
   words" boxes, and print support. Light motion only.
   NOTE: sample documents ship with a DRAFT stamp + [bracketed]
   placeholders — both must survive until counsel signs off.
   ============================================================ */

section { padding: 6rem 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.grid-paper {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, #000 30%, transparent 75%);
}

.tagline {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 1.4rem;
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(22px); }
}

/* rubber stamps (dotted-mask texture, family pattern) */
.stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1.6px solid currentColor;
  border-radius: 6px;
  padding: 0.28rem 0.6rem;
  rotate: -2deg;
  opacity: 0.9;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Ccircle cx='1' cy='1' r='1.2' fill='%23000'/%3E%3Ccircle cx='3' cy='3' r='1.2' fill='%23000'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Ccircle cx='1' cy='1' r='1.2' fill='%23000'/%3E%3Ccircle cx='3' cy='3' r='1.2' fill='%23000'/%3E%3C/svg%3E");
}
.stamp.draft { color: var(--coral); rotate: 2deg; }
.stamp.ok { color: var(--olive); }
.stamp .stamp-v { text-transform: none; letter-spacing: 0.06em; }

/* ============================================================
   HUB
   ============================================================ */

.hero {
  position: relative;
  padding: 5.5rem 0 5rem;
  overflow: hidden;
}
.hub-inner {
  position: relative;
  max-width: 840px;
  margin-inline: auto;
  text-align: center;
}
.hub-inner h1 {
  font-size: clamp(2.4rem, 5.2vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.hub-inner h1 em { font-style: normal; color: var(--amber-deep); }
.hero-sub {
  margin: 1.5rem auto 0;
  max-width: 58ch;
  font-size: 1.08rem;
  color: var(--text-dim);
}
.hub-inner > * { animation: rise-in 0.9s var(--ease-out) both; }
.hub-inner > *:nth-child(2) { animation-delay: 0.08s; }
.hub-inner > *:nth-child(3) { animation-delay: 0.16s; }

/* manila-folder document cards */
.cabinet { background: var(--surface); border-block: 1px solid var(--line); }
.cabinet .section-head { margin-bottom: 3.2rem; }
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
.cabinet .section-head,
.other-docs .section-head { margin-inline: auto; text-align: center; }
.folder-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 1.6rem;
}
.folder-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
  padding: 1.9rem 2rem 1.7rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 18px 40px -28px rgba(20, 36, 48, 0.35);
  transition: transform 0.3s var(--ease-out), border-color 0.3s, box-shadow 0.3s var(--ease-out);
}
.folder-card:hover {
  transform: translateY(-5px);
  border-color: var(--amber);
  box-shadow: 0 28px 55px -28px rgba(20, 36, 48, 0.45);
}
/* the folder tab */
.folder-tab {
  position: absolute;
  top: -15px;
  left: -1px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  color: var(--amber-deep);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  padding: 0.3rem 1rem 0.5rem;
  transition: border-color 0.3s;
}
.folder-card:hover .folder-tab { border-color: var(--amber); border-bottom: none; }
.folder-card h3 { font-size: 1.3rem; }
.folder-card h3 .soon {
  float: right;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-top: 0.3rem;
}
.folder-card > p { color: var(--text-dim); font-size: 0.95rem; flex: 1; }
.folder-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
/* faux document-preview lines */
.doc-lines { display: grid; gap: 6px; margin: 0.4rem 0 0.6rem; }
.doc-lines i { height: 4px; border-radius: 2px; background: var(--line); }
.doc-lines i:nth-child(1) { width: 90%; }
.doc-lines i:nth-child(2) { width: 72%; }
.doc-lines i:nth-child(3) { width: 84%; }
.folder-card .go {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--amber-deep);
}
.folder-card .go svg { width: 16px; height: 16px; transition: transform 0.2s var(--ease-out); }
.folder-card:hover .go svg { transform: translateX(4px); }

/* hub plain-language note */
.hub-note {
  margin-top: 2.4rem;
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.hub-note svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--olive); }

/* ============================================================
   DOCUMENT pages
   ============================================================ */

.doc-hero {
  position: relative;
  padding: 4.5rem 0 3rem;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
/* One centered reading column shared by the letterhead, contents card and
   clause body, so all three start and end on the same vertical lines. */
.doc-hero, .doc-layout { --doc-w: 800px; }
.letterhead { position: relative; max-width: var(--doc-w); margin-inline: auto; }
.lh-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.8rem;
}
.lh-brand img { height: 34px; width: auto; }
.lh-brand span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  color: var(--text-faint);
}
.lh-brand .kicker-back {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-decoration: none;
}
.lh-brand .kicker-back:hover { color: var(--amber-deep); }
.letterhead h1 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.doc-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem 1.3rem;
  margin-top: 1.4rem;
}
.doc-meta .m {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.doc-meta .m b { color: var(--text-dim); font-weight: 500; }
.print-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--text);
  transition: border-color 0.2s, color 0.2s;
}
.print-btn:hover { border-color: var(--amber); color: var(--amber-deep); }
.print-btn svg { width: 15px; height: 15px; }
.letterhead > * { animation: rise-in 0.8s var(--ease-out) both; }
.letterhead > *:nth-child(2) { animation-delay: 0.07s; }
.letterhead > *:nth-child(3) { animation-delay: 0.14s; }

/* generated table of contents */
.doc-layout { padding: 3rem 0 4.5rem; }
.toc-card {
  max-width: var(--doc-w);
  margin: 0 auto 3rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.7rem;
}
.toc-card .toc-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin-bottom: 0.9rem;
}
.toc-card ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 2rem;
}
.toc-card a {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.93rem;
  transition: color 0.2s;
}
.toc-card a:hover { color: var(--amber-deep); }
.toc-card a .n { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-faint); }

/* clause body */
.doc-body {
  max-width: var(--doc-w);
  margin-inline: auto;
  font-size: 1rem;
  line-height: 1.75;
}
.clause {
  padding: 0; /* clauses are <section>s — opt out of the page-level section padding */
  scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}
.clause + .clause { margin-top: 2.8rem; }
.clause h2 {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.9rem;
}
.clause h2 .cl-n {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--amber-deep);
}
.clause p, .clause li { color: var(--text-dim); }
.clause p + p { margin-top: 0.9em; }
.clause ul { padding-left: 1.3em; display: grid; gap: 0.5em; margin: 0.9em 0; }
.clause a { color: var(--amber-deep); text-underline-offset: 3px; }
.clause strong { color: var(--text); }

/* cookie / data tables */
.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.clause table { width: 100%; border-collapse: collapse; font-size: 0.9rem; line-height: 1.5; }
.clause th, .clause td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
}
.clause th {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}
.clause tbody tr:last-child td { border-bottom: none; }
.clause td:first-child { color: var(--text); }
.clause td code { font-family: var(--font-mono); font-size: 0.84em; overflow-wrap: anywhere; }
.clause .consent-btn { margin-top: 0.4rem; }
.clause .consent-note { color: var(--coral); font-size: 0.92rem; }

/* bracketed placeholders counsel must resolve */
.fill-me {
  font-family: var(--font-mono);
  font-size: 0.88em;
  font-style: normal;
  color: var(--coral);
  background: color-mix(in srgb, var(--coral) 10%, transparent);
  border: 1px dashed color-mix(in srgb, var(--coral) 45%, transparent);
  border-radius: 6px;
  padding: 0.05em 0.4em;
}

/* per-clause plain-language summary */
.plain {
  margin-top: 1.1rem;
  background: color-mix(in srgb, var(--olive) 9%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--olive) 35%, var(--line));
  border-radius: var(--radius);
  padding: 1rem 1.3rem;
  font-size: 0.95rem;
  color: var(--text-dim);
}
.plain .pl-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--olive);
  margin-bottom: 0.4rem;
}

/* dots divider + end row */
.dots-divider {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin: 3rem 0;
}
.dots-divider i { width: 9px; height: 9px; border-radius: 50%; }
.dots-divider i:nth-child(1) { background: var(--amber); }
.dots-divider i:nth-child(2) { background: var(--coral); }
.dots-divider i:nth-child(3) { background: var(--olive); }

/* other documents strip */
.other-docs { background: var(--surface); border-block: 1px solid var(--line); }
.other-docs .section-head { margin-bottom: 2.6rem; }
.other-docs .folder-grid { grid-template-columns: repeat(3, 1fr); }

/* ---------- final CTA — ink card (family pattern) ---------- */
.cta-final { padding-bottom: 7rem; }
.cta-card {
  position: relative;
  background: var(--ink-800);
  color: var(--cream);
  border-radius: var(--radius-lg);
  padding: clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
  overflow: hidden;
}
.cta-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(240, 235, 218, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 235, 218, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
}
.cta-card > * { position: relative; }
.cta-dots { display: inline-flex; gap: 8px; margin-bottom: 1.4rem; }
.cta-dots i { width: 12px; height: 12px; border-radius: 50%; }
.cta-dots i:nth-child(1) { background: var(--amber); }
.cta-dots i:nth-child(2) { background: var(--coral); }
.cta-dots i:nth-child(3) { background: var(--olive); }
.cta-card h2 { font-size: clamp(1.9rem, 4.5vw, 3rem); }
.cta-card p {
  max-width: 62ch;
  margin: 1.1rem auto 2rem;
  color: rgba(240, 235, 218, 0.7);
}
.cta-group { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.cta-card .btn-ghost { color: var(--cream); border-color: rgba(240, 235, 218, 0.3); }
.cta-card .btn-ghost:hover { border-color: var(--amber); color: var(--amber); }

/* ---------- print ---------- */
@media print {
  .syn-nav, syn-footer, .cta-final, .other-docs, .print-btn, .toc-card, .dots-divider { display: none !important; }
  main { padding-top: 0; }
  body { background: #fff; }
  .doc-hero { padding-top: 1rem; border-bottom: 2px solid #000; }
  .plain { border: 1px solid #999; background: none; }
  .table-wrap { overflow: visible; }
  .consent-btn, .consent-note { display: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .folder-grid,
  .other-docs .folder-grid { grid-template-columns: 1fr; }
  .toc-card ol { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  section { padding: 4rem 0; }
  .clause table { min-width: 540px; }
  .hero { padding: 3.5rem 0 4rem; }
  .doc-meta { gap: 0.7rem 1rem; }
  .print-btn { margin-left: 0; }
}
