
  :root {
    --bg: #141414;
    --surface: #1c1c1c;
    --text: #e8e8e8;
    --muted: #9a9a9a;
    --accent: #c4b5a0;
    --accent-dim: #8a7f72;
    --border: #333;
    --code-bg: #0f0f0f;
    --code-text: #d4d4d4;
    --success: #7d9b76;
    --radius: 6px;
    --mono: "SF Mono", "IBM Plex Mono", Consolas, "Liberation Mono", Menlo, monospace;
  }

  * { box-sizing: border-box; }

  html { -webkit-text-size-adjust: 100%; }

  body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
      Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
  }

  .wrap {
    max-width: 42rem;
    margin: 0 auto;
    padding: 3rem 1.25rem 5rem;
  }

  .page-head {
    margin-bottom: 2.5rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border);
  }

  .kicker {
    display: block;
    margin: 0 0 0.5rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-dim);
  }

  h1 {
    font-size: clamp(1.5rem, 4vw, 1.875rem);
    line-height: 1.25;
    margin: 0 0 0.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
  }

  .lead {
    margin: 0;
    color: var(--muted);
    font-size: 0.98rem;
    max-width: 36em;
  }

  .section-title {
    font-size: 1.125rem;
    margin: 2.5rem 0 0.75rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem 0.65rem;
  }

  .section-num {
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-dim);
    flex-shrink: 0;
  }

  p { margin: 0 0 1rem; }

  a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: var(--accent-dim);
    text-underline-offset: 2px;
    transition: color 0.12s ease, text-decoration-color 0.12s ease;
  }
  a:hover {
    color: #e0d6c8;
    text-decoration-color: var(--accent);
  }

  /* Lucide (ISC) + Simple Icons (CC0) — official paths, see icons in markup */
  .ico {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    color: var(--accent-dim);
  }
  .ico--lucide {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .ico--simple {
    fill: currentColor;
  }

  .link-row {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }

  .link-row a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: var(--text);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    transition: background 0.12s ease;
  }
  .link-row a:last-child { border-bottom: none; }
  .link-row a:hover {
    background: #242424;
    color: var(--text);
  }

  .link-row .link-meta {
    flex: 1;
    min-width: 0;
  }

  .link-row .link-label {
    display: block;
    font-size: 0.7rem;
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.15rem;
  }

  .link-row .link-action {
    display: block;
    font-size: 0.92rem;
    font-weight: 500;
  }

  .link-row .link-arrow {
    color: var(--accent-dim);
    font-family: var(--mono);
    font-size: 0.85rem;
  }

  .subnote {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .steps {
    padding: 0 0 0 2.75rem;
    list-style: none;
    margin: 0 0 1.25rem;
    counter-reset: guide;
    border-left: 1px solid var(--border);
    margin-left: 0.15rem;
  }

  .steps li {
    margin: 0;
    padding: 0 0 1.1rem 0.5rem;
    position: relative;
    font-size: 0.95rem;
    color: var(--text);
  }

  .steps li::before {
    counter-increment: guide;
    content: counter(guide, decimal-leading-zero);
    position: absolute;
    left: -2.75rem;
    top: 0.05rem;
    width: 2.25rem;
    text-align: right;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--accent-dim);
    background: var(--bg);
  }

  .closing {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
  }

  /* Code block */
  .code-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 0.5rem 0;
    background: var(--surface);
  }

  .code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0.6rem 0.75rem;
    background: var(--surface);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
  }

  .toggle-btn {
    background: none;
    border: none;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 6px;
  }
  .toggle-btn:hover { background: rgba(255,255,255,0.06); }

  .arrow {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1;
    transition: transform 0.2s ease;
    color: var(--accent-dim);
  }
  .code-card.open .arrow { transform: rotate(45deg); }

  .copy-btn {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
    white-space: nowrap;
  }
  .copy-btn:hover {
    background: #242424;
    border-color: var(--accent-dim);
  }
  .copy-btn.copied {
    color: var(--success);
    border-color: var(--success);
  }

  /* Collapsed preview with fade */
  .code-body {
    position: relative;
    max-height: 190px;
    overflow: hidden;
    transition: max-height 0.35s ease;
    background: var(--code-bg);
  }
  /* Expanded: only a bit taller, scroll inside the box */
  .code-card.open .code-body {
    max-height: 340px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Scrollbar styling for the code box */
  .code-body::-webkit-scrollbar { width: 10px; }
  .code-body::-webkit-scrollbar-thumb {
    background: #3a3f4a;
    border-radius: 8px;
    border: 2px solid var(--code-bg);
  }
  .code-body::-webkit-scrollbar-track { background: transparent; }

  .fade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 120px;
    pointer-events: none;
    background: linear-gradient(
      to bottom,
      rgba(18, 20, 26, 0) 0%,
      rgba(18, 20, 26, 0.85) 65%,
      var(--code-bg) 100%
    );
    transition: opacity 0.3s ease;
  }
  .code-card.open .fade { opacity: 0; }

  pre {
    margin: 0;
    padding: 18px;
    background: var(--code-bg);
    color: var(--code-text);
    font-family: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9rem;
    line-height: 1.55;
    /* Wrap long lines so nothing is hidden past the box */
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  @media (max-width: 600px) {
    .wrap { padding: 1.75rem 1rem 4rem; }
    .section-title { font-size: 1.05rem; }
    pre { font-size: 0.8rem; padding: 0.85rem; }
    .code-head { flex-wrap: wrap; }
    .copy-btn { width: 100%; text-align: center; }
    .code-card.open .code-body { max-height: 300px; }
  }
