/* MD-Studio website */
:root {
  --bg: #07090f;
  --panel: #0d111c;
  --border: #232a3d;
  --text: #e6e9f2;
  --muted: #8b93a8;
  --dim: #5a627a;
  --accent: #22d3ee;
  --accent2: #818cf8;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Nav ─── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
  max-width: 1200px;
  margin: 0 auto;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
}
.logo-square {
  width: 18px; height: 18px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  display: inline-block;
}
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--muted); font-size: 14px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ─── Hero ─── */
.hero { padding-bottom: 80px; }
.hero-content {
  max-width: 900px;
  margin: 60px auto 0;
  padding: 0 40px;
  text-align: center;
}
.hero h1 {
  font-size: 64px;
  line-height: 1.05;
  margin: 0 0 20px;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.grad {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline {
  font-size: 19px;
  color: var(--muted);
  margin-bottom: 40px;
  max-width: 640px;
  margin-left: auto; margin-right: auto;
}
.cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-primary {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #0a0e1a;
  font-weight: 700;
  font-size: 15px;
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(34, 211, 238, 0.2);
}
.btn-primary:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(34, 211, 238, 0.3);
}
.btn-primary.small { padding: 8px 16px; font-size: 13px; }
.btn-primary .version {
  font-size: 11px;
  opacity: 0.7;
  font-weight: 500;
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 14px 24px;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  border-radius: 10px;
  background: var(--panel);
}
.btn-secondary:hover { border-color: var(--accent); text-decoration: none; }
.hero-hint { color: var(--dim); font-size: 13px; margin-top: 20px; }

/* ─── Features ─── */
.features {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 40px;
}
.features h2, .download h2, .changelog h2 {
  font-size: 32px;
  margin-bottom: 40px;
  letter-spacing: -0.02em;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.feature {
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.15s, transform 0.15s;
}
.feature:hover { border-color: rgba(34, 211, 238, 0.3); transform: translateY(-2px); }
.feature h3 { margin: 0 0 8px; font-size: 16px; color: var(--text); }
.feature p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

/* ─── Download ─── */
.download {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}
.download-version { color: var(--muted); margin-bottom: 30px; }
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.dl-card {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dl-card.disabled { opacity: 0.5; }
.dl-label { font-weight: 600; font-size: 14px; }
.dl-file { color: var(--dim); font-size: 11px; font-family: 'JetBrains Mono', monospace; }
.dl-unavailable { color: var(--dim); font-size: 13px; font-style: italic; }

/* ─── Changelog ─── */
.changelog {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}
.release {
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
}
.release-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 12px;
}
.release-version { font-size: 18px; font-weight: 700; }
.release-date { color: var(--dim); font-size: 13px; }
.release-notes { color: var(--muted); font-size: 14px; line-height: 1.7; white-space: pre-line; }

/* ─── Footer ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 30px 40px;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--muted); }

/* ─── Prose pages (privacy, etc.) ─── */
.prose-page .simple-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  max-width: 800px;
  margin: 0 auto;
}
.prose {
  max-width: 720px;
  margin: 40px auto;
  padding: 0 40px;
}
.prose h1 { font-size: 36px; letter-spacing: -0.02em; }
.prose h2 { font-size: 22px; margin-top: 36px; }
.prose p, .prose li { color: var(--muted); }
.prose .muted { color: var(--dim); font-size: 13px; }
.prose code { background: var(--panel); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.prose ul.strike-good li { color: #6ee7b7; }

/* ─── Admin pages ─── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}
.admin-side {
  width: 220px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
}
.admin-side h2 { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; margin: 16px 0 8px; }
.admin-side a {
  display: block;
  padding: 8px 12px;
  color: var(--muted);
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 2px;
}
.admin-side a:hover { background: rgba(255,255,255,0.04); color: var(--text); text-decoration: none; }
.admin-side a.active { background: rgba(34, 211, 238, 0.1); color: var(--accent); }
.admin-main { flex: 1; padding: 40px; max-width: 1200px; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.stat-label { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 6px; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0;
  font-size: 13px;
}
.bar-row .lbl { width: 140px; color: var(--muted); }
.bar-row .bar-bg { flex: 1; height: 10px; background: rgba(255,255,255,0.05); border-radius: 5px; overflow: hidden; }
.bar-row .bar { height: 100%; background: linear-gradient(90deg, var(--accent) 0%, var(--accent2) 100%); border-radius: 5px; }
.bar-row .val { width: 60px; text-align: right; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
table.events {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
table.events th, table.events td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.events th { color: var(--dim); font-weight: 600; text-transform: uppercase; font-size: 10px; letter-spacing: 1px; }
table.events td { color: var(--muted); }
table.events tr:hover td { background: rgba(255,255,255,0.02); color: var(--text); }
.login-card {
  max-width: 400px;
  margin: 100px auto;
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.login-card h1 { margin: 0 0 24px; font-size: 22px; }
.login-card input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  margin-bottom: 12px;
}
.login-card input:focus { border-color: var(--accent); }
.login-card button {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #0a0e1a;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.login-card .err { color: #f87171; font-size: 13px; margin-bottom: 12px; }

/* ─── Forms ─── */
.form-grid label { display: block; margin: 12px 0 4px; color: var(--muted); font-size: 13px; }
.form-grid input, .form-grid textarea, .form-grid select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
}
.form-grid textarea { min-height: 120px; font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.btn-submit {
  margin-top: 16px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #0a0e1a;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}
.flash {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 13px;
}
.flash.success { background: rgba(110, 231, 183, 0.1); color: #6ee7b7; border: 1px solid rgba(110, 231, 183, 0.3); }
.flash.error   { background: rgba(248, 113, 113, 0.1); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.3); }

@media (max-width: 768px) {
  .hero h1 { font-size: 42px; }
  .admin-layout { flex-direction: column; }
  .admin-side { width: 100%; }
}
