:root {
    --font: 'Jost', ui-sans-serif, system-ui, sans-serif;
    --bar-bg: #5c2a33;
    --bar-text: #ffffff;
    --text: #1c1c1c;
    --soft: #3f3f3c;
    --muted: #6b6b66;
    --rule: #e2e2de;
    --frame: #f4f4f1;
}
:root[data-theme="dark"] { --frame: #2e2e2c; }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg, #fff);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--rule); transition: text-decoration-color 0.2s; }
a:hover { text-decoration-color: var(--text); }

svg.icon { width: 1em; height: 1em; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* Top bar */
.navbar { position: sticky; top: 0; z-index: 10; height: 62px; background: var(--bar-bg); color: var(--bar-text); display: flex; align-items: center; padding: 0 30px; }
.navbar a { color: inherit; text-decoration: none; }
.navbar .brand { font-size: 21px; margin-right: 24px; }
.navbar .links { display: flex; gap: 4px; flex: 1; }
.navbar .links a { padding: 8px 10px; opacity: 0.8; transition: opacity 0.2s; }
.navbar .links a:hover, .navbar .links a[aria-current="page"] { opacity: 1; }
.navbar .tools { display: flex; gap: 18px; font-size: 21px; }

/* Case study */
.case { max-width: 760px; margin: 0 auto; padding: 40px 30px 90px; }

.back { display: inline-block; font-size: 14.5px; color: var(--muted); text-decoration: none; margin-bottom: 30px; }
.back:hover { color: var(--text); }

.case h1 { font-size: 42px; font-weight: 500; line-height: 1.12; letter-spacing: -0.01em; }
.lede { font-size: 21px; font-weight: 300; line-height: 1.5; color: var(--soft); margin: 14px 0 26px; }

.meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 24px; padding: 18px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.meta dt { font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.meta dd { font-size: 15px; line-height: 1.5; }
.meta .stack-row { grid-column: 1 / -1; }

.out { display: flex; flex-wrap: wrap; gap: 22px; margin: 16px 0 36px; font-size: 15.5px; }

/* One frame for every image: 16:10, contained, same border and radius */
.frame { margin: 0; }
.frame .pic {
    display: block; width: 100%; border-radius: 12px; overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 14px 34px -18px rgba(0,0,0,0.28);
}
.frame picture, .frame img { display: block; width: 100%; height: auto; }
.frame figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.hero { margin-bottom: 44px; }

.case section { margin-bottom: 38px; }
.case h2 { font-size: 24px; font-weight: 500; line-height: 1.25; margin-bottom: 10px; }
.case h3 { font-size: 17.5px; font-weight: 500; margin: 20px 0 4px; }
.case section p, .case section li { color: var(--soft); font-weight: 300; }
.case section p + p { margin-top: 10px; }
.case section strong { font-weight: 500; color: var(--text); }
.case section ul { padding-left: 20px; }
.case section li + li { margin-top: 4px; }
.case section li::marker { color: var(--muted); }

/* Album */
.album { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 16px; }
.album .frame figcaption { font-size: 12.5px; line-height: 1.4; }
.album a.pic { cursor: zoom-in; transition: transform 0.3s cubic-bezier(.16, 1, .3, 1), box-shadow 0.3s ease; }
.album a.pic:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -16px rgba(0,0,0,0.35); }
.album-count { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 8px; }

.lightbox {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center; gap: 12px;
    background: rgba(18, 18, 17, 0.92); padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(1200px, 100%); display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 8px; display: block; }
.lightbox figcaption { display: flex; gap: 14px; color: #e7e6e1; font-size: 14px; margin-top: 12px; }
.lb-count { color: #a3a29c; font-variant-numeric: tabular-nums; }
.lightbox button {
    background: none; border: none; color: #f2f1ec; cursor: pointer; font: inherit;
    font-size: 34px; line-height: 1; width: 48px; height: 48px; border-radius: 50%;
    opacity: 0.75; transition: opacity 0.2s, background 0.2s;
}
.lightbox button:hover, .lightbox button:focus-visible { opacity: 1; background: rgba(255,255,255,0.08); outline: none; }
.lb-close { position: absolute; top: 14px; right: 16px; font-size: 30px; }

.pager { display: flex; justify-content: space-between; gap: 20px; padding-top: 22px; border-top: 1px solid var(--rule); margin-top: 26px; }
.pager a { text-decoration: none; display: flex; flex-direction: column; max-width: 48%; }
.pager a span { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.pager a b { font-weight: 500; font-size: 17px; }
.pager a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.pager .next { text-align: right; margin-left: auto; }

@media (max-width: 640px) {
    .navbar { padding: 0 16px; }
    .navbar .brand { font-size: 18px; margin-right: 8px; }
    .case { padding: 26px 18px 60px; }
    .case h1 { font-size: 33px; }
    .lede { font-size: 19px; }
    .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .album { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
    .hero .pic { max-width: 300px; margin: 0 auto; border-radius: 20px; }
    .hero figcaption { text-align: center; }
    .album .pic { border-radius: 14px; }
    .lb-prev, .lb-next { display: none; }
}

/* ---------- Screenshot carousel ---------- */
.carousel { margin: 6px 0 46px; }
.cz-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cz-mode { display: inline-flex; padding: 3px; border: 1px solid var(--rule); border-radius: 999px; }
.cz-mode button {
    font: inherit; font-size: 13.5px; color: var(--muted); background: none; border: 0;
    padding: 4px 14px; border-radius: 999px; cursor: pointer; transition: background 0.2s, color 0.2s;
}
.cz-mode button[aria-pressed="true"] { background: var(--text); color: var(--bg, #fff); }
.cz-count { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.cz-stage { position: relative; }
.cz-track {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
    scrollbar-width: none; outline: none; border-radius: 14px;
}
.cz-track::-webkit-scrollbar { display: none; }
.cz-slide { flex: 0 0 100%; scroll-snap-align: center; margin: 0; padding: 0 2px 6px; }
.cz-slide .pic {
    display: block; border-radius: 12px; overflow: hidden; cursor: zoom-in;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 16px 36px -20px rgba(0,0,0,0.32);
}
.cz-slide img { display: block; width: 100%; height: auto; }
.cz-slide figcaption { font-size: 13.5px; color: var(--muted); margin-top: 10px; text-align: center; }

.is-phone .cz-slide .pic { width: fit-content; max-width: 100%; margin: 0 auto; border-radius: 24px; }
.is-phone .cz-slide img { width: auto; max-width: 100%; height: min(68vh, 620px); }

.cz-nav {
    position: absolute; top: calc(50% - 26px); transform: translateY(-50%);
    width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--rule);
    background: var(--bg, #fff); color: var(--text); font-size: 26px; line-height: 1; cursor: pointer;
    box-shadow: 0 6px 18px -8px rgba(0,0,0,0.3); transition: opacity 0.2s, transform 0.2s;
}
.cz-prev { left: -20px; }
.cz-next { right: -20px; }
.cz-nav:hover { transform: translateY(-50%) scale(1.06); }
.cz-nav:disabled { opacity: 0; pointer-events: none; }

.cz-thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 14px 2px 4px; scrollbar-width: none; }
.cz-thumbs::-webkit-scrollbar { display: none; }
.cz-thumb {
    flex: 0 0 auto; padding: 0; border: 0; background: none; cursor: pointer;
    border-radius: 7px; overflow: hidden; opacity: 0.5; outline: 2px solid transparent; outline-offset: 2px;
    transition: opacity 0.2s, outline-color 0.2s;
}
.cz-thumb img { display: block; width: 104px; height: 65px; object-fit: cover; object-position: top; }
.is-phone .cz-thumb img { width: 40px; height: 86px; }
.cz-thumb:hover { opacity: 0.85; }
.cz-thumb.active { opacity: 1; outline-color: var(--text); }

/* ---------- Bullet writing ---------- */
.out-gap { height: 26px; }
.case ul.hl { list-style: none; padding: 0; }
.case ul.hl li { padding-left: 18px; position: relative; }
.case ul.hl li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 7px; height: 7px; border-radius: 50%; background: var(--bar-bg); }
.case ul.hl li + li { margin-top: 10px; }
.case ul.hl strong { font-weight: 600; }
.case ul.cols { columns: 2; column-gap: 32px; }
.case ul.cols li { break-inside: avoid; }

@media (max-width: 640px) {
    .cz-nav { display: none; }
    .case ul.cols { columns: 1; }
    .is-phone .cz-slide img { height: min(62vh, 560px); }
}
