/* ===========================================================
   IMACX — Galeria / Portefólio
   Bento portfolio: product cut-outs on colour, advertising panels,
   real work shots. Layers on imacx.css tokens.
   =========================================================== */

.gx { padding-bottom: 4px; }
.gx [data-ink="light"] { color: #fff; }
.gx [data-ink="dark"]  { color: #0a0a0a; }

/* ---- Masthead -------------------------------------------------- */
.gx-mast { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: end; padding: 8px 0 clamp(36px, 5vw, 64px); }
.gx-h1 { margin: 0; font-weight: var(--w-s); letter-spacing: -.045em; line-height: .92; font-size: clamp(48px, 8.5vw, 132px); }
.gx-h1 .ln { display: block; }
.gx-h1 .ln > span { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .gx-h1 .ln > span { transform: translateY(24px); animation: gx-rise-line .8s cubic-bezier(.2,.7,.2,1) forwards; }
  .gx-h1 .ln:nth-child(1) > span { animation-delay: .04s; }
  .gx-h1 .ln:nth-child(2) > span { animation-delay: .12s; }
  .gx-h1 .ln:nth-child(3) > span { animation-delay: .2s; }
}
.gx-h1 em { font-style: normal; }
.gx-h1 .o { color: var(--accent); }
@keyframes gx-rise-line { to { transform: translateY(0); } }

.gx-mast-side > p { font-size: var(--t-body-l); line-height: 1.55; color: #0a0a0a; margin: 0 0 26px; max-width: 46ch; }
.gx-mast-side > p b { font-weight: var(--w-s); }
.gx-mast-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 28px; border-top: var(--hairline) solid var(--line); padding-top: 20px; }
.gx-mast-stats .s { display: flex; flex-direction: column; gap: 4px; }
.gx-mast-stats .s b { font-size: var(--t-h4); font-weight: var(--w-s); letter-spacing: -.02em; }
.gx-mast-stats .s span { font-size: var(--t-label); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ---- Brand marquee --------------------------------------------- */
.gx-marquee { overflow: hidden; border-block: var(--hairline) solid var(--line); padding: 22px 0; margin-bottom: clamp(20px, 3vw, 36px); -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.gx-mq-track { display: inline-flex; align-items: center; white-space: nowrap; animation: gx-marquee 46s linear infinite; }
.gx-mq-item { display: inline-flex; align-items: center; font-size: clamp(22px, 2.6vw, 38px); font-weight: var(--w-s); letter-spacing: -.02em; color: #0a0a0a; }
.gx-mq-dot { width: 7px; height: 7px; background: var(--accent); margin: 0 clamp(26px, 3vw, 48px); flex: none; }
@keyframes gx-marquee { to { transform: translateX(-50%); } }
.gx-marquee:hover .gx-mq-track { animation-play-state: paused; }

/* ---- Filter bar ------------------------------------------------ */
.gx-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 18px; margin-top: 4px; flex-wrap: wrap; }
.gx-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.gx-chip { font: inherit; font-size: var(--t-body-s); font-weight: var(--w-m); letter-spacing: .01em; height: 38px; padding: 0 16px; border: var(--hairline) solid var(--line-2); border-radius: 999px; background: var(--bg); color: var(--fg); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.gx-chip:hover { border-color: var(--fg); }
.gx-chip[data-on="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.gx-count { font-size: var(--t-label); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

/* ---- Bento ----------------------------------------------------- */
.gx-bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 286px; grid-auto-flow: dense; gap: 16px; margin: 28px 0 8px; }
.gx-card { position: relative; overflow: hidden; border: 0; padding: 0; margin: 0; font: inherit; text-align: left; cursor: pointer; border-radius: var(--radius); display: flex; isolation: isolate; background: var(--bg-3); }
@media (prefers-reduced-motion: no-preference) {
  .gx-card { transform: translateY(20px) scale(.98); animation: gx-rise .6s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(var(--i, 0) * 24ms); }
}
@keyframes gx-rise { to { transform: none; } }
.gx-card.w2 { grid-column: span 2; }
.gx-card.h2 { grid-row: span 2; }
.gx-card.w2.h2 { grid-column: span 2; grid-row: span 2; }
@media (prefers-reduced-motion: reduce) { .gx-h1 .ln > span { animation: none; transform: none; } }

/* product cut-out cards */
.gx-piece { align-items: center; justify-content: center; }
.gx-glyph { width: 58%; max-width: 230px; aspect-ratio: 1; display: grid; place-items: center; color: currentColor; filter: drop-shadow(0 18px 30px rgba(0,0,0,.18)); transform: translateZ(0); transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.gx-card.h2 .gx-glyph { width: 46%; }
.gx-glyph-svg { width: 100%; height: 100%; opacity: .92; }
.gx-piece:hover .gx-glyph { transform: translateY(-6px) rotate(-3deg) scale(1.04); }
@media (prefers-reduced-motion: no-preference) {
  .gx-piece .gx-glyph { animation: gx-float 7s ease-in-out infinite; }
  .gx-piece:nth-child(3n) .gx-glyph { animation-duration: 8.5s; animation-delay: -2s; }
  .gx-piece:nth-child(4n) .gx-glyph { animation-duration: 6s; animation-delay: -1s; }
}
@keyframes gx-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* caption — small, in a corner, informational only */
.gx-cap { position: absolute; left: 18px; bottom: 16px; right: 18px; z-index: 3; display: flex; flex-direction: column; gap: 1px; line-height: 1.2; pointer-events: none; }
.gx-cap b { font-size: var(--t-body-s); font-weight: var(--w-s); letter-spacing: -.005em; }
.gx-cap i { font-size: var(--t-label); font-style: normal; opacity: .7; letter-spacing: .01em; }
.gx-cap[data-on-photo="true"] { color: #fff; }
.gx-cap[data-on-photo="true"] i { opacity: .82; }

/* category tag — top-left, tiny */
.gx-tag { position: absolute; left: 16px; top: 15px; z-index: 3; font-size: 9.5px; text-transform: uppercase; letter-spacing: .12em; font-weight: var(--w-m); opacity: .5; }

/* hover arrow */
.gx-go { position: absolute; right: 14px; top: 13px; z-index: 3; width: 34px; height: 34px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: var(--accent-fg); opacity: 0; transform: scale(.7) rotate(-30deg); transition: opacity .2s, transform .25s cubic-bezier(.2,.7,.2,1); }
.gx-card:hover .gx-go { opacity: 1; transform: none; }

/* advertising panels */
.gx-ad { padding: clamp(26px, 2.4vw, 40px); flex-direction: column; justify-content: space-between; cursor: default; }
.gx-ad-in { display: flex; flex-direction: column; }
.gx-kick { font-size: var(--t-label); text-transform: uppercase; letter-spacing: .14em; font-weight: var(--w-s); opacity: .68; }
.gx-ad-h { margin: 18px 0 0; font-weight: var(--w-s); letter-spacing: -.035em; line-height: .95; font-size: clamp(28px, 3.2vw, 56px); }
.gx-ad.w2:not(.h2) .gx-ad-h { font-size: clamp(26px, 2.6vw, 42px); }
.gx-ad-p { margin: 16px 0 0; font-size: var(--t-body); line-height: 1.5; max-width: 30ch; opacity: .82; }
.gx-ad-mark { font-size: clamp(40px, 5vw, 92px); font-weight: var(--w-s); line-height: 1; opacity: .14; align-self: flex-end; }

/* real work shots */
.gx-photo { background: #0a0a0a; }
.gx-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2,.6,.2,1); }
.gx-photo:hover img { transform: scale(1.06); }
.gx-photo-scrim { position: absolute; inset: 0; z-index: 2; background: linear-gradient(to top, rgba(10,10,10,.78), rgba(10,10,10,.06) 56%); }

/* ---- Techniques ------------------------------------------------ */
.gx-techs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 clamp(28px, 4vw, 64px); }
.gx-tech { padding: 30px 0; border-top: var(--hairline) solid var(--line); }
.gx-tech .n { font-size: var(--t-label); color: var(--accent); font-weight: var(--w-s); letter-spacing: .04em; }
.gx-tech h4 { margin: 12px 0 8px; font-size: var(--t-h5); font-weight: var(--w-s); letter-spacing: -.015em; }
.gx-tech p { margin: 0; font-size: var(--t-body); line-height: 1.55; color: var(--muted); max-width: 34ch; }

/* ---- Lightbox -------------------------------------------------- */
.gx-lb { position: fixed; inset: 0; z-index: 120; background: rgba(8,8,8,.74); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center; padding: clamp(16px, 4vw, 48px); animation: gx-fade .2s ease; }
@keyframes gx-fade { from { opacity: 0; } }
.gx-lb-card { width: min(960px, 100%); max-height: 88vh; background: var(--bg); border-radius: var(--radius); overflow: hidden; display: grid; grid-template-columns: 1.15fr 1fr; box-shadow: 0 40px 120px rgba(0,0,0,.5); animation: gx-pop .32s cubic-bezier(.2,.7,.2,1); }
@keyframes gx-pop { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.gx-lb-stage { position: relative; display: grid; place-items: center; min-height: 360px; overflow: hidden; }
.gx-lb-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gx-lb-glyph { width: 56%; max-width: 280px; aspect-ratio: 1; color: currentColor; filter: drop-shadow(0 22px 40px rgba(0,0,0,.22)); animation: gx-float 7s ease-in-out infinite; }
.gx-lb-info { padding: clamp(28px, 3vw, 46px); display: flex; flex-direction: column; }
.gx-lb-info h3 { margin: 14px 0 0; font-size: var(--t-h3); font-weight: var(--w-s); letter-spacing: -.025em; line-height: 1; }
.gx-lb-piece { margin: 10px 0 0; font-size: var(--t-body-l); font-weight: var(--w-m); }
.gx-lb-blurb { margin: 16px 0 0; font-size: var(--t-body); line-height: 1.6; color: var(--muted); }
.gx-lb-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 26px; }
.gx-lb-x { position: fixed; top: 22px; right: 24px; z-index: 2; width: 46px; height: 46px; border-radius: 999px; border: var(--hairline) solid rgba(255,255,255,.3); background: rgba(0,0,0,.3); color: #fff; cursor: pointer; display: grid; place-items: center; }
.gx-lb-x:hover { background: var(--accent); border-color: var(--accent); }
.gx-lb-nav { position: fixed; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 999px; border: var(--hairline) solid rgba(255,255,255,.3); background: rgba(0,0,0,.3); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding-bottom: 4px; }
.gx-lb-nav:hover { background: var(--accent); border-color: var(--accent); }
.gx-lb-nav.prev { left: clamp(10px, 3vw, 34px); }
.gx-lb-nav.next { right: clamp(10px, 3vw, 34px); }

/* ---- Responsive ------------------------------------------------ */
@media (max-width: 1000px) {
  .gx-mast { grid-template-columns: 1fr; gap: 28px; }
  .gx-bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 240px; }
  .gx-card.w2.h2 { grid-column: span 2; grid-row: span 2; }
  .gx-techs { grid-template-columns: 1fr 1fr; }
  .gx-lb-card { grid-template-columns: 1fr; max-height: 92vh; overflow: auto; }
  .gx-lb-stage { min-height: 300px; }
}
@media (max-width: 620px) {
  .gx-bento { grid-template-columns: 1fr 1fr; grid-auto-rows: 200px; gap: 12px; }
  .gx-card.w2 { grid-column: span 2; }
  .gx-card.h2 { grid-row: span 1; }
  .gx-card.w2.h2 { grid-row: span 2; }
  .gx-ad.w2.h2 .gx-ad-h { font-size: clamp(24px, 7vw, 38px); }
  .gx-techs { grid-template-columns: 1fr; }
  .gx-mast-stats { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}
