:root {
  color-scheme: dark;
  --bg: #020508;
  --panel: rgba(8, 15, 24, 0.78);
  --panel-strong: rgba(10, 18, 30, 0.92);
  --text: #f4f8fb;
  --muted: #94a3b4;
  --soft: #cbd5e1;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(34, 211, 238, 0.28);
  --cyan: #22d3ee;
  --blue: #2286ff;
  --success: #86efac;
  --danger: #fecaca;
  --warning: #fbbf24;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(ellipse at 50% -180px, rgba(34, 134, 255, 0.2), rgba(34, 211, 238, 0.07) 34%, transparent 68%),
    radial-gradient(circle at 88% 10%, rgba(90, 166, 255, 0.12), transparent 34%),
    #020508;
  color: var(--text);
  line-height: 1.55;
  padding: 28px 16px 46px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 72%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 72%);
}

.page-auth-hidden {
  display: none;
}

a {
  color: #7dd3fc;
}

.wrap,
.container {
  width: min(1120px, 100%);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.template-rail {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: clamp(120px, 11vw, 178px);
  overflow: hidden;
  pointer-events: none;
  opacity: 0.9;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}

.template-rail::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 42%, rgba(2, 5, 8, 0.58) 100%);
  pointer-events: none;
}

.template-rail-left {
  left: max(10px, calc((100vw - 1480px) / 2));
}

.template-rail-right {
  right: max(10px, calc((100vw - 1480px) / 2));
}

.template-track {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 0;
  will-change: transform;
}

.template-track-up {
  animation: mcp-template-drift-up 52s linear infinite;
}

.template-track-down {
  animation: mcp-template-drift-down 58s linear infinite;
}

.template-mini-card {
  min-height: 156px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 18px;
  padding: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(8, 15, 24, 0.78);
  background-size: cover;
  background-position: center;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.template-mini-card.has-image {
  min-height: 176px;
}

.template-mini-card strong {
  color: #f8fbff;
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.75);
}

.template-mini-card small {
  color: rgba(223, 248, 255, 0.78);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9.5px;
  line-height: 1.35;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.template-kind {
  align-self: flex-start;
  border: 1px solid rgba(34, 211, 238, 0.26);
  background: rgba(0, 0, 0, 0.42);
  color: var(--cyan);
  border-radius: 999px;
  padding: 4px 8px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.fallback-art {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.045) 0 2px, transparent 2px 16px),
    linear-gradient(var(--angle, 150deg), var(--art-a), var(--art-b));
}

.art-a { --angle: 150deg; --art-a: #0f766e; --art-b: #1d4ed8; }
.art-b { --angle: 35deg; --art-a: #7c2d12; --art-b: #be185d; }
.art-c { --angle: 120deg; --art-a: #312e81; --art-b: #0891b2; }
.art-d { --angle: 80deg; --art-a: #111827; --art-b: #9333ea; }
.art-e { --angle: 145deg; --art-a: #365314; --art-b: #0f766e; }
.art-f { --angle: 45deg; --art-a: #581c87; --art-b: #1d4ed8; }
.art-g { --angle: 110deg; --art-a: #78350f; --art-b: #0f172a; }
.art-h { --angle: 160deg; --art-a: #164e63; --art-b: #701a75; }

.mobile-template-showcase {
  display: none;
}

@keyframes mcp-template-drift-up {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

@keyframes mcp-template-drift-down {
  0% { transform: translateY(-50%); }
  100% { transform: translateY(0); }
}

.top-links,
.links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 22px;
}

.top-links::before,
.links::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.55);
}

.chip-link,
.link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.chip-link:hover,
.link:hover {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.06);
}

.hero,
.card {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.022)),
    var(--panel);
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.hero {
  padding: clamp(28px, 5vw, 54px);
  margin-bottom: 16px;
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--text);
}

h1 {
  margin: 0;
  max-width: 880px;
  font-size: clamp(38px, 6.4vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

h2 {
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

p {
  color: var(--muted);
}

.hero p,
.hero-text {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.65;
}

.gradient-text {
  background: linear-gradient(100deg, var(--cyan), #5aa6ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.install-box {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-top: 28px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 16px;
}

.url,
.mono,
code,
pre,
.mono-block {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.url {
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  color: #dff8ff;
  font-size: 14px;
  padding: 8px 4px;
}

.btn {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #00111a;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  min-height: 42px;
  padding: 0 18px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(34, 211, 238, 0.25);
}

.btn.secondary {
  color: #dbeafe;
  background: rgba(51, 65, 85, 0.92);
}

.btn.danger {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
  box-shadow: none;
}

.status {
  min-height: 18px;
  margin-top: 10px;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
}

.status:empty {
  display: none !important;
}

.status.success {
  display: block;
  border: 1px solid rgba(34, 197, 94, 0.4);
  background: rgba(22, 101, 52, 0.25);
  color: var(--success);
}

.status.error {
  display: block;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(127, 29, 29, 0.25);
  color: var(--danger);
}

.status.info {
  display: block;
  border: 1px solid rgba(34, 211, 238, 0.34);
  background: rgba(8, 47, 73, 0.32);
  color: #bae6fd;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.wrap > .grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  padding: 20px;
}

.card p,
.card li {
  color: var(--muted);
}

.card p {
  margin: 0;
}

.wide,
.full-width,
.mt-14 {
  grid-column: span 2;
}

.full-width,
.mt-14 {
  margin-top: 14px;
}

ol,
ul {
  margin: 10px 0 0;
  padding-left: 0;
  list-style: none;
}

li + li {
  margin-top: 10px;
}

ol li,
ul li {
  position: relative;
  padding-left: 34px;
}

ol {
  counter-reset: ordered-steps;
}

ol li {
  counter-increment: ordered-steps;
}

ol li::before,
ul li::before {
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 23px;
  height: 23px;
  border-radius: 7px;
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

ol li::before {
  content: counter(ordered-steps);
}

ul li::before {
  content: "";
  width: 8px;
  height: 8px;
  top: 0.62em;
  left: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.45);
}

code {
  border: 1px solid rgba(100, 116, 139, 0.4);
  background: rgba(0, 0, 0, 0.32);
  border-radius: 8px;
  padding: 2px 6px;
  color: #dff8ff;
  font-size: 0.88em;
}

pre,
.mono-block {
  margin: 12px 0 0;
  overflow-x: auto;
  border: 1px solid rgba(100, 116, 139, 0.4);
  background: #050b13;
  border-radius: 14px;
  padding: 13px;
  color: #dff8ff;
  font-size: 12.5px;
  line-height: 1.6;
}

.accent {
  color: var(--cyan);
  font-weight: 800;
}

.p-top-space,
.mt-10 {
  margin-top: 10px;
}

.tutorial {
  margin-top: 16px;
  border-top: 1px solid rgba(100, 116, 139, 0.34);
  padding-top: 16px;
}

.tiny {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.warning-note {
  margin-top: 10px;
  color: var(--warning);
}

.field {
  margin-bottom: 12px;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(100, 116, 139, 0.45);
  background: rgba(3, 10, 18, 0.8);
  color: var(--text);
  border-radius: 12px;
  font-size: 14px;
  padding: 11px 12px;
  outline: none;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
}

.checkboxes {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-top: 6px;
}

.scope-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid rgba(100, 116, 139, 0.38);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--soft);
  font-size: 12px;
}

.scope-item input {
  width: auto;
  margin: 0;
}

.auth-banner {
  display: none;
  margin-top: 14px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(127, 29, 29, 0.3);
  color: var(--danger);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 13px;
}

.auth-banner.show {
  display: block;
}

.login-link {
  color: #fff;
}

.hidden {
  display: none !important;
}

.list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.key-item {
  border: 1px solid rgba(100, 116, 139, 0.38);
  border-radius: 14px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.key-meta {
  color: var(--soft);
  font-size: 12px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
  color: #5b6b7e;
  font-size: 13px;
}

footer a {
  color: #7e8b9c;
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 920px) {
  body.mcp-page {
    padding: 12px 12px 30px;
    background:
      radial-gradient(circle at 50% -8%, rgba(34, 211, 238, 0.2), transparent 38%),
      radial-gradient(circle at 96% 14%, rgba(34, 134, 255, 0.18), transparent 34%),
      #020508;
  }

  .template-rail {
    display: none;
  }

  .wrap,
  .container {
    width: 100%;
  }

  .top-links,
  .links {
    gap: 8px;
    margin-bottom: 12px;
    padding: 2px 2px 0;
  }

  .top-links::before,
  .links::before {
    width: 14px;
    height: 14px;
    border-radius: 4px;
  }

  .chip-link,
  .link {
    min-height: 34px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.045);
  }

  .hero {
    position: relative;
    padding: 24px 18px 18px;
    border-radius: 26px;
    margin-bottom: 12px;
    background:
      radial-gradient(circle at 88% 0%, rgba(34, 211, 238, 0.18), transparent 38%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
      rgba(8, 15, 24, 0.88);
  }

  .hero::after {
    content: "";
    position: absolute;
    right: 18px;
    bottom: 18px;
    width: 72px;
    height: 72px;
    border-radius: 24px;
    background:
      linear-gradient(135deg, rgba(34, 211, 238, 0.34), rgba(34, 134, 255, 0.1)),
      repeating-linear-gradient(135deg, rgba(255,255,255,0.12) 0 1px, transparent 1px 9px);
    opacity: 0.5;
    pointer-events: none;
    filter: blur(0.2px);
  }

  .eyebrow {
    margin-bottom: 10px;
    font-size: 10.5px;
    letter-spacing: 0.18em;
  }

  h1 {
    font-size: clamp(38px, 12vw, 54px);
    line-height: 0.96;
    letter-spacing: -0.06em;
    max-width: 10ch;
  }

  .hero p,
  .hero-text {
    margin-top: 14px;
    max-width: 100%;
    font-size: 15.5px;
    line-height: 1.55;
    padding-right: 8px;
  }

  .install-box {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 18px;
    padding: 10px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.22);
  }

  .url {
    border: 1px solid rgba(34, 211, 238, 0.16);
    border-radius: 12px;
    padding: 10px 11px;
    background: rgba(2, 5, 8, 0.52);
    font-size: 12px;
  }

  .btn {
    width: 100%;
    min-height: 48px;
    border-radius: 14px;
    font-size: 14px;
  }

  .mobile-template-showcase {
    display: block;
    margin: 12px -12px 14px;
    padding: 12px 0 14px 12px;
    overflow: hidden;
  }

  .mobile-showcase-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 0 12px 10px 0;
  }

  .mobile-showcase-head span {
    color: var(--cyan);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }

  .mobile-showcase-head strong {
    color: rgba(244, 248, 251, 0.88);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
  }

  .mobile-template-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(178px, 64vw);
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: inline mandatory;
    padding: 0 12px 4px 0;
  }

  .mobile-template-strip::-webkit-scrollbar {
    display: none;
  }

  .mobile-template-strip .template-mini-card {
    min-height: 148px;
    scroll-snap-align: start;
    border-radius: 20px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 12px 0;
  }

  .wrap > .grid {
    grid-template-columns: 1fr;
  }

  .wide,
  .full-width,
  .mt-14 {
    grid-column: auto;
  }

  .install-box {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 17px;
    border-radius: 20px;
  }

  .card h2 {
    font-size: 17px;
  }

  .card p,
  .card li {
    font-size: 14px;
    line-height: 1.5;
  }

  ol,
  ul {
    margin-top: 12px;
  }

  li + li {
    margin-top: 9px;
  }

  ol li,
  ul li {
    padding-left: 32px;
  }

  ol li::before,
  ul li::before {
    width: 22px;
    height: 22px;
    border-radius: 8px;
  }

  .mono-block {
    border-radius: 14px;
    padding: 12px;
    font-size: 11.5px;
    white-space: nowrap;
  }

  footer {
    justify-content: center;
    text-align: center;
    margin-top: 18px;
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  body.mcp-page {
    padding-inline: 10px;
  }

  .hero {
    padding: 22px 16px 16px;
  }

  h1 {
    font-size: clamp(34px, 12.6vw, 48px);
  }

  .hero p,
  .hero-text {
    font-size: 14.5px;
  }

  .mobile-template-strip {
    grid-auto-columns: minmax(164px, 72vw);
  }

  .mobile-template-strip .template-mini-card {
    min-height: 136px;
  }
}

@media (min-width: 921px) and (max-width: 1260px) {
  .template-rail {
    width: 104px;
    opacity: 0.42;
  }

  .template-mini-card {
    min-height: 132px;
    padding: 10px;
  }

  .template-mini-card strong {
    font-size: 12px;
  }

  .template-mini-card small {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .template-track {
    animation: none !important;
  }
}
