/*
 * The lead profile page (docs/queue/45-lead-profile.md): Roam's own neutral look, not an edition's brand. A warm off-white
 * page, near-black ink, one accent; one display face (Newsreader) for the name and the section titles, one text face
 * (Figtree) for everything else, tabular figures for every time and measurement; a strict scale of five sizes, an 8 px
 * spacing scale, hairline rules rather than boxes; a 12-column grid on a desktop and one column on a phone; the heat
 * ramp cool for brief and warm for long; designed for dark as well, and for print on one A4 page. The fonts are the
 * Charters edition's self-hosted Figtree and Newsreader (SIL Open Font License, the licences beside them).
 */
@font-face {
  font-family: 'Newsreader';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('/lead/fonts/newsreader-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Newsreader';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('/lead/fonts/newsreader-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Figtree';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('/lead/fonts/figtree-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Figtree';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('/lead/fonts/figtree-600.woff2') format('woff2');
}

:root {
  color-scheme: light dark;
  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-text: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* The scale: five sizes. */
  --fs-label: 0.75rem;
  --fs-text: 0.9375rem;
  --fs-lead: 1.125rem;
  --fs-title: 1.375rem;
  --fs-name: clamp(2.125rem, 1.5rem + 2.6vw, 3.25rem);
  --lh-text: 1.55;
  --lh-tight: 1.15;
  --track-label: 0.12em;
  /* The 8 px spacing scale. */
  --s1: 0.5rem;
  --s2: 1rem;
  --s3: 1.5rem;
  --s4: 2rem;
  --s5: 3rem;
  --s6: 4rem;
  --s7: 6rem;
  /* The page. */
  --page: #f6f2ec;
  --ink: #1b1a17;
  --muted: #645f57;
  --rule: #ddd6cb;
  --accent: #a0472a;
  --accent-ink: #ffffff;
  --sheet: #ffffff;
  /* The heat ramp, cool for brief to warm for long; the tap-only tint; the badge's tint per heat. */
  --heat-tap: #b9c4cc;
  --heat-1: #8fb0c6;
  --heat-2: #a9c0a4;
  --heat-3: #e0c070;
  --heat-4: #e0944f;
  --heat-5: #c4522f;
  --heat-fill: 0.5;
  --badge-hot: #c4522f;
  --badge-warm: #e0c070;
  --badge-cold: #8fb0c6;
  --badge-new: #ddd6cb;
  --badge-hot-ink: #ffffff;
  --badge-warm-ink: #1b1a17;
  --badge-cold-ink: #1b1a17;
  --badge-new-ink: #1b1a17;
  --measure: #1b1a17;
  --plan-dim: 1;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #1a1917;
    --ink: #f1ece3;
    --muted: #a7a095;
    --rule: #3a3731;
    --accent: #e3906d;
    --accent-ink: #1a1917;
    --sheet: #f1ece3;
    --heat-tap: #6c7880;
    --heat-1: #5f8aa8;
    --heat-2: #7f9c78;
    --heat-3: #d4af54;
    --heat-4: #dd8440;
    --heat-5: #d0583a;
    --heat-fill: 0.6;
    --badge-hot: #d0583a;
    --badge-warm: #d4af54;
    --badge-cold: #5f8aa8;
    --badge-new: #3a3731;
    --badge-hot-ink: #1a1917;
    --badge-warm-ink: #1a1917;
    --badge-cold-ink: #f1ece3;
    --badge-new-ink: #f1ece3;
    --measure: #1b1a17;
    --plan-dim: 0.92;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: var(--lh-text);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background: var(--page);
}

a {
  color: inherit;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: var(--accent);
}

h1,
h2,
p,
ol,
ul,
dl,
figure,
blockquote {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

.page {
  max-width: 72rem;
  margin: 0 auto;
  padding: var(--s5) var(--s3) var(--s5);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--s3);
  row-gap: var(--s5);
}

.page > * {
  grid-column: 1 / -1;
}

/* Section names: small, letterspaced, in the text face. */
.label {
  font-family: var(--font-text);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--s2);
}

.muted {
  color: var(--muted);
}

/* ---- Who: the name, the heat and how to reach them (docs/queue/55-lean-lead-profile.md) ---- */
.who {
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--rule);
}

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s2);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s2);
}

.eyebrow time {
  font-variant-numeric: tabular-nums;
}

.who-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--s1) var(--s3);
}

.name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-name);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
}

.heat {
  display: inline-block;
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  line-height: 1;
  padding: 0.55em 0.9em 0.5em;
  border-radius: 999px;
  background: var(--badge-new);
  color: var(--badge-new-ink);
  position: relative;
  top: -0.35em;
}

.heat-hot .heat {
  background: var(--badge-hot);
  color: var(--badge-hot-ink);
}

.heat-warm .heat {
  background: var(--badge-warm);
  color: var(--badge-warm-ink);
}

.heat-cold .heat {
  background: var(--badge-cold);
  color: var(--badge-cold-ink);
}

/* The email and the phone as links, under the name: large enough to read at a glance and to tap. */
.who-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s3);
  margin-top: var(--s1);
}

.contact-line {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-family: var(--font-display);
  font-size: var(--fs-title);
  line-height: 1.3;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.contact-line:hover {
  color: var(--accent);
}

/* What they asked for, and the time in the tour. */
.who-line {
  margin-top: var(--s1);
  font-size: var(--fs-text);
  color: var(--muted);
}

/* Their message, quoted in full. */
.message {
  margin-top: var(--s2);
  max-width: 48rem;
  font-family: var(--font-display);
  font-size: var(--fs-lead);
  line-height: 1.45;
  padding-left: var(--s2);
  border-left: 2px solid var(--accent);
  /* A message typed on several lines keeps them. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* One line where a section has nothing to show: "Did not go inside.", "Did not look round outside." */
.none {
  font-size: var(--fs-text);
  color: var(--muted);
}

/* ---- How to approach them ---- */
.approach {
  grid-column: 1 / span 8;
}

.approach-list {
  counter-reset: step;
  display: grid;
  row-gap: var(--s2);
}

.approach-list li {
  counter-increment: step;
  position: relative;
  padding-left: 2.25rem;
  font-size: var(--fs-lead);
  line-height: 1.45;
  text-wrap: pretty;
}

.approach-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: var(--fs-text);
  line-height: 1.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---- The plans as a heat map: the hero ---- */
/* One floor, or the plot alone, is no wider than it is with a second beside it. */
.plan,
.site {
  max-width: 34.5rem;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: var(--s3);
  align-items: start;
}

.plan .label {
  margin-bottom: var(--s1);
}

.sheet {
  position: relative;
  width: 100%;
  background: var(--sheet);
  border: 1px solid var(--rule);
  overflow: hidden;
}

.sheet img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  /* The drawing kept light so the shading reads. */
  opacity: 0.72;
  filter: grayscale(1) brightness(var(--plan-dim));
  mix-blend-mode: multiply;
}

.sheet .overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.room {
  fill: var(--heat-3);
  fill-opacity: var(--heat-fill);
  stroke: none;
}

.room.soft {
  fill-opacity: 1;
}

.heat-tap,
.heat-tap-stop {
  fill: var(--heat-tap);
  stop-color: var(--heat-tap);
}
.heat-1,
.heat-1-stop {
  fill: var(--heat-1);
  stop-color: var(--heat-1);
}
.heat-2,
.heat-2-stop {
  fill: var(--heat-2);
  stop-color: var(--heat-2);
}
.heat-3,
.heat-3-stop {
  fill: var(--heat-3);
  stop-color: var(--heat-3);
}
.heat-4,
.heat-4-stop {
  fill: var(--heat-4);
  stop-color: var(--heat-4);
}
.heat-5,
.heat-5-stop {
  fill: var(--heat-5);
  stop-color: var(--heat-5);
}

.room.heat-tap {
  fill-opacity: 0.35;
}

.measure line {
  stroke: var(--measure);
  stroke-width: 1.25px;
  vector-effect: non-scaling-stroke;
  stroke-linecap: butt;
}

.measure-point {
  fill: var(--measure);
}

.plan-time,
.plan-reading {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: var(--fs-label);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: #1b1a17;
  white-space: nowrap;
  pointer-events: none;
}

.plan-time {
  transform: translate(-50%, 0.55rem);
  background: rgba(255, 255, 255, 0.82);
  padding: 0.25em 0.45em 0.2em;
  border-radius: 2px;
}

.plan-time-tap {
  font-weight: 400;
  color: #645f57;
}

.plan-reading {
  transform: translate(-50%, calc(-50% - 0.7rem));
  background: #1b1a17;
  color: #f6f2ec;
  padding: 0.3em 0.5em 0.25em;
  border-radius: 2px;
}

.key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1) var(--s2);
  margin-top: var(--s2);
  font-size: var(--fs-label);
  color: var(--muted);
  letter-spacing: 0.02em;
}

.key-ramp {
  display: inline-flex;
  height: 0.6rem;
  width: 6rem;
}

.key-ramp i {
  flex: 1;
  display: block;
  opacity: 0.8;
}

.key-ramp .heat-1 {
  background: var(--heat-1);
}
.key-ramp .heat-2 {
  background: var(--heat-2);
}
.key-ramp .heat-3 {
  background: var(--heat-3);
}
.key-ramp .heat-4 {
  background: var(--heat-4);
}
.key-ramp .heat-5 {
  background: var(--heat-5);
}

.key-line {
  display: inline-block;
  width: 1.5rem;
  height: 0;
  border-top: 1.25px solid var(--ink);
  vertical-align: middle;
  margin: 0 0.2em;
  position: relative;
}

.key-line::before,
.key-line::after {
  content: '';
  position: absolute;
  top: -0.3rem;
  width: 0;
  height: 0.6rem;
  border-left: 1.25px solid var(--ink);
}

.key-line::before {
  left: 0;
}

.key-line::after {
  right: 0;
}

.key-note {
  flex-basis: 100%;
}

/* The finish photos opened in a room (queue job 54): one quiet line under the floor's plan, the room's name then what was opened. */
.plan-finishes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15em 0.6em;
  margin: 0.55rem 0 0;
  font-size: var(--fs-label);
  line-height: 1.35;
}

.plan-finishes-room {
  font-weight: 600;
}

.plan-finishes-loose {
  margin-top: var(--s2);
}

/* ---- Outside: the plot from above, in the plans' language ---- */
/* A photograph, not a drawing: kept in colour, quietened so the discs read. */
.site-sheet img {
  opacity: 1;
  filter: saturate(0.7) brightness(var(--plan-dim));
  mix-blend-mode: normal;
}

.spot {
  stroke: none;
}

.spot-point {
  fill: #ffffff;
  stroke: #1b1a17;
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}

.site-label {
  position: absolute;
  transform: translate(0.7rem, -50%);
  font-size: var(--fs-label);
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: #1b1a17;
  background: rgba(255, 255, 255, 0.86);
  padding: 0.3em 0.5em 0.25em;
  border-radius: 2px;
  white-space: nowrap;
  pointer-events: none;
}

.site-label b {
  font-weight: 600;
}

.site-label-left {
  transform: translate(calc(-100% - 0.7rem), -50%);
}

.site-label-tap {
  color: #645f57;
}

.site-north {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--track-label);
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
  padding-top: 0.75rem;
}

.site-north::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 0;
  height: 0.6rem;
  border-left: 1.25px solid #ffffff;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.7));
}

/* The places no picture shows: the name and the time, as a disc's label has them. */
.outside-list {
  display: grid;
  max-width: 34.5rem;
  margin-top: var(--s1);
}

.outside-list li {
  padding: var(--s1) 0;
  border-bottom: 1px solid var(--rule);
  font-size: var(--fs-text);
  font-variant-numeric: tabular-nums;
}

.outside-list b {
  font-weight: 600;
}

.outside-sun {
  display: flex;
  gap: var(--s1);
  align-items: flex-start;
  font-size: var(--fs-text);
  padding: var(--s1) 0;
}

.sun-mark {
  flex: none;
  width: 1rem;
  height: 1rem;
  margin-top: 0.3em;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.25;
  stroke-linecap: round;
}

/* ---- Their answers: only the questions answered ---- */
.answers {
  grid-column: 1 / span 6;
}

.answers dl {
  display: grid;
  row-gap: var(--s1);
}

.answers dl > div {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: var(--s1);
  padding: var(--s1) 0;
  border-bottom: 1px solid var(--rule);
  font-size: var(--fs-text);
}

.answers dl > div:last-child {
  border-bottom: 0;
}

.answers dt {
  color: var(--muted);
}

.answers dd {
  margin: 0;
}

/* ---- The footer ---- */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s1) var(--s3);
  padding-top: var(--s2);
  border-top: 1px solid var(--rule);
  font-size: var(--fs-label);
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* ---- Phones: one column ---- */
@media (max-width: 47.9rem) {
  .page {
    padding: var(--s4) var(--s2) var(--s4);
    row-gap: var(--s4);
    column-gap: 0;
  }

  .approach,
  .answers {
    grid-column: 1 / -1;
  }

  .who-contact {
    flex-direction: column;
  }

  .approach-list li {
    font-size: var(--fs-text);
    line-height: 1.5;
    padding-left: 2rem;
  }

  .approach-list li::before {
    width: 1.375rem;
    height: 1.375rem;
    line-height: 1.375rem;
    font-size: var(--fs-label);
  }

  .plans-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Print: one A4 page in the screen's order, the plans side by side and small, the ink black on white ---- */
@media print {
  @page {
    size: A4;
    margin: 12mm 14mm;
  }

  :root {
    --page: #ffffff;
    --ink: #000000;
    --muted: #444444;
    --rule: #bbbbbb;
    --accent: #000000;
    --sheet: #ffffff;
    --heat-fill: 0.55;
    --fs-text: 8.5pt;
    --fs-lead: 9.5pt;
    --fs-label: 6.5pt;
    --fs-title: 11pt;
    --fs-name: 20pt;
    --lh-text: 1.35;
    --s5: 4mm;
    --s4: 3.5mm;
    --s3: 2.5mm;
    --s2: 1.8mm;
    --s1: 1mm;
  }

  html {
    font-size: 10px;
  }

  .page {
    max-width: none;
    padding: 0;
    row-gap: var(--s2);
  }

  .who {
    padding-bottom: var(--s2);
  }

  .approach {
    grid-column: 1 / -1;
  }

  .approach-list {
    row-gap: var(--s1);
  }

  .approach-list li {
    font-size: var(--fs-lead);
    line-height: 1.3;
    padding-left: 1.8rem;
  }

  .approach-list li::before {
    width: 1.3rem;
    height: 1.3rem;
    line-height: 1.3rem;
    font-size: var(--fs-label);
  }

  .plans {
    grid-column: 1 / -1;
  }

  .plans-grid {
    grid-template-columns: repeat(2, minmax(0, 56mm));
    justify-content: start;
    gap: 6mm;
  }

  .plan-time,
  .plan-reading,
  .site-label {
    font-size: 5.5pt;
  }

  /* The plot at the size of a floor's plan. */
  .plan,
  .site {
    max-width: 56mm;
  }

  .outside-list li,
  .outside-sun {
    padding: 0.5mm 0;
  }

  .site-sheet img {
    filter: saturate(0.7);
  }

  .sheet img {
    opacity: 0.8;
    filter: grayscale(1);
  }

  .key {
    margin-top: var(--s1);
  }

  /* A4's printable width is under the phone rule's width, so the desktop column is set again here. */
  .answers {
    grid-column: 1 / span 6;
  }

  .answers dl {
    row-gap: 0;
  }

  .answers dl > div {
    padding: 0.6mm 0;
    grid-template-columns: 4.5rem 1fr;
  }

  .who-contact {
    flex-direction: row;
    margin-top: 0;
  }

  .contact-line {
    min-height: 0;
    font-size: var(--fs-title);
  }

  .message {
    font-size: var(--fs-lead);
    margin-top: var(--s1);
    max-width: none;
  }

  .who-line {
    margin-top: 0;
  }

  .plan,
  .outside,
  .approach,
  .answers {
    break-inside: avoid;
  }

  .heat {
    border: 1px solid #000;
    background: none !important;
    color: #000 !important;
  }

  a {
    text-decoration: none;
  }

  .message {
    border-left-color: #000;
  }

  .foot {
    padding-top: var(--s1);
  }
}

/* ---- The privacy notice (docs/queue/63-consent-and-privacy.md 1): the same look, one reading column ---- */
.notice .page {
  row-gap: var(--s4);
}

.notice-head {
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--rule);
}

.notice-head .name {
  max-width: 24ch;
  text-wrap: balance;
}

.notice-section {
  grid-column: 1 / span 8;
  max-width: 44rem;
}

.notice-section p,
.notice-section li {
  font-size: var(--fs-text);
  line-height: var(--lh-text);
  text-wrap: pretty;
}

.notice-section p + p,
.notice-section ul,
.notice-section ul + p {
  margin-top: var(--s2);
}

.notice-section ul {
  padding-left: 1.25rem;
  list-style: disc;
}

.notice-section li + li {
  margin-top: var(--s1);
}

.notice-section q {
  font-family: var(--font-display);
  font-size: var(--fs-lead);
  quotes: '\201C' '\201D';
}

.notice-section code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.875em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* A fact still to be filled in site.json: unmistakable on the page, in light and in dark. */
.placeholder {
  background: var(--heat-3);
  color: var(--badge-warm-ink);
  padding: 0.05em 0.35em;
  border-radius: 0.25em;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.placeholder-note {
  margin-top: var(--s2);
  padding: var(--s1) var(--s2);
  border-left: 2px solid var(--heat-3);
  font-size: var(--fs-text);
  color: var(--muted);
}

@media (max-width: 47.9rem) {
  .notice-section {
    grid-column: 1 / -1;
  }
}

@media print {
  .notice-section {
    break-inside: avoid;
  }
}
