:root {
  --bg-body: #fff;
  --bg-surface: #f9f9f9;
  --bg-highlight: #f0f0f0;
  --text-main: #0a0a0a;
  --text-muted: #737373;
  --text-light: #a3a3a3;
  --border-light: #e5e5e5;
  --z-purple: #6c5ce7;
  --z-blue: #2980f9;
  --z-teal: #00c9a7;
  --z-grad: linear-gradient(135deg, #6c5ce7 0%, #2980f9 50%, #00c9a7 100%);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg-body);
  color: var(--text-main);
  font-family: "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--text-main);
  color: #fff;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: #d4d4d4; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

.noise-overlay {
  position: fixed;
  z-index: 9999;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.fixed-grid-overlay {
  position: fixed;
  z-index: 0;
  inset: 0;
  display: flex;
  justify-content: center;
  padding: 0 48px;
  pointer-events: none;
}

.fixed-grid-inner {
  display: grid;
  width: 100%;
  max-width: 1440px;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  border-right: 1px dashed rgb(0 0 0 / 5%);
  border-left: 1px dashed rgb(0 0 0 / 5%);
}

.fixed-grid-line {
  height: 100%;
  border-right: 1px dashed rgb(0 0 0 / 4%);
}

.site-header {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  border-bottom: 1px solid rgb(0 0 0 / 5%);
  background: rgb(255 255 255 / 70%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand-link img {
  display: block;
  width: auto;
  height: 36px;
}

.back-link,
.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.3s var(--ease-expo), box-shadow 0.3s, border-color 0.2s;
}

.back-link {
  padding: 10px 22px;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  background: rgb(255 255 255 / 80%);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.back-link:hover,
.back-link:focus-visible {
  transform: translateY(-2px);
  border-color: var(--text-main);
}

.legal-main {
  position: relative;
  z-index: 1;
  padding: 152px 80px 104px;
}

.legal-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.legal-hero {
  max-width: 830px;
  margin-bottom: 64px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--z-purple);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.legal-hero h1 {
  margin-bottom: 24px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.legal-intro {
  max-width: 700px;
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 300;
  line-height: 1.75;
}

.updated-at {
  display: block;
  margin-top: 24px;
  color: var(--text-light);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 72px;
  align-items: start;
}

.legal-content {
  min-width: 0;
}

.legal-section {
  padding: 40px 0;
  border-top: 1px dashed rgb(0 0 0 / 10%);
}

.legal-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.legal-section h2 {
  margin-bottom: 18px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.legal-section h3 {
  margin: 24px 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.02rem;
  font-weight: 600;
}

.legal-section p,
.legal-section li {
  color: var(--text-muted);
  font-size: 0.96rem;
  font-weight: 300;
  line-height: 1.78;
}

.legal-section p + p {
  margin-top: 14px;
}

.legal-section ul,
.legal-section ol {
  display: grid;
  gap: 10px;
  margin: 16px 0 0 20px;
  padding-left: 5px;
}

.legal-section strong {
  color: var(--text-main);
  font-weight: 600;
}

.legal-section a:not(.primary-action),
.contact-card a {
  color: var(--text-main);
  text-decoration-color: rgb(108 92 231 / 45%);
  text-underline-offset: 4px;
}

.legal-section a:hover,
.contact-card a:hover {
  text-decoration-color: var(--z-purple);
}

.legal-aside {
  position: sticky;
  top: 104px;
  padding: 24px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  background: rgb(255 255 255 / 72%);
  box-shadow: 0 18px 50px rgb(0 0 0 / 4%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.legal-aside span {
  display: block;
  margin-bottom: 16px;
  color: var(--text-light);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.legal-aside nav {
  display: grid;
  gap: 12px;
}

.legal-aside a {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.2s;
}

.legal-aside a:hover,
.legal-aside a:focus-visible {
  color: var(--text-main);
}

.contact-card {
  position: relative;
  overflow: hidden;
  margin-top: 40px;
  padding: 32px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  background: var(--bg-surface);
}

.contact-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--z-grad);
  content: "";
}

.contact-card h2 {
  margin-bottom: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.45rem;
  letter-spacing: -0.035em;
}

.contact-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.primary-action {
  position: relative;
  overflow: hidden;
  margin-top: 22px;
  padding: 14px 26px;
  border: 0;
  background: var(--text-main);
  color: #fff;
  font-size: 0.87rem;
  font-weight: 600;
}

.primary-action::before {
  position: absolute;
  inset: 0;
  background: var(--z-grad);
  content: "";
  opacity: 0;
  transition: opacity 0.3s;
}

.primary-action span,
.primary-action svg {
  position: relative;
  z-index: 1;
}

.primary-action:hover,
.primary-action:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgb(0 0 0 / 15%);
}

.primary-action:hover::before,
.primary-action:focus-visible::before {
  opacity: 1;
}

.site-footer {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 80px;
  background: var(--text-main);
  color: rgb(255 255 255 / 35%);
  font-size: 0.75rem;
}

.site-footer::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--z-purple) 25%, var(--z-blue) 60%, var(--z-teal) 85%, transparent 100%);
  content: "";
}

.footer-brand img {
  display: block;
  width: auto;
  height: 22px;
  opacity: 0.8;
}

.footer-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-meta a {
  color: rgb(255 255 255 / 45%);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-meta a:hover,
.footer-meta a:focus-visible,
.footer-meta a[aria-current="page"] {
  color: #fff;
}

@media (max-width: 900px) {
  .legal-main { padding: 128px 24px 72px; }
  .legal-hero { margin-bottom: 48px; }
  .legal-layout { grid-template-columns: 1fr; gap: 40px; }
  .legal-aside { position: static; order: -1; }
  .legal-aside nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer { flex-direction: column; padding: 28px 24px; text-align: center; }
  .footer-meta { justify-content: center; }
}

@media (max-width: 600px) {
  .site-header { padding: 0 20px; }
  .fixed-grid-overlay { padding: 0 16px; }
  .brand-link img { height: 32px; }
  .back-link { padding: 9px 15px; font-size: 0.62rem; }
  .back-link svg { display: none; }
  .legal-main { padding-right: 20px; padding-left: 20px; }
  .legal-hero h1 { font-size: clamp(2.35rem, 13vw, 3.6rem); }
  .legal-aside nav { grid-template-columns: 1fr; }
  .legal-section { padding: 32px 0; }
  .contact-card { padding: 26px 22px; }
  .primary-action { width: 100%; padding-right: 18px; padding-left: 18px; text-align: center; }
  .footer-meta { flex-direction: column; gap: 12px; }
}

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