/* ---------- Filters (projects hub, reviews) ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--space-lg); }
.filter { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: var(--radius-pill); border: 1.5px solid var(--line-strong); background: var(--white); font-size: 14px; font-weight: var(--weight-bold); color: var(--navy-800); transition: background var(--dur-hover), color var(--dur-hover), border-color var(--dur-hover); }
.filter small { font-size: 12px; color: var(--text-soft); transition: color var(--dur-hover); }
.filter:hover { border-color: var(--navy-800); }
.filter[aria-pressed="true"] { background: var(--navy-800); border-color: var(--navy-800); color: var(--chalk-000); }
.filter[aria-pressed="true"] small { color: var(--navy-200); }
[data-filter-items] > .is-hidden { display: none !important; }

/* ---------- Story: at a glance (overlaps the page header) ---------- */

.glance-wrap { position: relative; z-index: 3; margin-top: -32px; }
@media (min-width: 768px) { .glance-wrap { margin-top: -44px; } }
.glance { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: var(--radius-lg); background: var(--white); border: 1px solid var(--ink-a08); box-shadow: var(--shadow-hover); overflow: hidden; }
@media (min-width: 900px) { .glance { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.glance > div { display: grid; gap: 4px; padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.glance > div:nth-child(2n) { border-right: 0; }
.glance > div:nth-child(n+3) { border-bottom: 0; }
@media (min-width: 900px) { .glance > div { padding: 20px 24px; border-bottom: 0; } .glance > div:nth-child(2n) { border-right: 1px solid var(--line); } .glance > div:last-child { border-right: 0; } }
.glance dt { font: var(--weight-bold) 11px/1 var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-soft); }
.glance dd { margin: 0; font: var(--weight-black) 16px/1.3 var(--font-display); color: var(--navy-800); }
@media (min-width: 768px) { .glance dd { font-size: 18px; } }

/* ---------- Story: before and after ---------- */

.sba { display: none; }
@media (min-width: 768px) { .sba { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .sba-slider { display: none; } }
.sba__tile { position: relative; aspect-ratio: 4 / 4.4; max-height: 640px; width: 100%; border-radius: var(--radius-xl); box-shadow: var(--shadow-card); }
.sba__tile .chip { position: absolute; left: 16px; bottom: 16px; z-index: 3; }
.sba--one { display: grid; grid-template-columns: minmax(0, 1fr); }
.sba--one .sba__tile { max-width: 620px; margin-inline: auto; }
.sba__tile .tag { position: absolute; left: 16px; top: 16px; z-index: 3; }
.sba-slider .ba { height: 440px; border-radius: var(--radius-xl); overflow: hidden; }

/* ---------- Story: narrative ---------- */

.snarr { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); }
@media (min-width: 960px) { .snarr { grid-template-columns: 1.25fr 0.75fr; gap: var(--space-2xl); align-items: start; } }
.sbeats { display: grid; gap: 0; }
.sbeat { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 4px 18px; padding: 26px 0; border-top: 1px solid var(--line); }
.sbeat:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .sbeat { grid-template-columns: 72px minmax(0, 1fr); padding: 32px 0; } }
.sbeat__num { grid-row: span 2; font: var(--weight-black) 30px/1 var(--font-display); letter-spacing: -0.03em; background: var(--heat); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (min-width: 768px) { .sbeat__num { font-size: 40px; } }
.sbeat h2 { font: var(--weight-black) 22px/1.2 var(--font-display); letter-spacing: -0.01em; color: var(--navy-700); }
@media (min-width: 768px) { .sbeat h2 { font-size: 26px; } }
.sbeat p { font-size: 17px; line-height: 1.65; color: var(--text-muted); margin-top: 8px; max-width: 640px; }
.sbeat p.sbeat__extra { font-size: 15px; color: var(--navy-700); font-weight: var(--weight-semibold); }
.snarr__side { display: grid; gap: 14px; }
@media (min-width: 960px) { .snarr__side { position: sticky; top: calc(var(--header-h) + var(--header-top) + 24px); } }
.snarr__side .qcard blockquote { font-size: 18px; }
.srel { display: grid; gap: 8px; }
.srel__label { font: var(--weight-bold) 11px/1 var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin: 8px 0 4px; }
.srel a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--white); border: 1px solid var(--ink-a08); font-size: 15px; font-weight: var(--weight-bold); color: var(--navy-800); transition: border-color var(--dur-hover), transform var(--dur-hover) var(--ease-out), box-shadow var(--dur-hover); }
.srel a .ico { width: 18px; height: 18px; flex-shrink: 0; transition: transform var(--dur-hover) var(--ease-out); }
.srel a:hover { border-color: var(--navy-300); transform: translateY(-2px); box-shadow: var(--shadow-card); }
.srel a:hover .ico { transform: translateX(3px); }

/* ---------- Story: gallery and lightbox ---------- */

.sgal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 768px) { .sgal { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
.gthumb { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: var(--radius-lg); overflow: hidden; background: var(--chalk-200); cursor: zoom-in; }
.gthumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out); }
.gthumb:hover img { transform: scale(1.05); }
.gthumb .chip { position: absolute; left: 12px; bottom: 12px; right: 12px; width: fit-content; white-space: normal; line-height: 1.25; }
.gthumb__zoom { position: absolute; right: 12px; top: 12px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--chalk-000); background: var(--frost-dark-bg); border: 1px solid var(--frost-dark-line); opacity: 0; transform: scale(0.8); transition: opacity var(--dur-hover), transform var(--dur-hover) var(--ease-out); }
.gthumb__zoom .ico { width: 18px; height: 18px; }
.gthumb:hover .gthumb__zoom, .gthumb:focus-visible .gthumb__zoom { opacity: 1; transform: none; }

.lbox .modal-dialog { max-width: min(1100px, calc(100vw - 24px)); margin-inline: auto; }
.lbox .modal-content { position: relative; background: var(--navy-950); border: 1px solid var(--line-on-ink); border-radius: var(--radius-xl); overflow: hidden; }
.lbox__img { display: block; width: 100%; max-height: calc(100vh - 180px); object-fit: contain; background: #050d17; }
.lbox__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; color: var(--chalk-000); }
.lbox__cap { font-size: 14px; font-weight: var(--weight-semibold); }
.lbox__count { font-size: 12px; color: var(--navy-200); white-space: nowrap; }
.lbox__btn { position: absolute; top: 50%; z-index: 2; width: 46px; height: 46px; margin-top: -48px; border-radius: 50%; display: grid; place-items: center; color: var(--chalk-000); background: var(--frost-dark-bg); border: 1px solid var(--frost-dark-line); transition: background var(--dur-hover), color var(--dur-hover); }
.lbox__btn:hover { background: var(--chalk-000); color: var(--navy-950); }
.lbox__btn .ico { width: 20px; height: 20px; }
.lbox__prev { left: 12px; }
.lbox__next { right: 12px; }
.lbox__close { top: 12px; right: 12px; margin-top: 0; }
.modal-backdrop.show { opacity: 0.8; }
@media (min-width: 768px) { .sgal--two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 820px; } }

/* ---------- Gallery: sticky filter bar, grid, batches ---------- */

.gbar { position: sticky; top: calc(var(--header-h) + var(--header-top) + 10px); z-index: 5; display: flex; align-items: center; gap: 10px 18px; padding: 7px; margin-bottom: var(--space-md); border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--ink-a08); box-shadow: var(--shadow-card); }
.gbar__filters { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; gap: 6px; margin: 0; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.gbar__filters::-webkit-scrollbar { display: none; }
.gbar .filter { flex-shrink: 0; height: 38px; padding: 0 14px; font-size: 13px; border-color: transparent; background: transparent; }
.gbar .filter:hover { border-color: var(--line-strong); }
.gbar .filter[aria-pressed="true"] { background: var(--navy-800); border-color: var(--navy-800); }
.gbar__count { display: none; flex-shrink: 0; padding-right: 12px; font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.gbar__count b { color: var(--navy-800); }
@media (min-width: 768px) { .gbar__count { display: block; } }
.ggrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense; gap: 10px; }
@media (min-width: 768px) {
  .ggrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .gitem--big { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
  .gitem--big img { position: absolute; inset: 0; }
}
@media (min-width: 1100px) { .ggrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.ggrid > .is-later { display: none !important; }
.gitem { scroll-margin-top: 160px; }
.gitem:focus-visible { outline: 3px solid var(--clay-600); outline-offset: 3px; }
.gitem .chip { font-size: 12px; }
.gitem__story { position: absolute; left: 12px; top: 12px; z-index: 2; padding: 6px 10px; border-radius: var(--radius-pill); font: var(--weight-bold) 11px/1 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--chalk-000); background: var(--clay-600); box-shadow: 0 6px 16px rgba(194, 69, 44, 0.35); }
.gitem.is-new { animation: gitemIn 700ms var(--ease-out) both; }
@keyframes gitemIn { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .gitem.is-new { animation: none; } }
.gmore { display: grid; justify-items: center; gap: 14px; margin-top: var(--space-lg); }
.gmore[hidden] { display: none; }
.gmore__bar { width: min(280px, 100%); height: 4px; border-radius: 4px; background: var(--chalk-200); overflow: hidden; }
.gmore__bar i { display: block; width: 0; height: 100%; border-radius: 4px; background: var(--heat); transition: width 600ms var(--ease-out); }
.gmore__btn .ico { width: 18px; height: 18px; transition: transform var(--dur-hover) var(--ease-out); }
.gmore__btn:hover .ico { transform: translateY(3px); }
.gnote { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: var(--space-lg); padding: 18px 22px; border-radius: var(--radius-lg); background: var(--white); border: 1px solid var(--ink-a08); font-size: 15px; font-weight: var(--weight-semibold); color: var(--navy-800); transition: border-color var(--dur-hover), transform var(--dur-hover) var(--ease-out), box-shadow var(--dur-hover); }
.gnote img { height: 20px; width: auto; }
.gnote span { flex: 1 1 220px; }
.gnote .ico { width: 18px; height: 18px; transition: transform var(--dur-hover) var(--ease-out); }
.gnote:hover { border-color: var(--navy-300); transform: translateY(-2px); box-shadow: var(--shadow-card); }
.gnote:hover .ico { transform: translateX(3px); }
.lbox__foot { flex-wrap: wrap; }
.lbox__story { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: var(--weight-bold); color: var(--amber-500); white-space: nowrap; transition: color var(--dur-hover); }
.lbox__story .ico { width: 16px; height: 16px; transition: transform var(--dur-hover) var(--ease-out); }
.lbox__story:hover { color: var(--chalk-000); }
.lbox__story:hover .ico { transform: translateX(3px); }
.lbox__story[hidden] { display: none; }
@media (max-width: 1199px) { .gbar__filters { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); padding-right: 32px; } }
@media (max-width: 767px) {
  .gitem .chip { left: 8px; right: 8px; bottom: 8px; padding: 5px 9px; font-size: 11px; }
  .gitem__story { left: 8px; top: 8px; padding: 5px 8px; font-size: 10px; }
  .gitem .gthumb__zoom { display: none; }
}

/* Mobile type scale: gallery captions 12px, the uppercase story badge 11px */
@media (max-width: 599px) { .gitem .chip { font-size: 12px; } .gitem__story { font-size: 11px; } }
