/* type matches the home hero: Allo, 17px name, 15/22 body, 13px grey meta */
.case-page { --hero-font: Allo, -apple-system, "system-ui", sans-serif; font-family:var(--hero-font); letter-spacing:-0.02em; color:#424346; }
.case-page .wrap { max-width:560px; }
.case-page .back { font-size:13px; color:#a1a1aa; margin-bottom:32px; }
.case-page .back:hover { color:#242528; }
.case-page article.case h1 { font-size:17px; font-weight:500; line-height:1.1; letter-spacing:-0.02em; color:#242528; margin:0 0 6px; }
.case-page article.case .lead { font-size:13px; line-height:1.1; color:#a1a1aa; margin:0 0 24px; }
.case-page .case .facts { font-size:13px; line-height:18px; gap:8px 32px; padding:12px 0; margin-bottom:24px; }
.case-page .case .facts dt { color:#a1a1aa; margin-bottom:2px; }
.case-page .case .facts dd { color:#242528; }
.case-page .prose { font-size:15px; line-height:26px; color:#424346; }
.case-page .prose p { margin:0 0 22px; }
.case-page .prose h2 { font-size:15px; line-height:22px; font-weight:500; color:#242528; letter-spacing:-0.02em; margin:40px 0 6px; }
.case-page .case figure { margin:16px 0; }
.case-page .case video, .case-page .prose img { border-radius:12px; }
.case-page .case-count { font-size:13px; color:#a1a1aa; }
.case-page .gh-repo { color:#242528; }
.case-page .areas summary { font-size:15px; font-weight:500; color:#242528; }
.case .facts { display:flex; flex-wrap:wrap; gap:12px 40px; margin:0 0 40px; padding:18px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); font-size:15px; }
.case .facts dt { color:var(--muted); margin-bottom:4px; }
.case .facts dd { margin:0; }
.case .facts a { text-decoration:underline; text-decoration-color:#ccc; text-underline-offset:3px; }
.case video { display:block; width:100%; height:auto; border-radius:16px; background:var(--tile); }
.case figure { margin:24px 0; }
.case figcaption { font-size:14px; color:var(--muted); margin-top:8px; }
.case-count { color:var(--muted); font-size:15px; margin-top:-8px !important; }
.commits h3 { font-size:13px; font-weight:500; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:28px 0 8px; }
.commits ol { list-style:none; padding:0; margin:0; }
.commits li { display:flex; gap:16px; padding:10px 0; border-bottom:1px solid var(--line); font-size:16px; line-height:1.5; margin:0; }
.commits time { color:var(--muted); font-variant-numeric:tabular-nums; width:22px; flex:none; }
.commits li p { margin:0; }
.commits .note { color:var(--muted); font-size:15px; }
/* What I shipped: quiet rows in the site's own style (hairlines, soft pills, mono icons) */
.gh-repo { display:flex; align-items:center; gap:8px; margin:6px 0 8px; font-size:13px; line-height:18px; color:#a1a1aa; }
.gh-repo .gh-mark { width:14px; height:14px; color:#424346; }
.gh-repo span:first-of-type { color:#424346; }
.gh-repo .gh-stat { margin-left:auto; }
.prose .areas { list-style:none; padding:0; margin:0 0 32px; border-top:1px solid #ececec; }
.areas > li { margin:0; border-bottom:1px solid #ececec; }
.areas summary { list-style:none; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; cursor:pointer; font-size:15px; line-height:22px; font-weight:400; color:#242528; transition:color .15s; }
.areas summary::-webkit-details-marker { display:none; }
.area-title { display:flex; align-items:center; gap:10px; }
.chev { width:6px; height:6px; border-right:1.4px solid #a1a1aa; border-bottom:1.4px solid #a1a1aa; transform:rotate(-45deg); transition:transform .2s cubic-bezier(.22,1,.36,1); }
details[open] .chev { transform:rotate(45deg); }
.areas summary:hover .chev { border-color:#242528; }
.gh-counts { display:flex; gap:4px; }
.pill { display:inline-flex; align-items:center; gap:4px; padding:0 9px; height:22px; border-radius:999px; background:rgba(0,0,0,.05); font-size:12px; line-height:1; color:#6e6e73; }
.pill .pr-icon { width:11px; height:11px; margin:0; color:#6e6e73; }
.case-page .prose .area-sum { margin:0 0 10px 16px; font-size:15px; line-height:26px; color:#424346; }
.prose .prs { list-style:none; padding:0; margin:0 0 14px 16px; }
.prs li { display:flex; gap:10px; padding:6px 0; margin:0; }
.pr-icon { color:#8250df; flex:none; width:13px; height:13px; margin-top:3px; }
.case-page .prose .pr-title { margin:0; font-size:13px; line-height:18px; color:#242528; }
.case-page .prose .pr-meta { margin:0; font-size:12px; line-height:16px; color:#a1a1aa; }
.label { display:inline-block; padding:0 6px; margin-left:4px; border-radius:999px; font-size:11px; line-height:16px; vertical-align:1px; background:rgba(0,0,0,.05); color:#6e6e73; }
@media (max-width:640px) { .gh-counts .pill:last-child { display:none; } }

/* related PRs under a section's description */
.section-prs { margin:-10px 0 18px; }
.case-page .prose .section-prs .prs { margin:0; }
.prs-more summary { list-style:none; display:inline-flex; align-items:center; gap:8px; padding:4px 0; font-size:13px; color:#a1a1aa; cursor:pointer; }
.prs-more summary::-webkit-details-marker { display:none; }
.prs-more summary:hover { color:#242528; }
/* media carousel */
.carousel { margin:8px 0 16px; }
.carousel-track { display:flex; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none; border-radius:12px; }
.carousel-track::-webkit-scrollbar { display:none; }
.carousel-track figure { flex:0 0 100%; scroll-snap-align:start; margin:0 !important; }
.carousel-track video, .carousel-track img { border-radius:12px; }
.carousel-nav { display:flex; align-items:center; justify-content:center; gap:12px; margin-top:10px; }
.carousel-btn { width:28px; height:28px; border:0; border-radius:999px; background:rgba(0,0,0,.05); color:#424346; font:inherit; font-size:16px; line-height:1; cursor:pointer; }
.carousel-btn:hover { background:rgba(0,0,0,.09); }
.carousel-dots { display:flex; gap:6px; }
.carousel-dots i { width:6px; height:6px; border-radius:50%; background:#d4d4d8; cursor:pointer; transition:background .15s; }
.carousel-dots i.on { background:#242528; }

/* area content: summary, PRs, then media */
.area-content { padding:0 0 18px 16px; }
.case-page .prose .area-content .area-sum { margin:0 0 12px; }
.case-page .prose .area-content .section-prs { margin:0 0 14px; }
.area-content > figure { margin:0; }
/* keep tall Figma pages from stretching the page: show their top */
.carousel-track figure img, .area-content > figure img { max-height:420px; width:100%; object-fit:cover; object-position:top; background:#f4f4f5; }
.carousel-track figure video { max-height:420px; object-fit:contain; background:#f4f4f5; }
.areas .prs-more summary { display:inline-flex; justify-content:flex-start; gap:8px; padding:4px 0; font-size:13px; line-height:18px; font-weight:400; color:#a1a1aa; }
.areas .prs-more summary:hover { color:#242528; }

/* table of contents: fixed beside the column on wide screens */
html:has(.case-toc) { scroll-behavior:smooth; }
.case-page h2[id] { scroll-margin-top:32px; }
.case-toc { display:none; }
@media (min-width:1100px) {
  .case-toc { display:block; position:fixed; top:120px; left:calc(50% - 280px - 220px); width:180px; font-size:13px; line-height:18px; }
  .case-toc ol { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
  .case-toc a { color:#a1a1aa; transition:color .15s; }
  .case-toc a:hover, .case-toc a[aria-current] { color:#242528; }
}
@media (prefers-reduced-motion: reduce) { html:has(.case-toc) { scroll-behavior:auto; } }

/* visuals break out of the 560px text column: wide and tall */
.case-page .carousel, .case-page .prose > figure {
  width:min(960px, calc(100vw - 48px)); position:relative; left:50%; transform:translateX(-50%); margin:20px 0 28px;
}
.case-page .carousel-track figure img, .case-page .prose > figure img { max-height:min(720px, 80vh); }
.case-page .carousel-track figure video, .case-page .prose > figure video { max-height:min(720px, 80vh); }
.case-page .carousel-track, .case-page .carousel-track img, .case-page .carousel-track video, .case-page .prose > figure img, .case-page .prose > figure video { border-radius:16px; }
/* the TOC moves to the page edge and only shows where it clears the wide visuals */
.case-toc { display:none !important; }
@media (min-width:1440px) {
  .case-toc { display:block !important; left:max(24px, calc(50% - 480px - 200px)); width:160px; }
  /* center the column (and its wide visuals) in the space right of the TOC, not the whole viewport */
  .case-page:has(.case-toc) .wrap { position:relative; left:calc((max(24px, 50vw - 680px) + 200px) / 2); }
}

/* ---- visuals in the homepage shot style ---- */
.case-page .carousel, .case-page .prose > figure.case-shot {
  width:min(960px, calc(100vw - 48px)); margin:20px 0 28px calc((100% - min(960px, calc(100vw - 48px))) / 2);
  left:auto; transform:none;
}
.case-page .carousel-track { border-radius:28px; gap:0; }
.case-shot { position:relative; aspect-ratio:5360 / 3784; border-radius:28px; overflow:hidden; background:var(--shot-fill); }
.carousel-track .case-shot { flex:0 0 100%; scroll-snap-align:start; }
.case-shot::after { content:""; position:absolute; inset:0; border-radius:inherit; box-shadow:inset 0 0 0 0.5px rgba(0,0,0,.12); pointer-events:none; }
.case-shot-box { position:absolute; inset:var(--pad); display:grid; place-items:center; }
.case-page .case-shot img, .case-page .case-shot video {
  width:100%; height:100%; max-height:none; object-fit:contain; border-radius:0; background:none; display:block;
}
/* tall pages: show their top, in a rounded frame with the same hairline as cropped homepage shots */
.case-shot.is-top .case-shot-box { overflow:hidden; border-radius:12px; }
.case-shot.is-top .case-shot-box::after { content:""; position:absolute; inset:0; border-radius:inherit; box-shadow:inset 0 0 0 0.5px rgba(0,0,0,.16); pointer-events:none; }
.case-page .case-shot.is-top img { object-fit:cover; object-position:top; }
@media (max-width:640px) { .case-shot, .case-page .carousel-track { border-radius:18px; } }

.case-shot-box { container-type:size; }
.case-crop { position:relative; overflow:hidden; width:min(100cqw, 100cqh * var(--crop-r)); }
.case-crop::after { content:""; position:absolute; inset:0; border-radius:inherit; box-shadow:inset 0 0 0 0.5px rgba(0,0,0,.16); pointer-events:none; }
.case-page .case-shot .case-crop video, .case-page .case-shot .case-crop img { height:auto; }

/* company logo above the title, like the avatar above the name in the hero */
.case-page .case-logo { display:block; width:48px; height:48px; margin:0 0 16px; border-radius:14px; }

/* part dividers: the designer-era story, then what I shipped */
.case-page .prose h2.case-part { font-size:13px; font-weight:400; color:#a1a1aa; margin:56px 0 -24px; padding-top:20px; border-top:1px solid #ececec; }
.case-page .prose h2.case-part:first-child { margin-top:8px; }
.case-toc .toc-group { margin:0 0 8px; color:#242528; font-weight:500; }
.case-toc ol + .toc-group { margin-top:24px; }
.case-toc ol:has(+ .toc-group), .case-toc .toc-group + ol { padding-left:0; }
.case-toc .toc-part { margin:0 0 8px; color:#a1a1aa; }
.case-toc ol + .toc-part { margin-top:28px; }
.case-page .prose h2.case-story { font-size:17px; margin:36px 0 -16px; }
.case-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:24px; margin:12px 0 24px; }
.case-stats dt { font-size:32px; line-height:36px; font-weight:500; letter-spacing:-0.03em; color:#242528; }
.case-stats dd { margin:6px 0 0; font-size:13px; line-height:18px; color:#a1a1aa; }
@media (max-width:520px) { .case-stats { grid-template-columns:1fr; } }
.case-page .case .facts { border-top:0; border-bottom:0; padding:0; }
.case-toc .toc-sub summary { list-style:none; display:flex; gap:8px; align-items:baseline; cursor:pointer; color:#242528; font-weight:500; margin:0 0 8px; }
.case-toc .toc-sub summary::-webkit-details-marker { display:none; }
.case-toc .toc-sub .chev { flex:none; transform:rotate(-45deg) translateY(-2px); }
.case-toc .toc-sub[open] .chev { transform:rotate(45deg) translateY(-2px); }
.case-toc .toc-sub ol { padding-left:14px !important; }
.case-toc .toc-sub + .toc-part { margin-top:28px; }
.case-toc .toc-sub .chev { display:none; }
.case-toc .toc-sub ol { margin-left:2px; padding-left:12px !important; border-left:1px solid #e4e4e7; }
.case-toc .toc-num { display:inline-block; width:22px; font-variant-numeric:tabular-nums; color:#d4d4d8; }
.case-toc a[aria-current] .toc-num, .case-toc a:hover .toc-num { color:#a1a1aa; }
.case-toc .toc-num { width:auto; min-width:16px; margin-right:10px; }
.case-toc .toc-sub summary { gap:0; }
.case-toc .toc-sub summary .toc-num { flex:none; color:#a1a1aa; font-weight:400; }
.case-toc .toc-sub ol { margin-left:5px; }
