/* =========================================================
   Garner Legacy — Portfolio page styles
   Dark editorial · athletic · Unbounded / Satoshi / Fraunces
   ========================================================= */

/* Tokens, reset, utilities, grain, typography helpers, reveal, and
   reduced-motion are defined in shared/base.css (loaded before this). */

/* Page-specific layout overrides */
:root {
  --maxw: 1280px;
  --gutter-d: 24px;
  --gutter-m: 16px;
  --sect-y:   clamp(5rem, 10vw, 9rem);
}

/* Portfolio headings use system-ui fallback explicitly */
h1, h2, h3 {
  font-family: 'Unbounded', system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.02;
  margin: 0;
}

/* Portfolio's eyebrow uses a tighter bottom margin than base */
.eyebrow { margin: 0 0 1rem; }

.inline-link {
  color: var(--gl-red);
  border-bottom: 1px solid color-mix(in oklab, var(--gl-red) 40%, transparent);
  transition: color .15s ease, border-color .15s ease;
}
.inline-link:hover { color: var(--gl-red-hi); border-color: var(--gl-red-hi); }

/* .gl-grain overlay lives in shared/base.css */

/* Buttons (.btn, .btn--primary, .btn--ghost) and nav (.nav, .mobilenav)
   live in shared/layout.css — removed from here to prevent the portfolio
   page's nav from looking different than the rest of the site. */

/* =========================================================
   PAGE HEAD
   ========================================================= */
.pagehead {
  padding: clamp(4rem, 9vw, 7rem) var(--gutter-d) clamp(3rem, 6vw, 5rem);
  max-width: var(--maxw);
  margin: 0 auto;
  position: relative;
}
.pagehead__inner { max-width: 960px; }
.pagehead__title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 800;
  font-size: var(--fs-hero);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}
.pagehead__sub {
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  color: var(--gl-ink-dim);
  max-width: 40ch;
  line-height: 1.35;
  margin: 0 0 2.5rem;
}
.pagehead__meta {
  display: flex; flex-wrap: wrap; gap: 32px 48px;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gl-line);
}
.pagehead__meta > div { display: flex; flex-direction: column; gap: 4px; }
.pagehead__meta-k {
  font-size: var(--fs-eyebrow); font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gl-ink-mute);
}
.pagehead__meta-v {
  font-family: 'Unbounded', sans-serif; font-weight: 600;
  font-size: 1.05rem;
  color: var(--gl-ink);
}

/* =========================================================
   FEATURED SPOTLIGHT
   ========================================================= */
.spot {
  background: linear-gradient(180deg, var(--gl-black) 0%, var(--gl-surface) 40%, var(--gl-surface) 100%);
  border-top: 1px solid var(--gl-line);
  border-bottom: 1px solid var(--gl-line);
  padding: clamp(3rem, 6vw, 5rem) var(--gutter-d);
  overflow: hidden;
}
.spot__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}

.spot__media {
  position: relative;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--gl-surface-2);
  border: 1px solid var(--gl-line);
}
.spot__media img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: transform 1.8s var(--ease-out);
}
.spot:hover .spot__media img { transform: scale(1.04); }
.spot__tag {
  position: absolute; top: 16px; left: 16px;
  z-index: 3;
  padding: 8px 12px;
  background: color-mix(in oklab, var(--gl-black) 70%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--gl-line);
  color: var(--gl-red-hi);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.spot__body { position: relative; }
.spot__title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 800;
  font-size: var(--fs-display);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}
.spot__copy {
  font-size: 1.125rem;
  color: var(--gl-ink-dim);
  margin: 0 0 1.75rem;
  max-width: 52ch;
}

.spot__tech {
  list-style: none;
  padding: 1.25rem 0;
  margin: 0 0 1.75rem;
  display: flex; flex-wrap: wrap; gap: 8px 10px;
  border-top: 1px solid var(--gl-line);
  border-bottom: 1px solid var(--gl-line);
}
.spot__tech li {
  font-size: var(--fs-small);
  color: var(--gl-ink);
  padding: 6px 12px;
  border: 1px solid var(--gl-line);
  background: var(--gl-surface-2);
  border-radius: 999px;
}

.spot__cta { display: flex; flex-wrap: wrap; gap: 12px; }

.spot__num {
  position: absolute;
  right: -8px; top: -36px;
  font-family: 'Unbounded', sans-serif;
  font-weight: 800;
  font-size: clamp(5rem, 10vw, 9rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--gl-line);
  margin: 0;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

@media (max-width: 820px) {
  .spot__inner { grid-template-columns: 1fr; }
  .spot__media { aspect-ratio: 3 / 2; order: -1; }
  .spot__num { display: none; }
}

/* =========================================================
   FILTER BAR
   ========================================================= */
.filterbar {
  position: sticky;
  top: 62px; /* below nav */
  z-index: 30;
  background: color-mix(in oklab, var(--gl-black) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--gl-line);
}
.filterbar__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px var(--gutter-d);
  display: flex; align-items: center; gap: 20px;
}
.filterbar__label {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0;
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gl-ink-mute);
  flex-shrink: 0;
}
.filterbar__label .eyebrow__rule { width: 24px; }

.filterbar__chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 0;
}
.filterbar__chips::-webkit-scrollbar { display: none; }

.chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  min-height: 40px;
  font-family: 'Satoshi', system-ui, sans-serif;
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--gl-ink-dim);
  border: 1px solid var(--gl-line);
  background: var(--gl-surface);
  border-radius: 999px;
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.chip:hover { color: var(--gl-ink); border-color: color-mix(in oklab, var(--gl-red) 40%, var(--gl-line)); }
.chip.is-active {
  color: var(--gl-ink);
  background: var(--gl-surface-2);
  border-color: var(--gl-line);
}
.chip.is-active::after {
  content: ''; position: absolute;
  left: 16px; right: 16px; bottom: 6px;
  height: 1.5px; background: var(--gl-red);
}
.chip__count {
  font-family: 'Unbounded', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gl-ink-mute);
  margin-left: 4px;
}

@media (max-width: 700px) {
  .filterbar__label { display: none; }
  .filterbar__inner { padding: 10px var(--gutter-m); }
}

/* =========================================================
   GRID
   ========================================================= */
.grid-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4rem) var(--gutter-d) var(--sect-y);
}

.folio {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
}

.folio__item {
  grid-column: span 3;
  transition: opacity .4s var(--ease-out), transform .4s var(--ease-out);
}
.folio__item--wide { grid-column: span 6; }
.folio__item--flex { grid-column: span 4; }
.folio__item--tall { grid-column: span 2; }
.folio__item--tall .folio__media { aspect-ratio: 4 / 5; }
.folio__item--flex .folio__media { aspect-ratio: 3 / 2; }

/* [hidden] respect + no-JS fallback live in shared/base.css */

/* Mid breakpoint — 4 col */
@media (max-width: 1100px) {
  .folio { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .folio__item { grid-column: span 2; }
  .folio__item--wide { grid-column: span 4; }
  .folio__item--flex { grid-column: span 3; }
  .folio__item--tall { grid-column: span 1; }
}
/* Tablet — 2 col */
@media (max-width: 820px) {
  .folio { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .folio__item,
  .folio__item--flex,
  .folio__item--tall { grid-column: span 1; }
  .folio__item--wide { grid-column: span 2; }
  .folio__item--tall .folio__media { aspect-ratio: 3 / 2; }
}
/* Mobile — 1 col */
@media (max-width: 560px) {
  .folio { grid-template-columns: 1fr; gap: 20px; padding: 0; }
  .folio__item,
  .folio__item--flex,
  .folio__item--tall,
  .folio__item--wide { grid-column: span 1; }
  .folio__item--wide .folio__media { aspect-ratio: 3 / 2; }
}

/* Filter hide/collapse — graceful */
.folio__item.is-hidden {
  opacity: 0;
  transform: scale(0.97);
  pointer-events: none;
  grid-column: span 0;
  width: 0;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 0;
  border: 0;
}

/* ---------- CARD ---------- */
.folio__card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--gl-surface);
  border: 1px solid var(--gl-line);
  overflow: hidden;
  height: 100%;
  transition: transform .3s var(--ease-out), border-color .25s, box-shadow .3s;
}
.folio__card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in oklab, var(--gl-red) 55%, var(--gl-line));
  box-shadow: 0 18px 40px -24px color-mix(in oklab, var(--gl-black) 80%, transparent), 0 2px 0 0 color-mix(in oklab, var(--gl-red) 24%, transparent);
}

.folio__media {
  position: relative;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--gl-surface-2);
}
.folio__item--wide .folio__media { aspect-ratio: 16 / 8; }

.folio__media img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: transform 1.4s var(--ease-out), filter .3s ease;
  filter: saturate(0.85) contrast(1.02);
}
.folio__card:hover .folio__media img {
  transform: scale(1.04);
  filter: saturate(1) contrast(1.05);
}
.folio__media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,11,13,0) 40%, rgba(10,11,13,0.55) 100%);
  pointer-events: none;
}

.folio__body {
  padding: 20px 22px 22px;
  display: flex; flex-direction: column; gap: 10px;
  flex: 1;
}
.folio__eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gl-red-hi);
  margin: 0;
}
.folio__name {
  font-family: 'Unbounded', sans-serif;
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.1;
  margin: 0;
  color: var(--gl-ink);
}
.folio__item--wide .folio__name {
  font-size: clamp(1.75rem, 2.8vw, 2.25rem);
  font-weight: 800;
}
.folio__desc {
  margin: 0;
  font-size: 0.98rem;
  color: var(--gl-ink-dim);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.folio__item--wide .folio__desc {
  -webkit-line-clamp: 3;
  font-size: 1.05rem;
  max-width: 58ch;
}

/* Tech overlay — slides up on hover */
.folio__tech {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 22px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--gl-black) 40%, transparent) 0%, var(--gl-black) 100%);
  border-top: 1px solid color-mix(in oklab, var(--gl-red) 30%, var(--gl-line));
  display: flex; flex-wrap: wrap; gap: 6px 8px;
  transform: translateY(101%);
  opacity: 0;
  transition: transform .35s var(--ease-out), opacity .25s;
  z-index: 3;
}
.folio__tech span {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gl-ink);
  padding: 4px 10px;
  border: 1px solid var(--gl-line);
  border-radius: 999px;
  background: var(--gl-surface-2);
}

.folio__card:hover .folio__tech,
.folio__card:focus-visible .folio__tech {
  transform: translateY(0);
  opacity: 1;
}

/* Empty state */
.folio__empty {
  display: flex; align-items: center; justify-content: center;
  padding: 4rem 2rem;
  margin: 2rem 0 0;
  text-align: center;
  color: var(--gl-ink-dim);
  border: 1px dashed var(--gl-line);
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 1.25rem;
}

/* .sr / .reveal base rules live in shared/base.css */

/* =========================================================
   CLOSING CTA BAND
   ========================================================= */
.ctaband {
  padding: var(--sect-y) var(--gutter-d);
  background:
    radial-gradient(ellipse at 20% 0%, color-mix(in oklab, var(--gl-red-lo) 18%, transparent) 0%, transparent 60%),
    var(--gl-black);
  border-top: 1px solid var(--gl-line);
}
.ctaband__inner {
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}
.ctaband__title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 800;
  font-size: var(--fs-display);
  line-height: 0.95;
  margin: 0 0 1rem;
}
.ctaband__lede {
  font-size: 1.125rem;
  color: var(--gl-ink-dim);
  margin: 0 auto 2rem;
  max-width: 54ch;
}
.ctaband__cta { display: inline-flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* Screenshot variants — for live-site thumbnails in portfolio cards.
   Landscape aspect and no filter (we want the real site colors to read). */
.spot__media--screenshot { aspect-ratio: 16 / 10; background: var(--gl-black); }
.spot__media--screenshot img { filter: none; object-position: top center; }
@media (max-width: 820px) {
  .spot__media--screenshot { aspect-ratio: 16 / 10; }
}

.folio__media--screenshot { aspect-ratio: 3 / 2; background: var(--gl-black); }
.folio__media--screenshot img {
  filter: none;
  object-position: top center;
  transition: transform 1.4s var(--ease-out), filter .3s ease;
}
.folio__item--wide .folio__media--screenshot { aspect-ratio: 16 / 10; }
.folio__item--tall .folio__media--screenshot { aspect-ratio: 3 / 2; }
.folio__item--flex .folio__media--screenshot { aspect-ratio: 16 / 10; }

.folio__card--screenshot:hover .folio__media--screenshot img {
  transform: scale(1.02);
  filter: brightness(1.05);
}

/* Footer (.foot, .news) styles live in shared/layout.css. */
