/* HB Portfolio front end. Cards sit on the dark (ink) Work section; the popup is light. Scoped to .hbp-* */
.hbp-gallery, .hbp-dialog {
  --hbp-ink: #0F1517; --hbp-card: #172024; --hbp-teal: #16BBAA; --hbp-deep: #0E7C72; --hbp-tint: #E4F5F2;
  --hbp-paper: #F5F1EA; --hbp-border: #E7E1D7; --hbp-muted: #5B6468; --hbp-text: #1D2327;
  font-family: "Jost", Helvetica, Arial, sans-serif; line-height: 1.5;
}
.hbp-gallery *, .hbp-dialog * { box-sizing: border-box; }
.hbp-dialog [hidden] { display: none !important; }
.hbp-gallery a, .hbp-dialog a { text-decoration: none; }
.hbp-gallery a:focus-visible, .hbp-dialog :is(button, a, [tabindex]):focus-visible { outline: 3px solid var(--hbp-teal); outline-offset: 3px; }
.hbp-dialog button { font: inherit; cursor: pointer; }

/* ---------- Cards ---------- */
.hbp-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.hbp-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid rgba(255,255,255,.08); border-radius: 22px; background: var(--hbp-card); color: #fff; overflow: hidden; transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease; }
.hbp-card:hover, .hbp-card:focus-visible { transform: translateY(-6px); border-color: rgba(22,187,170,.6); box-shadow: 0 26px 60px rgba(0,0,0,.45); }
.hbp-cover { display: block; position: relative; aspect-ratio: 1.6; overflow: hidden; background: radial-gradient(ellipse at 70% 0%, color-mix(in srgb, var(--cover) 55%, #0F1517), color-mix(in srgb, var(--cover) 18%, #0F1517) 70%); }
.hbp-shot-desktop, .hbp-shot-phone { display: block; position: absolute; overflow: hidden; border-style: solid; box-shadow: 0 14px 34px rgba(0,0,0,.4); }
.hbp-shot-desktop img, .hbp-shot-phone img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; max-width: none; }
.hbp-shot-desktop { top: 12%; left: 7%; width: 76%; height: auto; aspect-ratio: 1440/850; border: 4px solid #fff; border-radius: 10px; transition: transform .5s ease; }
.hbp-shot-phone { top: 30%; right: 7%; width: 21%; height: 74%; border: 3px solid #0F1517; border-radius: 12px; transition: transform .5s ease; }
.hbp-card:hover .hbp-shot-desktop { transform: translateY(-6px); }
.hbp-card:hover .hbp-shot-phone { transform: translateY(-14px); }
.hbp-cover-text { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 22px; }
.hbp-copy { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 22px 26px 26px; }
.hbp-tag, .hbp-dtag { color: var(--hbp-teal); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.4px; }
.hbp-gallery h3.hbp-name { margin: 0; padding: 0; color: #fff; font-family: "Bricolage Grotesque", sans-serif; font-size: 24px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.hbp-hook { color: rgba(255,255,255,.74); font-size: 16px; line-height: 1.55; }
.hbp-chips, .hbp-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.hbp-explore { margin-top: auto; padding-top: 12px; align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: #fff; font-weight: 600; font-size: 15px; }
.hbp-explore span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(22,187,170,.18); color: var(--hbp-teal); transition: background .2s, color .2s, transform .2s; }
.hbp-card:hover .hbp-explore span { background: var(--hbp-teal); color: var(--hbp-ink); transform: rotate(8deg); }

/* Featured: the full width card, image left and text right */
.hbp-card--featured { grid-column: 1 / -1; flex-direction: row; align-items: stretch; }
.hbp-card--featured .hbp-cover { flex: 0 0 58%; aspect-ratio: auto; min-height: 380px; }
.hbp-card--featured .hbp-copy { justify-content: center; padding: 36px 40px; }
.hbp-card--featured h3.hbp-name { font-size: 32px; }

/* Platform chips: brand colour on dark cards */
.hbp-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; line-height: 1.2; color: rgba(255,255,255,.86); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 20px; padding: 5px 11px; }
.hbp-chip svg { width: 13px; height: 13px; flex: none; fill: currentColor; }
.hbp-chip--wordpress { --b: #4FA8D8; } .hbp-chip--woocommerce { --b: #B98BEA; } .hbp-chip--shopify { --b: #95BF47; }
.hbp-chip--nextjs { --b: #FFFFFF; } .hbp-chip--divi { --b: #A97BFF; } .hbp-chip--elementor { --b: #F06BA0; } .hbp-chip--webflow { --b: #6A8BFF; }
.hbp-gallery .hbp-chip[class*="hbp-chip--"] { color: var(--b); background: color-mix(in srgb, var(--b) 12%, transparent); border-color: color-mix(in srgb, var(--b) 40%, transparent); }
.hbp-gallery .hbp-chip[class*="hbp-chip--"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--b); }
.hbp-gallery .hbp-chip:has(svg)::before { display: none; }
/* In the light popup */
.hbp-dialog .hbp-chip { color: #3E474B; background: var(--hbp-paper); border-color: var(--hbp-border); }
.hbp-dialog .hbp-chip--wordpress { --c: #1E6A8D; } .hbp-dialog .hbp-chip--woocommerce { --c: #7F54B3; } .hbp-dialog .hbp-chip--shopify { --c: #4A7A2C; }
.hbp-dialog .hbp-chip--nextjs { --c: #000; } .hbp-dialog .hbp-chip--divi { --c: #6C2EB9; } .hbp-dialog .hbp-chip--elementor { --c: #92003B; } .hbp-dialog .hbp-chip--webflow { --c: #2448D6; }
.hbp-dialog .hbp-chip[class*="hbp-chip--"] { color: var(--c); background: color-mix(in srgb, var(--c) 8%, white); border-color: color-mix(in srgb, var(--c) 30%, white); }

/* ---------- Dialog ---------- */
html.hbp-lock { overflow: hidden; }
.hbp-dialog { width: min(1000px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 0; border-radius: 22px; background: #fff; color: var(--hbp-text); box-shadow: 0 30px 90px rgba(0,0,0,.5); overflow: hidden; display: none; flex-direction: column; }
.hbp-dialog[open] { display: flex; animation: hbp-pop .28s ease; }
@keyframes hbp-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.hbp-dialog::backdrop { background: rgba(9,13,15,.8); backdrop-filter: blur(3px); }
.hbp-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 28px 16px; border-bottom: 1px solid var(--hbp-border); }
.hbp-dtag { margin: 0 0 2px !important; padding: 0 !important; color: var(--hbp-deep); }
.hbp-dialog h2 { margin: 0; padding: 0; color: var(--hbp-ink); font-family: "Bricolage Grotesque", sans-serif; font-size: clamp(22px, 3vw, 32px); font-weight: 800; line-height: 1.15; }
.hbp-close, .hbp-back { flex: none; background: #fff; color: var(--hbp-ink); border: 1px solid var(--hbp-border); border-radius: 12px; padding: 9px 13px; min-height: 44px; font-size: 14px; font-weight: 600; line-height: 1.2; }
.hbp-close:hover, .hbp-back:hover { background: var(--hbp-paper); }
.hbp-close span { font-size: 18px; }
.hbp-body { overflow: auto; overscroll-behavior: contain; padding: 18px 28px 6px; flex: 1; }
.hbp-devices { display: grid; grid-template-columns: 1.65fr 1fr .58fr; gap: clamp(10px, 2.4vw, 26px); align-items: end; padding: clamp(14px, 3vw, 30px); background: radial-gradient(ellipse at 52% 0%, #CFEFEA, var(--hbp-paper) 68%); border-radius: 18px; }
.hbp-device { min-width: 0; display: grid; gap: 8px; justify-items: center; background: none; border: 0; padding: 0; color: var(--hbp-ink); }
.hbp-frame { position: relative; display: block; width: 100%; overflow: hidden; background: var(--hbp-ink); border: clamp(3px, .5vw, 6px) solid var(--hbp-ink); border-radius: clamp(6px, 1vw, 12px); box-shadow: 0 12px 26px rgba(15,21,23,.25); transition: border-color .2s; }
.hbp-device[data-device="desktop"] .hbp-frame { aspect-ratio: 1440/850; }
.hbp-device[data-device="tablet"] .hbp-frame { aspect-ratio: 820/1000; }
.hbp-device[data-device="mobile"] .hbp-frame { aspect-ratio: 390/844; border-radius: clamp(10px, 1.6vw, 18px); }
.hbp-frame img { display: block; width: 100%; height: auto; max-width: none; transform: translateY(0); transition: transform .8s ease; will-change: transform; }
.hbp-frame-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 12px; }
.hbp-device:not(:disabled):hover .hbp-frame { border-color: var(--hbp-teal); }
.hbp-scroll-tag { position: absolute; right: 6px; bottom: 6px; background: rgba(15,21,23,.82); color: #fff; font-size: 10.5px; font-weight: 600; border-radius: 20px; padding: 3px 8px; pointer-events: none; transition: opacity .3s; }
.hbp-device:hover .hbp-scroll-tag { opacity: 0; }
.hbp-device-label { font-size: 13px; font-weight: 600; }
.hbp-hint { margin: 10px 0 0 !important; padding: 0 !important; color: var(--hbp-muted); font-size: 13px; text-align: center; }
.hbp-brief { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 20px 0 12px; }
.hbp-brief:has(section:only-child) { grid-template-columns: 1fr; }
.hbp-brief section { background: var(--hbp-paper); border-radius: 14px; padding: 16px 18px; }
.hbp-brief h3 { margin: 0 0 6px; padding: 0; font-family: "Bricolage Grotesque", sans-serif; font-size: 16px; font-weight: 800; color: var(--hbp-ink); }
.hbp-brief ul { margin: 0; padding: 0 0 0 18px; list-style: disc; }
.hbp-brief li, .hbp-brief p { color: #3E474B; font-size: 15px; line-height: 1.6; margin: 0; padding: 0; }
.hbp-zoom { padding-bottom: 12px; }
.hbp-scroller { margin-top: 12px; max-height: calc(100dvh - 300px); min-height: 240px; overflow: auto; border: 1px solid var(--hbp-border); border-radius: 12px; background: var(--hbp-paper); overscroll-behavior: contain; }
.hbp-scroller img { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.hbp-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 28px; border-top: 1px solid var(--hbp-border); background: #fff; }
.hbp-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hbp-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; border-radius: 50px; padding: 11px 22px; background: var(--hbp-teal); color: var(--hbp-ink) !important; font-size: 15px; font-weight: 600; line-height: 1.2; transition: background .2s, color .2s; }
.hbp-btn:hover { background: var(--hbp-ink); color: #fff !important; }
.hbp-btn-ghost { background: var(--hbp-tint); color: var(--hbp-deep) !important; }
.hbp-btn-ghost:hover { background: #C9ECE6; color: var(--hbp-ink) !important; }
.hbp-nav { display: flex; gap: 8px; }
.hbp-nav button { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; border: 1px solid var(--hbp-border); border-radius: 12px; padding: 7px 12px; background: #fff; color: var(--hbp-ink); text-align: left; line-height: 1.25; }
.hbp-nav button:hover { background: var(--hbp-paper); border-color: #CFC7BA; }
.hbp-prev { min-width: 46px; justify-content: center; }
.hbp-next small { display: block; color: var(--hbp-deep); font-size: 11.5px; }
.hbp-next strong { display: block; font-size: 13.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hbp-gallery { gap: 20px; }
  .hbp-card--featured { flex-direction: column; }
  .hbp-card--featured .hbp-cover { flex: none; aspect-ratio: 1.6; min-height: 0; }
  .hbp-card--featured .hbp-copy { padding: 24px 26px 26px; }
  .hbp-card--featured h3.hbp-name { font-size: 26px; }
}
@media (max-width: 700px) {
  .hbp-gallery { grid-template-columns: 1fr; }
  .hbp-dialog { width: 100%; max-height: 94dvh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .hbp-top { padding: 16px 16px 12px; }
  .hbp-body { padding: 14px 16px 4px; }
  .hbp-devices { grid-template-columns: 1fr .5fr; }
  .hbp-device[data-device="tablet"] { display: none; }
  .hbp-brief { grid-template-columns: 1fr; gap: 10px; }
  .hbp-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .hbp-actions { width: 100%; }
  .hbp-actions .hbp-btn { flex: 1; justify-content: center; padding: 12px 10px; font-size: 14px; white-space: nowrap; }
  .hbp-nav { width: 100%; }
  .hbp-next { flex: 1; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .hbp-card, .hbp-shot-desktop, .hbp-shot-phone, .hbp-frame img { transition: none !important; transform: none !important; }
  .hbp-dialog[open] { animation: none; }
}

/* ---------- Index layout: names on the left, floating mockup on the right (no boxes) ---------- */
.hbp-index { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; font-family: "Jost", Helvetica, Arial, sans-serif; }
.hbp-list { list-style: none !important; margin: 0 !important; padding: 0 !important; border-top: 1px solid rgba(255,255,255,.14); }
.hbp-list li { list-style: none !important; margin: 0 !important; padding: 0 !important; border-bottom: 1px solid rgba(255,255,255,.14); }
.hbp-row { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 4px 18px; align-items: start; padding: 26px 8px 26px 0; color: #fff; text-decoration: none !important; }
.hbp-row-num { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 14px; color: #8E9C9F; padding-top: 12px; transition: color .25s; }
.hbp-row-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hbp-row-name { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: clamp(26px, 18px + 1.6vw, 42px); line-height: 1.08; letter-spacing: -.02em; color: #A9B6B9; transition: color .25s, transform .3s; }
.hbp-row-meta { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.hbp-row-tag { font-size: 12.5px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: #16BBAA; margin-right: 4px; }
.hbp-row-meta .hb-bc { font-size: 12.5px; padding: 5px 11px 5px 8px; }
.hbp-row-meta .hb-bc::before { width: 15px; height: 15px; }
.hbp-row-hook { color: #D5DEE0; font-size: 16px; line-height: 1.5; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .35s ease, opacity .35s ease; }
.hbp-row-go { align-self: center; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); color: #fff; font-size: 18px; transition: background .25s, color .25s, transform .25s, border-color .25s; }
.hbp-row-thumb { display: none; }
.hbp-row.is-on .hbp-row-name, .hbp-row:hover .hbp-row-name { color: #fff; }
.hbp-row.is-on .hbp-row-num { color: #16BBAA; }
.hbp-row.is-on .hbp-row-hook { max-height: 80px; opacity: 1; }
.hbp-row.is-on .hbp-row-go, .hbp-row:hover .hbp-row-go { background: #16BBAA; border-color: #16BBAA; color: #0F1517; transform: rotate(8deg); }
.hbp-row:focus-visible { outline: 3px solid #16BBAA; outline-offset: 4px; border-radius: 6px; }

.hbp-stage { position: relative; aspect-ratio: 1.25; }
.hbp-stage-item { position: absolute; inset: 0; opacity: 0; visibility: hidden; transform: translateY(16px) scale(.98); transition: opacity .45s ease, transform .45s ease, visibility .45s; }
.hbp-stage-item::before { content: ""; position: absolute; inset: 8% 6% 4%; background: radial-gradient(closest-side, color-mix(in srgb, var(--cover) 60%, transparent), transparent); filter: blur(30px); opacity: .7; }
.hbp-stage-item.is-on { opacity: 1; visibility: visible; transform: none; }
.hbp-stage .hbp-shot-desktop { top: 12%; left: 0; width: 84%; border-width: 5px; border-radius: 12px; box-shadow: 0 30px 70px rgba(0,0,0,.55); }
.hbp-stage .hbp-shot-phone { top: 34%; right: 2%; width: 24%; height: 62%; border-width: 4px; border-radius: 16px; box-shadow: 0 30px 60px rgba(0,0,0,.55); }
.hbp-stage:hover .hbp-shot-desktop { transform: translateY(-6px); }
.hbp-stage:hover .hbp-shot-phone { transform: translateY(-12px); }
.hbp-stage-hint { position: absolute; left: 0; bottom: -8px; font-size: 13px; color: #8E9C9F; }

@media (max-width: 980px) {
  .hbp-index { grid-template-columns: 1fr; gap: 0; }
  .hbp-stage { display: none; }
  /* 1.1.1: the screenshot sits on top of the row, full width; name, category, chips and hook below. */
  .hbp-row { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 24px 0; }
  .hbp-row-num, .hbp-row-go { display: none; }
  .hbp-row-name { color: #fff; }
  .hbp-row-hook { max-height: none; opacity: 1; font-size: 15px; }
  .hbp-row-thumb { display: block; order: -1; width: 100%; aspect-ratio: 720 / 425; border-radius: 12px; overflow: hidden; border: 2px solid rgba(255,255,255,.85); background: rgba(255,255,255,.04); }
  .hbp-row-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
  /* 1.1.2: a small "View project" pill on the screenshot so phone users know a tap opens more. */
  .hbp-row-thumb { position: relative; transition: transform .2s ease, border-color .2s ease; }
  .hbp-row-thumb::after { content: "View project \2197"; position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px 7px 14px; border-radius: 999px; background: rgba(15,21,23,.78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(22,187,170,.65); color: #fff; font-family: "Jost", Helvetica, Arial, sans-serif; font-size: 13px; font-weight: 600; line-height: 1; letter-spacing: .2px; box-shadow: 0 6px 18px rgba(0,0,0,.35); pointer-events: none; }
  .hbp-row:active .hbp-row-thumb { transform: scale(.985); border-color: #16BBAA; }
}
@media (prefers-reduced-motion: reduce) { .hbp-stage-item, .hbp-row-hook { transition: none; } }
/* The mockup follows the hovered name (JS sets translateY) and always fits the screen height */
.hbp-index { align-items: start; }
.hbp-stage { width: min(100%, calc((100vh - 200px) * 1.25)); justify-self: end; transition: transform .45s cubic-bezier(.22,.8,.3,1); will-change: transform; }
@media (prefers-reduced-motion: reduce) { .hbp-stage { transition: none; } }
