/* personalizedainews.com: a technical explainer set like a drawing sheet.
   Drafting paper, Prussian-blue ink, one vermilion for the stories and the
   call to action. Sources sit in the margin; figures sit on gridded plates. */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --desk: #dfe3dc;
  --paper: #f4f5f0;
  --plate: #fcfcf9;
  --ink: #12233f;
  --ink-2: #3d4a63;
  --ink-3: #55627a;
  --line: rgba(18, 35, 63, 0.16);
  --blue: #1b3f9e;
  --accent: #d4411e;
  --accent-dark: #b5330f;
  --hi: #f4df7a;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --measure: 640px;
  --gut: 16px;
  --pad: 16px;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
  --grid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath d='M16 .5H.5V16' fill='none' stroke='%2312233f' stroke-opacity='.07'/%3E%3C/svg%3E");
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--desk);
  scrollbar-color: var(--ink) var(--desk);
}

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
  caret-color: var(--accent);
}

::selection { background: var(--hi); color: var(--ink); }

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 150ms var(--ease);
}
a:hover { color: var(--accent-dark); }

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

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 2;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
}
.skip:focus { top: 8px; color: var(--paper); }

/* The sheet: paper on a desk, with a ruled border on wide screens. */

.sheet {
  max-width: 1280px;
  margin: 0 auto;
  background: var(--paper);
}

/* Masthead: the title block of the drawing, in ruled cells. */

.mast {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  border-bottom: 1.5px solid var(--ink);
}

.site-name {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 var(--pad);
  font-family: var(--cond);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}
.site-name:hover { color: var(--accent-dark); }

.by {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 var(--pad);
  border-left: 1px solid var(--ink);
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
}
.by:hover { color: var(--accent-dark); }
.ulsa-mark { display: block; }

.chapters {
  flex: 1 0 100%;
  display: grid;
  grid-template-columns: repeat(3, auto);
  border-top: 1px solid var(--ink);
}
.chapters a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 10px;
  font-family: var(--cond);
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.chapters a + a { border-left: 1px solid var(--ink); }
.chapters a:hover { background: var(--plate); color: var(--accent-dark); }
.chapters a[aria-current="page"] { background: var(--ink); color: var(--paper); }

main { padding: 40px var(--pad) 0 var(--gut); }

/* Reading text and its margin. */

.col > *,
.terms dl,
.page > .aside-note { max-width: var(--measure); }
.margin { max-width: var(--measure); }

h1, h2, h3, h4 { margin: 0; font-family: var(--cond); font-weight: 600; text-wrap: balance; }

h1 {
  font-size: clamp(42px, 7.4vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  max-width: 24ch;
  margin-bottom: 28px;
}

/* Section opener: a full-width sheet rule, then the heading. */
h2 {
  font-size: clamp(30px, 4.4vw, 40px);
  line-height: 1.08;
  margin: 64px calc(var(--pad) * -1) 20px calc(var(--gut) * -1);
  padding: 20px var(--pad) 0 var(--gut);
  border-top: 1.5px solid var(--ink);
}
h3 { font-size: 26px; line-height: 1.15; margin: 0 0 12px; }
h4 { font-size: 21px; line-height: 1.2; margin: 24px 0 8px; }

p { margin: 0 0 16px; }
ul { margin: 0 0 16px; padding-left: 22px; }
li { margin-bottom: 6px; }

.lead p { font-size: 20px; line-height: 1.5; }
.lead p + p { font-size: 17px; line-height: 1.6; color: var(--ink-2); }

.stamp {
  font-size: 15px;
  color: var(--ink-2);
  padding: 10px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}

.disclosure { font-size: 15.5px; line-height: 1.55; color: var(--ink-2); }

.src {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-3);
}
p.src {
  margin: 4px 0 20px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
span.src { display: block; margin-top: 8px; }

.aside-note { font-size: 16px; color: var(--ink-2); }

/* Figures: a gridded plate, then a ruled caption strip. */

.diagram { margin: 28px 0 32px; padding: 0; }
.plate {
  padding: 24px 12px 20px;
  border: 1.5px solid var(--ink);
  background: var(--plate) var(--grid);
}
.dia { display: block; width: 100%; height: auto; }
.dia-wide { display: none; }
.dia-narrow { max-width: 440px; margin: 0 auto; }

.diagram figcaption {
  display: grid;
  border: 1.5px solid var(--ink);
  border-top: 0;
  background: var(--paper);
}
.fig-title {
  padding: 10px 14px;
  font-family: var(--cond);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  border-bottom: 1px solid var(--ink);
}
.fig-note { padding: 10px 14px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }

.parts { margin: 0 0 40px; }
.parts h3,
.parts h4 { font-size: 22px; margin: 0 0 4px; }
.parts dl { display: grid; margin: 0; }
.parts dl > div { padding: 12px 0; border-top: 1px solid var(--line); }
.parts dt { font-weight: 600; display: flex; align-items: baseline; gap: 10px; }
.parts dd { margin: 2px 0 0; font-size: 16px; color: var(--ink-2); }

/* Reference letters match the ones lettered on the figure. */
.letter {
  flex: none;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.92em;
  color: var(--accent-dark);
}

/* Evidence and rights */

.finding,
.law { border-top: 1px solid var(--line); padding-top: 28px; margin-top: 20px; }

blockquote {
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--plate);
  font-size: 16px;
}
blockquote p { margin: 0; }
.clause:first-child h4 { margin-top: 0; }

/* How it works */

.step h2 { display: flex; align-items: baseline; gap: 14px; }

.terms dl { margin: 0; }
.terms dl > div { padding: 16px 0; border-top: 1px solid var(--line); }
.terms dt { font-family: var(--cond); font-weight: 600; font-size: 22px; }
.terms dd { margin: 4px 0 0; }

/* Checklist */

.questions { list-style: none; margin: 0; padding: 0; }
.questions > li { margin: 0; }
.lead-note { margin-top: 28px; }

.answer { margin: 0 0 40px; max-width: 880px; }
.answer > div { padding: 12px 0; border-top: 1px solid var(--line); }
.answer > div:first-child { border-top: 0; padding-top: 0; }
.answer dt { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.answer dd { margin: 2px 0 0; }
.answer .own {
  margin-top: 8px;
  padding: 14px 16px;
  border: 1.5px solid var(--ink);
  background: var(--plate);
}
.answer .own dt { color: var(--ink); }

/* Privacy label table: restacks on phones, scrolls in its own box when tight. */

.labels { margin: 0 0 40px; padding: 0; }
.labels .scroll { overflow-x: auto; scrollbar-color: var(--ink) var(--paper); }
.labels table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.labels caption {
  text-align: left;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
  padding-bottom: 12px;
}
.labels th,
.labels td { text-align: left; vertical-align: top; padding: 12px 16px 12px 0; border-top: 1px solid var(--line); }
.labels thead th { font-weight: 600; border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--ink); }
.labels tbody th { font-weight: 600; font-size: 16px; min-width: 140px; }
.labels tbody tr:last-child > * { border-bottom: 1.5px solid var(--ink); }
.labels .dev { display: block; font-weight: 400; font-size: 14px; color: var(--ink-3); }
.labels figcaption { margin-top: 14px; max-width: var(--measure); font-size: 14.5px; line-height: 1.5; color: var(--ink-3); }
@media (max-width: 759px) {
  .labels thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .labels tr,
  .labels tbody th,
  .labels td { display: block; }
  .labels tbody tr { padding: 16px 0; border-top: 1px solid var(--ink); }
  .labels tbody th,
  .labels td,
  .labels tbody tr:last-child > * { border: 0; padding: 0 0 8px; }
  .labels td::before { content: attr(data-label); display: block; font-weight: 600; font-size: 14px; color: var(--ink-2); }
}

/* The one call to action: the sheet's closing block, in reversed ink. */

.ulsa {
  margin: 72px calc(var(--pad) * -1) 0 calc(var(--gut) * -1);
  padding: 32px var(--pad) 36px var(--gut);
  background: var(--ink);
  color: var(--paper);
}
.ulsa ::selection { background: var(--accent); color: #fff; }
.ulsa h2 { margin: 0 0 12px; padding: 0; border: 0; font-size: 30px; }
.ulsa p { max-width: var(--measure); }
.ulsa .note { font-size: 16px; color: #c5cbd6; }
.ulsa .go { margin: 20px 0 0; }

.btn {
  display: inline-block;
  padding: 11px 22px;
  background: var(--accent-dark);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 150ms var(--ease);
}
.btn:hover { background: var(--accent); color: #fff; }
.btn:focus-visible { outline-color: var(--paper); }

/* Footer: ruled cells, like the bottom strip of the sheet. */

.foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-size: 14.5px;
  color: var(--ink-2);
  border-top: 1.5px solid var(--ink);
}
.foot p { margin: 0; padding: 14px var(--pad); border-bottom: 1px solid var(--line); }
.foot p:nth-child(even) { border-left: 1px solid var(--line); }
.foot p:nth-child(-n + 2) { grid-column: 1 / -1; border-left: 0; }

@media (min-width: 760px) {
  :root { --pad: 32px; --gut: 32px; }
  .chapters { flex: 0 0 auto; display: flex; border-top: 0; }
  .chapters a { min-height: 56px; padding: 0 22px; border-left: 1px solid var(--ink); }
  .site-name { font-size: 28px; }
  .by { padding: 0 22px; }
  .diagram figcaption { grid-template-columns: minmax(200px, 1fr) 2.4fr; }
  .fig-title { border-bottom: 0; border-right: 1px solid var(--ink); }
  .parts dl { grid-template-columns: 1fr 1fr; column-gap: 40px; }
  .answer > div { display: grid; grid-template-columns: 168px 1fr; gap: 24px; }
  .answer dt { padding-top: 2px; }
  .answer dd { margin: 0; }
  .answer .own { margin-left: -16px; margin-right: -16px; }
  .foot { grid-template-columns: 1.6fr 1.2fr auto auto; }
  .foot p,
  .foot p:nth-child(-n + 2) { grid-column: auto; border-bottom: 0; border-left: 1px solid var(--line); }
  .foot p:first-child { border-left: 0; }
}

/* Wide: a left gutter for reference letters, sources in the right margin,
   and the wide drawings. */
@media (min-width: 1100px) {
  :root { --pad: 48px; --gut: 88px; }
  .sheet { margin: 20px auto; border: 1.5px solid var(--ink); }
  .site-name { padding-left: 88px; }
  main { padding-top: 52px; }
  .intro + section > h2 { margin-top: 44px; }
  .answer { display: grid; grid-template-columns: minmax(0, 1fr) 400px; column-gap: 56px; align-items: start; max-width: none; }
  .answer > div { grid-column: 1; }
  .answer .own { display: block; grid-column: 2; grid-row: 1 / span 3; margin: 0; }
  .answer .own dt { margin-bottom: 6px; }
  .run {
    display: grid;
    grid-template-columns: minmax(0, var(--measure)) minmax(0, 1fr);
    column-gap: 72px;
    align-items: start;
  }
  .margin { max-width: 360px; }
  .margin p.src { margin-top: 6px; }
  .dia-wide { display: block; }
  .dia-narrow { display: none; }
  .parts-3 dl { grid-template-columns: repeat(3, 1fr); }
  .terms dl { max-width: none; display: grid; grid-template-columns: 1fr 1fr; column-gap: 72px; }
  /* Short pages: side heads in the left column, text beside them. */
  .utility > section {
    display: grid;
    grid-template-columns: 300px minmax(0, var(--measure));
    column-gap: 72px;
    margin: 48px calc(var(--pad) * -1) 0 calc(var(--gut) * -1);
    padding: 24px var(--pad) 8px var(--gut);
    border-top: 1.5px solid var(--ink);
  }
  .utility > section > h2 { margin: 0; padding: 0; border: 0; font-size: 34px; }
  .utility > section .run { display: block; }
  .step h2 .letter { width: 74px; margin-left: -88px; text-align: right; }
  .ulsa {
    display: grid;
    grid-template-columns: minmax(0, var(--measure)) auto;
    column-gap: 72px;
    align-items: end;
  }
  .ulsa h2 { grid-column: 1 / -1; }
  .ulsa .ulsa-body p:last-child { margin-bottom: 0; }
  .ulsa .go { margin: 0; }
  .foot p:first-child { padding-left: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* AI disclosure line (added by the build) sits in the footer strip like the other cells */
.foot .ai-note { margin: 0 !important; padding: 14px var(--pad); border-left: 0; }
