:root {
  --bg: #05070b;
  --bg-elevated: #080c13;
  --text: #f4f6f8;
  --text-soft: rgba(244, 246, 248, 0.68);
  --text-dim: rgba(244, 246, 248, 0.46);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.28);
  --focus: rgba(138, 195, 255, 0.72);
  --max-content: 820px;
  --radius: 14px;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
}

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

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(circle at top left, rgba(110, 176, 255, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(8, 12, 19, 0.96), rgba(5, 7, 11, 1));
  color: var(--text);
  font-family: var(--font-mono);
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.legal-page {
  position: relative;
  overflow-x: clip;
}

.legal-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.48), #000 28%, #000 72%, rgba(0, 0, 0, 0.3));
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.48), #000 28%, #000 72%, rgba(0, 0, 0, 0.3));
  pointer-events: none;
  z-index: 0;
}

.legal-shell {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  width: min(100%, calc(var(--max-content) + 2rem));
  margin: 0 auto;
  padding: 1.25rem 1rem 1.5rem;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 1.75rem;
}

.legal-main {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(10, 15, 24, 0.84), rgba(8, 12, 19, 0.7));
  padding: clamp(1.2rem, 2.5vw, 2rem);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  min-width: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.35rem;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.back-link:hover {
  color: var(--text);
}

.back-link::before {
  content: "<";
  color: rgba(138, 195, 255, 0.72);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: 0;
}

h2 {
  margin: 2rem 0 0.9rem;
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 500;
  color: rgba(138, 195, 255, 0.82);
}

p,
li {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

p {
  margin: 0.85rem 0 0;
}

ul {
  margin: 0.85rem 0 0;
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.4rem;
}

dl {
  margin: 1.25rem 0 0;
  display: grid;
  grid-template-columns: minmax(180px, 220px) 1fr;
  gap: 0.75rem 1rem;
}

dt {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.7;
}

dd {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.legal-email,
.inline-link {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.18rem;
}

.legal-email:hover,
.inline-link:hover {
  color: rgba(138, 195, 255, 0.92);
}

.site-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.7;
}

.footer-identity {
  margin: 0;
  overflow-wrap: anywhere;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.2rem;
}

.footer-nav a:hover {
  color: var(--text);
}

@media (max-width: 680px) {
  .legal-shell {
    width: 100%;
    padding: 0.85rem 0.75rem 1rem;
    gap: 1rem;
  }

  .legal-main {
    padding: 1rem 0.9rem;
    border-radius: 12px;
  }

  h1 {
    font-size: clamp(1.75rem, 8vw, 2.2rem);
  }

  h2 {
    margin-top: 1.6rem;
    font-size: 0.96rem;
  }

  p,
  li,
  dt,
  dd {
    font-size: 0.9rem;
    line-height: 1.72;
  }

  dl {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  dd + dt {
    margin-top: 0.7rem;
  }

  .site-footer {
    gap: 0.75rem;
    font-size: 0.74rem;
  }

  .footer-nav {
    width: 100%;
    gap: 0.65rem 1rem;
  }
}

@media (max-width: 420px) {
  .legal-shell {
    padding-inline: 0.65rem;
  }

  .legal-main {
    padding: 0.95rem 0.8rem;
  }

  .back-link {
    margin-bottom: 1rem;
    font-size: 0.82rem;
  }
}

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