@font-face { font-family: 'Poppins'; src: url('../fonts/poppins-400.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../fonts/poppins-600.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../fonts/poppins-700.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --bg: #120b08;
  --bg-2: #170f0a;
  --surface: #1d140e;
  --surface-2: #2a1d14;
  --border: #3a2a1d;
  --text: #f7efe2;
  --muted: #c2b19c;
  --faint: #8f7c68;
  --accent: #ec8f33;
  --accent-2: #f6b45c;
  --accent-soft: rgba(236, 143, 51, 0.14);
  --gold: #ffd77a;
  --gold-soft: rgba(255, 215, 122, 0.13);
  --danger: #f87171;
  --radius: 14px;
  --head: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
main { flex: 1; }

/* ---------- header ---------- */
.top { border-bottom: 1px solid var(--border); background: rgba(18, 11, 8, 0.88); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 700 20px var(--head); }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.top nav a.link { color: var(--muted); padding: 8px 10px; border-radius: 8px; font-size: 15px; }
.top nav a.link:hover { color: var(--text); text-decoration: none; background: var(--surface); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px var(--body); border-radius: 10px; padding: 11px 18px;
  border: 1px solid transparent; cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap; color: var(--text); background: var(--surface-2);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #1a0d05; }
.btn-primary:hover { background: #f6a24c; }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { border-color: var(--faint); background: var(--surface); }
.btn-sm { padding: 7px 12px; font-size: 14px; border-radius: 8px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ---------- landing ---------- */
.hero { padding: 28px 0 56px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -260px; right: -160px; width: 720px; height: 720px;
  background: radial-gradient(closest-side, rgba(236, 143, 51, 0.16), transparent); pointer-events: none;
}
.hero .hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; position: relative; }
.banner-wrap { position: relative; margin-bottom: 44px; }
.banner { display: block; width: 100%; height: auto; border-radius: 18px; border: 1px solid var(--border); box-shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.9); }
.eyebrow { display: inline-block; color: var(--accent-2); background: var(--accent-soft); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.hero h1 { font-size: clamp(38px, 6vw, 60px); }
.hero h1 span { color: var(--accent-2); }
.hero p.lead { color: var(--muted); font-size: 18px; margin: 18px 0 28px; max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* a Discord-like preview of Kelmo's real welcome message */
.preview { background: #1e1f22; border: 1px solid #2b2d31; border-radius: 12px; padding: 18px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7); font-size: 14.5px; min-width: 0; }
.msg { display: flex; gap: 12px; min-width: 0; }
.msg > div { min-width: 0; }
.msg img.av { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.msg .who { font-weight: 600; color: #f2f3f5; }
.msg .tag { background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1px 5px; margin-left: 4px; vertical-align: 2px; }
.msg .when { color: #949ba4; font-size: 12px; margin-left: 6px; }
.embed { margin-top: 6px; background: #2b2d31; border-left: 4px solid var(--accent); border-radius: 4px; padding: 10px 14px 12px; color: #dbdee1; line-height: 1.5; overflow-wrap: anywhere; }
.embed b { color: #f2f3f5; }
.embed .t { font-weight: 700; color: #f2f3f5; margin-bottom: 6px; }
.embed code { background: #1e1f22; border-radius: 4px; padding: 1px 4px; font-size: 13px; }
.embed ul { margin: 4px 0 8px; padding-left: 18px; }
.embed p { margin: 0 0 8px; }
.embed p:last-child { margin: 0; }

section.block { padding: 56px 0; border-top: 1px solid var(--border); }
section.block h2 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 10px; }
section.block p.sub { color: var(--muted); margin: 0 0 32px; max-width: 40em; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card h3 { font-size: 20px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.card p { color: var(--muted); margin: 0; font-size: 15px; }
.icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); display: grid; place-items: center; font-size: 18px; flex: none; }
.badge { font: 700 11px var(--body); letter-spacing: 0.04em; text-transform: uppercase; border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.badge-premium { color: var(--gold); background: var(--gold-soft); }
.badge-note { color: var(--muted); background: var(--surface-2); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: step; }
.step { padding: 20px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--border); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #1a0d05; font: 700 14px var(--body); margin-bottom: 12px; }
.step h3 { font-size: 20px; margin-bottom: 4px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
.lead code, .step code, .prose code, .hint code { background: var(--surface-2); border-radius: 5px; padding: 1px 6px; font-size: 0.92em; }

.final { text-align: center; }
.final p.sub { margin-left: auto !important; margin-right: auto !important; }
.final .cta { justify-content: center; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--border); color: var(--faint); font-size: 14px; padding: 26px 0; margin-top: 40px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
footer a { color: var(--muted); }
footer .sp { margin-left: auto; }

/* ---------- legal pages ---------- */
.prose { max-width: 760px; padding: 48px 20px 24px; }
.prose h1 { font-size: clamp(32px, 5vw, 44px); margin-bottom: 6px; }
.prose .meta { color: var(--faint); margin: 0 0 30px; font-size: 14px; }
.prose h2 { font-size: 25px; margin: 34px 0 10px; }
.prose p, .prose li { color: #cdd1e2; }
.prose ul { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 10px 0 6px; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.table-scroll { overflow-x: auto; }
.callout { background: var(--accent-soft); border: 1px solid rgba(246, 180, 92, 0.3); border-radius: 12px; padding: 14px 16px; color: var(--text); }

/* ---------- dashboard ---------- */
.dash { padding: 36px 0 20px; }
.dash h1 { font-size: 30px; }
.dash .lead { color: var(--muted); margin: 6px 0 22px; }
.user { display: flex; align-items: center; gap: 10px; }
.user img { width: 30px; height: 30px; border-radius: 50%; }
.user .name { font-weight: 600; font-size: 14px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center-box { max-width: 460px; margin: 60px auto; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 36px 28px; }
.center-box img.logo { width: 72px; height: 72px; margin-bottom: 14px; border-radius: 18px; }
.center-box h1 { font-size: 26px; margin-bottom: 8px; }
.center-box p { color: var(--muted); margin: 0 0 22px; }
.center-box .small { font-size: 13px; color: var(--faint); margin: 18px 0 0; }

.servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.server { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; min-width: 0; }
.gi { width: 44px; height: 44px; border-radius: 12px; flex: none; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; color: var(--muted); overflow: hidden; }
.gi img { width: 100%; height: 100%; }
.server .gname { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server .gname small { display: block; font-weight: 400; color: var(--faint); font-size: 13px; }
.section-label { color: var(--faint); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin: 28px 0 10px; }

.ghead { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.ghead .gi { width: 52px; height: 52px; border-radius: 14px; }
.ghead h1 { font-size: 26px; overflow-wrap: anywhere; }
.ghead .plan { margin-top: 6px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-bottom: 18px; background: none; border: 0; cursor: pointer; padding: 0; font-family: inherit; }
.back:hover { color: var(--text); text-decoration: none; }

.modules { display: grid; gap: 10px; }
.module { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.module .info { flex: 1; min-width: 0; }
.module .info h2 { font-size: 17px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.module .info p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }

/* toggle switch */
.switch { position: relative; width: 50px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); transition: background 0.15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--faint); transition: transform 0.18s, background 0.15s; }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(22px); background: #1a0d05; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .track { opacity: 0.45; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 12px 18px; border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; max-width: calc(100vw - 32px); font-size: 15px; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(248, 113, 113, 0.55); }
.notice { background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.35); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; }
.empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 22px; }
.hint { color: var(--faint); font-size: 14px; margin-top: 18px; }
.loading { color: var(--muted); padding: 40px 0; }
[hidden] { display: none !important; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .hero { padding: 16px 0 36px; }
  .hero .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .grid, .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .prose { padding: 32px 16px 16px; }
  .dash { padding-top: 28px; }
  .grid, .steps { grid-template-columns: 1fr; }
  .top nav a.link.hide-sm { display: none; }
  .cta .btn { flex: 1 1 100%; }
  .banner-wrap { margin-bottom: 28px; padding: 0 10px; }
  .banner { border-radius: 12px; }
  .user .name { display: none; }
  .module { padding: 14px; gap: 12px; }
  footer .sp { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.server-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
