/* pouncecode.com — the site IS an editor.
   PounceCode ships the JetBrains "Rider Dark" palette as its default theme,
   so the site uses the same token colours the app paints code with: a reader
   who installs it should recognise the place. Mono everywhere, a line-number
   gutter on anything code-shaped, tab-strip nav. No frameworks, no webfonts,
   no emojis — inline SVG only. */

:root {
  /* Straight from the app's themes.js 'rider' theme. */
  --bg:        #1E1F22;
  --surface:   #2B2D30;
  --surface2:  #313438;
  --border:    #393B40;
  --border2:   #4E5157;
  --text:      #BCBEC4;
  --text-dim:  #A8ADB4;
  --text-mute: #6F737A;
  --accent:    #56A8F5;
  --accent2:   #2AACB8;
  --keyword:   #CC7832;
  --string:    #6AAB73;
  --number:    #2AACB8;
  --comment:   #629755;
  --param:     #9876AA;
  --bracket:   #C792EA;
  --func:      #FFC66D;
  --error:     #FF5261;
  --warn:      #FFC66D;
  --success:   #6AAB73;
  --selection: #214283;

  --radius: 8px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Monaco, "Cascadia Mono", monospace;
  --nav-h: 54px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 var(--mono);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--selection); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
b, strong { color: #E3E5E9; font-weight: 600; }
h1, h2, h3 { color: #E3E5E9; font-weight: 600; line-height: 1.25; }
img { max-width: 100%; height: auto; display: block; border-radius: var(--radius); }
hr { border: 0; border-top: 1px solid var(--border); margin: 44px 0; }

code {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px; font-size: .92em; color: var(--text);
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
.g  { color: var(--accent); }
.kw { color: var(--keyword); }
.st { color: var(--string); }
.cm { color: var(--comment); font-style: italic; }
.fn { color: var(--func); }
.ty { color: var(--number); }
.pm { color: var(--param); }

/* ---- nav: the editor's tab strip ------------------------------------ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  background: rgba(30, 31, 34, .94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-in {
  max-width: 1080px; margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; gap: 3px; height: var(--nav-h); overflow-x: auto;
}
.nav-in::-webkit-scrollbar { display: none; }
.nav-brand {
  display: flex; align-items: center; gap: 8px; margin-right: 16px;
  white-space: nowrap; font-weight: 700; color: #E3E5E9;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand .a { color: var(--accent); }
.nav-brand svg { width: 18px; height: 18px; stroke: var(--accent); flex-shrink: 0; }
.nav-tab {
  padding: 5px 12px; border-radius: 6px 6px 0 0; color: var(--text-mute);
  white-space: nowrap; font-size: 13.5px; border: 1px solid transparent; border-bottom: none;
}
.nav-tab:hover { color: var(--text); text-decoration: none; background: var(--surface); }
/* An editor marks the open file with a lit tab and a top rule, not brackets. */
.nav-tab.active {
  color: #E3E5E9; background: var(--surface);
  border-color: var(--border); box-shadow: inset 0 2px 0 var(--accent);
}
.nav-get { margin-left: auto; color: var(--accent) !important; border: 1px solid var(--border2); border-radius: 6px; }
.nav-get:hover { background: rgba(86, 168, 245, .12); }

main { padding-top: calc(var(--nav-h) + 46px); padding-bottom: 80px; }

/* ---- hero ----------------------------------------------------------- */
h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -.5px; }
.sub { color: var(--text-dim); font-size: clamp(15px, 2vw, 17.5px); margin-top: 16px; max-width: 74ch; }

.brewline {
  display: block; margin: 26px 0 8px; padding: 13px 16px;
  background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius);
  font-size: 14px; color: var(--text); overflow-x: auto; white-space: nowrap;
}
.brewline b { color: var(--string); font-weight: 600; }
.doclink { color: var(--text-mute); font-size: 13px; margin-bottom: 8px; }

/* ---- editor pane: the site's signature block ------------------------ */
.pane {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin: 26px 0;
}
.pane-bar {
  display: flex; align-items: center; gap: 8px; padding: 9px 13px;
  background: var(--surface2); border-bottom: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-mute);
}
.pane-dots { display: flex; gap: 6px; margin-right: 5px; }
.pane-dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.pane-dots i:nth-child(1) { background: #ED6A5E; }
.pane-dots i:nth-child(2) { background: #F4BF4F; }
.pane-dots i:nth-child(3) { background: #61C554; }
.pane-name { color: var(--text-dim); }
.pane-right { margin-left: auto; color: var(--text-mute); }
.pane-body { padding: 0; overflow-x: auto; }

/* code with a line-number gutter */
.code { display: grid; grid-template-columns: auto 1fr; font-size: 13.5px; line-height: 1.75; }
.code .ln {
  padding: 14px 12px 14px 16px; text-align: right; color: #4B4F57;
  background: var(--bg); border-right: 1px solid var(--border);
  user-select: none; white-space: pre;
}
.code .src { padding: 14px 18px; white-space: pre; color: var(--text); background: var(--bg); }

/* ---- cards ---------------------------------------------------------- */
.grid { display: grid; gap: 14px; margin-top: 22px; }
.grid.two   { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 17px 19px;
}
.card h3 { font-size: 15.5px; margin-bottom: 7px; display: flex; align-items: center; gap: 8px; }
.card h3 svg { width: 16px; height: 16px; stroke: var(--accent); flex-shrink: 0; }
.card p { color: var(--text-dim); font-size: 13.5px; line-height: 1.6; }
.card p + p { margin-top: 8px; }

/* ---- section headings ----------------------------------------------- */
.sec { margin-top: 64px; }
.sec > h2 { font-size: clamp(21px, 3vw, 27px); }
.sec > h2::before { content: "// "; color: var(--comment); font-weight: 400; }
.sec > .lede { color: var(--text-dim); margin-top: 10px; max-width: 76ch; font-size: 14.5px; }

/* ---- shots ---------------------------------------------------------- */
figure { margin: 22px 0; }
figure img { border: 1px solid var(--border); background: var(--bg); }
figcaption { color: var(--text-mute); font-size: 12.5px; margin-top: 9px; }

/* A placeholder that is honest about being one. Better than shipping a
   stock image: it says exactly what belongs here and never gets mistaken
   for the product. */
.shot-todo {
  border: 1px dashed var(--border2); border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, var(--surface) 0 10px, var(--surface2) 10px 20px);
  aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center;
  color: var(--text-mute); font-size: 13px; text-align: center; padding: 20px;
}

/* ---- tables --------------------------------------------------------- */
.tbl-wrap { overflow-x: auto; margin-top: 18px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; min-width: 520px; }
th, td { text-align: left; padding: 9px 13px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-mute); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
td code { background: transparent; border: 0; padding: 0; color: var(--accent2); }

/* ---- tool catalogue -------------------------------------------------- */
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin: 22px 0 6px; position: sticky; top: var(--nav-h); z-index: 10;
  background: var(--bg); padding: 12px 0;
}
.toolbar input {
  flex: 1 1 240px; min-width: 200px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border2); border-radius: 6px; padding: 9px 12px;
  font: 14px var(--mono);
}
.toolbar input:focus { outline: none; border-color: var(--accent); }
.chip {
  padding: 6px 11px; border-radius: 999px; font-size: 12.5px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-mute);
}
.chip:hover { color: var(--text); }
.chip.on { background: rgba(86, 168, 245, .14); border-color: var(--accent); color: var(--accent); }
.count { color: var(--text-mute); font-size: 12.5px; }

.tool {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 17px; margin-bottom: 10px;
}
.tool-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tool-name { color: var(--func); font-size: 14.5px; font-weight: 600; }
.tool-grp { color: var(--text-mute); font-size: 12px; }
.tool-desc { color: var(--text-dim); font-size: 13.5px; margin-top: 6px; }
.tool-args { margin-top: 10px; font-size: 12.5px; color: var(--text-mute); }
.tool-args div { padding: 3px 0; }
.tool-args .an { color: var(--param); }
.tool-args .at { color: var(--number); }

.tag {
  font-size: 11px; padding: 2px 7px; border-radius: 4px; letter-spacing: .3px;
  border: 1px solid var(--border2); color: var(--text-mute);
}
.tag.danger { color: var(--warn); border-color: rgba(255, 198, 109, .45); background: rgba(255, 198, 109, .08); }
.tag.always { color: var(--string); border-color: rgba(106, 171, 115, .45); background: rgba(106, 171, 115, .08); }

/* ---- callout -------------------------------------------------------- */
.note {
  border-left: 3px solid var(--accent); background: var(--surface);
  padding: 13px 17px; border-radius: 0 var(--radius) var(--radius) 0;
  margin: 20px 0; font-size: 13.5px; color: var(--text-dim);
}
.note.warn { border-left-color: var(--warn); }
.note b { color: #E3E5E9; }

/* ---- footer --------------------------------------------------------- */
.foot {
  border-top: 1px solid var(--border); margin-top: 72px; padding: 26px 0 50px;
  color: var(--text-mute); font-size: 13px;
}
.foot-in { max-width: 1080px; margin: 0 auto; padding: 0 22px; display: flex; gap: 18px; flex-wrap: wrap; }
.foot a { color: var(--text-dim); }
.foot .sp { margin-left: auto; }

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .code { font-size: 12.5px; }
  .toolbar { position: static; }
}
