/* Sparksy legal pages.
 *
 * The palette is the app's, from lib/core/theme/app_colors.dart, so somebody
 * arriving from the registration screen lands somewhere that looks like the
 * place they came from.
 *
 * No web fonts. The app uses Plus Jakarta Sans, and matching it here would
 * mean a request to Google's font servers on the one page whose whole job is
 * to be straight about what reaches third parties. A system stack costs
 * nothing, loads instantly, and does not undercut the text it is setting.
 */

:root {
  --navy: #03225e;
  --violet: #9e52d9;
  --coral: #f5693d;
  --coral-light: #f89677;

  --text: #1e293b;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --border: #cbd5e1;
  --border-light: #e2e8f0;
  --surface: #ffffff;
  --surface-alt: #f8fafc;

  --measure: 68ch;
  --radius: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  /* A column, so the footer sits on the floor of a short page instead of
     halfway up it with white space underneath. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- header */

.masthead {
  background: linear-gradient(135deg, var(--navy) 0%, var(--violet) 140%);
  color: #fff;
  padding: 22px 0 26px;
}

.masthead__inner,
.page,
.footer__inner {
  width: min(100% - 40px, 1080px);
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 19px;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: block;
}

/* ------------------------------------------------------------ doc header */

.doc-head {
  padding: 40px 0 26px;
  border-bottom: 1px solid var(--border-light);
}

.doc-head h1 {
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: var(--navy);
}

.doc-head .stamp {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
}

.back {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--violet);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}

.back:hover {
  text-decoration: underline;
}

/* ----------------------------------------------------------------- layout */

.layout {
  display: grid;
  gap: 44px;
  padding: 34px 0 72px;
  align-items: start;
}

@media (min-width: 900px) {
  .layout {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 56px;
  }
}

/* -------------------------------------------------------------------- toc */

.toc {
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px 20px;
}

@media (min-width: 900px) {
  .toc {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
  }
}

.toc__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 12px;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc li + li {
  margin-top: 9px;
}

.toc a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  line-height: 1.4;
  display: block;
}

.toc a:hover {
  color: var(--violet);
}

/* ------------------------------------------------------------------- prose */

.prose {
  max-width: var(--measure);
}

.prose h2 {
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin: 42px 0 14px;
  scroll-margin-top: 20px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-size: 18px;
  color: var(--navy);
  margin: 30px 0 10px;
  scroll-margin-top: 20px;
}

.prose p {
  margin: 0 0 18px;
}

.prose ul {
  margin: 0 0 18px;
  padding-left: 22px;
}

.prose li {
  margin-bottom: 9px;
}

.prose a {
  color: var(--violet);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.prose strong {
  font-weight: 650;
}

/* Keeps a long address or e-mail from pushing the column sideways. */
.prose {
  overflow-wrap: break-word;
}

/* -------------------------------------------------------------- home page */

.hero {
  padding: 60px 0 10px;
}

.hero h1 {
  font-size: clamp(32px, 6vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  color: var(--navy);
}

.hero p {
  max-width: 54ch;
  color: var(--text-secondary);
  font-size: 18px;
  margin: 0;
}

.cards {
  display: grid;
  gap: 16px;
  padding: 34px 0 60px;
}

@media (min-width: 720px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  display: block;
  padding: 22px 22px 24px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: var(--violet);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
  }
  .card:hover {
    transform: none;
  }
}

.card h2 {
  margin: 0 0 6px;
  font-size: 19px;
  color: var(--navy);
}

.card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.55;
}

.card__mark {
  display: block;
  width: 34px;
  height: 4px;
  border-radius: 99px;
  margin-bottom: 16px;
  background: linear-gradient(
    90deg,
    var(--coral-light) 0%,
    var(--coral) 100%
  );
}

/* ----------------------------------------------------------------- footer */

main {
  flex: 1 0 auto;
}

.footer {
  border-top: 1px solid var(--border-light);
  background: var(--surface-alt);
  padding: 30px 0 40px;
  color: var(--text-secondary);
  font-size: 15px;
}

.footer a {
  color: var(--violet);
}

.footer p {
  margin: 0 0 6px;
  max-width: var(--measure);
}

.footer strong {
  color: var(--text);
  font-weight: 650;
}

/* Visible focus everywhere, on the brand colour rather than the browser's. */
a:focus-visible,
.card:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
  border-radius: 4px;
}
