/* ─────────────────────────────────────────────────────────────
   Mira agent overlay styles.
   Paperclip = fixed layer top-right. Notes stack vertically when
   multiple are queued (rare — usually one at a time).
   ───────────────────────────────────────────────────────────── */

#mira-agent-layer {
  position: fixed;
  top: 92px;           /* clears the top nav */
  right: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 16px;
  pointer-events: none; /* notes re-enable on themselves */
  max-width: 400px;
}

.mira-note {
  position: relative;
  background: var(--paper, #f4ede0);
  border: 1px solid var(--hair-color, #d8cfbe);
  border-right: none;
  box-shadow:
    -2px 2px 0 rgba(58, 44, 24, 0.04),
    -12px 16px 36px -12px rgba(58, 44, 24, 0.22),
    -4px 6px 14px -6px rgba(58, 44, 24, 0.12);
  padding: 20px 24px 22px 28px;
  width: 360px;
  margin-right: 0;
  transform: translateX(calc(100% + 24px)) rotate(0.6deg);
  transition:
    transform 480ms cubic-bezier(0.22, 1, 0.32, 1),
    opacity 240ms ease;
  opacity: 0;
  pointer-events: auto;
  font-family: var(--font-sans, "IBM Plex Sans", system-ui, sans-serif);
}

.mira-note.is-in {
  transform: translateX(0) rotate(-0.3deg);
  opacity: 1;
}

.mira-note.is-leaving {
  transform: translateX(calc(100% + 24px)) rotate(1.4deg);
  opacity: 0;
}

/* Paperclip — silver metal clip pinning the note to the page edge.
   Pure CSS, sits over the top-right corner. */
.mira-note__clip {
  position: absolute;
  top: -14px;
  right: 18px;
  width: 30px;
  height: 52px;
  border: 2px solid #8f8a80;
  border-radius: 8px 8px 5px 5px;
  border-bottom: none;
  background: transparent;
  box-shadow:
    inset -1px 0 0 rgba(255, 255, 255, 0.5),
    0 1px 2px rgba(58, 44, 24, 0.2);
  pointer-events: none;
}
.mira-note__clip::before {
  content: '';
  position: absolute;
  top: 7px;
  left: 4px;
  right: 4px;
  bottom: -2px;
  border: 2px solid #8f8a80;
  border-radius: 5px 5px 3px 3px;
  border-bottom: none;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.4);
}

/* From-line: "mira" in italic serif, like a signature */
.mira-note__from {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  padding-right: 36px;  /* keep text out from under clip */
}
.mira-note__from-name {
  font-family: var(--font-serif, Fraunces, serif);
  font-style: italic;
  font-size: 17px;
  font-weight: 500;
  color: var(--accent, #c8684a);
  line-height: 1;
}
.mira-note__from-meta {
  font-family: var(--font-mono, "IBM Plex Mono", ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted, #8a7a5c);
}

.mira-note__body {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink, #2a251f);
  margin: 0 0 16px;
}
.mira-note__body strong {
  color: var(--ink, #2a251f);
  font-weight: 500;
  background: linear-gradient(transparent 62%, rgba(200, 104, 74, 0.18) 62%);
  padding: 0 2px;
}

/* Typed reveal — characters uncover left-to-right */
.mira-note__body.is-typing .mira-note__char {
  opacity: 0;
  animation: mira-char-in 20ms linear forwards;
}
@keyframes mira-char-in {
  to { opacity: 1; }
}

.mira-note__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mira-note__btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border: 1px solid var(--accent, #c8684a);
  background: var(--accent, #c8684a);
  color: var(--paper, #f4ede0);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
  letter-spacing: 0;
}
.mira-note__btn:hover {
  transform: translateY(-1px);
}
.mira-note__btn--ghost {
  background: transparent;
  color: var(--ink-soft, #5a4a2a);
  border-color: var(--hair-color, #d8cfbe);
}
.mira-note__btn--ghost:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink, #2a251f);
}

/* Close x — always present, top-right inside note */
.mira-note__close {
  position: absolute;
  top: 10px;
  right: 8px;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--muted, #8a7a5c);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  border-radius: 11px;
  opacity: 0.5;
  transition: opacity 120ms ease, background 120ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mira-note__close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}

/* "Thinking" pulse — small dots before message resolves */
.mira-note__thinking {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.mira-note__thinking span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent, #c8684a);
  opacity: 0.3;
  animation: mira-pulse 1.1s ease-in-out infinite;
}
.mira-note__thinking span:nth-child(2) { animation-delay: 0.15s; }
.mira-note__thinking span:nth-child(3) { animation-delay: 0.3s; }
@keyframes mira-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.15); }
}

/* ─────────────────────────────────────────────────────────────
   Cookie banner — deliberately ordinary so Mira's offer to close
   it feels natural. Sticky top.
   ───────────────────────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  top: 64px;   /* below nav */
  left: 0;
  right: 0;
  z-index: 8500;
  background: var(--ink, #2a251f);
  color: var(--paper, #f4ede0);
  transform: translateY(0);
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1), opacity 240ms ease;
  opacity: 1;
}
.cookie-banner.is-hidden {
  transform: translateY(-120%);
  opacity: 0;
  pointer-events: none;
}
.cookie-banner__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px var(--pad-x, 72px);
  display: flex;
  align-items: center;
  gap: 32px;
}
.cookie-banner__text {
  flex: 1;
  font-size: 13px;
  line-height: 1.55;
  max-width: 72ch;
  font-family: var(--font-sans, "IBM Plex Sans", system-ui, sans-serif);
}
.cookie-banner__text strong {
  font-weight: 500;
  display: block;
  margin-bottom: 2px;
}
.cookie-banner__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.cookie-banner__btn {
  font-family: inherit;
  font-size: 13px;
  padding: 9px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.cookie-banner__btn--primary {
  background: var(--accent, #c8684a);
  color: var(--ink, #2a251f);
}
.cookie-banner__btn--ghost {
  background: transparent;
  color: var(--paper, #f4ede0);
  border-color: rgba(244, 237, 224, 0.3);
}
.cookie-banner__btn--ghost:hover {
  border-color: var(--paper, #f4ede0);
}

/* Brief highlight on the cookie banner when Mira "handles" it — a
   subtle flash then slide-away. */
.cookie-banner.is-handling {
  box-shadow: inset 0 0 0 2px var(--accent, #c8684a);
  transition: box-shadow 180ms ease, transform 320ms cubic-bezier(0.4,0,0.2,1);
}
