/* Room8 legal pages.
   Tokens, type scale, global nav, ribbon and footer are the same as the
   Room8 website's styles.css, so the two sites can be merged later. */
:root {
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --paper: #ffffff;
  --mist: #f5f5f7;
  --blue: #0071e3;
  --blue-link: #0066cc;
  --hair: #d2d2d7;

  --font: system-ui, "Inter", "Helvetica Neue", Arial, sans-serif;

  --col: 980px;
  --ease-out: cubic-bezier(.25, .1, .25, 1);
  --spring: cubic-bezier(.32, .72, 0, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 12px; }

.wrap { width: min(var(--col), 100% - 44px); margin-inline: auto; }
.center { text-align: center; }
.narrow { max-width: 640px; margin-inline: auto; }
.muted { color: var(--ink-2); }

/* ---------- Type scale ---------- */
.headline-xl { font-size: clamp(40px, 6.2vw, 80px); line-height: 1.05; font-weight: 600; letter-spacing: -0.015em; margin: 10px 0 0; text-wrap: balance; }
.lede { font-size: clamp(19px, 1.6vw, 21px); line-height: 1.38; font-weight: 400; letter-spacing: .011em; margin: 24px 0 0; }
.lede.narrow { margin-inline: auto; }
.product-name { font-size: clamp(21px, 2vw, 28px); font-weight: 600; letter-spacing: .007em; margin: 0; }

.link { color: var(--blue-link); font-size: 17px; display: inline-flex; gap: 4px; align-items: center; }
.link:hover { text-decoration: underline; }

/* ---------- Global nav ---------- */
.globalnav { position: relative; z-index: 40; background: rgba(250,250,252,.8); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.globalnav-inner { width: min(1024px, 100% - 44px); margin-inline: auto; height: 44px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.gn-logo { justify-self: start; }
.gn-logo img { width: 16px; height: 16px; opacity: .88; }
.gn-links { display: flex; gap: clamp(14px, 3.4vw, 38px); list-style: none; margin: 0; padding: 0; }
.gn-links a { font-size: 12px; letter-spacing: -0.01em; color: rgba(0,0,0,.8); transition: color .2s; }
.gn-links a:hover, .gn-links a[aria-current="page"] { color: #000; }
.gn-links a[aria-current="page"] { font-weight: 600; }

.ribbon { background: var(--mist); text-align: center; padding: 15px 22px; position: relative; z-index: 1; }
.ribbon p { margin: 0; font-size: 14px; letter-spacing: -0.016em; }
.ribbon a { color: var(--blue-link); white-space: nowrap; }
.ribbon a:hover { text-decoration: underline; }

/* ---------- Hub (index and 404) ---------- */
.hub { padding-block: clamp(72px, 9vw, 120px) clamp(100px, 11vw, 150px); }
.doc-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: clamp(56px, 6vw, 72px); }
.doc-card {
  background: var(--mist); border-radius: 28px; padding: 36px; min-width: 0;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .4s var(--spring), box-shadow .4s var(--ease-out);
}
.doc-card:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -24px rgba(0,0,0,.18); }
.doc-card:active { transform: scale(.985); transition-duration: .1s; }
.doc-card:hover .link { text-decoration: underline; }
.doc-icon { width: 56px; height: 56px; margin-bottom: 18px; border-radius: 15px; display: grid; place-items: center; color: #fff; background: linear-gradient(200deg, #4c7dff, #1b3fa8); }
.doc-name { font-size: 21px; font-weight: 600; letter-spacing: .011em; }
.doc-sub { color: var(--ink-2); }
.doc-card .link { margin-top: auto; padding-top: 14px; }

/* ---------- Document pages ---------- */
.doc-head { padding-block: clamp(64px, 8vw, 110px) clamp(40px, 5vw, 64px); border-bottom: 1px solid var(--hair); }
.doc-head .product-name a:hover { text-decoration: underline; }
.meta { margin: 18px 0 0; color: var(--ink-2); font-size: 17px; }

.doc-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(40px, 7vw, 96px); align-items: start; padding-block: clamp(40px, 5vw, 64px) clamp(100px, 11vw, 150px); }

/* On this page — sticky beside the text on wide screens */
.toc { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; }
.toc-title { margin: 0 0 12px; font-size: 12px; font-weight: 600; color: var(--ink); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--hair); font-size: 14px; line-height: 1.35; letter-spacing: -0.016em; color: var(--ink-2); transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--ink); font-weight: 600; }

/* The documents themselves: a capped reading measure, generous section breaks */
.doc-body { max-width: 692px; }
.doc-body > :first-child { margin-top: 0; }
.doc-body h2 { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.125; font-weight: 600; letter-spacing: .004em; margin: 64px 0 18px; text-wrap: balance; }
.doc-body h2:first-child { margin-top: 0; }
.doc-body h3 { font-size: 21px; font-weight: 600; letter-spacing: .011em; margin: 36px 0 10px; }
.doc-body p { margin: 0 0 18px; text-wrap: pretty; }
.doc-body ul, .doc-body ol { margin: 0 0 18px; padding-left: 22px; }
.doc-body li { margin-bottom: 8px; }
.doc-body li::marker { color: var(--ink-3); }
.doc-body strong { font-weight: 600; }
.doc-body a:not(.doc-next) { color: var(--blue-link); }
.doc-body a:not(.doc-next):hover { text-decoration: underline; }

/* Callouts ("Read this clause carefully") */
.doc-body blockquote { margin: 0 0 18px; padding: 18px 24px; background: var(--mist); border-radius: 18px; font-weight: 600; }
.doc-body blockquote p { margin: 0; }

/* Tables — wrapped in a scroll container by the script in the layout */
.table-scroll { overflow-x: auto; margin: 6px 0 24px; -webkit-overflow-scrolling: touch; }
.table-scroll table { margin: 0; min-width: 520px; }
.doc-body table { width: 100%; border-collapse: collapse; margin: 6px 0 24px; font-size: 15px; line-height: 1.4; letter-spacing: -0.01em; }
.doc-body th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink); padding: 0 16px 10px 0; border-bottom: 1px solid var(--ink); }
.doc-body td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--hair); vertical-align: top; overflow-wrap: break-word; }
.doc-body td:first-child { font-weight: 600; }
.doc-body td:not(:first-child) { color: var(--ink-2); }

/* Next document */
.doc-next { display: flex; flex-direction: column; gap: 4px; margin-top: 64px; background: var(--mist); border-radius: 28px; padding: 32px 36px; transition: transform .4s var(--spring), box-shadow .4s var(--ease-out); }
.doc-next:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -24px rgba(0,0,0,.18); }
.doc-next:hover .link { text-decoration: underline; }
.doc-next-label { font-size: 14px; color: var(--ink-2); }
.doc-next-title { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.125; font-weight: 600; letter-spacing: .004em; }
.doc-next .link { margin-top: 10px; }

/* ---------- Footer ---------- */
.footer { background: var(--mist); color: var(--ink-2); font-size: 12px; line-height: 1.33; letter-spacing: -0.01em; padding: 18px 0 20px; }
.crumb { display: flex; align-items: center; gap: 10px; color: var(--ink); padding-bottom: 12px; border-bottom: 1px solid var(--hair); }
.crumb img { opacity: .85; }
.crumb a:hover { text-decoration: underline; }
.footnote { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--hair); }
.fcols { display: flex; justify-content: flex-start; gap: 24px 72px; flex-wrap: wrap; padding: 18px 0; border-bottom: 1px solid var(--hair); }
.fcols h4 { margin: 0 0 10px; color: var(--ink); font-size: 12px; font-weight: 600; }
.flinks { display: grid; grid-template-rows: repeat(3, auto); grid-auto-flow: column; justify-content: start; gap: 8px 32px; }
.flinks a { color: var(--ink-2); white-space: nowrap; }
.flinks a:hover { color: var(--ink); text-decoration: underline; }
.legal { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding-top: 14px; }
.legal p { margin: 0; }
.legal-links { display: flex; gap: 18px; flex-wrap: wrap; }
.legal-links a:hover { color: var(--ink); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .doc-card, .doc-next { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .globalnav { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ---------- Narrow screens ---------- */
@media (max-width: 833px) {
  .doc-cards { grid-template-columns: 1fr; }
  .doc-grid { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .fcols { gap: 20px 36px; }
}
@media (max-width: 600px) {
  .globalnav-inner { grid-template-columns: auto 1fr; }
  .gn-links { gap: 16px; justify-content: flex-end; }
  .doc-card, .doc-next { padding: 28px; }
  .doc-body h2 { margin-top: 48px; }
}
