/* ✧ cozy terminal windows + a pastel Pygments theme (light and night-snow) ✧ */

.code-window {
  position: relative; margin: 1.6em 0; border-radius: 16px; overflow: hidden;
  border: 2px solid var(--line); background: var(--code-bg); box-shadow: var(--shadow-sm);
}
.code-head {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px;
  background: var(--code-head); border-bottom: 2px solid var(--line-soft); font: 600 .78rem var(--mono); color: var(--ink-soft);
}
/* three little paw pads instead of traffic lights */
.paw-dots { display: inline-flex; gap: 4px; flex: none; }
.paw-dots .pd { width: 14px; height: 14px; }
.pd1 { color: #ffa9c8; } .pd2 { color: #ffc08f; } .pd3 { color: #8fdcb8; }
.code-window:hover .pd1 { animation: pad-tap .5s ease; }
.code-window:hover .pd2 { animation: pad-tap .5s .08s ease; }
.code-window:hover .pd3 { animation: pad-tap .5s .16s ease; }
.code-title { padding: 1px 10px; border-radius: 8px 8px 0 0; background: var(--code-bg); color: var(--ink); margin-bottom: -8px; padding-bottom: 6px; border: 2px solid var(--line-soft); border-bottom: 0; }
.code-spacer { flex: 1; }
.code-lang { text-transform: lowercase; color: var(--lav-deep); letter-spacing: .04em; }
.code-copy {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--panel); color: var(--ink-soft); font: 600 .74rem var(--mono);
  transition: border-color .15s, color .15s;
}
.code-copy .icon { width: 13px; height: 13px; color: var(--pink-deep); }
.code-copy:hover { border-color: var(--pink-deep); color: var(--ink); }
.code-copy.copied { border-color: var(--mint-deep); color: var(--mint-deep); }
.code-copy.copied .icon { color: var(--mint-deep); }

.code-window pre.code { margin: 0; padding: 14px 0; overflow-x: auto; font: 400 .87rem/1.65 var(--mono); color: #4f4560; tab-size: 4; }
.code-window code { display: block; min-width: max-content; font: inherit; }
.code .line { display: block; padding: 0 18px; min-height: 1.65em; }
.code .line.hl { background: color-mix(in srgb, var(--fox) 18%, transparent); box-shadow: inset 3px 0 0 var(--fox); }
.code .line.add { background: color-mix(in srgb, var(--mint-deep) 16%, transparent); box-shadow: inset 3px 0 0 var(--mint-deep); }
.code .line.del { background: color-mix(in srgb, var(--red-deep) 13%, transparent); box-shadow: inset 3px 0 0 var(--red-deep); opacity: .8; }
.code .line.add::before, .code .line.del::before { display: inline-block; width: 1.2em; margin-left: -1.2em; font-weight: 700; }
.code .line.add::before { content: "+"; color: var(--mint-deep); }
.code .line.del::before { content: "−"; color: var(--red-deep); }
.code.numbered code { counter-reset: ln; }
.code.numbered .line::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 2.4em; margin-right: 1.1em; text-align: right; color: color-mix(in srgb, var(--ink-soft) 55%, transparent); user-select: none; }
.code.numbered .line.add::before, .code.numbered .line.del::before { margin-left: 0; font-weight: 400; }
.code.numbered .line.add::before { content: counter(ln) " +"; }
.code.numbered .line.del::before { content: counter(ln) " −"; }
.code.session .go { color: var(--ink-soft); }
.code .gp { color: var(--pink-deep); user-select: none; font-weight: 700; }

/* ---------- Pygments tokens (light) ---------- */
.code .c, .code .ch, .code .cm, .code .c1, .code .cs, .code .cpf { color: #9a91aa; font-style: italic; }
.code .cp { color: #c06d9b; }
.code .k, .code .kc, .code .kd, .code .kn, .code .kp, .code .kr { color: #9a5fd6; font-weight: 600; }
.code .kt { color: #2f8fb8; font-weight: 600; }
.code .o, .code .ow { color: #d1607d; }
.code .p { color: #7b6f86; }
.code .s, .code .s1, .code .s2, .code .sa, .code .sb, .code .sc, .code .sd, .code .se, .code .sh, .code .si, .code .sx, .code .sr, .code .ss, .code .dl { color: #3a9a6c; }
.code .se, .code .si { color: #c0752f; }
.code .m, .code .mb, .code .mf, .code .mh, .code .mi, .code .mo, .code .il { color: #d0702c; }
.code .nf, .code .fm { color: #3c79c9; }
.code .nc, .code .nn, .code .ne { color: #c0752f; font-weight: 600; }
.code .nb, .code .bp { color: #b05a90; }
.code .nv, .code .vc, .code .vg, .code .vi, .code .vm { color: #b0567a; }
.code .na { color: #c0752f; }
.code .nt { color: #9a5fd6; }
.code .nl { color: #3a9a6c; }
.code .nd { color: #c06d9b; }
.code .no { color: #d0702c; }
.code .gd { color: #c94f69; background: color-mix(in srgb, var(--red-deep) 10%, transparent); }
.code .gi { color: #2d8a5c; background: color-mix(in srgb, var(--mint-deep) 12%, transparent); }
.code .gh, .code .gu { color: #9a5fd6; font-weight: 700; }
.code .err { color: inherit; }

/* ---------- night snow ---------- */
[data-theme="dark"] .code-window pre.code { color: #e3dcef; }
[data-theme="dark"] .code .c, [data-theme="dark"] .code .ch, [data-theme="dark"] .code .cm, [data-theme="dark"] .code .c1, [data-theme="dark"] .code .cs, [data-theme="dark"] .code .cpf { color: #8b86a6; }
[data-theme="dark"] .code .cp, [data-theme="dark"] .code .nd { color: #f2a6cf; }
[data-theme="dark"] .code .k, [data-theme="dark"] .code .kc, [data-theme="dark"] .code .kd, [data-theme="dark"] .code .kn, [data-theme="dark"] .code .kp, [data-theme="dark"] .code .kr, [data-theme="dark"] .code .nt { color: #c9a8ff; }
[data-theme="dark"] .code .kt { color: #82cdf0; }
[data-theme="dark"] .code .o, [data-theme="dark"] .code .ow { color: #ff9cb6; }
[data-theme="dark"] .code .p { color: #b4abc6; }
[data-theme="dark"] .code .s, [data-theme="dark"] .code .s1, [data-theme="dark"] .code .s2, [data-theme="dark"] .code .sa, [data-theme="dark"] .code .sb, [data-theme="dark"] .code .sc, [data-theme="dark"] .code .sd, [data-theme="dark"] .code .sh, [data-theme="dark"] .code .sx, [data-theme="dark"] .code .sr, [data-theme="dark"] .code .ss, [data-theme="dark"] .code .dl, [data-theme="dark"] .code .nl { color: #8fe0b5; }
[data-theme="dark"] .code .m, [data-theme="dark"] .code .mb, [data-theme="dark"] .code .mf, [data-theme="dark"] .code .mh, [data-theme="dark"] .code .mi, [data-theme="dark"] .code .mo, [data-theme="dark"] .code .il, [data-theme="dark"] .code .no, [data-theme="dark"] .code .se, [data-theme="dark"] .code .si { color: #ffbf8a; }
[data-theme="dark"] .code .nf, [data-theme="dark"] .code .fm { color: #8db8ff; }
[data-theme="dark"] .code .nc, [data-theme="dark"] .code .nn, [data-theme="dark"] .code .ne, [data-theme="dark"] .code .na { color: #ffcf8f; }
[data-theme="dark"] .code .nb, [data-theme="dark"] .code .bp, [data-theme="dark"] .code .nv, [data-theme="dark"] .code .vc, [data-theme="dark"] .code .vg, [data-theme="dark"] .code .vi, [data-theme="dark"] .code .vm { color: #f5a8c8; }
[data-theme="dark"] .code .gd { color: #ff9fb1; }
[data-theme="dark"] .code .gi { color: #96e6bb; }

@keyframes pad-tap { 50% { transform: translateY(-3px) rotate(-10deg); } }
