/* Casepagina's onder /work: dezelfde tokens, fonts, top bar en tree-nav als de
   homepage (public/preview/index.html), plus het ritme van de case-frames in Figma
   ("→ Case pages (build)"): 1440 desktop, 390 mobiel. */

/* ABC Areal by Dinamo — free fonts license. Variable: wght 400–700, slnt, DRKM (dark-mode compensation). */
@font-face { font-family: "Areal"; src: url(/work/fonts/areal.woff2) format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Areal Semi Mono"; src: url(/work/fonts/areal-semi-mono.woff2) format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  --bg: #ffffff;
  --ink: #161616;
  --ink-2: #5c5c5c;
  --ink-3: #8f8f8f;
  --line: #e4e4e4;
  --ph: #f0f0f0;
  --nav-w: 240px;
  --gutter: 56px;
  --font: "Areal", Arial, sans-serif;
  --font-meta: "Areal Semi Mono", "Areal", ui-monospace, monospace;
  --track-display: -0.025em;
  --track-h: -0.012em;
  --drkm: 0;
  /* case-ritme */
  --cs-top: 72px;
  --cs-back-gap: 32px;
  --cs-head-gap: 40px;
  --cs-section-gap: 96px;
  --cs-foot-gap: 120px;
  --cs-text-w: 620px;
  --cs-title: 84px;
  --cs-meta: 16px;
  --cs-lede: 22px;
  --cs-teaser-r: 8px;
}
:root h1, :root h2, :root h3 { font-feature-settings: "ss01", "ss05", "ss09"; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212; --ink: #ededed; --ink-2: #a8a8a8; --ink-3: #6f6f6f;
    --line: #2a2a2a; --ph: #1d1d1d; --drkm: 1; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121212; --ink: #ededed; --ink-2: #a8a8a8; --ink-3: #6f6f6f;
  --line: #2a2a2a; --ph: #1d1d1d; --drkm: 1; color-scheme: dark;
}
*, *::before, *::after { box-sizing: inherit; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  font-variation-settings: "DRKM" var(--drkm);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: var(--track-h); text-wrap: balance; }
p { margin: 0; }

/* ---------- top bar ---------- */
.top {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 28px var(--gutter) 0;
  font-size: 14px;
}
.top .name { font-weight: 500; }
.top .mail { color: var(--ink-2); }

/* ---------- layout ---------- */
.page {
  display: grid;
  grid-template-columns: var(--nav-w) 1px minmax(0, 1fr);
  max-width: 1440px; margin: 0 auto;
  padding: 0 var(--gutter);
}
.rule { background: var(--line); }

/* ---------- tree nav ---------- */
.nav { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 96px); align-self: start; padding: 96px 0 40px; height: fit-content; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree > li + li { border-top: 1px solid var(--line); }
.tree a {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0; font-size: 14px; color: var(--ink-2);
  transition: color .15s;
}
.tree a:hover { color: var(--ink); }
.tree a[aria-current], .tree li.open > a { color: var(--ink); }
.tree ul.l2 > li > a { padding: 8px 0 8px 16px; font-size: 13px; }
.tree ul.l2 > li:last-child > a { padding-bottom: 14px; }

/* mobile breadcrumb */
.crumb { display: none; }

/* ---------- case ---------- */
.main { padding: var(--cs-top) 0 96px var(--gutter); min-width: 0; }
.cp-back { display: inline-block; font-family: var(--font-meta); font-size: 13px; color: var(--ink-3); }
.cp-back:hover { color: var(--ink); }
.cs-teaser { margin: var(--cs-back-gap) 0 0; border-radius: var(--cs-teaser-r); overflow: hidden; aspect-ratio: 1031 / 320; background: var(--ph); }
.cs-teaser img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cs-head { margin-top: var(--cs-head-gap); }
.cp-back + .cs-head { margin-top: var(--cs-back-gap); } /* case zonder teaser */
.cs-title { font-size: var(--cs-title); line-height: 1.02; letter-spacing: var(--track-display); }
.w-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-top: 12px; }
.w-meta .cat { font-size: var(--cs-meta); font-weight: 500; color: var(--ink-3); white-space: pre; }
.year { font-family: var(--font-meta); font-size: var(--cs-meta); color: var(--ink-3); white-space: nowrap; }
.w-sub { color: var(--ink-2); font-size: var(--cs-lede); line-height: 1.45; max-width: 760px; margin-top: 4px; }
.cs-text { max-width: var(--cs-text-w); font-size: 17px; line-height: 1.55; }
.cs-text p + p { margin-top: 14px; }
.cs-text.tight p + p { margin-top: 4px; }
.cs-intro { margin-top: var(--cs-head-gap); }
.cs-intro p + p { margin-top: 16px; }
.cs-section { margin-top: var(--cs-section-gap); }
.cs-section h2 { font-size: 20px; line-height: 1.3; letter-spacing: var(--track-h); max-width: var(--cs-text-w); }
.cs-section h2 + .cs-text { margin-top: 8px; }
.cs-fig { margin: 24px 0 0; }
.cs-fig img { display: block; width: 100%; height: auto; }
.cs-fig figcaption { margin-top: 12px; max-width: var(--cs-text-w); font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.cs-next { margin-top: var(--cs-foot-gap); padding-top: 24px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: flex-start; }
.cs-next-label { font-size: 13px; color: var(--ink-2); }
.cs-next a { font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: var(--track-h); }
.cs-next a:hover { color: var(--ink-2); }

/* Semi Mono carries the second voice: meta, labels, the tree */
.tree, .top .mail, .crumb { font-family: var(--font-meta); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  :root { --nav-w: 200px; --gutter: 40px; --cs-title: 72px; }
}
@media (max-width: 760px) {
  :root {
    --gutter: 16px;
    --cs-top: 24px; --cs-head-gap: 32px; --cs-section-gap: 64px; --cs-foot-gap: 64px;
    --cs-title: 48px; --cs-meta: 14px; --cs-lede: 19px; --cs-teaser-r: 6px;
  }
  .page { grid-template-columns: minmax(0, 1fr); }
  .rule, .nav .tree { display: none; }
  .nav { position: static; padding: 0; height: auto; }
  .crumb {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    position: fixed; left: 0; right: 0; top: 0; z-index: 11; width: 100%;
    padding: calc(env(safe-area-inset-top, 0px) + 12px) var(--gutter) 12px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 0; border-bottom: 1px solid var(--line);
    font: inherit; font-family: var(--font-meta); font-size: 13px; color: var(--ink-2); text-align: left; cursor: pointer;
  }
  .crumb .path { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .crumb b { font-weight: 500; color: var(--ink); }
  .crumb .path span + span::before { content: " › "; color: var(--ink-3); }
  .crumb .chev { color: var(--ink-3); transition: transform .2s; }
  .crumb[aria-expanded="true"] .chev { transform: rotate(180deg); }
  /* dropdown: the same tree, fully expanded, under the bar */
  .nav.open .tree {
    display: block; position: fixed; left: 0; right: 0; z-index: 10;
    top: calc(env(safe-area-inset-top, 0px) + 45px);
    max-height: calc(100vh - 45px); overflow: auto;
    padding: 8px var(--gutter) 16px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px -12px rgba(0,0,0,.18);
  }
  .top { padding-top: 64px; }
  .main { padding: var(--cs-top) 0 64px; }
}
