/* Static-site additions: no-JS replacements for the original React widgets, plus new sections. */

/* On body, not :root: --font-geist-mono is defined by a class on <body>. */
body {
  --sd-mono: var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, monospace;
  --sd-blue: #3b82f6;
  --sd-green: #22c55e;
  --sd-panel: #0c0c0c;
  --sd-muted: #a3a3a3;
}

/* ---------- Home: request/delivery diagram ---------- */

.sd-log {
  border: 1px solid hsl(var(--border));
  background: #111;
  border-radius: 6px;
  padding: 6px 8px;
  font-family: var(--sd-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--sd-muted);
}
.sd-log__head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #e5e5e5;
  white-space: nowrap;
  overflow: hidden;
}
.sd-log__head span:last-child,
.sd-log p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sd-log p { margin: 2px 0 0; }

.sd-tag {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  padding: 0 5px;
  border-radius: 4px;
}
.sd-tag--req  { background: rgba(59, 130, 246, .15); color: #60a5fa; }
.sd-tag--ok   { background: rgba(34, 197, 94, .15);  color: #4ade80; }
.sd-tag--wait { background: rgba(234, 179, 8, .15);  color: #facc15; }

.sd-gap {
  text-align: center;
  font-family: var(--sd-mono);
  font-size: 10px;
  color: #737373;
  padding: 2px 0;
}

.sd-wire-label {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--sd-mono);
  font-size: 11px;
  color: var(--sd-muted);
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}

.sd-pulse {
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 999px;
  background: var(--sd-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .25), 0 0 12px var(--sd-blue);
  opacity: 0;
  animation: sd-ltr 2.8s linear infinite;
}
.sd-pulse--rtl {
  background: var(--sd-green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .25), 0 0 12px var(--sd-green);
  animation-name: sd-rtl;
  animation-delay: 1.4s;
}
@keyframes sd-ltr { 0% { left: 0; opacity: 0 } 10%, 90% { opacity: 1 } 100% { left: 100%; opacity: 0 } }
@keyframes sd-rtl { 0% { left: 100%; opacity: 0 } 10%, 90% { opacity: 1 } 100% { left: 0; opacity: 0 } }

@media (max-width: 639px) {
  .sd-wire-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sd-pulse { display: none; }
}

/* ---------- Schedule page: form + live code ---------- */

.sd-time-row { position: relative; }
.sd-picker {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.sd-picker--visible {
  position: static;
  width: 100%;
  height: 36px;
  margin-top: 8px;
  opacity: 1;
  pointer-events: auto;
  color-scheme: dark;
  background: transparent;
  border: 1px solid hsl(var(--input));
  border-radius: 6px;
  padding: 0 12px;
  color: inherit;
}

.sd-textarea {
  display: block;
  width: 100%;
  min-height: 200px;
  resize: vertical;
  background: transparent;
  border: 0;
  outline: none;
  color: #fff;
  font-family: var(--sd-mono);
  font-size: 13px;
  line-height: 1.6;
  tab-size: 2;
}

.sd-error {
  margin: 0;
  color: #f87171;
  font-size: .8rem;
  font-weight: 500;
}
[aria-invalid="true"] { border-color: #f87171 !important; }

.sd-code-wrap { position: relative; }
.sd-code {
  margin: 0;
  min-height: 200px;
  max-height: 420px;
  overflow: auto;
  color: #d4d4d4;
  font-family: var(--sd-mono);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.sd-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  background: #171717;
  color: #e5e5e5;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s;
}
.sd-copy:hover { background: #262626; }
.sd-copy:focus-visible { outline: 2px solid var(--sd-blue); outline-offset: 2px; }

.sd-spin { animation: sd-spin 1s linear infinite; }
@keyframes sd-spin { to { transform: rotate(360deg) } }

.sd-result {
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.5;
}
.sd-result[hidden] { display: none; }
.sd-result--ok { border-color: rgba(34, 197, 94, .45); background: rgba(34, 197, 94, .06); }
.sd-result--err { border-color: rgba(248, 113, 113, .45); background: rgba(248, 113, 113, .06); }
.sd-result__title { font-weight: 600; margin: 0 0 8px; }
.sd-result--ok .sd-result__title { color: #4ade80; }
.sd-result--err .sd-result__title { color: #f87171; }
.sd-result dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
  margin: 0 0 10px;
}
.sd-result dt { color: var(--sd-muted); }
.sd-result dd {
  margin: 0;
  font-family: var(--sd-mono);
  font-size: 12.5px;
  word-break: break-all;
}
.sd-result p { margin: 0; color: var(--sd-muted); }
.sd-result a { color: #60a5fa; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Integration guide: language tabs + reference table ---------- */

.sd-tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.sd-tab-list {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 12px;
  border: 1px solid #282828;
  background: #191919;
}
.sd-tab-list label {
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--sd-muted);
  cursor: pointer;
  user-select: none;
}
.sd-tab-list label:hover { color: #fff; }
.sd-tab-panel { display: none; }

#sd-verify-node:checked ~ .sd-tab-list label[for="sd-verify-node"],
#sd-verify-python:checked ~ .sd-tab-list label[for="sd-verify-python"],
#sd-verify-go:checked ~ .sd-tab-list label[for="sd-verify-go"] {
  background: #fafafa;
  color: #191919;
}
#sd-verify-node:focus-visible ~ .sd-tab-list label[for="sd-verify-node"],
#sd-verify-python:focus-visible ~ .sd-tab-list label[for="sd-verify-python"],
#sd-verify-go:focus-visible ~ .sd-tab-list label[for="sd-verify-go"] {
  outline: 2px solid var(--sd-blue);
  outline-offset: 2px;
}
#sd-verify-node:checked ~ .sd-tab-panel--node,
#sd-verify-python:checked ~ .sd-tab-panel--python,
#sd-verify-go:checked ~ .sd-tab-panel--go { display: block; }

.sd-table-wrap { overflow-x: auto; }
.sd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.sd-table th,
.sd-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid hsl(var(--border));
}
.sd-table th { color: #e5e5e5; font-weight: 600; white-space: nowrap; }
.sd-table td { color: var(--sd-muted); }
.sd-table td:first-child code { color: #7ee787; }
.sd-table td:nth-child(2) { white-space: nowrap; }

.sd-endpoint {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid hsl(var(--border));
  background: var(--sd-panel);
  font-family: var(--sd-mono);
  font-size: 14px;
  word-break: break-all;
}

/* ---------- Pricing ---------- */

.sd-pricing-hero {
  padding: 10vh 20px 6vh;
  text-align: center;
}
.sd-pricing-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.sd-pricing-hero h1 span { color: var(--sd-blue); }
.sd-pricing-hero p {
  margin: 16px auto 0;
  max-width: 560px;
  color: #9ca3af;
}

.sd-plans {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid hsl(var(--border));
}
@media (min-width: 768px) {
  .sd-plans { grid-template-columns: 1fr 1fr; }
  .sd-plan + .sd-plan { border-left: 1px solid hsl(var(--border)); }
}
.sd-plan {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px 24px;
}
.sd-plan + .sd-plan { border-top: 1px solid hsl(var(--border)); }
@media (min-width: 768px) {
  .sd-plan { padding: 40px; }
  .sd-plan + .sd-plan { border-top: 0; }
}
.sd-plan__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sd-plan__head h2 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.sd-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: #fafafa;
  color: #191919;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.sd-badge--muted { background: #262626; color: #e5e5e5; }
.sd-plan__price { margin: 0; display: flex; align-items: baseline; gap: 6px; }
.sd-plan__price strong { font-size: 3rem; line-height: 1; font-weight: 700; }
.sd-plan__price span { color: var(--sd-muted); }
.sd-plan__desc { margin: 0; color: #9ca3af; min-height: 3em; }
.sd-plan h3 { margin: 6px 0 0; font-size: 14px; font-weight: 600; color: #e5e5e5; }

.sd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 24px;
  border: 1px solid hsl(var(--border));
  color: #fafafa;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s, border-color .15s;
}
.sd-btn:hover { background: #1a1a1a; border-color: #404040; }
.sd-btn--primary { background: var(--sd-blue); border-color: var(--sd-blue); color: #fff; }
.sd-btn--primary:hover { background: #2563eb; border-color: #2563eb; }
.sd-btn:focus-visible { outline: 2px solid var(--sd-blue); outline-offset: 2px; }

.sd-features {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: #d4d4d4;
}
.sd-features li { display: flex; align-items: flex-start; gap: 10px; }
.sd-features li::before {
  content: "";
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 999px;
  background: rgba(59, 130, 246, .18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2360a5fa' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat;
}

.sd-faq {
  padding: 56px 24px;
  border-top: 1px solid hsl(var(--border));
}
@media (min-width: 768px) { .sd-faq { padding: 72px 40px; } }
.sd-faq h2 { margin: 0 0 24px; font-size: 2rem; font-weight: 700; }
.sd-faq details { border-bottom: 1px solid hsl(var(--border)); }
.sd-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.sd-faq summary::-webkit-details-marker { display: none; }
.sd-faq summary::after {
  content: "";
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 16px no-repeat;
  transition: transform .2s;
}
.sd-faq details[open] summary::after { transform: rotate(180deg); }
.sd-faq summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.sd-faq summary:focus-visible { outline: 2px solid var(--sd-blue); outline-offset: 2px; }
.sd-faq details p {
  margin: 0;
  padding: 0 0 18px;
  max-width: 760px;
  color: #9ca3af;
  line-height: 1.6;
}

/* Let code blocks scroll inside the guide's step grid instead of widening the page. */
.sd-steps > * { min-width: 0; }
