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

:root {
  color-scheme: light;
  --page: #f7f7f7;
  --surface: #ffffff;
  --text: #151515;
  --muted: #777777;
  --subtle: #999999;
  --border: #e7e7e7;
  --soft: #f3f3f3;
  --black: #151515;
  --content-width: 1080px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 40px;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: var(--page);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible {
  outline: 2px solid #777777;
  outline-offset: 4px;
}

/* Top Bar */

.terms-topbar {
  width: 100%;
  padding: 24px 6%;
  background: transparent;
}

.terms-topbar-inner {
  max-width: var(--content-width);
  margin: 0 auto;
}

.back-to-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 650;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.back-to-home-btn:hover {
  background: var(--soft);
  border-color: #d6d6d6;
  transform: translateY(-1px);
}

/* Page introduction */

.terms-main-wrapper {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 20px 28px 90px;
  flex: 1;
}

.terms-hero {
  max-width: 720px;
  margin-bottom: 38px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 17px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--black);
  border-radius: 50%;
}

.terms-hero h1 {
  color: var(--text);
  font-size: clamp(38px, 6vw, 58px);
  font-weight: 750;
  letter-spacing: -3px;
  line-height: 1.05;
}

.terms-hero p {
  max-width: 560px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
}

.terms-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 23px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  color: #666666;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
}

.meta-pill i {
  color: #777777;
}

/* Content layout */

.terms-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  align-items: start;
  gap: 25px;
}

.terms-toc {
  position: sticky;
  top: 30px;
  padding: 19px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
}

.toc-heading {
  padding: 0 9px;
  margin-bottom: 12px;
  color: var(--subtle);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.terms-toc nav {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.terms-toc a {
  position: relative;
  z-index: 1;
  display: block;
  padding: 11px 14px;
  border-radius: 9px;
  color: #666;
  text-decoration: none;
  font-size: 11px;
  line-height: 1.5;
  transition: color 220ms ease;
}

.terms-toc a:hover {
  color: var(--text);
}

.terms-toc a.active {
  color: #ffffff;
}

.terms-toc-indicator {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  border-radius: 9px;
  background: var(--black);
  opacity: 0;
  pointer-events: none;
  transform: translateY(0);
  transition:
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
    height 220ms ease,
    opacity 180ms ease;
}

.terms-toc-indicator.visible {
  opacity: 1;
}

.terms-container {
  min-width: 0;
  padding: 36px 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.018);
}

.terms-intro {
  padding-bottom: 25px;
  border-bottom: 1px solid #eeeeee;
}

.terms-intro p {
  margin: 0;
}

.terms-container h2 {
  margin: 34px 0 12px;
  color: var(--text);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.45px;
  line-height: 1.4;
  scroll-margin-top: 40px;
}

.terms-container h3 {
  margin: 20px 0 8px;
  color: #292929;
  font-size: 13px;
  font-weight: 700;
}

.terms-container p {
  margin-bottom: 14px;
  color: #626262;
  font-size: 13px;
  line-height: 1.9;
}

.terms-container ul {
  display: grid;
  gap: 10px;
  margin: 12px 0 18px;
  padding-left: 0;
  list-style: none;
}

.terms-container li {
  position: relative;
  padding-left: 21px;
  color: #626262;
  font-size: 13px;
  line-height: 1.8;
}

.terms-container li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 10px;
  width: 5px;
  height: 5px;
  background: #999999;
  border-radius: 50%;
}

.terms-container strong {
  color: #333333;
  font-weight: 650;
}

.terms-container a {
  text-decoration-color: #aaaaaa;
  text-underline-offset: 3px;
}

.terms-container a:hover {
  color: #555555;
}

/* Notice */

.terms-notice {
  margin-top: 25px;
  padding: 16px 17px;
  color: #666666;
  background: #f7f7f7;
  border: 1px solid #eaeaea;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.8;
}

.terms-notice strong {
  display: block;
  margin-bottom: 4px;
  color: #222222;
}

/* Bottom action */

.terms-footer-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 38px;
  padding-top: 23px;
  border-top: 1px solid #eeeeee;
}

.terms-footer-action p {
  margin: 0;
  color: #999999;
  font-size: 11px;
}

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  color: #222222;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  transition: gap 0.2s ease;
}

.back-home:hover {
  gap: 13px;
}

/* Footer */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 6%;
  background: #ffffff;
  border-top: 1px solid var(--border);
}

.footer-brand {
  color: #999999;
  font-size: 10px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links a {
  color: #777777;
  text-decoration: none;
  font-size: 11px;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #111111;
}

/* Responsive */

@media (max-width: 800px) {
  .terms-main-wrapper {
    padding: 20px 20px 65px;
  }

  .terms-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .terms-toc {
    position: static;
    padding: 15px;
  }

  .terms-toc nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .terms-toc a {
    padding: 8px 10px;
  }

  .terms-container {
    padding: 30px 25px;
  }

  .site-footer {
    padding: 24px 22px;
  }
}

@media (max-width: 520px) {
  .terms-topbar {
    padding: 18px 16px;
  }

  .terms-main-wrapper {
    padding: 10px 14px 48px;
  }

  .terms-hero {
    margin-bottom: 28px;
  }

  .terms-hero h1 {
    font-size: 40px;
    letter-spacing: -2px;
  }

  .terms-hero p {
    font-size: 13px;
  }

  .terms-container {
    padding: 24px 19px;
    border-radius: 14px;
  }

  .terms-container h2 {
    margin-top: 29px;
    font-size: 16px;
  }

  .terms-container p,
  .terms-container li {
    font-size: 12px;
  }

  .terms-footer-action {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer {
    flex-direction: column;
    text-align: center;
    gap: 17px;
  }

  .footer-links {
    justify-content: center;
    gap: 16px;
  }
}

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