/* ============================================================
   NCS - Nexarats Cheat Sheet: Complete Design System
   Modern, professional, production-ready UI
   ============================================================ */

/* ---------- CSS Custom Properties (Design Tokens) ---------- */
:root {
  --color-primary: #0d9488;
  --color-primary-light: #14b8a6;
  --color-primary-dark: #0f766e;
  --color-accent: #06b6d4;
  --color-accent-light: #22d3ee;

  --color-bg: #f8fafc;
  --color-bg-dark: #0f172a;
  --color-surface: #ffffff;
  --color-surface-dark: #1e293b;
  --color-surface-hover: #f1f5f9;
  --color-surface-hover-dark: #334155;

  --color-border: #e2e8f0;
  --color-border-dark: #334155;
  --color-border-light: #f1f5f9;

  --color-text: #000000;
  --color-text-secondary: #000000;
  --color-text-muted: #000000;

  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;

  --font-sans: Helvetica, Arial, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Source Code Pro', Menlo, Monaco, Consolas, monospace;
  --font-display: 'Arial Black', Helvetica, system-ui, sans-serif;
  --font-body: 'Times New Roman', Times, serif;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.dark {
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-surface-hover: #334155;
  --color-border: #334155;
  --color-border-light: #1e293b;
  --color-text: #f1f5f9;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
}

/* ---------- Base ---------- */
html {
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
  color: var(--color-text);
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

html.dark { color-scheme: dark; }

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Typography ---------- */
h1, h2 { font-family: var(--font-display); font-weight: 900; line-height: 1.1; color: var(--color-text); margin: 0; letter-spacing: normal; }
h3, h4, h5, h6 { font-family: Helvetica, Arial, system-ui, sans-serif; font-weight: 700; line-height: 1.2; color: var(--color-text); margin: 0; letter-spacing: normal; }

h1 { font-size: 36px; }
h2 { font-size: 24px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }
h5 { font-size: 12px; }
h6 { font-size: 12px; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

code, pre, kbd { font-family: var(--font-mono); }

a {
  color: #0000ee;
  text-decoration: underline;
}
a:hover { color: #0000ee; text-decoration: underline; }

/* ---------- Layout ---------- */
.max-container {
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .max-container { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
  .max-container { padding-left: 2rem; padding-right: 2rem; }
}

/* ---------- Section Divider ---------- */
.section-divider {
  height: 1px;
  background: var(--color-border);
  margin: 2rem 0;
  border: 0;
}

/* ---------- Header / Navbar ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

header.home {
  position: relative;
  background: transparent;
  border-bottom: none;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: Helvetica, Arial, system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo:hover { text-decoration: none; color: #0000ee; }

.nav-logo-badge {
  font-family: Helvetica, Arial, system-ui, sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: var(--color-primary);
  color: #fff;
  line-height: 1.4;
}

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

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: Helvetica, Arial, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  gap: 0.375rem;
  white-space: nowrap;
}
.nav-btn:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.nav-btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-btn-icon:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.nav-btn-icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.nav-kbd {
  display: none;
  font-size: 12px;
  padding: 0.125rem 0.375rem;
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  color: var(--color-text);
  font-family: Helvetica, Arial, system-ui, sans-serif;
}

@media (min-width: 768px) {
  .nav-kbd { display: inline-flex; align-items: center; gap: 0.125rem; }
}

/* Hero header (homepage) */
header.home {
  position: relative;
  background: var(--color-primary);
  overflow: hidden;
}

header.home .nav-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}
header.home .nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

header.home .nav-btn-icon {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}
header.home .nav-btn-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

header.home .nav-logo { color: #fff; }
header.home .nav-kbd { border-color: rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.7); }

/* ---------- Hero Section (Homepage) ---------- */
.hero-section {
  padding: 3rem 0 4rem;
  text-align: center;
  position: relative;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.5rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 0%, #5eead4 50%, #22d3ee 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}

.hero-tagline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-description {
  max-width: 600px;
  margin: 0 auto 2rem;
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}
.hero-cta:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
  color: #fff;
  transform: translateY(-1px);
}

@media (min-width: 768px) {
  .hero-title { font-size: 3.75rem; }
  .hero-tagline { font-size: 1.25rem; }
  .hero-description { font-size: 1.25rem; }
}

/* ---------- Cards ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  transition: all 0.2s ease;
}

.card-hover:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.1);
  transform: translateY(-2px);
}

.card-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.card-title {
  font-family: Helvetica, Arial, system-ui, sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Grid: Category Cards ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .cat-grid { grid-template-columns: repeat(4, 1fr); gap: 1rem; }
}

/* ---------- Grid: Recommended Cards ---------- */
.recommend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .recommend-grid { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
}

/* ---------- Section Heading ---------- */
.section-heading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--color-primary);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 24px;
  color: var(--color-text);
}

.section-heading svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-primary);
}

/* ---------- Content Layout (mdLayout) ---------- */
.mdLayout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  color: var(--color-text);
}

/* H2 Section - full card with header */
.mdLayout .h2-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.mdLayout .h2-wrap > h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 24px;
  color: #fff;
  background: var(--color-primary);
  padding: 0.625rem 1.25rem;
  margin: 0;
  text-transform: uppercase;
}

.mdLayout .h2-wrap > h2 a.h-anchor {
  color: rgba(255,255,255,0.5);
  padding-right: 0.5rem;
  font-weight: 400;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.15s;
}
.mdLayout .h2-wrap > h2:hover a.h-anchor { opacity: 1; }

/* H3 Grid (multi-column inside h2 card) */
.mdLayout .h2-wrap > .h3-wrap-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 1024px) {
  .mdLayout .h2-wrap > .h3-wrap-list { grid-template-columns: repeat(3, 1fr); }
}

.mdLayout .h2-wrap.cols-1 > .h3-wrap-list { grid-template-columns: 1fr; }
.mdLayout .h2-wrap.cols-2 > .h3-wrap-list { grid-template-columns: repeat(2, 1fr); }
.mdLayout .h2-wrap.cols-3 > .h3-wrap-list { grid-template-columns: repeat(3, 1fr); }
.mdLayout .h2-wrap.cols-4 > .h3-wrap-list { grid-template-columns: repeat(4, 1fr); }
.mdLayout .h2-wrap.cols-5 > .h3-wrap-list { grid-template-columns: repeat(5, 1fr); }
.mdLayout .h2-wrap.cols-6 > .h3-wrap-list { grid-template-columns: repeat(6, 1fr); }

/* H3 Card - compact sub-section inside h2 */
.mdLayout .h3-wrap {
  border-bottom: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
}

.mdLayout .h3-wrap > .section {
  background: var(--color-bg);
}

.dark .mdLayout .h3-wrap > .section {
  background: transparent;
}

/* Col/row span support for h3 cards */
.mdLayout .h3-wrap.col-span-2 { grid-column: span 2; }
.mdLayout .h3-wrap.col-span-3 { grid-column: span 3; }
.mdLayout .h3-wrap.col-span-4 { grid-column: span 4; }
.mdLayout .h3-wrap.col-span-5 { grid-column: span 5; }
.mdLayout .h3-wrap.col-span-6 { grid-column: span 6; }
.mdLayout .h3-wrap.row-span-2 { grid-row: span 2; }
.mdLayout .h3-wrap.row-span-3 { grid-row: span 3; }
.mdLayout .h3-wrap.row-span-4 { grid-row: span 4; }

/* Remove right border for single col (default) and last column in multi-col grids */
.mdLayout .h2-wrap:not([class*="cols-"]) > .h3-wrap-list > .h3-wrap { border-right: none; }
.mdLayout .h2-wrap > .h3-wrap-list > .h3-wrap:last-child { border-bottom: none; }
.mdLayout .h2-wrap.cols-2 > .h3-wrap-list > .h3-wrap:nth-child(2n) { border-right: none; }
.mdLayout .h2-wrap.cols-3 > .h3-wrap-list > .h3-wrap:nth-child(3n) { border-right: none; }
.mdLayout .h2-wrap.cols-4 > .h3-wrap-list > .h3-wrap:nth-child(4n) { border-right: none; }
.mdLayout .h2-wrap.cols-5 > .h3-wrap-list > .h3-wrap:nth-child(5n) { border-right: none; }
.mdLayout .h2-wrap.cols-6 > .h3-wrap-list > .h3-wrap:nth-child(6n) { border-right: none; }

.mdLayout .h3-wrap > h3 {
  font-family: Helvetica, Arial, system-ui, sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text);
  padding: 0.5rem 1rem;
  margin: 0;
  background: var(--color-surface-hover);
  border-bottom: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
}

.mdLayout .h3-wrap > h3 a.h-anchor {
  color: var(--color-text-muted);
  padding-right: 0.4rem;
  font-weight: 400;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.15s;
}
.mdLayout .h3-wrap > h3:hover a.h-anchor { opacity: 1; }

.mdLayout .h3-wrap.secondary > h3 { color: var(--color-text); border-left-color: #d97706; background: #fffbeb; }
.dark .mdLayout .h3-wrap.secondary > h3 { background: #451a03; border-left-color: #fbbf24; }
.mdLayout .h3-wrap.primary > h3 { color: var(--color-text); border-left-color: #dc2626; background: #fef2f2; }
.dark .mdLayout .h3-wrap.primary > h3 { background: #450a0a; border-left-color: #f87171; }

/* Section content inside h3 card */
.mdLayout .h3-wrap > .section {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.mdLayout .h3-wrap > .section > * {
  margin: 0;
}

.mdLayout .h3-wrap > .section > p {
  padding: 0.5rem 1rem;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
}

.mdLayout .h3-wrap > .section > ul {
  padding: 0;
}

.mdLayout .h3-wrap > .section > h4 {
  background: var(--color-surface-hover);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  margin: 0;
  padding: 0.25rem 1rem;
  text-align: center;
  font-family: Helvetica, Arial, system-ui, sans-serif;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
}

.mdLayout .h3-wrap > .section > pre {
  border-radius: 0;
  margin: 0;
}

.mdLayout .h3-wrap > .section > pre + pre {
  border-top: 1px solid var(--color-border);
}

/* ---------- Tables ---------- */
.mdLayout .h3-wrap > .section > table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
  padding: 0;
  background: #ffffff;
  border: 1px solid var(--color-border);
}

.mdLayout .h3-wrap > .section > table thead { display: none; }
.mdLayout .h3-wrap > .section > table.show-header thead {
  display: table-header-group;
  border-bottom: 1px solid var(--color-border);
}

.mdLayout .h3-wrap > .section > table th {
  font-family: Helvetica, Arial, system-ui, sans-serif;
  font-weight: 700;
  color: #000000;
  text-align: left;
  padding: 0.35rem 0.75rem;
  font-size: 12px;
  text-transform: uppercase;
  background: var(--color-surface-hover);
}

.mdLayout .h3-wrap > .section > table td {
  padding: 0.35rem 0.75rem;
  text-align: left;
  vertical-align: top;
  color: #000000;
}

.mdLayout .h3-wrap > .section > table tr + tr {
  border-top: 1px solid var(--color-border-light);
}

.mdLayout .h3-wrap > .section > table tr th:last-child,
.mdLayout .h3-wrap > .section > table tr td:last-child {
  text-align: right;
}

.mdLayout .h3-wrap > .section > table td:first-child {
  white-space: nowrap;
  font-weight: 500;
}

.mdLayout .h3-wrap > .section > ul {
  margin: 0;
  padding: 0;
  list-style: none;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
}

.mdLayout .h3-wrap > .section > ul > li {
  padding: 0.35rem 0.75rem 0.35rem 1.75rem;
  position: relative;
  border-bottom: 1px solid var(--color-border-light);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  color: #000000;
}

.mdLayout .h3-wrap > .section > ul > li:last-child {
  border-bottom: none;
}

.mdLayout .h3-wrap > .section > ul:not(.marker-none):not(.collapsible):not(.marker-timeline):not(.icon-list) > li::before {
  content: '';
  position: absolute;
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--color-primary);
  border-radius: 50%;
  left: 0.75rem;
  top: 0.65rem;
  opacity: 0.5;
}

.mdLayout .h3-wrap > .section > h4 {
  background: var(--color-surface-hover);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  color: #000000;
  margin: 0;
  padding: 0.25rem 1rem;
  text-align: center;
  font-family: Helvetica, Arial, system-ui, sans-serif;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .mdLayout .h3-wrap > .section > table td:first-child { white-space: normal; }
}

.mdLayout .h3-wrap > .section > table td:first-child > code {
  color: var(--color-text);
  font-size: 12px;
}

.mdLayout .h3-wrap > .section > table a {
  color: #0000ee;
}
.mdLayout .h3-wrap > .section > table a:hover {
  text-decoration: underline;
}

.mdLayout .h3-wrap > .section > table tr:first-child td {
  border-top: none;
}

.mdLayout .h3-wrap > .section > table + table {
  border-top: 1px solid var(--color-border);
}

/* Table variants */
.mdLayout table.left-text tr th,
.mdLayout table.left-text tr td,
.mdLayout table.left-text tr td:last-child {
  text-align: left;
}

.mdLayout table.center-text tr th,
.mdLayout table.center-text tr td,
.mdLayout table.center-text tr td:last-child {
  text-align: center;
}

.mdLayout table.bold-first tr > td:first-child {
  font-weight: 700;
}

.mdLayout table.no-wrap td,
.mdLayout table.no-wrap th {
  white-space: nowrap;
}

.mdLayout table.style-list td,
.mdLayout table.style-list-arrow td {
  display: block;
  text-align: left !important;
}

.mdLayout table kbd {
  padding: 0.1em 0.5em;
  border: 1px solid var(--color-border);
  line-height: 1.4;
  font-size: 12px;
  display: inline-block;
  background: var(--color-surface-hover);
  border-radius: 0.25rem;
  color: var(--color-text);
  font-family: var(--font-sans);
}

/* ---------- Lists ---------- */
.mdLayout .h3-wrap > .section ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mdLayout .h3-wrap > .section ul > li {
  padding: 0.35rem 0.75rem 0.35rem 1.75rem;
  position: relative;
  border-bottom: 1px solid var(--color-border-light);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
}

.mdLayout .h3-wrap > .section ul > li:last-child {
  border-bottom: none;
}

.mdLayout .h3-wrap > .section ul > li > p {
  margin: 0;
  padding: 0;
}

.mdLayout .h3-wrap > .section ul:not(.marker-none):not(.collapsible):not(.marker-timeline):not(.icon-list) > li::before {
  content: '';
  position: absolute;
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--color-primary);
  border-radius: 50%;
  left: 0.75rem;
  top: 0.65rem;
  opacity: 0.5;
}

/* Timeline list */
.mdLayout .h3-wrap > .section > ul.marker-timeline {
  counter-reset: stepCount;
  margin-top: 1rem;
}

.mdLayout .h3-wrap > .section > ul.marker-timeline > li {
  padding: 0.25rem 0 1rem 1.5rem;
  border-left: 2px solid var(--color-primary);
  position: relative;
  margin-left: 1.5rem;
  border-bottom: none;
}

.mdLayout .h3-wrap > .section > ul.marker-timeline > li:last-child {
  border-image: linear-gradient(to bottom, var(--color-primary), transparent) 1 100%;
}

.mdLayout .h3-wrap > .section > ul.marker-timeline > li::before {
  counter-increment: stepCount;
  content: counter(stepCount);
  position: absolute;
  left: -0.75rem;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  color: var(--color-text);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mdLayout .h3-wrap > .section > ul.marker-timeline > li:first-child::before {
  background: var(--color-primary);
  color: #fff;
}

.mdLayout .h3-wrap > .section > ul.icon-list {
  list-style: none;
  padding: 0;
}

.mdLayout .h3-wrap > .section > ul.icon-list > li {
  padding: 0.25rem 0;
  border: none;
}

.mdLayout .h3-wrap > .section > ul.icon-list > li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  color: #0000ee;
}
.mdLayout .h3-wrap > .section > ul.icon-list > li a:hover {
  background: var(--color-surface-hover);
  text-decoration: none;
}

.mdLayout .h3-wrap > .section > ul.icon-list > li a img {
  width: 1.25rem;
  height: 1.25rem;
}

/* Collapsible list */
.mdLayout .h3-wrap > .section > ul.collapsible > li > pre {
  display: none;
}
.mdLayout .h3-wrap > .section > ul.collapsible > li.active > pre {
  display: block;
}
.mdLayout .h3-wrap > .section > ul.collapsible > li > strong {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.mdLayout .h3-wrap > .section > ul.collapsible > li > strong::before {
  content: '▶';
  font-size: 12px;
  color: var(--color-text);
}
.mdLayout .h3-wrap > .section > ul.collapsible > li > strong.arrow-down::before {
  content: '▼';
}

/* ---------- Code Blocks ---------- */
pre {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  background: transparent;
  border-radius: 0;
  padding: 0.75rem 1rem;
  margin: 0;
  line-height: 1.5;
  font-size: 0.82rem;
}

pre:first-child { margin-top: 0; }

pre > code {
  color: #24292e;
  background: transparent;
  padding: 0 !important;
  font-size: inherit;
  line-height: inherit;
}

.dark pre > code {
  color: #e2e8f0;
}

pre > code.wrap {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Override highlight.js base color with higher specificity */
pre code.hljs {
  color: #24292e;
  background: transparent;
}

.dark pre code.hljs {
  color: #e2e8f0;
  background: transparent;
}

/* --- Light mode syntax highlighting (GitHub-inspired) --- */
pre .hljs-keyword, pre .hljs-literal, pre .hljs-name,
pre .hljs-selector-tag, pre .hljs-strong, pre .hljs-tag { color: #cf222e; }

pre .hljs-code { color: #0550ae; }

pre .hljs-attribute, pre .hljs-link, pre .hljs-regexp,
pre .hljs-symbol, pre .hljs-function, pre .hljs-section,
pre .hljs-title.function_ { color: #8250df; }

pre .hljs-addition, pre .hljs-built_in, pre .hljs-bullet,
pre .hljs-string, pre .hljs-subst, pre .hljs-template-tag,
pre .hljs-template-variable, pre .hljs-selector-attr,
pre .hljs-selector-pseudo { color: #0a3069; }

pre .hljs-title, pre .hljs-type, pre .hljs-variable,
pre .hljs-number { color: #953800; }

pre .hljs-class .hljs-title, pre .hljs-title.class_ { color: #953800; }

pre .hljs-comment, pre .hljs-deletion, pre .hljs-meta,
pre .hljs-quote { color: #6e7781; }

pre .hljs-emphasis { font-style: italic; color: #24292e; }
pre .hljs-strong { font-weight: 700; }
pre .hljs-doctag { color: #cf222e; }

/* --- Dark mode syntax highlighting (Monokai-inspired) --- */
.dark pre .hljs-keyword, .dark pre .hljs-literal, .dark pre .hljs-name,
.dark pre .hljs-selector-tag, .dark pre .hljs-strong, .dark pre .hljs-tag { color: #f92672; }

.dark pre .hljs-code { color: #66d9ef; }

.dark pre .hljs-attribute, .dark pre .hljs-link, .dark pre .hljs-regexp,
.dark pre .hljs-symbol { color: #bf79db; }

.dark pre .hljs-addition, .dark pre .hljs-built_in, .dark pre .hljs-bullet,
.dark pre .hljs-emphasis, .dark pre .hljs-section, .dark pre .hljs-selector-attr,
.dark pre .hljs-selector-pseudo, .dark pre .hljs-string, .dark pre .hljs-subst,
.dark pre .hljs-template-tag, .dark pre .hljs-template-variable,
.dark pre .hljs-title, .dark pre .hljs-type, .dark pre .hljs-variable { color: #a6e22e; }

.dark pre .hljs-class .hljs-title, .dark pre .hljs-title.class_ { color: #fff; }

.dark pre .hljs-comment, .dark pre .hljs-deletion, .dark pre .hljs-meta,
.dark pre .hljs-quote { color: #75715e; }

.dark pre .hljs-number { color: #ae81ff; }
.dark pre .hljs-function, .dark pre .hljs-title.function_ { color: #a6e22e; }
.dark pre .hljs-doctag { color: #f92672; }
.dark pre .hljs-emphasis { color: #a6e22e; }

@media (max-width: 768px) {
  pre { font-size: 0.8rem; }
  pre > code { white-space: pre-wrap; word-break: break-word; }
}

code {
  color: var(--color-text);
  font-size: 0.85em;
  padding: 0.125em 0.375em;
  background: rgba(13, 148, 136, 0.1);
  border-radius: 0.25rem;
}

.dark code { color: var(--color-text); background: rgba(45, 212, 191, 0.1); }

/* ---------- Links ---------- */
.mdLayout a {
  color: #0000ee;
  text-decoration: underline;
}
.mdLayout a:hover {
  color: #0000ee;
  text-decoration: underline;
}

.mdLayout .h3-wrap > .section p a {
  color: #0000ee;
  text-decoration: underline;
}
.mdLayout .h3-wrap > .section p a:hover {
  text-decoration: underline;
}

.mdLayout .h3-wrap > .section a code {
  color: inherit;
}

/* ---------- Images ---------- */
.mdLayout .h3-wrap > .section img {
  max-width: 100%;
  height: auto;
  display: block;
  padding: 0.75rem 1rem;
}

/* ---------- Iframe ---------- */
.mdLayout .h3-wrap > .section iframe {
  border: 0;
  width: 100%;
  padding: 0.5rem 1rem;
  box-sizing: border-box;
}

/* ---------- Light/Dark icon toggle ---------- */
.icon-light { display: block; }
.icon-dark { display: none; }
.dark .icon-light { display: none; }
.dark .icon-dark { display: block; }

/* ---------- "boxed" effect for anchor jumps ---------- */
.mdLayout .h2-wrap.boxed {
  box-shadow: 0 0 0 2px var(--color-primary);
  transition: box-shadow 0.3s ease;
}
.mdLayout .h3-wrap.boxed {
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
  transition: outline 0.3s ease;
}
.mdLayout .h3-wrap.primary.boxed { outline-color: var(--color-danger); }
.mdLayout .h3-wrap.secondary.boxed { outline-color: var(--color-warning); }

/* ---------- Footer ---------- */
footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  margin-top: auto;
}

footer a {
  color: #0000ee;
}
footer a:hover {
  color: #0000ee;
  text-decoration: underline;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2.5rem 0;
}

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
}

.footer-heading {
  font-family: Helvetica, Arial, system-ui, sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text);
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.footer-link-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-md);
  transition: background 0.15s;
  text-decoration: none;
  color: var(--color-text);
}
.footer-link-item:hover {
  background: var(--color-surface-hover);
  text-decoration: none;
}

.footer-link-icon {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.footer-link-icon svg {
  width: 1rem;
  height: 1rem;
}

.footer-link-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text);
}
.footer-link-subtitle {
  font-size: 12px;
  color: var(--color-text);
}

.footer-bottom {
  text-align: center;
  padding: 1rem 0;
  border-top: 1px solid var(--color-border);
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--color-text);
}

/* ---------- Search Modal ---------- */
#mysearch {
  z-index: 100;
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  padding-top: 3rem;
  animation: fadeIn 0.15s ease;
}

#mysearch.hidden { display: none; }
#mysearch.block { display: flex; }

#mysearch-box {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  min-height: 320px;
  max-height: 80vh;
  animation: scaleIn 0.15s ease;
}

#mysearch-input {
  flex: 1;
  width: 100%;
  height: 100%;
  background: transparent;
  color: var(--color-text);
  outline: none;
  border: none;
  font-size: 1rem;
  font-family: var(--font-sans);
  padding: 0 1rem;
}

#mysearch-input::placeholder {
  color: var(--color-text);
}

.search-header {
  display: flex;
  align-items: center;
  height: 3rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.search-header form {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
}

.search-btn-clear {
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  border: none;
  background: none;
  color: var(--color-text);
  font-family: Helvetica, Arial, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  border-left: 1px solid var(--color-border);
}
.search-btn-clear:hover { color: #0000ee; }

.search-btn-cancel {
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  border: none;
  background: none;
  color: var(--color-text);
  font-family: Helvetica, Arial, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  border-left: 1px solid var(--color-border);
}
.search-btn-cancel:hover { color: #0000ee; }

.search-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.search-results {
  flex: 1;
  overflow-y: auto;
}

.search-preview {
  display: none;
  overflow-y: auto;
  border-left: 1px solid var(--color-border);
  background: var(--color-bg);
}

@media (min-width: 1024px) {
  .search-preview { display: block; width: 50%; }
}

/* Search result items */
#mysearch-list li {
  border-bottom: 1px solid var(--color-border-light);
  transition: background 0.1s;
}
#mysearch-list li:hover,
#mysearch-list li.active {
  background: var(--color-surface-hover);
}
#mysearch-list li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.875rem;
}
#mysearch-list li a:hover { text-decoration: underline; color: #0000ee; }
#mysearch-list li.active a { color: #0000ee; }

.search-result-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}
.search-result-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.search-result-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 12px;
  color: var(--color-text);
  margin-top: 0.125rem;
}

.search-result-category {
  display: inline-flex;
  padding: 0.0625rem 0.375rem;
  background: var(--color-surface-hover);
  border-radius: 0.25rem;
  font-weight: 700;
  color: var(--color-text);
}

/* Search preview panel */
.preview-panel-section {
  padding: 1rem 1.25rem;
  font-family: var(--font-sans);
}

.preview-panel-header {
  font-family: Helvetica, Arial, system-ui, sans-serif;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border-light);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.preview-panel-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.preview-section-item { list-style: none; margin: 0; padding: 0; }

.preview-section-title {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--color-text);
  padding: 0.25rem 0;
  text-decoration: none;
}
.preview-section-title:hover { color: #0000ee; text-decoration: underline; }

.preview-h3-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.375rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--color-border);
}

.preview-h3-item {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  background: var(--color-surface-hover);
  border-radius: 0.25rem;
  color: var(--color-text);
  font-size: 12px;
  text-decoration: none;
}
.preview-h3-item:hover {
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
}

/* Search highlight */
#mysearch em,
#mysearch mark {
  font-style: normal;
  font-weight: 700;
  color: var(--color-text);
  background: none;
}

/* ---------- TOC (Table of Contents) ---------- */
#toc-container {
  position: fixed;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: none;
}

@media (min-width: 1024px) {
  #toc-container { display: block; }
}

#toc-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  position: relative;
}

#toc-list::before {
  content: '';
  position: absolute;
  top: 0.75rem;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: var(--color-border);
  z-index: 1;
}

#toc-list::after {
  content: '';
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: var(--progress-height, 0%);
  max-height: calc(100% - 1.5rem);
  background: linear-gradient(to bottom, var(--color-primary), var(--color-accent));
  z-index: 2;
  transition: height 0.15s ease;
}

#toc-list a.toc-link {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--color-text-muted);
  background: var(--color-surface);
  z-index: 3;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

#toc-list a.toc-link:hover {
  border-color: var(--color-primary);
  background: var(--color-primary);
  transform: scale(1.3);
}

#toc-list a.toc-link.read {
  border-color: var(--color-primary);
  background: var(--color-primary);
}

#toc-list a.toc-link.active {
  border-color: var(--color-primary);
  background: var(--color-surface);
  transform: scale(1.4);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

/* ---------- About / Archive Page ---------- */
.page-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 1rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 14px;
  text-transform: uppercase;
}

.page-content {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-text);
}

.page-content h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 24px;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.page-content ul {
  padding-left: 1.5rem;
}

.page-content li {
  margin-bottom: 0.5rem;
}

/* ---------- Notes Page ---------- */
.notes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .notes-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .notes-grid { grid-template-columns: repeat(3, 1fr); }
}

.note-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}
.note-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.1);
}

.note-card-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 24px;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}
.note-card-title:hover { color: #0000ee; }

.note-card-intro {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.note-card-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--color-border-light);
}

.note-card-link {
  font-size: 12px;
  font-weight: 700;
  color: #0000ee;
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* ---------- Request CTA ---------- */
.cta-banner {
  background: linear-gradient(135deg, #0f172a 0%, #134e4a 100%);
  border: 1px solid rgba(13, 148, 136, 0.3);
  border-radius: var(--radius-xl);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  text-align: center;
}

@media (min-width: 768px) {
  .cta-banner { flex-direction: row; text-align: left; padding: 2.5rem; }
}

.cta-banner::before {
  content: '';
  position: absolute;
  width: 15rem;
  height: 15rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.1), transparent);
  top: -5rem;
  right: -5rem;
  pointer-events: none;
}

.cta-banner::after {
  content: '';
  position: absolute;
  width: 15rem;
  height: 15rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.1), transparent);
  bottom: -5rem;
  left: -5rem;
  pointer-events: none;
}

.cta-content {
  position: relative;
  z-index: 1;
}

.cta-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 24px;
  color: #fff;
  margin-bottom: 0.5rem;
}

.cta-text {
  font-family: var(--font-body);
  font-size: 14px;
  color: #fff;
  line-height: 1.4;
}

.cta-button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
  text-decoration: none;
  color: #fff;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-spin { animation: spin 1s linear infinite; }

/* ---------- Focus States ---------- */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* ---------- Home page category section ---------- */
.cat-section {
  margin-bottom: 2.5rem;
}

.cat-section:last-child {
  margin-bottom: 0;
}

/* ---------- Empty state for no-icon posts ---------- */
.default-icon-fallback {
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* Code blocks - handled in style.tailwindcss */
/* Keeping minimal overrides for special cases */

.note-content pre {
  padding: 6px 0;
}

.note-content pre code {
  padding: 1rem;
}

.mdLayout .line-highlight {
  transform: translate3d(0, 2px, 0);
  background: linear-gradient(to right, rgba(13, 148, 136, 0.05) 25%, transparent);
}

.mdLayout .line-highlight[data-end] {
  margin-top: 0;
}

.mdLayout .line-highlight::before,
.mdLayout .line-highlight::after {
  display: none;
}

.mdLayout code.hljs {
  background: transparent;
}


a.underline {
  text-decoration: underline;
  color: #0000ee;
}

.dark a.underline {
  color: #0000ee;
}

a.underline:hover {
  color: #0000ee;
}

.dark a.underline:hover {
  color: #0000ee;
}


/* Custom tag styles - expanded from @apply */
yel { color: #d97706; }
red { color: #dc2626; }
pur { color: #7c3aed; }
blu { color: #2563eb; }

.dark yel { color: #fbbf24; }
.dark red { color: #f87171; }
.dark pur { color: #a78bfa; }
.dark blu { color: #60a5fa; }


/* Animation keyframes */
@keyframes openAnimation {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes closeAnimation {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(0.8); opacity: 0; }
}

.openAnimation {
  animation: 200ms cubic-bezier(0, 0, 0.2, 1) 0s 1 normal both running openAnimation;
}

.closeAnimation {
  animation: 200ms cubic-bezier(0.4, 0, 1, 1) 0s 1 normal both running closeAnimation;
}


/* List styles for mdLayout content - core styles in style.tailwindcss */
/* This file provides additional list variants */

.mdLayout .h3-wrap > .section ul.marker-round > li {
  padding-left: 30px;
}

.mdLayout .h3-wrap > .section ul.marker-round > li::before {
  content: '';
  top: 16px;
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  border: 2px solid var(--color-primary, #0d9488);
  background: #fff;
}

.dark .mdLayout .h3-wrap > .section ul.marker-round > li::before {
  background: #1e293b;
}

.mdLayout .h3-wrap > .section > ul.icon-list {
  list-style: none;
  padding: 0;
}

.mdLayout .h3-wrap > .section > ul.icon-list > li {
  padding: 0;
  border: none;
}

.mdLayout .h3-wrap > .section > ul.icon-list > li a {
  display: flex;
  align-items: center;
  border-radius: 0.5rem;
  padding: 0.5rem;
  color: var(--color-text, #1e293b);
  animation: fadeIn 0.5s ease;
  text-decoration: none;
}

.mdLayout .h3-wrap > .section > ul.icon-list > li a:hover {
  background: var(--color-surface-hover, #f1f5f9);
}

.dark .mdLayout .h3-wrap > .section > ul.icon-list > li a:hover {
  background: #334155;
}

.mdLayout .h3-wrap > .section > ul.icon-list > li a img {
  margin-right: 1rem;
  height: 1.5rem;
}


/* Note content styles - legacy, most is handled by mdLayout now */
/* Keeping for backward compatibility with any content using .note-content */

.note-content ul > li {
  padding: 0.625rem 0.625rem;
  position: relative;
}

.note-content ul > li:first-child {
  padding-top: 1.25rem;
}

.note-content {
  color: var(--color-text, #1e293b);
  font-size: 1rem;
  line-height: 1.7;
  min-height: 100%;
  overflow-wrap: break-word;
}

.note-width {
  max-width: 46rem;
}

.note-content ul,
.note-content ol {
  margin: 2px 0 16px;
}

.note-content p {
  margin: 4px 0;
  hyphens: auto;
}

.note-content pre,
.note-content pre > code {
  margin-top: 0.75rem;
  border-radius: 0.5rem;
  background: #f6f6f6;
}

.dark .note-content pre,
.dark .note-content pre > code {
  background: #042f2e;
}

.note-content a {
  color: var(--color-primary, #0d9488);
  text-decoration: none;
}

.note-content a:hover {
  text-decoration: underline;
}

.note-content h2 {
  font-weight: 700;
  font-size: 1.5rem;
  margin: 24px 0 2px;
  color: var(--color-text, #1e293b);
}

.note-content h3 {
  font-weight: 700;
  font-size: 1.25rem;
  margin: 24px 0 2px;
  color: var(--color-text, #1e293b);
}

.note-content img,
.note-content video {
  display: block;
  margin: auto;
  max-width: 100%;
  height: auto;
}

.note-content blockquote {
  border-left: 3px solid var(--color-primary, #0d9488);
  background-color: var(--color-surface-hover, #f8f8f8);
  padding: 15px 20px;
  margin: 1rem 0;
  border-radius: 0 0.5rem 0.5rem 0;
}

.dark .note-content blockquote {
  background-color: rgba(15, 23, 42, 0.3);
}

.note-content blockquote p {
  margin: 0;
}

.note-content .h-anchor {
  display: none;
}

/* Tags style */
.post-tags-list {
  margin-top: 20px;
  margin-bottom: 30px;
  display: table;
}

.post-tags-list-item {
  float: left;
  font-size: 12px;
  margin-right: 10px;
  background: rgba(102, 128, 153, 0.075);
  border-radius: 4px;
  padding: 2px 5px;
  color: rgba(44, 63, 81, 0.5);
}

.post-tags-list-link {
  cursor: default;
}


/* Table styles - core styles in style.tailwindcss */
/* This file provides table utility classes and overrides */

.mdLayout .section > table:last-child::after {
  content: '';
  display: block;
  height: 0.5rem;
}

.mdLayout table td[rowspan] {
  vertical-align: middle;
}

.mdLayout table td[colspan] {
  text-align: center;
}

.mdLayout table td em {
  opacity: 0.6;
}

.dark .mdLayout table td em {
  opacity: 0.9;
}

.mdLayout table.plus-first tr > td:first-child {
  font-size: 1.5rem;
  line-height: 1;
}


body {
  padding-top: 0;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header.home {
  position: relative;
  z-index: 50;
  flex-shrink: 0;
}

section.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 0;
}

footer {
  flex-shrink: 0;
}

#mysearch-trigger:focus,
#darkMode:focus {
  outline: 2px solid #0d9488;
  outline-offset: 2px;
}


.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 16px 0;
}

.pagination .page-number,
.pagination .extend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  font-size: 12px;
  color: #000;
  border: 1px solid #000;
  background: #fff;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 700;
  border-radius: 0;
}

.pagination .page-number:hover,
.pagination .extend:hover {
  background: #000;
  color: #fff;
}

.pagination .page-number.current {
  background: #000;
  color: #fff;
}


#mysearch {
  animation-duration: 200ms;
  animation-name: fade-in;
  animation-fill-mode: both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#mysearch-box {
  animation: 200ms cubic-bezier(0, 0, 0.2, 1) 0s 1 normal both running openAnimation;
}

#mysearch em,
#mysearch mark {
  font-style: normal;
  font-weight: 600;
  color: #0f766e;
  background: none;
}

.dark #mysearch em,
.dark #mysearch mark {
  color: #2dd4bf;
}

#mysearch-list li {
  border-bottom: 1px solid #f1f5f9;
}

.dark #mysearch-list li {
  border-bottom: 1px solid #1e293b;
}

#mysearch-list li a {
  color: #334155;
  text-decoration: none;
  padding: 10px 16px;
  display: block;
  font-size: 14px;
  font-weight: 500;
  transition: all 150ms ease;
}

.dark #mysearch-list li a {
  color: #cbd5e1;
}

#mysearch-list li:hover {
  background: #f8fafc;
}

.dark #mysearch-list li:hover {
  background: #1e293b;
}

#mysearch-list li a:hover,
#mysearch-list li:hover a {
  color: #0f766e;
}

.dark #mysearch-list li a:hover,
.dark #mysearch-list li:hover a {
  color: #2dd4bf;
}

#mysearch-list li.active {
  background: #f8fafc;
}

.dark #mysearch-list li.active {
  background: #1e293b;
}

#mysearch-list li.active a {
  color: #0f766e;
}

.dark #mysearch-list li.active a {
  color: #2dd4bf;
}

#mysearch-list li.inactive {
  background: transparent;
}

.dark #mysearch-list li.inactive {
  background: transparent;
}

.search-preview {
  background: #f8fafc;
  border-left: 1px solid #e2e8f0;
  width: 50%;
  flex: none;
  overflow-y: auto;
}

.dark .search-preview {
  background: rgba(15, 23, 42, 0.4);
  border-left-color: rgba(51, 65, 85, 0.5);
}

.search-preview::-webkit-scrollbar {
  width: 4px;
}
.search-preview::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}


/* Social Buttons Component Styles */

/* Base styles for all social buttons */
.social-buttons {
  /* Ensure proper spacing and alignment */
}

/* Fix icon and text alignment issues */
.social-buttons a {
  /* Ensure perfect vertical alignment */
  align-items: center !important;
  justify-content: center !important;
}

.social-buttons a > div,
.social-buttons a > span {
  /* Remove any default margins that might cause misalignment */
  margin-top: 0 !important;
  margin-bottom: 0 !important;

  /* Ensure consistent line height */
  line-height: 1 !important;

  /* Prevent flex items from growing/shrinking unexpectedly */
  flex-shrink: 0;
}

/* Specific fixes for SVG icons */
.social-buttons svg {
  /* Ensure SVG icons are properly aligned */
  vertical-align: middle;
  display: block;

  /* Override any fixed width/height attributes to match container */
  width: 100% !important;
  height: 100% !important;
}

/* Ensure icon containers have consistent sizing */
.social-buttons .w-4 {
  width: 1rem !important;
  height: 1rem !important;
}

.social-buttons .w-5 {
  width: 1.25rem !important;
  height: 1.25rem !important;
}

/* Force all SVG icons to inherit container dimensions */
.social-buttons .w-4 svg,
.social-buttons .w-5 svg {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
}

/* Hero variant - large buttons for homepage */
.social-buttons.hero {
  /* Already handled by Tailwind classes in component */
}

/* Compact variant - small icons for navbar */
.social-buttons.compact {
  /* Hide on mobile to save space */
  @media (width <= 1023px) {
    display: none !important;
  }
}

/* Inline variant - medium size for detail pages */
.social-buttons.inline {
  /* Responsive adjustments for inline variant */
  @media (width <= 768px) {
    flex-direction: column;
    gap: 0.75rem;
  }

  @media (width <= 640px) {
    /* Stack vertically on small screens */
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
}

/* GitHub stars counter responsive behavior */
[id^='github-stars'] {
  /* Ensure stars counter is readable */
  min-width: 2rem;
  text-align: center;
}

/* Compact variant specific styling for navbar */
#github-stars-compact {
  min-width: 2.5rem;
  font-size: 0.75rem;
  line-height: 1;
  text-align: center;
  font-weight: 500;
}

/* Ensure proper text color for compact variant */
#github-stars-compact {
  color: inherit;
}

/* Home page compact variant */
.home #github-stars-compact {
  color: rgb(255 255 255 / 90%);
}

/* Non-home page compact variant */
body:not(.home) #github-stars-compact {
  color: rgb(71 85 105); /* slate-600 */
}

.dark body:not(.home) #github-stars-compact {
  color: rgb(203 213 225); /* slate-300 */
}

/* Loading animation for stars */
.loading-dots {
  animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
  0%,
  20% {
    opacity: 0.4;
  }

  50% {
    opacity: 1;
  }

  80%,
  100% {
    opacity: 0.4;
  }
}

/* Button hover effects - ensure they work on all variants */
.social-buttons a {
  /* Smooth transitions */
  transition: all 0.2s ease-in-out;
}

/* Responsive text sizing */
@media (width <= 640px) {
  .social-buttons.inline a {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .social-buttons.inline [id^='github-stars'] {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
}

/* Ensure proper spacing between buttons on all screen sizes */
.social-buttons.hero {
  @media (width <= 1024px) {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .social-buttons.inline a {
    /* Ensure good contrast in dark mode */
    border-color: rgb(51 65 85 / 70%);
  }
}

/* Focus states for accessibility */
.social-buttons a:focus {
  outline: 2px solid rgb(59 130 246);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .social-buttons a {
    transition: none;
  }

  .social-buttons a:hover {
    transform: none !important;
  }

  .loading-dots {
    animation: none;
  }
}


#toc-list {
  position: relative;
  padding-left: 10px;
  padding-right: 10px;
}

/* Background timeline track */
#toc-list::before {
  content: '';
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background-color: #e2e8f0; /* slate-200 */
  z-index: 1;
}

.dark #toc-list::before {
  background-color: #334155; /* slate-700 */
}

/* Active progress track */
#toc-list::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: var(--progress-height, 0%);
  max-height: calc(100% - 32px);
  background-image: linear-gradient(to bottom, #0d9488, #06b6d4); /* teal to cyan */
  z-index: 2;
  transition: height 0.15s ease-out;
}

/* Timeline dots */
#toc-list a.toc-link {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2.5px solid #94a3b8; /* slate-400 */
  background-color: #fff;
  z-index: 3;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.dark #toc-list a.toc-link {
  border-color: #475569; /* slate-600 */
  background-color: #0f172a; /* slate-900 */
}

/* Hover state */
#toc-list a.toc-link:hover {
  border-color: #0d9488;
  background-color: #0d9488;
  transform: scale(1.3);
}

.dark #toc-list a.toc-link:hover {
  border-color: #2dd4bf;
  background-color: #2dd4bf;
}

/* Read (visited) state */
#toc-list a.toc-link.read {
  border-color: #0d9488;
  background-color: #0d9488;
}

.dark #toc-list a.toc-link.read {
  border-color: #0f766e;
  background-color: #0f766e;
}

/* Active (current) state */
#toc-list a.toc-link.active {
  border-color: #0d9488;
  background-color: #fff;
  transform: scale(1.4);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.25);
}

.dark #toc-list a.toc-link.active {
  border-color: #2dd4bf;
  background-color: #0f172a;
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.25);
}


pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#272822;color:#ddd}.hljs-keyword,.hljs-literal,.hljs-name,.hljs-selector-tag,.hljs-strong,.hljs-tag{color:#f92672}.hljs-code{color:#66d9ef}.hljs-attribute,.hljs-link,.hljs-regexp,.hljs-symbol{color:#bf79db}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-emphasis,.hljs-section,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-string,.hljs-subst,.hljs-template-tag,.hljs-template-variable,.hljs-title,.hljs-type,.hljs-variable{color:#a6e22e}.hljs-class .hljs-title,.hljs-title.class_{color:#fff}.hljs-comment,.hljs-deletion,.hljs-meta,.hljs-quote{color:#75715e}.hljs-doctag,.hljs-keyword,.hljs-literal,.hljs-section,.hljs-selector-id,.hljs-selector-tag,.hljs-title,.hljs-type{font-weight:700}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-25%); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-bounce { animation: bounce 1s infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.fadeIn { animation: fade-in 0.5s ease-out; }
#mysearch { animation-duration: 200ms; animation-name: fade-in; animation-fill-mode: both; }
