/* Selium. Bootstrap supplies the layout. This file is the dark theme, the rainbow card, and the editor. */

[data-bs-theme="dark"] {
  --bs-body-bg: #0b0a0e;
  --bs-body-color: #f4f1f6;
  --bs-secondary-color: rgba(244, 241, 246, 0.68);
  --bs-tertiary-color: rgba(244, 241, 246, 0.5);
  --bs-primary: #ff2d55;
  --bs-primary-rgb: 255, 45, 85;
  --bs-link-color: #ff8aa3;
  --bs-link-hover-color: #ffb3c2;
  --bs-border-color: rgba(255, 255, 255, 0.12);
  --bs-heading-color: #fff;
  --bs-emphasis-color: #fff;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(980px 460px at 0% -8%, rgba(255, 45, 85, 0.2), transparent 56%),
    radial-gradient(760px 420px at 100% 0%, rgba(94, 92, 230, 0.16), transparent 52%),
    #0b0a0e;
  min-height: 100vh;
  letter-spacing: -0.011em;
}

.page-wrap {
  padding-top: 1.5rem;
  padding-bottom: 3.5rem;
}

.glass-nav {
  background: rgba(11, 10, 14, 0.78);
  backdrop-filter: blur(18px) saturate(1.45);
  -webkit-backdrop-filter: blur(18px) saturate(1.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar-brand {
  font-weight: 650;
  letter-spacing: -0.03em;
  color: #fff;
}

.brand-mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff2d55;
  box-shadow: 0 0 0 4px rgba(255, 45, 85, 0.18);
}

.navbar .nav-link {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 560;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: #fff;
}

.navbar .nav-link.active {
  color: #fff;
  background: rgba(255, 45, 85, 0.18);
}

.btn-primary {
  --bs-btn-bg: #ff2d55;
  --bs-btn-border-color: #ff2d55;
  --bs-btn-hover-bg: #e11d48;
  --bs-btn-hover-border-color: #e11d48;
  --bs-btn-active-bg: #be123c;
  --bs-btn-active-border-color: #be123c;
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-focus-shadow-rgb: 255, 45, 85;
  font-weight: 600;
}

.btn-ghost {
  --bs-btn-color: #f4f1f6;
  --bs-btn-bg: transparent;
  --bs-btn-border-color: rgba(255, 255, 255, 0.18);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: rgba(255, 255, 255, 0.08);
  --bs-btn-hover-border-color: rgba(255, 255, 255, 0.32);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: rgba(255, 255, 255, 0.12);
  --bs-btn-active-border-color: rgba(255, 255, 255, 0.32);
  font-weight: 560;
}

.section-label {
  margin: 2.75rem 0 1rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ff8aa3;
}

.lede {
  max-width: 42rem;
  margin: -0.25rem 0 1.1rem;
  color: rgba(244, 241, 246, 0.72);
}

.glass {
  background: rgba(22, 18, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 1.25rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 40px rgba(0, 0, 0, 0.28);
}

.glass .card-body {
  padding: 1.35rem 1.35rem 1.25rem;
}

.kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ff8aa3;
}

.glass h2,
.glass h3 {
  letter-spacing: -0.03em;
}

.file-name {
  margin: 0.85rem 0 1rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.92rem;
}

.fine {
  margin: 0.9rem 0 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.62);
}

.step-no {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ff2d55;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}

.app-card h3 {
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
}

.app-card p,
.link-card p {
  margin: 0;
  color: rgba(244, 241, 246, 0.74);
  line-height: 1.5;
}

.link-card {
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.link-card:hover {
  color: inherit;
  border-color: rgba(255, 45, 85, 0.45) !important;
}

.footer-note {
  margin: 2.5rem 0 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.rainbow-card {
  position: relative;
  overflow: hidden;
  margin: 0 0 0.5rem;
  border-radius: 1.75rem;
  min-height: 280px;
  isolation: isolate;
}

.rainbow-card.compact {
  min-height: 0;
}

.rainbow-card::before {
  content: "";
  position: absolute;
  left: -40%;
  top: -40%;
  width: 180%;
  height: 180%;
  background: conic-gradient(
    from 0deg,
    #ff2d55,
    #ff6b35,
    #ffd60a,
    #32d74b,
    #64d2ff,
    #5e5ce6,
    #bf5af2,
    #ff2d55
  );
  animation: rainbow-spin 9s linear infinite;
}

.rainbow-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.42) 48%, transparent 62%);
  background-size: 220% 100%;
  animation: rainbow-sheen 4.8s linear infinite;
  mix-blend-mode: screen;
  pointer-events: none;
}

.rainbow-glass {
  position: relative;
  z-index: 1;
  margin: 14px;
  padding: 1.6rem 1.45rem 1.25rem;
  border-radius: 1.35rem;
  color: #fff;
  background: rgba(12, 8, 16, 0.46);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.22),
    0 18px 40px rgba(0, 0, 0, 0.28);
}

.rainbow-kicker {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.rainbow-glass h1 {
  margin: 0 0 0.55rem;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 680;
}

.rainbow-card.compact .rainbow-glass h1 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
}

.rainbow-glass p {
  margin: 0;
  max-width: 40rem;
  font-size: 1.02rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 1.15rem 0 0;
}

.stats div {
  padding: 0.7rem 0.4rem 0.55rem;
  border-radius: 1rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.stats dt {
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.stats dd {
  margin: 0.15rem 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.docs-stack {
  margin-top: 1.75rem;
}

.doc-block {
  margin: 0 0 0.9rem;
  padding: 1.2rem 1.35rem 1.05rem;
  border-radius: 1.25rem;
  background: rgba(22, 18, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.doc-block h2 {
  margin: 0 0 0.65rem;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.doc-block h3 {
  margin: 1.15rem 0 0.4rem;
  font-size: 1.02rem;
}

.doc-block p,
.doc-block li {
  font-size: 0.98rem;
  line-height: 1.55;
  color: rgba(244, 241, 246, 0.88);
}

.doc-block a {
  color: #ff8aa3;
}

.doc-block code,
.glass code,
.lede code,
.fine code,
.help-copy code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.doc-block pre {
  overflow: auto;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.12);
  color: #f7f2f8;
}

.doc-block table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 0.4rem;
  font-size: 0.92rem;
}

.doc-block th,
.doc-block td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.doc-block th {
  color: #ff8aa3;
  font-weight: 600;
}

.toc-card .section-label {
  margin-top: 0;
}

.toc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: block;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.toc a:hover {
  color: #fff;
}

.editor-card,
.preview-card {
  overflow: hidden;
  padding: 0;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.form-control,
.form-control:focus {
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.12);
}

.form-control:focus {
  border-color: #ff2d55;
  box-shadow: 0 0 0 0.2rem rgba(255, 45, 85, 0.25);
}

.form-check-input:checked {
  background-color: #ff2d55;
  border-color: #ff2d55;
}

.form-check-input:focus {
  border-color: #ff8aa3;
  box-shadow: 0 0 0 0.2rem rgba(255, 45, 85, 0.25);
}

.form-check-label {
  color: rgba(244, 241, 246, 0.84);
}

textarea.code,
.payload-code {
  display: block;
  width: 100%;
  min-height: 220px;
  margin: 0;
  padding: 0.85rem 1rem;
  box-sizing: border-box;
  border: 0;
  resize: vertical;
  color: #f7f2f8;
  background: rgba(0, 0, 0, 0.35);
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

textarea.code.short,
.payload-code {
  min-height: 120px;
}

#control-preview {
  min-height: 140px;
}

.editor-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.72);
}

.payload-row {
  margin: 0 0 0.75rem;
  border-radius: 1.15rem;
  overflow: hidden;
  background: rgba(22, 18, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.path-label {
  display: block;
  padding: 0 0.85rem 0.55rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.72);
}

.payload-path,
.field {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.75rem;
  box-sizing: border-box;
  border: 0;
  border-radius: 0.75rem;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font: 14px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.text-btn {
  border: 0;
  background: transparent;
  color: #ff8aa3;
  font-size: 0.82rem;
  padding: 0;
}

.text-btn:hover {
  color: #fff;
}

.status {
  min-height: 1.3em;
  margin: 0.85rem 0 0;
  color: rgba(255, 255, 255, 0.8);
}

.status.bad {
  color: #ff8aa3;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.help-copy {
  margin: 0;
  color: rgba(244, 241, 246, 0.78);
  line-height: 1.5;
}

[data-animate] {
  opacity: 0;
}

[data-animate].animate__animated {
  --animate-duration: 0.8s;
  opacity: 1;
}

@keyframes rainbow-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rainbow-sheen {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@media (max-width: 720px) {
  .stats,
  .toc {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .rainbow-card::before,
  .rainbow-card::after {
    animation: none;
  }

  [data-animate] {
    opacity: 1 !important;
    animation: none !important;
  }
}
