:root{
    --bg: #12121a;
    --bg-alt: #17171f;
    --panel: #1c1c28;
    --panel-alt: #20212e;
    --line: #2c2d3d;
    --text: #e9e9f2;
    --muted: #9497a8;
    --local: #ffb454;      /* Git Bash / lokaal */
    --local-dim: #4a3a20;
    --remote: #5eead4;     /* GitHub / online */
    --remote-dim: #1c3e3a;
    --install: #c4b5fd;    /* installatiewizard op Windows */
    --install-dim: #362f52;
    --warn: #ff8080;
    --warn-dim: #3a2222;
    --heading: #ffffff;
    --radius: 10px;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
    --sans: 'Work Sans', system-ui, sans-serif;
    --shadow: 0 6px 20px rgba(0,0,0,0.35);
  }

  html[data-theme="light"]{
    --bg: #f1f2f6;
    --bg-alt: #e7e9f0;
    --panel: #ffffff;
    --panel-alt: #eef0f5;
    --line: #d7dae3;
    --text: #1c1d27;
    --muted: #52566a;
    --local: #b6650a;
    --local-dim: #fdecd3;
    --remote: #0f8f7d;
    --remote-dim: #d9f7f0;
    --install: #6d4fd6;
    --install-dim: #ece7fb;
    --warn: #c93838;
    --warn-dim: #ffe1e1;
    --heading: #101119;
    --shadow: 0 6px 20px rgba(28,29,39,0.08);
  }
  html[data-theme="light"] .hero{
    background:
      radial-gradient(1100px 480px at 12% -10%, #e2e5f4 0%, transparent 60%),
      var(--bg);
  }
  html[data-theme="light"] .navdot::before{ background: var(--bg-alt); }
  html[data-theme="light"] .box.warn{ background: #fff3f3; }

  *{ box-sizing: border-box; }
  html{ scroll-behavior: smooth; }
  body{ transition: background-color 0.2s ease, color 0.2s ease; }
  @media (prefers-reduced-motion: reduce){ html{ scroll-behavior: auto; } *{ transition: none !important; animation: none !important; } }

  body{
    margin:0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.65;
    font-size: 16.5px;
  }

  a{ color: var(--remote); }
  a:focus-visible, button:focus-visible, .navdot:focus-visible{
    outline: 2px solid var(--local);
    outline-offset: 3px;
  }

  h1,h2,h3{ font-family: var(--mono); font-weight: 700; letter-spacing: -0.01em; margin: 0; }

  /* ---------- HERO ---------- */
  .hero{
    position: relative;
    padding: 4.5rem 2rem 5rem;
    background:
      radial-gradient(1100px 480px at 12% -10%, #24263a 0%, transparent 60%),
      var(--bg);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
  }
  .hero-inner{
    max-width: 980px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2.5rem;
    align-items: center;
  }
  .eyebrow{
    font-family: var(--mono);
    color: var(--local);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.9rem;
  }
  .hero h1{
    font-size: clamp(2.1rem, 4vw, 3.1rem);
    line-height: 1.12;
    color: var(--heading);
  }
  .hero h1 span{ color: var(--remote); }
  .hero p.lede{
    font-size: 1.08rem;
    color: var(--muted);
    max-width: 46ch;
    margin-top: 1.1rem;
  }
  .hero-meta{
    margin-top: 1.6rem;
    display: flex;
    gap: 1.4rem;
    flex-wrap: wrap;
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--muted);
  }
  .hero-meta b{ color: var(--text); }

  .branch-art{ width: 100%; height: auto; }
  .branch-art text{ fill: var(--muted); }
  .branch-art .connector{ stroke: var(--line); }

  /* ---------- LAYOUT ---------- */
  .layout{
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 0;
    align-items: start;
  }

  /* ---------- GIT-GRAPH NAV (signature element) ---------- */
  .graph-nav{
    position: sticky;
    top: 0;
    align-self: start;
    padding: 3rem 1.2rem 3rem 2rem;
    max-height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
  }
  .graph-nav::-webkit-scrollbar{ width: 3px; }
  .graph-nav::-webkit-scrollbar-track{ background: transparent; }
  .graph-nav::-webkit-scrollbar-thumb{ background: var(--line); border-radius: 3px; }
  .graph-nav::-webkit-scrollbar-thumb:hover{ background: var(--muted); }
  .graph-nav h3{
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1.1rem;
  }
  .graph-list{ list-style:none; margin:0; padding:0; position: relative; }
  .graph-list::before{
    content:"";
    position:absolute;
    left: 5px;
    top: 6px;
    bottom: 18px;
    width: 2px;
    background: var(--line);
  }
  .graph-item{ position: relative; padding-left: 1.6rem; margin-bottom: 1.05rem; }
  .navdot{
    display:block;
    text-decoration:none;
    color: var(--muted);
    font-family: var(--mono);
  }
  .navdot::before{
    content:"";
    position:absolute;
    left: 0px;
    top: 4px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--bg-alt);
    border: 2px solid var(--line);
  }
  .navdot.active::before, .navdot:hover::before{
    border-color: var(--local);
    background: var(--local);
  }
  .navdot .hash{ font-size: 0.68rem; color: var(--muted); display:block; }
  .navdot .msg{ font-size: 0.82rem; color: var(--text); display:block; margin-top: 1px; }
  .navdot:hover .msg, .navdot.active .msg{ color: var(--local); }

  /* ---------- MAIN CONTENT ---------- */
  main{ padding: 3rem 2rem 6rem; min-width: 0; }
  section.chapter{
    padding-bottom: 3.4rem;
    margin-bottom: 3.4rem;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: 4.5rem;
  }
  section.chapter:last-of-type{ border-bottom: none; }

  .chapter-label{
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
  }
  .chapter-label .n{ color: var(--local); font-weight: 700; }
  section.chapter h2{ font-size: 1.55rem; color: var(--heading); margin-bottom: 1rem; }

  p{ margin: 0 0 1rem; color: var(--text); }
  section.chapter > p:first-of-type{ margin-top: 0; }
  strong{ color: var(--heading); }
  ul, ol{ margin: 0 0 1.1rem; padding-left: 1.3rem; }
  li{ margin-bottom: 0.4rem; }

  /* ---------- TERMINAL BLOCK ---------- */
  .terminal{
    background: #0c0c12;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 1.2rem 0 1.4rem;
  }
  .terminal .bar{
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    padding: 0 0 0 0.8rem;
    background: var(--panel-alt);
    border-bottom: 1px solid var(--line);
  }
  .terminal .bar span{
    flex: 0 0 auto;
    width: 32px;
    border-radius: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--sans);
    font-size: 0.78rem;
    color: var(--muted);
    cursor: default;
    user-select: none;
    transition: background 0.1s;
  }
  .terminal .bar span:nth-child(1)::after{ content: '\2013'; }  /* – minimize */
  .terminal .bar span:nth-child(2)::after{ content: '\25A1'; }  /* □ maximize */
  .terminal .bar span:nth-child(3)::after{ content: '\00D7'; font-size: 0.95rem; }
  .terminal .bar span:hover{ background: rgba(255,255,255,0.07); }
  .terminal .bar span:nth-child(3):hover{ background: #c42b1c; color: #fff; }
  .terminal .bar .label{
    flex: 1 1 auto;
    min-width: 0;
    order: -1;
    padding: 0.42rem 0;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .terminal.local .bar .label{ color: #ffb454; }
  .terminal.remote .bar .label{ color: #5eead4; }
  .terminal pre{
    margin:0;
    padding: 1rem 1.1rem;
    font-family: var(--mono);
    font-size: 0.86rem;
    line-height: 1.75;
    overflow-x: auto;
    color: #d7d8e2;
  }
  /* De terminal zelf heeft altijd een donkere achtergrond, ongeacht het thema —
     daarom blijven deze accentkleuren vast in plaats van mee te schakelen. */
  .terminal .prompt{ color: #ffb454; }
  .terminal .comment{ color: #8a8ea1; }
  .terminal .out{ color: #8f93a8; }

  /* ---------- INFO BOXES ---------- */
  .box{
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    margin: 1.2rem 0;
    border-left: 3px solid var(--line);
    background: var(--panel);
  }
  .box .box-title{
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
    display:block;
  }
  .box p:last-child{ margin-bottom: 0; }
  .box.tip{ border-color: var(--local); }
  .box.tip .box-title{ color: var(--local); }
  .box.warn{ border-color: var(--warn); background: #201417; }
  .box.warn .box-title{ color: var(--warn); }
  .box.term{ border-color: var(--remote); }
  .box.term .box-title{ color: var(--remote); }

  /* ---------- TAG (actie-markering: waar moet de leerling iets doen?) ---------- */
  .tag{
    display:inline-flex;
    align-items:center;
    gap: 0.35rem;
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.22rem 0.6rem 0.22rem 0.5rem;
    border-radius: 20px;
    margin-bottom: 0.7rem;
  }
  .tag::before{
    content: "";
    flex: 0 0 auto;
    width: 13px; height: 13px;
    background-color: currentColor;
  }
  .tag.local{ background: var(--local-dim); color: var(--local); }
  .tag.remote{ background: var(--remote-dim); color: var(--remote); }
  .tag.install{ background: var(--install-dim); color: var(--install); }
  /* Toetsenbord-icoon: "typ dit in Git Bash" */
  .tag.local::before{
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="5" width="20" height="14" rx="2"></rect><path d="M6 9h.01M10 9h.01M14 9h.01M18 9h.01M6 13h.01M18 13h.01M9 13h6"></path></svg>') center / contain no-repeat;
            mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="5" width="20" height="14" rx="2"></rect><path d="M6 9h.01M10 9h.01M14 9h.01M18 9h.01M6 13h.01M18 13h.01M9 13h6"></path></svg>') center / contain no-repeat;
  }
  /* Cursor-icoon: "klik dit aan op de website" */
  .tag.remote::before{
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black"><path d="M4 3l16 7-6.5 2.5L11 19z"></path></svg>') center / contain no-repeat;
            mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black"><path d="M4 3l16 7-6.5 2.5L11 19z"></path></svg>') center / contain no-repeat;
  }
  /* Download-icoon: "installeer dit op je computer" */
  .tag.install::before{
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3v12"></path><path d="M7 10l5 5 5-5"></path><path d="M4 19h16"></path></svg>') center / contain no-repeat;
            mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3v12"></path><path d="M7 10l5 5 5-5"></path><path d="M4 19h16"></path></svg>') center / contain no-repeat;
  }

  /* ---------- STAPPENLIJST (genummerde actie-chips) ---------- */
  ol.steps{ list-style:none; padding-left:0; margin: 0 0 1.2rem; counter-reset: step; }
  ol.steps li{
    counter-increment: step;
    position: relative;
    padding-left: 2.3rem;
    margin-bottom: 0.7rem;
  }
  ol.steps li::before{
    content: counter(step);
    position:absolute;
    left:0; top: -0.05rem;
    width: 1.6rem; height: 1.6rem;
    border-radius: 50%;
    display:flex; align-items:center; justify-content:center;
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--panel-alt);
    border: 1px solid var(--line);
    color: var(--text);
  }

  /* ---------- STAGING DIAGRAM ---------- */
  .flow{
    display:flex;
    align-items: stretch;
    gap: 0;
    margin: 1.4rem 0;
    flex-wrap: wrap;
  }
  .flow-box{
    flex: 1 1 160px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    text-align:center;
  }
  .flow-box .ft{ font-family: var(--mono); font-weight:700; color: var(--heading); font-size:0.92rem; }
  .flow-box .fc{ font-family: var(--mono); font-size:0.74rem; color: var(--local); margin-top:0.3rem; }
  .flow-box .fd{ font-size: 0.82rem; color: var(--muted); margin-top: 0.5rem; }
  .flow-arrow{
    display:flex; align-items:center; justify-content:center;
    padding: 0 0.6rem;
    color: var(--muted);
    font-family: var(--mono);
    min-width: 40px;
  }

  /* ---------- TABLE (cheatsheet) ---------- */
  table{ width:100%; border-collapse: collapse; margin: 1rem 0 1.6rem; font-size: 0.92rem; }
  th, td{ text-align:left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
  th{ font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
  td code, .inline-cmd{
    font-family: var(--mono);
    background: var(--panel-alt);
    color: var(--local);
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    font-size: 0.86rem;
  }
  .cheat-group{ margin-top: 2rem; }
  .cheat-group h3{ font-size: 1rem; color: var(--remote); margin-bottom: 0.4rem; }

  footer{
    border-top: 1px solid var(--line);
    padding: 2.4rem 2rem;
    text-align:center;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.78rem;
  }

  /* ---------- TOPBAR ---------- */
  .topbar{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 2rem;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .topbar-brand{
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
  }
  .topbar-name{
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--heading);
  }
  .topbar-email{
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--muted);
  }
  .topbar-actions{
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }
  a.logout{
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--warn);
    text-decoration: none;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--warn-dim);
    background: transparent;
    transition: background 0.15s;
  }
  a.logout:hover{ background: var(--warn-dim); }

  /* ---------- THEME TOGGLE ---------- */
  .theme-toggle{
    position: fixed;
    top: 1.1rem;
    right: 1.1rem;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.72rem;
    cursor: pointer;
    box-shadow: var(--shadow);
  }
  .theme-toggle:hover{ border-color: var(--local); }
  .theme-toggle svg{ width: 15px; height: 15px; display: block; }
  .theme-toggle .icon-sun{ color: var(--local); display: none; }
  .theme-toggle .icon-moon{ color: var(--remote); display: block; }
  html[data-theme="light"] .theme-toggle .icon-sun{ display: block; }
  html[data-theme="light"] .theme-toggle .icon-moon{ display: none; }
  /* when the toggle lives inside .topbar, remove fixed positioning */
  .topbar .theme-toggle{ position: static; box-shadow: none; }
  @media (max-width: 880px){
    .theme-toggle .label{ display:none; }
  }

  /* ---------- MOBILE TOC ---------- */
  .mobile-toc{ display:none; }

  @media (max-width: 880px){
    .topbar{ padding: 0.55rem 1.2rem; }
    .topbar-email{ display: none; }
    a.logout .logout-label{ display: none; }
    .hero-inner{ grid-template-columns: 1fr; }
    .branch-art{ max-width: 260px; }
    .layout{ grid-template-columns: 1fr; }
    .graph-nav{ display:none; }
    .mobile-toc{
      display:block;
      position: sticky; top:0; z-index:5;
      background: var(--bg-alt);
      border-bottom: 1px solid var(--line);
      padding: 0.7rem 1.2rem;
    }
    .mobile-toc select{
      width:100%;
      background: var(--panel);
      color: var(--text);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 0.6rem 0.7rem;
      font-family: var(--mono);
      font-size: 0.82rem;
    }
    main{ padding: 2rem 1.2rem 4rem; }
    .flow{ flex-direction: column; }
    .flow-arrow{ transform: rotate(90deg); padding: 0.3rem 0; }
  }