/*
 * The look of One Take's privacy policy, terms and support pages: the website's (I's look), drawn
 * for reading. The colours, the type, the radii and the spacing are the website's own values,
 * copied here from apps/app/src/web (base.css, site-nav.css, brand.css): the site imports nothing
 * from the app. The white bar with the 1 mark and pill links, the indigo band with the page's
 * heading, the grey sheet that rides up over it, and the words on a white tile.
 *
 * System fonts only, as the website's words are; nothing is fetched but this file. The website
 * draws its 1 mark in Overpass ExtraBold and, until that loads, in the system's font at 800: the
 * mark here is that second one.
 *
 * A gap in square brackets and a draft line are marked in red, so a look at a page shows each
 * one: the gate (scripts/check-live.mjs) lets no page go live with either, so the marks are for
 * the people filling them, never for a reader.
 */

:root {
  color-scheme: light;

  /* Colours, by the website's names (base.css). */
  --ot-indigo: #5856D6;
  /* A link under the cursor. */
  --ot-deep: #3634A3;
  /* The text selection. */
  --ot-halo: #D5D5F5;
  /* The current page's link. */
  --ot-soft: #EEEEFB;
  --ot-ground: #F2F2F7;
  --ot-card: #FFFFFF;
  --ot-label: #000000;
  --ot-secondary: #6C6C70;
  /* Hairlines, and the ring round the bar. */
  --ot-track: #E5E5EA;
  --ot-red: #D70015;

  --ot-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;

  --ot-radius-nav: 10px;
  --ot-radius-button: 12px;
  --ot-radius-tile: 16px;
  --ot-radius-sheet: 28px;

  /* The bar's inset from each side, and the page's margins. */
  --ot-gutter: calc(6.25vw + 18.75px);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* A page shorter than the window still fills it, its foot at the bottom. */
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--ot-ground);
  color: var(--ot-label);
  font-family: var(--ot-font);
  font-size: 17px;
  line-height: 26px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  /* An address or a long word breaks rather than run off a narrow page. */
  overflow-wrap: break-word;
}

::selection {
  background: var(--ot-halo);
  color: var(--ot-label);
}

:focus-visible {
  outline: 2px solid var(--ot-indigo);
  outline-offset: 3px;
}

/* A link in a page's words: indigo and underlined, so it isn't told by its colour alone. */
a {
  color: var(--ot-indigo);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ot-deep);
}

/* ---- The bar: the 1 mark, "One Take" and the four pages (site-nav.css) ---- */

/* The band's indigo starts at the top of the page, behind the bar. */
.top {
  background: var(--ot-indigo);
  padding: 17px var(--ot-gutter) 0;
}

/* 68 px tall with its links beside the name. Where they don't fit, they go under it, in rows. */
.bar {
  box-sizing: border-box;
  min-height: 68px;
  padding: 12px 10.625px 12px 17px;
  border-radius: var(--ot-radius-nav);
  background: #FFFFFF;
  box-shadow: inset 0 0 0 1px var(--ot-track);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 20px;
}

.logo {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

a.logo,
a.logo:hover {
  color: #000000;
}

.mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--ot-indigo);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  line-height: 1;
  font-weight: 800;
}

.mark::before {
  content: "1";
}

.name {
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.01em;
}

.links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4.25px;
}

/* The pill links, as the website's bar draws them: in a bar of links, they aren't underlined. */
.links a {
  min-height: 44px;
  padding: 0 15px;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  font-size: 17px;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
}

.links a,
.links a:hover {
  color: #000000;
}

.links a:hover {
  background: var(--ot-ground);
}

/* The open page's link is tinted. */
.links a[aria-current="page"],
.links a[aria-current="page"]:hover {
  background: var(--ot-soft);
  color: var(--ot-indigo);
  font-weight: 600;
}

/* ---- The page: band, sheet, tile (brand.css) ---- */

main {
  flex: 1 0 auto;
}

.in {
  margin: 0 var(--ot-gutter);
}

.band {
  background: var(--ot-indigo);
  color: #FFFFFF;
  padding: 65px 0 92px;
}

/* On the indigo band the focus ring is white. */
.band :focus-visible {
  outline-color: #FFFFFF;
}

.band a,
.band a:hover {
  color: #FFFFFF;
}

h1 {
  margin: 0;
  font-size: 64px;
  line-height: 68px;
  font-weight: 700;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.sheet {
  position: relative;
  margin-top: -36px;
  padding: 44px 0 64px;
  border-radius: var(--ot-radius-sheet) var(--ot-radius-sheet) 0 0;
  background: var(--ot-ground);
}

/* The words: a white tile, 600 px of text at most, about 75 characters a line. */
.doc {
  box-sizing: border-box;
  width: min(680px, 100%);
  margin: 0 auto;
  padding: 40px;
  border-radius: var(--ot-radius-tile);
  background: var(--ot-card);
}

.doc > :first-child {
  margin-top: 0;
}

.doc > :last-child {
  margin-bottom: 0;
}

.doc p,
.doc ul,
.doc .table-box {
  margin: 0 0 16px;
}

.doc h2 {
  margin: 44px 0 12px;
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.doc h3 {
  margin: 28px 0 8px;
  font-size: 20px;
  line-height: 25px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.doc ul {
  padding: 0 0 0 22px;
}

.doc li {
  margin: 0 0 8px;
  padding-left: 2px;
}

.doc li:last-child {
  margin-bottom: 0;
}

.doc strong {
  font-weight: 600;
}

/* ---- The table: where the page is narrower than it, it scrolls inside its own box ---- */

/* While there is more of the table past an edge of its box, that edge is shaded: a shadow that stays at the box's edge,
   and a strip of the tile's white that rides at each end of the table and covers the shadow once that end is in view.
   A table that fits shows neither. */
.table-box {
  overflow-x: auto;
  border: 1px solid var(--ot-track);
  border-radius: var(--ot-radius-button);
  background:
    linear-gradient(to right, var(--ot-card) 40%, rgba(255, 255, 255, 0)) left center / 40px 100% no-repeat local,
    linear-gradient(to left, var(--ot-card) 40%, rgba(255, 255, 255, 0)) right center / 40px 100% no-repeat local,
    linear-gradient(to right, rgba(0, 0, 0, .14), rgba(0, 0, 0, 0)) left center / 14px 100% no-repeat scroll,
    linear-gradient(to left, rgba(0, 0, 0, .14), rgba(0, 0, 0, 0)) right center / 14px 100% no-repeat scroll;
}

.table-box:focus-visible {
  outline-offset: 2px;
}

table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 20px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ot-track);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--ot-ground);
  font-weight: 600;
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* ---- What a page doesn't say yet: a gap in square brackets, and a draft line ---- */

.gap {
  padding: 1px 3px;
  border-radius: 4px;
  background: rgba(215, 0, 21, .07);
  box-shadow: inset 0 0 0 1px rgba(215, 0, 21, .45);
  color: var(--ot-red);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.doc p.draft {
  padding: 10px 14px;
  border: 2px dashed var(--ot-red);
  border-radius: var(--ot-radius-button);
  color: var(--ot-red);
  font-weight: 600;
}

/* ---- The foot: who runs One Take, and the support address ---- */

.foot {
  padding: 0 var(--ot-gutter) 56px;
  text-align: center;
  font-size: 15px;
  line-height: 20px;
  color: var(--ot-secondary);
}

.foot p {
  margin: 0;
}

.foot p + p {
  margin-top: 4px;
}

/* ---- Widths ---- */

/* Below 1000 px the heading steps down, as the website's does. */
@media (max-width: 999px) {
  h1 {
    font-size: 44px;
    line-height: 48px;
  }

  .band {
    padding-top: 43px;
  }
}

/* Below 760 px the table is wider than its box: its headings lose their grey, which would hide the edge's shade. */
@media (max-width: 759px) {
  th {
    background: none;
  }
}

/* On a phone the margins give the words the room: 16 px a side, and the tile 20 px inside. */
@media (max-width: 599px) {
  :root {
    --ot-gutter: 16px;
  }

  h1 {
    font-size: 36px;
    line-height: 40px;
  }

  .band {
    padding: 32px 0 76px;
  }

  .sheet {
    padding-top: 16px;
  }

  .doc {
    padding: 24px 20px;
  }

  .doc h2 {
    margin-top: 36px;
    font-size: 24px;
    line-height: 30px;
  }
}

/* ---- On paper: the words alone, without the bar, the band's colour or the foot ---- */

@media print {
  .top,
  .foot {
    display: none;
  }

  body {
    display: block;
    min-height: 0;
    background: none;
    font-size: 11pt;
    line-height: 1.45;
  }

  .in {
    margin: 0;
  }

  .band {
    padding: 0 0 14pt;
    background: none;
    color: #000000;
  }

  h1 {
    font-size: 22pt;
    line-height: 1.2;
  }

  .sheet {
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: none;
  }

  .doc {
    width: auto;
    padding: 0;
    border-radius: 0;
  }

  .doc h2 {
    font-size: 15pt;
    line-height: 1.25;
    break-after: avoid;
  }

  .doc h3 {
    font-size: 12pt;
    line-height: 1.3;
    break-after: avoid;
  }

  .doc li,
  tr {
    break-inside: avoid;
  }

  a,
  a:hover {
    color: inherit;
  }

  .table-box {
    overflow: visible;
    background: none;
  }

  table {
    min-width: 0;
    font-size: 9.5pt;
    line-height: 1.35;
  }
}
