/* The Lab (/lab/, /fr/labo/): its own room. 2026-11: the "Night lab" look of the mockups. Near-black navy with a faint
   blue grid that fades down the page, dark glass cards, monospace details, glowing status dots and a blue cursor.
   The same in light and dark mode (it's the Lab's identity): the page uses the site's dark-mode tokens, so the menu is
   the dark glass one even when the computer is in light mode. The footer is the site's own royal blue.
   Cards sit in a masonry grid: lab.js sets each card's row span from its height, so short notes fill the gaps.
   Without JavaScript it's a plain grid. */

body.lab-body {
  /* The site's dark-mode tokens (style.css), whatever the computer's setting */
  --bg: #0a1124;
  --card: #18223a;
  --ink: #eef1f6;
  --muted: #a3adc4;
  --accent-soft: #24324f;
  --line: #2a3555;
  --focus: var(--accent);
  --glass-top: rgba(255, 255, 255, 0.13);
  --glass-bottom: rgba(255, 255, 255, 0.04);
  --glass-edge: rgba(255, 255, 255, 0.22);
  --glass-rim: linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.06) 38%, rgba(255, 255, 255, 0.02) 62%, rgba(195, 211, 226, 0.4));
  --glass-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
  --lens-top: rgba(255, 255, 255, 0.24);
  --lens-bottom: rgba(255, 255, 255, 0.10);
  --lens-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.5);
  --glow-2: #6a58b4;
  color-scheme: dark;

  /* The Lab's own */
  --lab-blue: #8db6e8;
  --lab-text: #e8eef8;
  --lab-muted: #a3b0c8;
  --lab-edge: rgba(255, 255, 255, 0.13);
  --lab-card-top: rgba(255, 255, 255, 0.085);
  --lab-card-bottom: rgba(255, 255, 255, 0.03);
  --lab-chip: rgba(255, 255, 255, 0.08);
  --lab-grid: rgba(141, 182, 232, 0.07);
  --lab-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  background-color: var(--bg);
  /* the grid, fading out down the page (the top layer is a veil of the page colour) */
  background-image:
    linear-gradient(180deg, rgba(10, 17, 36, 0) 0, rgba(10, 17, 36, 0) 700px, #0a1124 1500px),
    linear-gradient(var(--lab-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--lab-grid) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  background-repeat: no-repeat, repeat, repeat;
  color: var(--ink);
}
/* The site's glows: blue top left, lilac top right, softer on the dark page */
body.lab-body::before { background: radial-gradient(40% 44% at 14% 8%, rgba(141, 182, 232, 0.26), transparent 70%), radial-gradient(44% 40% at 55% 100%, rgba(141, 182, 232, 0.1), transparent 70%); }
body.lab-body::after { background: radial-gradient(36% 42% at 90% 14%, rgba(185, 169, 242, 0.26), transparent 70%); }
/* The menu: the dark glass one, also in light mode (style.css paints a light veil and rim there) */
@media (prefers-color-scheme: light) {
  body.lab-body .site-header-inner { background: linear-gradient(160deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)), rgba(24, 34, 58, 0.88); -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4); box-shadow: inset 0 1px 0 var(--glass-edge), var(--glass-shadow); }
  body.lab-body .site-header-inner::after { background: var(--glass-rim); }
  body.lab-body .site-header.stuck .site-header-inner { box-shadow: inset 0 1px 0 var(--glass-edge), 0 18px 40px -16px rgba(0, 0, 0, 0.7); }
}

.lab-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main.page.wide.lab-page { max-width: 1200px; }

/* Draft notice (only you see the page while it's in draft) */
.lab-draft { margin: 0 0 24px; padding: 10px 14px; border-radius: 12px; background: #ffd84d; color: #3d2f00; font-weight: 700; font-size: .9rem; }

/* Heading */
main.page.wide.lab-page .page-head h1 { color: var(--lab-text); }
main.page.wide.lab-page .page-head .lead { color: var(--lab-muted); }
.lab-kicker { margin: 0 0 14px; font-family: var(--lab-mono); font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--lab-blue); }
.lab-cursor { display: inline-block; width: .14em; height: .82em; margin-left: .08em; vertical-align: -0.02em; background: var(--lab-blue); border-radius: 2px; }
@media (prefers-reduced-motion: no-preference) { .lab-cursor { animation: lab-blink 1.1s steps(1) infinite; } }
@keyframes lab-blink { 50% { opacity: 0; } }

/* Filters (lab.js shows them; without JavaScript every entry is simply shown) */
.lab-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.lab-filters[hidden] { display: none; }
.lab-filter {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 18px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: .92rem; font-weight: 700; color: var(--lab-text);
  border: 1px solid var(--lab-edge);
  background: linear-gradient(160deg, var(--lab-card-top), var(--lab-card-bottom));
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 22px -16px rgba(0, 0, 0, 0.7);
  transition: transform .2s ease, border-color .2s ease;
}
.lab-filter:hover { transform: translateY(-1px); border-color: rgba(141, 182, 232, 0.35); }
.lab-filter[aria-pressed="true"] { background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.lab-filter:focus-visible { outline: 3px solid var(--lab-blue); outline-offset: 3px; }
.lab-count { font-family: var(--lab-mono); font-size: .76rem; font-weight: 500; color: var(--lab-muted); }

/* The board */
.lab-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; grid-auto-flow: row dense; }
.lab-board.is-masonry { grid-auto-rows: 4px; row-gap: 0; }
.lab-board.is-masonry .lab-card { padding-bottom: 20px; }   /* the gap, inside the measured height */
@media (min-width: 900px) { .lab-card.is-big { grid-column: span 2; } }
.lab-card[hidden] { display: none; }

.lab-card-in {
  display: flex; flex-direction: column; padding: 6px; border-radius: 26px; color: var(--lab-text);
  border: 1px solid var(--lab-edge);
  background: linear-gradient(160deg, var(--lab-card-top), var(--lab-card-bottom));
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 18px 40px -22px rgba(0, 0, 0, 0.7);
  transition: transform .25s ease, box-shadow .25s ease;
}
.lab-card-in:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 26px 50px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(141, 182, 232, 0.18); }
.has-img .lab-card-in { padding: 8px; }
/* A Note gets a lilac tint; a big entry without an image a blue one, so it still reads as important */
.lab-k-note .lab-card-in { background: linear-gradient(160deg, rgba(185, 169, 242, 0.14), rgba(255, 255, 255, 0.025)); }
.lab-card.is-big.no-img:not(.lab-k-note) .lab-card-in { background: linear-gradient(160deg, rgba(141, 182, 232, 0.18), rgba(255, 255, 255, 0.03)); }

/* Image: shown whole at its own ratio (never cropped) */
.lab-img { margin: 0; border-radius: 19px; overflow: hidden; background: #121c38; }
.lab-img img { display: block; width: 100%; height: auto; }
/* A big card with an image: picture beside the text on large screens */
@media (min-width: 900px) {
  .lab-card.is-big.has-img .lab-card-in { flex-direction: row; align-items: flex-start; gap: 4px; }
  .lab-card.is-big.has-img .lab-img { flex: 1 1 52%; }
  .lab-card.is-big.has-img .lab-body { flex: 1 1 48%; }
}

.lab-body { display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 8px; min-width: 0; }
.is-big .lab-body { padding: 18px 16px 10px; }
.lab-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; }
.lab-kind { font-family: var(--lab-mono); font-size: .74rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--lab-muted); }
.lab-status { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); font-family: var(--lab-mono); font-size: .72rem; font-weight: 700; white-space: nowrap; color: var(--lab-text); }
.lab-dot { width: 7px; height: 7px; border-radius: 50%; }
.lab-s-shipped .lab-dot { background: #5fd39a; box-shadow: 0 0 10px #5fd39a; }
.lab-s-progress .lab-dot { background: #8db6e8; box-shadow: 0 0 10px #8db6e8; }
.lab-s-paused .lab-dot { background: #f2c14e; box-shadow: 0 0 10px #f2c14e; }
.lab-s-dead .lab-dot { background: #8a93a6; }
.lab-title { margin: 0; font-size: 1.2rem; font-weight: 800; letter-spacing: -0.015em; line-height: 1.22; color: var(--lab-text); }
.lab-k-note .lab-title { font-size: 1.1rem; }
.is-big .lab-title { font-size: clamp(1.35rem, 2.2vw, 1.6rem); }
.lab-pin { display: inline-flex; vertical-align: -0.12em; margin-right: 6px; color: var(--lab-blue); }
.lab-pin svg { width: 1em; height: 1em; }
.lab-text { margin: 0; color: var(--lab-muted); font-size: .95rem; line-height: 1.55; }
.is-big .lab-text { font-size: 1.03rem; }
.lab-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.lab-tags li { padding: 3px 9px; border-radius: 8px; background: var(--lab-chip); border: 1px solid var(--lab-edge); font-family: var(--lab-mono); font-size: .74rem; color: var(--lab-muted); }

/* "How I did it": opens in place */
.lab-more { border-top: 1px solid var(--lab-edge); }
.lab-more summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; cursor: pointer; list-style: none; font-weight: 700; font-size: .95rem; }
.lab-more summary::-webkit-details-marker { display: none; }
.lab-more summary svg { width: 16px; height: 16px; flex: none; transition: transform .2s ease; }
.lab-more[open] summary svg { transform: rotate(180deg); }
.lab-more summary:focus-visible { outline: 3px solid var(--lab-blue); outline-offset: 2px; border-radius: 8px; }
.lab-prose { padding: 2px 0 8px; color: var(--lab-muted); font-size: .97rem; line-height: 1.6; }
.lab-prose > :first-child { margin-top: 0; }
.lab-prose > :last-child { margin-bottom: 0; }
.lab-prose p { margin: 0 0 .8em; }
.lab-prose h2, .lab-prose h3, .lab-prose h4 { margin: 1em 0 .4em; color: var(--lab-text); font-size: 1rem; }
.lab-prose a { color: var(--lab-blue); }
.lab-prose code { font-family: var(--lab-mono); font-size: .88em; padding: 1px 5px; border-radius: 5px; background: var(--lab-chip); }

.lab-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; width: fit-content; font-weight: 700; font-size: .95rem; color: var(--lab-blue); text-decoration: none; }
.lab-link:hover { color: var(--lab-blue); text-decoration: underline; text-underline-offset: 4px; }
.lab-link svg { width: 15px; height: 15px; }
.lab-card a:focus-visible { outline: 3px solid var(--lab-blue); outline-offset: 2px; border-radius: 6px; }

.lab-empty { margin: 24px 0 0; padding: 28px; border-radius: 22px; text-align: center; color: var(--lab-muted); border: 1px dashed var(--lab-edge); }
.lab-empty[hidden] { display: none; }

/* Leave the Lab (the hatch closes on the way out, see transitions.css) */
.lab-leave-wrap { display: flex; justify-content: center; margin: 48px 0 0; }
.lab-leave {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 999px;
  color: var(--lab-text); font-weight: 700; text-decoration: none;
  border: 1px solid var(--lab-edge); background: linear-gradient(160deg, var(--lab-card-top), var(--lab-card-bottom));
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: border-color .2s ease;
}
.lab-leave:hover { color: var(--lab-text); border-color: rgba(141, 182, 232, 0.4); }
.lab-leave:focus-visible { outline: 3px solid var(--lab-blue); outline-offset: 3px; }
.lab-leave svg { width: 16px; height: 16px; }

@media (prefers-reduced-motion: reduce) {
  .lab-card-in, .lab-filter, .lab-more summary svg, .lab-leave { transition: none; }
  .lab-card-in:hover, .lab-filter:hover { transform: none; }
}
