/* Terms of Service (2026-10). Tokens, page colours, fonts, buttons, nav and footer come from
   brand.css. Same layout as the Disclaimer: a light title band (.cs-light) over the ink ground
   and a sticky contents list beside the text on wide screens. The legal text is kept plain
   and readable: numbered sections with lettered and roman clauses, as the Terms refer to
   them (Section 5(e), 17(b)). */
body.cs-page {
  /* the sticky site nav's height, as on the FAQ */
  --cs-nav-h: 94px;
}

/* on paper the accent goes purple (brand yellow is too faint for text) */
.cs-terms-hero {
  --hi: var(--cs-purple);
  position: relative;
  padding: clamp(48px, 7vw, 104px) var(--cs-gutter) clamp(56px, 7vw, 96px);
}

/* a stepped hairline field in the top right, like the FAQ's */
.cs-terms-hero::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: min(44vw, 560px);
  height: 100%;
  background: var(--hatch-white);
  clip-path: polygon(40% 0, 100% 0, 100% 100%, 72% 100%, 72% 62%, 54% 62%, 54% 28%, 40% 28%);
  pointer-events: none;
}

.cs-terms-hero-inner {
  position: relative;
  max-width: var(--cs-max);
  margin: 0 auto;
}

.cs-terms-title {
  margin: 0 0 20px;
  font-family: var(--cs-display);
  font-size: clamp(64px, 9vw, 136px);
  font-weight: 400;
  line-height: .86;
  letter-spacing: .01em;
}

.cs-terms-title span {
  color: var(--hi);
}

.cs-terms-lede {
  max-width: 46ch;
  margin: 0 0 16px;
  color: var(--cs-text-soft);
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.5;
}

.cs-terms-date {
  margin: 0;
  color: var(--cs-text-soft);
  font-size: 14px;
  font-weight: 600;
}

/* ---- Contents and sections on the ink ground ---- */
.cs-terms-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0 clamp(40px, 6vw, 96px);
  max-width: var(--cs-max);
  margin: 0 auto;
  padding: clamp(48px, 6vw, 80px) var(--cs-gutter) clamp(72px, 9vw, 128px);
}

.cs-terms-nav {
  position: sticky;
  top: calc(var(--cs-nav-h) + 32px);
  align-self: start;
  max-height: calc(100vh - var(--cs-nav-h) - 64px);
  overflow-y: auto;
}

.cs-terms-nav-title {
  margin: 0 0 14px;
  color: var(--cs-link);
  font-family: var(--cs-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: .05em;
}

.cs-terms-nav ul {
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--cs-rule);
  list-style: none;
}

.cs-terms-nav a {
  display: block;
  margin-left: -1px;
  padding: 5px 0 5px 16px;
  border-left: 3px solid transparent;
  color: var(--cs-text-soft);
  font-size: 14px;
  line-height: 1.3;
  text-decoration: none;
}

.cs-terms-nav a:hover {
  border-left-color: var(--cs-teal);
  color: var(--cs-text);
}

.cs-terms-nav a:focus-visible {
  outline: 3px solid var(--cs-teal);
  outline-offset: 2px;
}

.cs-terms-short,
.cs-terms-legal {
  max-width: 72ch;
}

.cs-terms-short {
  --accent: var(--cs-teal);
  margin-bottom: clamp(40px, 5vw, 56px);
  padding: 28px 28px 14px;
  background-color: rgba(255, 255, 255, .05);
  box-shadow: inset 0 0 0 1px var(--cs-rule);
  scroll-margin-top: calc(var(--cs-nav-h) + 24px);
}

.cs-terms-bars {
  display: block;
  width: 38px;
  height: 30px;
  margin-bottom: 16px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 15px);
}

.cs-terms-short-title {
  margin: 0 0 14px;
  font-family: var(--cs-display);
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 400;
  line-height: .95;
  letter-spacing: .01em;
}

.cs-terms-short ul {
  padding-left: 22px;
}

.cs-terms-short li + li {
  margin-top: 8px;
}

.cs-terms-short li::marker {
  color: var(--accent);
}

.cs-terms-short p,
.cs-terms-short ul,
.cs-terms-legal p,
.cs-terms-legal ol {
  margin: 0 0 14px;
  color: var(--cs-text-soft);
  font-size: 16px;
  line-height: 1.65;
}

.cs-terms-notice {
  padding-left: 16px;
  border-left: 3px solid var(--cs-yellow);
}

.cs-terms-section {
  padding-top: 28px;
  scroll-margin-top: calc(var(--cs-nav-h) + 16px);
}

.cs-terms-section-title {
  margin: 0 0 12px;
  font-family: var(--cs-display);
  font-size: clamp(28px, 2.6vw, 34px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: .02em;
}

.cs-terms-section-title span {
  color: var(--cs-teal);
}

.cs-terms-alpha {
  padding-left: 26px;
  list-style: lower-alpha;
}

.cs-terms-roman {
  margin-top: 10px;
  padding-left: 30px;
  list-style: lower-roman;
}

.cs-terms-legal li + li {
  margin-top: 10px;
}

.cs-terms-legal li::marker {
  color: var(--cs-text);
  font-weight: 600;
}

.cs-terms-short strong,
.cs-terms-legal strong {
  color: var(--cs-text);
  font-weight: 600;
}

.cs-terms-hero a,
.cs-terms-short a,
.cs-terms-legal a {
  color: var(--cs-link);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

/* long addresses and URLs (the program address, the AAA rules) wrap rather than overflow */
.cs-terms-legal {
  overflow-wrap: anywhere;
}

.cs-terms-hero a:focus-visible,
.cs-terms-short a:focus-visible,
.cs-terms-legal a:focus-visible {
  outline: 3px solid var(--cs-teal);
  outline-offset: 2px;
}

/* below this the contents list goes: the sections run full width */
@media screen and (max-width: 991px) {
  .cs-terms-body {
    display: block;
  }

  .cs-terms-nav {
    display: none;
  }
}

@media screen and (max-width: 767px) {
  /* keep the field in the corner beside the title, off the copy */
  .cs-terms-hero::before {
    width: 34vw;
    height: 120px;
  }

  .cs-terms-short {
    padding: 22px 18px 8px;
  }
}
