/* ============================================================
   dbaexpert.com aligned — DM Sans + Lexend + gold, compact rhythm
   Code blocks follow orapub pattern (kept intentionally).
   ============================================================ */

:root {
  /* light surfaces (default reading theme) */
  --bg-primary:   #F7F6F3;
  --bg-elevated:  #EEEDEA;
  --bg-card:      #FFFFFF;
  --bg-card-hover:#F9F8F5;

  /* ink */
  --text-primary:   #111111;
  --text-secondary: #4A4A4A;
  --text-muted:     #999999;

  /* gold — dbaexpert accent */
  --gold:        #A68517;
  --gold-bright: #C9A227;
  --gold-dim:    #7A6312;
  --gold-glow:   rgba(166,133,23,0.08);
  --gold-border: rgba(166,133,23,0.22);

  /* rules and surfaces */
  --border:       rgba(0,0,0,0.07);
  --border-hover: rgba(166,133,23,0.35);
  --nav-bg:       rgba(247,246,243,0.88);
  --tag-bg:       rgba(166,133,23,0.08);
  --tag-text:     #7A6312;
  --shadow:       0 2px 20px rgba(0,0,0,0.06);
  --radius:       10px;

  /* dark hero */
  --hero-bg:      #07080C;
  --hero-text:    #E8E6E1;
  --hero-text-soft:#9B978F;
  --hero-text-muted:#5C584F;
  --hero-gold:        #C9A227;
  --hero-gold-bright: #E4BE3C;
  --hero-gold-dim:    #8B7019;
  --hero-border:      rgba(255,255,255,0.06);

  /* typography */
  --f-display: 'Lexend', system-ui, sans-serif;
  --f-body:    'DM Sans', system-ui, -apple-system, sans-serif;
  --f-mono:    ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'JetBrains Mono', monospace;

  /* rhythm */
  --article-max: 680px;
  --container-max: 1140px;
  --nav-h: 60px;
}

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

html { scroll-behavior: smooth; }
body {
  font-family: var(--f-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--gold); color: #fff; }

h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.15; }
a { color: inherit; text-decoration: none; }

/* subtle grain like dbaexpert.com */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 10000;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
}

main, header.site, footer.site, .hero { position: relative; }

/* ============================================================
   reading progress
   ============================================================ */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: rgba(0,0,0,0.06);
  z-index: 200;
}
.progress__bar {
  height: 100%; width: 0;
  background: var(--gold);
  transition: width 120ms linear;
}

/* ============================================================
   nav — fixed, blurred, 60px, compact
   ============================================================ */
header.site {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.brand {
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 1px;
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.brand span.thin { font-weight: 300; opacity: 0.7; }
.nav {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  list-style: none;
}
.nav a {
  color: var(--text-muted);
  font-family: var(--f-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color 0.3s ease;
  position: relative;
  padding-bottom: 2px;
}
.nav a::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 0;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width 0.4s cubic-bezier(0.16,1,0.3,1);
}
.nav a:hover, .nav a.is-active { color: var(--gold); }
.nav a:hover::after, .nav a.is-active::after { width: 100%; }

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
}
.theme-toggle:hover { border-color: var(--gold); color: var(--gold); transform: rotate(30deg); }

/* ============================================================
   hero — dark, compact, gold accents
   ============================================================ */
.hero {
  background: var(--hero-bg);
  color: var(--hero-text);
  padding: calc(var(--nav-h) + 1.75rem) 2rem 1.75rem;
  overflow: hidden;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 100px 100px;
  mask-image: radial-gradient(ellipse at 50% 60%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 60%, black 20%, transparent 70%);
  z-index: 0;
}
.hero__glow {
  position: absolute;
  top: 40%; left: 50%;
  transform: translate(-50%, -50%);
  width: 900px; height: 500px;
  background: radial-gradient(ellipse, rgba(201,162,39,0.18) 0%, transparent 55%);
  z-index: 0;
  animation: pulseGlow 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pulseGlow {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.95; }
}
.hero__inner {
  position: relative;
  z-index: 2;
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

/* gold tagline with side hairlines — exact dbaexpert pattern */
.hero__tagline {
  font-family: var(--f-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 6px;
  color: var(--hero-gold);
  text-transform: uppercase;
  position: relative;
  display: inline-block;
}
.hero__tagline::before,
.hero__tagline::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 32px; height: 1px;
  background: var(--hero-gold-dim);
}
.hero__tagline::before { right: calc(100% + 16px); }
.hero__tagline::after  { left:  calc(100% + 16px); }

.hero__series {
  font-family: var(--f-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--hero-gold-bright);
  margin: 0;
  opacity: 0.9;
}

.hero__badge {
  display: inline-block;
  background: rgba(201,162,39,0.12);
  color: var(--hero-gold-bright);
  border: 1px solid rgba(201,162,39,0.25);
  padding: 4px 14px;
  border-radius: 20px;
  font-family: var(--f-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.hero h1 {
  font-family: var(--f-display);
  font-size: clamp(1.35rem, 2.3vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.15;
  max-width: 22ch;
  color: var(--hero-text) !important;
}
.hero h1 em, .hero h1 .accent {
  font-style: normal;
  color: var(--hero-gold);
}

.hero__sub {
  font-family: var(--f-body);
  font-size: 0.85rem;
  color: var(--hero-text-soft);
  line-height: 1.5;
  max-width: 60ch;
  margin: 0 auto;
}

.hero__meta {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-family: var(--f-body);
  font-size: 0.72rem;
  color: var(--hero-text-muted);
  letter-spacing: 0.3px;
  margin-top: 0.1rem;
}
.hero__meta strong { color: var(--hero-text); font-weight: 600; }
.hero__meta .sep {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--hero-text-muted);
}

.hero__tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.2rem;
}
.hero__tags li {
  background: rgba(201,162,39,0.1);
  color: var(--hero-gold-bright);
  padding: 3px 9px;
  border-radius: 3px;
  font-family: var(--f-display);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* ============================================================
   article body — compact, dbaexpert-sized
   ============================================================ */
main {
  padding: 0 2rem;
}
.article {
  max-width: var(--article-max);
  margin: 2rem auto 3.5rem;
}

.article p, .article li {
  font-family: var(--f-body);
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.article p { margin: 0 0 0.85rem; }
.article strong { color: var(--text-primary); font-weight: 700; }
.article em { font-style: italic; }

.article p.lede {
  font-size: 1rem;
  color: var(--text-primary);
}

.article h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  margin: 1.75rem 0 0.5rem;
}
.article h2.step {
  display: flex; align-items: center; gap: 0.65rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.step__num {
  font-family: var(--f-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--gold);
  background: var(--gold-glow);
  border: 1px solid var(--gold-border);
  padding: 3px 8px;
  border-radius: 4px;
}
.step__line {
  height: 1px; width: 24px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.step__text {}

.article h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.2rem 0 0.35rem;
  letter-spacing: -0.2px;
}
.article h3.sub { display: inline-flex; align-items: baseline; gap: 0.5rem; }
.sub__mark { color: var(--gold); font-family: var(--f-mono); font-size: 0.9rem; }

.article a {
  color: var(--gold);
  border-bottom: 1px solid var(--gold-border);
  transition: color 0.3s, border-color 0.3s;
}
.article a:hover {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

.article ul, .article ol { margin: 0.4rem 0 0.85rem 1.5rem; }
.article ul li, .article ol li { margin-bottom: 0.25rem; line-height: 1.5; color: var(--text-secondary); }
.article ul { list-style: disc; }
.article ol { list-style: decimal; }
.article ul li::marker { color: var(--gold); }
.article ol li::marker { color: var(--gold); font-family: var(--f-display); font-weight: 700; font-size: 0.9em; }

.article hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 1.75rem auto;
  max-width: 120px;
}

/* inline code — subtle chip, dbaexpert neutral style */
.article :not(pre) > code {
  font-family: var(--f-mono);
  font-size: 0.85em;
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ============================================================
   code blocks — orapub pattern, kept per user request
   ============================================================ */
figure.code {
  position: relative;
  margin: 0.9rem 0;
}
.article pre {
  background: #F6F6F7;
  border: 1px solid #E7E9EB;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0;
  overflow-x: auto;
  font-family: var(--f-mono) !important;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #303745;
  position: relative;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  tab-size: 4;
}
.article pre code,
.article pre code.hljs {
  display: block;
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-family: var(--f-mono) !important;
  font-size: inherit;
  line-height: inherit;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  min-width: 0;
  width: max-content;
}
.article pre[data-language]::before {
  content: attr(data-language);
  position: absolute;
  top: 8px; right: 12px;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: #767C88;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  pointer-events: none;
}
figure.code .code__copy {
  position: absolute;
  top: 6px; right: 60px;
  width: 22px; height: 22px;
  padding: 0;
  border: 1px solid #E7E9EB;
  border-radius: 4px;
  background: #ffffff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 160ms ease, border-color 160ms ease;
}
figure.code:hover .code__copy { opacity: 1; }
figure.code .code__copy::before,
figure.code .code__copy::after {
  content: "";
  position: absolute;
  border: 1.5px solid #767C88;
  border-radius: 2px;
  background: #ffffff;
}
figure.code .code__copy::before { width: 8px; height: 10px; top: 3px; left: 4px; }
figure.code .code__copy::after  { width: 8px; height: 10px; top: 6px; left: 8px; }
figure.code .code__copy:hover { border-color: var(--gold); }
figure.code .code__copy:hover::before,
figure.code .code__copy:hover::after { border-color: var(--gold); }

/* highlight.js — orapub palette */
.hljs { background: transparent !important; color: #303745 !important; }
.hljs-comment, .hljs-quote { color: #959AA4; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-type, .hljs-addition { color: #2A6FC0; font-weight: 500; }
.hljs-string, .hljs-doctag, .hljs-regexp { color: #00857B; }
.hljs-number, .hljs-meta, .hljs-link { color: #C66D00; }
.hljs-title, .hljs-section, .hljs-name, .hljs-built_in { color: #2A6FC0; }
.hljs-attr, .hljs-property, .hljs-params { color: #0D4F8C; }
.hljs-variable, .hljs-template-variable, .hljs-tag, .hljs-attribute { color: #C66D00; }
.hljs-symbol, .hljs-subst, .hljs-punctuation { color: #464C5A; }
.hljs-strong { font-weight: 700; }
.hljs-emphasis { font-style: italic; }

/* ============================================================
   blockquote
   ============================================================ */
blockquote.pull {
  margin: 1rem 0;
  padding: 0.7rem 1rem;
  background: var(--bg-elevated);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
}
blockquote.pull p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
}
blockquote.pull p + p { margin-top: 0.5rem; }

/* ============================================================
   figures (images)
   ============================================================ */
.figure { margin: 1.1rem 0; }
.figure__frame {
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 8px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.figure__frame img {
  display: block;
  width: 100%; height: auto;
  border-radius: 4px;
}
.figure__cap {
  margin-top: 0.6rem;
  font-family: var(--f-body);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.2px;
}

/* ============================================================
   footer — compact, dbaexpert-aligned
   ============================================================ */
footer.site {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 3rem 2rem 2rem;
}
.foot-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
}
.foot-brand {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.foot-brand .dot { color: var(--gold); }
.foot-tag {
  font-family: var(--f-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}
.foot-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 38ch;
}
.foot-col h4 {
  font-family: var(--f-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0 0 0.8rem;
}
.foot-col ul { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
.foot-col a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 0.3s ease;
}
.foot-col a:hover { color: var(--gold); }
.foot-bottom {
  max-width: var(--container-max);
  margin: 2rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between;
  font-family: var(--f-body);
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ============================================================
   responsive
   ============================================================ */
@media (max-width: 860px) {
  .nav { display: none; }
  .nav-inner { grid-template-columns: none; }
  .foot-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .hero { padding: calc(var(--nav-h) + 2.5rem) 1.25rem 2rem; }
  .article { margin: 2rem auto 3rem; }
  .article pre { font-size: 0.8rem; padding: 16px; }
  .foot-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .foot-bottom { flex-direction: column; gap: 0.5rem; }
  main { padding: 0 1.25rem; }
}
