:root {
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-sm: clamp(0.875rem, 0.84rem + 0.15vw, 0.9375rem);
  --heading-1: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
  --heading-2: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --line: 1.7;
  --radius: 14px;
  --header-h: 4.25rem;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --accent: #0891b2;
  --accent-gradient: linear-gradient(135deg, #0891b2, #7c3aed);
  --logo-text-gradient: linear-gradient(90deg, #22d3ee 0%, #0891b2 42%, #7c3aed 100%);
}

[data-theme="light"] {
  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --muted-dim: #64748b;
  --border: #e2e8f0;
  --header-bg: rgba(248, 250, 252, 0.92);
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  --skip-fg: #fff;
}

[data-theme="dark"] {
  --bg: #030306;
  --bg-elevated: rgba(255, 255, 255, 0.04);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --muted-dim: #64748b;
  --border: rgba(255, 255, 255, 0.1);
  --header-bg: rgba(3, 3, 6, 0.95);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --skip-fg: #030306;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: var(--line);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
  padding-bottom: env(safe-area-inset-bottom);
}
body.cookie-visible { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }

a { color: var(--accent); }
a:hover { text-decoration: underline; }

.container {
  width: 100%; max-width: 48rem; margin: 0 auto;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}
@media (min-width: 640px) { .container { padding-left: 1.5rem; padding-right: 1.5rem; } }
.container--wide { max-width: 72rem; }

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h); background: var(--header-bg);
  backdrop-filter: blur(16px); border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: 72rem; margin: 0 auto; height: 100%;
  padding: 0 max(1rem, env(safe-area-inset-left)) 0 max(1rem, env(safe-area-inset-right));
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.logo {
  display: inline-flex; align-items: center; gap: 0.55rem;
  text-decoration: none; color: var(--text);
}
.logo-mark {
  width: 2.15rem; height: 2.15rem; flex-shrink: 0; display: block; object-fit: contain;
}
.logo-wordmark {
  font-weight: 700; font-size: 1.1rem; line-height: 1; letter-spacing: -0.03em;
  background: var(--logo-text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.back-link {
  font-size: var(--text-sm); color: var(--muted); text-decoration: none; font-weight: 500;
}
.back-link:hover { color: var(--accent); text-decoration: none; }

.theme-toggle {
  width: 2.75rem; height: 2.75rem; min-width: 44px; min-height: 44px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.theme-toggle svg { width: 1.15rem; height: 1.15rem; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

.legal-main {
  padding: calc(var(--header-h) + 2rem) 0 3rem;
}
.legal-main .container { max-width: 42rem; }

.legal-doc h1 {
  font-size: var(--heading-1); font-weight: 700;
  line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 0.5rem;
}
.legal-meta {
  font-size: var(--text-sm); color: var(--muted-dim); margin-bottom: 2rem;
}
.legal-doc h2 {
  font-size: var(--heading-2); font-weight: 600;
  margin: 2rem 0 0.75rem; line-height: 1.3;
}
.legal-doc h3 {
  font-size: 1.05rem; font-weight: 600; margin: 1.25rem 0 0.5rem;
}
.legal-doc p, .legal-doc li {
  font-size: var(--text-sm); color: var(--muted); margin-bottom: 0.85rem;
}
.legal-doc ul, .legal-doc ol {
  margin: 0 0 1rem 1.25rem; color: var(--muted);
}
.legal-doc li { margin-bottom: 0.4rem; font-size: var(--text-sm); }
.legal-doc strong { color: var(--text); font-weight: 600; }
.legal-box {
  padding: 1.25rem 1.35rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-elevated);
  margin: 1.5rem 0; font-size: var(--text-sm);
}
.legal-box p:last-child { margin-bottom: 0; }

.site-footer {
  border-top: 1px solid var(--border); padding: 2rem 0;
}
.site-footer .container--wide { max-width: 72rem; }
.footer-inner {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 1rem;
}
@media (min-width: 640px) {
  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}
.footer-inner p { font-size: var(--text-sm); color: var(--muted-dim); }
.footer-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem 1.25rem;
}
.footer-links a {
  color: var(--muted); text-decoration: none; font-size: var(--text-sm);
}
.footer-links a:hover { color: var(--accent); text-decoration: none; }

/* Cookie banner */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  padding: 1rem max(1rem, env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: var(--header-bg);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(16px);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
  transform: translateY(110%);
  transition: transform 0.4s var(--ease);
}
.cookie-banner.visible { transform: translateY(0); }
.cookie-inner {
  max-width: 72rem; margin: 0 auto;
  display: flex; flex-direction: column; gap: 1rem;
}
@media (min-width: 768px) {
  .cookie-inner { flex-direction: row; align-items: center; justify-content: space-between; gap: 1.5rem; }
}
.cookie-text {
  font-size: var(--text-sm); color: var(--muted); line-height: 1.55;
}
.cookie-text a { color: var(--accent); font-weight: 500; }
.cookie-actions { display: flex; gap: 0.65rem; flex-shrink: 0; }
.cookie-btn {
  min-height: 44px; padding: 0.6rem 1.25rem; border-radius: 10px;
  font-family: inherit; font-size: var(--text-sm); font-weight: 600;
  cursor: pointer; border: none; transition: opacity 0.2s;
}
.cookie-btn-accept {
  background: var(--accent-gradient); color: #fff;
}
.cookie-btn-accept:hover { opacity: 0.92; }
.cookie-btn-settings {
  background: var(--bg-elevated); color: var(--text);
  border: 1px solid var(--border);
}
