:root {
  --bg: #090b10;
  --panel: #11151d;
  --panel-2: #171c26;
  --border: #272e3d;
  --text: #f4f6fb;
  --muted: #9aa5b8;
  --accent: #7c5cff;
  --accent-2: #9b86ff;
  --success: #38d996;
  --danger: #ff667a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 15% 0%, #17142a 0, transparent 34rem), var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }

.topbar { min-height: 68px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); background: rgba(9,11,16,.86); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark, .preview-avatar { display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--accent), #33c4ff); color: white; font-weight: 900; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.topnav { display: flex; align-items: center; gap: 18px; color: var(--muted); }
.user-pill { color: var(--text); background: var(--panel-2); border: 1px solid var(--border); padding: 8px 12px; border-radius: 999px; }
.inline-form { display: inline; margin: 0; }
.text-button { border: 0; color: var(--muted); background: transparent; cursor: pointer; }

.page-shell { width: min(1180px, 90vw); margin: 0 auto; padding: 64px 0 80px; min-height: calc(100vh - 140px); }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 42px; align-items: center; min-height: 60vh; }
.hero h1, .section-heading h1, .error-state h1 { font-size: clamp(2.4rem, 6vw, 5.2rem); line-height: .98; letter-spacing: -.055em; margin: 10px 0 22px; }
.section-heading h1, .error-state h1 { font-size: clamp(2.1rem, 4vw, 3.7rem); }
.lede, .section-heading p, .error-state p { color: var(--muted); font-size: 1.08rem; line-height: 1.7; max-width: 720px; }
.eyebrow { color: var(--accent-2); text-transform: uppercase; letter-spacing: .14em; font-size: .76rem !important; font-weight: 800; }
.hero-actions { display: flex; gap: 12px; margin-top: 26px; }

.card { border: 1px solid var(--border); background: linear-gradient(180deg, rgba(23,28,38,.96), rgba(14,18,25,.96)); border-radius: 18px; padding: 24px; box-shadow: 0 18px 50px rgba(0,0,0,.18); }
.hero-panel { padding: 28px; }
.status-row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 4px rgba(255,102,122,.08); }
.status-dot.online { background: var(--success); box-shadow: 0 0 0 4px rgba(56,217,150,.08); }
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 24px; }
.metric-grid > div { background: var(--panel); border: 1px solid var(--border); border-radius: 13px; padding: 16px; display: grid; gap: 6px; }
.metric-label { color: var(--muted); font-size: .78rem; }
.feature-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 28px; }
.feature-strip .card { display: grid; gap: 9px; }
.feature-strip span { color: var(--muted); line-height: 1.45; }

.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 0 18px; border: 0; border-radius: 11px; background: linear-gradient(135deg, var(--accent), #6244ed); color: white; font-weight: 750; cursor: pointer; box-shadow: 0 10px 28px rgba(124,92,255,.18); }
.button:hover { filter: brightness(1.08); }
.button.secondary { background: var(--panel-2); border: 1px solid var(--border); box-shadow: none; color: var(--muted); }
.button.small { min-height: 38px; font-size: .9rem; }
.button:disabled { opacity: .45; cursor: not-allowed; }

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 30px; }
.back-link { color: var(--muted); font-size: .9rem; display: inline-block; margin-bottom: 20px; }
.server-grid, .module-grid { display: grid; gap: 16px; }
.server-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.server-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; }
.server-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-weight: 900; background: var(--panel); border: 1px solid var(--border); }
.server-info h2, .module-card h2 { margin: 0 0 8px; letter-spacing: -.025em; }
.module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.module-card { min-height: 210px; display: flex; flex-direction: column; align-items: flex-start; }
.module-card p { color: var(--muted); line-height: 1.55; flex: 1; }
.module-badge { border: 1px solid var(--border); color: var(--accent-2); padding: 5px 8px; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.muted-card { opacity: .68; }
.disabled-action { color: var(--muted); font-size: .88rem; }

.builder-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 22px; align-items: start; }
.form-card { display: grid; gap: 18px; }
.form-card label { display: grid; gap: 8px; color: #dfe4ef; font-weight: 650; font-size: .9rem; }
.form-card small { color: var(--muted); font-weight: 500; }
input, textarea { width: 100%; border: 1px solid var(--border); background: #0b0f16; color: var(--text); border-radius: 10px; padding: 12px 13px; outline: none; resize: vertical; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.preview-card { position: sticky; top: 96px; }
.discord-preview { background: #313338; border-radius: 12px; padding: 18px; }
.discord-author { display: flex; gap: 8px; align-items: center; }
.preview-avatar { width: 38px; height: 38px; border-radius: 50%; }
.app-tag { font-size: .62rem; background: #5865f2; color: white; border-radius: 4px; padding: 2px 4px; font-weight: 900; }
.preview-embed { border-left: 4px solid var(--accent); border-radius: 4px; background: #2b2d31; padding: 14px 16px; margin: 12px 0 0 46px; max-width: 520px; }
.preview-embed p { color: #b5bac1; line-height: 1.45; margin-bottom: 0; }
.notice { border-radius: 12px; padding: 14px 16px; margin-bottom: 20px; border: 1px solid var(--border); }
.notice.success { background: rgba(56,217,150,.08); border-color: rgba(56,217,150,.35); color: #baf4db; }
.empty-state, .error-state { max-width: 720px; }
.footer { width: min(1180px, 90vw); margin: 0 auto; min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 20px; color: var(--muted); border-top: 1px solid var(--border); font-size: .85rem; }

@media (max-width: 900px) {
  .hero, .builder-grid { grid-template-columns: 1fr; }
  .feature-strip, .module-grid { grid-template-columns: repeat(2, 1fr); }
  .server-grid { grid-template-columns: 1fr; }
  .preview-card { position: static; }
}

@media (max-width: 620px) {
  .topbar { padding: 0 4vw; }
  .topnav > a:not(.button), .user-pill { display: none; }
  .page-shell { width: 92vw; padding-top: 38px; }
  .feature-strip, .module-grid, .metric-grid, .form-row { grid-template-columns: 1fr; }
  .server-card { grid-template-columns: auto 1fr; }
  .server-card .button { grid-column: 1 / -1; }
  .footer { width: 92vw; flex-direction: column; justify-content: center; align-items: flex-start; padding: 20px 0; }
}
