/* JSON File Opener & Editor · privacy policy
   Dark by default (matches the app), light when the device asks for it. */

:root {
  --bg: #0a0e1a;
  --bg-2: #13102b;
  --surface: #121a2e;
  --surface-2: #1b2540;
  --border: rgba(169, 196, 255, 0.18);
  --text: #e6ecff;
  --muted: #97a3c4;
  --brand-a: #22b8ff;
  --brand-b: #3d6bff;
  --brand-c: #8b3dff;
  --accent: #5aa9ff;
  --link: #8fc2ff;
  --radius: 20px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --content: 1120px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f7ff;
    --bg-2: #f3eaff;
    --surface: #ffffff;
    --surface-2: #eef2fb;
    --border: rgba(47, 107, 255, 0.18);
    --text: #111827;
    --muted: #4b5673;
    --accent: #2f6bff;
    --link: #2f6bff;
    --shadow: 0 14px 30px rgba(47, 107, 255, 0.12);
    color-scheme: light;
  }
}

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

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 60%, var(--bg) 100%) fixed;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: min(100% - 32px, var(--content));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  z-index: 100;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  min-width: 0;
}
.brand img { border-radius: 10px; flex: none; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 0.92rem;
  transition: background 0.2s ease, color 0.2s ease;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 9vw, 96px) 0 clamp(32px, 6vw, 56px);
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: min(70vw, 620px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--brand-a), var(--brand-b) 45%, transparent 70%);
  opacity: 0.22;
  filter: blur(10px);
  pointer-events: none;
}
.hero__inner { position: relative; max-width: 760px; }

.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(90deg, var(--brand-a), var(--brand-b), var(--brand-c));
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 5.2vw, 3.3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--brand-a), var(--brand-b), var(--brand-c));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  margin: 0 0 22px;
  font-size: clamp(1.02rem, 2.2vw, 1.15rem);
  color: var(--muted);
  max-width: 62ch;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 0.9rem;
  color: var(--muted);
}
.meta span {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 12px;
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 32px;
  padding-bottom: 56px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 88px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.toc__title {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.toc a {
  display: block;
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.93rem;
}
.toc a:hover,
.toc a.is-active {
  color: var(--text);
  background: var(--surface-2);
}

/* ---------- Policy cards ---------- */
.policy { display: grid; gap: 18px; min-width: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 30px);
  box-shadow: var(--shadow);
  scroll-margin-top: 90px;
  animation: rise 0.6s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.card h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  font-size: clamp(1.2rem, 2.4vw, 1.4rem);
  letter-spacing: -0.01em;
}
.card h3 {
  margin: 18px 0 6px;
  font-size: 1.02rem;
  color: var(--accent);
}
.card p { margin: 0 0 12px; color: var(--text); }
.card p:last-child { margin-bottom: 0; }

.num {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-a), var(--brand-b) 55%, var(--brand-c));
}

.list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.list li {
  position: relative;
  padding-left: 22px;
  color: var(--text);
}
.list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-a), var(--brand-c));
}

.card--contact {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand-b) 22%, var(--surface)), var(--surface));
}
address {
  font-style: normal;
  margin: 10px 0 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  line-height: 1.8;
}
.fine { font-size: 0.92rem; color: var(--muted); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 24px 0 36px; color: var(--muted); font-size: 0.92rem; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; }
.footer p { margin: 0; }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-a), var(--brand-b) 55%, var(--brand-c));
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px) scale(0.92);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 60;
}
.to-top.is-visible { opacity: 1; transform: none; }
.to-top[hidden] { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  .toc {
    position: static;
    order: -1;
  }
  .toc ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 8px;
  }
}

@media (max-width: 640px) {
  .topbar__inner { min-height: 58px; }
  .brand span { font-size: 0.9rem; }
  .nav { display: none; }
  .meta span { width: 100%; }
  .toc ol { grid-template-columns: 1fr; }
  .card { border-radius: 16px; }
  .num { width: 30px; height: 30px; font-size: 0.85rem; border-radius: 10px; }
  .to-top { right: 14px; bottom: 14px; }
}

@media (min-width: 1280px) {
  .container { width: min(100% - 48px, var(--content)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .topbar, .to-top, .toc, .nav, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #ccc; animation: none; }
  h1 { -webkit-text-fill-color: #000; background: none; }
}
