/* =========================================================================
   DESIGN SYSTEM — one type size, one weight, tokens for everything else.
   Change a value here and the whole site follows. See DESIGN-SYSTEM.md.
   ========================================================================= */
:root {
  /* — Type ————————————————————————————————— */
  --font-primary: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", "SF Mono", SFMono-Regular, ui-monospace, Consolas, monospace;
  --text-size: 14px;
  --text-line: 22px;
  --text-size-xs: 11px;

  /* — Surface & ink (light) ———————————————————— */
  --body-bg: #fafafa;
  --bg-primary: #fff;
  --bg-secondary: #f9f9f9;
  --text-primary: #27272a;
  --text-strong: #0e0e0e;
  --text-secondary: #9f9f9f;
  --border-color: #e4e4e4;
  --border-faint: #f5f5f5;
  --border-divider: rgba(0, 0, 0, .08);
  --selection-bg: rgba(197, 255, 59, .18);

  /* — Interactive ——————————————————————————— */
  --link-color: #0066cc;
  --link-hover: #0094ff;
  --focus-color: rgba(0, 122, 255, .5);

  /* — Per-project accents (icons light up on row hover) ——— */
  --icon-aidol: #d92d20;
  --icon-brsh: #0841e2;
  --icon-fertilova: #6d3fd4;
  --icon-busolo: #a67c00;
  --icon-skilio: #008453;
  --icon-signit: #1d6f42;
  --icon-sepakat: #0e7490;
  --icon-award: #bf8300;
  --icon-role: #6656f0;

  /* — Shape & rhythm ——————————————————————— */
  --radius: 10px;
  --radius-sm: 6px;
  --measure: 540px;          /* single column width, the whole layout */
  --gutter: 30px;

  /* — Motion: three durations, two curves. That's the whole vocabulary. */
  --dur-fast: .15s;          /* colour, opacity — must feel instant */
  --dur-base: .22s;          /* size, position */
  --dur-slow: .4s;           /* entrances */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

:root[data-theme="dark"] {
  --body-bg: #0e0e0e;
  --bg-primary: #111;
  --bg-secondary: #171717;
  --text-primary: #b0b0b0;
  --text-strong: #f0f0f0;
  --text-secondary: #6e6e6e;
  --border-color: #2c2c2c;
  --border-faint: #1a1a1a;
  --border-divider: #222;
  --selection-bg: rgba(255, 255, 255, .08);
  --link-color: #74b1fd;
  --link-hover: #9cf;
  --icon-aidol: #ff7a70;
  --icon-brsh: #7fb0ff;
  --icon-fertilova: #ab97ff;
  --icon-busolo: #ffcf63;
  --icon-skilio: #62c155;
  --icon-signit: #63d29b;
  --icon-sepakat: #67e8f9;
  --icon-award: #ffcf63;
  --icon-role: #ab97ff;
}

/* =========================================================================
   BASE
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; outline: 0; }

html {
  scroll-behavior: smooth;
  background: var(--body-bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Kill every transition while the theme swaps, so nothing cross-fades badly. */
html.is-theme-switching, html.is-theme-switching *,
html.is-theme-switching *::before, html.is-theme-switching *::after {
  transition-duration: 0s !important;
  animation-duration: 0s !important;
  transition-delay: 0s !important;
  animation-delay: 0s !important;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-size);
  font-weight: 400;
  line-height: var(--text-line);
  color: var(--text-primary);
  background: var(--body-bg);
  min-height: 100vh;
  overflow-y: scroll;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  text-size-adjust: none;
}

p, a, span, li, button { font-size: var(--text-size); line-height: var(--text-line); font-weight: 400; }

a { color: var(--link-color); text-decoration: none; cursor: pointer; transition: color var(--dur-fast) ease; }
a:hover { color: var(--link-hover); }

button { background: none; border: 0; cursor: pointer; font-family: inherit; color: inherit; }

::selection { background: var(--selection-bg); text-shadow: none; }
:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 2px; border-radius: 3px; }

/* Section heading: label on the left, hairline filling the rest. */
h2 {
  font-size: var(--text-size);
  font-weight: 400;
  line-height: var(--text-line);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: .75rem;
}
h2::after { content: ""; flex: 1; height: 1px; background: var(--border-divider); }

/* =========================================================================
   ENTRANCE — every block stagger-fades in via --appear-delay
   ========================================================================= */
@keyframes appear-content {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
.appear {
  animation: appear-content var(--dur-slow) var(--ease-out) backwards;
  animation-delay: var(--appear-delay, 0s);
}

/* =========================================================================
   LAYOUT
   ========================================================================= */
.site { width: 100%; min-width: 320px; overflow-x: clip; }
.intro-section { width: 100%; padding: 88px 0 80px; position: relative; }
.content {
  width: var(--measure);
  max-width: calc(100% - var(--gutter) * 2);
  margin: 0 auto;
  position: relative;
}
.stack { display: flex; flex-direction: column; align-items: flex-start; gap: 32px; width: 100%; }
/* Established year on the left, Dea's own clock on the right. */
.meta-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%;
  font-size: var(--text-size-xs);
  letter-spacing: .06em;
  color: var(--text-secondary);
}
.meta-clock { display: inline-flex; align-items: center; gap: 6px; }
.meta-clock svg { display: block; opacity: .75; }
/* Tabular figures, or the whole line twitches once a second. */
.meta-clock time { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.press-line { color: var(--text-secondary); }

.body-copy { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.information { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.information p { overflow-wrap: break-word; hyphens: none; }
.link-groups { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; }
.link-section { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; width: 100%; margin-bottom: 24px; }

/* Hairline that fades out at both ends. */
.link-divider { width: 100%; height: 0; position: relative; }
.link-divider::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-divider) 25%, var(--border-divider) 75%, transparent);
  opacity: .4;
}

/* =========================================================================
   ROW — the workhorse. Name left, meta right, baseline aligned.
   ========================================================================= */
.link-row { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 6px 16px;
  width: 100%;
}
.names { min-width: 0; color: var(--text-primary); }
.names a {
  display: inline-block;
  width: fit-content;
  position: relative;
  color: var(--text-strong);
  transition: color var(--dur-fast) ease;
}
/* Underline grows from the left instead of just appearing. */
.names a::after {
  content: "";
  position: absolute; left: 0; bottom: -1px;
  width: 0; height: 1px;
  background: currentColor;
  transition: width var(--dur-base) ease;
}
.names a:hover { color: var(--link-hover); }
.names a:hover::after, .names a:focus-visible::after { width: 100%; }

.dates { text-align: right; white-space: nowrap; }
.dates span { color: var(--text-secondary); transition: color var(--dur-fast) ease; }
/* Meta text warms up only for the row you're actually on. */
.row:hover .dates span { color: var(--text-primary); }

/* Project icon: grey until the row is hovered, then its own accent. */
.names-with-icon { display: inline-flex; align-items: center; }
.name-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 19px; height: 19px; margin-right: 9px;
  color: var(--text-secondary);
  cursor: pointer;
  touch-action: manipulation;
  transition: color var(--dur-base) ease, transform .3s var(--ease-spring);
}
.name-icon svg { display: block; overflow: visible; }
.name-icon[data-icon="aidol"]     { --accent: var(--icon-aidol); }
.name-icon[data-icon="brsh"]      { --accent: var(--icon-brsh); }
.name-icon[data-icon="fertilova"] { --accent: var(--icon-fertilova); }
.name-icon[data-icon="busolo"]    { --accent: var(--icon-busolo); }
.name-icon[data-icon="skilio"]    { --accent: var(--icon-skilio); }
.name-icon[data-icon="signit"]    { --accent: var(--icon-signit); }
.name-icon[data-icon="sepakat"]   { --accent: var(--icon-sepakat); }
.name-icon[data-icon="award"]     { --accent: var(--icon-award); }
.name-icon[data-icon="role"]      { --accent: var(--icon-role); }
.names-with-icon:hover .name-icon,
.names-with-icon:focus-within .name-icon { color: var(--accent, var(--text-strong)); }
/* Click it and it pops — overshoots past 1, settles back. */
.name-icon.is-poked { transform: scale(1.16); }

/* Signature-style icon redraws itself when poked. */
.pi-stroke { stroke-dasharray: 60; stroke-dashoffset: 0; }
.name-icon.is-poked .pi-stroke { animation: pi-write .55s var(--ease-out); }
@keyframes pi-write { from { stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }

/* Section heading that is itself a link: arrow slides in on hover. */
.section-link { color: inherit; transition: color var(--dur-fast) ease; }
.section-link:hover { color: var(--text-primary); }
.section-link::after { content: " \2192"; opacity: 0; transition: opacity var(--dur-fast) ease; }
.section-link:hover::after { opacity: .55; }

/* =========================================================================
   AVATAR — the lantern from page-mascot. Two 3×3 sprite sheets: nine head
   directions and nine reactions. app.js moves one background-position.
   ========================================================================= */
.avatar {
  position: relative;
  display: block;
  width: 72px; height: 72px;
  /* Each cell pads the lantern; pull it back so it lines up with the text. */
  margin: -8px 0 -12px -20px;
}
.mascot-body { position: absolute; inset: 0; transform-origin: 50% 78%; }
.mascot-layer {
  position: absolute; inset: 0;
  background: no-repeat 50% 50% / 300% 300%;   /* 50% 50% = the centre cell */
}
.mascot-face     { background-image: url(assets/mascots/lantern-directions.webp); }
.mascot-reaction { background-image: url(assets/mascots/lantern-reactions.webp); opacity: 0; }
.mascot.is-reacting .mascot-face     { opacity: 0; }
.mascot.is-reacting .mascot-reaction { opacity: 1; }
/* Dark mode: the lantern's body is dark too, so light up the head. Sits
   behind both sheets, so it stays put while the face turns and reacts. */
:root[data-theme="dark"] .mascot-body::before {
  content: '';
  position: absolute; inset: -14%;
  background: radial-gradient(circle at 52% 44%, rgba(255, 196, 102, .34), rgba(255, 196, 102, 0) 42%);
  pointer-events: none;
}

/* =========================================================================
   TOOLTIPS — one implementation, driven by data-tip
   ========================================================================= */
@media (hover: hover) {
  [data-tip]::before {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: var(--text-size-xs); font-weight: 500; line-height: 1; letter-spacing: .01em;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .12s ease, transform .12s ease;
    z-index: 10;
  }
  [data-tip]:hover::before { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Inline term with a rich hover card. */
.term-wrap { position: relative; display: inline-block; }
.term {
  color: var(--text-strong);
  border-bottom: 1px dashed var(--border-color);
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.term:hover { color: var(--link-hover); border-color: currentColor; }
.term-tip {
  position: absolute; bottom: calc(100% + 10px); left: 0;
  display: flex; flex-direction: column; gap: 8px;
  width: 260px; padding: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .10);
  opacity: 0; transform: translateY(4px); pointer-events: none;
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
  z-index: 20;
}
.term-wrap:hover .term-tip, .term-wrap:focus-within .term-tip { opacity: 1; transform: none; }
.term-tip-title { color: var(--text-strong); font-weight: 500; }
.term-tip-lead, .term-tip-foot, .term-tip-tag { color: var(--text-secondary); font-size: var(--text-size-xs); line-height: 16px; }
.term-tip-scene { display: flex; flex-direction: column; gap: 4px; padding: 8px; background: var(--bg-secondary); border-radius: var(--radius-sm); }
.term-tip-row { display: flex; justify-content: space-between; gap: 12px; font-size: var(--text-size-xs); line-height: 16px; color: var(--text-secondary); }
.term-tip-row[data-promoted="true"] > span:first-child { color: var(--text-strong); }
.term-tip-foot { color: var(--link-hover); }

/* =========================================================================
   DISCLOSURE BUTTON
   ========================================================================= */
.detail-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-size-xs);
  color: var(--text-secondary);
  opacity: .8;
  transition: opacity var(--dur-fast) ease, color var(--dur-fast) ease;
}
.detail-btn:hover { opacity: 1; color: var(--text-primary); }
.detail-btn-label { text-decoration: underline; text-decoration-color: var(--border-color); transition: text-decoration-color var(--dur-fast) ease; }
.detail-btn:hover .detail-btn-label { text-decoration-color: currentColor; }
.detail-btn svg { transition: transform var(--dur-base) var(--ease-out); }
.detail-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.details { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.details[hidden] { display: none; }
.details .names span, .details .dates span { color: var(--text-secondary); }

.connect-copy { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.connect-copy p { color: var(--text-primary); overflow-wrap: break-word; }
.connect-copy a { color: var(--link-color); transition: color var(--dur-fast) ease; }
.connect-copy a:hover { color: var(--link-hover); }

/* =========================================================================
   FOOTER
   ========================================================================= */
.footer { width: 100%; padding: 0 0 96px; }
.footer-inner { width: var(--measure); max-width: calc(100% - var(--gutter) * 2); margin: 0 auto; padding-top: 24px; }
.footer-row { display: flex; align-items: center; justify-content: center; padding-top: 16px; }
.sig-link { position: relative; color: var(--text-secondary); transition: color var(--dur-base) ease; }
.sig-link:hover { color: var(--text-strong); }
.sig-link svg { display: block; }
/* The signature writes itself on hover. A wipe rather than a stroke-draw,
   because the real mark is filled paths and stroke-dasharray does nothing to a fill. */
.sig-link:hover svg { animation: sig-write 1.1s var(--ease-out); }
@keyframes sig-write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }

/* =========================================================================
   DOCK — fixed pill, always dark, tooltips above
   ========================================================================= */
.dock-area {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex; align-items: center; gap: 8px;
}

/* Back pill — its own capsule, only on case study pages. */
.dock-back {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 999px;
  background: #0e0e0e;
  color: rgba(255, 255, 255, .65);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
  position: relative;
  transition: color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring);
}
.dock-back:hover { color: rgba(255, 255, 255, .95); }
.dock-back:active { transform: scale(.9); }
.dock-back svg { transition: transform var(--dur-base) var(--ease-out); }
.dock-back:hover svg { transform: translateX(-2px); }

.dock {
  display: flex; align-items: center; gap: 0;
  padding: 6px 8px;
  background: #0e0e0e;
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
}
.dock-sep { width: 1px; height: 16px; margin: 0 2px; background: rgba(255, 255, 255, .14); }
.dock-btn {
  position: relative;
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 999px;
  color: rgba(255, 255, 255, .65);
  transition: color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring);
}
.dock-btn:hover { color: rgba(255, 255, 255, .95); }
.dock-btn:active { transform: scale(.9); }
@media (hover: hover) {
  .dock-btn::before, .dock-back::before {
    bottom: calc(100% + 10px);
    background: rgba(10, 10, 10, .9);
    border-color: rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .8);
  }
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 640px) {
  :root { --gutter: 20px; }
  .intro-section { padding: 56px 0 64px; }
  .footer { padding-bottom: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================================
   CASE STUDY PAGES
   ========================================================================= */
.article-page { padding: 88px 0 80px; }

/* Breadcrumb — 12px, the one place type shrinks. */
.breadcrumb { margin-bottom: 16px; }
.breadcrumb ol { display: flex; align-items: center; list-style: none; }
.breadcrumb li { display: flex; align-items: center; font-size: 12px; line-height: 20px; color: var(--text-secondary); }
.breadcrumb a { color: var(--text-secondary); opacity: .65; transition: opacity var(--dur-fast) ease, color var(--dur-fast) ease; }
.breadcrumb a:hover { opacity: 1; color: var(--link-hover); }
.breadcrumb [aria-current="page"] { opacity: .4; }
.bc-sep { margin: 0 6px; opacity: .3; }

.article-header { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.article-title { color: var(--text-strong); font-weight: 400; }
.article-meta { color: var(--text-secondary); }

.article-body { display: flex; flex-direction: column; gap: 40px; width: 100%; padding-top: 24px; }
.article-section { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 96px; }
.article-section > p { color: var(--text-primary); }
.article-section > p + p { margin-top: -4px; }

/* Facts block reuses the .row grid from the index. */
.facts { display: flex; flex-direction: column; gap: 6px; }
.facts .names span { color: var(--text-secondary); }
.facts .dates span { color: var(--text-primary); }

/* Table of contents — desktop only, tracks the section you're reading. */
.toc {
  position: fixed; top: 96px;
  left: max(.5rem, calc(50vw - 610px));
  width: 9rem;
  z-index: 10;
  display: none;
}
@media (min-width: 1200px) { .toc { display: block; } }
.toc-home { display: block; margin-bottom: 24px; color: var(--text-secondary); transition: color var(--dur-fast) ease; }
.toc-home:hover { color: var(--text-primary); }
.toc ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.toc a {
  display: block;
  color: var(--text-secondary);
  line-height: 1.35;
  transition: color var(--dur-fast) ease;
}
.toc a:hover { color: var(--text-primary); }
.toc a[aria-current="true"] { color: var(--text-strong); }

/* Figures. Always the width of the text column — the prose sets the measure. */
figure { display: flex; flex-direction: column; gap: 8px; margin: 0; }
figure img {
  display: block;
  width: 100%; height: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;   /* no long-press "Save Image" sheet on iOS */
  transition: border-color var(--dur-base) ease, transform var(--dur-base) var(--ease-out);
}
figure img:hover { border-color: var(--text-secondary); transform: translateY(-2px); }
figcaption { color: var(--text-secondary); font-size: var(--text-size-xs); line-height: 16px; }

/* Inline diagrams. Framed like a figure image, drawn with the type tokens so
   they follow the theme instead of shipping two copies of every picture. */
figure .diagram {
  display: block; box-sizing: border-box;
  width: 100%; height: auto;
  padding: 18px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-secondary);
}
.diagram text      { font-family: var(--font-primary); font-size: 12px; fill: var(--text-primary); }
.diagram .d-box    { fill: var(--bg-primary); stroke: var(--border-color); }
.diagram .d-chip   { fill: var(--bg-secondary); stroke: var(--border-color); }
.diagram .d-line   { fill: none; stroke: var(--border-color); }
.diagram .d-rule   { fill: var(--text-secondary); }
.diagram .d-tag    { fill: var(--text-secondary); font-size: 10px; letter-spacing: .09em; }
.diagram .d-mut    { fill: var(--text-secondary); font-size: 11px; }
.diagram .d-mono   { fill: var(--text-primary); font-family: var(--font-mono); font-size: 11px; }
.diagram .d-strong { fill: var(--text-strong); }
.diagram .d-ink    { fill: var(--text-strong); stroke: none; }
.diagram .d-stroke { fill: none; stroke: var(--text-primary); }
.diagram .d-crop   { fill: none; stroke: var(--text-primary); stroke-dasharray: 3 3; }
.diagram .d-bar    { fill: var(--text-secondary); }
.diagram .d-bar-top{ fill: var(--text-strong); }

/* Problem / solution pair. */
.callout {
  display: grid; gap: 14px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-secondary);
}
@media (min-width: 560px) { .callout { grid-template-columns: 1fr 1fr; } }
.callout h4 { font-size: var(--text-size); font-weight: 400; color: var(--text-secondary); margin-bottom: 2px; }
.callout p { color: var(--text-primary); }

/* Pull quote from the source deck. */
blockquote {
  border-left: 2px solid var(--border-color);
  padding-left: 16px;
  color: var(--text-secondary);
}
blockquote cite { display: block; margin-top: 6px; font-style: normal; font-size: var(--text-size-xs); opacity: .8; }

/* Prev / next. */
.pager { display: flex; justify-content: space-between; gap: 16px; padding-top: 8px; }
.pager a { color: var(--text-secondary); transition: color var(--dur-fast) ease; }
.pager a:hover { color: var(--link-hover); }

/* External link button. */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  width: fit-content;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-strong);
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring);
}
.btn:hover { background: var(--bg-primary); border-color: var(--text-secondary); color: var(--text-strong); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
/* Reserves its line so an export message can't shift the page. */
.pad-status { color: var(--text-secondary); min-height: var(--text-line); }

code { font-family: var(--font-mono); font-size: 13px; color: var(--text-strong); }

/* Inline chip — a key to press, or a small action beside prose. Sizes .btn
   down; border, fill, hover and press are all inherited from it. */
.key {
  gap: 5px;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  font-size: var(--text-size-xs);
  line-height: 18px;
  vertical-align: 1px;
}
button.key { font-family: var(--font-mono); min-width: 24px; justify-content: center; }
.key.is-copied { color: var(--text-strong); border-color: var(--text-secondary); }
.key svg { display: block; }

/* =========================================================================
   LIGHTBOX — screenshots are the content here, they need to be readable
   ========================================================================= */
.lightbox {
  position: fixed; inset: 0;
  z-index: 300;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(10, 10, 10, .88);
  backdrop-filter: blur(4px);
  cursor: zoom-out;
  opacity: 0;
  transition: opacity var(--dur-base) ease;
  overscroll-behavior: contain;
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
.lightbox-stage {
  display: grid; place-items: center;
  width: 100%; height: 100%;
  overflow: hidden;
}
.lightbox img {
  max-width: 100%; max-height: 100%;
  border-radius: var(--radius);
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  transform-origin: center;
  transition: transform var(--dur-base) var(--ease-out);
  will-change: transform;
}
/* Once zoomed the image is draggable, so the cursor has to say so, and the
   transition has to go — it would lag a pan by 220ms. */
.lightbox.is-zoomed img { cursor: grab; transition: none; }
.lightbox.is-zoomed img:active { cursor: grabbing; }

.lightbox-controls {
  position: absolute; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 0;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(20, 20, 20, .92);
  border: 1px solid rgba(255, 255, 255, .12);
  cursor: default;
}
.lightbox-controls button {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 999px;
  color: rgba(255, 255, 255, .65);
  transition: color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring);
}
.lightbox-controls button:hover { color: rgba(255, 255, 255, .95); }
.lightbox-controls button:active { transform: scale(.9); }
.lightbox-sep { width: 1px; height: 16px; margin: 0 4px; background: rgba(255, 255, 255, .14); }
