/* CraftMCP Public Portal — tasteskill tokens (cool-grey-cobalt / soot-pale-lime, Host Grotesk + JetBrains Mono, sharp radius) */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --bg: #eef0f3;
  --surface: #e2e5ea;
  --card: #ffffff;
  --ink: #0b0c0e;
  --muted: #505764;
  --border: rgba(11, 12, 14, 0.14);
  --border-strong: rgba(11, 12, 14, 0.28);
  --accent: #1f2de6;
  --accent-ink: #ffffff;
  --accent-hover: #1723bf;
  --ok-bg: #e6f4ea;
  --ok-ink: #137333;
  --warn-bg: #fef7e0;
  --warn-ink: #8a5300;
  --err-bg: #fce8e6;
  --err-ink: #b3261e;

  --font-sans: "Host Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --nav-h: 72px;
  --gut: clamp(20px, 5vw, 80px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

html[data-theme="dark"] {
  --bg: #0f0f0f;
  --surface: #17181a;
  --card: #131416;
  --ink: #eef0f3;
  --muted: #9da4b0;
  --border: rgba(238, 240, 243, 0.14);
  --border-strong: rgba(238, 240, 243, 0.28);
  --accent: #dafa9c;
  --accent-ink: #0b0c0e;
  --accent-hover: #c9f27a;
  --ok-bg: rgba(34, 197, 94, 0.16);
  --ok-ink: #86efac;
  --warn-bg: rgba(245, 158, 11, 0.16);
  --warn-ink: #fcd34d;
  --err-bg: rgba(239, 68, 68, 0.18);
  --err-ink: #fca5a5;
}

/* Accent presets (non-violet) */
html[data-accent="emerald"] { --accent: #0f766e; --accent-ink: #ffffff; --accent-hover: #0d5e58; }
html[data-theme="dark"][data-accent="emerald"] { --accent: #34d399; --accent-ink: #0b0c0e; --accent-hover: #10b981; }
html[data-accent="lime"] { --accent: #3f6212; --accent-ink: #ffffff; --accent-hover: #365314; }
html[data-theme="dark"][data-accent="lime"] { --accent: #dafa9c; --accent-ink: #0b0c0e; --accent-hover: #c5ee78; }
html[data-accent="amber"] { --accent: #b45309; --accent-ink: #ffffff; --accent-hover: #92400e; }
html[data-theme="dark"][data-accent="amber"] { --accent: #fbbf24; --accent-ink: #0b0c0e; --accent-hover: #f59e0b; }
html[data-accent="crimson"] { --accent: #be123c; --accent-ink: #ffffff; --accent-hover: #9f1239; }
html[data-theme="dark"][data-accent="crimson"] { --accent: #fb7185; --accent-ink: #0b0c0e; --accent-hover: #f43f5e; }

html {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  scroll-padding-top: var(--nav-h);
}

body {
  min-height: 100svh;
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a, button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip-link {
  position: fixed;
  top: -100px;
  left: var(--gut);
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-weight: 500;
  text-decoration: none;
}
.skip-link:focus { top: 14px; }

.wrap {
  width: min(100% - 2 * var(--gut), 1280px);
  margin-inline: auto;
}

.mono { font-family: var(--font-mono); }

/* Header */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--card);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav__link {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 150ms var(--ease);
}
.nav__link:hover { border-bottom-color: var(--ink); }

.nav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav__menu-btn { display: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), transform 110ms var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.985); }

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn--secondary {
  background: var(--card);
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn--secondary:hover { background: var(--surface); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--surface); }

.btn--full { width: 100%; }

/* Mobile sheet */
.mobile-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(11, 12, 14, 0.55);
  display: flex;
  justify-content: flex-end;
}
.mobile-sheet[hidden] { display: none; }
.mobile-sheet__panel {
  width: min(320px, 100%);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.mobile-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-sheet__links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mobile-sheet__link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.mobile-sheet__link:hover { background: var(--surface); }
.mobile-sheet__foot { margin-top: auto; }

/* Banners */
.banner {
  margin-top: calc(var(--nav-h) + 18px);
  margin-bottom: -10px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--card);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  font-size: 0.94rem;
}
.banner[hidden] { display: none; }
.banner--warning { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-ink); }
.banner--danger { background: var(--err-bg); color: var(--err-ink); border-color: var(--err-ink); }
.banner--success { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-ink); }

/* Hero */
.hero {
  padding-top: calc(var(--nav-h) + 48px);
  padding-bottom: 72px;
  min-height: 92svh;
  display: flex;
  align-items: center;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(32px, 4vw, 64px);
  align-items: start;
}

.hero__tagline {
  margin: 0 0 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.hero__h1 {
  margin: 0 0 18px;
  font-size: clamp(2.1rem, 3.8vw, 3.6rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
  max-width: 15ch;
}

.hero__lead {
  margin: 0 0 24px;
  font-size: 1.06rem;
  color: var(--muted);
  max-width: 54ch;
}

.join-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  margin-bottom: 20px;
  max-width: 520px;
}

.join-box__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.join-box__label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.join-box__addr {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.hero__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  max-width: 520px;
}

.fact dt {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.fact dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 500;
}

/* Live App Frame */
.app-frame {
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.app-frame__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.app-frame__title {
  font-size: 0.88rem;
  font-weight: 500;
}

.status-chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink);
}

.app-frame__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.snapshot-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.snapshot-section:last-child { padding-bottom: 0; border-bottom: none; }

.snapshot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

.mono-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.snapshot-url {
  display: block;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  word-break: break-all;
}

.snapshot-note {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.snapshot-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.snap-srv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

.snap-srv__meta {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.meter-row { display: flex; flex-direction: column; gap: 6px; }
.meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
}
.meter-track {
  height: 8px;
  border-radius: 2px;
  background: var(--surface);
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  background: var(--accent);
  transition: width 240ms var(--ease);
}

/* Sections */
.section { padding: clamp(56px, 7vw, 104px) 0; }
.section--surface { background: var(--surface); }

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

h2 {
  margin: 0 0 8px;
  font-size: clamp(1.65rem, 2.8vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

h3 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.section__sub {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

/* Server Cards */
.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 20px;
}

.srv-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease);
}
.srv-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }

.srv-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.srv-card__name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 500;
}

.srv-card__desc {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge--running { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-ink); }
.badge--starting { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-ink); }
.badge--stopped { background: var(--surface); color: var(--muted); }
.badge--error { background: var(--err-bg); color: var(--err-ink); border-color: var(--err-ink); }

.srv-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  font-size: 0.86rem;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.srv-card__meta span { color: var(--muted); display: block; font-size: 0.78rem; }
.srv-card__meta strong { font-weight: 500; }

.srv-card__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.srv-card__addr {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Split Sections */
.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}

.spec-rows {
  margin: 24px 0 0;
  border-top: 1px solid var(--border);
}

.spec-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
}
.spec-row dt { font-weight: 500; font-size: 0.9rem; }
.spec-row dd { margin: 0; color: var(--muted); font-size: 0.94rem; }

.endpoint-card {
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.endpoint-item { display: flex; flex-direction: column; gap: 4px; }
.endpoint-item__label { font-size: 0.8rem; font-weight: 500; color: var(--muted); }
.endpoint-item code {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  word-break: break-all;
}

.endpoint-card__foot {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.endpoint-card__foot p { margin: 0; font-size: 0.9rem; color: var(--muted); }

/* Specs Grid */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.spec-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.spec-card__label { font-size: 0.84rem; color: var(--muted); font-weight: 500; }
.spec-card__val { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 500; }
.spec-card__note { margin: 0; font-size: 0.85rem; color: var(--muted); }

/* Rules */
.rules-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rule;
  border-top: 1px solid var(--border);
}

.rules-list li {
  counter-increment: rule;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 14px;
  align-items: baseline;
}

.rules-list li::before {
  content: "0" counter(rule);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  flex-shrink: 0;
}

.community-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* States */
.state-box {
  grid-column: 1 / -1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.state-box p { margin: 0; color: var(--muted); }
.state-box--error { border-color: var(--err-ink); background: var(--err-bg); color: var(--err-ink); }
.state-box--error p { color: var(--err-ink); }

.skeleton-row {
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 0.86rem;
}

/* Public Server Detail Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(11, 12, 14, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 85svh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.modal-card__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  background: var(--bg);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer__note {
  margin-left: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer__links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.footer__links a:hover { color: var(--ink); text-decoration: underline; }

/* Responsive breakpoints (tablet 640-1023 & mobile < 640) */
@media (max-width: 1023px) {
  .hero__grid, .split-section { grid-template-columns: 1fr; }
  .specs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav__links { display: none; }
  .nav__menu-btn { display: inline-flex; }
}

@media (max-width: 639px) {
  :root { --nav-h: 60px; }
  .nav__actions > .btn--primary { display: none; }
  .hero { padding-top: calc(var(--nav-h) + 28px); padding-bottom: 48px; min-height: auto; }
  .join-box { flex-direction: column; align-items: stretch; }
  .btn-row { flex-direction: column; }
  .btn-row .btn { width: 100%; }
  .specs-grid { grid-template-columns: 1fr; }
  .spec-row { grid-template-columns: 1fr; gap: 4px; }
  .hero__facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
