/* The Canary companion on osauer.dev: the Desk companion's bird, drawn in
   SVG and animated by assets/canary.js, with its speech capsule beside it,
   laid out like the native one. It plays a scripted day on a synthetic book;
   nothing here is live. It sits just under the header rule, in the band the
   hero reserves for it, and scrolls away with the header: the gutter beside
   the content column is too narrow for a fixed bird and capsule, which
   covered the text below. */
.canary-companion {
  position: absolute;
  top: 116px;
  right: max(22px, calc((100vw - 1240px) / 2 - 68px));
  z-index: 40;
  display: flex;
  align-items: flex-start;
  gap: 2px;
  pointer-events: none;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.canary-companion > * { pointer-events: auto; }
.canary-companion .column { display: flex; flex-direction: column; align-items: flex-end; pointer-events: none; }
.canary-companion .column > * { pointer-events: auto; }
.canary-perch {
  position: relative;
  /* The native bird's visible artwork is about 52px square. */
  width: 66px;
  height: 58px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.canary-perch svg { display: block; width: 100%; height: 100%; overflow: visible; }
.canary-perch:focus-visible { outline: 2px solid var(--moss, #0D7680); outline-offset: 4px; border-radius: 12px; }
.canary-speech .tool:focus-visible, .canary-brief .close:focus-visible { outline: 2px solid var(--moss, #0D7680); outline-offset: 2px; }
.canary-badge {
  position: absolute;
  top: 2px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--blue, #0F5499);
  color: #fff;
  font: 700 10px/16px system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 2px 6px rgba(16, 24, 39, 0.25);
  transform: scale(0.3);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.2s;
}
.canary-badge[data-on="1"] { transform: scale(1); opacity: 1; }
.canary-badge[data-orange="1"] { background: #FF8833; color: #33302E; }

/* The capsule: two lines on the left, the tools on the right. */
.canary-speech {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  max-width: min(440px, calc(100vw - 200px));
  margin: 0;
  padding: 0 14px;
  border: 1px solid rgba(16, 24, 39, 0.1);
  border-radius: 26px;
  background: rgba(255, 252, 248, 0.95);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 10px 30px rgba(16, 24, 39, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  color: var(--ink, #33302E);
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px) scale(0.98);
  transform-origin: 100% 50%;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2), visibility 0s linear 0.18s;
  pointer-events: none;
}
.canary-speech[data-open="1"] { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition-delay: 0s; }
.canary-speech [hidden] { display: none !important; }
.canary-speech .lines { min-width: 0; }
.canary-speech .title { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.canary-speech .line2 { display: flex; align-items: center; gap: 7px; margin-top: 2px; }
.canary-speech .ticker { position: relative; min-width: 0; height: 18px; overflow: hidden; }
.canary-speech .ticker .sizer { display: block; padding-left: 19px; visibility: hidden; white-space: nowrap; font-size: 12px; line-height: 18px; }
.canary-speech .ticker .page {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--ink-soft, #4D4640);
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.canary-speech .ticker .page span { overflow: hidden; text-overflow: ellipsis; }
.canary-speech .ticker .page[data-enter="1"] { animation: canary-ticker-enter .34s cubic-bezier(0.2, 0.9, 0.3, 1); }
@keyframes canary-ticker-enter {
  from { transform: translateY(110%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.canary-speech .kind, .canary-brief .kind { flex: none; width: 17px; height: 17px; color: var(--muted, #6B635C); }
.canary-speech .kind { width: 14px; height: 14px; }
.canary-speech .kind[data-kind="order"], .canary-brief .kind[data-kind="order"] { color: #FF8833; }
.canary-speech .kind[data-kind="brief"], .canary-brief .kind[data-kind="brief"] { color: var(--blue, #0F5499); }
.canary-speech .kind[data-kind="issue"], .canary-brief .kind[data-kind="issue"] { color: #CC0000; }
.canary-speech .kind[data-kind="question"], .canary-brief .kind[data-kind="question"] { color: #593380; }
.canary-speech .kind svg, .canary-brief .kind svg { display: block; width: 100%; height: 100%; }
.canary-speech .dots { display: flex; flex: none; gap: 4px; margin: 0; padding: 0; list-style: none; }
.canary-speech .dots li { width: 4px; height: 4px; border-radius: 50%; background: rgba(16, 24, 39, 0.22); }
.canary-speech .dots li[aria-current="true"] { background: var(--ink, #33302E); }
.canary-speech .tools { display: flex; flex: none; align-items: center; gap: 4px; }
.canary-speech .tool {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-soft, #4D4640);
  font: 700 18px/1 system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.canary-speech .tool svg { width: 16px; height: 16px; }
.canary-speech .tool:hover { background: rgba(16, 24, 39, 0.08); color: var(--ink, #33302E); }
.canary-speech .tool.brief { color: var(--blue, #0F5499); }
.canary-speech .tool.brief .unread { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue, #0F5499); opacity: 0; transition: opacity 0.2s; }
.canary-speech .tool.brief[data-unread="1"] .unread { opacity: 1; }
.canary-speech .tool.review .count {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--blue, #0F5499);
  color: #fff;
  font: 700 10px/16px system-ui, sans-serif;
  text-align: center;
  opacity: 0;
  transform: scale(0.4);
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.15s;
}
.canary-speech .tool.review .count[data-on="1"] { opacity: 1; transform: none; }
.canary-speech .tool.review .count[data-orange="1"] { background: #FF8833; color: #33302E; }
.canary-speech .tool.close { color: var(--muted, #6B635C); }
.canary-note { margin: 5px 6px 0 0; color: var(--muted, #6B635C); font-size: 12px; letter-spacing: 0.02em; opacity: 0; transition: opacity 0.2s; }
.canary-speech[data-open="1"] + .canary-note { opacity: 1; }

/* The cards: the brief, and what waits for you. */
.canary-brief {
  position: absolute;
  right: max(26px, calc((100vw - 1240px) / 2));
  top: 228px;
  z-index: 41;
  width: min(440px, calc(100vw - 44px));
  max-height: min(80vh, 680px);
  overflow: auto;
  padding: 18px 20px 16px;
  border: 1px solid var(--line, #E4D5C6);
  border-radius: 16px;
  background: #FFFCF8;
  box-shadow: 0 22px 60px rgba(16, 24, 39, 0.22);
  color: var(--ink, #33302E);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
}
.canary-brief[hidden] { display: none; }
.canary-brief .eyebrow-line { margin: 0 0 4px; color: var(--muted, #6B635C); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.canary-brief h3 { margin: 0 0 2px; font-size: 19px; line-height: 1.2; }
.canary-brief .when { margin: 0 0 8px; color: var(--muted, #6B635C); font-size: 13px; }
.canary-brief h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 4px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft, #4D4640);
}
.canary-brief h4::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--muted, #6B635C); }
.canary-brief h4[data-tone="blue"]::before { background: var(--blue, #0F5499); }
.canary-brief h4[data-tone="ink"]::before { background: var(--terminal, #0e1626); }
.canary-brief h4[data-tone="amber"]::before { background: var(--amber, #b45309); }
.canary-brief h4[data-tone="slate"]::before { background: #6b7a90; }
.canary-brief h4[data-tone="orange"]::before { background: #FF8833; }
.canary-brief p { margin: 0; color: var(--ink-soft, #4D4640); }
.canary-brief .pos { color: var(--green-dark, #00744A); font-weight: 650; font-variant-numeric: tabular-nums; }
.canary-brief .neg { color: #CC0000; font-weight: 650; font-variant-numeric: tabular-nums; }
.canary-brief .pill { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 750; line-height: 20px; vertical-align: 1px; background: #F2DFCE; color: var(--amber-dark, #990F3D); }
.canary-brief .pill[data-state="new"] { background: #DDEFE3; color: var(--green-dark, #00744A); }
.canary-brief .items { margin: 10px 0 0; padding: 0; list-style: none; }
.canary-brief .items li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line, #E4D5C6); }
.canary-brief .items li:first-child { border-top: 0; }
.canary-brief .close { position: absolute; top: 10px; right: 12px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: none; color: var(--muted, #6B635C); font: 700 16px/26px system-ui, sans-serif; cursor: pointer; }
.canary-brief .close:hover { background: rgba(16, 24, 39, 0.08); color: var(--ink, #33302E); }
.canary-brief .demo { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line, #E4D5C6); color: var(--muted, #6B635C); font-size: 12px; }

/* Room under the capsule's demo note, so it never crowds the lead. */
@media (min-width: 761px) {
  .project-intro { padding-top: 100px; }
}
@media (max-width: 760px) {
  .canary-companion, .canary-brief { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .canary-speech .ticker .page[data-enter="1"] { animation: none; }
  .canary-speech, .canary-badge, .canary-speech .tool.review .count { transition: none; }
}

:root[data-theme=dark] .canary-speech{ background: rgba(46, 51, 59, 0.9); border-color: rgba(255, 241, 229, 0.12); color: #F2E8DF; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
:root[data-theme=dark] .canary-speech .ticker .page{ color: #D9CFC5; }
:root[data-theme=dark] .canary-speech .tool{ color: #D9CFC5; }
:root[data-theme=dark] .canary-speech .tool:hover{ background: rgba(255, 241, 229, 0.1); color: #F2E8DF; }
:root[data-theme=dark] .canary-speech .tool.brief{ color: #4FC3C9; }
:root[data-theme=dark] .canary-speech .kind[data-kind="brief"],:root[data-theme=dark] .canary-brief .kind[data-kind="brief"]{ color: #4FC3C9; }
:root[data-theme=dark] .canary-speech .kind[data-kind="issue"],:root[data-theme=dark] .canary-brief .kind[data-kind="issue"]{ color: #FF8C99; }
:root[data-theme=dark] .canary-speech .kind[data-kind="question"],:root[data-theme=dark] .canary-brief .kind[data-kind="question"]{ color: #C4A9E6; }
:root[data-theme=dark] .canary-speech .dots li{ background: rgba(255, 241, 229, 0.25); }
:root[data-theme=dark] .canary-speech .dots li[aria-current="true"]{ background: #F2E8DF; }
:root[data-theme=dark] .canary-note{ color: #B3A79C; }
:root[data-theme=dark] .canary-brief{ background: #2E333B; border-color: #3B3632; color: #F2E8DF; }
:root[data-theme=dark] .canary-brief p,:root[data-theme=dark] .canary-brief h4{ color: #D9CFC5; }
:root[data-theme=dark] .canary-brief .items li,:root[data-theme=dark] .canary-brief .demo{ border-color: #3B3632; }
:root[data-theme=dark] .canary-brief .pill{ background: #3B3632; color: #F2C4A0; }
:root[data-theme=dark] .canary-brief .pill[data-state="new"]{ background: #1F3A2C; color: #8FE0B0; }
:root[data-theme=dark] .canary-brief .pos{ color: #8FE0B0; }
:root[data-theme=dark] .canary-brief .neg{ color: #FF8C99; }

@media(prefers-color-scheme:dark){:root:not([data-theme]) .canary-speech{ background: rgba(46, 51, 59, 0.9); border-color: rgba(255, 241, 229, 0.12); color: #F2E8DF; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
:root:not([data-theme]) .canary-speech .ticker .page{ color: #D9CFC5; }
:root:not([data-theme]) .canary-speech .tool{ color: #D9CFC5; }
:root:not([data-theme]) .canary-speech .tool:hover{ background: rgba(255, 241, 229, 0.1); color: #F2E8DF; }
:root:not([data-theme]) .canary-speech .tool.brief{ color: #4FC3C9; }
:root:not([data-theme]) .canary-speech .kind[data-kind="brief"],:root:not([data-theme]) .canary-brief .kind[data-kind="brief"]{ color: #4FC3C9; }
:root:not([data-theme]) .canary-speech .kind[data-kind="issue"],:root:not([data-theme]) .canary-brief .kind[data-kind="issue"]{ color: #FF8C99; }
:root:not([data-theme]) .canary-speech .kind[data-kind="question"],:root:not([data-theme]) .canary-brief .kind[data-kind="question"]{ color: #C4A9E6; }
:root:not([data-theme]) .canary-speech .dots li{ background: rgba(255, 241, 229, 0.25); }
:root:not([data-theme]) .canary-speech .dots li[aria-current="true"]{ background: #F2E8DF; }
:root:not([data-theme]) .canary-note{ color: #B3A79C; }
:root:not([data-theme]) .canary-brief{ background: #2E333B; border-color: #3B3632; color: #F2E8DF; }
:root:not([data-theme]) .canary-brief p,:root:not([data-theme]) .canary-brief h4{ color: #D9CFC5; }
:root:not([data-theme]) .canary-brief .items li,:root:not([data-theme]) .canary-brief .demo{ border-color: #3B3632; }
:root:not([data-theme]) .canary-brief .pill{ background: #3B3632; color: #F2C4A0; }
:root:not([data-theme]) .canary-brief .pill[data-state="new"]{ background: #1F3A2C; color: #8FE0B0; }
:root:not([data-theme]) .canary-brief .pos{ color: #8FE0B0; }
:root:not([data-theme]) .canary-brief .neg{ color: #FF8C99; }
}
