/* Cookie consent dark theme */
#cc-main {
  --cc-bg: #141518;
  --cc-primary-color: #e8e9ec;
  --cc-secondary-color: #888a94;
  --cc-btn-primary-bg: #5b8fff;
  --cc-btn-primary-color: #fff;
  --cc-btn-primary-hover-bg: #3d6fe8;
  --cc-btn-primary-hover-color: #fff;
  --cc-btn-secondary-bg: #1c1d21;
  --cc-btn-secondary-color: #e8e9ec;
  --cc-btn-secondary-hover-bg: #2a2b30;
  --cc-btn-secondary-hover-color: #e8e9ec;
  --cc-separator-border-color: #2a2b30;
  --cc-cookie-category-block-bg: #1c1d21;
  --cc-cookie-category-block-hover-bg: #2a2b30;
  --cc-overlay-bg: rgba(14,15,17,0.7);
  --cc-toggle-on-bg: #5b8fff;
  --cc-section-border: #2a2b30;
  --cc-font-family: 'DM Sans', sans-serif;
}
#cc-main .cm, #cc-main .pm {
  border: 1px solid #2a2b30;
  border-radius: 10px;
}

:root {
  --bg:       #0e0f11;
  --bg2:      #141518;
  --bg3:      #1c1d21;
  --border:   #2a2b30;
  --text:     #e8e9ec;
  --muted:    #888a94;
  --accent:   #5b8fff;
  --accent2:  #3d6fe8;
  --green:    #3ecf8e;
  --yellow:   #f5c542;
  --red:      #ff6b6b;
  --purple:   #a78bfa;
  --radius:   10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ─── NAV ─── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14,15,17,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  font-family: 'DM Mono', monospace;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-dot { color: var(--accent); }
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  align-items: center;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 0.85rem !important;
  transition: background 0.2s !important;
}
.nav-cta:hover { background: var(--accent2) !important; color: #fff !important; }

/* Hamburger toggle (mobile) */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.nav-toggle:hover { background: var(--bg3); }
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle.open span { background: transparent; }
.nav-toggle.open span::before { top: 0; transform: rotate(45deg); }
.nav-toggle.open span::after { top: 0; transform: rotate(-45deg); }

/* Language switcher */
.lang-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.lang-switch button {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.active {
  background: var(--bg3);
  color: var(--accent);
}

/* ─── HERO ─── */
.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px 2rem 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(91,143,255,0.1);
  border: 1px solid rgba(91,143,255,0.3);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.badge-dot {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 1.25rem;
}
h1 em {
  font-style: italic;
  color: var(--accent);
}
.hero-desc {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.75;
  margin-bottom: 2rem;
  font-weight: 300;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--muted); background: var(--bg3); }

/* Terminal mock */
.terminal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
}
.terminal-bar {
  background: var(--bg3);
  padding: 10px 16px;
  display: flex;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.t-dot { width: 10px; height: 10px; border-radius: 50%; }
.t-dot:nth-child(1) { background: #ff5f57; }
.t-dot:nth-child(2) { background: #febc2e; }
.t-dot:nth-child(3) { background: #28c840; }
.terminal-label { color: var(--muted); font-size: 0.75rem; margin-left: auto; }
.terminal-body { padding: 20px; line-height: 2; }
.t-comment { color: #4a4f5e; }
.t-cmd { color: var(--text); }
.t-cmd::before { content: '$ '; color: var(--green); }
.t-out { color: var(--muted); }
.t-success { color: var(--green); }
.t-accent { color: var(--accent); }

/* ─── SECTIONS ─── */
section { padding: 80px 2rem; }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
h2 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}
.section-desc {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 540px;
  margin-bottom: 3rem;
  font-weight: 300;
}

/* ─── FEATURES ─── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.feature {
  background: var(--bg2);
  padding: 2rem;
  transition: background 0.2s;
}
.feature:hover { background: var(--bg3); }
.feature-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
.feature h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.feature p { font-size: 0.9rem; color: var(--muted); line-height: 1.6; }

/* ─── ROLES ─── */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}
.role-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.role-name {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}
.role-admin .role-name { background: rgba(255,107,107,0.15); color: var(--red); }
.role-owner .role-name { background: rgba(91,143,255,0.15); color: var(--accent); }
.role-tenant .role-name { background: rgba(62,207,142,0.15); color: var(--green); }
.role-counter .role-name { background: rgba(245,197,66,0.15); color: var(--yellow); }
.role-caretaker .role-name { background: rgba(167,139,250,0.15); color: var(--purple); }
.role-card p { font-size: 0.875rem; color: var(--muted); }
.role-perms {
  list-style: none;
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.role-perms li {
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.role-perms li::before { content: '\2713'; color: var(--green); font-size: 0.75rem; }

/* ─── TECH ─── */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.tech-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tech-item span { color: var(--muted); font-size: 0.75rem; font-family: 'DM Sans', sans-serif; }

/* ─── DOCS ─── */
.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  align-items: start;
}
.docs-nav {
  position: sticky;
  top: 80px;
}
.docs-nav-section {
  margin-bottom: 1.5rem;
}
.docs-nav-title {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.docs-nav-links { list-style: none; }
.docs-nav-links a {
  display: block;
  padding: 4px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}
.docs-nav-links a:hover { color: var(--text); }
.docs-nav-links a.active { color: var(--accent); }

.docs-content {
  min-width: 0;
}
.docs-content h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem;
  margin: 2.5rem 0 1rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: 80px;
}
.docs-content h3:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.docs-content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
}
.docs-content p { color: var(--muted); margin-bottom: 1rem; font-size: 0.95rem; }
.docs-content ul { color: var(--muted); padding-left: 1.5rem; margin-bottom: 1rem; font-size: 0.95rem; }
.docs-content li { margin-bottom: 0.3rem; }

pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1rem 0;
}
code {
  font-family: 'DM Mono', monospace;
  font-size: 0.83rem;
  color: var(--text);
  line-height: 1.8;
}
p code, li code {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--accent);
}

.callout {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.9rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.callout-info { background: rgba(91,143,255,0.08); border: 1px solid rgba(91,143,255,0.2); color: #b0c4ff; }
.callout-warn { background: rgba(245,197,66,0.08); border: 1px solid rgba(245,197,66,0.2); color: #f5e09a; }
.callout-tip  { background: rgba(62,207,142,0.08); border: 1px solid rgba(62,207,142,0.2); color: #a0e8c8; }

/* ─── FOOTER ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }

/* ─── RESPONSIVE ─── */
@media (max-width: 1100px) {
  .roles-grid { grid-template-columns: repeat(3, 1fr); }
  .nav-links { gap: 1.1rem; }
  .nav-links a { font-size: 0.85rem; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .roles-grid { grid-template-columns: 1fr 1fr; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-nav { display: none; }

  /* Mobile nav: hamburger pattern */
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(14,15,17,0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-links.open {
    max-height: 480px;
  }
  .nav-links li {
    border-bottom: 1px solid var(--border);
  }
  .nav-links li:last-child { border-bottom: none; }
  .nav-links a {
    display: block;
    padding: 0.9rem 2rem;
    font-size: 0.95rem;
  }
  .nav-cta {
    margin: 0.75rem 2rem;
    text-align: center;
  }
}
@media (max-width: 600px) {
  .features-grid { grid-template-columns: 1fr; }
  .roles-grid { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
  nav { padding: 0 1rem; }
}

/* ─── CLOUD ─── */
.cloud-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}
.cloud-benefit {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: left;
}
.cloud-benefit:hover { background: var(--bg3); }
.cloud-icon {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}
.cloud-benefit h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.cloud-benefit p { font-size: 0.9rem; color: var(--muted); line-height: 1.6; }
.cloud-pricing {
  max-width: 420px;
  margin: 2.5rem auto 0;
}
.cloud-pricing table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.cloud-pricing thead tr {
  border-bottom: 2px solid var(--border);
}
.cloud-pricing th {
  padding: 0.6rem 1rem;
  color: var(--muted);
  font-weight: 500;
  text-align: left;
}
.cloud-pricing td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
}
.cloud-pricing td:last-child {
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  font-weight: 500;
}
.cloud-trial-note {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.75rem;
}
@media (max-width: 900px) {
  .cloud-grid { grid-template-columns: 1fr; }
}

/* subtle grid background */
.hero-section {
  background-image:
    linear-gradient(rgba(91,143,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91,143,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* FAQ accordion marker */
#faq details summary,
.faq-list details summary { position: relative; padding-right: 2rem; }
#faq details summary::-webkit-details-marker,
.faq-list details summary::-webkit-details-marker { display: none; }
#faq details summary::after,
.faq-list details summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--accent);
  transition: transform 0.15s ease;
  line-height: 1;
}
#faq details[open] summary::after,
.faq-list details[open] summary::after { content: "−"; }
#faq details:hover,
.faq-list details:hover { border-color: var(--accent) !important; }

/* ─── BREADCRUMB ─── */
.breadcrumb {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 2rem 0;
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--muted);
}
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.breadcrumb li { display: flex; align-items: center; gap: 0.5rem; }
.breadcrumb li + li::before {
  content: "/";
  color: var(--border);
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current="page"] { color: var(--text); }

/* ─── ARTICLE PAGES ─── */
.article-hero {
  max-width: 820px;
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
}
.article-hero h1 {
  font-size: clamp(2rem, 3.5vw, 3rem);
  margin-bottom: 1rem;
}
.article-hero .lede {
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.65;
  font-weight: 300;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--muted);
}
.article-meta span strong { color: var(--text); font-weight: 500; }

article.content {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}
article.content h2 {
  font-size: clamp(1.6rem, 2.5vw, 2rem);
  margin-top: 3rem;
  margin-bottom: 1rem;
  scroll-margin-top: 80px;
}
article.content h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
article.content p {
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 1.1rem;
  line-height: 1.75;
}
article.content ul, article.content ol {
  color: var(--text);
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
article.content li { margin-bottom: 0.5rem; line-height: 1.7; }
article.content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
article.content a:hover { color: var(--accent2); }
article.content strong { color: var(--text); font-weight: 600; }
article.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
article.content th, article.content td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
article.content th {
  color: var(--muted);
  font-weight: 500;
  background: var(--bg2);
}
article.content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-style: italic;
}

.faq-list {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}
.faq-list h2 {
  margin-bottom: 1.5rem;
}
.faq-list details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  background: var(--bg);
}
.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}
.faq-list .answer {
  margin-top: 0.75rem;
  color: var(--muted);
  line-height: 1.7;
}

.related-pages {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
  border-top: 1px solid var(--border);
}
.related-pages h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}
.related-pages ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.related-pages li {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: background 0.2s, border-color 0.2s;
}
.related-pages li:hover {
  background: var(--bg3);
  border-color: var(--accent);
}
.related-pages a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
}
.related-pages p {
  color: var(--muted);
  font-size: 0.875rem;
}

.page-cta {
  max-width: 820px;
  margin: 0 auto;
  padding: 3rem 2rem;
  text-align: center;
  background: linear-gradient(180deg, var(--bg) 0%, rgba(91,143,255,0.04) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.page-cta h2 { margin-bottom: 0.75rem; }
.page-cta p {
  color: var(--muted);
  margin-bottom: 1.5rem;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}
.page-cta .btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
