/* VALBLOX legal pages (terms.html, privacy.html, aml.html), on top of styles.css and pages.css.
   A reading page: the whole page is one centred column on wide screens; the contents list rides beside the text,
   sticky under the bar, and folds above it on narrow screens (native <details>, no script). The text keeps a measure
   of about 70 characters. Every plate here is the light edge tier: these pages have no heavy key panel.
   Built by brand/viking/src/page/build_legal.py. */

.content--legal { max-width: calc(1040px + 2 * var(--pad)); }
.legal { display: grid; grid-template-columns: 244px minmax(0, 1fr); column-gap: 28px; row-gap: 20px; align-items: start; }
.legal__tpl { grid-column: 1 / -1; }
.legal__main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* ---------------------------------------------------------------- side: contents + the three documents */
.legal__side {
  position: sticky; top: calc(var(--bar-h) + 16px); display: flex; flex-direction: column; gap: 14px; min-width: 0;
  max-height: calc(100vh - var(--bar-h) - 32px); overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #3A4556 transparent;
}
.legal__box { position: relative; isolation: isolate; padding: 15px 10px 12px; }
.legal__box > .plate { --c: 11px; --n: 4px; --bt: rgba(var(--hi), .24); --bb: rgba(var(--lo), .56); --face: linear-gradient(170deg, var(--card) 0%, var(--card-b) 100%); }
.legal__box > .kick { padding: 0 10px 8px; }
.legal__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }

/* contents links (the side list and the folding list share them) */
ol.legal__list a {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: baseline; column-gap: 8px; padding: 6px 10px 7px 6px;
  font-family: "Skranji", sans-serif; font-size: 14px; line-height: 19px; letter-spacing: .3px; color: var(--muted); text-decoration: none;
  transition: color .12s, background-color .12s;
}
ol.legal__list a > span { font-family: "GoldenSmile", sans-serif; font-size: 12px; letter-spacing: .5px; color: rgba(var(--gold-rgb), .62); text-align: right; }
ol.legal__list a:hover { color: var(--lilac-lighter); background: rgba(var(--lilac-rgb), .07); }
ol.legal__list a:hover > span { color: var(--gold); }
ol.legal__list a:focus-visible { outline: 2px solid var(--lilac); outline-offset: -2px; }

/* the three documents: the current one is a lit tab */
.legal__docs .legal__list a {
  position: relative; isolation: isolate; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px 9px;
  font-family: "Skranji", sans-serif; font-size: 14px; line-height: 19px; letter-spacing: .3px; color: var(--muted); text-decoration: none;
}
.legal__docs .legal__list a > .plate {
  display: none; --c: 8px; --n: 1px; --rim: rgba(var(--lilac-rgb), .5); --bt: rgba(var(--lilac-rgb), .16); --bb: rgba(var(--lo), .5);
  --face: linear-gradient(180deg, rgba(var(--lilac-rgb), .12) 0%, rgba(var(--lilac-rgb), .04) 100%), #1C2330;
}
.legal__docs .legal__list a[aria-current="page"] > .plate { display: block; }
.legal__docs .legal__list a[aria-current="page"] { color: var(--white); }
.legal__docs .legal__list a .ic { width: 18px; height: 18px; flex: none; color: var(--lilac); }
.legal__docs .legal__list a:not([aria-current]):hover { color: var(--lilac-lighter); }
.legal__docs .legal__list a:focus-visible { outline: 2px solid var(--lilac); outline-offset: -2px; }
.legal__ds { display: none; }
.legal__help { margin-top: 12px; gap: 8px; }
.legal__help .ic { width: 18px; height: 18px; flex: none; }

/* folding contents (narrow screens only); the plate sits on the wrapper so it shows while closed */
.legal__mtoc { display: none; position: relative; isolation: isolate; }
.legal__mtoc > .plate { --c: 11px; --n: 4px; --bt: rgba(var(--hi), .24); --bb: rgba(var(--lo), .56); --face: linear-gradient(96deg, var(--card) 0%, var(--card-b) 100%); }
.legal__mtoc:has(details[open]) > .plate { --rim: rgba(var(--lilac-rgb), .4); }
.legal__mtoc summary {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 16px 12px 18px; cursor: pointer; list-style: none;
  font-size: 15px; line-height: 20px; letter-spacing: .9px; color: var(--white); text-transform: uppercase;
}
.legal__mtoc summary::-webkit-details-marker { display: none; }
.legal__mtoc summary::marker { content: ""; }
.legal__mtoc summary > .ic:first-child { width: 18px; height: 18px; flex: none; color: var(--lilac); }
.legal__mtoc summary small { font-family: "Skranji", sans-serif; font-size: 13px; line-height: 18px; letter-spacing: .3px; color: var(--muted); text-transform: none; }
.legal__mtoc .ic--chev { width: 20px; height: 20px; flex: none; margin-left: auto; color: var(--muted); transition: transform .15s; }
.legal__mtoc details[open] .ic--chev { transform: rotate(180deg); color: var(--lilac); }
.legal__mtoc summary:hover { color: var(--lilac-lighter); }
.legal__mtoc summary:focus-visible { outline: 2px solid var(--lilac); outline-offset: -3px; }
.legal__mtoc .legal__list { padding: 0 10px 12px; }

/* ---------------------------------------------------------------- the document */
.legal__doc { --px: 40px; padding: 32px var(--px) 30px; }

/* the short version: a recessed bay at the top */
.legal__short { position: relative; isolation: isolate; padding: 16px 20px 15px; }
.legal__short > .plate { --c: 11px; --n: 4px; --bt: rgba(5, 8, 12, .5); --bb: rgba(var(--hi), .3); --face: linear-gradient(180deg, #19202B 0%, #1D2531 100%); }
.legal__short ul { list-style: none; margin: 11px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.legal__short li { display: flex; align-items: flex-start; gap: 10px; min-width: 0; font-family: "Skranji", sans-serif; font-size: 14.5px; line-height: 21px; letter-spacing: .3px; color: #C6CEDC; }
.legal__short li .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--green); }
.legal__fine { margin-top: 12px; font-family: "Skranji", sans-serif; font-size: 13px; line-height: 18px; letter-spacing: .3px; color: var(--muted); }

/* sections: grooved apart, a bronze lozenge per number, an anchor link that shows on hover or focus */
.legal__short + .legal__sec { margin-top: 30px; }
.legal__sec + .legal__sec, .legal__end { margin-top: 30px; padding-top: 28px; border-top: 1px solid rgba(var(--hi), .55); box-shadow: inset 0 1px 0 rgba(var(--lo), .6); }
.legal__sec { font-family: "Skranji", sans-serif; font-size: 15.5px; line-height: 26px; letter-spacing: .25px; color: #B3BDCF; }
.legal__sec > :not(.legal__hrow) { max-width: 70ch; }
.legal__sec > * + * { margin-top: 12px; }
.legal__sec b, .legal__sec strong { font-weight: 400; color: var(--white); }
.legal__hrow { position: relative; display: flex; align-items: center; gap: 8px; }
.legal__h { display: flex; align-items: center; gap: 13px; min-width: 0; font-family: "GoldenSmile", sans-serif; font-size: 19px; line-height: 26px; letter-spacing: 1px; color: var(--white); text-transform: uppercase; }
.legal__n {
  position: relative; isolation: isolate; flex: none; width: 28px; height: 28px; display: grid; place-items: center; padding-bottom: 1px;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: conic-gradient(var(--bz1) 0 90deg, var(--bz4) 90deg 180deg, var(--bz3) 180deg 270deg, var(--bz0) 270deg 360deg);
  font-size: 12px; line-height: 1; letter-spacing: 0; color: #4A300C; text-shadow: 0 1px 0 rgba(253, 228, 196, .55);
}
.legal__n::before { content: ""; position: absolute; inset: 3.6px; z-index: -1; background: var(--bz2); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.legal__a {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); opacity: 0;
  transition: opacity .15s, color .15s;
}
.legal__a .ic { width: 17px; height: 17px; }
.legal__hrow:hover .legal__a, .legal__a:focus-visible, .legal__sec:target .legal__a { opacity: 1; }
.legal__a:hover { color: var(--lilac); }
.legal__a:focus-visible { outline: 2px solid var(--lilac); outline-offset: -2px; }
@media (hover: none) { .legal__a { opacity: .6; } }
/* the section you jumped to: a lit edge mark and a frosted title */
.legal__sec:target .legal__hrow::before {
  content: ""; position: absolute; left: calc(1px - var(--px)); top: 0; bottom: 0; width: 3px;
  background: var(--lilac); box-shadow: 0 0 10px rgba(var(--lilac-rgb), .7);
}
.legal__sec:target .legal__h { color: var(--lilac-lighter); }

.legal__sec h3 { margin-top: 20px; font-family: "GoldenSmile", sans-serif; font-size: 14px; line-height: 20px; letter-spacing: 1px; color: var(--lilac-light); text-transform: uppercase; }
.legal__sec h3 + ul { margin-top: 9px; }
.legal__sec ul { list-style: none; margin-left: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.legal__sec ul > li { position: relative; padding-left: 22px; }
.legal__sec ul > li::before {
  content: ""; position: absolute; left: 4px; top: 10px; width: 6px; height: 6px; transform: rotate(45deg);
  background: var(--lilac); box-shadow: 0 0 6px rgba(var(--lilac-rgb), .45);
}
.legal__doc a:not(.legal__a) { color: var(--lilac); text-decoration: underline; text-decoration-color: rgba(var(--lilac-rgb), .45); text-underline-offset: 3px; }
.legal__doc a:not(.legal__a):hover { color: var(--lilac-lighter); text-decoration-color: currentColor; }

/* a gap the operator must fill in before launch */
.legal__todo {
  padding: 0 5px 1px; color: var(--gold); background: rgba(var(--gold-rgb), .1); border: 1px dashed rgba(var(--gold-rgb), .55);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
/* a promise the operator still has to confirm: the same mark, with the words in it (build_legal.py confirm()) */
.legal__todo--c { color: inherit; }
.legal__todo-k { font-size: .85em; letter-spacing: .3px; color: var(--gold); white-space: nowrap; }

/* AML tiers: three light plates in a row */
.legal__tiers { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.legal__tier { position: relative; isolation: isolate; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 13px 15px 15px; }
.legal__tier > .plate { --c: 11px; --n: 4px; --bt: rgba(var(--hi), .24); --bb: rgba(var(--lo), .56); --face: linear-gradient(170deg, #2A3344 0%, #222A38 100%); }
.legal__tier:nth-child(2) > .plate { --rim: rgba(var(--lilac-rgb), .3); }
.legal__tier:nth-child(3) > .plate { --rim: rgba(var(--gold-rgb), .38); }
.legal__tn { font-family: "GoldenSmile", sans-serif; font-size: 12px; line-height: 16px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.legal__tier:nth-child(2) .legal__tn { color: var(--lilac); }
.legal__tier:nth-child(3) .legal__tn { color: var(--gold); }
.legal__tt { font-family: "GoldenSmile", sans-serif; font-weight: 400; font-size: 15px; line-height: 20px; letter-spacing: .8px; color: var(--white); text-transform: uppercase; }
.legal__td { margin-top: 2px; font-size: 14px; line-height: 21px; color: var(--muted); }

.legal__end { font-family: "Skranji", sans-serif; font-size: 14px; line-height: 21px; letter-spacing: .3px; color: var(--muted); }

/* ---------------------------------------------------------------- narrow: one column, the contents fold above the text */
@container page (max-width: 900px) {
  .legal { grid-template-columns: minmax(0, 1fr); row-gap: 14px; }
  .legal__side { position: static; max-height: none; overflow: visible; }
  .legal__toc { display: none; }
  .legal__mtoc { display: block; }
  .legal__docs { padding: 0; }
  .legal__docs > .plate, .legal__docs > .kick, .legal__help { display: none; }
  .legal__docs .legal__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .legal__docs .legal__list a { justify-content: center; min-height: 44px; padding: 8px 10px 10px; }
  .legal__docs .legal__list a > .plate { display: block; --rim: var(--rim-iron); --bt: rgba(var(--hi), .3); --bb: rgba(var(--lo), .56); --face: var(--raised); }
  .legal__docs .legal__list a[aria-current="page"] > .plate {
    --rim: rgba(var(--lilac-rgb), .55); --bt: rgba(var(--lilac-rgb), .18);
    --face: linear-gradient(180deg, rgba(var(--lilac-rgb), .14) 0%, rgba(var(--lilac-rgb), .05) 100%), #1C2330;
  }
  .legal__tiers { grid-template-columns: minmax(0, 1fr); }
}
@container page (max-width: 600px) {
  .legal__dl { display: none; }
  .legal__ds { display: inline; }
  .legal__docs .legal__list a { gap: 7px; padding-inline: 6px; }
  .legal__doc { --px: 18px; padding: 22px var(--px) 22px; }
  .legal__short { padding: 14px 16px 14px; }
  .legal__short ul { grid-template-columns: minmax(0, 1fr); }
  .legal__sec { font-size: 15px; line-height: 24px; }
  .legal__sec ul > li::before { top: 9px; }
  .legal__h { gap: 11px; font-size: 17px; line-height: 23px; }
  .legal__sec + .legal__sec, .legal__end { margin-top: 24px; padding-top: 22px; }
}
/* touch screens: the section link is a 40px target; the heading keeps its height */
@media (pointer: coarse) {
  .legal__a { width: 40px; height: 40px; margin: -5px; }
}
