/* LifeCharts site. Colours are tokens on :root; dark mode follows the device. */

@font-face { font-family: "Plex"; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex"; src: url("../fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex"; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex"; src: url("../fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Caslon"; src: url("../fonts/libre-caslon-text-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Caslon"; src: url("../fonts/libre-caslon-text-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --bg: #f7f6f3;
  --bg-alt: #ffffff;
  --ink: #1b1d21;
  --ink-soft: #4a4f58;
  --line: #e2dfd8;
  --card: #ffffff;
  --accent: #2878c8;        /* the logo bar's blue */
  --accent-ink: #ffffff;
  --accent-hover: #1f63a8;
  --focus: #b0569f;
  /* the logo's timeline bar */
  --bar: linear-gradient(90deg, #ba68c8 0 4%, #c77fd6 4% 7%, #5aa844 7% 14%, #6bb556 14% 19%, #2e7fc4 19% 27%, #2a74b5 27% 34%, #2e86d1 34% 58%, #3a8fd6 58% 66%, #2e86d1 66% 100%);
  --shadow: 0 1px 2px rgb(20 20 30 / 6%), 0 8px 24px rgb(20 20 30 / 8%);
  --radius: 14px;
  --gutter: 20px;
  --serif: "Caslon", Georgia, "Times New Roman", serif;
  --sans: "Plex", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --bg-alt: #1b1f26;
    --ink: #eef0f3;
    --ink-soft: #b4bac4;
    --line: #2d333c;
    --card: #20252d;
    --accent: #4c9be6;
    --accent-ink: #0d1117;
    --accent-hover: #6cb0f0;
    --focus: #e09ad6;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 30px rgb(0 0 0 / 35%);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, picture, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; }
h1, h2 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }
.lead { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem); color: var(--ink-soft); max-width: 46em; }
.fine { font-size: 0.875rem; color: var(--ink-soft); }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 820px; }
section { padding: clamp(56px, 8vw, 104px) 0; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--card); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* The logo's coloured bar, used as a divider */
.bar { height: 6px; background: var(--bar); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 26px;
  border: 2px solid var(--accent); border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font: 700 1rem/1 var(--sans); letter-spacing: 0.06em; text-decoration: none;
  cursor: pointer; transition: background-color .15s, border-color .15s, transform .15s;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--accent); letter-spacing: 0.03em; }
.btn-ghost:hover { background: var(--accent); color: var(--accent-ink); }
.btn-small { min-height: 40px; padding: 0 18px; font-size: 0.875rem; }
.btn-big { min-height: 60px; padding: 0 40px; font-size: 1.15rem; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand img { width: 150px; height: auto; }
.nav { display: none; gap: 26px; margin-left: auto; }
.nav a { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.nav a:hover { color: var(--ink); }
.top .btn { margin-left: auto; }
@media (min-width: 760px) {
  .brand img { width: 180px; }
  .nav { display: flex; }
  .top .btn { margin-left: 8px; }
}

/* Hero */
.hero { padding-top: clamp(28px, 4.5vw, 64px); padding-bottom: 0; }
.hero-grid { display: grid; gap: 32px; align-items: center; padding-bottom: clamp(40px, 6vw, 80px); }
.hero h1 { font-size: clamp(1.9rem, 1.2rem + 3vw, 3.1rem); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-show { margin: 0; }
.hero-show .show {
  aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line); background: #fff;
}
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 0.8fr 1.2fr; gap: 56px; }
}

/* Slideshows: stacked slides, the current one fades in */
.show { position: relative; }
.show .slide { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .9s ease; }
.show .slide img, .show img.slide, .show video.slide { width: 100%; height: 100%; object-fit: cover; }
.show .slide.is-on { opacity: 1; }
/*@media (prefers-reduced-motion: reduce) { .show .slide { transition: none; } }*/

/* Digital and print: a pair of 4:3 photos per size */
.sizes { background: var(--bg-alt); }
.sizes h2 { text-align: center; margin-bottom: clamp(28px, 4vw, 48px); }
.size { margin-bottom: clamp(36px, 5vw, 64px); }
.size-tag {
  display: inline-block; margin: 0 0 14px; padding: 4px 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
  font: 700 0.85rem/1.4 var(--sans); letter-spacing: 0.08em; text-transform: uppercase;
}
.pair { display: grid; gap: 20px; }
@media (min-width: 760px) { .pair { grid-template-columns: 1fr 1fr; gap: 28px; } }
.card { margin: 0; position: relative; }
.card > picture img, .card .scene { border-radius: var(--radius); box-shadow: var(--shadow); }
.card > picture img { width: 100%; }
/* DIGITAL / PRINT, on the photo's top-left corner */
.kind {
  position: absolute; left: 12px; top: 12px; z-index: 2; padding: 5px 10px 4px; border-radius: 4px;
  background: #000; color: #fff; font: 700 0.75rem/1.2 var(--sans); letter-spacing: 0.1em; text-transform: uppercase;
}
.more { text-align: center; margin: 8px 0 0; }

.scene { position: relative; overflow: hidden; background: #fff; }
.scene .photo { width: 100%; }
/* The photo's screen is see-through: the photo sits over the clip, so the device's own
   rounded corners (and any fingers) trim it. */
.scene-masked picture { position: relative; z-index: 1; pointer-events: none; }
/* Laid out at its own size, then mapped onto the photo's screen by site.js */
.screen { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; background: #0c0e12; visibility: hidden; }
.screen.is-placed { visibility: visible; }
/* Charts are shown whole, padded above and below where the screen is taller than 16:9 */
.screen .slide { object-fit: contain !important; }
.screen-light { background: #fbfbfd; }
.screen-dark { background: #000; }
/* a soft reflection across the glass */
.screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgb(255 255 255 / 14%) 0%, rgb(255 255 255 / 4%) 32%, rgb(255 255 255 / 0%) 48%);
}

/* Uses */
.uses h2 { max-width: 20em; }
.span-scale {
  display: flex; align-items: center; gap: 12px; margin: 36px 0 14px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft);
}
.span-arrow { flex: 1; height: 6px; border-radius: 3px; background: var(--bar); position: relative; }
.span-arrow::after {
  content: ""; position: absolute; right: -9px; top: 50%; transform: translateY(-50%);
  border: 8px solid transparent; border-left: 10px solid #2e86d1; border-right: 0;
}
.use-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
@media (min-width: 760px) { .use-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); } }
.use-grid li {
  padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  border-left: 4px solid var(--accent); font-weight: 600; line-height: 1.3;
}
.use-grid li:nth-child(3n+1) { border-left-color: #ba68c8; }
.use-grid li:nth-child(3n+2) { border-left-color: #5aa844; }
.callout {
  display: grid; gap: 18px 24px; align-items: center; margin-top: 28px; padding: 18px;
  border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 10%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
@media (min-width: 640px) { .callout { grid-template-columns: minmax(200px, 300px) 1fr; } }
.callout-copy p { margin: 0 0 14px; font-size: 1.05rem; }
.thumb { all: unset; position: relative; display: block; cursor: zoom-in; border-radius: 10px; overflow: hidden; }
.thumb img { width: 100%; }
.thumb:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.enlarge {
  position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 8px; background: rgb(0 0 0 / 62%); transition: background-color .15s;
}
.enlarge svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.thumb:hover .enlarge { background: var(--accent); }

/* Features */
.features { background: var(--bg-alt); padding-top: clamp(40px, 5vw, 64px); }
.feature-grid { display: grid; gap: 24px; }
@media (min-width: 760px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }
.feature { padding: 22px 22px 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.feature h3 { display: flex; align-items: center; gap: 10px; }
.feature p { color: var(--ink-soft); }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.dot-chart { background: #2e86d1; }
.dot-map { background: #ba68c8; }
.dot-time { background: #5aa844; }
.benefits { list-style: none; padding: 0; margin: 40px 0 0; display: grid; gap: 14px 32px; }
@media (min-width: 760px) { .benefits { grid-template-columns: 1fr 1fr; } }
.benefits li { padding-left: 22px; position: relative; color: var(--ink-soft); }
.benefits li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 10px; height: 10px; border-radius: 2px; background: var(--accent); }
.benefits li:nth-child(2)::before { background: #5aa844; }
.benefits li:nth-child(3)::before { background: #ba68c8; }
.benefits strong { color: var(--ink); }

/* Full animations: a portrait per person, then the chosen one's bio and video */
.people h2 { text-align: center; }
.people-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 12px; max-width: 880px; margin: 28px auto 8px; }
@media (min-width: 640px) { .people-tabs { grid-template-columns: repeat(4, 1fr); } }
.person {
  all: unset; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; text-align: center; font-weight: 600; line-height: 1.25; padding: 6px; border-radius: 12px;
  position: relative;
}
.person img {
  width: min(140px, 36vw); aspect-ratio: 1; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--line); filter: grayscale(1); transition: border-color .15s, transform .15s, filter .15s;
}
.person span { font-size: 0.95rem; color: var(--ink-soft); }
.person:hover img { transform: scale(1.03); }
/* the chosen one's ring: drawn on the button, as the photo's grayscale filter would grey it */
.person[aria-selected="true"]::before {
  content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); pointer-events: none;
  width: min(140px, 36vw); aspect-ratio: 1; border-radius: 50%; box-shadow: 0 0 0 6px var(--accent);
}
.person[aria-selected="true"] img { border-color: var(--bg-alt); }
.person[aria-selected="true"] span { color: var(--ink); }
.person:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.person-panel { max-width: 960px; margin: 0 auto; }
.bio { text-align: center; font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--ink-soft); margin: 18px 0 20px; }
.yt { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow); }
.yt button { all: unset; position: absolute; inset: 0; cursor: pointer; }
.yt button img { width: 100%; height: 100%; object-fit: cover; }
.yt button::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 76px; height: 54px; transform: translate(-50%, -50%);
  border-radius: 14px; background: rgb(0 0 0 / 70%) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 7v10l8-5z'/%3E%3C/svg%3E") center / 38px no-repeat;
}
.yt button:hover::after, .yt button:focus-visible::after { background-color: #c00; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-soon { display: grid; place-items: center; background: var(--card); border: 2px dashed var(--line); box-shadow: none; color: var(--ink-soft); font-weight: 600; }
.yt-soon p { margin: 0; }
.yt-note { text-align: center; margin-top: 12px; }
.people .closer-row { margin-top: clamp(32px, 5vw, 56px); }

/* FAQ */
.people { background: var(--bg-alt); }
.faq h2 { margin-bottom: 24px; }
details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); }
summary {
  list-style: none; cursor: pointer; padding: 20px 44px 20px 0; position: relative;
  font-weight: 600; font-size: 1.125rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 12px; height: 12px; margin-top: -9px;
  border-right: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent);
  transform: rotate(45deg); transition: transform .2s;
}
details[open] summary::after { transform: rotate(225deg); margin-top: -3px; }
.answer { padding: 0 0 18px; color: var(--ink-soft); }
.answer ul, .answer ol { padding-left: 1.3em; margin: 0 0 1em; }
.answer li { margin-bottom: 0.35em; }
.answer strong { color: var(--ink); }

/* Closer and footer */
.closer-row { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.foot { padding: 0 0 32px; }
.foot-row { padding-top: 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 32px; }
.foot p { margin: 0; }

/* Other examples */
.gallery {
  width: min(1100px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0;
  border: 0; border-radius: var(--radius); background: var(--bg); color: var(--ink); box-shadow: 0 20px 60px rgb(0 0 0 / 40%);
}
.gallery::backdrop { background: rgb(10 12 16 / 72%); }
.gallery-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.gallery-head h2 { margin: 0; font-size: 1.5rem; }
.close { all: unset; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; font-size: 1.9rem; line-height: 1; }
.close:hover { background: var(--line); }
.close:focus-visible { outline: 3px solid var(--focus); }
.gallery-grid { padding: 18px; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; }
.gallery-grid figure { margin: 0; }
.gallery-grid img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.gallery-grid figcaption { margin-top: 8px; font-size: 0.9rem; color: var(--ink-soft); }
.lightbox picture img { width: 100%; }
body.no-scroll { overflow: hidden; }

/* 404 */
.notfound { padding-top: 12vh; padding-bottom: 12vh; }
.notfound h1 { margin-top: 40px; font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); }
