/* Motion docs. Three columns on a wide screen (contents, page, on this page), two on a laptop,
   one on tablets and phones with the contents in a drawer. */

.docs { display: grid; grid-template-columns: 236px minmax(0, 1fr) 200px; gap: 0 44px; align-items: start; padding-top: 28px; }

/* contents */
.side { position: sticky; top: 86px; max-height: calc(100vh - 104px); max-height: calc(100dvh - 104px); overflow-y: auto; overscroll-behavior: contain; padding: 0 6px 24px 0; }
.side h2 { margin: 22px 0 6px; font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); }
.side h2:first-child { margin-top: 0; }
.side a { display: block; padding: 6px 0 6px 14px; margin-left: 2px; border-left: 2px solid var(--line); color: var(--ink-dim); text-decoration: none; font-size: 15px; line-height: 1.3; }
.side a:hover { color: var(--ink); }
.side a[aria-current="page"] { color: var(--ink); font-weight: 600; border-left-color: var(--ink); }
.side-head, .menu-btn { display: none; }

/* on this page */
.toc { position: sticky; top: 86px; font-size: 13.5px; }
.toc h2 { margin: 0 0 8px; font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); }
.toc ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.toc a { color: var(--ink-dim); text-decoration: none; line-height: 1.3; display: block; }
.toc a:hover, .toc a.on { color: var(--ink); }

/* the page */
.prose { min-width: 0; max-width: 760px; font-size: 16.5px; line-height: 1.62; color: rgba(245, 241, 232, 0.86); padding-bottom: 10px; }
.crumb { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); }
.prose h1 { margin: 0 0 14px; font-family: var(--display); font-style: italic; font-weight: 700; font-size: clamp(34px, 5.4vw, 56px); line-height: 0.96; letter-spacing: 0.005em; text-transform: uppercase; color: var(--ink); overflow-wrap: anywhere; }
.prose .lead { font-size: 19px; line-height: 1.5; color: var(--ink); margin: 0 0 22px; max-width: 640px; }
.prose h2 { margin: 44px 0 12px; padding-top: 20px; border-top: 1px solid var(--line-strong); font-family: var(--display); font-style: italic; font-weight: 600; font-size: 29px; line-height: 1.05; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink); scroll-margin-top: 80px; }
.prose h3 { margin: 28px 0 8px; font-size: 18px; font-weight: 600; line-height: 1.3; color: var(--ink); scroll-margin-top: 80px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 7px; }
.prose li::marker { color: var(--ink-faint); }
.prose b, .prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink-faint); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--ink); }
.prose code { font-family: var(--mono); font-size: 0.86em; background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }

.pre { position: relative; margin: 0 0 18px; background: #0a0908; border: 1px solid var(--line-strong); border-radius: 10px; }
.pre pre { margin: 0; padding: 14px 16px 15px; overflow-x: auto; -webkit-overflow-scrolling: touch; font-family: var(--mono); font-size: 13.5px; line-height: 1.55; color: var(--ink); tab-size: 2; }
.pre code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; white-space: pre; }
.pre-top { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 0 16px; border-bottom: 1px solid var(--line); min-height: 40px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); }
.copy { background: none; border: 0; color: var(--ink-dim); font-size: 13px; font-family: var(--body); padding: 6px 12px; border-radius: 6px; min-height: 40px; text-transform: none; letter-spacing: 0; }
.copy:hover { color: var(--ink); }

.tbl { margin: 0 0 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.tbl table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); padding: 10px 14px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.tbl td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-family: var(--body); white-space: normal; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.n, .tbl th.n { text-align: right; font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
.tbl td:first-child { color: var(--ink); }
.tbl td code { white-space: nowrap; }

.note, .flagnote, .status { margin: 0 0 18px; padding: 12px 16px; border-radius: 0 10px 10px 0; font-size: 15.5px; }
.note { background: var(--panel); border-left: 3px solid var(--ink-faint); }
.flagnote { background: var(--flag-soft); border-left: 3px solid var(--flag); }
.flagnote b { color: var(--flag); }
.status { background: var(--panel); border-left: 3px solid var(--flag); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.status b { font-family: var(--display); font-style: italic; font-weight: 600; font-size: 19px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--flag); }
.note p:last-child, .flagnote p:last-child, .status p:last-child { margin-bottom: 0; }
.soon { display: inline-block; font-family: var(--display); font-style: italic; font-weight: 600; font-size: 0.95em; letter-spacing: 0.03em; color: #1a1503; background: var(--flag); padding: 0 7px 1px; border-radius: 3px; transform: skewX(-10deg); white-space: nowrap; }

/* cards that lead somewhere */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.cards a { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 15px; text-decoration: none; transition: border-color 0.15s ease; }
.cards a:hover { border-color: var(--ink); }
.cards b { display: block; font-family: var(--display); font-style: italic; font-weight: 600; font-size: 22px; line-height: 1.1; text-transform: uppercase; letter-spacing: 0.03em; }
.cards span { display: block; color: var(--ink-dim); font-size: 14.5px; line-height: 1.4; margin-top: 4px; }

/* the money flow, drawn in boxes */
.flowline { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) 20px minmax(0, 1fr) 20px minmax(0, 1.15fr); gap: 0 8px; margin: 0 0 18px; align-items: stretch; }
.flowline div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; font-size: 14.5px; line-height: 1.4; min-width: 0; }
.flowline div b { display: block; font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); margin-bottom: 4px; }
.flowline div.burn { background: var(--flag-soft); border-color: rgba(242, 194, 48, 0.35); }
.flowline div.burn strong { color: var(--flag); }
.flowline i { align-self: center; height: 30px; background: var(--ink-faint); clip-path: polygon(0 0, 45% 0, 100% 50%, 45% 100%, 0 100%, 55% 50%); }

/* an endpoint */
.ep { margin: 0 0 10px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; scroll-margin-top: 80px; }
.ep .verb { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 17px; letter-spacing: 0.05em; padding: 0 8px 1px; border-radius: 3px; transform: skewX(-10deg); background: var(--long-soft); color: var(--long); }
.ep .verb.post { background: var(--flag-soft); color: var(--flag); }
.ep code { font-size: 15px; background: none; border: 0; padding: 0; color: var(--ink); }
.epbox { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 26px; }
.epbox:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }

/* swatches on the brand page */
.swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.swatches div { border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--panel); font-size: 13.5px; }
.swatches i { display: block; height: 56px; }
.swatches span { display: block; padding: 8px 12px 10px; }
.swatches span b { display: block; }
.swatches code { background: none; border: 0; padding: 0; color: var(--ink-dim); }
.assets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.assets a { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; }
.assets img { display: block; width: 100%; height: auto; background: var(--bg); }
.assets span { display: block; padding: 10px 14px 12px; font-size: 14.5px; }
.assets .wide { grid-column: 1 / -1; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 46px 0 0; }
.pager a { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px 14px; text-decoration: none; min-width: 0; }
.pager a:hover { border-color: var(--ink); }
.pager small { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); }
.pager b { display: block; font-family: var(--display); font-style: italic; font-weight: 600; font-size: 21px; line-height: 1.15; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink); overflow-wrap: anywhere; }
.pager .next { text-align: right; grid-column: 2; }
.docs .foot { margin-top: 40px; }

/* ---------- laptops: drop the right column ---------- */
@media (max-width: 1199px) {
  .docs { grid-template-columns: 220px minmax(0, 1fr); gap: 0 36px; }
  .toc { display: none; }
}

/* ---------- tablets and phones: one column, contents in a drawer ---------- */
@media (max-width: 899px) {
  .docs { grid-template-columns: minmax(0, 1fr); padding-top: 20px; }
  .menu-btn {
    display: inline-flex; align-items: center; gap: 9px; background: none; border: 1px solid var(--line-strong); border-radius: 999px;
    padding: 0 15px 0 13px; min-height: 40px; font-weight: 600; font-size: 14.5px; color: var(--ink);
  }
  .menu-btn i { width: 15px; height: 10px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: skewX(-14deg); }
  .docs-app { display: none; }
  .side {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 80; width: min(86vw, 330px); max-height: none;
    background: var(--panel); border-right: 1px solid var(--line-strong);
    padding: calc(14px + var(--st)) 18px calc(30px + var(--sb)) max(18px, var(--sl));
    transform: translateX(-104%); visibility: hidden;
    transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.24s;
  }
  html.drawer-open .side { transform: none; visibility: visible; transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .side-head { display: flex; align-items: center; justify-content: space-between; margin: 0 -6px 14px 0; }
  .side-head span { font-family: var(--display); font-style: italic; font-weight: 600; font-size: 22px; text-transform: uppercase; letter-spacing: 0.03em; }
  .side-x { width: 44px; height: 44px; border: 0; background: none; position: relative; border-radius: 50%; }
  .side-x::before, .side-x::after { content: ""; position: absolute; left: 13px; right: 13px; top: 21px; height: 2px; background: var(--ink-dim); }
  .side-x::before { transform: rotate(45deg); }
  .side-x::after { transform: rotate(-45deg); }
  .side a { padding: 11px 0 11px 14px; font-size: 16px; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 70; width: 100%; border: 0; padding: 0; background: rgba(0, 0, 0, 0.64); opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
  html.drawer-open .scrim { opacity: 1; pointer-events: auto; }
  html.drawer-open, html.drawer-open body { overflow: hidden; }
  .prose h2, .prose h3 { scroll-margin-top: 14px; }
}
.scrim { display: none; }

@media (max-width: 599px) {
  .prose { font-size: 16px; }
  .prose .lead { font-size: 17.5px; }
  .prose h2 { font-size: 26px; margin-top: 36px; }
  .cards, .assets { grid-template-columns: minmax(0, 1fr); }
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flowline { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .flowline i { height: 18px; width: 30px; justify-self: center; clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 45%, 50% 100%, 0 45%); }
  .tbl table { font-size: 14px; }
  .tbl th, .tbl td { padding: 9px 11px; }
  .pre pre { font-size: 12.5px; padding: 12px 13px 13px; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { grid-column: auto; text-align: left; }
  .pager b { font-size: 20px; }
}

/* fingers need bigger targets than a mouse does, also on a tablet held sideways where the contents stay in view */
@media (pointer: coarse) {
  .side a { padding-top: 10px; padding-bottom: 10px; }
  .toc ul { gap: 0; }
  .toc a { padding: 11.5px 0; }                 /* 40 px tall with its one line of text */
}
