  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    --bg:       #F8F7F4;
    --bg2:      #EEECEA;
    --bg3:      #D8D5D1;
    --text:     #1A1916;
    --text2:    #3A3834;
    --text3:    #6B6860;
    --orange:   #FF5F00;
    --blue:     #0057FF;
    --border:   rgba(26,25,22,0.1);
    --font-display: 'Syne', sans-serif;
    --font-body:    'DM Sans', sans-serif;
    --font-mono:    'DM Mono', monospace;
  }
  html.dark {
    --bg:       #1A1916;
    --bg2:      #242220;
    --bg3:      #3A3834;
    --text:     #F0EEE9;
    --text2:    #C8C5C0;
    --text3:    #6B6860;
    --orange:   #FF5F00;
    --blue:     #4D85FF;
    --border:   rgba(240,238,233,0.08);
  }

  html { scroll-behavior: smooth; }
  body {
    background: var(--bg);
    color: var(--text2);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  .brand-dot { color: var(--orange); }

  main { max-width: 820px; margin: 0 auto; padding: 44px var(--pad-r) 72px var(--pad-l); }

  .eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--orange);
    margin-bottom: 12px;
  }
  h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(30px, 6vw, 44px);
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.08;
    margin-bottom: 12px;
  }
  .updated {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text3);
    margin-bottom: 36px;
  }
  .intro { font-size: 16px; color: var(--text2); margin-bottom: 8px; }

  h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 20px;
    color: var(--text);
    letter-spacing: -0.01em;
    margin: 44px 0 14px;
    scroll-margin-top: 72px;
  }
  h2 .num {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    color: var(--orange);
    margin-right: 10px;
  }
  h3 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
    margin: 20px 0 8px;
  }

  p { margin-bottom: 16px; }
  main ul { list-style: none; margin: 0 0 16px 0; display: flex; flex-direction: column; gap: 8px; }
  main li { position: relative; padding-left: 18px; line-height: 1.6; }
  main li::before { content: '—'; position: absolute; left: 0; color: var(--orange); }
  strong { color: var(--text); font-weight: 600; }

  main a { color: var(--blue); text-decoration: none; }
  main a:hover { text-decoration: underline; }

  .callout {
    background: var(--bg2);
    border: 0.5px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    margin: 24px 0;
    font-size: 14px;
    color: var(--text2);
  }
  .callout strong { color: var(--text); }
  .fineprint { font-size: 13px; color: var(--text3); line-height: 1.7; }

  @media (max-width: 720px) {
    main { padding-left: max(22px, env(safe-area-inset-left, 0px)); padding-right: max(22px, env(safe-area-inset-right, 0px)); }
  }

  /* ── Write-up additions ── */
  .meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
  .meta-row .updated { margin-bottom: 0; }
  .pill {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text2);
    background: var(--bg2);
    border: 0.5px solid var(--border);
    border-radius: 6px;
    padding: 2px 8px;
  }
  .result {
    display: flex; align-items: center; gap: 20px;
    background: var(--bg2);
    border: 0.5px solid var(--border);
    border-left: 3px solid var(--orange);
    border-radius: 12px;
    padding: 18px 20px;
    margin: 24px 0 8px;
  }
  .grade {
    font-family: var(--font-display); font-weight: 700; font-size: 34px;
    color: var(--orange); line-height: 1; flex-shrink: 0;
  }
  .result p { margin: 0; font-size: 14px; }
  code {
    font-family: var(--font-mono);
    font-size: 0.86em;
    color: var(--text);
    background: var(--bg2);
    border: 0.5px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    overflow-wrap: anywhere;
  }
  pre {
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg2);
    border: 0.5px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    margin: 0 0 18px;
    overflow-x: auto;
    white-space: pre;
  }
  pre code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; }
  .table-wrap { overflow-x: auto; margin: 0 0 18px; }
  table { width: 100%; border-collapse: collapse; font-size: 14px; }
  th, td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 0.5px solid var(--border); }
  th { font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text3); }
  td:first-child { white-space: nowrap; }
  .back { font-family: var(--font-mono); font-size: 12px; display: inline-block; margin-top: 40px; }
  /* Numbered steps (ordered lists) - mono counter in place of the dash */
  main ol { list-style: none; counter-reset: step; margin: 0 0 16px 0; display: flex; flex-direction: column; gap: 10px; }
  main ol > li { counter-increment: step; padding-left: 30px; }
  main ol > li::before { content: counter(step, decimal-leading-zero); font-family: var(--font-mono); font-size: 12px; top: 2px; }
  @media (max-width: 600px) {
    thead { display: none; }
    table, tbody, tr, td { display: block; width: 100%; }
    tr { padding: 12px 0; border-bottom: 0.5px solid var(--border); }
    td { border: 0; padding: 0; }
    td:first-child { white-space: normal; margin-bottom: 6px; }
  }
