@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Commit Mono";
  src: url("fonts/commit-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Commit Mono";
  src: url("fonts/commit-mono-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* Colour carries meaning: cobalt = personal identity, ochre = work identity, green = Verified. */
:root {
  --paper: #f4f6f9;
  --surface: #ffffff;
  --ink: #142036;
  --muted: #556073;
  --line: #dce2ea;
  --personal: #2d5be3;
  --personal-soft: #e6ecfd;
  --work: #9a5a06;
  --work-soft: #fbefdc;
  --verified: #15783f;
  --verified-soft: #e1f3e8;
  --unverified: #b42318;
  --code-bg: #101b2d;
  --code-ink: #dce4f0;
  --code-muted: #8391a8;
  --code-personal: #9db8ff;
  --code-work: #f2b75e;
  --focus: #2d5be3;
  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "Commit Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --measure: 46rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1422;
    --surface: #131c2e;
    --ink: #e6ebf3;
    --muted: #9aa5b8;
    --line: #24314a;
    --personal: #86a6ff;
    --personal-soft: #18254a;
    --work: #e9aa4e;
    --work-soft: #33240e;
    --verified: #4cc785;
    --verified-soft: #10301f;
    --unverified: #ff8a7a;
    --code-bg: #0a101c;
    --focus: #86a6ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  font-feature-settings: "ss01";
  text-rendering: optimizeLegibility;
}
a { color: var(--personal); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
img { max-width: 100%; height: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: 76rem; margin: 0 auto; padding: 0.7rem 1.25rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -0.01em; flex: none; }
.brand svg { width: 30px; height: 30px; flex: none; }
.top nav { display: flex; gap: 1.25rem; margin-left: auto; font-size: 0.95rem; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); }
.top .star {
  border: 1px solid var(--line); border-radius: 999px; padding: 0.25rem 0.8rem;
  color: var(--ink); background: var(--surface);
}

/* Layout */
.shell { max-width: 76rem; margin: 0 auto; padding: 0 1.25rem; display: grid; grid-template-columns: 14.5rem minmax(0, 1fr); gap: 3.5rem; }
.side { position: sticky; top: 4.4rem; align-self: start; max-height: calc(100vh - 5rem); overflow: auto; padding: 2.2rem 0 2rem; font-size: 0.94rem; }
.side summary { display: none; }
.side h2 { font-size: 0.82rem; font-weight: 650; color: var(--muted); margin: 1.4rem 0 0.4rem; letter-spacing: 0.01em; }
.side h2:first-of-type { margin-top: 0; }
.side ol { list-style: none; margin: 0; padding: 0; }
.side a { display: flex; gap: 0.55rem; padding: 0.28rem 0.6rem; margin-left: -0.6rem; border-radius: 6px; color: var(--ink); text-decoration: none; }
.side a:hover { background: var(--surface); }
.side a[aria-current="page"] { background: var(--surface); box-shadow: inset 2px 0 0 var(--personal); font-weight: 600; }
.side .n { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); min-width: 1ch; padding-top: 0.15rem; }

main { min-width: 0; padding: 2.2rem 0 4rem; }
.prose { max-width: var(--measure); }
.crumbs { font-size: 0.9rem; color: var(--muted); margin: 0 0 0.75rem; }
.crumbs a { color: var(--muted); }
.step { display: inline-block; font-size: 0.85rem; font-weight: 600; color: var(--personal); background: var(--personal-soft); padding: 0.1rem 0.6rem; border-radius: 999px; margin-left: 0.4rem; }

/* Prose */
.prose h1 { font-size: clamp(2rem, 1.4rem + 2.2vw, 2.85rem); line-height: 1.1; letter-spacing: -0.025em; font-weight: 760; margin: 0 0 1.1rem; text-wrap: balance; }
.prose h2 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.015em; font-weight: 700; margin: 2.8rem 0 0.8rem; text-wrap: balance; }
.prose h3 { font-size: 1.2rem; line-height: 1.3; font-weight: 660; margin: 2rem 0 0.5rem; }
.prose h2, .prose h3 { position: relative; }
.prose .anchor { position: absolute; left: -1.1em; padding-right: 0.3em; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose .anchor:focus { opacity: 1; }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose li { margin: 0.3rem 0; }
.prose li > p { margin: 0.3rem 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.prose strong { font-weight: 680; }
.prose picture, .prose > p > img { display: block; margin: 1.5rem 0; }
.prose picture img { border-radius: 12px; }

code { font-family: var(--mono); font-size: 0.86em; }
:not(pre) > code {
  background: var(--surface); border: 1px solid var(--line); border-radius: 5px;
  padding: 0.08em 0.35em; white-space: nowrap;
}
td :not(pre) > code { white-space: normal; overflow-wrap: anywhere; }
.prose a code { color: inherit; }

.code { position: relative; margin: 1rem 0 1.4rem; }
pre {
  margin: 0; background: var(--code-bg); color: var(--code-ink);
  border-radius: 10px; padding: 1rem 1.1rem; overflow-x: auto;
  font-size: 0.92rem; line-height: 1.6; tab-size: 4;
}
pre code { font-size: 0.86rem; }
.code .copy {
  position: absolute; top: 0.5rem; right: 0.5rem;
  font: 600 0.78rem var(--sans); color: var(--code-ink); background: #ffffff14;
  border: 1px solid #ffffff26; border-radius: 6px; padding: 0.25rem 0.6rem; cursor: pointer;
  opacity: 0; transition: opacity 0.15s;
}
.code:hover .copy, .code .copy:focus-visible, .code .copy[data-done] { opacity: 1; }
@media (hover: none) { .code .copy { opacity: 1; } }
pre .c { color: var(--code-muted); }
pre .p, pre .w { font-weight: 700; }
pre .p { color: var(--code-personal); }
pre .w { color: var(--code-work); }
code .ph { border-bottom: 1px dashed currentColor; }
:not(pre) > code .p { color: var(--personal); }
:not(pre) > code .w { color: var(--work); }

.table { overflow-x: auto; margin: 1rem 0 1.5rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-weight: 650; font-size: 0.88rem; color: var(--muted); }

blockquote {
  margin: 1.2rem 0; padding: 0.8rem 1rem; border-radius: 10px;
  background: var(--personal-soft); border-left: 3px solid var(--personal);
}
blockquote p:last-child { margin-bottom: 0; }

details { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 0.2rem 1rem; margin: 1rem 0; }
details > summary { cursor: pointer; font-weight: 600; padding: 0.6rem 0; }
details[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 0.8rem; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; max-width: var(--measure); }
.pager a { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem 1rem; text-decoration: none; background: var(--surface); color: var(--ink); }
.pager a:hover { border-color: var(--personal); }
.pager small { display: block; color: var(--muted); font-size: 0.82rem; }
.pager .next { text-align: right; grid-column: 2; }
.edit { margin-top: 2rem; font-size: 0.9rem; color: var(--muted); }
.edit a { color: var(--muted); }

/* Hero */
.hero { border-bottom: 1px solid var(--line); background: var(--surface); }
.hero-in {
  max-width: 76rem; margin: 0 auto; padding: 3.5rem 1.25rem 3.25rem;
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.3fr); gap: 3.5rem; align-items: center;
}
.hero h1 { font-size: clamp(2.2rem, 1.4rem + 2.6vw, 3.3rem); line-height: 1.03; letter-spacing: -0.035em; font-weight: 800; margin: 0 0 1.2rem; text-wrap: balance; }
.hero h1 span { display: block; color: var(--verified); }
.hero .lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 1.8rem; max-width: 34rem; }
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.btn { display: inline-block; padding: 0.7rem 1.2rem; border-radius: 9px; font-weight: 650; text-decoration: none; border: 1px solid var(--line); color: var(--ink); background: var(--paper); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.facts { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin: 1.8rem 0 0; padding: 0; list-style: none; font-size: 0.92rem; color: var(--muted); }
.facts b { color: var(--ink); font-weight: 650; }

/* The trust chain: two accounts -> one key -> Verified commits */
.chain {
  --gap: 1.6rem;
  display: grid; grid-template-columns: 1fr 1.1fr 1.15fr; gap: var(--gap); align-items: center;
  font-size: 0.9rem; position: relative;
}
.chain .col { display: grid; gap: 0.8rem; position: relative; }
.acct, .key, .commit { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem 0.85rem; position: relative; }
.acct { border-left: 4px solid var(--id); }
.acct b { display: block; font-weight: 700; }
.acct small, .commit small { display: block; color: var(--muted); font-family: var(--mono); font-size: 0.76rem; overflow-wrap: anywhere; }
.acct.p, .uid.p, .commit.p { --id: var(--personal); }
.acct.w, .uid.w, .commit.w { --id: var(--work); }
.key { background: var(--ink); color: var(--paper); border-color: var(--ink); padding: 0.9rem; }
.key .k-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; }
.key svg { width: 18px; height: 18px; flex: none; }
.key .fpr { font-family: var(--mono); font-size: 0.72rem; opacity: 0.7; margin: 0.35rem 0 0.6rem; letter-spacing: 0.02em; }
.uid { display: flex; align-items: center; gap: 0.45rem; font-family: var(--mono); font-size: 0.74rem; padding: 0.12rem 0; overflow-wrap: anywhere; }
.uid::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--id); flex: none; }
@media (prefers-color-scheme: dark) { .key { background: #e6ebf3; color: #0d1422; } .uid.p { --id: #2d5be3; } .uid.w { --id: #9a5a06; } }
.commit { border-left: 4px solid var(--id); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 0.6rem; align-items: center; }
.commit .msg { font-weight: 600; }
.commit small { grid-column: 1; }
.badge {
  grid-row: 1 / span 2; grid-column: 2;
  font-size: 0.75rem; font-weight: 700; color: var(--verified); background: var(--verified-soft);
  border: 1px solid color-mix(in srgb, var(--verified) 45%, transparent); border-radius: 999px; padding: 0.12rem 0.55rem;
}
.chain .col + .col::before {
  content: ""; position: absolute; left: calc(var(--gap) * -1); width: var(--gap); top: 50%;
  border-top: 2px dashed color-mix(in srgb, var(--muted) 55%, transparent);
}
@media (prefers-reduced-motion: no-preference) {
  .chain.play .badge { animation: stamp 0.45s cubic-bezier(.2, 1.4, .4, 1) both; }
  .chain.play .commit.p .badge { animation-delay: 0.55s; }
  .chain.play .commit.w .badge { animation-delay: 0.85s; }
  @keyframes stamp { from { opacity: 0; transform: scale(1.6) rotate(-6deg); } to { opacity: 1; transform: none; } }
}

/* Home sections */
.home-faq details { margin: 0.6rem 0; }
.home-faq details p { margin: 0 0 0.8rem; }

footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 0.92rem; }
.foot { max-width: 76rem; margin: 0 auto; padding: 2rem 1.25rem; display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; justify-content: space-between; }
footer a { color: var(--muted); }

@media (max-width: 960px) {
  .hero-in { grid-template-columns: 1fr; gap: 2.5rem; padding-top: 2.5rem; }
  .shell { grid-template-columns: 1fr; gap: 0; }
  .side { position: static; max-height: none; padding: 1rem 0 0; }
  .side details.pages { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 0 1rem; }
  .side summary { display: block; }
  .top nav .hide-sm { display: none; }
}
@media (min-width: 961px) {
  .side details.pages { border: 0; background: none; padding: 0; margin: 0; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .top-in { padding: 0.6rem 1rem; gap: 0.8rem; }
  .brand span { display: none; }
  .top nav { gap: 0.9rem; font-size: 0.9rem; }
  .shell, .hero-in, .foot { padding-left: 1rem; padding-right: 1rem; }
  .chain { grid-template-columns: 1fr; --gap: 1.6rem; }
  .chain .col + .col::before { left: 50%; top: calc(var(--gap) * -1); height: var(--gap); width: 0; border-top: 0; border-left: 2px dashed color-mix(in srgb, var(--muted) 55%, transparent); }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .prose .anchor { display: none; }
}
@media print {
  .top, .side, .pager, .edit, footer, .copy { display: none !important; }
  .shell { display: block; }
  pre { white-space: pre-wrap; }
}
