:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef5ff;
  --ink: #172033;
  --muted: #5f6f89;
  --line: #dfe7f2;
  --navy: #07111f;
  --navy-2: #0d2037;
  --blue: #1f74ff;
  --blue-dark: #1558d6;
  --teal: #20c7b5;
  --shadow: 0 18px 45px rgba(16, 33, 60, 0.09);
  --sidebar-width: 280px;
  --header-height: 76px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--header-height);
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(31, 116, 255, 0.24);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
  line-height: 1.15;
}

.brand small {
  color: #a9bbd4;
  font-size: 0.78rem;
  margin-top: 2px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(31, 116, 255, 0.25);
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.btn-secondary,
.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.btn-secondary:hover,
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
}

.menu-toggle {
  display: none;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  z-index: 15;
  width: var(--sidebar-width);
  padding: 26px 18px;
  overflow-y: auto;
  background: #0a1628;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.sidebar a {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-radius: 8px;
  padding: 10px 12px;
  color: #b7c5d9;
  font-weight: 700;
}

.sidebar a:hover,
.sidebar a.is-active {
  background: rgba(31, 116, 255, 0.14);
  color: #ffffff;
}

.sidebar a.is-active {
  box-shadow: inset 3px 0 0 var(--teal);
}

/* Main */
.main-content {
  width: min(1180px, calc(100% - var(--sidebar-width)));
  margin-left: var(--sidebar-width);
  padding: calc(var(--header-height) + 42px) 44px 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  align-items: stretch;
  gap: 28px;
  margin-bottom: 36px;
}

.hero-copy {
  padding: 46px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
  box-shadow: var(--shadow);
}

.eyebrow,
.card-kicker {
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  line-height: 1.02;
}

h2 {
  margin-bottom: 16px;
  font-size: 1.55rem;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.08rem;
  line-height: 1.25;
}

.lead {
  color: #24344f;
  font-size: 1.25rem;
}

.hero-copy p,
.page-title p,
.content-section p {
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-actions .btn-ghost {
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}

.hero-panel {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 16px;
  min-height: 320px;
  border-radius: 8px;
  padding: 34px;
  background: linear-gradient(160deg, #07111f, #102944);
  color: #ffffff;
  box-shadow: var(--shadow);
}

.hero-panel img {
  width: 96px;
  height: 96px;
  border-radius: 8px;
}

.hero-panel strong {
  font-size: 1.45rem;
  line-height: 1.2;
}

.hero-panel span {
  color: #a9bbd4;
}

.page-content {
  max-width: 1040px;
}

.page-title {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.page-title h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
}

.content-section {
  margin-bottom: 30px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(16, 33, 60, 0.05);
}

.callout {
  border-color: rgba(31, 116, 255, 0.22);
  background: var(--surface-soft);
}

.note {
  margin-top: 16px;
  margin-bottom: 0;
  font-size: 0.95rem;
}

.check-list,
.steps {
  color: var(--muted);
}

.check-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.check-list span {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fbfdff;
  font-weight: 700;
}

.steps {
  margin-bottom: 0;
  padding-left: 22px;
}

.steps li + li {
  margin-top: 8px;
}

.author-box {
  display: flex;
  align-items: center;
  gap: 16px;
}

.author-box img {
  width: 58px;
  height: 58px;
  border-radius: 8px;
}

.author-box strong,
.author-box span {
  display: block;
}

.author-box span {
  color: var(--muted);
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

.card {
  min-height: 170px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(16, 33, 60, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

a.card:hover {
  transform: translateY(-3px);
  border-color: rgba(31, 116, 255, 0.35);
  box-shadow: var(--shadow);
}

.card p {
  margin-bottom: 0;
  color: var(--muted);
}

.tag-grid,
.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-grid span,
.tech-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #f9fbff;
  color: #263852;
  font-weight: 700;
  font-size: 0.94rem;
}

.tech-list span {
  border-color: rgba(31, 116, 255, 0.18);
  background: #edf5ff;
  color: #174a9d;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  background: #f0f5fb;
  color: #25344d;
  font-size: 0.9rem;
}

tr:last-child td {
  border-bottom: 0;
}

td {
  color: var(--muted);
}

td:first-child {
  color: var(--ink);
  font-weight: 800;
}

/* Code Blocks */
code {
  font-family: "Cascadia Code", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

p code {
  border-radius: 6px;
  padding: 2px 6px;
  background: #eef4ff;
  color: #1558d6;
}

pre {
  margin: 0;
  overflow-x: auto;
  border-radius: 8px;
  padding: 20px;
  background: #07111f;
  color: #dbeafe;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

pre code {
  display: block;
  min-width: max-content;
  line-height: 1.65;
}

.site-footer {
  margin-left: var(--sidebar-width);
  padding: 26px 44px;
  border-top: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  text-align: center;
}

/* Responsive */
@media (max-width: 980px) {
  .site-header {
    flex-wrap: wrap;
    padding: 12px 18px;
  }

  .brand {
    min-width: 0;
  }

  .top-actions {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .top-actions .btn {
    flex: 0 0 auto;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar {
    top: 132px;
    width: 100%;
    max-height: calc(100vh - 132px);
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar nav {
    gap: 8px;
  }

  .main-content,
  .site-footer {
    width: 100%;
    margin-left: 0;
  }

  .main-content {
    padding: 170px 20px 44px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .hero-panel,
  .content-section {
    padding: 24px;
  }
}

@media (max-width: 560px) {
  .site-header {
    gap: 12px;
  }

  .brand img {
    width: 40px;
    height: 40px;
  }

  .brand strong {
    font-size: 0.92rem;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

  .sidebar {
    top: 184px;
    max-height: calc(100vh - 184px);
  }

  .main-content {
    padding: 220px 16px 36px;
  }

  .hero-copy,
  .hero-panel,
  .content-section,
  .card {
    padding: 20px;
  }

  .hero-panel {
    min-height: 260px;
  }

  .card-grid,
  .check-list {
    grid-template-columns: 1fr;
  }

  .site-footer {
    padding: 22px 16px;
  }
}
