@import url("https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:wght@500;700;800&family=DM+Mono:wght@400;500&display=swap");

/* Scratch — the Physical Graffiti template. Every project starts here, for us and for clients.
   In one line: soft, neutral colours and professional sketching. Philosophy: playful rigour. Serious fun.
   Used until a client has a brand; then their design/foundations/tokens.css replaces this file.
   Role names stay the same, so the swap is one file.

   Kanso   (simplicity)   one heavy grotesk for headings, one mono for labels and numbers. No accent colour.
   Ma      (space)        space separates sections; broken hairlines mark tiles, never boxes.
   Shibui  (quiet)        warm paper grey and charcoal; weight and size carry the hierarchy.
   Wabi-sabi (unfinished) drafts look like drafts: version stamp, crop marks, margin notes, open marks.

   Look after a logo-mark presentation sheet: uppercase grotesk title, mono meta with arrows,
   tiles with a grey index top right and a short rule underneath, corner crop marks.

   Sketch layer: architectural line work, not cartoons. Lines overshoot their corners, dimension
   lines carry real numbers, drawn icons get a slight hand wobble (the #pg-rough SVG filter).
   A sketch always carries information.

   Status is a shape, never a colour:  ● decided   ◐ assumed   ○ open question   × cut */

:root{
  --paper:#ebe9e4; --ink:#2a2926; --ink-2:#5b5954; --ink-3:#97948d; --rule:#cdcac3; --field:#e2dfd9; --sand:#ddd5c6;
  --display:"Schibsted Grotesk","Helvetica Neue",Arial,sans-serif;
  --sans:"Schibsted Grotesk",ui-sans-serif,-apple-system,"Helvetica Neue",Arial,sans-serif;
  --mono:"DM Mono",ui-monospace,"SF Mono",Menlo,monospace;
  --step-0:1.0625rem; --step-1:1.25rem; --step-2:1.5rem; --step-3:clamp(2rem,6vw,2.75rem); --small:.8125rem;
  --space:1rem; --gap:2rem; --ma:4.5rem;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --paper:#1b1a18; --ink:#ebe9e4; --ink-2:#aaa7a0; --ink-3:#77746e; --rule:#3a3834; --field:#24231f; --sand:#2e2a23; color-scheme:dark}}
:root[data-theme="dark"]{
  --paper:#1b1a18; --ink:#ebe9e4; --ink-2:#aaa7a0; --ink-3:#77746e; --rule:#3a3834; --field:#24231f; --sand:#2e2a23; color-scheme:dark}

*{box-sizing:border-box}
[hidden]{display:none!important}
body{background:var(--paper);color:var(--ink);font:400 var(--step-0)/1.6 var(--sans);
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));
  padding-block:var(--gap) var(--ma)}
main{max-width:46rem;margin-inline:auto;display:grid;gap:var(--ma)}
main > *{min-width:0}
section,header.page{display:grid;gap:var(--space);align-content:start}

/* Stamp: right-aligned mono meta with arrows and a heavy underline */
.stamp{justify-self:end;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.15rem 1.1rem;
  font:400 var(--small)/1.6 var(--mono);color:var(--ink);border-bottom:2px solid var(--ink);padding-bottom:.4rem;margin-bottom:.75rem}
.stamp span::before{content:"\2192\00a0";color:var(--ink-3)}
h1{font:800 var(--step-3)/1.02 var(--display);text-transform:uppercase;letter-spacing:-.02em;margin:0;text-wrap:balance}
h2{font:700 var(--step-2)/1.2 var(--display);letter-spacing:-.015em;margin:0;text-wrap:balance}
h3{font:700 var(--step-0)/1.4 var(--display);margin:0}
p{margin:0;max-width:65ch}
.lede{font-size:var(--step-1);line-height:1.45;color:var(--ink-2)}
.label{font:400 var(--small)/1.4 var(--mono);letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3)}
.label::before{content:"\2192\00a0"}
.quiet{color:var(--ink-2)}
b,strong{font-weight:700}
a{color:var(--ink);text-underline-offset:.2em;text-decoration-color:var(--ink-3)}
a:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
ul,ol{margin:0;padding-left:1.25rem;display:grid;gap:.5rem}
li{max-width:65ch}

/* Tiles of coded statements: D1, A3, Q2 … index top right, hairline left, short rule below */
.items{list-style:none;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(17rem,1fr));gap:1.25rem 1rem}
.items > li{position:relative;display:grid;gap:.35rem;align-content:start;max-width:none;
  border-left:1px solid var(--rule);padding:.15rem 0 1.1rem 1rem}
.items > li::after{content:"";position:absolute;left:1rem;right:.5rem;bottom:0;height:1px;background:var(--rule)}
.items > li > div{display:grid;gap:.2rem;min-width:0}
.items p{color:var(--ink-2);font-size:.94em}
.code{justify-self:end;font:400 var(--small)/1.5 var(--mono);color:var(--ink-3);white-space:nowrap;font-variant-numeric:tabular-nums}
.code::before{margin-right:.4em}
.d .code::before{content:"\25CF"}
.a .code::before{content:"\25D0"}
.q .code::before{content:"\25CB"}
.x .code::before{content:"\00D7"}
.key{display:flex;flex-wrap:wrap;gap:.4rem 1.5rem;font:400 var(--small)/1.5 var(--mono);color:var(--ink-2)}

/* Margin notes: the consultant thinking out loud */
.note{font:400 var(--small)/1.6 var(--mono);color:var(--ink-2);border-left:1px solid var(--ink-3);padding-left:.9rem;max-width:60ch}
.field{background:var(--field);padding:1.1rem 1.25rem;display:grid;gap:.6rem}
.strike{text-decoration:line-through;color:var(--ink-3)}

/* Ordered stages: 01, 02 … */
.stages{list-style:none;padding:0;gap:var(--gap);counter-reset:s}
.stages > li{counter-increment:s;display:grid;grid-template-columns:2.5rem minmax(0,1fr);gap:.75rem;max-width:none}
.stages > li::before{content:counter(s,decimal-leading-zero);font:400 var(--small)/2 var(--mono);color:var(--ink-3)}
.stages > li > div{display:grid;gap:.6rem;min-width:0}

/* Transcript */
.talk{display:grid;gap:1.1rem;margin:0}
.talk > div{display:grid;grid-template-columns:4.5rem minmax(0,1fr);gap:.75rem}
.talk dt{font:400 var(--small)/1.9 var(--mono);color:var(--ink-3);text-transform:uppercase;letter-spacing:.06em}
.talk dd{margin:0;max-width:62ch}
.talk .standin dd::after{content:" \25D0 stand-in";font:400 var(--small) var(--mono);color:var(--ink-3);white-space:nowrap}

/* Tables */
.scroll{overflow-x:auto}
table{border-collapse:collapse;width:100%;min-width:30rem;font-size:.94em}
th,td{text-align:left;vertical-align:top;padding:.6rem .75rem .6rem 0;border-bottom:1px solid var(--rule)}
thead th{font:400 var(--small)/1.4 var(--mono);letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3);border-bottom:2px solid var(--ink)}
td{color:var(--ink-2)}
td:first-child,th:first-child{color:var(--ink)}
.num{font-family:var(--mono);font-variant-numeric:tabular-nums}

pre{margin:0;overflow-x:auto;font:400 var(--small)/1.6 var(--mono);background:var(--field);padding:1rem 1.1rem}

/* Footer framed by crop marks */
footer{--c:var(--ink-3);max-width:46rem;margin:var(--ma) auto 0;padding:1.4rem 1.5rem;
  font:500 var(--small)/1.6 var(--mono);text-transform:uppercase;letter-spacing:.04em;color:var(--ink);
  display:flex;flex-wrap:wrap;justify-content:space-between;gap:.5rem 1rem;
  background:
    linear-gradient(var(--c),var(--c)) top left/14px 1px no-repeat, linear-gradient(var(--c),var(--c)) top left/1px 14px no-repeat,
    linear-gradient(var(--c),var(--c)) top right/14px 1px no-repeat, linear-gradient(var(--c),var(--c)) top right/1px 14px no-repeat,
    linear-gradient(var(--c),var(--c)) bottom left/14px 1px no-repeat, linear-gradient(var(--c),var(--c)) bottom left/1px 14px no-repeat,
    linear-gradient(var(--c),var(--c)) bottom right/14px 1px no-repeat, linear-gradient(var(--c),var(--c)) bottom right/1px 14px no-repeat}

/* Sketch layer */
/* Frame whose lines run past the corners, each side by a slightly different amount */
.frame{position:relative}
.frame::before{content:"";position:absolute;inset:-6px -9px -8px -5px;pointer-events:none;--c:var(--ink-3);
  background:
    linear-gradient(var(--c),var(--c)) 0 6px/100% 1px no-repeat,
    linear-gradient(var(--c),var(--c)) 0 calc(100% - 8px)/100% 1px no-repeat,
    linear-gradient(var(--c),var(--c)) 5px 0/1px 100% no-repeat,
    linear-gradient(var(--c),var(--c)) calc(100% - 9px) 0/1px 100% no-repeat}
/* Dimension line: ticks at both ends, the measurement in the middle */
.dim{display:flex;align-items:center;gap:.75rem;font:400 var(--small)/1.4 var(--mono);color:var(--ink-3);
  letter-spacing:.04em;text-transform:uppercase;white-space:nowrap}
.dim::before,.dim::after{content:"";flex:1;height:9px;min-width:1.5rem;--c:var(--ink-3)}
.dim::before{background:linear-gradient(var(--c),var(--c)) 0 50%/100% 1px no-repeat,linear-gradient(var(--c),var(--c)) 0 0/1px 100% no-repeat}
.dim::after{background:linear-gradient(var(--c),var(--c)) 0 50%/100% 1px no-repeat,linear-gradient(var(--c),var(--c)) 100% 0/1px 100% no-repeat}
/* Hatching, for a filled area in a drawing */
.hatch{background:repeating-linear-gradient(135deg,var(--rule) 0 1px,transparent 1px 7px)}
/* Drawn strokes; add class rough for the hand wobble */
.sk{fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.rough{filter:url(#pg-rough)}

@media (max-width:480px){
  .stamp{justify-self:start;justify-content:flex-start}
  .talk > div{grid-template-columns:1fr;gap:.1rem}
  .stages > li{grid-template-columns:1.75rem minmax(0,1fr)}
}
