﻿/* DChat SDK Docs â€” GitBook-style shared stylesheet */
:root {
  --bg: #1a1d23;
  --surface: #22262f;
  --surface2: #2a2f3b;
  --border: #353a47;
  --accent: #5b8dee;
  --accent2: #7c6aff;
  --green: #3ecf8e;
  --cyan: #22d3ee;
  --red: #e05c6e;
  --text: #e2e8f0;
  --text-muted: #8892a4;
  --text-dim: #5a6375;
  --code-bg: #161920;
  --sidebar-w: 320px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --icon-home: #5b8dee;
  --icon-rocket: #3ecf8e;
  --icon-config: #22d3ee;
  --icon-id: #7c6aff;
  --icon-lock: #3ecf8e;
  --icon-msg: #5b8dee;
  --icon-group: #22d3ee;
  --icon-stream: #7c6aff;
  --icon-list: #e05c6e;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.7;
  display: flex;
  justify-content: center;
}

/* Layout wrapper - centers sidebar + content together */
.layout-wrapper {
  display: flex;
  min-height: 100vh;
  max-width: calc(var(--sidebar-w) + 860px + 80px);
  width: 100%;
}

/* ============================================
   PREMIUM SIDEBAR
   Glassmorphism with animated interactions
   ============================================ */

.sidebar {
  position: sticky;
  top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, rgba(26, 29, 35, 0.98), rgba(22, 25, 30, 0.99));
  border-right: 1px solid rgba(91, 141, 238, 0.1);
  overflow-y: auto;
  z-index: 100;
  padding-bottom: 2rem;
  box-shadow: 2px 0 15px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

/* Subtle gradient overlay */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at top left, rgba(91, 141, 238, 0.03), transparent 50%);
  pointer-events: none;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 2rem 1.75rem 1.5rem;
  border-bottom: 1px solid rgba(91, 141, 238, 0.1);
  text-decoration: none;
  position: relative;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.sidebar-logo:hover {
  background: rgba(91, 141, 238, 0.03);
}

.sidebar-logo .logo-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.sidebar-logo:hover .logo-icon {
  transform: scale(1.05);
}

.sidebar-logo .logo-icon svg,
.sidebar-logo .logo-icon img {
  width: 100%;
  height: 100%;
}

.sidebar-logo .logo-text {
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sidebar-logo .logo-sub {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.sidebar-section {
  padding: 1.75rem 1rem 0.5rem 1.5rem;
  position: relative;
}

.sidebar-section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.8rem;
  padding-left: 0.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(91, 141, 238, 0.2), transparent);
  margin-left: 8px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 1.25rem;
  margin: 3px 10px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 17px;
  font-weight: 500;
  border-radius: 12px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  overflow: hidden;
}

/* Glow indicator on left */
.sidebar nav a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: linear-gradient(180deg, var(--accent), rgba(91, 141, 238, 0.5));
  border-radius: 0 2px 2px 0;
  transition: height 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Shine effect */
.sidebar nav a::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
  transition: left 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.sidebar nav a:hover::after {
  left: 100%;
}

.sidebar nav a .nav-icon {
  font-size: 19px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  z-index: 1;
}

.sidebar nav a:hover {
  background: rgba(91, 141, 238, 0.08);
  color: var(--text);
  transform: translateX(4px);
}

.sidebar nav a:hover::before {
  height: 60%;
}

.sidebar nav a:hover .nav-icon {
  transform: scale(1.15);
}

/* Premium active state */
.sidebar nav a.active {
  background: linear-gradient(135deg, rgba(91, 141, 238, 0.12), rgba(91, 141, 238, 0.04));
  color: var(--text);
  font-weight: 600;
  border: 1px solid rgba(91, 141, 238, 0.25);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Animated indicator bar */
.sidebar nav a.active::before {
  height: 65%;
  background: linear-gradient(180deg, var(--accent), rgba(91, 141, 238, 0.6));
  box-shadow: none;
  animation: activeIndicator 2s ease-in-out infinite;
}

/* Sidebar submenu */
.sidebar-submenu {
  margin-left: 1rem;
  padding-left: 0.5rem;
  border-left: 1px solid rgba(91, 141, 238, 0.2);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
  opacity: 0;
}

.sidebar-submenu.expanded {
  max-height: 1000px;
  opacity: 1;
}

.sidebar-submenu a {
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  opacity: 0.75;
}

.sidebar-submenu a:hover {
  opacity: 1;
}

.sidebar-submenu a .nav-icon {
  font-size: 14px;
  width: 18px;
}

/* Sidebar item with toggle chevron */
.sidebar-item-with-toggle {
  display: flex;
  align-items: center;
}

.sidebar-item-with-toggle > a {
  flex: 1;
}

.sidebar-chevron {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  margin-right: 0.25rem;
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s;
}

.sidebar-chevron:hover {
  opacity: 1;
}

.sidebar-chevron.expanded {
  transform: rotate(180deg);
}

.sidebar-chevron i {
  font-size: 12px;
}

@keyframes activeIndicator {
  0%, 100% {
    opacity: 0.7;
    height: 65%;
  }
  50% {
    opacity: 1;
    height: 75%;
  }
}

/* Icon container background for active */
.sidebar nav a.active .nav-icon {
  background: rgba(91, 141, 238, 0.1);
  border-radius: 6px;
  padding: 2px;
}

/* Premium icon colors */
.sidebar nav a .nav-icon.fa-house { color: var(--icon-home); }
.sidebar nav a .nav-icon.fa-rocket { color: var(--icon-rocket); }
.sidebar nav a .nav-icon.fa-gear { color: var(--icon-config); }
.sidebar nav a .nav-icon.fa-id-card { color: var(--icon-id); }
.sidebar nav a .nav-icon.fa-lock { color: var(--icon-lock); }
.sidebar nav a .nav-icon.fa-message { color: var(--icon-msg); }
.sidebar nav a .nav-icon.fa-users { color: var(--icon-group); }
.sidebar nav a .nav-icon.fa-tower-broadcast { color: var(--icon-stream); }
.sidebar nav a .nav-icon.fa-list { color: var(--icon-list); }

/* ————————————————————————
   Main content
   ———————————————————————— */

.main {
  flex: 1;
  max-width: 860px;
  padding: 2.5rem 3rem 5rem;
}

/* â”€â”€ Top bar â”€â”€ */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2.5rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}

.breadcrumb { font-size: 13px; color: var(--text-muted); }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb span { margin: 0 6px; color: var(--text-dim); }

/* â”€â”€ Page header â”€â”€ */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.page-header .lead { font-size: 16px; color: var(--text-muted); margin-top: 0.6rem; max-width: 640px; line-height: 1.6; }

/* â”€â”€ Badges â”€â”€ */
.badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 4px;
  text-transform: uppercase;
}
.badge-blue   { background: rgba(91,141,238,.18); color: var(--accent); }
.badge-green  { background: rgba(62,207,142,.15); color: var(--green); }
.badge-orange { background: rgba(240,160,75,.15);  color: var(--orange); }
.badge-red    { background: rgba(224,92,110,.15);  color: var(--red); }
.badge-purple { background: rgba(124,106,255,.15); color: var(--accent2); }

/* â”€â”€ Sections & headings â”€â”€ */
.section { margin-bottom: 3rem; }
.section h2 {
  font-size: 1.3rem; font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.section h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin: 1.4rem 0 .6rem; }
.section p  { color: var(--text-muted); margin-bottom: .8rem; }
.section a, .callout a { color: var(--accent); text-decoration: none; }
.section a:hover, .callout a:hover { text-decoration: underline; }

/* -- Premium Cards -- */
.cards { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); 
  gap: 20px; 
  margin: 1.5rem 0; 
}

.card {
  position: relative;
  background: linear-gradient(145deg, rgba(34, 38, 47, 0.9), rgba(26, 29, 35, 0.95));
  border: 1px solid rgba(91, 141, 238, 0.1);
  border-radius: 16px;
  padding: 1.5rem 1.4rem;
  text-decoration: none;
  overflow: hidden;
  opacity: 0;
  transform: perspective(800px) rotateX(3deg) translateY(20px);
  transition:
    opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1),
    transform 0.6s cubic-bezier(0.23, 1, 0.32, 1),
    border-color 0.3s cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.card.revealed {
  opacity: 1;
  transform: perspective(800px) rotateX(0) translateY(0);
}

/* Card glow effect on hover */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at top, rgba(91, 141, 238, 0.08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
}

.card:hover {
  border-color: rgba(91, 141, 238, 0.4);
  transform: translateY(-6px) scale(1.02);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 60px rgba(91, 141, 238, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card:hover::before {
  opacity: 1;
}

/* Card icon container with gradient background */
.card .card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: rgba(91, 141, 238, 0.1);
  transition:
    background 0.3s cubic-bezier(0.23, 1, 0.32, 1),
    transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  color: #5b8dee;
}

.card:hover .card-icon {
  transform: scale(1.1);
}

/* API Reference card icon colors */
.card .card-icon .fa-link::before { color: #5b8dee; }
.card .card-icon .fa-fingerprint::before { color: #7c6aff; }
.card .card-icon .fa-key::before { color: #3ecf8e; }
.card .card-icon .fa-shield-halved::before { color: #3ecf8e; }
.card .card-icon .fa-layer-group::before { color: #22d3ee; }
.card .card-icon .fa-comment::before { color: #5b8dee; }
.card .card-icon .fa-comments::before { color: #22d3ee; }
.card .card-icon .fa-user-plus::before { color: #f0a04b; }
.card .card-icon .fa-user-tag::before { color: #7c6aff; }
.card .card-icon .fa-eye::before { color: #22d3ee; }
.card .card-icon .fa-image::before { color: #3ecf8e; }
.card .card-icon .fa-server::before { color: #5b8dee; }
.card .card-icon .fa-bell::before { color: #f0a04b; }

/* API Reference card icon backgrounds */
.card:has(.fa-link) .card-icon { background: rgba(91, 141, 238, 0.12); }
.card:has(.fa-fingerprint) .card-icon { background: rgba(124, 106, 255, 0.12); }
.card:has(.fa-key) .card-icon { background: rgba(62, 207, 142, 0.12); }
.card:has(.fa-shield-halved) .card-icon { background: rgba(62, 207, 142, 0.12); }
.card:has(.fa-layer-group) .card-icon { background: rgba(34, 211, 238, 0.12); }
.card:has(.fa-comment) .card-icon { background: rgba(91, 141, 238, 0.12); }
.card:has(.fa-comments) .card-icon { background: rgba(34, 211, 238, 0.12); }
.card:has(.fa-user-plus) .card-icon { background: rgba(240, 160, 75, 0.12); }
.card:has(.fa-user-tag) .card-icon { background: rgba(124, 106, 255, 0.12); }
.card:has(.fa-eye) .card-icon { background: rgba(34, 211, 238, 0.12); }
.card:has(.fa-image) .card-icon { background: rgba(62, 207, 142, 0.12); }
.card:has(.fa-server) .card-icon { background: rgba(91, 141, 238, 0.12); }
.card:has(.fa-bell) .card-icon { background: rgba(240, 160, 75, 0.12); }

.card .card-title { 
  font-size: 15px; 
  font-weight: 700; 
  color: var(--text);
  margin-bottom: 6px;
}

.card .card-desc { 
  font-size: 13px; 
  color: var(--text-muted); 
  line-height: 1.6; 
}

/* Card shine effect */
.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.03),
    transparent
  );
  transition: left 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
}

.card:hover::after {
  left: 100%;
}

/* â”€â”€ API method blocks â”€â”€ */
.method-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 1rem 0;
  overflow: hidden;
}

.method-header {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
}

.method-sig {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
  flex: 1;
}
.method-sig .ret   { color: var(--accent); }
.method-sig .name  { color: var(--green); font-weight: 700; }
.method-sig .param { color: var(--orange); }
.method-sig .type  { color: var(--accent2); }

/* Aliases used by standalone API pages */
.method-header .method-name { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--green); flex: 1; }
.method-header .method-return { font-family: var(--mono); font-size: 12px; color: var(--accent2); background: rgba(124,106,255,.12); border: 1px solid rgba(124,106,255,.25); border-radius: 5px; padding: 2px 8px; white-space: nowrap; }

.method-body { padding: 1rem 1.2rem; }
.method-desc { color: var(--text-muted); font-size: 13.5px; margin-bottom: 0.8rem; }

.param-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 0.4rem; }
.param-table th {
  text-align: left; padding: 6px 10px;
  background: var(--code-bg); color: var(--text-dim);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.param-table td { padding: 7px 10px; border-top: 1px solid var(--border); color: var(--text-muted); vertical-align: top; }
.param-table td:first-child { font-family: var(--mono); color: var(--orange); font-size: 12px; white-space: nowrap; }
.param-table td:nth-child(2) { font-family: var(--mono); color: var(--accent2); font-size: 12px; white-space: nowrap; }

/* â”€â”€ Property table â”€â”€ */
.prop-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0.6rem 0 1.2rem; }
.prop-table th {
  text-align: left; padding: 8px 12px;
  background: var(--code-bg); color: var(--text-dim);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}
.prop-table td { padding: 9px 12px; border-top: 1px solid var(--border); color: var(--text-muted); vertical-align: top; }
.prop-table td.pname { font-family: var(--mono); color: var(--green); font-size: 12.5px; white-space: nowrap; }
.prop-table td.ptype { font-family: var(--mono); color: var(--accent2); font-size: 12px; white-space: nowrap; }

/* â”€â”€ Code block â”€â”€ */
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  margin: 0.8rem 0 1.2rem;
}
code { font-family: var(--mono); font-size: 12.5px; }
p code, li code {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--accent2);
}

.kw   { color: #c792ea; }
.cm   { color: #546e7a; font-style: italic; }
.str  { color: #c3e88d; }
.num  { color: #f78c6c; }
.cls  { color: #ffcb6b; }
.met  { color: #82aaff; }
.prop-c { color: var(--orange); }

/* â”€â”€ Callout â”€â”€ */
.callout {
  display: flex; gap: 12px;
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin: 1rem 0;
  border-left: 3px solid;
  font-size: 13.5px;
}
.callout-icon { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.callout-body { color: var(--text-muted); }
.callout-body strong { color: var(--text); }
.callout.info   { background: rgba(91,141,238,.08); border-color: var(--accent); }
.callout.warn   { background: rgba(240,160,75,.08);  border-color: var(--orange); }
.callout.danger { background: rgba(224,92,110,.08);  border-color: var(--red); }
.callout.tip    { background: rgba(62,207,142,.08);  border-color: var(--green); }

/* â”€â”€ Enum table â”€â”€ */
.enum-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0.6rem 0 1rem; }
.enum-table th {
  text-align: left; padding: 8px 12px;
  background: var(--code-bg); color: var(--text-dim);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.enum-table td { padding: 8px 12px; border-top: 1px solid var(--border); vertical-align: top; }
.enum-table td:first-child  { font-family: var(--mono); color: var(--green); font-size: 12.5px; white-space: nowrap; }
.enum-table td:nth-child(2) { font-family: var(--mono); color: var(--accent2); font-size: 12px; width: 50px; }
.enum-table td:nth-child(3) { color: var(--text-muted); }

/* â”€â”€ Events list â”€â”€ */
.event-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem 1.1rem;
  margin: 0.5rem 0;
  display: flex; gap: 12px; align-items: flex-start;
}
.event-name { font-family: var(--mono); font-size: 13px; color: var(--accent); font-weight: 700; white-space: nowrap; margin-right: 4px; }
.event-type { font-family: var(--mono); font-size: 12px; color: var(--accent2); margin-right: 8px; }
.event-desc { font-size: 13px; color: var(--text-muted); }

/* â”€â”€ Footer nav â”€â”€ */
.page-nav {
  display: flex; justify-content: space-between;
  margin-top: 4rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.page-nav a {
  display: flex; flex-direction: column; gap: 4px;
  text-decoration: none; color: var(--text-muted);
  font-size: 13px; max-width: 200px;
}
.page-nav a:hover { color: var(--accent); }
.page-nav a .nav-dir { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); }
.page-nav a .nav-title { font-weight: 600; color: var(--text); }
.page-nav a.next { align-items: flex-end; }

/* â”€â”€ Scrollbar â”€â”€ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ============================================
   PROFESSIONAL SCROLL-TRIGGERED ANIMATIONS
   Intersection Observer based - fires once when visible
   Ease-out-quint for smooth premium feel
   ============================================ */

/* All animatable elements start hidden */
.section,
.method-block,
pre,
.callout,
.flow-step,
.arch-box,
.encrypt-note,
.page-header {
  opacity: 0;
  transform: translateY(25px);
  transition:
    opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1),
    transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Revealed state */
.section.revealed,
.method-block.revealed,
pre.revealed,
.callout.revealed,
.flow-step.revealed,
.arch-box.revealed,
.encrypt-note.revealed,
.page-header.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .section,
  .card,
  .type-card,
  .method-block,
  pre,
  .callout,
  .flow-step,
  .arch-box,
  .encrypt-note,
  .page-header {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Page navigation slide */
.page-nav a {
  transition: 
    color 0.2s cubic-bezier(0.23, 1, 0.32, 1),
    transform 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}

.page-nav a:hover {
  transform: translateX(4px);
}

.page-nav a.next:hover {
  transform: translateX(-4px);
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Focus states with animation */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  transition: outline 0.15s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Loading shimmer effect for dynamic content */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.loading-skeleton {
  background: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--surface2) 50%,
    var(--surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

/* ============================================
   PREMIUM INFOGRAPHICS
   SVG-based animated diagrams
   ============================================ */

.infographic {
  background: linear-gradient(180deg, rgba(34, 38, 47, 0.6) 0%, rgba(22, 25, 32, 0.8) 100%);
  border: 1px solid rgba(91, 141, 238, 0.15);
  border-radius: 16px;
  padding: 2rem;
  margin: 1.5rem 0;
  position: relative;
  overflow: hidden;
}

.infographic::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91, 141, 238, 0.3), transparent);
}

.infographic-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.infographic-title::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 2px;
}

/* ============================================
   PREMIUM FLOW DIAGRAMS
   Centered arrows with advanced animations
   ============================================ */

.flow-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.flow-node {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: linear-gradient(145deg, rgba(34, 38, 47, 0.95), rgba(26, 29, 35, 0.98));
  border: 1px solid rgba(91, 141, 238, 0.2);
  border-radius: 14px;
  min-width: 300px;
  position: relative;
  z-index: 1;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Glow ring on hover */
.flow-node::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(91, 141, 238, 0.3), transparent, rgba(91, 141, 238, 0.3));
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: -1;
}

.flow-node:hover {
  border-color: rgba(91, 141, 238, 0.5);
  transform: translateY(-4px) scale(1.03);
  box-shadow: 
    0 12px 35px rgba(0, 0, 0, 0.4),
    0 0 50px rgba(91, 141, 238, 0.15);
}

.flow-node:hover::before {
  opacity: 1;
}

/* Pulse animation on node */
.flow-node::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: radial-gradient(ellipse at center, rgba(91, 141, 238, 0.1), transparent 70%);
  opacity: 0;
  animation: nodePulse 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes nodePulse {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.5; }
}

.flow-node-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(91, 141, 238, 0.2), rgba(91, 141, 238, 0.1));
  border-radius: 10px;
  font-size: 18px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.flow-node:hover .flow-node-icon {
  transform: scale(1.1) rotate(5deg);
  background: linear-gradient(135deg, rgba(91, 141, 238, 0.3), rgba(91, 141, 238, 0.15));
}

.flow-node-icon i {
  color: var(--accent);
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.flow-node:hover .flow-node-icon i {
  transform: scale(1.1);
}

.flow-node-content {
  flex: 1;
}

.flow-node-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.flow-node-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Connector between steps - centered */
.flow-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  position: relative;
  z-index: 10;
}

.flow-arrow {
  width: 2px;
  height: 24px;
  background: linear-gradient(180deg, rgba(91, 141, 238, 0.5), var(--accent));
  position: relative;
}

.flow-arrow::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
}

.flow-arrow::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--accent);
  filter: drop-shadow(0 0 3px var(--accent));
}

/* Step number badge */
.flow-step .flow-node::before {
  counter-increment: step;
}

.flow-step-number {
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--accent), rgba(91, 141, 238, 0.7));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  box-shadow: 0 2px 10px rgba(91, 141, 238, 0.4);
}

/* ============================================
   PREMIUM ARCHITECTURE DIAGRAMS
   Advanced animations and hover effects
   ============================================ */

.arch-diagram {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: center;
}

.arch-layer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.arch-box {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(145deg, rgba(34, 38, 47, 0.95), rgba(26, 29, 35, 0.98));
  border: 1px solid rgba(91, 141, 238, 0.15);
  border-radius: 14px;
  text-align: center;
  position: relative;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

/* Shine effect */
.arch-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.03),
    transparent
  );
  transition: left 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.arch-box:hover::before {
  left: 100%;
}

/* Glow ring */
.arch-box::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(91, 141, 238, 0.4), transparent, rgba(91, 141, 238, 0.4));
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: -1;
}

.arch-box:hover {
  border-color: rgba(91, 141, 238, 0.5);
  transform: translateY(-6px) scale(1.03);
  box-shadow: 
    0 15px 40px rgba(0, 0, 0, 0.4),
    0 0 60px rgba(91, 141, 238, 0.2);
}

.arch-box:hover::after {
  opacity: 1;
}

.arch-box-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.arch-box-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.arch-box.highlight {
  background: linear-gradient(145deg, rgba(91, 141, 238, 0.18), rgba(91, 141, 238, 0.08));
  border-color: rgba(91, 141, 238, 0.35);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.2),
    0 0 30px rgba(91, 141, 238, 0.1);
}

.arch-box.highlight .arch-box-title {
  color: var(--accent);
}

/* Services grid inside arch-box */
.arch-services {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.arch-service {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(91, 141, 238, 0.1);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.arch-service i {
  font-size: 12px;
  color: var(--accent);
}

.arch-service:hover {
  background: rgba(91, 141, 238, 0.2);
  transform: translateY(-2px);
}

.arch-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.arch-arrow {
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, rgba(91, 141, 238, 0.2), var(--accent), rgba(91, 141, 238, 0.2));
  position: relative;
  animation: arrowPulse 2s ease-in-out infinite;
}

@keyframes arrowPulse {
  0%, 100% { 
    opacity: 0.5;
    transform: scaleX(0.9);
  }
  50% { 
    opacity: 1;
    transform: scaleX(1.1);
  }
}

/* Arrow head */
.arch-arrow::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 8px solid var(--accent);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  filter: drop-shadow(0 0 4px var(--accent));
}

.arch-arrow.vertical {
  width: 2px;
  height: 35px;
  background: linear-gradient(180deg, rgba(91, 141, 238, 0.2), var(--accent), rgba(91, 141, 238, 0.2));
  animation: arrowPulseVertical 2s ease-in-out infinite;
}

@keyframes arrowPulseVertical {
  0%, 100% { 
    opacity: 0.5;
    transform: scaleY(0.9);
  }
  50% { 
    opacity: 1;
    transform: scaleY(1.1);
  }
}

.arch-arrow.vertical::after {
  right: 50%;
  top: auto;
  bottom: -6px;
  transform: translateX(50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--accent);
  filter: drop-shadow(0 2px 4px var(--accent));
}

.arch-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  background: rgba(91, 141, 238, 0.12);
  border-radius: 6px;
  border: 1px solid rgba(91, 141, 238, 0.2);
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.arch-label:hover {
  background: rgba(91, 141, 238, 0.18);
  border-color: rgba(91, 141, 238, 0.4);
}

/* Service boxes inside SDK layer */
.arch-services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.arch-service {
  padding: 8px 12px;
  background: rgba(91, 141, 238, 0.08);
  border-radius: 6px;
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.arch-service i {
  font-size: 12px;
  color: var(--accent);
}

/* ============================================
   ENCRYPTION DIAGRAM STYLES
   Dual-column comparison layout
   ============================================ */

.encrypt-column {
  display: flex;
  flex-direction: column;
}

.encrypt-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.encrypt-header i {
  font-size: 18px;
}

.encrypt-header:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.encrypt-note {
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ── Message Type Cards (same glassmorphism as .card) ───────── */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin: 1.5rem 0;
}

.type-card {
  position: relative;
  background: linear-gradient(145deg, rgba(34,38,47,.9), rgba(26,29,35,.95));
  border: 1px solid rgba(91,141,238,.1);
  border-radius: 16px;
  padding: 1.4rem 1.4rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  opacity: 0;
  transform: perspective(800px) rotateX(3deg) translateY(20px);
  transition:
    opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1),
    transform 0.6s cubic-bezier(0.23, 1, 0.32, 1),
    border-color 0.3s cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.type-card .tc-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: rgba(91, 141, 238, 0.1);
  color: #5b8dee;
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.type-card:hover .tc-icon {
  transform: scale(1.1);
}

/* Type card icon colors */
.type-card .tc-icon .fa-font { color: #5b8dee; }
.type-card .tc-icon .fa-image { color: #3ecf8e; }
.type-card .tc-icon .fa-microphone { color: #f0a04b; }
.type-card .tc-icon .fa-video { color: #e05c6e; }
.type-card .tc-icon .fa-file { color: #22d3ee; }
.type-card .tc-icon .fa-location-dot { color: #3ecf8e; }
.type-card .tc-icon .fa-face-smile { color: #f0a04b; }
.type-card .tc-icon .fa-film { color: #7c6aff; }
.type-card .tc-icon .fa-images { color: #3ecf8e; }
.type-card .tc-icon .fa-square-poll-vertical { color: #22d3ee; }
.type-card .tc-icon .fa-heart { color: #e05c6e; }
.type-card .tc-icon .fa-pen { color: #5b8dee; }
.type-card .tc-icon .fa-trash { color: #e05c6e; }
.type-card .tc-icon .fa-comments { color: #22d3ee; }
.type-card .tc-icon .fa-share { color: #7c6aff; }
.type-card .tc-icon .fa-thumbtack { color: #f0a04b; }
.type-card .tc-icon .fa-phone { color: #3ecf8e; }
.type-card .tc-icon .fa-phone-slash { color: #e05c6e; }
.type-card .tc-icon .fa-signal { color: #22d3ee; }
.type-card .tc-icon .fa-network-wired { color: #7c6aff; }
.type-card .tc-icon .fa-user-plus { color: #3ecf8e; }
.type-card .tc-icon .fa-user-check { color: #5b8dee; }
.type-card .tc-icon .fa-id-card { color: #7c6aff; }
.type-card .tc-icon .fa-eye { color: #22d3ee; }
.type-card .tc-icon .fa-keyboard { color: #5b8dee; }
.type-card .tc-icon .fa-key { color: #3ecf8e; }
.type-card .tc-icon .fa-shield-halved { color: #3ecf8e; }
.type-card .tc-icon .fa-users { color: #22d3ee; }
.type-card .tc-icon .fa-gear { color: #7c6aff; }
.type-card .tc-icon .fa-check { color: #3ecf8e; }
.type-card .tc-icon .fa-sync { color: #22d3ee; }
.type-card .tc-icon .fa-bell { color: #f0a04b; }

/* Type card icon backgrounds */
.type-card:has(.fa-font) .tc-icon { background: rgba(91, 141, 238, 0.12); }
.type-card:has(.fa-image) .tc-icon { background: rgba(62, 207, 142, 0.12); }
.type-card:has(.fa-microphone) .tc-icon { background: rgba(240, 160, 75, 0.12); }
.type-card:has(.fa-video) .tc-icon { background: rgba(224, 92, 110, 0.12); }
.type-card:has(.fa-file) .tc-icon { background: rgba(34, 211, 238, 0.12); }
.type-card:has(.fa-location-dot) .tc-icon { background: rgba(62, 207, 142, 0.12); }
.type-card:has(.fa-face-smile) .tc-icon { background: rgba(240, 160, 75, 0.12); }
.type-card:has(.fa-film) .tc-icon { background: rgba(124, 106, 255, 0.12); }
.type-card:has(.fa-images) .tc-icon { background: rgba(62, 207, 142, 0.12); }
.type-card:has(.fa-square-poll-vertical) .tc-icon { background: rgba(34, 211, 238, 0.12); }
.type-card:has(.fa-heart) .tc-icon { background: rgba(224, 92, 110, 0.12); }
.type-card:has(.fa-pen) .tc-icon { background: rgba(91, 141, 238, 0.12); }
.type-card:has(.fa-trash) .tc-icon { background: rgba(224, 92, 110, 0.12); }
.type-card:has(.fa-comments) .tc-icon { background: rgba(34, 211, 238, 0.12); }
.type-card:has(.fa-share) .tc-icon { background: rgba(124, 106, 255, 0.12); }
.type-card:has(.fa-thumbtack) .tc-icon { background: rgba(240, 160, 75, 0.12); }
.type-card:has(.fa-phone) .tc-icon { background: rgba(62, 207, 142, 0.12); }
.type-card:has(.fa-phone-slash) .tc-icon { background: rgba(224, 92, 110, 0.12); }
.type-card:has(.fa-signal) .tc-icon { background: rgba(34, 211, 238, 0.12); }
.type-card:has(.fa-network-wired) .tc-icon { background: rgba(124, 106, 255, 0.12); }
.type-card:has(.fa-user-plus) .tc-icon { background: rgba(62, 207, 142, 0.12); }
.type-card:has(.fa-user-check) .tc-icon { background: rgba(91, 141, 238, 0.12); }
.type-card:has(.fa-id-card) .tc-icon { background: rgba(124, 106, 255, 0.12); }
.type-card:has(.fa-eye) .tc-icon { background: rgba(34, 211, 238, 0.12); }
.type-card:has(.fa-keyboard) .tc-icon { background: rgba(91, 141, 238, 0.12); }
.type-card:has(.fa-key) .tc-icon { background: rgba(62, 207, 142, 0.12); }
.type-card:has(.fa-shield-halved) .tc-icon { background: rgba(62, 207, 142, 0.12); }
.type-card:has(.fa-users) .tc-icon { background: rgba(34, 211, 238, 0.12); }
.type-card:has(.fa-gear) .tc-icon { background: rgba(124, 106, 255, 0.12); }
.type-card:has(.fa-check) .tc-icon { background: rgba(62, 207, 142, 0.12); }
.type-card:has(.fa-sync) .tc-icon { background: rgba(34, 211, 238, 0.12); }
.type-card:has(.fa-bell) .tc-icon { background: rgba(240, 160, 75, 0.12); }

.type-card.revealed {
  opacity: 1;
  transform: perspective(800px) rotateX(0) translateY(0);
}

/* top glow overlay */
.type-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, rgba(91,141,238,.08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .3s cubic-bezier(.23,1,.32,1);
  pointer-events: none;
}

.type-card:hover {
  border-color: rgba(91,141,238,.4);
  transform: translateY(-6px) scale(1.02);
  box-shadow:
    0 20px 40px rgba(0,0,0,.4),
    0 0 60px rgba(91,141,238,.15),
    inset 0 1px 0 rgba(255,255,255,.05);
}

.type-card:hover::before { opacity: 1; }

/* shine sweep */
.type-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.03), transparent);
  transition: left .5s cubic-bezier(.23,1,.32,1);
  pointer-events: none;
}

.type-card:hover::after { left: 100%; }

.tc-val {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent2);
  background: rgba(124,106,255,.15);
  border: 1px solid rgba(124,106,255,.25);
  border-radius: 5px;
  padding: 1px 7px;
  letter-spacing: .03em;
}

.tc-name {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--cyan);
  line-height: 1.3;
}

.tc-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

.tc-fields {
  font-size: 11.5px;
  color: var(--text-dim);
  border-top: 1px solid rgba(53,58,71,.6);
  padding-top: 8px;
  margin-top: 4px;
  line-height: 1.7;
}

.tc-fields code {
  background: rgba(255,255,255,.05);
  border-radius: 3px;
  padding: 0 4px;
  font-size: 11px;
  color: var(--cyan);
}

/* Enum table (group/system message types) */
.enum-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin-top: 1rem;
}

.enum-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--surface2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}

.enum-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(53,58,71,.6);
  vertical-align: top;
  color: var(--text);
}

.enum-table td:first-child {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
  white-space: nowrap;
}

.enum-table td:nth-child(2) {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent2);
  white-space: nowrap;
}

.enum-table tr:hover td { background: rgba(255,255,255,.025); }

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .main,
  .section,
  .page-header,
  .sidebar-logo,
  .sidebar nav a,
  .sidebar-section-title,
  .method-block,
  pre,
  .callout {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Mobile menu toggle button */
.menu-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: 40px;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 18px;
  transition: all 0.3s ease;
}

.menu-toggle:hover {
  background: var(--surface2);
  border-color: var(--accent);
}

.menu-toggle.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Tablet - 1024px and below */
@media (max-width: 1024px) {
  :root {
    --sidebar-w: 280px;
  }

  .layout-wrapper {
    max-width: 100%;
  }

  .main {
    padding: 2rem 1.5rem;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile landscape - 768px and below */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 150;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* Overlay when sidebar is open */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 140;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .sidebar-overlay.active {
    display: block;
    opacity: 1;
  }

  .main {
    width: 100%;
    padding: 4rem 1.25rem 2rem;
  }

  .page-header {
    padding: 0 0 1.5rem;
  }

  .page-header h1 {
    font-size: 1.75rem;
  }

  .page-header .lead {
    font-size: 0.95rem;
  }

  .section {
    margin-bottom: 2.5rem;
  }

  .section h2 {
    font-size: 1.35rem;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .card {
    padding: 1.25rem;
  }

  .type-card {
    padding: 1.1rem;
  }

  /* Tables scroll horizontally */
  .method-table,
  .param-table,
  .enum-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Infographic adjustments */
  .infographic {
    padding: 1.5rem;
  }

  .arch-services {
    flex-direction: column;
    gap: 8px;
  }

  /* Code blocks */
  pre {
    font-size: 12px;
    padding: 1rem;
    overflow-x: auto;
  }

  code {
    font-size: 12px;
  }

  /* Callouts */
  .callout {
    padding: 1rem;
    flex-direction: column;
    gap: 8px;
  }

  .callout-icon {
    margin-bottom: 4px;
  }

  /* Page nav */
  .page-nav {
    flex-direction: column;
    gap: 12px;
  }

  .page-nav a {
    width: 100%;
  }

  /* Topbar */
  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 14px 1.25rem;
    padding-left: 56px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    height: 48px;
  }

  .topbar .breadcrumb {
    font-size: 13px;
    justify-content: flex-end;
    text-align: right;
  }

  /* Breadcrumb */
  .breadcrumb {
    flex-wrap: wrap;
  }
}

/* Mobile portrait - 480px and below */
@media (max-width: 480px) {
  .main {
    padding: 3.5rem 1rem 1.5rem;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .section h2 {
    font-size: 1.2rem;
  }

  .section h3 {
    font-size: 1.05rem;
  }

  .card-title,
  .tc-name {
    font-size: 0.95rem;
  }

  .card-desc,
  .tc-desc {
    font-size: 0.85rem;
  }

  /* Method blocks */
  .method-block {
    padding: 1rem;
  }

  .method-name {
    font-size: 0.9rem;
  }

  /* Param table */
  .param-table th,
  .param-table td {
    font-size: 12px;
    padding: 8px 10px;
  }

  /* Infographic */
  .infographic {
    padding: 1rem;
  }

  .infographic-title {
    font-size: 0.95rem;
  }

  .arch-box {
    padding: 0.875rem;
  }

  .arch-box-title {
    font-size: 0.85rem;
  }

  .arch-label {
    font-size: 10px;
  }

  /* Two-column layouts */
  .encrypt-column,
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}
