/* ==========================================================================
   SkillIA Wiki — ported from the marketing site's design system
   (assets/css/main.css) so the internal wiki reads as the same product.
   Plain CSS, no build step required.
   ========================================================================== */

:root {
  --bg: #142337;
  --bg-raised: #1a2c46;
  --ink: #ecf3ff;
  --muted: rgba(213, 228, 255, 0.72);
  --faint: rgba(213, 228, 255, 0.46);

  --accent: #89d7ff;
  --accent-strong: #b9e7ff;
  --accent-dim: rgba(137, 215, 255, 0.14);
  --accent-glow: rgba(137, 215, 255, 0.35);

  --card: rgba(146, 189, 255, 0.06);
  --card-hover: rgba(146, 189, 255, 0.1);
  --stroke: rgba(158, 197, 255, 0.18);
  --stroke-soft: rgba(158, 197, 255, 0.1);

  --ok: #7ce8b5;
  --err: #ff7a7f;

  --radius: 16px;
  --radius-sm: 10px;
  --max: 1180px;
  --nav-h: 68px;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.skip-link {
  position: absolute; left: -999px; top: 10px; z-index: 999;
  background: var(--bg-raised); border: 1px solid var(--stroke);
  color: var(--ink); padding: 10px 14px; border-radius: var(--radius-sm);
}
.skip-link:focus { left: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.section-tight { padding: 32px 0; }

h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.15; font-weight: 650; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.1rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.lead { font-size: clamp(1rem, 1.6vw, 1.15rem); color: var(--muted); max-width: 46em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.accent { color: var(--accent); }

.kicker {
  display: inline-block; letter-spacing: 0.2em; text-transform: uppercase;
  font-size: 0.7rem; font-weight: 600; color: var(--accent); margin-bottom: 10px;
}

/* Header / nav */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(20, 35, 55, 0.85);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--stroke-soft);
}
.nav-shell {
  max-width: var(--max); margin: 0 auto; padding: 0 20px; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.brand img { height: 30px; width: auto; }
.brand .wiki-tag {
  font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); border: 1px solid rgba(137, 215, 255, 0.35);
  border-radius: 999px; padding: 3px 9px;
}

.top-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.top-nav ul { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; flex-wrap: wrap; }
.nav-link {
  display: inline-block; padding: 7px 12px; border-radius: 999px;
  font-size: 0.9rem; color: var(--muted); transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--ink); background: var(--card-hover); }
.nav-link.active { color: var(--ink); background: var(--card); }

.nav-right { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--muted); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; border: 1px solid transparent;
  font-size: 0.95rem; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #06131c; box-shadow: 0 0 32px rgba(137, 215, 255, 0.22); }
.btn-primary:hover { background: var(--accent-strong); box-shadow: 0 0 44px var(--accent-glow); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--stroke); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* Cards & grids */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--card); border: 1px solid var(--stroke-soft);
  border-radius: var(--radius); padding: 24px;
  transition: border-color 0.2s, background 0.2s;
}
.card:hover { border-color: var(--stroke); background: var(--card-hover); }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.category-card { display: flex; flex-direction: column; gap: 10px; }
.category-icon { font-size: 1.6rem; }
.category-count { font-size: 0.82rem; color: var(--faint); }

/* Article list */
.article-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; border-radius: var(--radius-sm); border: 1px solid var(--stroke-soft);
  background: var(--card); transition: border-color 0.15s, background 0.15s;
}
.article-row:hover { border-color: var(--stroke); background: var(--card-hover); }
.article-row h3 { margin: 0 0 4px; font-size: 1rem; }
.article-row p { margin: 0; color: var(--faint); font-size: 0.88rem; }

/* Sidebar layout */
.wiki-layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
.wiki-sidebar { position: sticky; top: calc(var(--nav-h) + 24px); }
.sidebar-title { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin: 0 0 12px; }
.sidebar-list { list-style: none; margin: 0 0 24px; padding: 0; }
.sidebar-list li a {
  display: block; padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 0.92rem;
}
.sidebar-list li a:hover { color: var(--ink); background: var(--card-hover); }
.sidebar-list li a.active { color: var(--accent); background: var(--accent-dim); }

/* Prose (markdown article body) */
.prose { max-width: 760px; color: var(--muted); }
.prose h1, .prose h2, .prose h3 { color: var(--ink); }
.prose h2 { font-size: 1.35rem; margin-top: 1.6em; }
.prose h3 { font-size: 1.1rem; margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--accent); text-decoration: underline; }
.prose code {
  background: rgba(146, 189, 255, 0.1); color: var(--accent-strong);
  padding: 2px 6px; border-radius: 6px; font-size: 0.88em;
}
.prose pre {
  background: var(--bg-raised); border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-sm); padding: 16px; overflow-x: auto;
}
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; }
.prose th, .prose td { border: 1px solid var(--stroke-soft); padding: 8px 12px; text-align: left; }
.prose th { color: var(--ink); }

/* Forms */
form label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 6px; }
.field { margin-bottom: 16px; }

input[type="text"], input[type="email"], input[type="password"] {
  width: 100%; padding: 11px 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke); border-radius: var(--radius-sm);
  color: var(--ink); font-family: inherit; font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(137, 215, 255, 0.15);
}

.form-msg { margin-top: 12px; font-weight: 600; font-size: 0.9rem; display: none; }
.form-msg.err { color: var(--err); display: block; }
.form-msg.ok { color: var(--ok); display: block; }

.divider-line { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--faint); font-size: 0.85rem; }
.divider-line::before, .divider-line::after { content: ""; flex: 1; height: 1px; background: var(--stroke-soft); }

.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand { justify-content: center; margin-bottom: 28px; }

.gh-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 20px; border-radius: 999px;
  background: var(--ink); color: #0e1c2e; font-weight: 650; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer;
}
.gh-btn:hover { background: #fff; }

/* Footer */
.site-footer { border-top: 1px solid var(--stroke-soft); padding: 40px 0; margin-top: 40px; }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  color: var(--faint); font-size: 0.85rem;
}
.footer-bottom a { color: var(--muted); }
.footer-bottom a:hover { color: var(--accent); }

@media (max-width: 860px) {
  .wiki-layout { grid-template-columns: 1fr; }
  .wiki-sidebar { position: static; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .top-nav ul { display: none; }
}

@media (max-width: 560px) {
  .grid-3 { grid-template-columns: 1fr; }
  .article-row { flex-direction: column; align-items: flex-start; }
}
