/* Berri use cases: /use-cases/ and /use-cases/<slug>/. Prefix uc-. Builds on /b2.css, /home.css, /home-motion.css.
   Transform and opacity only; start states live behind html.js (b2-rise), so the page reads with JS off. */

.uc-page [hidden] { display: none !important; }

/* ---------- Role glyphs ---------- */
.uc-glyph { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px; color: var(--uc-ink); background: var(--uc-bg); box-shadow: 0 1px 0 rgb(255 255 255 / .7) inset, 0 8px 18px -12px var(--uc-ink); }
.uc-glyph svg { width: 22px; height: 22px; }
.uc-glyph--s { width: 24px; height: 24px; border-radius: 8px; box-shadow: none; }
.uc-glyph--s svg { width: 14px; height: 14px; }
.uc-glyph--l { width: 56px; height: 56px; border-radius: 18px; }
.uc-glyph--l svg { width: 28px; height: 28px; }
.uc-glyph--berry { --uc-bg: var(--b2-light-berry); --uc-ink: #9C1848; }
.uc-glyph--gold { --uc-bg: var(--b2-light-gold); --uc-ink: #7A5410; }
.uc-glyph--blue { --uc-bg: var(--b2-light-blue); --uc-ink: #3B3F9E; }
.uc-glyph--mint { --uc-bg: var(--b2-light-mint); --uc-ink: #1D5A43; }
.uc-glyph--peach { --uc-bg: var(--b2-light-peach); --uc-ink: #9A4A16; }

.uc-dot--strawberry { background: var(--b2-strawberry); }
.uc-dot--mango { background: var(--b2-mango); }

/* ---------- Index hero ---------- */
.uc-hero { padding-bottom: clamp(32px, 5vw, 56px); }
.uc-hero__title { max-width: 15ch; }
.uc-search { position: relative; width: min(100%, 560px); margin-top: 34px; }
.uc-search svg { position: absolute; left: 20px; top: 50%; width: 20px; height: 20px; translate: 0 -50%; color: var(--b2-ink-2); pointer-events: none; }
.uc-search__in { width: 100%; min-height: 58px; padding: 0 22px 0 54px; border-radius: 999px; border: 1px solid var(--b2-line-strong); background: rgb(255 255 255 / .92); font: 400 1rem/1 var(--b2-body); color: var(--b2-ink); box-shadow: 0 1px 0 #fff inset, 0 18px 40px -22px rgb(120 40 70 / .4); transition: box-shadow .3s var(--b2-ease), border-color .3s; }
.uc-search__in:focus { outline: none; border-color: var(--b2-ink); box-shadow: 0 0 0 4px rgb(206 36 96 / .12), 0 18px 40px -22px rgb(120 40 70 / .45); }
.uc-search__in::-webkit-search-cancel-button { cursor: pointer; }
.uc-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; max-width: 880px; }
.uc-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 10px; border-radius: 999px; border: 1px solid var(--b2-line); background: rgb(255 255 255 / .8); color: var(--b2-ink); font: 500 .9rem/1 var(--b2-body); text-decoration: none; transition: transform .3s var(--b2-ease), background-color .25s, color .25s, border-color .25s; }
.uc-chip[data-role="all"] { padding-left: 16px; }
.uc-chip:hover { transform: translateY(-2px); border-color: var(--b2-line-strong); }
.uc-chip[aria-current="true"] { background: var(--b2-ink); border-color: var(--b2-ink); color: var(--b2-bg); }
.js .uc-search, .js .uc-chips { animation: hm-fade-up .6s var(--b2-ease) .35s both; }
.js .uc-chips { animation-delay: .5s; }
.is-instant .uc-search, .is-instant .uc-chips { animation: none; }

/* ---------- Groups and cards ---------- */
.uc-list { padding-bottom: clamp(40px, 6vw, 72px); }
.uc-group:first-of-type { padding-top: 8px; }
.uc-count { margin: 0 0 8px; min-height: 1.5em; text-align: center; color: var(--b2-ink-2); font-size: .9rem; }
.uc-group { padding-top: clamp(40px, 6vw, 72px); scroll-margin-top: calc(var(--b2-bar) + 16px); }
.uc-group__h { display: flex; align-items: center; gap: 16px; margin-bottom: clamp(18px, 3vw, 28px); }
.uc-group__h h2 { margin: 0; font: 700 clamp(1.5rem, 3vw, 2.1rem)/1.1 var(--b2-display); letter-spacing: -.025em; }
.uc-group__h p { margin: 4px 0 0; color: var(--b2-ink-2); }
.uc-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 18px); }
.uc-card a { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; gap: 10px; height: 100%; padding: 22px 22px 18px; border-radius: 22px; border: 1px solid var(--b2-line); background: rgb(255 255 255 / .82); color: var(--b2-ink); text-decoration: none; box-shadow: 0 1px 0 #fff inset; transition: transform .45s var(--b2-ease), box-shadow .45s var(--b2-ease), border-color .3s; overflow: hidden; }
.uc-card a::after { content: ""; position: absolute; right: -60px; top: -60px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(closest-side, var(--b2-light-berry), transparent); opacity: 0; transition: opacity .5s var(--b2-ease), transform .6s var(--b2-ease); transform: scale(.6); pointer-events: none; }
.uc-card a:hover { transform: translateY(-4px); border-color: var(--b2-line-strong); box-shadow: 0 1px 0 #fff inset, 0 26px 50px -26px rgb(27 26 31 / .3); }
.uc-card a:hover::after { opacity: .7; transform: scale(1); }
.uc-card h3 { margin: 6px 0 0; font: 650 1.12rem/1.28 var(--b2-display); letter-spacing: -.012em; text-wrap: balance; }
.uc-card p { margin: 0; color: var(--b2-ink-2); font-size: .94rem; line-height: 1.5; }
.uc-card__meta { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .8rem; color: var(--b2-ink-2); }
.uc-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--b2-line-strong); }
.uc-grid > li:nth-child(3n+2) { transition-delay: .08s; }
.uc-grid > li:nth-child(3n) { transition-delay: .16s; }
.uc-empty { margin: 48px auto 0; max-width: 32em; text-align: center; color: var(--b2-ink-2); }
@media (max-width: 1000px) { .uc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .uc-grid { grid-template-columns: minmax(0, 1fr); } .uc-grid > li { transition-delay: 0s !important; } }

/* ---------- Detail hero ---------- */
.uc-dhero { padding-top: clamp(40px, 7vw, 88px); padding-bottom: clamp(24px, 4vw, 40px); }
.uc-dhero__in { position: relative; z-index: 1; display: grid; justify-items: start; }
.uc-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .9rem; color: var(--b2-ink-2); margin-bottom: 22px; }
.uc-crumb a { color: inherit; text-underline-offset: 3px; }
.uc-crumb a:hover { color: var(--b2-ink); }
.uc-dhero__glyph { margin-bottom: 18px; }
.uc-dtitle { max-width: 20ch; font-size: clamp(2.1rem, 5.4vw, 3.9rem); }
.uc-dhero__lede { margin-top: 18px; }
.uc-facts { list-style: none; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); width: 100%; border-top: 1px solid var(--b2-line); }
.uc-facts li { display: grid; gap: 4px; align-content: start; padding: 16px 20px 4px 0; font-size: .95rem; }
.uc-facts li + li { padding-left: 20px; border-left: 1px solid var(--b2-line); }
.uc-facts a { color: var(--b2-berry-ink); font-weight: 600; text-underline-offset: 3px; }
.uc-k { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--b2-ink-3, var(--b2-ink-2)); }
.uc-mode { display: inline-flex; align-items: center; gap: 8px; }
.js .uc-dhero .uc-facts, .js .uc-dhero__lede { animation: hm-fade-up .6s var(--b2-ease) .35s both; }
.is-instant .uc-dhero .uc-facts, .is-instant .uc-dhero__lede { animation: none; }
@media (max-width: 760px) {
  .uc-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uc-facts li:first-child { grid-column: 1 / -1; padding-right: 0; }
  .uc-facts li + li { padding-left: 0; border-left: 0; }
  .uc-facts li:nth-child(n+2) { border-top: 1px solid var(--b2-line); }
  .uc-facts li:nth-child(3) { padding-left: 16px; border-left: 1px solid var(--b2-line); }
}

/* ---------- Detail body ---------- */
.uc-body { padding-block: clamp(24px, 4vw, 48px) clamp(56px, 8vw, 96px); }
.uc-body__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 4vw, 64px); align-items: start; }
.uc-steps { display: grid; gap: clamp(28px, 3.5vw, 40px); }
.uc-h { margin: 0 0 12px; font: 650 1.2rem/1.25 var(--b2-display); letter-spacing: -.015em; }
.uc-block > p { margin: 0; color: var(--b2-ink-2); line-height: 1.6; }
.uc-prompt { position: relative; border-radius: 20px; padding: 1px; background: linear-gradient(135deg, var(--b2-light-berry), var(--b2-light-gold) 40%, var(--b2-light-blue) 75%, var(--b2-light-mint)); box-shadow: 0 24px 50px -30px rgb(120 40 70 / .45); }
.uc-prompt__t { margin: 0; padding: 20px 22px 58px; border-radius: 19px; background: var(--b2-surface); font: 500 .92rem/1.7 var(--b2-mono); color: var(--b2-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.uc-fill { padding: 1px 4px; border-radius: 6px; background: var(--b2-light-gold); color: #5E420B; font: inherit; }
.uc-copy { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--b2-line-strong); background: var(--b2-bg); color: var(--b2-ink); font: 600 .85rem/1 var(--b2-body); cursor: pointer; transition: transform .25s var(--b2-ease), background-color .25s, color .25s; }
.uc-copy svg { width: 16px; height: 16px; }
.uc-copy:hover { transform: translateY(-1px); }
.uc-copy.is-done { background: var(--b2-leaf); border-color: var(--b2-leaf); color: #fff; }
.uc-note { margin-top: 12px !important; font-size: .9rem; }
.uc-block--run { padding: 24px; border-radius: 22px; background: linear-gradient(160deg, #FDF0F4, rgb(255 255 255 / .9) 60%); border: 1px solid #F3CCDA; }
.uc-run { margin-top: 18px; min-height: 54px; padding-inline: 26px; font-size: 1.02rem; gap: 10px; box-shadow: 0 18px 36px -18px rgb(206 36 96 / .7); }
.uc-run svg { width: 18px; height: 18px; transition: transform .3s var(--b2-ease); }
.uc-run:hover svg { transform: translateX(3px); }
.uc-tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.uc-tips li { position: relative; padding-left: 30px; color: var(--b2-ink-2); line-height: 1.55; }
.uc-tips li::before { content: ""; position: absolute; left: 0; top: .25em; width: 18px; height: 18px; border-radius: 6px; background: var(--b2-light-mint); }
.uc-tips li::after { content: ""; position: absolute; left: 6px; top: calc(.25em + 4px); width: 5px; height: 8px; border: solid #1D5A43; border-width: 0 2px 2px 0; rotate: 45deg; }

/* The stage: a pool of light behind the playing scene */
.uc-stage { position: sticky; top: calc(var(--b2-bar) + 24px); margin: 0; padding: clamp(18px, 2.4vw, 28px); border-radius: 32px; background: radial-gradient(120% 80% at 0% 0%, #FCE4EC, transparent 60%), radial-gradient(90% 70% at 100% 100%, #E6EAFB, transparent 60%), radial-gradient(70% 60% at 100% 0%, #FBF0D5, transparent 60%), var(--b2-bg-soft); border: 1px solid var(--b2-line); }
.uc-stage__cap { margin: 2px 4px 14px; font: 600 .8rem/1 var(--b2-body); letter-spacing: .04em; text-transform: uppercase; color: var(--b2-ink-2); }
.uc-stage__note { margin: 14px 4px 0; font-size: .8rem; color: var(--b2-ink-2); }
.uc-app .hm-app__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.uc-sc__helper { flex: none; padding: 4px 10px; border-radius: 999px; background: var(--b2-berry-soft); color: var(--b2-berry-ink); font-size: .72rem; font-weight: 600; }
.uc-app .hm-app__thread { gap: 14px; }
.uc-app .hm-m__c { display: grid; gap: 10px; justify-items: start; }
.uc-app .hm-m__c > p { margin: 0; }
.uc-tblwrap { max-width: 100%; overflow-x: auto; }
.uc-tbl { max-width: none; }
.uc-checks li.is-note::before { background: var(--b2-light-gold); }
.uc-checks li.is-note::after { left: 7px; top: calc(.2em + 4px); width: 2px; height: 8px; background: #7A5410; border-radius: 1px; }
.uc-draft { width: 100%; }
@media (max-width: 900px) {
  .uc-body__grid { grid-template-columns: minmax(0, 1fr); }
  .uc-stage { position: relative; top: 0; }
}
@media (max-width: 480px) {
  .uc-stage { margin-inline: calc(var(--b2-gutter) * -.5); padding: 12px; border-radius: 24px; }
  .uc-run { width: 100%; justify-content: center; }
}

/* ---------- Related ---------- */
.uc-related { padding-bottom: clamp(24px, 4vw, 48px); }
.uc-related__h { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin-bottom: clamp(20px, 3vw, 32px); }
.uc-all { display: inline-flex; margin-top: 24px; }

@media (prefers-reduced-motion: reduce) {
  .uc-card a, .uc-card a::after, .uc-chip, .uc-copy, .uc-run svg { transition: none; }
  .js .uc-search, .js .uc-chips, .js .uc-dhero .uc-facts, .js .uc-dhero__lede { animation: none; }
}
