/* ==========================================================================
   Our Work — page-local styles (v3)
   - White canvas, left-aligned
   - Bento-style portfolio grid with filter system + modal expansion
   - Reuses global tokens (--pink, --gold, --content-width, glass system)
   - NO floating words / .fx-word system anymore
   ========================================================================== */

/* A) White canvas (overrides global black body on this page) */
body.page--white { background: #fff !important; }

/* B) Shared inner width — sits ABOVE #fx-layer (z:1) */
.work-inner {
  width: var(--content-width);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* C) Reduced section padding (replaces inline overrides from old work.html) */
.section-pad {
  padding-top: clamp(26px, 5vw, 56px);
  padding-bottom: clamp(26px, 5vw, 56px);
}

/* ==========================================================================
   HERO
   ========================================================================== */
.work-hero {
  background: #fff;
  color: #000;
  padding-top: clamp(48px, 7vw, 90px) !important;
  padding-bottom: clamp(22px, 4.5vw, 50px) !important;
}
.work-hero__title {
  margin: 0 0 clamp(14px, 2.6vw, 22px);
  font-weight: 900;
  font-size: clamp(44px, 6.2vw, 80px);
}
.work-hero__sub {
  margin: 0;
  max-width: 900px;
  color: rgba(13,10,12,.90);
  line-height: 1.58;
}

/* Animated brand gradient ink */
.grad-ink {
  background: linear-gradient(135deg, var(--pink), var(--gold));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  background-size: 200% 200%;
  animation: hue-pan 8s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .grad-ink { animation: none; } }
@keyframes hue-pan {
  0%,100% { background-position: 0% 50%; }
  50%     { background-position: 100% 50%; }
}

/* ==========================================================================
   FILTERS
   ========================================================================== */
.work-filters-section {
  background: #fff;
  padding-top: 0 !important;
  padding-bottom: clamp(14px, 2.4vw, 22px) !important;
}

.work-filters {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.work-filter {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(13,10,12,.10);
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(2px) saturate(1.1);
  -webkit-backdrop-filter: blur(2px) saturate(1.1);
  color: #0d0a0c;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .01em;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
  transition: transform .18s cubic-bezier(.22,.61,.36,1), filter .18s, box-shadow .18s, background .18s, color .18s;
}
.work-filter:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0,0,0,.10);
  filter: brightness(1.02);
}
.work-filter.is-active {
  background: linear-gradient(135deg, rgba(244,143,177,.95), rgba(244,196,48,.95));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(244,143,177,.25), inset 0 0 0 1px rgba(255,255,255,.20), inset 0 0 4px rgba(255,255,255,.45);
}

/* ==========================================================================
   PORTFOLIO GRID — bento with 3 sizes
   ========================================================================== */
.portfolio-section { background: #fff; color: #0d0a0c; padding-top: clamp(8px, 1.6vw, 16px) !important; }

.portfolio-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(180px, auto);
  grid-auto-flow: dense;
  gap: clamp(12px, 1.6vw, 18px);
}

.portfolio-card { position: relative; }
.portfolio-card--xl { grid-column: span 7; grid-row: span 2; }
.portfolio-card--lg { grid-column: span 5; grid-row: span 2; }
.portfolio-card--md { grid-column: span 6; grid-row: span 2; }
.portfolio-card--sm { grid-column: span 4; grid-row: span 1; }

@media (max-width: 1080px) {
  .portfolio-grid { grid-template-columns: repeat(6, 1fr); }
  .portfolio-card--xl { grid-column: span 6; grid-row: span 2; }
  .portfolio-card--lg { grid-column: span 6; grid-row: span 2; }
  .portfolio-card--md { grid-column: span 3; grid-row: span 2; }
  .portfolio-card--sm { grid-column: span 3; grid-row: span 1; }
}
@media (max-width: 640px) {
  .portfolio-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .portfolio-card--xl,
  .portfolio-card--lg,
  .portfolio-card--md,
  .portfolio-card--sm { grid-column: span 1; grid-row: auto; }
}

/* Filter hide state — animated collapse */
.portfolio-card.is-hidden {
  display: none;
}

/* Card surface (button or static wrapper share styles) */
.portfolio-card__trigger,
.portfolio-card__static {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  height: 100%;
  text-align: left;
  cursor: pointer;
  padding: 0;
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0,0,0,.08), inset 0 0 0 1px rgba(13,10,12,.06);
  transition: transform .25s cubic-bezier(.22,.61,.36,1), box-shadow .25s, filter .25s;
  color: #0d0a0c;
  font: inherit;
}
.portfolio-card__static { cursor: default; }

.portfolio-card__trigger:hover,
.portfolio-card[data-magnet]:hover .portfolio-card__trigger {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0,0,0,.12), inset 0 0 0 1px rgba(13,10,12,.08);
  filter: brightness(1.01);
}
.portfolio-card__trigger:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--pink) 60%, white);
  outline-offset: 3px;
}

/* Media area */
.portfolio-card__media {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 140px;
  position: relative;
  background: #f7f7f9;
  overflow: hidden;
}
.portfolio-card__media img,
.portfolio-card__media svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.portfolio-card__media--vector { background: #0d0a0c; }

/* Featured badge on XL card */
.portfolio-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, rgba(244,143,177,.95), rgba(244,196,48,.95));
  box-shadow: 0 6px 14px rgba(0,0,0,.18), inset 0 0 0 1px rgba(255,255,255,.25);
}

/* Body */
.portfolio-card__body {
  padding: clamp(14px, 1.6vw, 18px);
  display: grid;
  gap: 6px;
  background: #fff;
}
.portfolio-card__title {
  margin: 2px 0 0;
  font-weight: 900;
  font-size: clamp(18px, 2vw, 22px);
  letter-spacing: -0.01em;
}
.portfolio-card__sub {
  margin: 0;
  color: rgba(13,10,12,.72);
  font-size: 14px;
  line-height: 1.5;
}
.portfolio-card__cue {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  color: transparent;
  background: linear-gradient(135deg, var(--pink), var(--gold));
  -webkit-background-clip: text; background-clip: text;
}
.portfolio-card--static .portfolio-card__cue { display: none; }

/* Compact body for small cards */
.portfolio-card--sm .portfolio-card__body { padding: 12px 14px; }
.portfolio-card--sm .portfolio-card__title { font-size: 16px; }
.portfolio-card--sm .portfolio-card__sub { font-size: 13px; }

/* Empty state */
.portfolio-empty {
  margin: 24px auto 0;
  padding: 18px 22px;
  text-align: center;
  border-radius: 14px;
  background: rgba(13,10,12,.04);
  color: rgba(13,10,12,.7);
  font-weight: 600;
}

/* ==========================================================================
   CHIPS  (case meta + cloud, kept consistent with previous design)
   ========================================================================== */
.chips {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(13,10,12,.05);
  color: #0d0a0c;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .01em;
  box-shadow: 0 3px 10px rgba(0,0,0,.06);
}

/* "Live" gradient tag */
.chip--live {
  position: relative;
  color: #fff;
  isolation: isolate;
  background: transparent;
  box-shadow: 0 5px 14px rgba(0,0,0,.10);
}
.chip--live::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  z-index: -1;
  background: linear-gradient(135deg, rgba(244,143,177,.90), rgba(244,196,48,.90));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), inset 0 0 4px rgba(255,255,255,.55);
}

/* Chip cloud (How we work section) */
.chip-cloud {
  list-style: none;
  padding: 0;
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip-cloud li {
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  color: #0d0a0c;
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(2px) saturate(1.1);
  -webkit-backdrop-filter: blur(2px) saturate(1.1);
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  border: 1px solid rgba(13,10,12,.08);
}

/* ==========================================================================
   PROJECT MODAL — overlay expansion
   ========================================================================== */
.project-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 32px);
}
.project-modal.is-open {
  display: flex;
  animation: modalFadeIn .25s ease both;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.project-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13,10,12,.55);
  backdrop-filter: blur(6px) saturate(1.1);
  -webkit-backdrop-filter: blur(6px) saturate(1.1);
}

.project-modal__panel {
  position: relative;
  width: min(960px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 30px 60px rgba(0,0,0,.30);
  padding: clamp(20px, 3vw, 36px);
  animation: panelRise .3s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes panelRise {
  from { transform: translateY(20px) scale(.98); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.project-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: rgba(13,10,12,.06);
  color: #0d0a0c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .18s, transform .18s;
  z-index: 2;
}
.project-modal__close:hover { background: rgba(13,10,12,.12); transform: scale(1.05); }
.project-modal__close:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--pink) 60%, white);
  outline-offset: 2px;
}

/* Project detail layout */
.project-detail__head { margin-bottom: 18px; }
.project-detail__head .chips { margin-bottom: 12px; }
.project-detail__title {
  margin: 0;
  font-weight: 900;
  font-size: clamp(24px, 3.6vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.project-detail__gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 18px 0 22px;
}
.project-detail__gallery figure { margin: 0; }
.project-detail__gallery img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(0,0,0,.10);
}
@media (max-width: 640px) {
  .project-detail__gallery { grid-template-columns: 1fr; }
}

.project-detail__lead {
  margin: 0 0 18px;
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.6;
  color: rgba(13,10,12,.88);
}
.project-detail__h4 {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(13,10,12,.6);
}
.project-detail__body .bullets {
  margin: 0 0 12px;
  padding-left: 1.1em;
}
.project-detail__body .bullets li {
  margin: .35em 0;
  color: rgba(13,10,12,.88);
}
.project-detail__foot {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* When modal open — lock body scroll */
body.modal-open { overflow: hidden; }

/* Card "expanding" visual cue while modal opens (tiny grow) */
.portfolio-card.is-active .portfolio-card__trigger {
  transform: scale(.98);
  filter: brightness(.96);
}
/* Other cards dim slightly while one is active */
.portfolio-grid.is-focusing .portfolio-card:not(.is-active) {
  opacity: .55;
  filter: saturate(.85);
  transition: opacity .25s ease, filter .25s ease;
}

/* ==========================================================================
   HOW WE WORK
   ========================================================================== */
.how-we-work { background: #fff; color: #0d0a0c; }
.how__title {
  margin: .2em 0 .4em;
  font-weight: 900;
  font-size: clamp(28px, 5.2vw, 44px);
}
.how__copy {
  margin: 0 0 14px;
  max-width: 880px;
  color: rgba(13,10,12,.9);
}
.how-we-work .how__copy { margin-bottom: 18px; }

/* ==========================================================================
   SIGNALS — glass outline cards
   ========================================================================== */
.signals { background: #fff; color: #0d0a0c; }
.signals__title {
  margin: .2em 0 .6em;
  font-weight: 900;
  font-size: clamp(28px, 5.2vw, 44px);
}
.signals__grid {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 2.2vw, 20px);
}
@media (max-width: 1080px) { .signals__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px)  { .signals__grid { grid-template-columns: 1fr; } }

.signal .glass__content { padding: clamp(16px, 2.2vw, 22px); }
.signal h3 {
  margin: .1em 0 .3em;
  font-weight: 900;
  font-size: clamp(18px, 2.4vw, 22px);
}
.signal p { margin: 0; color: rgba(13,10,12,.88); }

.signal--grad .glass__filter {
  -webkit-backdrop-filter: blur(calc(var(--lg-blur) * 1.8)) saturate(var(--lg-vibrancy));
  backdrop-filter: blur(calc(var(--lg-blur) * 1.8)) saturate(var(--lg-vibrancy));
  will-change: backdrop-filter;
}
.signal--grad .glass__overlay {
  background: linear-gradient(135deg, rgba(244,143,177,.16), rgba(244,196,48,.16));
}

/* ==========================================================================
   FINAL CTA + button width helper
   ========================================================================== */
.work-final-cta { background: #fff; color: #0d0a0c; }
.work-final-cta .lead { color: rgba(13,10,12,.88); }

.btn--wide {
  width: 100%;
  max-width: 520px;
  margin-top: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   Bullets (shared)
   ========================================================================== */
.bullets { margin: 0 0 1.1em; padding-left: 1.1em; }
.bullets--tight li { margin: .35em 0; }

/* ==========================================================================
   Reset accidental section borders
   ========================================================================== */
section, .signals, .how-we-work, .work-final-cta, .portfolio-section { border: 0 !important; }
