/* ═══════════════════════════════════════════════════════════════
   CASE STUDY (v2) — builds on home.css (tokens, toolbar, sheet,
   section heads, wireframe mode, footer, lightbox)
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════ HERO ═══════════════════════ */
.case-hero { position: relative; padding: 22px var(--pad) 0; }
.case-hero .grid8 { inset: 0 0 auto 0; height: 100%; }
.case-meta { grid-template-columns: repeat(3, 1fr) auto; }
.back { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; text-decoration: none; border-bottom: 1.5px solid var(--orange); padding-bottom: 2px; }
.back:hover { color: var(--orange); }

/* fit-to-width words built from letters (title, "next" link) */
.fitword { display: block; margin: 9vh 0 4vh; font-family: var(--flex); text-transform: uppercase; line-height: .8; user-select: none; }
.fw-line { display: flex; justify-content: space-between; align-items: baseline; white-space: nowrap; }
.fw-line + .fw-line { margin-top: .03em; }
.fitword .lc {
  display: inline-block; font-variation-settings: 'wght' 1000, 'wdth' 112, 'opsz' 144;
  -webkit-text-stroke: 1.5px transparent;
  transition: font-variation-settings .25s ease-out, color .2s, -webkit-text-stroke-color .2s;
}
.fitword .lc.amp { color: var(--orange); }
.fitword .lc.thin { color: transparent; -webkit-text-stroke-color: var(--orange); }
.js .fitword .lc.pre { font-variation-settings: 'wght' 120, 'wdth' 25, 'opsz' 144; color: transparent; -webkit-text-stroke-color: currentColor; }
.js .fitword .lc.pre.amp { -webkit-text-stroke-color: var(--orange); }
.js .fitword .lc.go { transition: font-variation-settings .9s cubic-bezier(.2,.9,.2,1), color .3s .45s, -webkit-text-stroke-color .3s .45s; }

.case-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 64px; align-items: end; margin-bottom: 56px; }
.case-intro p { font-size: clamp(18px, 1.6vw, 22px); max-width: 620px; }
.case-intro p b, .hl { background: var(--orange); color: var(--ink); font-weight: 600; padding: 0 5px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.tags li { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .04em; padding: 6px 11px; border: 1.5px solid var(--ink); border-radius: 999px; }

/* browser frame with a design-tool selection around it */
.browser-frame { position: relative; margin: 0 0 120px; border: 1.5px solid var(--ink); border-radius: 16px; background: var(--paper); }
.browser-frame.sel::after { content: ''; position: absolute; inset: -9px; border: 1.5px solid var(--orange); border-radius: 22px; pointer-events: none; }
.browser-frame > .hd.a { left: -14px; top: -14px; } .browser-frame > .hd.b { right: -14px; top: -14px; }
.browser-frame > .hd.c { left: -14px; bottom: -14px; } .browser-frame > .hd.d { right: -14px; bottom: -14px; }
.sel-tag { position: absolute; left: -10px; top: -10px; transform: translateY(-100%); font: 500 11px var(--mono); background: var(--orange); color: var(--ink); padding: 3px 7px; }
.chrome-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1.5px solid var(--ink); text-decoration: none; color: var(--ink); }
.chrome-bar i { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--ink); }
.chrome-bar i:first-child { background: var(--orange); border-color: var(--orange); }
.addr { margin-left: 12px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 500 13px var(--mono); background: #F2F2F0; border-radius: 8px; padding: 6px 12px; }
.live { display: inline-flex; align-items: center; gap: 8px; font: 500 12px var(--mono); text-transform: uppercase; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: var(--paper); }
.live em { width: 7px; height: 7px; border-radius: 50%; background: #2FD98A; box-shadow: 0 0 0 0 rgba(47,217,138,.6); animation: livePing 1.8s infinite; }
@keyframes livePing { 70% { box-shadow: 0 0 0 7px rgba(47,217,138,0); } 100% { box-shadow: 0 0 0 0 rgba(47,217,138,0); } }
.chrome-bar:hover .addr { color: var(--orange); }
.cover-img { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 0 0 14px 14px; }
.cover-img img { width: 100%; height: 100%; object-fit: cover; }

/* ═══════════════════════ OVERVIEW ═══════════════════════ */
.overview { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 72px; }
.ov-text p { font-size: 18px; color: #333; margin-bottom: 18px; max-width: 680px; }
.ov-text .lead-sm { font-family: var(--flex); font-size: clamp(21px, 1.8vw, 27px); line-height: 1.3; color: var(--ink); font-variation-settings: 'wght' 560, 'wdth' 100, 'opsz' 144; margin-bottom: 24px; }
.facts { border-top: 1.5px solid var(--ink); align-self: start; }
.facts div { display: grid; grid-template-columns: 90px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts dt { font: 500 12px var(--mono); color: var(--orange); text-transform: uppercase; padding-top: 3px; }
.facts a { border-bottom: 1.5px solid var(--orange); text-decoration: none; }

/* ═══════════════════════ BEFORE / AFTER ═══════════════════════ */
.compare {
  position: relative; aspect-ratio: 16 / 10; border: 1.5px solid var(--ink); border-radius: 16px; overflow: hidden;
  background: var(--paper); cursor: ew-resize; touch-action: pan-y; user-select: none;
}
.compare .img { position: absolute; inset: 0; }
.compare img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.cmp-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.cmp-before img { object-position: 50% 0; }
.cmp-label { position: absolute; top: 14px; z-index: 4; font: 500 12px var(--mono); text-transform: uppercase; padding: 5px 10px; border-radius: 999px; background: var(--ink); color: var(--paper); }
.cmp-label.l { left: 14px; } .cmp-label.r { right: 14px; background: var(--orange); color: var(--ink); }
.cmp-handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos); z-index: 5; width: 2px; margin-left: -1px; background: var(--orange); cursor: ew-resize;
}
.cmp-handle span {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; transform: translate(-50%, -50%); border-radius: 50%;
  background: var(--orange); color: var(--ink); display: grid; place-items: center; font-size: 20px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(17,17,17,.25);
}
.cmp-handle:focus-visible span { outline: 2px solid var(--ink); outline-offset: 3px; }

.problems { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 48px; }
.problems li { background: var(--paper); border: 1.5px solid var(--ink); border-radius: 16px; padding: 22px 22px 24px; display: grid; gap: 10px; align-content: start; }
.problems h3 { font-size: 21px; line-height: 1.2; font-weight: 600; }
.problems p { font-size: 15px; color: #333; }
.aside-note { margin-top: 22px; font: 500 13px/1.6 var(--mono); color: var(--muted); max-width: 720px; }

/* ═══════════════════════ PROCESS ═══════════════════════ */
.process { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 72px; align-items: start; }

/* a Figma-style layers panel that tracks the phase you're reading */
.layers { position: sticky; top: 24px; border: 1.5px solid var(--ink); border-radius: 14px; padding: 12px 8px 10px; background: var(--paper); }
.layers-title { display: block; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 2px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.layers ol { list-style: none; }
.layers a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; font-size: 14px; color: #444; transition: background .2s, color .2s; }
.layers a i { width: 11px; height: 11px; border: 1.5px solid currentColor; border-radius: 2px; flex: none; }
.layers a:hover { background: rgba(255,84,0,.08); color: var(--ink); }
.layers a.on { background: var(--orange); color: var(--ink); font-weight: 600; }
.layers a.on i { background: var(--ink); border-color: var(--ink); }

.phase { padding: 0 0 96px; scroll-margin-top: 24px; }
.phase + .phase { border-top: 1.5px solid var(--ink); padding-top: 56px; }
.phase-no { display: block; font: 500 12px var(--mono); color: var(--orange); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }
.phase h3 { font-family: var(--flex); font-size: clamp(28px, 3.1vw, 46px); line-height: 1.02; font-variation-settings: 'wght' 900, 'wdth' 100, 'opsz' 144; margin-bottom: 22px; max-width: 820px; }
.phase p { font-size: 17px; color: #333; max-width: 700px; margin-bottom: 16px; }
.phase .mini-head { font-size: 20px; font-weight: 600; margin: 48px 0 10px; }

/* home.css crops its .shot thumbnails to 16:10; case figures keep the image's own ratio and show their caption */
figure.shot { margin-top: 28px; aspect-ratio: auto; overflow: visible; }
.shot .img { display: block; border: 1.5px solid var(--ink); border-radius: 14px; overflow: hidden; cursor: zoom-in; }
.shot img { width: 100%; height: auto; transition: transform .6s; }
.shot .img:hover img { transform: scale(1.02); }
.shot figcaption, .phone figcaption, .swap-card figcaption { margin-top: 12px; font-size: 14px; color: var(--muted); max-width: 640px; }
.shot figcaption b, .swap-card figcaption b { color: var(--ink); font-weight: 600; }

.chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.chips div { border: 1.5px solid var(--ink); border-radius: 12px; padding: 14px 14px 16px; }
.chips dt { font: 500 11px var(--mono); text-transform: uppercase; color: var(--orange); margin-bottom: 6px; }
.chips dd { font-family: var(--flex); font-size: 20px; line-height: 1.1; font-variation-settings: 'wght' 800, 'wdth' 100, 'opsz' 144; }

.specimens { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.spec { border: 1.5px solid var(--ink); border-radius: 12px; padding: 18px; display: grid; gap: 2px; }
.spec-aa { font-size: 64px; line-height: 1; margin-bottom: 12px; color: #005F4E; }
.spec.serif .spec-aa { font-family: 'Fraunces', serif; }
.spec.sans .spec-aa { font-family: 'Inter', sans-serif; font-weight: 500; }
.spec.cjk .spec-aa { font-family: 'Noto Serif TC', 'Songti TC', 'SimSun', serif; font-size: 48px; padding-top: 10px; }
.spec b { font-weight: 600; }
.spec i { font-style: normal; font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; }

.sitemap { margin-top: 28px; padding: 28px; border: 1.5px dashed var(--ink); border-radius: 14px; display: grid; justify-items: center; gap: 36px; position: relative; }
.sm-root, .sm-node { font: 500 13px var(--mono); padding: 10px 14px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--paper); position: relative; }
.sm-root { background: var(--ink); color: var(--paper); }
.sm-root::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 18px; background: var(--orange); }
.sm-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding-top: 18px; border-top: 1.5px solid var(--orange); position: relative; }
.sm-tpl { border-color: var(--orange); border-style: dashed; }
.sm-tpl em { display: block; font-style: normal; color: var(--orange); font-size: 11px; margin-top: 2px; }

.gaps { margin: 6px 0 0 20px; display: grid; gap: 10px; max-width: 700px; }
.gaps li { font-size: 16px; color: #333; padding-left: 4px; }
.gaps li::marker { color: var(--orange); font: 500 14px var(--mono); }
.gaps b { color: var(--ink); }

/* palette reversal: the same mosaic in both directions */
.palette { margin-top: 30px; border: 1.5px solid var(--ink); border-radius: 16px; padding: 16px; background: var(--paper); }
.pal-switch { display: inline-flex; padding: 3px; border: 1.5px solid var(--ink); border-radius: 999px; margin-bottom: 14px; }
.pal-switch button { font: 600 13px 'Space Grotesk', sans-serif; padding: 8px 16px; border-radius: 999px; transition: background .2s; }
.pal-switch button[aria-pressed="true"] { background: var(--orange); }
.pal-view { position: relative; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.pal-img { position: absolute; inset: 0; transition: opacity .5s; }
.pal-img img { width: 100%; height: 100%; object-fit: cover; }
.palette[data-state="green"] .pal-img.beige, .palette[data-state="beige"] .pal-img.green { opacity: 0; }
.swatches { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.palette[data-state="green"] .swatches.beige, .palette[data-state="beige"] .swatches.green { display: none; }
.swatches li { font: 500 11px var(--mono); color: var(--muted); }
.swatches li::before { content: ''; display: block; height: 44px; border-radius: 8px; background: var(--c); border: 1px solid var(--line); margin-bottom: 6px; }
.swatches b { display: block; color: var(--ink); font: 600 12px 'Space Grotesk', sans-serif; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.rules { list-style: none; display: grid; gap: 8px; margin: 6px 0 22px; max-width: 700px; }
.rules li { position: relative; padding-left: 28px; font-size: 16px; }
.rules li::before { content: '✓'; position: absolute; left: 0; top: 0; color: var(--orange); font-weight: 600; }
.rules li.no::before { content: '✕'; }

.swap { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 26px; }
.swap-card .crop { display: block; aspect-ratio: 4 / 5; border-radius: 14px; border: 1.5px solid var(--ink); background-repeat: no-repeat; }
/* tile at x 1075–1430, y 0–450 of the 1440×900 screenshot (stops before its scrollbar) */
.swap-card.rejected .crop { background-image: url('../assets/projects/resourcehub/02-beige-v1.jpg'); background-size: 405.6% auto; background-position: 99.1% 0; }
/* tile at x 2164–2880, y 161–896 of the 2880×1800 screenshot, cropped to 4:5 inside it */
.swap-card.shipped .crop { background-image: url('../assets/projects/resourcehub/09-final-mosaic.jpg'); background-size: 490% auto; background-position: 97.2% 15.1%; }
.swap-card { position: relative; }
.swap-card.rejected::before, .swap-card.shipped::before {
  position: absolute; top: 12px; left: 12px; z-index: 4; font: 500 12px var(--mono); text-transform: uppercase; padding: 5px 10px; border-radius: 999px;
}
.swap-card.rejected::before { content: '✕ Rejected'; background: var(--ink); color: var(--paper); }
.swap-card.shipped::before { content: '✓ Shipped'; background: var(--orange); color: var(--ink); }

/* the rejected candidates are drawn as wireframe placeholders */
.candidates { list-style: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin: 16px 0 6px; }
.cand { font: 500 11px/1.35 var(--mono); color: var(--muted); }
.cand .x, .cand .crop {
  display: block; aspect-ratio: 1; border-radius: 10px; margin-bottom: 8px;
}
.cand .x {
  border: 1.5px dashed var(--ink);
  background:
    linear-gradient(to top right, transparent calc(50% - 1px), var(--ink) 50%, transparent calc(50% + 1px)),
    linear-gradient(to top left, transparent calc(50% - 1px), var(--ink) 50%, transparent calc(50% + 1px));
  opacity: .55;
}
.cand.ok { color: var(--ink); font-weight: 600; }
.cand.ok .crop { border: 2px solid var(--orange); background: url('../assets/projects/resourcehub/05-process-step.jpg') no-repeat 94% 30% / 232% auto; box-shadow: 0 0 0 4px rgba(255,84,0,.18); }

.phones { display: grid; grid-template-columns: 180px 180px minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 28px; }
.phone .img { display: block; aspect-ratio: 1170 / 2532; border: 5px solid var(--ink); border-radius: 26px; overflow: hidden; cursor: zoom-in; }
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.phones .qr { margin-top: 0; }

/* ═══════════════════════ RESULT ═══════════════════════ */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1.5px solid rgba(255,255,255,.3); margin-bottom: 80px; }
.stats div { padding: 26px 20px 0 0; display: flex; flex-direction: column-reverse; gap: 8px; }
.stats div + div { padding-left: 24px; border-left: 1px solid rgba(255,255,255,.15); }
.stats dd { font-family: var(--flex); font-size: clamp(48px, 6vw, 96px); line-height: .9; color: var(--orange); font-variation-settings: 'wght' 1000, 'wdth' 100, 'opsz' 144; }
.stats dt { font-size: 14px; color: rgba(255,255,255,.65); }

/* the client's words, pinned like a design comment on the live site */
.pinned { position: relative; margin-bottom: 80px; }
.pinned-shot { display: block; aspect-ratio: 16 / 8; border-radius: 16px; overflow: hidden; border: 1.5px solid #333; }
.pinned-shot img { width: 100%; height: 100%; object-fit: cover; opacity: .45; filter: grayscale(.3); }
.pin {
  position: absolute; left: 42%; top: 30%; z-index: 4; width: 38px; height: 38px; border-radius: 50% 50% 50% 4px;
  background: var(--orange); color: var(--ink); display: grid; place-items: center; font-weight: 600; box-shadow: 0 0 0 5px rgba(255,84,0,.25);
}
.comment {
  position: absolute; left: calc(42% + 52px); top: 30%; z-index: 5; width: min(520px, 52%);
  background: var(--paper); color: var(--ink); border-radius: 4px 18px 18px 18px; padding: 20px 22px 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.comment header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-weight: 600; }
.comment header b { display: block; font-weight: 600; line-height: 1.2; }
.comment header i { display: block; font: 500 11px var(--mono); font-style: normal; color: var(--muted); text-transform: uppercase; }
.comment p { font-size: clamp(17px, 1.5vw, 21px); line-height: 1.45; }

.visit { display: block; text-decoration: none; color: var(--paper); border-top: 1.5px solid rgba(255,255,255,.3); padding-top: 26px; }
.visit-url {
  display: block; margin-top: 10px; font-family: var(--flex); font-size: min(6.2vw, 108px); line-height: .95; text-transform: lowercase; white-space: nowrap;
  font-variation-settings: 'wght' 950, 'wdth' 100, 'opsz' 144; -webkit-text-stroke: 1.5px transparent;
  transition: font-variation-settings .45s cubic-bezier(.2,.9,.2,1), color .25s, -webkit-text-stroke-color .25s;
}
.visit:hover .visit-url { font-variation-settings: 'wght' 250, 'wdth' 50, 'opsz' 144; color: transparent; -webkit-text-stroke-color: var(--orange); }

/* ═══════════════════════ LESSONS ═══════════════════════ */
.lessons { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; border-top: 1.5px solid var(--ink); counter-reset: l; }
.lessons li { counter-increment: l; position: relative; padding: 24px 0 24px 44px; border-bottom: 1px solid var(--line); font-size: 16px; color: #333; }
.lessons li::before { content: counter(l, decimal-leading-zero); position: absolute; left: 0; top: 27px; font: 500 13px var(--mono); color: var(--orange); }
.lessons b { color: var(--ink); font-weight: 600; display: block; font-size: 18px; margin-bottom: 4px; }

/* ═══════════════════════ NEXT ═══════════════════════ */
.next { display: block; padding: 90px var(--pad) 70px; border-top: 1.5px solid var(--ink); text-decoration: none; color: var(--ink); }
.next .fitword { margin: 18px 0 18px; }
.next-note { font: 500 13px var(--mono); text-transform: uppercase; color: var(--muted); }
.next:hover .next-note { color: var(--orange); }

/* ═══════════════════════ WIREFRAME MODE (case additions) ═══════════════════════ */
body.wire .fitword .lc, body.wire .phase h3, body.wire .stats dd, body.wire .visit-url, body.wire .ov-text .lead-sm, body.wire .chips dd {
  color: transparent !important; -webkit-text-stroke: 1.5px var(--wf-ln) !important;
}
body.wire .fitword .lc.amp, body.wire .stats dd { -webkit-text-stroke-color: var(--orange) !important; }
body.wire :is(.browser-frame, .cover-img, .compare, .problems li, .layers, .layers a, .shot .img, .chips div, .spec, .sitemap, .sm-root, .sm-node, .palette, .pal-view, .pal-switch, .pal-switch button, .swap-card .crop, .cand .x, .cand .crop, .phone .img, .pinned-shot, .comment, .tags li, .live, .addr, .cmp-label, .cmp-handle span) { border-radius: 0 !important; }
body.wire :is(.problems li, .layers, .chips div, .spec, .palette, .comment) { border-style: dashed; box-shadow: none; }
body.wire .swap-card .crop, body.wire .cand.ok .crop { background: none; position: relative; }
body.wire .swap-card .crop::after, body.wire .cand.ok .crop::after { display: block; }
body.wire .swatches li::before { background: transparent; border: 1.5px dashed var(--ink); }
body.wire .hl, body.wire .case-intro p b { background: transparent; box-shadow: inset 0 0 0 1.5px var(--orange); }

/* ═══════════════════════ RESPONSIVE ═══════════════════════ */
@media (max-width: 1100px) {
  .process { grid-template-columns: 200px minmax(0, 1fr); gap: 40px; }
  .chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phones { grid-template-columns: 1fr 1fr; }
  .phones .qr { grid-column: 1 / -1; }
  .candidates { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .comment { left: auto; right: 4%; width: min(480px, 60%); }
}

@media (max-width: 760px) {
  .case-meta { grid-template-columns: 1fr auto; }
  .case-meta > div:nth-child(2), .case-meta > div:nth-child(3) { display: none; }
  .fitword { margin: 7vh 0 3vh; }
  .case-intro { grid-template-columns: 1fr; margin-bottom: 40px; }
  .tags { justify-content: flex-start; }
  .browser-frame { margin-bottom: 80px; }
  .addr { font-size: 11px; margin-left: 6px; }
  .live { font-size: 10px; padding: 5px 9px; }
  .browser-frame > .hd, .sel-tag { display: none; }
  .browser-frame.sel::after { inset: -6px; }

  .overview { grid-template-columns: 1fr; gap: 40px; }
  .ov-text p { font-size: 16px; }

  .compare { aspect-ratio: 4 / 5; }
  .cmp-label { font-size: 10px; }
  .problems { grid-template-columns: 1fr; }

  /* phones: the layers panel becomes a sticky strip of phase chips */
  .process { grid-template-columns: 1fr; gap: 24px; }
  .layers { top: 0; z-index: 20; border-radius: 0; border-width: 0 0 1.5px; margin: 0 calc(-1 * var(--pad)); padding: 8px var(--pad); overflow-x: auto; scrollbar-width: none; }
  .layers::-webkit-scrollbar { display: none; }
  .layers-title { display: none; }
  .layers ol { display: flex; gap: 6px; width: max-content; }
  .layers a { white-space: nowrap; padding: 7px 11px; font-size: 13px; border: 1px solid var(--line); border-radius: 999px; }
  .layers a i { display: none; }
  .phase { scroll-margin-top: 60px; padding-bottom: 64px; }
  .phase + .phase { padding-top: 40px; }
  .phase p { font-size: 16px; }

  .specimens { grid-template-columns: 1fr; }
  .spec { grid-template-columns: auto 1fr; align-items: center; column-gap: 16px; }
  .spec-aa { grid-row: span 2; font-size: 44px; margin: 0; }
  .spec.cjk .spec-aa { font-size: 32px; padding: 0; }
  .pair, .swap { grid-template-columns: 1fr; }
  .swap { grid-template-columns: 1fr 1fr; gap: 12px; }
  .swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .candidates { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .phones { grid-template-columns: 1fr 1fr; gap: 12px; }

  .stats { grid-template-columns: 1fr 1fr; margin-bottom: 56px; }
  .stats div { padding: 22px 12px 18px 0; border-bottom: 1px solid rgba(255,255,255,.15); }
  .stats div + div { padding-left: 0; border-left: 0; }
  .stats div:nth-child(even) { padding-left: 16px; border-left: 1px solid rgba(255,255,255,.15); }
  .pinned-shot { aspect-ratio: 16 / 10; }
  .pin { left: 12%; top: 18%; }
  .comment { position: relative; left: auto; right: auto; top: auto; width: auto; margin: -40px 12px 0; }
  .lessons { grid-template-columns: 1fr; }
  .visit-url { white-space: normal; font-size: 9vw; overflow-wrap: anywhere; }
  .next { padding: 64px var(--pad) 56px; }
}
