*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --g: #00553A;
  --w: #ffffff;
  --g08: rgba(0,85,58,0.08);
  --g15: rgba(0,85,58,0.15);
  --g35: rgba(0,85,58,0.35);
  --t: 80ms ease;
  --max: 960px;
}

html { background: var(--w); }

body {
  background: var(--w);
  color: var(--g);
  font-family: "calling-code", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--g); }
a:hover { opacity: 0.6; }

/* page wrapper — centers everything */

.page-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* header */

header {
  border-bottom: 1px solid var(--g);
}

header .page-wrap {
  padding-top: 52px;
  padding-bottom: 32px;
}

.site-title {
  font-family: "orpheuspro", serif;
  font-weight: 400;
  font-style: italic;
  font-size: 58px;
  color: var(--g);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 8px;
}

.site-subtitle {
  font-family: "calling-code", sans-serif;
  font-weight: 400;
  font-style: italic;
  font-size: 14px;
  color: var(--g);
  opacity: 0.45;
  letter-spacing: 0.01em;
}

.header-links {
  margin-top: 14px;
  display: flex;
  gap: 16px;
  font-size: 13px;
  font-style: italic;
}
.header-links a { opacity: 0.55; text-decoration: none; }
.header-links a:hover { opacity: 1; }

/* Prism syntax theme: shared by docs.html and about.html.
   Only token colors live here; surrounding `pre`/`code` boxes are styled per-page. */
pre[class*="language-"],
code[class*="language-"] {
  color: var(--g);
  font-family: "calling-code", sans-serif;
  tab-size: 2;
}
.token.comment, .token.prolog, .token.cdata { color: var(--g); opacity: 0.42; font-style: italic; }
.token.punctuation { color: var(--g); opacity: 0.55; }
.token.namespace { opacity: 0.7; }
.token.string,
.token.attr-value,
.token.url { color: #2d6a4f; }
.token.number,
.token.boolean,
.token.constant { color: #6a994e; font-style: italic; }
.token.keyword,
.token.builtin,
.token.tag,
.token.class-name { color: var(--g); font-weight: 500; }
.token.function {
  color: var(--g);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--g35);
}
.token.operator,
.token.entity { color: var(--g); opacity: 0.75; }
.token.variable,
.token.parameter { color: #386641; font-style: italic; }
.token.attr-name,
.token.property,
.token.key,
.token.section,
.token.table { color: var(--g); font-weight: 500; }
.token.deleted { background: rgba(170, 0, 0, 0.08); }
.token.inserted { background: var(--g08); }
.token.italic { font-style: italic; }
.token.bold { font-weight: 600; }

/* sticky controls */

.controls-wrap {
  border-bottom: 1px solid var(--g);
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--w);
}

.controls-bar {
  display: flex;
  align-items: stretch;
}

.controls-bar input,
.controls-bar select {
  font-family: "calling-code", sans-serif;
  font-size: 14px;
  color: var(--g);
  background: transparent;
  border: none;
  border-right: 1px solid var(--g);
  padding: 13px 18px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.controls-bar input {
  flex: 1;
  cursor: text;
}

.controls-bar input::placeholder {
  color: var(--g);
  opacity: 0.32;
  font-style: italic;
}

.controls-bar select {
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2300553A' opacity='.45'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.controls-bar select:last-of-type {
  border-right: 1px solid var(--g);
}

.results-count {
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-size: 13px;
  font-style: italic;
  opacity: 0.38;
  white-space: nowrap;
}

/* grid wrapper */

.grid-section {}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--g);
  gap: 1px;
  padding-bottom: 1px;
}

/* cards */

.tool-card {
  background: var(--w);
  padding: 28px 28px 24px;
  cursor: pointer;
  transition: background var(--t), color var(--t);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-card:hover {
  background: var(--g);
  color: var(--w);
}

.card-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.card-name {
  font-family: "calling-code", sans-serif;
  font-weight: 400;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.card-ver {
  font-size: 13px;
  opacity: 0.38;
  font-style: italic;
}

.tier-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 7px;
  border: 1px solid currentColor;
  opacity: 0.5;
  letter-spacing: 0.02em;
  font-style: italic;
  transition: opacity var(--t);
  flex-shrink: 0;
}

.tool-card:hover .tier-badge { opacity: 0.75; }

.card-desc {
  font-size: 14px;
  opacity: 0.62;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  transition: opacity var(--t);
}

.tool-card:hover .card-desc { opacity: 0.75; }

.card-io {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.chip {
  font-size: 12px;
  font-style: italic;
  padding: 2px 7px;
  border: 1px solid currentColor;
  opacity: 0.42;
  transition: opacity var(--t);
}

.tool-card:hover .chip { opacity: 0.68; }

.chip-arrow {
  font-size: 12px;
  opacity: 0.25;
  padding: 0 2px;
  border: none;
  font-style: normal;
}

/* empty / loading */

.empty {
  background: var(--w);
  grid-column: 1 / -1;
  padding: 72px 36px;
  font-style: italic;
  opacity: 0.32;
}

/* modal overlay */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 85, 58, 0.07);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

/* modal */

.modal {
  background: var(--w);
  border: 1px solid var(--g);
  width: min(640px, 95vw);
  max-height: 86vh;
  overflow-y: auto;
  animation: modal-in 120ms ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 32px 22px;
  border-bottom: 1px solid var(--g);
}

.modal-name {
  font-family: "calling-code", sans-serif;
  font-size: 24px;
  letter-spacing: -0.01em;
  margin-bottom: 5px;
}

.modal-meta {
  font-size: 13px;
  font-style: italic;
  opacity: 0.48;
}

.modal-close {
  background: none;
  border: none;
  color: var(--g);
  cursor: pointer;
  opacity: 0.32;
  font-size: 15px;
  line-height: 1;
  padding: 4px;
  transition: opacity var(--t);
  margin-top: 3px;
  flex-shrink: 0;
}

.modal-close:hover { opacity: 0.85; }

.modal-section {
  padding: 18px 32px;
  border-bottom: 1px solid var(--g15);
}

.modal-section.last { border-bottom: none; }

.section-label {
  font-size: 11px;
  font-style: italic;
  opacity: 0.38;
  letter-spacing: 0.07em;
  margin-bottom: 9px;
}

/* bv add command block */

.bv-add-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--g08);
  border: 1px solid var(--g15);
  padding: 12px 16px;
}

.bv-add-cmd {
  font-family: "calling-code", sans-serif;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--g);
  flex: 1;
  word-break: break-all;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--g);
  font-size: 17px;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  opacity: 0.38;
  transition: opacity var(--t), color var(--t);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.copy-btn:hover { opacity: 0.85; }
.copy-btn.copied { opacity: 1; }

.modal-desc {
  font-size: 13px;
  opacity: 0.72;
  line-height: 1.55;
}

.io-list { display: flex; flex-direction: column; gap: 5px; }

.io-row {
  font-size: 14px;
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.io-type {
  opacity: 0.55;
  min-width: 130px;
}

.io-empty { opacity: 0.35; font-size: 12px; }

.versions-row { display: flex; flex-wrap: wrap; gap: 7px; }

.vpill {
  font-size: 13px;
  padding: 3px 9px;
  border: 1px solid var(--g);
  opacity: 0.5;
}

/* responsive */

@media (max-width: 900px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .site-title { font-size: 44px; }
}

@media (max-width: 580px) {
  .site-title { font-size: 34px; }
  .tool-grid { grid-template-columns: 1fr; }
  .controls-bar { flex-wrap: wrap; }
  .controls-bar input { width: 100%; border-right: none; border-bottom: 1px solid var(--g); }
  .controls-bar select { flex: 1; }
}
