:root {
  --bg: #0b0f14;
  --panel: #121821;
  --muted: #95a1b2;
  --text: #e6edf3;
  --brand: #7cc4ff;
  --brand-2: #a78bfa;
  --border: #1f2632;
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  position: relative;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(124,196,255,.08), transparent 60%) ,
              radial-gradient(800px 400px at 90% -20%, rgba(167,139,250,.08), transparent 60%),
              var(--bg);
  background-repeat: no-repeat;
}
#navLink { text-transform: uppercase;  }
.container { width: min(1100px, 92vw); margin: 48px auto 64px; }
.site-header {
  display: flex; align-items: center; 
  background-color: black;
  padding: 20px 30px;
  margin-bottom: 20px;
  justify-content: space-between;
}
.site-header .logo {
  font-size: 3em;
}
.site-footer {
  display: flex; align-items: center; gap: 16px;
  width: min(1100px, 92vw); margin: 24px auto 0;
}
.site-footer { justify-content: center; margin-top: 48px; color: var(--muted); }

.logo { text-decoration: none; color: var(--text); font-weight: 700; letter-spacing: .3px; }
.search-wrap { margin: 0 auto; width: 380px; max-width: 50vw; }
#site-search {
  width: 100%; border: 1px solid var(--border); background: var(--panel); color: var(--text);
  border-radius: 999px; padding: 10px 14px; outline: none; transition: border .15s;
}
#site-search:focus { border-color: var(--brand); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.card {
  background: linear-gradient(180deg, rgba(124,196,255,.05), rgba(167,139,250,.05)) , var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card:hover { border-color: rgba(124,196,255,.35); transform: translateY(-1px); transition: .18s ease; }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #10151d; border: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.badge + .badge { margin-left: 6px; }

.breadcrumbs { color: var(--muted); margin-bottom: 16px; font-size: 14px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text); }

.topic-hero {
  display: grid; gap: 16px; grid-template-columns: 1.5fr .8fr; align-items: center;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.topic-hero img { width: 100%; border-radius: 12px; border: 1px solid var(--border); }

.topic h1 { margin: 10px 0 12px; }
.meta { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

.callout {
  border-radius: 12px; padding: 12px 14px; border: 1px solid var(--border);
  background: #0e141d;
}
.callout.tip { border-left: 4px solid var(--ok); }
.callout.note { border-left: 4px solid var(--brand); }
.callout.warn { border-left: 4px solid var(--warn); }

.steps { display: grid; gap: 12px; }
.step {
  border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: #0e141d;
}
.step h4 { margin: 0 0 6px; }
.step img { width: 100%; margin-top: 8px; border-radius: 10px; border: 1px solid var(--border); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag { border: 1px solid var(--border); background: #0e141d; padding: 4px 8px; border-radius: 999px; font-size: 12px; color: var(--muted); }

.list { display: grid; gap: 10px; }
.list a { text-decoration: none; color: var(--text); }
.list a .card { transition: transform .15s ease; }
.list a:hover .card { transform: translateY(-2px); }

hr.sep { border: none; border-top: 1px solid var(--border); margin: 28px 0; opacity: .7; }

a {
  color: var(--brand);
  text-decoration: none;
  transition: color .15s ease, text-decoration-color .15s ease;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:visited {
  color: var(--brand);          /* prevent default purple */
}
a:active {
  color: var(--brand-2);        /* subtle press feedback */
}
a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Logo: keep neutral */
.logo,
.logo:visited {
  color: var(--text);
  text-decoration: none;
}

/* Card links: inherit text color, no underline */
.card-link,
.card-link:visited {
  color: inherit;
  text-decoration: none;
}

/* Breadcrumbs: muted until hover */
.breadcrumbs a,
.breadcrumbs a:visited {
  color: var(--muted);
  text-decoration: none;
}
.breadcrumbs a:hover {
  color: var(--text);
}

/* In-article rich text links: show underline for readability */
.topic p a,
.topic li a,
.callout a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* List titles & alpha-ordered lists */
.list-title { margin: 8px 0 6px; font-weight: 600; }
ol.alpha { list-style-type: upper-alpha; }

/* Nice spacing (if not already present) */
.topic ol, .topic ul { margin: 0 0 16px 22px; }
.topic li { margin: 6px 0; }
.topic li > ol, .topic li > ul { margin-top: 6px; }

/* Lists inside steps a bit tighter */
.step ol, .step ul { margin: 8px 0 0 22px; }
.step li { margin: 4px 0; }

/* Lean image defaults */
.img-lean {
  display: block;
  width: 100%;
  max-width: 520px;        /* cap width on large screens */
  max-height: 320px;       /* cap height to avoid tall visuals */
  height: auto;
  object-fit: contain;
  margin: 8px auto 0;      /* center within cards/blocks */
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* Topic hero image: even smaller, more “badge-like” */
.topic-hero img.img-lean {
  max-width: 420px;
  max-height: 260px;
  margin: 0 0 0 auto;      /* align to the right column by default */
}

/* Step images: slightly tighter */
.step img.img-lean {
  max-width: 800px;
  max-height: 800px;
}

/* Small screens: allow comfortable width but keep height cap */
@media (max-width: 720px) {
  .topic-hero { grid-template-columns: 1fr; }
  .topic-hero img.img-lean { margin: 0 auto; max-width: 92vw; }
  .img-lean { max-width: 92vw; }
}

.badge { vertical-align: middle; }

@media only screen and (max-width: 720px) {
  .site-header {
      flex-direction: column;
      font-size: 10px;
  }
  .site-header img {
    width: 150px;
  }
  .site-header .logo {
    font-size: 2em;
  }
}

/* Language switcher */
.lang-switcher {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 9999;
  font-size: 14px;
}

.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #0e141d;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  user-select: none;
}
.lang-pill:hover { border-color: rgba(124,196,255,.35); }
.lang-pill:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.lang-menu {
  position: absolute;
  right: 0;
  bottom: 44px;
  min-width: 180px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: none;
}
.lang-menu.open { display: block; }

.lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.lang-item:hover { background: #0e141d; }
.lang-item[aria-current="true"] { background: #0e141d; border: 1px solid var(--border); }
.lang-item-kbd {
  font-size: 12px;
  color: var(--muted);
}
