@font-face {
  font-family: 'Satoshi';
  src: url('/fonts/satoshi-variable.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #000;
  --paper: #fff;
  --muted: #5c5c5c;
  --rule: #d9d9d9;
  --gutter: clamp(18px, 4vw, 48px);
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: 'Satoshi', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.draft-banner {
  margin: 0;
  padding: 10px var(--gutter);
  background: #ffe24a;
  font-size: 14px;
  font-weight: 600;
}

.legal-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 22px var(--gutter);
}

.legal-lang {
  color: inherit;
  font-size: 15px;
  font-weight: 600;
  text-underline-offset: 3px;
}

.legal-note {
  max-width: 62ch;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 15px;
}

.legal-home {
  color: inherit;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.legal-home:hover,
.legal-home:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.legal {
  max-width: 1200px;
  padding: clamp(24px, 6vw, 72px) var(--gutter) 120px;
}

.legal-title {
  margin: 0 0 28px;
  font-size: clamp(46px, 8vw, 112px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.legal-intro {
  max-width: 38ch;
  margin: 0 0 14px;
  font-size: clamp(20px, 2.1vw, 26px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.legal-version {
  margin: 0 0 56px;
  color: var(--muted);
  font-size: 15px;
}

.clause {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
}

.clause h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.clause-n {
  display: inline-block;
  min-width: 1.6em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.clause-body {
  max-width: 62ch;
}

.clause-body p {
  margin: 0 0 12px;
}

.clause:target {
  background: linear-gradient(90deg, #f2f2f2, transparent 70%);
}

@media (min-width: 900px) {
  .clause {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 40px;
    padding: 36px 0;
  }
}

.legal-note a {
  color: inherit;
  text-underline-offset: 2px;
}

.clause-body a {
  color: inherit;
  text-underline-offset: 2px;
}

/* Page transitions: must be declared on both pages for the browser to run them.
   Keyframes mirror app.css. */

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: page-dim 420ms ease-in both;
}

::view-transition-new(root) {
  animation: page-tear-in 520ms cubic-bezier(0.76, 0, 0.24, 1) both;
}

@keyframes page-dim {
  to { opacity: 0.35; filter: blur(2px); }
}

@keyframes page-tear-in {
  0%   { clip-path: inset(100% 0 0 0); transform: translateX(0); }
  18%  { clip-path: inset(74% 0 8% 0); transform: translateX(-10px); }
  36%  { clip-path: inset(46% 0 30% 0); transform: translateX(8px); }
  54%  { clip-path: inset(22% 0 12% 0); transform: translateX(-5px); }
  74%  { clip-path: inset(6% 0 0 0); transform: translateX(3px); }
  100% { clip-path: inset(0); transform: none; }
}

/* On arrival the eye reads the title first, then the intro, not a wall of text. */
.legal-title,
.legal-intro,
.legal-note,
.legal-version {
  animation: legal-rise 640ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.legal-title { animation-delay: 260ms; }
.legal-intro { animation-delay: 360ms; }
.legal-note,
.legal-version { animation-delay: 440ms; }

@keyframes legal-rise {
  from { opacity: 0; transform: translateY(18px); }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
  .legal-title,
  .legal-intro,
  .legal-note,
  .legal-version {
    animation: none;
  }
}
