/* The "See how close you are to history" guide (/uses/living-memory). Built like the obituary column of a life: white paper, black ink,
   Libre Caslon for names and stories, the site's sans for dates and sources, hairline rules. Each colour has one job: red is
   always the life being followed (the year, "You turned 33", the line down the page), and slate blue is always a moment
   in history on a timeline (a war, a day). Portraits are square and
   black and white; a notice without one is normal in a newspaper. Text meets 4.5:1. */
@font-face { font-family: "Libre Caslon Text"; src: url("/fonts/libre-caslon-text-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Libre Caslon Text"; src: url("/fonts/libre-caslon-text-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Libre Caslon Text"; src: url("/fonts/libre-caslon-text-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

.lm-guide {
    --lm-ink: #171615;
    --lm-soft: #57534d;
    --lm-faint: #6b665f;
    --lm-rule: #dcd9d3;
    --lm-you: #a3211b;
    /* History has its own colour, so red means only you. Checked apart from the red for colour-blind readers, 6.9:1 as text. */
    --lm-past: #2b5d8a;
    --lm-serif: "Libre Caslon Text", "Times New Roman", serif;
    color: var(--lm-ink);
}
.lm-guide :is(.lm-opening, [data-life-slot], .lm-family, .lm-how) a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.lm-guide :is([data-life-slot], .lm-how) img { display: block; max-width: 100%; }
.lm-guide figure { margin: 0; }
.lm-guide :is(section, header)[id] { scroll-margin-top: 72px; }
/* The year's part of the page is replaced in place; the script keeps the reader's place, so the browser must not also try. */
.lm-guide [data-life-slot] { overflow-anchor: none; }
.lm-guide details { border: 0; padding: 0; }
.lm-guide details p { margin: 0; }

/* ---- The opening ---- */
.lm-opening { padding: 22px 0 0; }
.lm-kicker { margin: 0 0 12px; font-family: var(--lm-serif); font-style: italic; font-size: 1.25rem; color: var(--lm-soft); }
.lm-opening h1 { max-width: 920px; margin: 0; font-family: var(--lm-serif); font-weight: 400; font-size: clamp(2.3rem, 5.2vw, 3.65rem); line-height: 1.12; letter-spacing: -.01em; }
.lm-q { white-space: nowrap; }
.lm-pick { position: relative; display: inline-block; }
.lm-pick select { width: 3.6em; min-height: 1.3em; font: inherit; color: var(--lm-you); background: transparent; border: 0; border-bottom: 3px solid var(--lm-you); appearance: none; -webkit-appearance: none; padding: 0 1.05em 0 .05em; margin: 0; cursor: pointer; border-radius: 0; line-height: 1.1; }
.lm-pick select:focus-visible { outline: 3px solid var(--lm-ink); outline-offset: 4px; }
.lm-pick svg { position: absolute; right: .08em; top: 50%; width: .62em; height: .62em; margin-top: -.3em; pointer-events: none; color: var(--lm-you); }
.lm-pick-hint { margin: 12px 0 0; font-size: .95rem; color: var(--lm-soft); }
.lm-btn { margin-top: 12px; padding: 10px 18px; border: 0; background: var(--lm-you); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }

.lm-life { padding: 0 0 40px; border-bottom: 4px double var(--lm-ink); }
.lm-hint { max-width: 660px; margin: 14px 0 0; font-size: 1.05rem; color: var(--lm-soft); }
.lm-hint strong { color: var(--lm-you); font-weight: 600; }
.lm-faces { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; max-width: 980px; margin: 10px 0 0; padding: 0; }
.lm-faces img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; filter: grayscale(1) contrast(1.04); border: 1px solid var(--lm-ink); }
.lm-faces b { display: block; margin-top: 8px; font-family: var(--lm-serif); font-weight: 400; font-size: 1.05rem; line-height: 1.25; }
.lm-faces span { display: block; font-size: .82rem; color: var(--lm-soft); line-height: 1.35; }
.lm-faces-cap { margin: 26px 0 0; font-family: var(--lm-serif); font-style: italic; font-size: 1.1rem; color: var(--lm-soft); }
.lm-next { max-width: 760px; margin: 26px 0 0; font-size: 1.05rem; color: var(--lm-soft); }
.lm-lede { max-width: 760px; margin: 26px 0 0; font-family: var(--lm-serif); font-size: 1.35rem; line-height: 1.5; }

/* ---- The bar that follows the reader ---- */
/* Fixed over the page rather than in it, so it takes no space and nothing moves when it appears. */
.lm-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 10px max(16px, calc((100vw - 1160px) / 2)); background: #fff; border-bottom: 1px solid var(--lm-ink); font-size: .95rem; box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
.lm-bar[hidden] { display: none; }
.lm-bar.lm-bar-off { visibility: hidden; }
.lm-bar label { font-family: var(--lm-serif); font-size: 1.25rem; }
.lm-pick-small { font-family: var(--lm-serif); font-size: 1.25rem; }
.lm-pick-small select { border-bottom-width: 2px; }
.lm-bar-note { color: var(--lm-soft); }

/* ---- Sections ---- */
.lm-sec { padding: 54px 0 6px; }
.lm-guide :is(.lm-sec, .lm-family, .lm-how) h2 { max-width: 820px; margin: 0 0 12px; font-family: var(--lm-serif); font-weight: 400; font-size: clamp(1.9rem, 3.6vw, 2.5rem); line-height: 1.15; letter-spacing: -.005em; }
.lm-intro { max-width: 680px; margin: 0 0 30px; font-size: 1.05rem; color: var(--lm-soft); }

/* Your lifetime: the notices along a red line */
.lm-line { position: relative; margin: 0 0 0 4px; padding: 0; list-style: none; }
.lm-line::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; background: var(--lm-you); }
.lm-mark { position: relative; padding: 0 0 24px 30px; font-family: var(--lm-serif); font-size: 1.4rem; color: var(--lm-you); }
.lm-mark::before { content: ""; position: absolute; left: -6px; top: 14px; width: 15px; height: 3px; background: var(--lm-you); }
.lm-mark.lm-end { padding: 24px 0 0 30px; }
.lm-mark.lm-gap { padding: 18px 0 22px 30px; border-top: 1px solid var(--lm-rule); font-style: italic; font-size: 1.1rem; }
.lm-notice { position: relative; display: grid; grid-template-columns: 110px minmax(0, 1fr) 128px; gap: 0 30px; padding: 24px 0 26px 30px; border-top: 1px solid var(--lm-rule); }
.lm-notice.lm-nophoto { grid-template-columns: 110px minmax(0, 1fr); }
.lm-when { position: relative; }
.lm-when::before { content: ""; position: absolute; left: -30px; top: 16px; width: 12px; height: 3px; background: var(--lm-you); }
.lm-yr { display: block; font-family: var(--lm-serif); font-size: 1.85rem; line-height: 1.1; }
.lm-guide .lm-age { margin: 0 0 10px; color: var(--lm-you); font-weight: 600; }
.lm-notice h3 { margin: 0; font-family: var(--lm-serif); font-weight: 700; font-size: 1.55rem; line-height: 1.2; }
.lm-notice h3 small { margin-left: 8px; font-weight: 400; font-style: italic; font-size: 1rem; color: var(--lm-soft); }
.lm-guide .lm-was { margin: 4px 0 4px; font-family: var(--lm-serif); font-style: italic; font-size: 1.2rem; }
.lm-storytext { max-width: 640px; margin: 0; font-family: var(--lm-serif); font-size: 1.08rem; line-height: 1.6; }
.lm-meta { max-width: 640px; margin: 12px 0 0; font-size: .88rem; color: var(--lm-soft); }
.lm-photo img { width: 128px; height: 128px; object-fit: cover; filter: grayscale(1) contrast(1.04); border: 1px solid var(--lm-ink); }

/* Just before */
.lm-before p { max-width: 760px; margin: 0 0 14px; font-family: var(--lm-serif); font-size: 1.2rem; line-height: 1.55; }
.lm-before p.lm-familyline { margin-top: 24px; padding: 4px 0 4px 18px; border-left: 3px solid var(--lm-you); font-family: inherit; font-size: 1.08rem; }

/* The chain to 1776 */
.lm-chain { list-style: none; max-width: 820px; margin: 0; padding: 0; }
.lm-person { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 0 28px; padding: 22px 0; border-top: 1px solid var(--lm-ink); }
.lm-person.lm-nophoto { grid-template-columns: minmax(0, 1fr); }
.lm-person p { margin: 0; }
.lm-years { font-size: .9rem; color: var(--lm-soft); }
.lm-person h3 { margin: 2px 0; font-family: var(--lm-serif); font-weight: 700; font-size: 1.7rem; line-height: 1.2; }
.lm-title { font-family: var(--lm-serif); font-style: italic; font-size: 1.1rem; }
.lm-person .lm-sum { margin-top: 8px; font-family: var(--lm-serif); font-size: 1.08rem; }
.lm-person .lm-also { margin-top: 8px; font-size: .9rem; color: var(--lm-you); }
.lm-person .lm-photo img { width: 112px; height: 112px; }
.lm-handoff { position: relative; padding: 8px 0 22px 34px; font-family: var(--lm-serif); font-style: italic; font-size: 1.15rem; }
.lm-handoff::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 12px; width: 1px; background: var(--lm-ink); }
.lm-handoff::after { content: ""; position: absolute; left: 6px; bottom: 10px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid var(--lm-ink); }
.lm-handoff.lm-mine { color: var(--lm-you); }
.lm-handoff.lm-mine::before { background: var(--lm-you); }
.lm-handoff.lm-mine::after { border-top-color: var(--lm-you); }
.lm-me { border-top: 3px solid var(--lm-you); color: var(--lm-you); }
.lm-me .lm-years { color: var(--lm-you); }
.lm-me h3 { font-size: 2rem; }

/* Still with us */
.lm-say { max-width: 780px; margin: 0 0 22px; font-family: var(--lm-serif); font-size: 1.2rem; line-height: 1.55; }
.lm-moon { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 150px)); gap: 22px; margin: 0 0 30px; padding: 0; }
.lm-moon img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; filter: grayscale(1) contrast(1.04); border: 2px solid var(--lm-ink); margin-bottom: 8px; }
.lm-moon b { display: block; font-family: var(--lm-serif); font-weight: 700; font-size: 1.05rem; }
.lm-moon span { display: block; font-size: .86rem; color: var(--lm-soft); line-height: 1.4; }
.lm-moon span:first-of-type { color: var(--lm-ink); font-weight: 600; }
.lm-facts { max-width: 780px; padding-top: 18px; border-top: 1px solid var(--lm-rule); }
.lm-facts p { margin: 0 0 14px; font-family: var(--lm-serif); font-size: 1.12rem; line-height: 1.55; }
.lm-facts a { font-family: "Segoe UI", system-ui, sans-serif; font-size: .85rem; color: var(--lm-soft); }

/* The family */
.lm-family { margin: 60px 0 0; padding: 60px 40px 64px; background: var(--lm-ink); color: #fff; }
.lm-guide .lm-family h2 { color: #fff; font-size: clamp(2rem, 4vw, 2.8rem); }
.lm-family .lm-say { color: #fff; }
.lm-family ol { max-width: 760px; margin: 22px 0 28px; padding-left: 1.4em; font-family: var(--lm-serif); font-style: italic; font-size: 1.35rem; line-height: 1.45; }
.lm-family li { margin: 0 0 10px; padding-left: 6px; }
.lm-again { max-width: 700px; margin: 28px 0 0; padding-top: 22px; border-top: 1px solid #5c5953; color: #e8e6e1; }

/* How we know */
.lm-how { padding: 50px 0 20px; }
.lm-guide .lm-how h2 { font-size: 1.8rem; }
.lm-how p { max-width: 760px; color: var(--lm-soft); }
.lm-how dl { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 6px 20px; max-width: 760px; margin: 14px 0 22px; }
.lm-how dt { font-weight: 600; }
.lm-how dd { margin: 0; color: var(--lm-soft); }
.lm-credits > summary { cursor: pointer; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.lm-credits ul { columns: 2; column-gap: 40px; margin: 12px 0 0; padding-left: 18px; font-size: .86rem; color: var(--lm-soft); }
.lm-credits li { break-inside: avoid; margin-bottom: 4px; }

@media (max-width: 860px) {
    .lm-faces { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lm-moon { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .lm-opening h1 { font-size: 2.2rem; line-height: 1.16; }
    .lm-lede { font-size: 1.18rem; }
    .lm-faces { gap: 12px; }
    .lm-notice, .lm-notice.lm-nophoto { grid-template-columns: minmax(0, 1fr) 76px; gap: 0 14px; padding: 22px 0 24px 22px; }
    .lm-notice.lm-nophoto { grid-template-columns: minmax(0, 1fr); }
    .lm-when::before { left: -22px; top: 13px; }
    .lm-notice .lm-when { grid-column: 1; grid-row: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 10px; align-self: center; }
    .lm-yr { display: inline; font-size: 1.6rem; }
    .lm-notice .lm-photo { grid-column: 2; grid-row: 1; margin-bottom: 12px; }
    .lm-notice .lm-body { grid-column: 1 / -1; grid-row: 2; }
    .lm-photo img, .lm-person .lm-photo img { width: 76px; height: 76px; }
    .lm-mark, .lm-mark.lm-end, .lm-mark.lm-gap { padding-left: 22px; font-size: 1.2rem; }
    .lm-person { grid-template-columns: minmax(0, 1fr) 76px; gap: 0 14px; }
    .lm-person h3 { font-size: 1.45rem; }
    .lm-family { margin: 50px -16px 0; padding: 44px 16px 48px; }
    .lm-family ol { font-size: 1.15rem; }
    .lm-how dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .lm-how dd { margin-bottom: 10px; }
    .lm-credits ul { columns: 1; }
    .lm-bar-note { flex-basis: 100%; font-size: .85rem; }
}

/* The site sets every field to 16px on touch screens so phones don't zoom into them. The year is far larger than 16px
   (no zoom either way) and part of the headline, so it keeps the headline's size. */
@media (pointer: coarse) {
    .lm-guide .lm-pick select { font-size: inherit !important; }
}

/* ---- How close are you to history: each moment as a timeline of overlapping lives, ending in yours ---- */
.lm-close .lm-row { padding: 24px 0 26px; border-top: 1px solid var(--lm-ink); }
.lm-close .lm-row h3 { margin: 0 0 6px; font-family: var(--lm-serif); font-weight: 400; font-size: 1.45rem; }
.lm-close .lm-row h3 b { font-weight: 700; color: var(--lm-you); }
.lm-row-story { max-width: 760px; margin: 0 0 14px; font-family: var(--lm-serif); font-size: 1.08rem; line-height: 1.6; }

/* Every row of the timeline shares three columns: picture, name, and the track where years run left to right. The tracks
   touch, so the moment's line and the dashed hand-offs drawn in each one join into single lines down the chart. */
.lm-tl-row { display: grid; grid-template-columns: 52px 176px minmax(0, 1fr) 76px; column-gap: 14px; align-items: center; }
/* Today's age, just past the end of your bar, where it can only belong to the bar's end. */
.lm-tl-now { font-size: .8rem; font-weight: 600; line-height: 1.3; color: var(--lm-you); }
.lm-tl-row img, .lm-tl-row .lm-plate { width: 52px; height: 52px; object-fit: cover; border: 1px solid var(--lm-ink); }
.lm-tl-row img { filter: grayscale(1) contrast(1.04); }
.lm-plate { display: grid; place-items: center; background: #f1eee8; border-color: var(--lm-rule) !important; font-family: var(--lm-serif); font-size: 1.1rem; color: var(--lm-soft); }
.lm-tl-you .lm-plate { background: var(--lm-you); border-color: var(--lm-you) !important; color: #fff; font-size: 1rem; }
.lm-tl-who { min-width: 0; }
.lm-tl-who b { display: block; font-family: var(--lm-serif); font-weight: 700; font-size: 1rem; line-height: 1.25; }
.lm-tl-who span { display: block; font-size: .84rem; color: var(--lm-soft); }
.lm-tl-you .lm-tl-who b { color: var(--lm-you); }
.lm-tl-track { position: relative; align-self: stretch; height: 64px; margin-right: 6px; }
.lm-tl-track i { position: absolute; display: block; }
.lm-tl-bar { top: calc(50% - 4px); height: 8px; border-radius: 4px; background: var(--lm-ink); z-index: 1; }
/* Your life runs on past today, so it fades at the right instead of ending. */
.lm-tl-you .lm-tl-bar { background: linear-gradient(90deg, var(--lm-you) 75%, rgba(163, 33, 27, .2)); border-radius: 4px 0 0 4px; }
.lm-tl-moment { top: 0; bottom: 0; border-left: 2px solid var(--lm-past); }
.lm-tl-band { background: rgba(43, 93, 138, .1); border-right: 2px solid var(--lm-past); }
/* Where one life ends, a dashed line drops to the next life, which was still going. */
.lm-tl-pass { top: 50%; bottom: 0; border-left: 1px dashed var(--lm-soft); }
.lm-tl-drop { top: 0; height: 50%; border-left: 1px dashed var(--lm-soft); }
.lm-tl-dot { top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #fff; border: 2px solid var(--lm-ink); z-index: 2; }
.lm-tl-you .lm-tl-dot { border-color: var(--lm-you); }
.lm-tl-head .lm-tl-track { height: 24px; }
.lm-tl-mark { position: absolute; top: 2px; padding-left: 7px; white-space: nowrap; font-size: .8rem; font-weight: 600; color: var(--lm-past); }
.lm-tl-axis .lm-tl-track { height: 26px; border-top: 1px solid var(--lm-rule); }
.lm-tl-axis .lm-tl-track span { position: absolute; top: 4px; transform: translateX(-50%); font-size: .78rem; color: var(--lm-faint); }
.lm-tl-axis .lm-tl-track span.lm-tl-first { transform: none; }
.lm-tl-axis .lm-tl-track span.lm-tl-last { transform: translateX(-100%); }

/* Ages written on the bars: the age at the moment and at death above the bar, the age where the life above ended below it. */
.lm-tl-age { position: absolute; top: calc(50% - 24px); transform: translateX(-50%); padding: 0 3px; background: #fff; white-space: nowrap; font-size: .76rem; font-weight: 600; line-height: 1.25; color: var(--lm-soft); z-index: 3; }
.lm-tl-age.lm-tl-below { top: calc(50% + 8px); }
.lm-tl-age.lm-tl-first { transform: none; }
.lm-tl-age.lm-tl-last { transform: translateX(-100%); }
.lm-tl-age.lm-tl-after { transform: translateX(4px); }
.lm-tl-age.lm-tl-before { transform: translateX(calc(-100% - 4px)); }
.lm-tl-you .lm-tl-age { color: var(--lm-you); }
.lm-tl-short { display: none; }
.lm-tl-key { display: none; margin: 0 0 4px; font-size: .8rem; color: var(--lm-faint); }

/* On a phone the same chart, narrower: smaller pictures and names, so the years still have room. */
@media (max-width: 640px) {
    .lm-tl-row { grid-template-columns: 36px 92px minmax(0, 1fr) 20px; column-gap: 8px; }
    .lm-tl-now { font-size: .72rem; }
    .lm-tl-row img, .lm-tl-row .lm-plate { width: 36px; height: 36px; }
    .lm-tl-row .lm-plate { font-size: .9rem; }
    .lm-tl-track { height: 58px; }
    .lm-tl-who b { font-size: .9rem; }
    .lm-tl-who span { font-size: .76rem; }
    .lm-tl-mark { font-size: .74rem; }
    .lm-tl-axis .lm-tl-track span { font-size: .7rem; }
    .lm-tl-long { display: none; }
    .lm-tl-short { display: inline; }
    .lm-tl-age { font-size: .7rem; top: calc(50% - 22px); }
    .lm-tl-age.lm-tl-below { top: calc(50% + 7px); }
    .lm-tl-key { display: block; }
    .lm-tl-axis .lm-tl-track span.lm-tl-odd { display: none; }
}
