@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=Fira+Code:wght@400;500;600&display=swap');

:root {
  color-scheme: light;
  --bg: #fdfaf6;
  --bg-radial-1: rgba(246, 168, 0, 0.15);
  --bg-radial-2: rgba(24, 167, 161, 0.08);
  --surface: rgba(255, 255, 255, 0.85);
  --surface-solid: #ffffff;
  --surface-soft: #fbf5eb;
  --surface-tinted: #fdf0db;
  --sidebar: rgba(253, 250, 245, 0.85);
  --text: #665d52;
  --text-strong: #3a332b;
  --muted: #7d7468;
  --muted-2: #b4a795;
  --line: rgba(234, 220, 200, 0.5);
  --line-strong: rgba(246, 168, 0, 0.35);
  --accent: #d97706; /* Rich amber-600 */
  --accent-strong: #b45309; /* Rich amber-700 */
  --accent-soft: rgba(245, 158, 11, 0.12); /* amber-500 soft */
  --accent-line: rgba(245, 158, 11, 0.35);
  --success: #166534;
  --warning: #b45309;
  --danger: #991b1b;
  --code-bg: #1c1917; /* Slate-900 / Warm Stone */
  --code-text: #fde68a; /* Soft amber text */
  --code-line: #292524;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar-width: 308px;
  --toc-width: 240px;
  --content-width: 920px;
  --shadow-sm: 0 4px 12px rgba(58, 51, 43, 0.025), 0 1px 2px rgba(58, 51, 43, 0.04);
  --shadow: 0 12px 30px rgba(58, 51, 43, 0.05), 0 4px 8px rgba(58, 51, 43, 0.035);
  --shadow-lg: 0 24px 60px rgba(58, 51, 43, 0.10), 0 8px 16px rgba(58, 51, 43, 0.05);
  --transition-speed: 0.3s;
  --transition-curve: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0d0b; /* Deep obsidian */
  --bg-radial-1: rgba(246, 168, 0, 0.12);
  --bg-radial-2: rgba(24, 167, 161, 0.08);
  --surface: rgba(24, 21, 18, 0.82);
  --surface-solid: #171412;
  --surface-soft: #231f1a;
  --surface-tinted: #2d2312;
  --sidebar: rgba(18, 15, 13, 0.85);
  --text: #dfd5c6;
  --text-strong: #fcf9f2;
  --muted: #94a3b8;
  --muted-2: #7e7362;
  --line: rgba(234, 220, 200, 0.12);
  --line-strong: rgba(246, 168, 0, 0.3);
  --accent: #fbbf24; /* Warm golden-amber */
  --accent-strong: #f59e0b;
  --accent-soft: rgba(246, 168, 0, 0.15);
  --accent-line: rgba(251, 191, 36, 0.35);
  --code-bg: #0b0908;
  --code-text: #fef08a;
  --code-line: rgba(251, 191, 36, 0.18);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 13% -8%, var(--bg-radial-1), transparent 36rem),
    radial-gradient(circle at 92% 2%, var(--bg-radial-2), transparent 30rem),
    linear-gradient(180deg, var(--bg) 0%, var(--bg) 100%);
  color: var(--text);
  font: 16px/1.65 "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: -0.015em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: 
    linear-gradient(rgba(246, 168, 0, 0.05) 1px, transparent 1px), 
    linear-gradient(90deg, rgba(246, 168, 0, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 75%);
}

/* Global Transition for Theme Switching */
aside, main, header, nav, a, button, input, table, th, td, pre, code, .toc, .doc-card, .sidebar {
  transition: 
    background-color var(--transition-speed) var(--transition-curve),
    border-color var(--transition-speed) var(--transition-curve),
    color var(--transition-speed) var(--transition-curve),
    box-shadow var(--transition-speed) var(--transition-curve);
}

a { color: var(--accent); text-decoration: none; text-underline-offset: 4px; transition: color 0.2s ease, text-decoration 0.2s ease; }
a:hover { text-decoration: underline; color: var(--accent-strong); }
::selection { background: rgba(246, 168, 0, 0.25); color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-150%);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--text-strong);
  color: var(--bg);
  font-weight: 800;
  box-shadow: var(--shadow);
}
.skip-link:focus { transform: translateY(0); outline: 3px solid var(--accent); outline-offset: 3px; text-decoration: none; }
.reading-progress { 
  position: fixed; 
  top: 0; 
  left: 0; 
  z-index: 80; 
  height: 3px; 
  width: 0; 
  background: linear-gradient(90deg, var(--accent), #18a7a1); 
  box-shadow: 0 0 12px rgba(246, 168, 0, 0.4); 
}

/* Page fade transitions for Content Area */
@keyframes contentFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes contentFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(4px); }
}

.layout { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 24px 20px;
  background: var(--sidebar);
  backdrop-filter: blur(24px) saturate(170%);
  border-right: 1px solid var(--line);
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }

.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; margin-bottom: 24px; }
.brand:hover { text-decoration: none; }
.brand-mark { 
  display: grid; 
  place-items: center; 
  flex: 0 0 auto; 
  width: 46px; 
  height: 46px; 
  border-radius: 12px; 
  background: var(--accent-soft); 
  color: var(--accent); 
  border: 1px solid var(--accent-line); 
  box-shadow: none; 
  overflow: hidden; 
  padding: 8px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand:hover .brand-mark { transform: scale(1.04) rotate(1deg); }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-title { display: block; font-weight: 800; font-size: 16px; line-height: 1.15; color: var(--text-strong); letter-spacing: -0.03em; }
.brand-subtitle { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); letter-spacing: -0.01em; font-weight: 600; }

.search-wrap { position: relative; display: block; margin: 8px 0 20px; }
.search-wrap::before { content: "⌕"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 18px; pointer-events: none; line-height: 1; }
.search { 
  width: 100%; 
  height: 42px; 
  padding: 0 14px 0 38px; 
  border: 1px solid var(--line); 
  border-radius: 10px; 
  background: var(--surface-solid); 
  color: var(--text-strong); 
  outline: 0; 
  font-size: 14px; 
  font-weight: 500;
  box-shadow: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search::placeholder { color: var(--muted-2); }
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link { 
  display: flex; 
  align-items: center; 
  gap: 12px;
  min-height: 40px; 
  padding: 8px 16px; 
  border-radius: 12px; 
  color: var(--muted); 
  font-size: 14px; 
  font-weight: 700; 
  position: relative;
  transition: transform 0.2s ease, color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  background: transparent;
  border: 1px solid transparent;
}
.nav-link::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
  transition: background-color 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.nav-link:hover { 
  color: var(--text-strong); 
  background: var(--surface-soft); 
  text-decoration: none; 
  transform: translateX(3px);
}
.nav-link:hover::before {
  background: var(--accent);
  transform: scale(1.2);
}
.nav-link.active { 
  color: var(--accent); 
  background: var(--accent-soft); 
  border: 1px solid var(--accent-line);
  border-left: 3px solid var(--accent);
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  box-shadow: none;
}
.nav-link.active::before {
  background: var(--accent);
  transform: scale(1.2);
}
.nav-link[style*="none"] { display: none !important; }

.sidebar-actions { margin-top: 16px; }
.theme-toggle, .menu-btn { 
  display: flex; 
  width: 100%; 
  align-items: center; 
  justify-content: center; 
  gap: 8px; 
  min-height: 40px; 
  padding: 8px 16px; 
  border: 1px solid var(--line); 
  border-radius: 999px; 
  background: var(--surface-solid); 
  color: var(--text-strong); 
  font: inherit; 
  font-size: 13.5px; 
  font-weight: 800; 
  cursor: pointer; 
  box-shadow: none; 
  transition: transform 0.2s, background-color 0.2s, border-color 0.2s;
}
.theme-toggle:hover, .menu-btn:hover { 
  border-color: var(--accent-line); 
  background: var(--accent-soft); 
  transform: translateY(-1px);
}
.theme-toggle:active, .menu-btn:active {
  transform: translateY(0);
}

/* Sidebar built-in footer links style (matches screenshot) */
.sidebar-links-section {
  margin-top: 24px;
}
.sidebar-divider {
  height: 1px;
  background: var(--line);
  margin: 20px 0;
}
.sidebar-links-title {
  font-size: 12.5px;
  font-weight: 900;
  color: var(--text-strong);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}
.sidebar-links-grid {
  display: grid;
  gap: 8px;
}
.sidebar-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--text-strong);
  font-size: 13.5px;
  font-weight: 800;
  transition: all 0.2s ease;
}
.sidebar-link-btn:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-1px);
  text-decoration: none;
}

.topbar { 
  display: none; 
  position: sticky; 
  top: 0; 
  z-index: 50; 
  padding: 12px 18px; 
  background: var(--sidebar); 
  backdrop-filter: blur(24px) saturate(170%); 
  border-bottom: 1px solid var(--line); 
  gap: 12px; 
}
.topbar .brand { margin: 0; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.content { 
  display: grid; 
  grid-template-columns: minmax(0, var(--content-width)) var(--toc-width); 
  justify-content: center; 
  gap: 48px; 
  padding: 56px 48px 80px; 
  animation: contentFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: opacity, transform;
}

body.is-navigating .content {
  pointer-events: none;
  animation: contentFadeOut 0.18s cubic-bezier(0.4, 0, 1, 1) both;
}

.page { min-width: 0; overflow-wrap: break-word; }
.toc { 
  position: sticky; 
  top: 36px; 
  align-self: start; 
  max-height: calc(100vh - 72px); 
  overflow: auto; 
  padding: 16px; 
  border: 1px solid var(--line); 
  border-radius: 20px; 
  background: var(--surface); 
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm); 
}
.toc-title { display: block; margin-bottom: 12px; color: var(--text-strong); font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.toc nav { display: grid; gap: 4px; }
.toc a { display: block; padding: 6px 10px; border-radius: 10px; color: var(--muted); font-size: 13.5px; line-height: 1.4; font-weight: 700; transition: all 0.2s ease; }
.toc a:hover { color: var(--text-strong); background: var(--surface-soft); text-decoration: none; padding-left: 13px; }
.toc a.active { color: var(--accent); background: var(--accent-soft); text-decoration: none; font-weight: 800; }
.toc a.toc-h3 { padding-left: 18px; font-size: 12.5px; font-weight: 600; }
.toc a.toc-h3:hover { padding-left: 21px; }

/* Content Typography & Absolute Header Anchor Positioning */
main h1, main h2, main h3 {
  position: relative;
}
.anchor { 
  position: absolute; 
  right: 100%;
  padding-right: 8px;
  opacity: 0; 
  color: var(--accent); 
  font-weight: 800; 
  transition: opacity 0.2s; 
}
h1:hover .anchor, h2:hover .anchor, h3:hover .anchor { opacity: 1; }

main h1 { font-size: clamp(34px, 4vw, 52px); line-height: 1.15; margin: 0 0 1rem; color: var(--text-strong); letter-spacing: -0.035em; font-weight: 800; }
main h2 { margin: 2rem 0 0.6rem; color: var(--text-strong); font-size: 26px; line-height: 1.25; letter-spacing: -0.025em; font-weight: 800; }
main h3 { margin: 1.5rem 0 0.5rem; color: var(--text-strong); font-size: 20px; letter-spacing: -0.02em; font-weight: 750; }
main p { margin: 0 0 1.25rem; line-height: 1.65; color: var(--text); }
main ul, main ol { margin: 0 0 1.5rem; padding-left: 24px; }
main li { margin: 6px 0; }
p code, li code, td code { padding: 3px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--text-strong); font-size: .90em; font-family: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

/* Image and Media Figures */
.hero-shot { 
  margin: 32px 0 42px; 
  border: 1px solid var(--accent-line); 
  border-radius: 24px; 
  overflow: hidden; 
  background: var(--surface-solid); 
  box-shadow: var(--shadow-lg); 
  transition: transform 0.3s var(--transition-curve), box-shadow 0.3s var(--transition-curve);
}
.hero-shot:hover {
  transform: translateY(-2px);
  box-shadow: 0 30px 70px rgba(246, 168, 0, 0.12), var(--shadow-lg);
}
.hero-shot img { display: block; width: 100%; height: auto; cursor: zoom-in; }

.media-figure { 
  margin: 30px 0 38px; 
  border: 1px solid var(--line); 
  border-radius: 20px; 
  overflow: hidden; 
  background: var(--surface); 
  box-shadow: var(--shadow); 
  transition: border-color 0.3s, box-shadow 0.3s;
}
.media-figure:hover {
  border-color: var(--accent-line);
  box-shadow: 0 20px 45px rgba(246, 168, 0, 0.05), var(--shadow);
}
.media-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.media-kind { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); border: 1px solid var(--accent-line); font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.media-open { color: var(--muted); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.media-open::after { content: "↗"; font-size: 11px; }
.media-open:hover { color: var(--text-strong); text-decoration: none; }
.media-link { display: block; background: #1c1917; cursor: zoom-in; overflow: hidden; }
.media-link:hover { text-decoration: none; }
.media-figure img { display: block; width: 100%; height: auto; transition: transform 0.5s ease; }
.media-link:hover img { transform: scale(1.015); }
.media-figure figcaption { padding: 14px 18px 16px; color: var(--muted); font-size: 14px; line-height: 1.6; border-top: 1px solid var(--line); background: var(--surface-solid); font-weight: 500; }

/* Grid Dashboard Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 28px 0 38px; }
.doc-card { 
  position: relative; 
  display: block; 
  padding: 22px; 
  border: 1px solid var(--line); 
  border-radius: 18px; 
  background: var(--surface); 
  color: var(--text); 
  box-shadow: var(--shadow-sm); 
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease; 
  overflow: hidden; 
}
.doc-card::after { 
  content: "→"; 
  position: absolute; 
  right: 20px; 
  top: 18px; 
  color: var(--accent); 
  font-weight: 900; 
  opacity: 0; 
  transform: translateX(-6px); 
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); 
}
.doc-card:hover { 
  text-decoration: none; 
  transform: translateY(-4px) scale(1.02); 
  border-color: var(--accent-line); 
  background: var(--surface-solid); 
  box-shadow: 0 15px 30px rgba(246, 168, 0, 0.08), var(--shadow); 
}
.doc-card:hover::after { opacity: 1; transform: translateX(0); }
.doc-card strong { display: block; margin-bottom: 8px; padding-right: 20px; color: var(--text-strong); font-size: 16.5px; font-weight: 800; }
.doc-card span { display: block; color: var(--muted); font-size: 14px; line-height: 1.6; }

/* Code Blocks & Tables */
pre { position: relative; overflow: auto; margin: 20px 0 28px; padding: 22px; border: 1px solid var(--code-line); border-radius: 18px; background: var(--code-bg); color: var(--code-text); box-shadow: var(--shadow); }
pre code { font: 13.5px/1.7 "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.copy-code { 
  position: absolute; 
  top: 12px; 
  right: 12px; 
  z-index: 2; 
  padding: 6px 12px; 
  border: 1px solid rgba(251, 191, 36, 0.25); 
  border-radius: 10px; 
  background: rgba(255, 255, 255, 0.06); 
  color: #fef08a; 
  font-size: 12px; 
  font-weight: 800; 
  cursor: pointer; 
  backdrop-filter: blur(8px); 
  transition: all 0.2s; 
}
.copy-code:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(251, 191, 36, 0.5); transform: translateY(-1px); }
.copy-code:active { transform: translateY(0); }

.table-wrap { overflow: auto; margin: 24px 0 34px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-solid); box-shadow: var(--shadow-sm); }
table { width: 100%; min-width: 620px; border-collapse: separate; border-spacing: 0; margin: 0; background: transparent; }
th, td { padding: 15px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--text-strong); background: var(--surface-soft); font-size: 13px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; border-bottom: 2px solid var(--line); }
tr:last-child td { border-bottom: 0; }
tr:hover td { background-color: rgba(246, 168, 0, 0.015); }

/* Footer and Pagination */
.page-footer { margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; color: var(--muted); font-size: 14px; font-weight: 500; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.page-nav { margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.page-nav a { display: block; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); transition: transform 0.2s, border-color 0.2s, background-color 0.2s; }
.page-nav a:hover { text-decoration: none; border-color: var(--accent-line); background: var(--accent-soft); transform: translateY(-2px); }
.page-nav .label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; margin-bottom: 6px; }
.page-nav .title { display: block; color: var(--text-strong); font-weight: 800; font-size: 17px; }
.page-nav .next { text-align: right; }

.nav-link:focus-visible, .button:focus-visible, .social-links a:focus-visible, .media-link:focus-visible, .media-open:focus-visible, .menu-btn:focus-visible, .theme-toggle:focus-visible, .search:focus-visible, .page-nav a:focus-visible, .toc a:focus-visible, .copy-code:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, white); outline-offset: 2px; }

/* ==========================================================================
   Premium Fullscreen Screenshot Viewer Lightbox
   ========================================================================== */
.ar-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(10, 8, 7, 0.85);
  backdrop-filter: blur(20px) saturate(120%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  user-select: none;
}
.ar-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}
.ar-lightbox-viewport {
  position: relative;
  width: 90vw;
  height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
}
.ar-lightbox-img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  transform: scale(0.92);
  opacity: 0;
  transform-origin: center center;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  cursor: grab;
}
.ar-lightbox.active .ar-lightbox-img {
  transform: scale(1);
  opacity: 1;
}
.ar-lightbox-img:active {
  cursor: grabbing;
}
.ar-lightbox-img.zoomed {
  transition: none; /* Disable transition for real-time panning smoothness */
}
.ar-lightbox-controls {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  gap: 10px;
  z-index: 2010;
}
.ar-lightbox-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.ar-lightbox-btn:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(246, 168, 0, 0.5);
}
.ar-lightbox-btn:active {
  transform: scale(0.95);
}
.ar-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2010;
}
.ar-lightbox-prev { left: 24px; }
.ar-lightbox-next { right: 24px; }
.ar-lightbox-nav-btn {
  width: 52px;
  height: 52px;
  font-size: 24px;
}
.ar-lightbox-caption {
  margin-top: 24px;
  color: #f3e8dc;
  font-size: 14.5px;
  font-weight: 600;
  text-align: center;
  max-width: 75%;
  line-height: 1.5;
  background: rgba(28, 25, 23, 0.85);
  padding: 10px 24px;
  border-radius: 999px;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) 0.1s, opacity 0.3s ease 0.1s;
}
.ar-lightbox.active .ar-lightbox-caption {
  transform: translateY(0);
  opacity: 1;
}
.ar-lightbox-zoom-indicator {
  position: absolute;
  bottom: 24px;
  left: 24px;
  background: rgba(0, 0, 0, 0.65);
  color: rgba(255, 255, 255, 0.9);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  pointer-events: none;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.ar-lightbox-zoom-indicator.visible {
  opacity: 1;
}

/* Responsive Queries */
@media (max-width: 1180px) {
  .content { grid-template-columns: minmax(0, var(--content-width)); padding: 40px 32px 64px; }
  .toc { display: none; }
}
@media (max-width: 920px) {
  .layout { display: block; }
  .topbar { display: flex; align-items: center; justify-content: space-between; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(88vw, var(--sidebar-width)); transform: translateX(-105%); transition: transform .25s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 24px 0 55px rgba(0,0,0,0.22); }
  .sidebar.open { transform: translateX(0); }
  body.mobile-open::after { content: ""; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); }
  .content { display: block; padding: 34px 20px 58px; }
  .topbar .brand { min-width: 0; overflow: hidden; }
  .topbar .brand-mark { width: 36px; height: 36px; border-radius: 12px; padding: 6px; }
  .topbar .brand-title { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .brand-subtitle { display: none; }
  .topbar-actions { flex: 0 0 auto; }
  .page-nav { grid-template-columns: 1fr; }
  .page-nav .next { text-align: left; }
  .page-nav .empty { display: none; }
  p code, li code, td code { white-space: normal; }
  .media-head { padding: 10px 14px; }
  .media-open { font-size: 12px; }
  .media-figure { border-radius: 16px; }
  .ar-lightbox-nav-btn { width: 44px; height: 44px; font-size: 20px; }
  .ar-lightbox-prev { left: 12px; }
  .ar-lightbox-next { right: 12px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .topbar { padding: 9px 12px; }
  .theme-toggle .label { display: none; }
  .topbar .theme-toggle { width: 40px; padding: 0; border-radius: 50%; }
  .menu-btn { padding: 8px 12px; }
  main h1 { font-size: 34px; }
  main h2 { font-size: 22px; }
  .hero-shot { border-radius: 18px; }
  .ar-lightbox-controls { top: 12px; right: 12px; }
  .ar-lightbox-caption { font-size: 13px; max-width: 85%; padding: 8px 18px; }
}
@media print {
  .sidebar, .topbar, .page-footer, .page-nav, .toc, .reading-progress, .copy-code, .ar-lightbox { display: none !important; }
  .layout, .content { display: block; padding: 0; }
  .page { width: auto; max-width: none; padding: 0; }
  body { background: white; color: black; }
  a { color: black; text-decoration: underline; }
  pre, .table-wrap, .hero-shot, .media-figure { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .doc-card:hover { transform: none; }
  body.is-navigating .content { animation: none !important; }
}
