/* Case studies + News (website/case-studies/*, website/news/*) — catalogue world: white paper, ink rules, numbered parts. */
.cw { padding: 0 calc(var(--gut) + var(--tabs)) 0 var(--gut); }
html[lang="ja"] .cw h1, html[lang="ja"] .cw h2, html[lang="ja"] .cw h3, html[lang="ja"] .cw p, html[lang="ja"] .cw li, html[lang="ja"] .cw figcaption, html[lang="ja"] .cw td, html[lang="ja"] .cw th { font-family: var(--jp); }
.cw p { max-width: 68ch; color: var(--ink-2); }
html[lang="ja"] .cw p { max-width: 42em; }
.cw p a, .cw li a, .cw td a { color: var(--cyan-ink); }
.cw p a:hover { color: var(--ink); }
.c-h1 { font: 900 clamp(40px, 5vw, 72px)/.96 var(--display); font-variation-settings: "wdth" 116; letter-spacing: -.03em; color: var(--ink); text-wrap: balance; }
html[lang="ja"] .c-h1 { font-weight: 900; letter-spacing: -.01em; line-height: 1.12; }
.lede { font-size: 19px; line-height: 1.5; color: var(--ink) !important; }
.empty { padding: 28px 0; color: var(--ink-3) !important; border-top: 1px solid var(--zinc-2); }

/* test-project notice: the first thing under the band */
.notice { display: flex; gap: 14px; align-items: flex-start; padding: 14px calc(var(--gut) + var(--tabs)) 14px var(--gut); background: var(--chromate-2); border-bottom: 2px solid var(--ink); }
.notice svg { width: 24px; height: 24px; flex: none; margin-top: 2px; }
.notice b { display: block; font: 800 18px/1.35 var(--display); }
html[lang="ja"] .notice p, html[lang="ja"] .notice b { font-family: var(--jp); }
.notice p { font-size: 15px; color: var(--ink-2); margin: 0; }
.notice b { color: var(--ink); }
.cs-hero .date { font: 600 12px var(--mono); color: var(--ink-3); }

/* ---- index: case study cards ---- */
.c-head { padding: clamp(32px, 5vw, 64px) 0 28px; display: grid; gap: 16px; }
.cs-cards { list-style: none; margin: 0 0 64px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 28px; }
.cs-card { border: 2px solid var(--ink); border-radius: var(--r); background: var(--paper); display: grid; align-content: start; }
.cs-link { display: grid; gap: 10px; padding: 0 0 20px; text-decoration: none; color: inherit; }
.cs-link img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-bottom: 2px solid var(--ink); background: var(--paper-2); }
.cs-link > :not(img) { padding: 0 20px; }
.cs-meta { display: flex; gap: 14px; align-items: baseline; font: 600 12px var(--mono); color: var(--ink-3); margin-top: 6px; }
.cs-meta .pn { color: var(--cyan-ink); font-size: 13px; }
.cs-t { font: 800 clamp(26px, 2.5vw, 34px)/1.05 var(--display); font-variation-settings: "wdth" 110; letter-spacing: -.02em; }
.cs-link p { font-size: 16px; }
.cs-link:hover .cs-t { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.cs-link:hover img { filter: saturate(1.08) contrast(1.03); }
.cs-tags > span { display: flex; flex-wrap: wrap; gap: 6px; }
.cs-tags > span > span { font: 600 12px var(--display); padding: 3px 8px; border: 1.5px solid var(--ink); border-radius: var(--r); }
.cs-tags > span > span:first-child { background: var(--chromate); }

/* downloads (only rendered when a case study has files) */
.cs-dl { border-top: 2px solid var(--ink); padding: 14px 20px 18px; display: grid; gap: 10px; }
.cs-dl-h { font: 800 15px var(--display); font-variation-settings: "wdth" 120; letter-spacing: .08em; text-transform: uppercase; }
html[lang="ja"] .cs-dl-h { text-transform: none; letter-spacing: .1em; }
.cs-dl ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cs-dl li { display: flex; gap: 12px; align-items: center; justify-content: space-between; border-top: 1px solid var(--zinc-2); padding-top: 6px; }
.cs-dl a { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; color: var(--ink); min-height: 32px; }
.cs-dl svg { width: 18px; height: 18px; }
.cs-dl .num { font-size: 12px; color: var(--ink-3); }
.cs-body .cs-dl { padding: 18px 0 0; margin-top: 40px; }

/* ---- case study page ---- */
.cs-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px); padding: clamp(28px, 4vw, 56px) 0 40px; align-items: start; }
.cs-hero .c-intro { display: grid; gap: 18px; }
.cs-hero .spec { margin-top: 6px; }
.cs-hero .spec td.k { width: 120px; }
.cs-hero .spec td:nth-child(2) { padding-right: 12px; }
.cs-hero figure { margin: 0; }
.cs-hero .fig a { box-shadow: 8px 8px 0 var(--ink); }
.pill { display: inline-block; font: 700 11px var(--mono); padding: 2px 7px; border-radius: var(--r); white-space: nowrap; }
.pill.ok { background: #e3f2e9; color: var(--ok); }
.pill.open { background: var(--chromate-2); color: #5a4b0e; border: 1px solid var(--chromate); }

.cs-main { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); border-top: 2px solid var(--ink); padding-top: 28px; }
.cs-toc { position: sticky; top: 84px; align-self: start; }
.cs-toc h2 { font: 800 13px var(--display); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
html[lang="ja"] .cs-toc h2 { text-transform: none; }
.cs-toc ol { list-style: none; margin: 0; padding: 0; display: grid; }
.cs-toc a { display: grid; grid-template-columns: 28px 1fr; gap: 6px; padding: 6px 0; border-top: 1px solid var(--zinc-2); text-decoration: none; font-size: 14px; line-height: 1.35; color: var(--ink-2); }
.cs-toc a .num { font-size: 12px; color: var(--cyan-ink); padding-top: 1px; }
.cs-toc a:hover, .cs-toc a[aria-current="true"] { color: var(--ink); }
.cs-toc a[aria-current="true"] { font-weight: 700; }
.cs-toc a[aria-current="true"] .num { color: var(--ink); }

.step { display: grid; gap: 18px; padding: 0 0 56px; scroll-margin-top: 84px; }
.step .label { grid-template-columns: 64px 1fr auto; }
.step .label .nm { font-size: 17px; }
.step h2.nm { margin: 0; }
.step > p + p { margin-top: -6px; }
.spec.wide td { white-space: normal; }
.spec th { text-align: left; font: 600 12px var(--display); color: var(--ink-3); padding: 0 12px 6px 0; }
.spec.data td { padding-right: 12px; }
.spec.data td.v { text-align: left; }
.tbl { overflow-x: auto; max-width: 720px; }

/* figures: a 2px-ruled image well, the caption under it */
.figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 18px; }
.figs.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.figs .wide { grid-column: 1 / -1; }
.fig { margin: 0; display: grid; gap: 8px; align-content: start; }
.fig a { display: block; border: 2px solid var(--ink); border-radius: var(--r); background: #fff; overflow: hidden; cursor: zoom-in; position: relative; }
.fig a img { width: 100%; height: auto; transition: transform .5s cubic-bezier(.16, 1, .3, 1); }
.fig a:hover img { transform: scale(1.015); }
.fig a::after { content: ""; position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; border-radius: var(--r); background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='white' stroke-width='1.8'%3E%3Cpath d='M12 3h5v5M8 17H3v-5M17 3l-5.5 5.5M3 17l5.5-5.5'/%3E%3C/svg%3E") center / 16px no-repeat; opacity: 0; transition: opacity .2s; }
.fig a:hover::after, .fig a:focus-visible::after { opacity: 1; }
.fig figcaption, .cmp figcaption { font-size: 14px; line-height: 1.45; color: var(--ink-3); }
.fig.draw a img { padding: 8px; }

/* prompt block */
.prompt { border: 2px solid var(--ink); border-radius: var(--r); background: var(--paper-2); max-width: 720px; }
.prompt-h { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--zinc-2); font: 600 12px var(--mono); color: var(--ink-3); }
.prompt pre { margin: 0; padding: 16px; white-space: pre-wrap; font: 500 15px/1.6 var(--mono); color: var(--ink); }
html[lang="ja"] .prompt pre { font-family: var(--jp); font-size: 16px; }
.prompt-note { font-size: 13px !important; color: var(--ink-3) !important; padding: 0 16px 12px; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; max-width: 820px; border: 2px solid var(--ink); border-radius: var(--r); }
.flow li { padding: 12px 14px; display: grid; gap: 4px; font-size: 15px; line-height: 1.4; }
.flow li + li { border-left: 1px solid var(--zinc-2); }
.flow .bub { margin-bottom: 4px; }

/* before / after compare */
.cmps { display: grid; gap: 28px; }
.cmp { margin: 0; display: grid; gap: 8px; }
.cmp-stage { position: relative; aspect-ratio: 16 / 10; border: 2px solid var(--ink); border-radius: var(--r); overflow: hidden; background: var(--paper-2); --p: 50%; touch-action: pan-y; user-select: none; }
.cmp-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.cmp-b { clip-path: inset(0 0 0 var(--p)); }
.cmp-line { position: absolute; top: 0; bottom: 0; left: var(--p); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(21, 24, 26, .35); pointer-events: none; }
.cmp-knob { position: absolute; top: 50%; left: var(--p); width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); display: grid; place-items: center; pointer-events: none; box-shadow: 0 6px 16px -6px rgba(21, 24, 26, .5); }
.cmp-knob svg { width: 22px; height: 22px; }
.cmp-tag { position: absolute; top: 10px; padding: 4px 8px; font: 700 12px var(--display); letter-spacing: .04em; background: var(--ink); color: var(--paper); border-radius: var(--r); pointer-events: none; }
html[lang="ja"] .cmp-tag { font-family: var(--jp); }
.cmp-tag.a { left: 10px; }
.cmp-tag.b { right: 10px; background: var(--chromate); color: var(--ink); }
.cmp-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.cmp-stage:has(.cmp-range:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 3px; }
.cmp-stage:has(.cmp-range:focus-visible) .cmp-knob { background: var(--cyan); color: #fff; border-color: var(--cyan); }
.cmp-open { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.cmp-open a { color: var(--cyan-ink); }

.c-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
html[lang="ja"] .btn { font-family: var(--jp); }

/* prev / next between case studies (and news posts) */
.pager { display: grid; grid-template-columns: auto 1fr 1fr; gap: 12px; border-top: 2px solid var(--ink); padding: 18px 0 56px; align-items: stretch; }
.pager a { display: flex; gap: 10px; align-items: center; text-decoration: none; padding: 12px 14px; border: 1.5px solid var(--ink); border-radius: var(--r); min-height: 54px; }
.pager a:hover { background: var(--ink); color: var(--paper); }
.pager svg { width: 20px; height: 20px; flex: none; }
.pager small { display: block; font: 600 11px var(--mono); color: inherit; opacity: .7; text-transform: uppercase; }
.pager b { font: 700 15px var(--display); }
html[lang="ja"] .pager b, html[lang="ja"] .pager span { font-family: var(--jp); }
.pager .pg-back { font-weight: 700; }
.pager .pg-prev { grid-column: 2; }
.pager .pg-next { grid-column: 3; justify-content: flex-end; text-align: right; }

/* ---- news ---- */
.news-list { list-style: none; margin: 0 0 24px; padding: 0; border-top: 2px solid var(--ink); }
.news-list li { border-bottom: 1px solid var(--zinc-2); scroll-margin-top: 84px; }   /* #v0.9.2 etc.: the sticky header must not cover the post a link lands on */
.news-item { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding: 20px 0; text-decoration: none; color: inherit; align-items: start; }
.news-item img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 2px solid var(--ink); border-radius: var(--r); }
.news-tx { display: grid; gap: 8px; grid-column: 2; }
.news-item:not(:has(img)) .news-tx { grid-column: 1 / -1; }
.news-meta { display: flex; gap: 12px; align-items: center; font: 600 12px var(--mono); color: var(--ink-3); }
.tag { font: 700 11px var(--display); letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: var(--r); border: 1.5px solid var(--ink); color: var(--ink); }
html[lang="ja"] .tag { font-family: var(--jp); text-transform: none; }
.news-t { font: 800 clamp(22px, 2.2vw, 28px)/1.15 var(--display); letter-spacing: -.015em; }
.news-item:hover .news-t { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
/* A post is ONE reading column in the middle of the page container (the same 1360 px box as the header, the band and the footer).
   It used to sit at the container's left edge with 500 px of empty paper on its right (owner 2026-11-15). The prev / next
   links under it share the column; the news list and the case studies still fill the whole container. */
.post { display: grid; gap: 18px; padding: clamp(28px, 4vw, 56px) 0 40px; max-width: 860px; margin-inline: auto; }
.post ~ .pager { max-width: 860px; margin-inline: auto; }
.post .news-meta { margin-bottom: -4px; }

/* lightbox (assets/case.js) */
.lbx { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(13, 15, 16, .96); color: #fff; }
.lbx::backdrop { background: rgba(13, 15, 16, .7); }
.lbx-in { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lbx-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; font: 600 13px var(--mono); }
.lbx-fig { position: relative; display: grid; place-items: center; padding: 0 64px; min-height: 0; touch-action: pan-y pinch-zoom; }
.lbx-fig img { position: absolute; inset: 0; margin: auto; max-width: calc(100% - 128px); max-height: 100%; object-fit: contain; background: #fff; transition: opacity .2s, transform .25s cubic-bezier(.16, 1, .3, 1); }
.lbx-cap { padding: 12px 16px 18px; font-size: 15px; line-height: 1.5; text-align: center; color: #d9dddf; min-height: 3.2em; }
html[lang="ja"] .lbx-cap { font-family: var(--jp); }
.lbx button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; border: 1.5px solid rgba(255, 255, 255, .5); background: rgba(21, 24, 26, .7); color: #fff; border-radius: var(--r); cursor: pointer; font: 600 13px var(--display); padding: 0 10px; }
.lbx button:hover { background: #fff; color: var(--ink); }
.lbx button svg { width: 20px; height: 20px; }
.lbx .lbx-prev, .lbx .lbx-next { position: absolute; top: 50%; margin-top: -22px; }
.lbx .lbx-prev { left: 10px; }
.lbx .lbx-next { right: 10px; }
.lbx button[hidden] { display: none; }
.lbx :focus-visible { outline: 2px solid var(--chromate); outline-offset: 2px; }

@media (max-width: 1100px) {
  .cs-main { grid-template-columns: minmax(0, 1fr); }
  .cs-toc { position: static; }
  .cs-toc ol { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); column-gap: 18px; }
}
@media (max-width: 900px) {
  .cs-hero { grid-template-columns: minmax(0, 1fr); }
  .cs-hero figure { order: -1; }
  .cs-hero .fig a { box-shadow: 4px 4px 0 var(--ink); }
  .figs.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .figs, .figs.three { grid-template-columns: minmax(0, 1fr); }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .flow li + li { border-left: 0; border-top: 1px solid var(--zinc-2); }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager .pg-back { grid-column: 1 / -1; }
  .pager .pg-prev { grid-column: 1; }
  .pager .pg-next { grid-column: 2; }
  .news-item { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .news-tx { grid-column: 1; }
  .lbx-fig { padding: 0 8px; }
  .lbx-fig img { max-width: calc(100% - 16px); }
  .lbx-cap { padding: 12px 60px 18px; font-size: 14px; }
  .lbx .lbx-prev, .lbx .lbx-next { top: auto; bottom: -56px; }
  .cs-toc ol { grid-template-columns: minmax(0, 1fr); }
  .step .label { grid-template-columns: 44px 1fr; }
  .step .label .sp { grid-column: 2; text-align: left; padding-top: 0; }
  .lede { font-size: 17px; }
}
.cs-dl-app { font-size: 14px !important; margin: 0; }
.cw .news-item, .cw .cs-link { color: var(--ink); }
.nav a[aria-current="page"] { border-bottom-color: var(--ink); }
.tag-draft { background: var(--paper); border-style: dashed; color: var(--ink-2); }
.post h2 { font: 800 22px/1.2 var(--display); letter-spacing: -.01em; margin-top: 14px; padding-top: 14px; border-top: 2px solid var(--ink); }
html[lang="ja"] .post h2 { font-family: var(--jp); }
.post ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; max-width: 68ch; color: var(--ink-2); }
html[lang="ja"] .post ul { font-family: var(--jp); }
.post li b { color: var(--ink); }
.spec.stats { max-width: 360px; }
.spec.stats td.v { font-size: 16px; color: var(--ink); }
.cs-dl .num { white-space: nowrap; }
html[lang="ja"] .cw, html[lang="ja"] .notice { word-break: auto-phrase; }

/* video card: a poster that opens the video on YouTube (no embedded player: the pages load nothing from outside) */
.cs-video { margin: 0 0 48px; max-width: 1000px; }
.cs-video h2 { font: 800 13px var(--display); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 12px; }
html[lang="ja"] .cs-video h2 { text-transform: none; }
.yt-card a { cursor: pointer; }
.yt-card a::after { display: none; }
.yt-card .yt-play { position: absolute; left: 50%; top: 50%; width: 76px; height: 54px; margin: -27px 0 0 -38px; border-radius: 14px; background: #e00; box-shadow: 0 6px 18px rgba(0,0,0,.35); transition: transform .2s; }
.yt-card .yt-play::before { content: ""; position: absolute; left: 31px; top: 15px; border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #fff; }
.yt-card a:hover .yt-play, .yt-card a:focus-visible .yt-play { transform: scale(1.08); }
