/* ===== Design Tokens ====================================================== */
:root {
  /* Brand */
  --brand: #1565c0;
  --brand-600: #0d47a1;

  /* Text & Surfaces */
  --text: #111;
  --muted: #666;
  --border: #e6e6e6;
  --surface: #fff;
  --surface-2: #f7f7f8;

  /* Accents for badges */
  --ok-bg: #e6fcf5;
  --ok-fg: #087f5b;
  --info-bg: #e7f5ff;
  --info-fg: #0b6bcb;
  --warn-bg: #fff3cd;
  --warn-fg: #8a6d3b;
  --err-bg: #fde2e1;
  --err-fg: #a61d24;

  /* Typography */
  --heading-font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --body-font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --fw-thin: 300;
  --fw-light: 300;
  --fw-regular: 400;

  /* Radii & Shadows */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-lg: 30px;

  /* Transitions */
  --ease: 180ms ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #eaeaea;
    --muted: #cfcfcf;
    --border: #2a2b30;
    --surface: #1f1f1f;
    --surface-2: #161616;

    /* Tweak brand for dark */
    --brand: #8ab4ff;
    --brand-600: #81a7ff;
  }
}

/* Reduce motion if requested */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== Base =============================================================== */
html,
body {
  background: var(--surface);
  color: var(--text);
}

body {
  font-family: var(--body-font);
  font-weight: var(--fw-thin);
  line-height: 1.65;
}

/* Container width (optional) */
.container {
  max-width: 1100px;
}

/* Paragraphs & sections */
p {
  margin-bottom: 1rem;
  font-weight: var(--fw-thin);
}

section {
  margin-bottom: 2.5rem;
}

.more-height {
  line-height: 2;
}

/* Headings */
h1,
h2,
h3 {
  font-family: var(--heading-font);
  font-weight: var(--fw-light);
  text-transform: uppercase;
  letter-spacing: .02em;
  margin-bottom: .4rem;
  color: var(--text);
}

h1 {
  font-size: 2.2rem;
}

h2 {
  font-size: 1.7rem;
  padding-bottom: .2rem;
}

h3 {
  font-size: 1.3rem;
}

/* Links */
a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--ease), border-color var(--ease);
  border-bottom: 1px solid transparent;
}

a:hover {
  color: var(--brand);
}

/* Bold */
b,
strong {
  font-weight: var(--fw-regular);
}

/* ===== Buttons ============================================================ */
.btn {
  font-family: var(--body-font);
  font-weight: var(--fw-regular);
  border-radius: var(--radius-sm);
  border: 1px solid currentColor;
  color: var(--text);
  background: transparent;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}

.btn:hover {
  color: #fff;
  background: var(--text);
  border-color: var(--text);
}

.btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.btn-primary {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.btn-primary:hover {
  background: var(--brand-600);
  border-color: var(--brand-600);
}

.btn-outline-primary {
  color: var(--brand);
  border-color: var(--brand);
  background: transparent;
}

.btn-outline-primary:hover {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.btn-minimal {
  border: 1px solid var(--text);
  color: var(--text);
  background: transparent;
  padding: .35rem .6rem;
  border-radius: .4rem;
  font-size: .9rem;
  text-decoration: none;
}

.btn-minimal:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* Group gap helper */
.btn-group-gap {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

/* ===== Cards & Modal shells ============================================== */
.os-card,
.card {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.os-modal,
.modal-content {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* Badge avatar */
.os-badge {
  inline-size: 36px;
  block-size: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}

/* ===== Tables & “badge-type-*” =========================================== */
.table {
  color: var(--text);
}

.table thead th {
  background: var(--surface-2) !important;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.table td,
.table th {
  border-color: var(--border) !important;
}

.badge {
  display: inline-block;
  padding: .25rem .5rem;
  border-radius: .5rem;
  font-size: .8rem;
}

.badge-type-LOGIN {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.badge-type-INFO {
  background: var(--info-bg);
  color: var(--info-fg);
}

.badge-type-WARN {
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.badge-type-ERROR {
  background: var(--err-bg);
  color: var(--err-fg);
}

/* ===== Publications (if used) ============================================ */
.pub-entry {
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}

.pub-title a {
  text-decoration: underline;
  text-underline-offset: 2px;
  color: inherit;
}

.pub-title a:hover {
  color: var(--brand);
}

.pub-authors {
  color: var(--muted);
  margin-top: .15rem;
}

.venue-row {
  margin-top: .25rem;
  gap: .5rem;
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
}

.venue-badge {
  background: var(--surface-2);
  color: var(--text);
  font-size: .82rem;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ===== Utilities ========================================================== */
.text-muted {
  color: var(--muted) !important;
}

.rounded-md {
  border-radius: var(--radius-md);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

/* Optional: special code/preview block */
pre,
code,
kbd,
samp {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

pre {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: .75rem 1rem;
}

/* Optional: focus rings for clickable things lacking default outlines */
[role="button"],
.nav-link,
a.btn {
  outline-offset: 2px;
}

[role="button"]:focus-visible,
.nav-link:focus-visible,
a.btn:focus-visible {
  outline: 2px solid var(--brand);
}