/**
 * Styles for the Public Offer (`/public-offer.html`).
 *
 * That page is a legally binding document and is served **verbatim** — its markup
 * is byte-identical to the version that has been live, and it is not generated by
 * Astro. Only this stylesheet was rewritten, to bring it onto the new design
 * tokens. Every selector below already existed in the document; no class was
 * added, removed or renamed, so restyling cannot alter the contract's text.
 *
 * The tokens are duplicated here rather than imported because this page is a
 * standalone static file with no build step — it must render correctly on its own.
 */

:root {
  --brand-teal: #1b8188;
  --brand-lime: #b8e100;
  --brand-warm-grey: #b2a69a;

  --surface: #f7f5ec;
  --surface-container: #ffffff;
  --surface-sunken: #f0ede1;
  --on-surface: #0f1519;
  --on-surface-variant: #1c3b42;
  --on-surface-muted: #5c6a6e;
  --border: rgb(15 21 25 / 12%);

  --primary: var(--brand-teal);
  --on-primary: #f7f5ec;

  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial,
    sans-serif;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #0f1519;
    --surface-container: #1a1f25;
    --surface-sunken: #0a0f12;
    --on-surface: #f7f5ec;
    --on-surface-variant: #f2efe0;
    --on-surface-muted: #9aa5a8;
    --border: rgb(247 245 236 / 14%);

    color-scheme: dark;
  }
}

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-underline-offset: 0.2em;
}

a:hover {
  color: #166a70;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection {
  background: var(--brand-lime);
  color: #0f1519;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 10;
  padding: 0.75rem 1.25rem;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--radius-pill);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--on-primary);
}

/* --- Header ---------------------------------------------------------------- */

.legal-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface-sunken);
}

.legal-header__inner {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem clamp(1.25rem, 3vw, 3rem) 3rem;
}

.legal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 3rem;
}

.legal-brand {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--on-surface);
  text-decoration: none;
}

.legal-brand:hover {
  color: var(--primary);
}

.legal-back {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--on-surface);
  text-decoration: none;
}

.legal-back:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.legal-header h1 {
  max-width: 24ch;
  margin: 0;
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.legal-header__meta {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  color: var(--on-surface-muted);
}

/* --- Layout ---------------------------------------------------------------- */

.legal-layout {
  display: grid;
  gap: 3rem;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem clamp(1.25rem, 3vw, 3rem) 4rem;
}

@media (min-width: 62rem) {
  .legal-layout {
    grid-template-columns: 16rem minmax(0, 1fr);
    gap: 4rem;
    align-items: start;
  }
}

/* --- Table of contents ------------------------------------------------------ */

.legal-toc {
  padding: 1.5rem;
  background: var(--surface-container);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

@media (min-width: 62rem) {
  .legal-toc {
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
  }
}

.legal-toc h2 {
  margin: 0 0 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
}

.legal-toc ol {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9375rem;
}

.legal-toc a {
  color: var(--on-surface);
  text-decoration: none;
}

.legal-toc a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* --- Document --------------------------------------------------------------- */

.legal-document {
  max-width: 46rem; /* ~70ch — the brand's readable measure */
}

.legal-document h2 {
  margin: 3rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  scroll-margin-top: 2rem;
}

.legal-document h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.legal-document h3 {
  margin: 2rem 0 0.75rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.legal-document p {
  margin: 0 0 1rem;
  text-wrap: pretty;
}

.legal-document ul,
.legal-document ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.legal-document li {
  margin-bottom: 0.5rem;
}

.legal-document strong {
  font-weight: 600;
}

.legal-intro {
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  background: var(--surface-container);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-md);
}

.legal-intro p:last-child {
  margin-bottom: 0;
}

.legal-note {
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: rgb(184 225 0 / 18%);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
}

.legal-details {
  padding: 1.5rem;
  background: var(--surface-container);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
}

.legal-details p:last-child {
  margin-bottom: 0;
}

/* --- Actions ---------------------------------------------------------------- */

.legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 3rem;
}

.legal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.875rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

.legal-button:hover {
  background: #166a70;
  color: var(--on-primary);
}

.legal-button--secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--on-surface);
}

.legal-button--secondary:hover {
  background: rgb(27 129 136 / 8%);
  border-color: var(--primary);
  color: var(--primary);
}

/* --- Footer ----------------------------------------------------------------- */

.legal-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-sunken);
}

.legal-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem clamp(1.25rem, 3vw, 3rem);
  font-size: 0.8125rem;
  color: var(--on-surface-muted);
}

@media print {
  .legal-toc,
  .legal-actions,
  .legal-back,
  .skip-link {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .legal-layout {
    display: block;
    padding: 0;
  }
}
