/* 4digital Lab: loaded after the main site's style.css and reuses its tokens, header, footer and case-study layout
   (study-*, case-*). Only what the main site does not have: the Lab lockup, the index intro, research tables and
   metadata, and a monospace token for identifiers and measured values. */
:root{--mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}

/* Lab lockup (brand kit 4digital-lab v1.0.0): full in the header and footer, compact on narrow screens.
   style.css shows .brand-light / .brand-dark according to the theme. */
.lab-brand img.lab-compact{display:none}
.lab-header .lab-brand img.lab-full{width:272px}
.lab-footer .lab-brand img.lab-full{width:244px}
@media(max-width:1200px){.lab-header .lab-brand img.lab-full{width:244px}}
@media(max-width:600px){
  .lab-header .lab-brand img.lab-full{display:none}
  .lab-header .lab-brand img.lab-compact.brand-light{display:var(--light-logo)}
  .lab-header .lab-brand img.lab-compact.brand-dark{display:var(--dark-logo)}
  .lab-header .lab-brand img.lab-compact{width:auto;height:44px}
}

/* Index: opening text and the list of write-ups */
.lab-intro{display:grid;grid-template-columns:1fr 2fr;gap:30px;padding:64px 0 48px}
/* the first write-up should start within the first screen: tighter than the main site's .work section */
.research-list.work{margin-top:0;padding-top:48px}
.lab-intro h1{font-size:clamp(34px,4.6vw,68px);line-height:1.06;letter-spacing:-2px;font-weight:450;color:var(--ink);max-width:15ch}
.lab-intro .lab-lead{font-size:clamp(18px,1.7vw,23px);line-height:1.55;color:var(--ink);margin-top:30px;max-width:720px}
.lab-intro p{font-size:16px;line-height:1.85;color:var(--muted);margin-top:18px;max-width:720px}
.lab-intro .lab-signature{margin-top:30px;font-size:13px;line-height:1.7;color:var(--ink)}
.lab-intro .lab-link{color:var(--accent)}
.research-list .case-list{display:grid;gap:0}
.research-card .case-feature-link{grid-template-columns:minmax(0,1fr) 20px}
.research-card .case-overview h2{font-size:clamp(22px,2.4vw,30px);line-height:1.25;letter-spacing:-.6px;font-weight:450;margin:12px 0 10px;max-width:900px}
.research-card .case-lead{font-size:15px;line-height:1.8;color:var(--muted);max-width:760px}
.research-card .case-read{display:inline-block;margin-top:14px;font-size:12px;color:var(--accent)}
.research-list .case,.research-card .case-feature-link,.research-card .case-overview{max-width:none;width:100%}
.lab-tag{display:inline-block;margin-left:8px;padding:0 8px;border:1px dashed var(--accent);color:var(--accent);text-transform:none;letter-spacing:0}
@media(max-width:760px){.lab-intro{grid-template-columns:1fr;gap:6px;padding:40px 0 32px}.research-list.work{padding-top:36px}}

/* Write-up: section index, metadata, tables, code, evidence, citation, author.
   Grid items may shrink below their content (tables scroll inside .table-wrap; long URLs and hashes wrap), so the
   page never grows wider than the viewport. */
.research .study-section>*,.research-meta>*,.research-cite>*{min-width:0}
.study-copy p,.study-copy li,.research-objects dd{overflow-wrap:anywhere}
.research-byline{font-size:13px;color:var(--muted);margin:22px 0 34px}
.research-index{grid-template-columns:repeat(4,1fr)}
@media(min-width:900px){.research-index{grid-template-columns:repeat(7,1fr)}}
.research-meta{margin:44px 0 0 auto;max-width:none;padding:40px 52px}
.research-meta>.eyebrow{color:var(--accent);margin-bottom:18px;display:block}
.research-meta .study-context.research-objects{grid-template-columns:1fr;gap:14px;margin:0 0 34px;padding:0 0 26px;border-top:0;border-bottom:1px solid var(--line)}
.research-objects>div{display:grid;grid-template-columns:64px 1fr;gap:16px;align-items:start}
.research-objects dt{font-family:var(--mono);font-weight:500;color:var(--ink)}
.research-objects dd{font-size:14px;line-height:1.75;max-width:900px}
.lab-object-type{display:block;font-size:11px;letter-spacing:1px;text-transform:uppercase;color:var(--accent);margin-bottom:2px}
.research-meta .study-context.lab-meta{grid-template-columns:2fr 1fr;margin-top:0;padding-top:0;border-top:0}
.research-meta .study-context dd{color:var(--ink)}
.study-copy ol{margin:19px 0 0;padding-left:22px;font-size:15px;line-height:1.9;color:var(--muted)}
.study-copy blockquote{margin:26px 0 0;padding:0 0 0 22px;border-left:3px solid var(--accent);color:var(--muted);font-size:15px;line-height:1.85}
.study-copy code,.research-cite code{font-family:var(--mono);font-size:.86em;background:var(--art);padding:2px 6px;border-radius:3px;word-break:break-all}
.study-copy pre{margin:22px 0 0;padding:18px 20px;background:var(--art);border:1px solid var(--line);overflow-x:auto;font-size:13px;line-height:1.6}
.study-copy pre code{background:none;padding:0;word-break:normal}
.study-copy .table-wrap{margin:24px 0 0;overflow-x:auto;-webkit-overflow-scrolling:touch}
.study-copy table{width:100%;min-width:560px;border-collapse:collapse;font-size:13.5px;line-height:1.55;color:var(--muted)}
.study-copy table.evidence{min-width:0}
.study-copy th,.study-copy td{padding:11px 14px 11px 0;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
.study-copy th{font-size:11px;letter-spacing:1px;text-transform:uppercase;color:var(--accent);font-weight:500;max-width:11em}
.study-copy th.num,.study-copy td.num{text-align:right;font-variant-numeric:tabular-nums}
.study-copy td.num{white-space:nowrap;font-family:var(--mono);font-size:12.5px}
.study-copy td strong{color:var(--ink);font-weight:500}
.study-copy table.evidence td:last-child code{font-size:11px}
.research-errata{grid-template-columns:1fr;margin-top:0;padding-top:0;border-top:0;font-size:14px}
.research-errata dt{white-space:nowrap}
.research-notice{margin-top:26px;padding:14px 18px;border:1px solid var(--line);color:var(--ink);font-size:13px;line-height:1.6;background:var(--art)}
.research-notice a{color:var(--accent);text-decoration:underline;text-underline-offset:4px}
.research-cite .research-cite-text{font-size:14px;line-height:1.7;color:var(--ink);max-width:900px;margin-top:8px;overflow-wrap:anywhere}
.research-cite .source-hash{font-size:12px;line-height:1.7;color:var(--muted);margin-top:16px;overflow-wrap:anywhere}
.study-context.research-changelog{grid-template-columns:1fr;gap:14px;margin-top:30px;padding-top:24px}
.research-changelog>div{display:grid;grid-template-columns:150px 1fr;gap:16px}
.research-changelog>div:first-child dd{display:none}
.research-changelog dt{color:var(--accent)}
.research-author h2{font-size:clamp(26px,2.6vw,36px)}
.research-author>div>p:not(.eyebrow){font-size:15px;line-height:1.8;color:var(--muted);margin-top:14px;max-width:620px}
.research-author-links{display:flex;flex-direction:column;gap:10px;font-size:13px;flex-shrink:0;text-align:right}
.research-author-links a{color:var(--accent)}
@media(max-width:700px){
  .research-index{grid-template-columns:1fr 1fr}
  .research-meta{padding:28px 22px}
  .research-meta .study-context.lab-meta{grid-template-columns:1fr}
  .research-objects>div{grid-template-columns:52px 1fr;gap:12px}
  .research-changelog>div{grid-template-columns:1fr;gap:4px}
  .research-author-links{text-align:left}
}
