/* Privacy policy site — vanilla CSS, no dependencies, inline SVG only. */

:root {
  --bg: #f5f6f8;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --text: #171a21;
  --text-muted: #5c6370;
  --text-subtle: #8a909c;
  --border: #e4e7ec;
  --border-strong: #d3d8e0;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eef3ff;
  --code-bg: #f1f3f7;
  --shadow: 0 1px 2px rgba(23, 26, 33, 0.06), 0 1px 3px rgba(23, 26, 33, 0.05);
  --shadow-lg: 0 10px 30px rgba(23, 26, 33, 0.12);
  --radius: 14px;
  --radius-sm: 8px;
  --content-width: 720px;
  --wrap-width: 1040px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --bg-elev: #161b22;
    --surface: #161b22;
    --text: #e6e9ef;
    --text-muted: #a2abba;
    --text-subtle: #757e8c;
    --border: #262c36;
    --border-strong: #333b47;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-soft: #17233b;
    --code-bg: #1e242d;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 34px rgba(0, 0, 0, 0.5);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

.loading {
  color: var(--text-muted);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: var(--wrap-width);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

.site-brand:hover {
  text-decoration: none;
}

.site-brand__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}

.site-brand__icon svg {
  width: 20px;
  height: 20px;
}

.site-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.site-brand__name {
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.site-brand__label {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.site-nav__link {
  color: var(--text-muted);
  font-weight: 500;
}

.site-nav__link:hover {
  color: var(--accent);
  text-decoration: none;
}

.site-nav__sep {
  color: var(--text-subtle);
}

.site-nav__current {
  color: var(--text);
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 12rem;
}

/* ---------- Main / footer ---------- */

.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--wrap-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.site-footer {
  border-top: 1px solid var(--border);
}

.site-footer p {
  max-width: var(--wrap-width);
  margin: 0 auto;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-subtle);
}

/* ---------- Hero ---------- */

.hero {
  text-align: center;
  margin-bottom: 3rem;
}

.hero__title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}

.hero__subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.08rem;
}

/* ---------- App grid ---------- */

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.app-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  color: inherit;
  box-shadow: var(--shadow);
  transition: box-shadow 0.16s ease, border-color 0.16s ease;
}

.app-card:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  box-shadow: var(--shadow-lg);
}

.app-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}

.app-card__name {
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.app-card__tagline {
  margin: 0.35rem 0 1rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  flex-grow: 1;
}

.app-card__platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.platform-tag {
  font-size: 0.72rem;
  font-weight: 550;
  padding: 0.22rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-muted);
}

/* ---------- Privacy page ---------- */

.policy-header {
  margin-bottom: 2rem;
}

.policy-header h1,
.policy-header__title {
  margin: 0 0 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  line-height: 1.15;
}

.policy-header__heading {
  align-self: stretch;
  text-align: center;
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 750;
  letter-spacing: -0.025em;
  color: var(--text);
}

.policy-header__app {
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  font-weight: 500;
  color: var(--text-muted);
}

.policy-header h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 750;
  letter-spacing: -0.025em;
}

.policy-header .updated {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-subtle);
}

.policy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 2.5rem;
  align-items: start;
}

.policy-content {
  min-width: 0;
  max-width: var(--content-width);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem 2.5rem;
  box-shadow: var(--shadow);
}

.policy-content h2 {
  margin: 2.25rem 0 0.85rem;
  padding-top: 0.25rem;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.policy-content h2:first-child {
  margin-top: 0;
}

.policy-content h3 {
  margin: 1.6rem 0 0.55rem;
  font-size: 1.02rem;
  font-weight: 620;
}

.policy-content p {
  margin: 0 0 1rem;
}

.policy-content ul {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.policy-content li {
  margin-bottom: 0.4rem;
}

.policy-content li::marker {
  color: var(--accent);
}

.policy-content strong {
  font-weight: 650;
}

.policy-content code {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.87em;
  padding: 0.12em 0.4em;
  background: var(--code-bg);
  border-radius: 5px;
}

.policy-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

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

.policy-toc {
  position: sticky;
  top: 5rem;
  font-size: 0.88rem;
}

.policy-toc__title {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-subtle);
}

.policy-toc nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
}

.policy-toc nav li {
  margin: 0;
}

.policy-toc nav a {
  display: block;
  padding: 0.32rem 0 0.32rem 0.9rem;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  line-height: 1.35;
}

.policy-toc nav a:hover {
  color: var(--accent);
  border-left-color: var(--accent);
  text-decoration: none;
}

/* ---------- Error box ---------- */

.error-box {
  max-width: var(--content-width);
  padding: 1.5rem;
  background: color-mix(in srgb, #ef4444 8%, var(--surface));
  border: 1px solid color-mix(in srgb, #ef4444 35%, var(--border));
  border-radius: var(--radius);
}

.error-box p {
  margin: 0 0 0.5rem;
}

.error-box p:last-child {
  margin-bottom: 0;
}

.error-box__detail {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- Support page ---------- */

.support-content {
  margin: 0 auto;
}

.support-contact {
  margin: 1.5rem 0 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: var(--radius-sm);
}

.support-contact h2 {
  margin-top: 0;
}

.support-email {
  font-size: 1.05rem;
  font-weight: 600;
}

.support-apps {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.support-apps li {
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.support-apps li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.support-apps a {
  font-weight: 600;
}

.support-apps__tagline {
  font-weight: 400;
  color: var(--text-muted);
}

.not-found-content {
  margin: 0 auto;
  text-align: center;
}

.not-found-content p:last-child {
  margin-bottom: 0;
}

/* ---------- Scroll to top ---------- */

.scroll-top {
  position: fixed;
  right: 1.35rem;
  bottom: 1.35rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s, background 0.15s, color 0.15s;
  z-index: 60;
}

.scroll-top:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .policy-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .policy-toc {
    display: none;
  }
}

@media (max-width: 600px) {
  .site-header__inner {
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }

  .site-brand__label {
    display: none;
  }

  .site-nav__current {
    max-width: 7rem;
  }

  .site-main {
    padding: 2rem 1rem 3.5rem;
  }

  .policy-content {
    padding: 1.5rem 1.35rem;
  }

  .policy-header__title {
    align-items: center;
  }

  .hero {
    margin-bottom: 2.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
