/* ========== Design tokens ========== */
:root{
  --bg: #f5f7fa;
  --card: #ffffff;
  --ink: #222;
  --muted:#556277;
  --brand:#004085;
  --brand-ink:#ffffff;
  --accent:#0a84ff;
  --border:#e5e9f2;
  --shadow: 0 6px 16px rgba(0,0,0,.08);
  --radius: 12px;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg:#0f1218;
    --card:#121622;
    --ink:#e9edf5;
    --muted:#9aa8b8;
    --brand:#2b6cb0;
    --brand-ink:#0a1220;
    --accent:#409cff;
    --border:#1f2430;
    --shadow: 0 10px 28px rgba(0,0,0,.5);
  }
}

/* ========== Base ========== */
*,
*::before,
*::after{ box-sizing:border-box; }

html,body{ height:100%; }

body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

.wrap{
  max-width: 980px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* ========== Header & Footer ========== */
.site-header{
  background: var(--brand);
  color: var(--brand-ink);
  padding: 28px 0 26px;
  box-shadow: 0 3px 7px rgba(0,64,133,.35);
  margin-bottom: 36px;
}

.site-header h1{
  margin:0 0 6px;
  font-weight: 800;
  font-size: clamp(1.8rem, 2.8vw, 2.6rem);
  letter-spacing:.2px;
}

.subtitle{
  margin:0;
  opacity:.9;
}

.site-footer{
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding: 18px 0;
  color: var(--muted);
  font-size:.95rem;
}

/* ========== Layout ========== */
.container{
  display: grid;
  gap: 20px;
}

/* ========== Cards ========== */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.card h2{
  color: var(--brand);
  border-bottom: 3px solid var(--brand);
  padding-bottom: 8px;
  margin: 4px 0 18px;
  font-size: clamp(1.2rem, 2.2vw, 2rem);
}

.card h3{
  margin: 16px 0 10px;
  color: var(--ink);
}

/* ========== Text & Lists ========== */
p{ font-size: 1.05rem; margin: 0 0 14px; }
ul{ margin: 0 0 18px 20px; }
strong{
  color: var(--brand);
  background: #d0e2ff;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark){
  strong{ background: rgba(64,156,255,.18); }
}

/* checklist bullets */
.checklist{
  list-style: none;
  padding-left: 0;
}
.checklist li{
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
}
.checklist li::before{
  content: "✔";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ========== Figures & Images ========== */
.figure{
  margin: 14px 0 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
}
.figure img{
  width: 100%;
  display: block;
}
.figure figcaption{
  padding: 10px 14px;
  font-size: .95rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: linear-gradient(0deg, transparent, rgba(0,0,0,.02));
}

/* ========== Callouts ========== */
.callout{
  border: 1px solid var(--border);
  border-left-width: 6px;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 14px 0;
  background: color-mix(in srgb, var(--card) 90%, var(--accent) 10% / 8%);
}
.callout .callout-title{
  font-weight: 700;
  margin-bottom: 6px;
}
.callout.info{ border-left-color: #2f86eb; }
.callout.success{ border-left-color: #27ae60; }

/* ========== Code & KBD ========== */
pre{
  margin: 10px 0 14px;
  background: #0b1220;
  color: #e6edf3;
  border-radius: 10px;
  overflow: auto;
  border: 1px solid #0f1b31;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}
pre code{
  display: block;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .95rem;
  white-space: pre;
}
code{
  background: rgba(10,132,255,.12);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(10,132,255,.2);
}
kbd{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: .2em .5em;
  border: 1px solid var(--border);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: var(--card);
}

/* ========== Utilities ========== */
hr{
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ========== Responsive tweaks ========== */
@media (max-width: 640px){
  .card{ padding: 18px; }
  .figure figcaption{ font-size: .9rem; }
}
