/* „Skąd wie” (#zrodla), variant A: points, source buttons with native file icons, the peek into a document,
   the floating glasses. Behaviour in sources.js. The chat example stays in styles.css. */

/* the three points: the bold label is a small blue heading */
.points { margin-top: 34px; border-top: 1px solid var(--line); }
.points li { padding-block: 16px; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.points b { display: block; margin-bottom: 3px; font-size: 18px; font-weight: 800; line-height: 1.3; letter-spacing: -0.02em; color: var(--blue); }

.learn { position: relative; padding: 24px; border-radius: var(--r-panel); background: var(--pale); }

/* sources: a caption row, the buttons, and a free lane under them for the glasses */
.srcs { padding-bottom: 32px; margin-bottom: 20px; border-bottom: 1px solid var(--pale-line); }
.srcs__cap { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.srcs__hint { font-weight: 500; }
.srcs__list { display: flex; flex-wrap: wrap; gap: 8px; }
.src {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 13px 6px 8px;
  border: 0; border-radius: 7px; background: var(--white); color: var(--ink);
  font: 600 13.5px/1.2 var(--font); cursor: pointer; -webkit-tap-highlight-color: transparent;
  box-shadow: inset 0 0 0 1px var(--pale-line), 0 1px 0 #172c420a;
  transition: box-shadow 0.18s, transform 0.25s var(--ease);
}
.src__ic { display: block; flex: none; width: 24px; height: 24px; }
.src__ic svg, .src-tip__ic svg, .pv-ic svg { display: block; width: 100%; height: 100%; }
.src:hover, .src.is-open { box-shadow: inset 0 0 0 1px var(--blue-line), var(--shadow-card); transform: translateY(-1px); }
.src:active { transform: translateY(0) scale(0.98); }
.src:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.learn__title { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; }

/* ---------- the peek ---------- */
.src-tip {
  position: absolute; top: 0; left: 0; z-index: 6; width: min(304px, calc(100vw - 20px));
  padding: 10px 12px 12px; border-radius: var(--r-panel); background: var(--white);
  box-shadow: 0 0 0 1px #172c4214, var(--shadow-float);
  pointer-events: none; opacity: 0; visibility: hidden; transform: translateY(6px) scale(0.98); transform-origin: var(--ax, 50%) 100%;
  transition: opacity 0.4s, transform 0.4s var(--ease), visibility 0s linear 0.4s;
}
.src-tip.is-below { transform: translateY(-6px) scale(0.98); transform-origin: var(--ax, 50%) 0; }
.src-tip.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity 0.16s, transform 0.28s var(--ease), visibility 0s; }
.src-tip__head { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; font-size: 13px; }
.src-tip__head b { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.src-tip__ic { flex: none; width: 18px; height: 18px; }
.src-tip__tag { margin-left: auto; flex: none; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.src-tip__body { position: relative; }
.src-tip__body.is-frag { max-height: 178px; overflow: hidden; }
/* only a fragment: the bottom fades into the tooltip */
.src-tip__body.is-frag::after { content: ""; position: absolute; left: -2px; right: -2px; bottom: 0; height: 64px; background: linear-gradient(#fff0, var(--white) 88%); }
.src-tip__arrow { position: absolute; left: var(--ax, 50%); bottom: -6px; width: 12px; height: 12px; margin-left: -6px; background: var(--white); transform: rotate(45deg); box-shadow: 1px 1px 0 #172c4214; }
.src-tip.is-below .src-tip__arrow { top: -6px; bottom: auto; box-shadow: -1px -1px 0 #172c4214; }

/* document previews (Salon Pod Lokiem) */
.pv-paper { padding: 12px 14px 14px; border-radius: 4px; background: var(--white); box-shadow: 0 0 0 1px var(--line), 0 2px 6px #172c420d; font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.pv-brand { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #b4527a; }
.pv-h { margin-top: 2px; font-size: 15px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.pv-sub { margin-bottom: 8px; font-size: 11px; color: var(--muted); }
.pv-price dl { margin: 8px 0 0; }
.pv-price dl div { display: flex; align-items: baseline; gap: 6px; padding-block: 3px; }
.pv-price dl div::after { content: ""; order: 1; flex: 1; min-width: 12px; border-bottom: 1px dotted #b3bfcf; transform: translateY(-3px); }
.pv-price dt { order: 0; }
.pv-price dd { order: 2; margin: 0; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.pv-doc p + p { margin-top: 6px; }
.pv-doc b { color: var(--ink); }
.pv-doc .is-hl { margin-inline: -4px; padding: 2px 4px; border-radius: 3px; background: var(--pale); }
.pv-cal__day { margin-bottom: 8px; font-size: 13px; font-weight: 800; color: var(--ink); }
.pv-cal__day::first-letter { text-transform: uppercase; }
.pv-cal ol { display: grid; gap: 4px; }
.pv-cal li { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; font-size: 12px; }
.pv-cal time { color: var(--muted); font-variant-numeric: tabular-nums; }
.pv-cal span { padding: 5px 8px; border-radius: 4px; background: var(--pale); box-shadow: inset 2px 0 0 var(--blue); color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-cal .is-free span { background: none; box-shadow: inset 0 0 0 1px var(--pale-line); color: var(--muted); font-weight: 500; }
.pv-cal .is-break span { background: #f3efe6; box-shadow: inset 2px 0 0 #c9a96b; }
.pv-txt { padding: 10px 12px 12px; border-radius: 4px; background: #fbfcfd; box-shadow: 0 0 0 1px var(--line); font: 11.5px/1.5 ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; color: var(--ink-2); }
.pv-txt p + p { margin-top: 8px; }
.pv-txt i { font-style: normal; color: var(--muted); }
.pv-files { display: grid; gap: 1px; font-size: 12.5px; }
.pv-files li { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 6px; border-radius: 4px; color: var(--ink); }
.pv-files li:first-child { background: var(--pale); }
.pv-files li span:nth-child(2) { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pv-ic { flex: none; width: 16px; height: 16px; }
.pv-files em { margin-left: auto; flex: none; padding: 1px 6px; border-radius: 999px; background: var(--blue); color: var(--white); font-size: 10.5px; font-style: normal; font-weight: 700; }

/* ---------- the floating glasses ---------- */
/* hit box 38 × 24 (sources.js: W, H); the glasses float inside it, the shadow sits at the bottom */
.peek {
  position: absolute; top: 0; left: 0; z-index: 4; width: 38px; height: 24px; cursor: pointer;
  opacity: 0; pointer-events: none; -webkit-tap-highlight-color: transparent;
  transition: transform var(--glide, 0ms) cubic-bezier(0.45, 0.05, 0.35, 1), opacity 0.6s var(--ease);
}
.peek.is-in { opacity: 1; pointer-events: auto; }
.peek.is-off { display: none; }
.peek.is-bye { opacity: 0; pointer-events: none; transition: transform var(--glide, 0ms), opacity 2s ease-in; }
.peek__lean { position: absolute; left: 2px; top: 4px; width: 34px; transform: rotate(var(--lean, 0deg)) scale(var(--hov, 1)); transition: transform 0.9s var(--pop); }
.peek:hover { --hov: 1.12; }
.peek__float { display: block; animation: peek-bob 2.9s ease-in-out infinite; }
.peek .glasses { width: 34px; height: auto; animation: peek-tilt 4.7s ease-in-out infinite; transform-origin: 50% 40%; }
.peek .glasses__eyes { transform-box: fill-box; transform-origin: center; transition: transform 70ms; }
.peek.is-blink .glasses__eyes { transform: scaleY(0.12); }
.peek__shadow { position: absolute; left: 9px; bottom: 1px; width: 20px; height: 3px; border-radius: 50%; background: radial-gradient(closest-side, #172c4230, #172c4200); animation: peek-shadow 2.9s ease-in-out infinite; }
.peek.is-paused .peek__float, .peek.is-paused .glasses, .peek.is-paused .peek__shadow { animation-play-state: paused; }
@keyframes peek-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }
@keyframes peek-tilt { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes peek-shadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(0.8); opacity: 0.6; } }

@media (max-width: 600px) {
  .learn { padding: 18px 16px; margin-inline: -4px; }
  .points b { font-size: 17px; }
  .src { min-height: 40px; padding-right: 11px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .peek__float, .peek .glasses, .peek__shadow { animation: none; }
  .src:hover, .src.is-open { transform: none; }
}
