:root {
  --bg: #f4f8f5;
  --surface: #ffffff;
  --ink: #10231a;
  --text: #2a3c33;
  --muted: #546860;
  --line: #d7e1db;
  --line-soft: #e7eeea;
  --accent: #1a6b3f;
  --accent-strong: #134f2e;
  --on-accent: #ffffff;
  --sel: #def1e5;
  --code: #edf3ef;
  --bad: #b3261e;
  --bad-bg: #fbe9e7;
  --font-ui: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-read: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1512;
    --surface: #131d19;
    --ink: #e8f1ec;
    --text: #c9d8d0;
    --muted: #93a79c;
    --line: #243229;
    --line-soft: #1a2620;
    --accent: #52c493;
    --accent-strong: #7ad8ae;
    --on-accent: #0b1a13;
    --sel: #14352a;
    --code: #17231d;
    --bad: #ff9b92;
    --bad-bg: #3a1c19;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1512;
  --surface: #131d19;
  --ink: #e8f1ec;
  --text: #c9d8d0;
  --muted: #93a79c;
  --line: #243229;
  --line-soft: #1a2620;
  --accent: #52c493;
  --accent-strong: #7ad8ae;
  --on-accent: #0b1a13;
  --sel: #14352a;
  --code: #17231d;
  --bad: #ff9b92;
  --bad-bg: #3a1c19;
  color-scheme: dark;
}

/* topic tile colours */
.t-excel { --tile-bg: #dff1e6; --tile-ink: #14573a; }
.t-power-query { --tile-bg: #dcedf1; --tile-ink: #0b5a69; }
.t-power-bi { --tile-bg: #fbf0c0; --tile-ink: #5f4a00; }
.t-logistics { --tile-bg: #e4e8f7; --tile-ink: #2d3d8c; }
.t-start { --tile-bg: #10231a; --tile-ink: #e3f4ea; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .t-excel { --tile-bg: #153526; --tile-ink: #8fe0b8; }
  :root:not([data-theme="light"]) .t-power-query { --tile-bg: #123239; --tile-ink: #8bd3e2; }
  :root:not([data-theme="light"]) .t-power-bi { --tile-bg: #3a3108; --tile-ink: #f2d65a; }
  :root:not([data-theme="light"]) .t-logistics { --tile-bg: #1d2548; --tile-ink: #a9b8f5; }
  :root:not([data-theme="light"]) .t-start { --tile-bg: #e3f4ea; --tile-ink: #10231a; }
}
:root[data-theme="dark"] .t-excel { --tile-bg: #153526; --tile-ink: #8fe0b8; }
:root[data-theme="dark"] .t-power-query { --tile-bg: #123239; --tile-ink: #8bd3e2; }
:root[data-theme="dark"] .t-power-bi { --tile-bg: #3a3108; --tile-ink: #f2d65a; }
:root[data-theme="dark"] .t-logistics { --tile-bg: #1d2548; --tile-ink: #a9b8f5; }
:root[data-theme="dark"] .t-start { --tile-bg: #e3f4ea; --tile-ink: #10231a; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 18px/1.7 var(--font-read);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
img, svg { max-width: 100%; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 6px; z-index: 50; font: 600 15px var(--font-ui); }
.skip:focus { left: 12px; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 21px/1 var(--font-ui); letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand svg { width: 24px; height: 24px; flex: none; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { font: 500 15.5px var(--font-ui); color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 8px; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--line-soft); color: var(--ink); }
.theme-btn { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; cursor: pointer; margin-left: 6px; }
.theme-btn:hover { border-color: var(--accent); }
.theme-btn svg { width: 18px; height: 18px; }
#progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; z-index: 40; }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 56px; align-items: center; padding: 64px 0 44px; }
.hero h1 { font: 800 clamp(2.3rem, 5.2vw, 3.7rem)/1.04 var(--font-ui); letter-spacing: -0.03em; color: var(--ink); margin: 0 0 20px; }
.hero-sub { font-size: 1.22rem; line-height: 1.6; color: var(--muted); margin: 0 0 28px; max-width: 30em; }
.hero-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px; }
.btn { display: inline-block; background: var(--accent); color: var(--on-accent); font: 600 16.5px/1 var(--font-ui); padding: 15px 22px; border-radius: 10px; text-decoration: none; }
.btn:hover { background: var(--accent-strong); color: var(--on-accent); }
.link { font: 600 16.5px var(--font-ui); color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

/* worksheet mock */
.sheet { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 24px 48px -30px rgba(16, 35, 26, 0.45); }
.sheet-bar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--line-soft); border-bottom: 1px solid var(--line); }
.namebox { font: 500 13px var(--font-mono); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 2px 12px; color: var(--ink); }
.fx { font: italic 600 15px var(--font-read); color: var(--muted); }
.formula { font: 400 12.5px var(--font-mono); background: none; padding: 0; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sheet-scroll { padding: 0 7px 7px 0; overflow-x: auto; }
.grid { border-collapse: collapse; width: 100%; table-layout: fixed; font: 400 14px var(--font-ui); color: var(--text); }
.grid th { background: var(--line-soft); color: var(--muted); font-weight: 500; font-size: 12.5px; border: 1px solid var(--line); padding: 5px 8px; text-align: center; }
.grid thead th:first-child, .grid tbody th { width: 2.2rem; }
.grid td { border: 1px solid var(--line); padding: 10px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid td.n { text-align: right; font-variant-numeric: tabular-nums; }
.grid td.hd { font-weight: 700; color: var(--ink); }
.grid td.sel { position: relative; overflow: visible; background: var(--bad-bg); color: var(--bad); font-weight: 700; outline: 2px solid var(--accent); outline-offset: -2px; animation: pick 0.7s 0.5s ease-out both; }
.handle { position: absolute; right: -4px; bottom: -4px; width: 8px; height: 8px; background: var(--accent); border: 1px solid var(--surface); }
@keyframes pick { from { outline-color: transparent; background: transparent; color: var(--text); } }
.sheet-tabs { display: flex; padding: 0 12px; background: var(--line-soft); border-top: 1px solid var(--line); font: 500 13.5px var(--font-ui); }
.sheet-tabs span { padding: 8px 16px; color: var(--muted); border-bottom: 2px solid transparent; }
.sheet-tabs .on { background: var(--surface); color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }
.sheet figcaption { padding: 13px 16px; font: 400 15px/1.5 var(--font-ui); color: var(--muted); border-top: 1px solid var(--line); }

/* sections */
.section { padding: 44px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section h2, .page-head h1 { font: 800 clamp(1.6rem, 3.2vw, 2.1rem)/1.15 var(--font-ui); letter-spacing: -0.02em; color: var(--ink); margin: 0; }
.section-sub { color: var(--muted); margin: 6px 0 0; font-size: 1.05rem; }
.more { font: 600 15.5px var(--font-ui); }

.topics { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.topics a { display: inline-flex; gap: 9px; align-items: baseline; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: 600 15.5px var(--font-ui); color: var(--ink); text-decoration: none; }
.topics a:hover, .topics a[aria-current="page"] { border-color: var(--accent); background: var(--sel); color: var(--ink); }
.topics span { color: var(--muted); font-weight: 500; }

/* learning path */
.steps { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 3px solid var(--ink); }
.steps li { padding: 22px 28px 8px 0; margin-right: 28px; border-right: 1px solid var(--line); }
.steps li:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.step-n { display: block; font: 800 2.6rem/1 var(--font-ui); letter-spacing: -0.04em; color: var(--accent); margin-bottom: 10px; }
.steps h3 { font: 700 1.3rem/1.2 var(--font-ui); color: var(--ink); margin: 0 0 8px; letter-spacing: -0.01em; }
.steps p { margin: 0 0 12px; font-size: 1rem; color: var(--muted); line-height: 1.6; }
.steps ul { list-style: none; margin: 0 0 14px; padding: 0; }
.steps li li { border: 0; margin: 0; padding: 4px 0; font: 500 15.5px/1.4 var(--font-ui); }

/* guide list */
.guides { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.guide { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 6px 22px; padding: 22px 0; border-bottom: 1px solid var(--line); align-items: start; }
.guide[hidden] { display: none; }
.tile { width: 80px; height: 80px; border-radius: 12px; display: grid; place-items: center; padding: 4px; text-align: center; background-color: var(--tile-bg); color: var(--tile-ink); --tl: color-mix(in srgb, var(--tile-ink) 14%, transparent); background-image: linear-gradient(var(--tl) 1px, transparent 1px), linear-gradient(90deg, var(--tl) 1px, transparent 1px); background-size: 12px 12px; border: 1px solid color-mix(in srgb, var(--tile-ink) 22%, transparent); }
.tile span { font: 500 9px/1.15 var(--font-mono); background: var(--tile-bg); outline: 1.5px solid var(--tile-ink); padding: 3px 3px; max-width: 100%; white-space: nowrap; letter-spacing: -0.02em; }
.guide h3 { margin: 0 0 4px; font: 700 clamp(1.15rem, 2.2vw, 1.4rem)/1.25 var(--font-ui); letter-spacing: -0.015em; }
.guide h3 a { color: var(--ink); text-decoration: none; }
.guide h3 a:hover { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; }
.guide .dek { margin: 0; font-size: 1rem; line-height: 1.6; color: var(--muted); max-width: 40em; }
.g-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font: 500 14.5px var(--font-ui); color: var(--muted); white-space: nowrap; padding-top: 3px; }
.g-meta a { color: var(--ink); font-weight: 600; text-decoration: none; }
.g-meta a:hover { color: var(--accent); }

.search { margin: 22px 0 18px; }
.search input { width: 100%; max-width: 420px; font: 500 16px var(--font-ui); padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.search input:focus-visible { outline-offset: 1px; }
.empty { display: none; padding: 22px 0; font: 500 16px var(--font-ui); color: var(--muted); }
.page-head { padding: 52px 0 20px; }
.page-head p { color: var(--muted); font-size: 1.15rem; max-width: 36em; margin: 12px 0 0; }

/* author */
.author { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 18px; align-items: start; }
.avatar { position: relative; width: 44px; height: 44px; display: grid; place-items: center; font: 800 20px var(--font-ui); color: var(--accent); border: 2px solid var(--accent); background: var(--surface); flex: none; }
.avatar::after { content: ""; position: absolute; right: -5px; bottom: -5px; width: 8px; height: 8px; background: var(--accent); border: 1px solid var(--bg); }
.author h3 { margin: 0 0 4px; font: 700 1.15rem var(--font-ui); color: var(--ink); }
.author p { margin: 0; font-size: 1rem; line-height: 1.6; color: var(--muted); max-width: 38em; }
.author-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 30px 0; }

/* post */
.post-head { padding: 48px 0 8px; max-width: 46rem; }
.crumbs { font: 500 15px var(--font-ui); color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.post-head h1 { font: 800 clamp(2rem, 4.6vw, 3.1rem)/1.08 var(--font-ui); letter-spacing: -0.028em; color: var(--ink); margin: 0 0 16px; }
.post-dek { font-size: 1.3rem; line-height: 1.55; color: var(--muted); margin: 0 0 24px; }
.byline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 22px; font: 500 15px var(--font-ui); color: var(--muted); }
.byline .who { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 700; }
.byline .avatar { width: 32px; height: 32px; font-size: 15px; border-width: 2px; }
.byline .avatar::after { width: 6px; height: 6px; right: -4px; bottom: -4px; }
.post-layout { display: grid; grid-template-columns: minmax(0, 42rem) 230px; gap: 72px; padding: 28px 0 24px; }
.toc { position: sticky; top: 86px; align-self: start; font: 500 14.5px/1.4 var(--font-ui); max-height: calc(100vh - 110px); overflow: auto; }
.toc strong { display: block; color: var(--ink); font-weight: 700; margin-bottom: 10px; font-size: 15px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--accent); border-left-color: var(--accent); font-weight: 700; }
.toc-m { display: none; margin: 0 0 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: 500 15.5px var(--font-ui); }
.toc-m summary { padding: 12px 16px; cursor: pointer; font-weight: 700; color: var(--ink); }
.toc-m ol { margin: 0; padding: 0 16px 12px 36px; }
.toc-m li { padding: 4px 0; }

.prose { font-size: 1.1875rem; line-height: 1.78; color: var(--text); }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15em; }
.prose h1 { font: 800 2.4rem/1.1 var(--font-ui); letter-spacing: -0.025em; color: var(--ink); margin: 0 0 20px; }
.prose h2 { font: 800 1.75rem/1.2 var(--font-ui); letter-spacing: -0.02em; color: var(--ink); margin: 2.1em 0 0.55em; scroll-margin-top: 90px; }
.prose h3 { font: 700 1.3rem/1.3 var(--font-ui); letter-spacing: -0.01em; color: var(--ink); margin: 1.7em 0 0.4em; }
.prose li { margin-bottom: 0.4em; }
.prose strong { color: var(--ink); }
.prose .lead { font-size: 1.32rem; line-height: 1.6; color: var(--ink); }
.prose code { font: 400 0.82em var(--font-mono); background: var(--code); padding: 2px 6px; border-radius: 5px; color: var(--ink); overflow-wrap: anywhere; }
.prose pre { position: relative; margin: 0 0 1.4em; padding: 18px 20px; background: var(--code); border-left: 3px solid var(--accent); border-radius: 4px 10px 10px 4px; overflow-x: auto; line-height: 1.6; font-size: 15px; }
.prose pre code { background: none; padding: 0; font-size: 14.5px; overflow-wrap: normal; }
.copy { position: absolute; top: 8px; right: 8px; font: 600 12.5px var(--font-ui); border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.copy:hover { color: var(--ink); border-color: var(--accent); }
.prose .tablewrap { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--line); border-radius: 10px; }
.prose table { border-collapse: collapse; width: 100%; font: 400 15.5px/1.45 var(--font-ui); }
.prose th { background: var(--line-soft); color: var(--ink); font-weight: 700; text-align: left; }
.prose th, .prose td { padding: 10px 14px; border: 1px solid var(--line); vertical-align: top; }
.prose .tablewrap tr:first-child > * { border-top: 0; }
.prose .tablewrap tr > :first-child { border-left: 0; }
.prose .tablewrap tr > :last-child { border-right: 0; }
.prose .tablewrap tr:last-child > * { border-bottom: 0; }
.prose .box { background: var(--sel); border-left: 4px solid var(--accent); border-radius: 4px 10px 10px 4px; padding: 16px 20px; margin: 1.8em 0; font: 400 16.5px/1.6 var(--font-ui); color: var(--text); }
.prose .box strong { display: block; margin-bottom: 4px; font-size: 17px; }
.prose a { text-decoration-thickness: 1.5px; }

.after-post { padding: 8px 0 56px; }
.next h2 { font: 800 1.5rem var(--font-ui); letter-spacing: -0.02em; color: var(--ink); margin: 0 0 14px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 44px 0 36px; background: var(--surface); font: 400 15.5px/1.6 var(--font-ui); color: var(--muted); }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 36px; }
.site-footer h2 { font: 700 15px var(--font-ui); color: var(--ink); margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 3px 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer .brand { margin-bottom: 12px; }
.foot-note { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; }
.narrow { max-width: 42rem; padding: 52px 0 24px; }
.notfound { padding: 90px 0; max-width: 34rem; }
.notfound h1 { font: 800 2.4rem var(--font-ui); color: var(--ink); letter-spacing: -0.025em; margin: 0 0 12px; }

@media (max-width: 1080px) {
  .post-layout { grid-template-columns: minmax(0, 42rem); gap: 0; }
  .toc { display: none; }
  .toc-m { display: block; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding: 40px 0 28px; }
  .steps { grid-template-columns: minmax(0, 1fr); border-top: 0; }
  .steps li { border-right: 0; margin: 0; padding: 20px 0 8px 22px; border-left: 3px solid var(--ink); border-bottom: 0; }
  .steps li + li { margin-top: 12px; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .container { padding: 0 16px; }
  .section { padding: 32px 0; }
  .nav a { padding: 8px 9px; font-size: 15px; }
  .nav .hide-s { display: none; }
  .guide { grid-template-columns: 56px minmax(0, 1fr); gap: 4px 16px; padding: 18px 0; }
  .tile { width: 60px; height: 60px; border-radius: 10px; padding: 2px; }
  .tile span { font-size: 7px; padding: 2px 2px; }
  .g-meta { grid-column: 2; flex-direction: row; align-items: baseline; gap: 14px; padding-top: 4px; }
  .post-head { padding-top: 32px; }
  .prose { font-size: 1.0625rem; }
  .prose h2 { font-size: 1.5rem; }
  .sheet-bar { padding: 8px 10px; }
  .grid td { padding: 9px 8px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .site-header, .site-footer, .toc, .toc-m, #progress, .copy, .theme-btn { display: none !important; }
  body { background: #fff; color: #000; }
}
