/* help.29court.com: tiny tools, dark and sharp. */
:root {
  --bg: #0b0c0e;
  --bg2: #121417;
  --bg3: #1a1d22;
  --line: #262b33;
  --fg: #e8eaed;
  --dim: #9aa1ab;
  --faint: #5c636d;
  --acc: #b6f34c;
  --acc-dim: #7fb32e;
  --err: #ff6b6b;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* header */
header.site {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
header.site .wrap { display: flex; align-items: center; gap: 26px; }
.logo { font-family: var(--mono); font-weight: 700; font-size: 15px; color: var(--fg); }
.logo b { color: var(--acc); }
nav.top { display: flex; gap: 20px; margin-left: auto; }
nav.top a { color: var(--dim); font-family: var(--mono); font-size: 13px; }
nav.top a:hover, nav.top a.on { color: var(--acc); text-decoration: none; }

/* hero */
.hero { padding: 64px 0 40px; }
.kicker { font-family: var(--mono); font-size: 12px; color: var(--acc); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 16px; }
h1 { font-size: 40px; line-height: 1.15; letter-spacing: -1px; margin-bottom: 16px; }
h1 .hl { color: var(--acc); }
.lede { color: var(--dim); font-size: 17px; max-width: 620px; }
.promise {
  margin-top: 22px;
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--acc-dim);
  background: rgba(182, 243, 76, 0.06);
  padding: 10px 16px; border-radius: 8px;
  font-family: var(--mono); font-size: 13px; color: var(--acc);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 8px var(--acc); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; padding: 24px 0 64px; }
.card {
  border: 1px solid var(--line); border-radius: 12px; padding: 24px;
  background: var(--bg2); display: block; color: var(--fg);
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--acc-dim); text-decoration: none; transform: translateY(-2px); }
.card .t { font-family: var(--mono); font-size: 12px; color: var(--faint); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 10px; }
.card h2 { font-size: 20px; margin-bottom: 8px; letter-spacing: -0.5px; }
.card p { color: var(--dim); font-size: 14px; }
.card .go { margin-top: 14px; font-family: var(--mono); font-size: 13px; color: var(--acc); }

/* tool layout */
.toolhead { padding: 40px 0 8px; }
.toolhead h1 { font-size: 30px; }
.toolhead p { color: var(--dim); max-width: 640px; }
.panel {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; margin: 20px 0;
}
label.lbl { display: block; font-family: var(--mono); font-size: 12px; color: var(--dim); letter-spacing: 1px; text-transform: uppercase; margin: 0 0 8px; }
textarea, input[type=text], select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  color: var(--fg); font-family: var(--mono); font-size: 13px; padding: 12px;
}
textarea { min-height: 220px; resize: vertical; line-height: 1.6; }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--acc-dim); }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.row[hidden] { display: none; }
button, .btn {
  font-family: var(--mono); font-size: 13px; cursor: pointer;
  background: var(--bg3); color: var(--fg); border: 1px solid var(--line);
  padding: 10px 18px; border-radius: 8px; transition: border-color .15s, background .15s;
}
button:hover, .btn:hover { border-color: var(--acc-dim); }
button.primary { background: var(--acc); color: #0b0c0e; border-color: var(--acc); font-weight: 700; }
button.primary:hover { background: #c8ff70; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
select { width: auto; }
.out {
  margin-top: 14px; padding: 14px; border-radius: 8px; background: var(--bg);
  border: 1px solid var(--line); font-family: var(--mono); font-size: 13px;
  white-space: pre-wrap; word-break: break-word; max-height: 340px; overflow: auto;
}
.out.err { border-color: var(--err); color: var(--err); }
.out.ok { border-color: var(--acc-dim); }
.hint { color: var(--faint); font-size: 13px; font-family: var(--mono); margin-top: 10px; }
.stats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 12px; }
.stat { font-family: var(--mono); font-size: 13px; color: var(--dim); }
.stat b { color: var(--acc); font-size: 18px; display: block; }

/* dropzone */
.drop {
  border: 2px dashed var(--line); border-radius: 12px; padding: 48px 20px;
  text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
  margin: 20px 0;
}
.drop:hover, .drop.over { border-color: var(--acc); background: rgba(182,243,76,0.04); }
.drop .big { font-size: 17px; margin-bottom: 6px; }
.drop .small { color: var(--faint); font-family: var(--mono); font-size: 12px; }
.progress { height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; margin-top: 14px; display: none; }
.progress > div { height: 100%; width: 0%; background: var(--acc); transition: width .2s; }
.status { font-family: var(--mono); font-size: 13px; color: var(--dim); margin-top: 10px; }
.status.ok { color: var(--acc); }
.status.err { color: var(--err); }
.filemeta { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-top: 8px; }
img.preview { max-width: 100%; max-height: 280px; border-radius: 8px; margin-top: 12px; border: 1px solid var(--line); }
.tabs { display: flex; gap: 8px; margin: 20px 0 0; }
.tabs button.on { border-color: var(--acc); color: var(--acc); }

footer.site {
  border-top: 1px solid var(--line); margin-top: auto; padding: 22px 0;
  color: var(--faint); font-family: var(--mono); font-size: 12px;
}
footer.site .wrap { display: flex; gap: 18px; align-items: center; }
footer.site .r { margin-left: auto; }
@media (max-width: 640px) {
  h1 { font-size: 30px; }
  nav.top { gap: 12px; }
}

/* ---------- motion kit: background, toasts, dropdowns, sliders, flourish ---------- */
.bg-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
body { position: relative; }
header.site, main, footer.site { position: relative; z-index: 1; }

/* toasts */
.toast-root {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg3); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; font-family: var(--mono); font-size: 13px; color: var(--fg);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5); cursor: pointer; max-width: 340px;
}
.toast .tdot { width: 8px; height: 8px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 8px var(--acc); flex: none; }
.toast.ok .tdot { background: var(--acc); box-shadow: 0 0 8px var(--acc); }
.toast.err .tdot { background: var(--err); box-shadow: 0 0 8px var(--err); }

/* custom dropdown */
.dd { position: relative; display: inline-block; }
.dd-native {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  width: 100%; height: 100%;
}
.dd-btn {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  color: var(--fg); font-family: var(--mono); font-size: 13px; padding: 10px 14px;
  min-width: 150px; justify-content: space-between;
}
.dd-btn:hover { border-color: var(--acc-dim); }
.dd-btn.open { border-color: var(--acc); }
.dd-chev { color: var(--acc); font-size: 11px; transition: transform .2s; }
.dd-btn.open .dd-chev { transform: rotate(180deg); }
.dd-list {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 100%; z-index: 100;
  background: var(--bg3); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; display: none; box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.dd-list.open { display: block; }
.dd-opt {
  padding: 10px 14px; border-radius: 6px; font-family: var(--mono); font-size: 13px;
  color: var(--dim); cursor: pointer; white-space: nowrap;
}
.dd-opt:hover { background: rgba(182,243,76,0.08); color: var(--fg); }
.dd-opt.sel { color: var(--acc); }

/* range slider */
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 220px; height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--acc) var(--fill, 50%), var(--bg3) var(--fill, 50%));
  outline: none; padding: 0; border: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--acc); border: 3px solid #0b0c0e; box-shadow: 0 0 0 1px var(--acc), 0 2px 10px rgba(0,0,0,0.5);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--acc); border: 3px solid #0b0c0e; box-shadow: 0 0 0 1px var(--acc);
}
.slider-val { font-family: var(--mono); font-size: 13px; color: var(--acc); min-width: 64px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; color: var(--dim); cursor: pointer; }
.check input { accent-color: var(--acc); width: 16px; height: 16px; cursor: pointer; }

/* completion flourish */
body.no-scroll { overflow: hidden; }
.flourish {
  position: fixed; inset: 0; z-index: 300; display: none;
  align-items: center; justify-content: center; overflow: hidden;
}
.flourish-art {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.flourish-shade {
  position: absolute; inset: 0; background: rgba(5,6,8,0.45);
}
.flourish-inner { position: relative; text-align: center; z-index: 2; }
.flourish-stamp {
  font-family: var(--mono); font-weight: 700; font-size: clamp(40px, 8vw, 88px);
  color: #fff; letter-spacing: -2px;
  text-shadow: 0 4px 40px rgba(0,0,0,0.8), 0 0 60px rgba(182,243,76,0.35);
  border: 3px solid var(--acc); border-radius: 16px; padding: 8px 34px;
  display: inline-block; background: rgba(5,6,8,0.55); backdrop-filter: blur(4px);
}
.flourish-sub {
  margin-top: 18px; font-family: var(--mono); font-size: 15px; color: var(--acc);
  text-shadow: 0 2px 12px rgba(0,0,0,0.9);
}
.flourish-spray { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.flourish-spray i {
  position: absolute; left: 50%; top: 62%; width: 7px; height: 7px; border-radius: 50%;
  background: var(--acc); box-shadow: 0 0 10px var(--acc);
}

/* mini sweep for small success states */
.mini-sweep {
  position: absolute; top: 0; bottom: 0; width: 40%; left: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(182,243,76,0.22), transparent);
  border-radius: inherit;
}

/* skeleton shimmer for loading states */
.skel {
  position: relative; overflow: hidden; color: transparent !important;
  background: var(--bg3); border-radius: 6px; pointer-events: none;
}
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(232,234,237,0.08) 50%, transparent 80%);
  animation: skel 1.2s infinite;
}
@keyframes skel { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

@media (max-width: 640px) {
  .toast-root { left: 20px; right: 20px; align-items: stretch; }
  input[type="range"] { width: 160px; }
}

/* ---------- keyboard-first: skip link, focus rings, kbd chips, shortcuts dialog ---------- */
.skip {
  position: absolute; left: 16px; top: -70px; z-index: 400;
  background: var(--acc); color: #0b0c0e;
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  padding: 10px 18px; border-radius: 8px; text-decoration: none;
  transition: top .15s ease;
}
.skip:focus { top: 12px; color: #0b0c0e; text-decoration: none; }

/* beautiful focus states everywhere: never the default browser outline */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, .card:focus-visible, .drop:focus-visible, .dd-btn:focus-visible,
.dd-opt:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
  border-radius: 6px;
}
textarea:focus-visible, input:focus-visible, select:focus-visible { border-color: var(--acc); }

.kbd {
  display: inline-block; font-family: var(--mono); font-size: 11px; line-height: 1.4;
  color: var(--dim); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 7px; margin-left: 8px;
  background: var(--bg); white-space: nowrap; vertical-align: 1px;
}
button.primary .kbd { color: #0b0c0e; border-color: rgba(0,0,0,0.28); background: rgba(255,255,255,0.28); }
.kbd-plus { color: var(--faint); font-size: 11px; margin: 0 2px; }

/* dropdown keyboard highlight */
.dd-opt.kb { background: rgba(182,243,76,0.14); color: var(--fg); }

/* dropzone as a keyboard-operable button */
.drop:focus-visible { border-color: var(--acc); }

/* Safari-safe keyboard cursor. Safari does not match :focus-visible on
   programmatic .focus(), so the roving zone system paints the identical lime
   ring with this class. It is added/removed by HelpKeys in js/keys.js. */
.kb-focus {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
  border-radius: 6px;
}
textarea.kb-focus, input.kb-focus, select.kb-focus { border-color: var(--acc); }
.drop.kb-focus { border-color: var(--acc); }

/* shortcuts overlay */
.sc-overlay {
  position: fixed; inset: 0; z-index: 350;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5,6,8,0.72); backdrop-filter: blur(6px); padding: 20px;
}
.sc-overlay[hidden] { display: none; }
.sc-dialog {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 14px;
  max-width: 540px; width: 100%; max-height: 82vh; overflow: auto;
  padding: 26px 28px; box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.sc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sc-head h2 { font-size: 22px; letter-spacing: -0.5px; margin: 0; }
.sc-close {
  background: var(--bg3); border: 1px solid var(--line); border-radius: 8px;
  width: 34px; height: 34px; padding: 0; font-size: 14px; color: var(--dim);
  display: inline-flex; align-items: center; justify-content: center;
}
.sc-close:hover { color: var(--fg); border-color: var(--acc-dim); }
.sc-dialog h3 {
  font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--acc); margin: 16px 0 4px;
}
.sc-sub { color: var(--faint); font-size: 13px; font-family: var(--mono); margin-top: 4px; }
.sc-table { width: 100%; border-collapse: collapse; margin: 6px 0 4px; }
.sc-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); color: var(--dim); font-size: 13px; vertical-align: middle; }
.sc-table tr:last-child td { border-bottom: none; }
.sc-table td:first-child { width: 170px; }
.sc-table .kbd { margin-left: 0; }

/* CLI section (landing page) */
.cli { border: 1px solid var(--line); border-radius: 12px; padding: 28px; margin: 0 0 64px; background: rgba(255,255,255,0.015); }
.cli .t { font-family: var(--mono); font-size: 12px; color: var(--faint); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 10px; }
.cli h2 { font-size: 22px; margin-bottom: 8px; letter-spacing: -0.5px; }
.cli p { color: var(--dim); font-size: 14px; max-width: 70ch; }
.cli .fine { font-size: 13px; margin-top: 12px; }
.cli code { font-family: var(--mono); font-size: 12.5px; color: var(--acc); background: rgba(255,255,255,0.04); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.cli pre.cmd { margin: 16px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: #0a0a0c; overflow-x: auto; }
.cli pre.cmd code { background: none; padding: 0; font-size: 14px; }
