*,*::before,*::after{box-sizing:border-box}html{-webkit-text-size-adjust:100%}body{margin:0}img{max-width:100%}[hidden]{display:none!important}:root{padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}

/* Layout: a dotted notebook page on a dark ground. EB Garamond for headings, Newsreader for reading. Thiels colours for pills and graphic marks. */
:root {
  /* Thiels palette */
  --bordeaux: #5e2b2e;
  --aubergine: #3b2430;
  --ochre: #d9a96b;
  --cream: #f0e9dc;
  --ink-900: #1e1c19;

  /* Single dark look: dark paper, light ink, ochre graphic marks */
  --mark: #d9a96b;
  --paper: #15171D;
  --dot: #30333C;
  --ink: #E7E6E1;
  --muted: #9195A3;
  --pen: #9DB0F2;
  --card: #1B1E26;
  --line: #2C303B;
  color-scheme: dark;

  --f-serif: "EB Garamond", Garamond, "Iowan Old Style", Georgia, serif;
}

html, body { min-height: 100%; }
body {
  background-color: var(--paper);
  background-image: radial-gradient(circle, var(--dot) 0.75px, transparent 1px);
  background-size: 19px 19px;
  background-position: 9px 9px;
  color: var(--ink);
  font-family: var(--f-serif);
  font-size: 20px;
  line-height: 1.6;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--pen); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: 880px; margin: 0 auto; padding-block: 28px 80px; }

/* Top bar */
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.home { font-size: 1.3rem; text-decoration: none; letter-spacing: .01em; }
.toggles { display: flex; gap: 8px; margin-left: auto; }
.tog {
  font-family: var(--f-serif); font-size: .85rem;
  background: var(--paper); color: var(--muted); border: 1px solid var(--line);
  padding: 4px 12px; border-radius: 4px; cursor: pointer;
}
.tog:hover { color: var(--ink); border-color: var(--muted); }
.tog b { color: var(--ink); font-weight: 600; }

/* Front page */
.latest { padding-left: clamp(0px, 8vw, 88px); margin-top: 8px; }
.latest-cards { grid-template-columns: 1fr; }
@media (min-width: 640px) { .latest-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.latest h2 { font-weight: 400; font-style: italic; font-size: 1.1rem; color: var(--muted); margin: 0 0 10px; }
.latest-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.latest-list li { border-top: 1px solid var(--line); }
.latest-list li:last-child { border-bottom: 1px solid var(--line); }
.latest-list a { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; text-decoration: none; }
.latest-list a:hover .l-title { color: var(--pen); }
.l-title { font-size: 1.3rem; font-weight: 500; line-height: 1.25; text-wrap: balance; }
.l-sum { font-family: "Newsreader", Georgia, serif; font-size: .95rem; line-height: 1.45; color: var(--muted); }
.l-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.all-link { display: inline-block; margin-top: 14px; padding-block: 8px; color: var(--muted); font-style: italic; }
.all-link:hover { color: var(--pen); }
.front { min-height: 44vh; display: flex; flex-direction: column; justify-content: center; gap: 28px; padding-left: clamp(0px, 8vw, 88px); }
.wordmark { position: relative; z-index: 1; font-weight: 400; font-size: clamp(3.6rem, 12vw, 6.8rem); line-height: 1; margin: 0; letter-spacing: -.01em; }
.wordmark i, .home i { color: var(--mark); font-style: normal; }
.wordmark i { animation: blink 1.1s steps(1, end) infinite; }
@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }
.sub { font-style: italic; font-size: clamp(1.2rem, 3.4vw, 1.45rem); color: var(--muted); margin: -12px 0 0; max-width: 32ch; text-wrap: balance; }
.actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.btn {
  --c: var(--ink);
  align-self: flex-start;
  font-size: 1.35rem; text-decoration: none;
  color: var(--c); border: 1.5px solid var(--c); background: var(--paper);
  padding: 6px 26px; border-radius: 3px;
  box-shadow: 3px 3px 0 var(--c);
  transition: transform .12s ease, box-shadow .12s ease;
}
/* Each button has its own colour for text, border and shadow. On hover it lifts a little further off the page. */
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--c); }
.btn:active { transform: translate(0, 0); box-shadow: 2px 2px 0 var(--c); }
.btn.notes { --c: var(--ink); }
/* Notes is the main way in, so it stands a little apart from the other buttons */
.actions .btn.notes { margin-right: 18px; }
.btn.work { --c: var(--ochre); }
.btn.linkedin { --c: var(--pen); }

/* Overview */
.page-title { font-weight: 400; font-size: 2.8rem; line-height: 1.1; margin: 48px 0 36px; text-wrap: balance; }
.page-intro { font-style: italic; color: var(--muted); font-size: 1.1rem; margin: -24px 0 40px; max-width: 40em; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 40px; }
.cat { margin-bottom: 44px; }
.cat h2 { font-weight: 500; font-size: 1.6rem; margin: 0 0 12px; }
.cat-desc { font-style: italic; color: var(--muted); margin: -8px 0 16px; font-size: 1.05rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; gap: 16px; justify-content: space-between; align-items: flex-start;
  min-height: 120px; padding: 16px 18px; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  transition: border-color .12s ease, transform .12s ease;
}
.card:hover { border-color: var(--pen); transform: translateY(-2px); }
.card h3 { font-weight: 500; font-size: 1.2rem; line-height: 1.3; margin: 0; text-wrap: balance; min-width: 0; }

/* Type pills, colours from the Thiels palette */
.pill {
  display: inline-block;
  font-family: var(--f-serif); font-size: .7rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; line-height: 1;
  padding: 6px 11px 5px; border-radius: 999px;
  color: var(--cream);
}
.pill.article { background: var(--bordeaux); }
.pill.thought { background: var(--ochre); color: var(--ink-900); }
.pill.link { background: var(--aubergine); }

/* Single note */
.note { max-width: 800px; margin: 48px auto 0; }
.note .back { display: inline-block; padding-block: 10px; margin-bottom: 18px; }
.card-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card-sum { margin: 0; font-family: "Newsreader", Georgia, serif; font-size: .9rem; line-height: 1.45; color: var(--muted); }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; }
.cdate { font-size: .9rem; font-style: italic; color: var(--muted); font-variant-numeric: tabular-nums; }
.cdate.missing { opacity: .7; }
.tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.langtag {
  font-family: var(--f-serif); font-size: .7rem; font-weight: 600; letter-spacing: .1em; line-height: 1;
  padding: 5px 8px 4px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.note .tags { margin-bottom: 16px; }
.note h2 { font-weight: 500; font-size: 1.5rem; line-height: 1.25; margin: 1.6em 0 .5em; text-wrap: balance; }
.note h3 { font-weight: 500; font-size: 1.2rem; margin: 1.3em 0 .4em; }
.dek { font-style: italic; color: var(--muted); font-size: 1.2rem; line-height: 1.4; margin: 0 0 10px; text-wrap: balance; }
.note ol, .note ul { margin: 0 0 1.1em; padding-left: 1.4em; max-width: 42em; font-family: "Newsreader", Georgia, serif; font-size: 19px; font-weight: 400; line-height: 1.6; }
.note li { margin-bottom: .35em; }
.note li::marker { color: var(--muted); }
.note a { color: var(--pen); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.cover { margin: 0 0 36px; }
.cover img { display: block; width: 100%; height: auto; }
.fig img { display: block; width: 100%; height: auto; }
.fig { margin: 1.4em 0; }
.code { margin: 1.4em 0; }
.code pre { margin: 0; overflow-x: auto; background: #0f1115; border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; }
.code code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; line-height: 1.55; color: var(--ink); }
.code figcaption { font-size: .95rem; font-style: italic; color: var(--muted); margin-top: 8px; }
.fig-box { aspect-ratio: 16 / 9; max-width: 100%; border: 1px dashed var(--line); border-radius: 6px; display: grid; place-items: center; color: var(--muted); font-style: italic; background: var(--card); }
.fig figcaption { font-size: .95rem; font-style: italic; color: var(--muted); margin-top: 8px; }
.note p { max-width: 42em; }
.note p, .note blockquote {
  font-family: "Newsreader", Georgia, serif; font-size: 19px; font-weight: 400; line-height: 1.6;
}
.note p strong, .note p b { font-weight: 500; }
.note h1 { font-weight: 400; font-size: clamp(2.2rem, 6vw, 3rem); line-height: 1.12; margin: 0 0 10px; text-wrap: balance; }
.meta { font-size: .95rem; font-style: italic; color: var(--muted); margin-bottom: 32px; }
.note p { margin: 0 0 1.1em; }
.note blockquote { margin: 1.4em 0; padding-left: 18px; border-left: 2px solid var(--pen); font-style: italic; color: var(--muted); }
.back { font-size: .95rem; text-decoration: none; color: var(--muted); }
.back:hover { color: var(--pen); }

.proto { font-size: .85rem; font-style: italic; color: var(--muted); text-align: center; margin-top: 64px; }

/* Soft paper halo: dots fade out behind text */
.latest h2, .all-link, .wordmark, .sub, .page-title, .page-intro, .lang-filter, .legend, .cat h2, .cat-desc, .back, .proto {
  width: fit-content; max-width: 100%;
  --veil: color-mix(in srgb, var(--paper) 50%, transparent);
  background: var(--veil);
  box-shadow: 0 0 22px 16px var(--veil);
  border-radius: 14px;
}
.note { background: var(--paper); box-shadow: 0 0 48px 36px var(--paper); border-radius: 24px; }
/* Headings and labels let the dots show through at about 50%; the article itself (.note) stays solid paper */
.proto { margin-left: auto; margin-right: auto; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .wordmark i, .home i { animation: none; } }

/* Code in notes: a Markdown code block, with its caption as the italic line just below */
.note pre { margin: 1.4em 0 0; overflow-x: auto; background: #0f1115; border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; }
.note pre code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; line-height: 1.55; color: var(--ink); }
.note pre + p:has(> em:only-child) { font-family: var(--f-serif); font-size: .95rem; font-style: italic; color: var(--muted); margin-top: 8px; }
.note pre:not(:has(+ p > em:only-child)) { margin-bottom: 1.4em; }

/* DA/EN filter on All notes, styled like the DA/EN tags */
.lang-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: -12px 0 40px; }
.lang-filter-h { font-size: .95rem; font-style: italic; color: var(--muted); margin-right: 4px; }
.lang-opt {
  font-family: var(--f-serif); font-size: .8rem; font-weight: 600; letter-spacing: .1em; line-height: 1;
  padding: 7px 14px 6px; border-radius: 999px; cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); color: var(--muted);
  transition: border-color .12s ease, color .12s ease;
}
.lang-opt:hover { border-color: var(--muted); color: var(--ink); }
.lang-opt[aria-pressed="true"] { border-color: var(--pen); color: var(--pen); }

/* Tables in notes: scroll sideways on narrow screens instead of squeezing the columns */
.note table { display: block; overflow-x: auto; border-collapse: collapse; margin: 1.4em 0; font-family: "Newsreader", Georgia, serif; font-size: 16px; line-height: 1.45; }
.note th, .note td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); min-width: 9em; }
.note th { font-family: var(--f-serif); font-weight: 600; font-size: .95rem; color: var(--muted); border-bottom-color: var(--muted); }
.note tbody tr:last-child td { border-bottom: 0; }

/* Buttons inside a page, e.g. Get in touch on /work/ */
.note .actions { margin: 8px 0 1.4em; }

/* Small print at the end of a page, e.g. the disclaimer on /work/ */
.note .disclaimer { margin-top: 3em; padding-top: 1em; border-top: 1px solid var(--line); font-size: .9rem; font-style: italic; color: var(--muted); }
