/* Onest subsets used by the landing page, served locally under the SIL OFL. */
@font-face {
  font-family: Onest;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/onest/onest-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Onest;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/onest/onest-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  /* Keep these tokens aligned with src/app/globals.css. */
  --lime: #c8fa00;
  --lime-ink: #4f6b00;
  --foreground: #1c1c1c;
  --background: #fff;
  --surface-tint: #f4f5f1;
  --hairline: rgba(10, 10, 10, 0.12);
  --muted: rgba(10, 10, 10, 0.62);
  --radius-md: 16px;
  --pad-x: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }

html {
  background: var(--background);
  color: var(--foreground);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: Onest, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--lime); color: var(--foreground); }

.legal-document {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 64px) var(--pad-x) 80px;
}

a { color: inherit; text-underline-offset: 0.2em; }
a:hover { color: var(--lime-ink); }
a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--lime-ink);
  outline-offset: 4px;
  border-radius: 3px;
}

.back {
  display: inline-block;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}
.back:hover { text-decoration: underline; }

.document-header {
  margin: 36px 0 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--hairline);
}

.document-header::before {
  content: "";
  display: block;
  width: 48px;
  height: 6px;
  margin-bottom: 24px;
  border-radius: 9999px;
  background: var(--lime);
}

.document-context, .document-eyebrow {
  margin: 0 0 12px;
  color: var(--lime-ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4.5vw, 52px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.legal-content { overflow-wrap: anywhere; }
.legal-content h2, .legal-content h3 {
  margin: 36px 0 16px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.025em;
  scroll-margin-top: 24px;
}
.legal-content h2 { font-size: clamp(21px, 2.8vw, 28px); }
.legal-content h3 { font-size: clamp(18px, 2.4vw, 22px); }
.legal-content p { margin: 0 0 18px; }
.legal-content strong { font-weight: 700; }
.legal-content a { color: var(--lime-ink); }
.legal-content a:hover { color: var(--foreground); }
.legal-content img { max-width: 100%; height: auto; }
.document-logo { display: block; width: 160px; margin: 0 0 28px; }
.clause-number { font-weight: 600; }

.legal-list {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}
.legal-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  margin-top: 10px;
}
.legal-list-marker { color: var(--lime-ink); font-weight: 600; }

.legal-table-wrap {
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
}
table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font: inherit;
}
td, th {
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  text-align: left;
  vertical-align: top;
}
th { background: var(--surface-tint); font-weight: 600; }
td p:last-child, th p:last-child { margin-bottom: 0; }

@media (max-width: 640px) {
  body { font-size: 15px; }
  .document-header { margin-top: 28px; margin-bottom: 28px; padding-bottom: 24px; }
  .legal-content h2, .legal-content h3 { margin-top: 28px; }
  .legal-document { padding-bottom: 48px; }
}

@media print {
  @page { size: A4; margin: 18mm; }
  body { font-size: 10pt; line-height: 1.5; }
  .legal-document { max-width: none; margin: 0; padding: 0; }
  .back { display: none; }
  .document-header { margin-top: 0; }
  .document-header::before { display: none; }
  h1 { font-size: 24pt; }
  .legal-content h2 { font-size: 15pt; }
  .legal-content h3 { font-size: 12pt; }
  h1, h2, h3 { break-after: avoid; }
  p { orphans: 3; widows: 3; }
  .legal-table-wrap { overflow: visible; border-radius: 0; }
  table { min-width: 0; }
  tr { break-inside: avoid; }
}
