:root {
  --accent: #0f766e;
  --accent-dark: #0b5751;
  --accent-soft: #e6f4f2;
  --text: #1a1a1a;
  --text-muted: #555;
  --bg: #ffffff;
  --bg-alt: #fafafa;
  --border: #e5e5e5;
  --max-width: 1100px;
  --radius: 8px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:hover, a:focus { color: var(--accent-dark); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.beta-banner {
  background: var(--accent);
  color: #fff;
  text-align: center;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.site-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
}
.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}
.logo-text {
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

.hero {
  padding: 2rem 0 2.5rem;
  max-width: 760px;
}
.hero h1 {
  font-size: clamp(1.65rem, 4.5vw, 2.4rem);
  line-height: 1.2;
  margin: 0 0 1rem;
  letter-spacing: -0.015em;
}
.lede {
  font-size: 1.075rem;
  color: var(--text-muted);
  margin: 0;
}

.audiences {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  margin: 1.5rem 0 2.5rem;
}
@media (min-width: 720px) {
  .audiences { grid-template-columns: repeat(3, 1fr); }
}
.audiences article {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.4rem;
}
.audiences h2 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  color: var(--accent-dark);
}
.audiences p {
  margin: 0;
  color: var(--text);
  font-size: 0.97rem;
}

.contact {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  margin-top: 1rem;
}
.contact h2 {
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}
.contact p { margin: 0.3rem 0; }
.contact-email a {
  font-size: 1.1rem;
  font-weight: 500;
}

.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 1.75rem 1.25rem;
  margin-top: 2rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.site-footer > * {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}
.site-footer .legal-identity { margin-bottom: 0.6rem; line-height: 1.5; }
.site-footer .contact-line { margin: 0.3rem auto 0.75rem; }
.site-footer .contact-line a { color: var(--text-muted); }
.site-footer .contact-line a:hover { color: var(--accent-dark); }
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin-bottom: 0.65rem;
}
.site-footer nav a {
  color: var(--text-muted);
  text-decoration: none;
}
.site-footer nav a:hover { color: var(--accent-dark); text-decoration: underline; }
.site-footer .copyright { font-size: 0.82rem; opacity: 0.85; }

.site-footer .manage-cookies {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: none;
}
.site-footer .manage-cookies:hover { color: var(--accent-dark); text-decoration: underline; }

/* ------- Legal pages ------- */

.legal-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px) 240px;
  gap: 3rem;
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  align-items: start;
}
@media (max-width: 920px) {
  .legal-layout { grid-template-columns: 1fr; gap: 1.25rem; }
}

.legal-prose {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
}
.legal-prose h1 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  line-height: 1.25;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}
.legal-prose h2 {
  font-size: 1.2rem;
  margin: 2.25rem 0 0.75rem;
  color: var(--text);
  font-weight: 700;
  scroll-margin-top: 1.5rem;
}
.legal-prose h2 strong { font-weight: 700; }
.legal-prose h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
}
.legal-prose p { margin: 0.7rem 0; }
.legal-prose ul, .legal-prose ol { padding-left: 1.4rem; margin: 0.65rem 0; }
.legal-prose li { margin: 0.2rem 0; }
.legal-prose blockquote {
  margin: 0.9rem 0;
  padding: 0.7rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 0 4px 4px 0;
}
.legal-prose blockquote p { margin: 0.25rem 0; }
.legal-prose code {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  font-size: 0.93em;
}
.legal-prose hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.legal-prose a { color: var(--accent-dark); }

.legal-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.9rem 0;
  font-size: 0.93rem;
  display: block;
  overflow-x: auto;
}
.legal-prose table thead { background: var(--bg-alt); }
.legal-prose table th,
.legal-prose table td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: top;
}
.legal-prose table th { font-weight: 600; }

.legal-prose .last-updated {
  display: inline-block;
  margin: 0 0 1.25rem;
  padding: 0.25rem 0.6rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.legal-toc {
  position: sticky;
  top: 1rem;
  font-size: 0.88rem;
}
.legal-toc summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  padding: 0.4rem 0;
}
.legal-toc-title {
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.legal-toc nav { display: block; }
.legal-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--border);
}
.legal-toc li { margin: 0; }
.legal-toc a {
  display: block;
  padding: 0.3rem 0 0.3rem 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -2px;
  line-height: 1.4;
}
.legal-toc a:hover, .legal-toc a:focus-visible {
  color: var(--accent-dark);
  border-left-color: var(--accent);
}
@media (max-width: 920px) {
  .legal-toc { position: static; }
  .legal-toc[data-collapsible="true"] > nav { display: none; }
  .legal-toc[data-collapsible="true"][open] > nav { display: block; }
}

/* ------- Cookie banner + modal ------- */

#cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: #1a1a1a;
  color: #f5f5f5;
  padding: 1rem 1.25rem;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
}
#cookie-banner[hidden] { display: none; }
.cookie-banner-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 1.5rem;
  align-items: center;
}
@media (max-width: 720px) {
  .cookie-banner-inner { grid-template-columns: 1fr; }
}
.cookie-banner-text {
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0;
}
.cookie-banner-text a { color: #fff; text-decoration: underline; }
.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cookie-btn {
  font: inherit;
  font-size: 0.92rem;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  background: transparent;
  color: inherit;
  min-width: 7rem;
  text-align: center;
}
.cookie-btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.cookie-btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.cookie-btn-secondary {
  background: #fff;
  color: #1a1a1a;
  border-color: #fff;
}
.cookie-btn-secondary:hover { background: #e5e5e5; border-color: #e5e5e5; }
.cookie-btn-link {
  background: transparent;
  color: #fff;
  text-decoration: underline;
  padding: 0.5rem 0.4rem;
  min-width: auto;
}

#cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
#cookie-modal[hidden] { display: none; }
.cookie-modal-content {
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  max-height: 90vh;
  overflow-y: auto;
}
.cookie-modal-content h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}
.cookie-pref {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
}
.cookie-pref:first-of-type { border-top: 0; }
.cookie-pref-text { flex: 1; }
.cookie-pref-text strong { display: block; font-size: 0.97rem; }
.cookie-pref-text span { color: var(--text-muted); font-size: 0.87rem; }
.cookie-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
  justify-content: flex-end;
}
.cookie-modal-actions .cookie-btn { color: var(--text); border-color: var(--border); }
.cookie-modal-actions .cookie-btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.cookie-modal-actions .cookie-btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* Visually-hidden labels for the toggle */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.cookie-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.cookie-switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 24px;
  transition: background 0.15s;
}
.cookie-switch .slider::before {
  content: "";
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.15s;
}
.cookie-switch input:checked + .slider { background: var(--accent); }
.cookie-switch input:checked + .slider::before { transform: translateX(20px); }
.cookie-switch input:disabled + .slider { opacity: 0.6; cursor: not-allowed; }
.cookie-switch input:focus-visible + .slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
