/* ==========================================================================
   Lexicon website — lexicon.robertvokac.com
   ========================================================================== */

:root {
  --bg: #f6f7fa;
  --surface: #ffffff;
  --surface-alt: #eef1f6;
  --text: #1d2433;
  --muted: #5b6577;
  --accent: #3d5a99;
  --accent-strong: #2e4577;
  --accent-soft: #e4eaf6;
  --border: #dfe4ec;
  --code-bg: #f0f2f7;
  --code-block-bg: #1e2430;
  --code-block-text: #dbe2ef;
  --shadow: 0 1px 3px rgba(20, 30, 55, 0.08), 0 8px 24px rgba(20, 30, 55, 0.06);
  --ok: #2e7d4f;
  --warn: #b26a00;
  --danger: #b3403a;
}

[data-theme="dark"] {
  --bg: #12161d;
  --surface: #1a202a;
  --surface-alt: #202836;
  --text: #e6eaf2;
  --muted: #9aa5b8;
  --accent: #86a4e3;
  --accent-strong: #a8bfee;
  --accent-soft: #242f45;
  --border: #2a3342;
  --code-bg: #232b3a;
  --code-block-bg: #10141b;
  --code-block-text: #ccd6e8;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  --ok: #6fbf92;
  --warn: #e0a94f;
  --danger: #e08a85;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; color: var(--text); }
h1 { font-size: 2.1rem; margin: 0.2em 0 0.5em; }
h2 { font-size: 1.5rem; margin-top: 2.2em; padding-bottom: 0.25em; border-bottom: 1px solid var(--border); }
h3 { font-size: 1.15rem; margin-top: 1.8em; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }

kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  padding: 0.1em 0.45em;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
}

/* --------------------------------------------------------------------------
   Header / navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand-icon { width: 28px; height: 28px; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.site-nav a {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--text); background: var(--surface-alt); text-decoration: none; }
.site-nav a.active { color: var(--accent); background: var(--accent-soft); }

.nav-actions { display: flex; align-items: center; gap: 0.4rem; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.05rem;
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-alt); }

.nav-burger { display: none; }

@media (max-width: 820px) {
  .nav-burger { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1.25rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
}

/* --------------------------------------------------------------------------
   Hero (landing page)
   -------------------------------------------------------------------------- */

.hero {
  padding: 4rem 0 3rem;
  text-align: center;
  background: linear-gradient(180deg, var(--accent-soft), var(--bg));
}

.hero-icon { width: 84px; height: 84px; margin-bottom: 1rem; }

.hero h1 { font-size: 2.8rem; margin: 0 0 0.3em; }

.hero .tagline {
  font-size: 1.25rem;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 1.5rem;
}

.badges { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-bottom: 1.8rem; }

.badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
[data-theme="dark"] .btn-primary { color: #10141b; }

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

.hero-shot { margin: 2.5rem auto 0; max-width: 920px; }
.hero-shot img {
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* --------------------------------------------------------------------------
   Sections, cards, grids
   -------------------------------------------------------------------------- */

.section { padding: 3.5rem 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section h2 { border-bottom: none; margin-top: 0; text-align: center; font-size: 1.8rem; }
.section .section-lead { text-align: center; color: var(--muted); max-width: 640px; margin: 0.5rem auto 2.5rem; }

.grid { display: grid; gap: 1.25rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.5rem;
}
.section-alt .card { background: var(--bg); }

.card h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.card .card-emoji { font-size: 1.6rem; display: block; margin-bottom: 0.6rem; }

a.card-link { display: block; color: inherit; transition: border-color 0.15s ease, transform 0.15s ease; }
a.card-link:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
a.card-link h3 { color: var(--accent); }

.audience-card { padding: 2rem; }
.audience-card h3 { font-size: 1.3rem; }
.audience-card ul { color: var(--muted); font-size: 0.95rem; padding-left: 1.2rem; margin: 0.8rem 0 1.2rem; }
.audience-card .btn { margin-top: 0.25rem; }

/* --------------------------------------------------------------------------
   Docs layout (sidebar + content)
   -------------------------------------------------------------------------- */

.docs-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 3rem;
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.docs-sidebar { font-size: 0.93rem; }

.docs-sidebar nav {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 0.5rem;
}

.sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 1.4rem 0 0.4rem;
}
.sidebar-title:first-child { margin-top: 0; }

.docs-sidebar ul { list-style: none; margin: 0; padding: 0; }
.docs-sidebar li a {
  display: block;
  padding: 0.35rem 0.7rem;
  border-radius: 7px;
  color: var(--muted);
}
.docs-sidebar li a:hover { color: var(--text); background: var(--surface-alt); text-decoration: none; }
.docs-sidebar li a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

@media (max-width: 820px) {
  .docs-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .docs-sidebar nav { position: static; max-height: none; }
}

.breadcrumbs { font-size: 0.85rem; color: var(--muted); margin: 0 0 0.4rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }

.docs-content > p.lead { font-size: 1.1rem; color: var(--muted); margin-top: 0; }

/* Prev / next page navigation */
.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.page-nav a {
  max-width: 48%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.92rem;
}
.page-nav a:hover { border-color: var(--accent); text-decoration: none; }
.page-nav .dir { display: block; font-size: 0.75rem; color: var(--muted); }
.page-nav .next { margin-left: auto; text-align: right; }

/* --------------------------------------------------------------------------
   Content elements
   -------------------------------------------------------------------------- */

.docs-content table, .table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.93rem;
  display: block;
  overflow-x: auto;
}
.docs-content table th, .docs-content table td,
.table th, .table td {
  text-align: left;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  vertical-align: top;
}
.docs-content table th, .table th { background: var(--surface-alt); white-space: nowrap; }
.docs-content table tr:nth-child(even) td { background: var(--surface); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.12em 0.4em;
  border-radius: 5px;
}

pre {
  position: relative;
  background: var(--code-block-bg);
  color: var(--code-block-text);
  padding: 1rem 1.2rem;
  border-radius: 10px;
  overflow-x: auto;
  line-height: 1.55;
  margin: 1.2rem 0;
}
pre code { background: none; padding: 0; font-size: 0.86rem; color: inherit; }

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-family: inherit;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--code-block-text);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}
pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(255, 255, 255, 0.18); }

/* Callouts */
.callout {
  display: flex;
  gap: 0.7rem;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background: var(--surface);
  margin: 1.2rem 0;
  font-size: 0.95rem;
}
.callout .callout-icon { flex: none; }
.callout p { margin: 0; }
.callout strong:first-child { display: block; margin-bottom: 0.15rem; }
.callout-tip { border-left-color: var(--ok); }
.callout-warning { border-left-color: var(--warn); }
.callout-danger { border-left-color: var(--danger); }

/* Screenshots inside docs */
figure.screenshot { margin: 1.5rem 0; }
figure.screenshot img {
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}
figure.screenshot figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.5rem;
  text-align: center;
}

/* Steps list */
ol.steps { counter-reset: step; list-style: none; padding-left: 0; }
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.1rem;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

/* Inline tag/pill list (e.g. relation types) */
.pill { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.82rem; font-weight: 600; margin: 0.1rem 0.15rem 0.1rem 0; white-space: nowrap; }

/* --------------------------------------------------------------------------
   Screenshot gallery
   -------------------------------------------------------------------------- */

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-top: 2rem; }
@media (max-width: 720px) { .gallery { grid-template-columns: 1fr; } }

.gallery figure { margin: 0; }
.gallery img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  cursor: zoom-in;
  transition: transform 0.15s ease;
}
.gallery img:hover { transform: scale(1.015); }
.gallery figcaption { margin-top: 0.6rem; }
.gallery figcaption strong { display: block; }
.gallery figcaption span { color: var(--muted); font-size: 0.9rem; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(10, 14, 22, 0.88);
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6);
}
.lightbox .lightbox-caption {
  position: absolute;
  bottom: 1.2rem;
  left: 0;
  right: 0;
  text-align: center;
  color: #cdd6e4;
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 2.5rem 0;
  margin-top: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-grid { display: flex; flex-wrap: wrap; gap: 2.5rem; justify-content: space-between; }
.footer-col h4 { margin: 0 0 0.6rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.35rem; }
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: var(--accent); }

.footer-bottom { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--border); text-align: center; }
