/* ==========================================================================
   data-science-guide — shared design tokens and base layout.
   Loaded by the landing page and by every cheat sheet.
   ========================================================================== */

:root {
  --bg:            #ffffff;
  --bg-soft:       #f6f7f9;
  --bg-code:       #f2f4f7;
  --surface:       #ffffff;
  --border:        #e3e6ea;
  --border-strong: #cdd2d9;
  --text:          #1b1f24;
  --text-soft:     #59616b;
  --text-faint:    #8b939d;
  --accent:        #2563eb;
  --accent-soft:   #eaf0fe;
  --warn:          #b45309;
  --warn-soft:     #fdf3e3;
  --ok:            #15803d;
  --ok-soft:       #e8f5ec;

  --radius:   10px;
  --radius-s: 6px;
  --gap:      1.25rem;
  --maxw:     1180px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

/* Dark theme: follow the OS unless the page is explicitly pinned to light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #12151a;
    --bg-soft:       #171b21;
    --bg-code:       #1b2027;
    --surface:       #171b21;
    --border:        #262c35;
    --border-strong: #39414d;
    --text:          #e6e9ed;
    --text-soft:     #a4adb8;
    --text-faint:    #737d89;
    --accent:        #7aa2f7;
    --accent-soft:   #1c2740;
    --warn:          #e0a458;
    --warn-soft:     #2e2416;
    --ok:            #6bbf83;
    --ok-soft:       #16281c;
  }
}

/* Explicit dark, via the theme toggle. */
:root[data-theme="dark"] {
  --bg:            #12151a;
  --bg-soft:       #171b21;
  --bg-code:       #1b2027;
  --surface:       #171b21;
  --border:        #262c35;
  --border-strong: #39414d;
  --text:          #e6e9ed;
  --text-soft:     #a4adb8;
  --text-faint:    #737d89;
  --accent:        #7aa2f7;
  --accent-soft:   #1c2740;
  --warn:          #e0a458;
  --warn-soft:     #2e2416;
  --ok:            #6bbf83;
  --ok-soft:       #16281c;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* --- Site header ---------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.topbar__home {
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
}
.topbar__home:hover { color: var(--accent); text-decoration: none; }

.topbar__crumb {
  color: var(--text-faint);
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__spacer { flex: 1 1 auto; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.34rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--text-soft);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px 4rem;
}

/* --- Page intro ----------------------------------------------------------- */

.intro { padding: 2.2rem 0 1.4rem; border-bottom: 1px solid var(--border); }
.intro h1 { margin: 0 0 0.4rem; font-size: 1.9rem; line-height: 1.2; letter-spacing: -0.01em; }
.intro p  { margin: 0; color: var(--text-soft); max-width: 65ch; }

.meta {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  font-size: 0.78rem;
  color: var(--text-faint);
}

.tag {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-soft);
  font-size: 0.75rem;
}
.tag--accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }

/* --- Footer --------------------------------------------------------------- */

.foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem 16px 3rem;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.82rem;
}

@media print {
  .topbar, .btn, .no-print { display: none !important; }
  body { font-size: 10pt; }
}
