/* deepinfer.run — restrained infra/docs system (cool blue accent) */
:root {
  --bg: #07090F;
  --surface: #0E121B;
  --surface-2: #141A26;
  --surface-3: #1A2230;
  --text: #F4F6FB;
  --secondary: #A8B0C2;
  --muted: #6B7385;
  --accent: #38BDF8;
  --accent-dim: rgba(56, 189, 248, 0.12);
  --accent-ink: #041018;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --ok: #34D399;
  --warn: #FBBF24;
  --danger: #F87171;
  --radius: 12px;
  --radius-sm: 10px;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: min(1120px, calc(100% - 2.5rem));
  --wrap-wide: min(1200px, calc(100% - 2.5rem));
  --ease: 160ms cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 3.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  color-scheme: dark;
  max-width: 100%;
  /* clip avoids creating a scroll container that kills position:sticky */
  overflow-x: clip;
}
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  max-width: 100%;
  overflow-x: clip;
}
/* subtle top wash only — no rainbow blobs */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(720px 380px at 50% -12%, rgba(56, 189, 248, 0.07), transparent 60%),
    var(--bg);
}

a { color: var(--accent); text-decoration: none; transition: color var(--ease); }
a:hover { color: #7DD3FC; text-decoration: underline; text-underline-offset: 0.16em; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: var(--wrap); max-width: 100%; min-width: 0; margin-inline: auto; }
.wrap-wide { width: var(--wrap-wide); max-width: 100%; min-width: 0; margin-inline: auto; }

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-h);
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  /* Near-opaque so scrolled prose does not bleed through Install/Hardware/Blog */
  background: rgba(7, 9, 15, 0.96);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 650;
  font-size: 0.98rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  flex-shrink: 0;
}
.logo:hover { color: var(--text); text-decoration: none; }
.logo img {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 7px;
  border: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.15rem 1.15rem;
  margin-inline: auto;
}
.nav > a, .nav-more > summary {
  color: var(--secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.25rem 0;
  cursor: pointer;
  list-style: none;
}
.nav > a:hover, .nav > a[aria-current="page"],
.nav-more[open] > summary, .nav-more > summary:hover {
  color: var(--text);
  text-decoration: none;
}
.nav-more { position: relative; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary::after {
  content: "";
  display: inline-block;
  width: 0.35rem; height: 0.35rem;
  margin-left: 0.35rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.7;
}
.nav-more-panel {
  position: absolute;
  top: calc(100% + 0.65rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 10.5rem;
  padding: 0.4rem;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.nav-more-panel a {
  color: var(--secondary);
  font-size: 0.88rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  text-decoration: none;
}
.nav-more-panel a:hover, .nav-more-panel a[aria-current="page"] {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  text-decoration: none;
}

.nav-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
  flex-wrap: nowrap;
  margin-left: 0;
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.15rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}
.lang-switch a {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.28rem 0.5rem;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
}
.lang-switch a:hover { color: var(--text); text-decoration: none; }
.lang-switch a[aria-current="true"] {
  color: var(--text);
  background: var(--surface-3);
}
.gh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--secondary);
  text-decoration: none;
  flex-shrink: 0;
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}
.gh-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-2);
  text-decoration: none;
}
.gh-btn svg { width: 1rem; height: 1rem; display: block; }

.nav-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 9px;
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
  cursor: pointer;
}

@media (max-width: 900px) {
  .site-header {
    height: auto;
    min-height: var(--header-h);
  }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--header-h);
    padding: 0.55rem 0;
    align-items: center;
  }
  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.35rem 0 0.5rem;
    margin: 0;
  }
  .nav.open { display: flex; }
  .nav-more { width: 100%; }
  .nav-more-panel {
    position: static;
    transform: none;
    margin-top: 0.35rem;
    box-shadow: none;
  }
  .nav-tools { order: 0; }
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.72rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background var(--ease), border-color var(--ease), color var(--ease), transform var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}
.btn-primary:hover { color: var(--accent-ink); background: #7DD3FC; }
.btn-secondary {
  color: var(--text);
  background: transparent;
  border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: rgba(56, 189, 248, 0.35); color: var(--text); background: rgba(255,255,255,0.02); }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.7rem; }

/* ——— Hero ——— */
.hero { padding: 5rem 0 3.5rem; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 2.5rem;
  align-items: center;
}
@media (max-width: 900px) {
  .hero { padding: 3.5rem 0 2.5rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
}
.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.1rem, 4vw, 2.85rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 700;
  max-width: 16ch;
}
.hero h1 .kw {
  color: var(--accent);
}
.hero-lead {
  margin: 0 0 1.75rem;
  color: var(--secondary);
  font-size: 1.05rem;
  max-width: 42ch;
  line-height: 1.65;
}
.hero-panel {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 16px;
  padding: 1.25rem 1.35rem;
}
.hero-panel h3 {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-panel dl {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}
.hero-panel dt { font-size: 0.82rem; color: var(--muted); margin: 0; }
.hero-panel dd { margin: 0.1rem 0 0; color: var(--text); font-size: 0.95rem; font-weight: 550; }

/* ——— Sections ——— */
.section { padding: 5rem 0; max-width: 100%; min-width: 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-head { margin-bottom: 1.75rem; max-width: 40rem; }
.section-head h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
  letter-spacing: -0.025em;
  font-weight: 650;
}
.section-head p { margin: 0; color: var(--secondary); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 900px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.3rem;
  transition: border-color var(--ease), transform var(--ease);
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card h3 {
  margin: 0.15rem 0 0.5rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  font-weight: 650;
}
.card p, .card li { color: var(--secondary); font-size: 0.94rem; }
.card ul { margin: 0.45rem 0 0; padding-left: 1.1rem; }
.card li { margin: 0.22rem 0; }
.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  margin-bottom: 0.55rem;
  border: 1px solid var(--border);
  color: var(--secondary);
  background: transparent;
}
.tag-accent {
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.28);
  background: var(--accent-dim);
}

/* ——— Tables ——— */
.table-wrap {
  max-width: 100%;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  padding: 0.85rem 1.05rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: rgba(255,255,255,0.015); }
td { color: var(--secondary); }
td strong { color: var(--text); font-weight: 600; }
.yes { color: var(--ok); font-weight: 600; }
.no { color: var(--danger); font-weight: 600; }
.partial { color: var(--warn); font-weight: 600; }

/* ——— Prose / page ——— */
.page-hero { padding: 3.5rem 0 1.5rem; }
.page-hero h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  letter-spacing: -0.03em;
  font-weight: 700;
}
.page-hero p { margin: 0; color: var(--secondary); max-width: 42rem; }
.crumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.85rem; }
.crumbs a { color: var(--secondary); }
.prose { max-width: min(46rem, 100%); min-width: 0; width: 100%; }
.prose h2 { margin: 2.4rem 0 0.7rem; font-size: 1.35rem; letter-spacing: -0.02em; }
.prose h3 { margin: 1.6rem 0 0.5rem; font-size: 1.08rem; }
.prose p, .prose li { color: var(--secondary); }
.prose ul, .prose ol { padding-left: 1.15rem; }
.prose li { margin: 0.35rem 0; }
.inline-code, .prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.08rem 0.35rem;
  border-radius: 6px;
  color: #D7E8F5;
}
.checklist { list-style: none; padding: 0; margin: 1rem 0; }
.checklist li {
  position: relative;
  padding: 0.75rem 0.95rem 0.75rem 2.35rem;
  margin: 0.4rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--secondary);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 4px;
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  background: var(--accent-dim);
}
.callout {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 1.25rem 0;
  color: var(--secondary);
}
.callout strong { color: var(--text); }
.callout.warn { border-color: rgba(251, 191, 36, 0.28); }
.callout.danger { border-color: rgba(248, 113, 113, 0.28); }
.source-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin: 1rem 0 0; font-size: 0.9rem; }
pre.code-block {
  position: relative;
  background: #05070C;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.55;
  color: #D5DEEA;
}
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 0.22rem 0.5rem;
  font-size: 0.72rem;
  cursor: pointer;
}
.copy-btn:hover { color: var(--text); }

.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.85rem; margin-top: 1rem; }
.related a.card { display: block; text-decoration: none; color: inherit; }
.related a.card:hover { border-color: rgba(56, 189, 248, 0.3); }
.related a.card h3 { color: var(--text); }

.blog-list { display: flex; flex-direction: column; gap: 0.85rem; }
.blog-item {
  display: block;
  padding: 1.25rem 1.35rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--ease), transform var(--ease);
}
.blog-item:hover { border-color: var(--border-strong); transform: translateY(-2px); text-decoration: none; }
.blog-item .meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.4rem; }
.blog-item h2 { margin: 0 0 0.35rem; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--text); }
.blog-item p { margin: 0; color: var(--secondary); font-size: 0.94rem; }
.post-meta { color: var(--muted); font-size: 0.88rem; margin-bottom: 1.2rem; }

/* ad-slot inventory boxes removed — Social Bar only */

/* ——— Footer ——— */
.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding: 3rem 0 2.5rem;
  background: rgba(0, 0, 0, 0.2);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; } }
.site-footer h4 {
  margin: 0 0 0.7rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 650;
}
.site-footer a {
  color: var(--secondary);
  display: block;
  margin: 0.3rem 0;
  font-size: 0.9rem;
  text-decoration: none;
}
.site-footer a:hover { color: var(--text); }
.footer-note {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

/* ——— Figures / media ——— */
/* Contain wide PNGs / markdown imgs so they never expand the viewport */
img,
.prose img,
.figure img,
.chart-strip img {
  max-width: 100%;
  height: auto;
  display: block;
}
.figure {
  margin: 1.35rem 0;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 100%;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.figure img {
  width: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #05070C;
}
/* Wide diagrams (architecture etc.): keep readable size; scroll inside figure */
.figure.figure-wide img,
.figure img[src*="architecture"] {
  width: auto;
  max-width: none;
  min-width: 720px;
  height: auto;
}
.figure figcaption {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}
.attr-box {
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(56, 189, 248, 0.06);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 1.25rem 0;
  color: var(--secondary);
  max-width: 100%;
  min-width: 0;
}
.attr-box strong { color: var(--text); }
.chart-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 1rem;
  margin-top: 1rem;
  max-width: 100%;
  min-width: 0;
}
.chart-strip .figure { margin: 0; }
.prose .figure,
.prose img,
.prose table,
.prose .table-wrap {
  max-width: 100%;
  min-width: 0;
}

.phrase-keep { white-space: nowrap; }
