/* Info card: a pill in the top-left corner that springs open into a card.
   Size, corner radius, the plus rotation and the content reveal are all
   written by info-card.js from a single spring value. */

.ic {
  --ic-bg: rgba(255, 255, 255, 0.88);
  --ic-bg-solid: #ffffff;
  --ic-border: rgba(0, 0, 0, 0.1);
  --ic-fg: #16181d;
  --ic-muted: rgba(22, 24, 29, 0.6);
  --ic-link: rgba(22, 24, 29, 0.85);
  --ic-plus-bg: rgba(0, 0, 0, 0.07);
  --ic-focus: #2563eb;

  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 50;
  box-sizing: border-box;
  height: 46px;
  border-radius: 23px;
  overflow: hidden;
  /* clip can't be scrolled, so focusing the full-width header never shifts
     the content sideways */
  overflow: clip;
  background: var(--ic-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--ic-border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
  color: var(--ic-fg);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  transition: transform 100ms ease-out;
  transform-origin: center;
}

.ic.is-pressed {
  transform: scale(0.97);
}

/* Focus ring around the whole card when the header has keyboard focus. */
.ic.is-focus-visible {
  outline: 2px solid var(--ic-focus);
  outline-offset: 2px;
}

/* Laid out at the full open width at all times; the shell clips it. */
.ic-content {
  position: relative;
}

.ic-head {
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px; /* 46px minus the 1px border on each side */
  margin: 0;
  padding: 0 0 0 18px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.ic-head:focus {
  outline: none;
}

.ic-label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Rides the shell's right edge as the card widens. */
.ic-plus {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ic-plus-bg);
  pointer-events: none;
}

.ic-plus::before,
.ic-plus::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 1.5px;
  margin: -0.75px 0 0 -6px;
  border-radius: 1px;
  background: var(--ic-fg);
}

.ic-plus::after {
  transform: rotate(90deg);
}

.ic-body {
  padding: 2px 18px 18px;
  transform-origin: top left;
  opacity: 0;
}

.ic-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ic-muted);
}

/* Inline links get a wavy underline that ripples on hover. */
.ic-body p a {
  color: var(--ic-fg);
  text-decoration: none;
  padding-bottom: 4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='5' viewBox='0 0 12 5'%3E%3Cpath d='M0 2.5 Q3 0 6 2.5 T12 2.5' fill='none' stroke='%2316181d' stroke-opacity='.45' stroke-width='1.2'/%3E%3C/svg%3E")
    repeat-x 0 100% / 12px 5px;
  border-radius: 3px;
}

.ic-body p a:hover {
  animation: ic-wave 0.6s linear infinite;
}

@keyframes ic-wave {
  to {
    background-position-x: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ic-body p a:hover {
    animation: none;
  }
}

.ic-body p a:focus-visible {
  outline: 2px solid var(--ic-focus);
  outline-offset: 2px;
}

.ic-body p + p {
  margin-top: 8px;
}

.ic-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.ic-links a {
  font-size: 13px;
  color: var(--ic-link);
  text-decoration: none;
  border-radius: 4px;
}

.ic-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ic-links a:focus-visible {
  outline: 2px solid var(--ic-focus);
  outline-offset: 2px;
}

/* Reduced motion: size snaps, the content cross-fades. */
.ic.is-reduced-motion,
.ic.is-reduced-motion.is-pressed {
  transition: none;
  transform: none;
}

.ic.is-reduced-motion .ic-body {
  transition: opacity 200ms ease;
  filter: none !important;
  transform: none !important;
}

@media (prefers-reduced-transparency: reduce) {
  .ic {
    background: var(--ic-bg-solid);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
