/* ============================================================
   COLOR TOKENS
============================================================ */

:root {
  --primary: #2563eb;
  --secondary: #0f172a;
  --muted: #6b7280;
  --error: #dc2626;
  --domain-ai: #8b5cf6;
  --domain-infra: #059669;
  --domain-platform: #db2777;

  --bg-soft: #f8fafc;
  --bg-base: #ffffff;

  --border: #e5e7eb;
  --bg-card: #ffffff;
  --border-card: #e5e7eb;
  --crimson: #ff009c;
  --coral: #f97316;
  --cyan: #06b6d4;
  --purple: #8b5cf6;

  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #78350f;

  --tag-bg: #eef2ff;
  --tag-border: #c7d2fe;
  --tag-text: #4338ca;

  --code-bg: #f4f4f4;
  --code-border: #dddddd;
  --code-inline-bg: #ffeff0;

  --table-stripe: #f2f2f2;

  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 12px 24px rgba(0, 0, 0, 0.1),
                  0 4px 8px rgba(0, 0, 0, 0.06);

  --skeleton-base: #e5e7eb;              /* neutral light gray */
  --skeleton-highlight: rgba(255,255,255,0.6);

  --control-bg: var(--bg-card);
  --control-border: var(--border);
  --control-text: var(--text-primary);
  --control-hover-border: var(--primary);
  --control-focus-ring: var(--primary);
  --highlight-bg: linear-gradient(120deg, #a5f3fc 0%, #c4b5fd 100%);
  --highlight-color: #1e1b4b;
}

/* ---------------- DARK MODE ---------------- */
[data-theme="dark"] {
  --primary: #3b82f6;
  --secondary: #f1f5f9;
  --muted: #9ca3af;
  --error: #ef4444;
  --domain-ai: #a78bfa;
  --domain-infra: #34d399;
  --domain-platform: #f472b6;
  --highlight-bg: linear-gradient(120deg, var(--cyan) 0%, var(--purple) 100%);
  --highlight-color: #ffffff;

  --bg-soft: #0f172a;
  --bg-base: #0b1220;

  --border: #334155;
  --bg-card: #1f2937;
  --border-card: #374151;
  --crimson: #ff009c;
  --coral: #f97316;
  --cyan: #06b6d4;
  --purple: #8b5cf6;

  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-tertiary: #78350f;

  --tag-bg: #312e81;
  --tag-border: #4338ca;
  --tag-text: #a5b4fc;

  --code-bg: #111827;
  --code-border: #374151;
  --code-inline-bg: #1f2937;

  --table-stripe: #111827;

  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 12px 24px rgba(0, 0, 0, 0.4),
                  0 4px 8px rgba(0, 0, 0, 0.3);
  
  --skeleton-base: #2a3441;              /* lighter than bg-card */
  --skeleton-highlight: rgba(255,255,255,0.08);

  --control-bg: var(--bg-card);
  --control-border: var(--border);
  --control-text: var(--text-primary);
}

/* @media (prefers-color-scheme: dark) {
  :root {
    --primary: #3b82f6;
    --secondary: #f1f5f9;
    --muted: #9ca3af;

    --bg-soft: #0f172a;
    --bg-base: #0b1220;

    --border: #334155;
    --bg-card: #1f2937;
    --border-card: #374151;

    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;

    --tag-bg: #312e81;
    --tag-border: #4338ca;
    --tag-text: #a5b4fc;

    --code-bg: #111827;
    --code-border: #374151;
    --code-inline-bg: #1f2937;

    --table-stripe: #111827;

    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 12px 24px rgba(0, 0, 0, 0.4),
                  0 4px 8px rgba(0, 0, 0, 0.3);
  
    --skeleton-base: #2a3441; // lighter than bg-card
    --skeleton-highlight: rgba(255,255,255,0.08);
  }
} */

/* ============================================================
   BASE
============================================================ */

html {
  overflow-x: hidden;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
  background: linear-gradient(to bottom, var(--bg-soft) 0%, var(--bg-base) 40%);
  color: var(--text-primary);
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 60px;
  line-height: 1.65;
}

/* ========================================
   Segmented Theme Control
======================================== */
.theme-controls {
  display: flex;
  justify-content: flex-end;
  margin-top: -36px;
}
/* Wrapper */
.theme-dropdown {
  position: relative;
  display: inline-block;
}

/* Trigger button */
.theme-trigger {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-trigger:hover {
  border-color: var(--primary);
}

/* Floating panel */
.theme-panel {
  position: absolute;
  top: 110%;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  min-width: 140px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 200;
}

.theme-dropdown.open .theme-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.theme-panel button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-panel button:hover {
  background: var(--bg-soft);
  color: var(--text-primary);
}

.theme-panel button.active {
  background: var(--primary);
  color: #fff;
}


/* ============================================================
   LAYOUT
============================================================ */

.page-banner {
  width: 104%;
  margin-left: -3.5%;
}

.page-banner img {
  width: 100%;
}

header {
  /* padding: 8px 0; */
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: clamp(1.3rem, 5vw, 2.2rem);
  /* margin-bottom: 4px; */
  color: var(--secondary);
}

.gradient-name {
  background: linear-gradient(180deg, #0366d6 35%, #eb259c 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

header p {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 0;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}



.info-header {
  max-width: 780px;
}

h2 {
  font-size: 1.5rem;
  margin-top: 48px;
  margin-bottom: 16px;
  color: var(--secondary);
  position: relative;
}

h2::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  height: 26px;
  width: 4px;
  background: var(--primary);
  border-radius: 2px;
}

p,
li {
  font-size: 1rem;
  text-align: justify;
}


/* ============================================================
   LINKS
============================================================ */

a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  outline: none;
}

a:hover {
  text-decoration: underline;
}

a:focus {
  outline: none;
}

a img {
  outline: none;
  border: none;
}

/* ============================================================
   BLOCKQUOTE
============================================================ */

blockquote {
  background: var(--bg-soft);
  border-left: 4px solid var(--primary);
  padding: 8px 16px;
  margin: 28px 0;
  border-radius: 6px;
  color: var(--text-secondary);
  font-style: italic;
}

/* ============================================================
   CARD
============================================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 22px 26px;
  margin: 24px 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

/* ============================================================
   FOOTER
============================================================ */

footer {
  margin-top: 5rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.footer {
  margin-top: 16px;
  text-align: center;
  font-size: 0.9rem;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer .mobile-visible {
  display: none;
}

.footer .mobile-hidden {
  display: inline;
}

/* ============================================================
   CODE BLOCKS
============================================================ */

pre {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-left: 3px solid var(--primary);
  color: var(--text-primary);
  font-family: "JetBrains Mono", Consolas, Monaco, monospace;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 1.6em;
  overflow: auto;
  padding: 1em 1.5em;
  white-space: pre-wrap;
}

.language-text pre {
  white-space: pre;
}

p > code,
li > code,
td > code {
  background: var(--code-inline-bg);
  padding: 0.1rem 0.3rem 0.2rem;
  border-radius: 0.2rem;
  overflow-wrap: break-word;
  word-break: break-all;
}

/* ============================================================
   TABLE
============================================================ */

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  text-align: left;
  padding: 8px;
  border: 1px solid var(--border);
}

tr:nth-child(even) {
  background-color: var(--table-stripe);
}

/* ============================================================
   UTILITIES
============================================================ */

.hidden {
  display: none;
}

@media (max-width: 1024px) {
  .page-banner {
    width: 104%;
    margin-left: -2.5%;
  }
  .page-banner img {
    width: 100vw;
  }
}

@media (max-width: 767px) {
  .footer .mobile-visible {
    display: inline;
  }

  .footer .mobile-hidden {
    display: none;
  }

  .theme-controls {
    margin-top: -40px;
  }

  table {
    overflow-x: auto;
    display: block;
  }

  .page-banner {
    width: 108%;
    margin-left: -4.5%;
  }

  .page-banner img {
    width: 100vw;
  }
}


