/* ==========================================================================
   ADS PORTFOLIO
   Styled to match the two poster artworks that open and close the page:
   warm paper stock, heavy condensed capitals, cobalt accent, film grain.
   Palette is sampled from the posters themselves — the pale backdrop and
   charcoal type of "No Shoot Day", the cobalt and cream of "Ads That Sell".
   ========================================================================== */

.p-body {
  --paper:        #EDE9E1;   /* poster backdrop */
  --paper-card:   #F7F5F0;
  --char:         #1E2226;   /* poster headline charcoal */
  --char-soft:    #5B6166;
  --cobalt:       #1B47D8;   /* the blue from "No Crew" / "Ads That Sell" */
  --cobalt-deep:  #0D2A63;
  --ember:        #E8823C;   /* the mug */
  --rule:         rgba(30, 34, 38, 0.14);

  background-color: var(--paper);
  color: var(--char);
}

/* Film grain across the whole page, matching the grain baked into the art. */
.p-body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.portfolio-shell {
  min-height: 100vh;
  padding: 24px 32px 32px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Display type ----------
   Anton is the closest web face to the condensed grotesque burned into the
   posters, so every heading on the page speaks the same language as the art. */
.p-display {
  font-family: 'Anton', 'Instrument Sans', system-ui, sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  line-height: 0.94;
}

/* ---------- Nav ---------- */
.p-nav {
  max-width: var(--content-max);
  margin: 0 auto 14px;
  padding: 10px 10px 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  background-color: rgba(247, 245, 240, 0.92);
  border: 1px solid var(--rule);
  border-radius: 99px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.p-nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--char-soft);
}

.p-nav-links a:hover { color: var(--char); }
.p-nav-links a[aria-current="page"] { color: var(--cobalt); }

.p-nav .btn-nav {
  background-color: var(--cobalt);
  color: #fff;
}

.p-nav .btn-nav:hover { background-color: var(--cobalt-deep); }

/* ---------- Page shell ---------- */
.p-page {
  max-width: var(--content-max);
  margin: 0 auto;
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 20px;
  overflow: hidden;
}

.p-section-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cobalt);
  margin-bottom: 20px;
}

/* ==========================================================================
   POSTER BLOCKS — hero and closing CTA
   The artwork is a finished composition: type left, subject right. Nothing is
   overlaid on it. It runs full width at its own 16:9 and the copy sits in a
   band beneath, which also means the left-hand headline is never cropped on
   a narrow screen.
   ========================================================================== */
.p-poster {
  display: block;
  width: 100%;
}

.p-poster img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.p-hero {
  background-color: var(--char);
  border-bottom: 1px solid var(--rule);
}

.p-hero-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 34px var(--section-pad-h) 30px;
}

.p-lede {
  max-width: 520px;
  font-size: 16px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
}

.p-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.p-hero .btn-primary,
.p-cta .btn-primary {
  background-color: var(--cobalt);
  color: #fff;
  border-radius: 2px;
}

.p-hero .btn-primary:hover,
.p-cta .btn-primary:hover {
  background-color: #fff;
  color: var(--char);
  box-shadow: none;
}

.p-link-arrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  border-bottom: 2px solid rgba(255, 255, 255, 0.35);
  padding-bottom: 3px;
}

.p-link-arrow:hover { color: var(--ember); border-color: var(--ember); }

/* stat row */
.p-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.p-stat {
  padding: 24px var(--section-pad-h) 30px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.p-stat:last-child { border-right: 0; }
.p-stat:not(:first-child) { padding-left: 26px; }

.p-stat dt {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
}

.p-stat dd {
  font-family: 'Anton', 'Instrument Sans', system-ui, sans-serif;
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 0.94;
  text-transform: uppercase;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   CLIENT WALL
   ========================================================================== */
.p-clients {
  padding: clamp(44px, 6vw, 68px) var(--section-pad-h);
  border-bottom: 1px solid var(--rule);
}

.p-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.p-logo {
  flex: 1 1 220px;
  padding: 22px 24px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-family: 'Anton', 'Instrument Sans', system-ui, sans-serif;
  font-size: clamp(19px, 2.1vw, 26px);
  text-transform: uppercase;
  letter-spacing: 0.005em;
  line-height: 1;
  color: var(--char);
}

.p-clients-note {
  margin-top: 22px;
  max-width: 520px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--char-soft);
}

/* ==========================================================================
   SERVICES
   ========================================================================== */
.p-services {
  padding: clamp(48px, 7vw, 80px) var(--section-pad-h);
  border-bottom: 1px solid var(--rule);
}

.p-service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.p-service {
  padding: 26px 24px 30px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  transition: background-color var(--ease-base);
}

.p-service:hover { background-color: rgba(27, 71, 216, 0.05); }

.p-service-num {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--cobalt);
  margin-bottom: 16px;
}

.p-service h2 {
  font-family: 'Anton', 'Instrument Sans', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1.02;
  letter-spacing: 0.005em;
  color: var(--char);
  margin-bottom: 10px;
}

.p-service p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--char-soft);
}

/* ==========================================================================
   WORK — heading, filters, grid
   ========================================================================== */
.p-work-head {
  padding: clamp(48px, 7vw, 80px) var(--section-pad-h) 6px;
  scroll-margin-top: 90px;
}

.p-h2 {
  font-family: 'Anton', 'Instrument Sans', system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(38px, 6.4vw, 82px);
  text-transform: uppercase;
  color: var(--char);
  line-height: 0.92;
  letter-spacing: 0.005em;
}

.p-filters {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 22px var(--section-pad-h);
  background: rgba(247, 245, 240, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--rule);
}

.p-chip {
  padding: 8px 15px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--char-soft);
  cursor: pointer;
  transition: background var(--ease-fast), color var(--ease-fast),
              border-color var(--ease-fast);
}

.p-chip:hover { color: var(--char); border-color: var(--char); }

.p-chip[aria-pressed="true"] {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: #fff;
}

.p-chip-count {
  opacity: 0.6;
  margin-left: 7px;
  font-variant-numeric: tabular-nums;
}

/* ---------- Masonry ----------
   Multicol is the no-JS fallback; portfolio.js swaps in explicit columns and
   fills left-to-right so the newest-first order actually reads that way. */
.p-grid {
  padding: 28px var(--section-pad-h) clamp(56px, 8vw, 96px);
  columns: 3 260px;
  column-gap: 14px;
}

.p-grid.is-masonry {
  columns: auto;
  column-gap: normal;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.p-col {
  flex: 1 1 0;
  min-width: 0;
}

.p-item {
  break-inside: avoid;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  width: 100%;
  display: block;
  position: relative;
  border-radius: 3px;
  overflow: hidden;
  background: var(--paper) center / cover no-repeat;
  cursor: pointer;
  font-family: var(--font-sans);
  text-align: left;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease-spring), transform 0.6s var(--ease-spring),
              box-shadow var(--ease-base);
}

.p-item.is-in { opacity: 1; transform: none; }
.p-item[hidden] { display: none; }

.p-item img,
.p-item video {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.7s var(--ease-spring);
}

.p-item .p-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--ease-base);
  pointer-events: none;
}

.p-item.is-previewing .p-preview { opacity: 1; }

.p-item:hover,
.p-item:focus-visible {
  box-shadow: 0 14px 34px rgba(30, 34, 38, 0.26), 0 0 0 2px var(--cobalt);
}

.p-item:hover img { transform: scale(1.04); }

/* caption */
.p-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 44px 14px 13px;
  background: linear-gradient(to top, rgba(14, 17, 20, 0.92) 0%, rgba(14, 17, 20, 0) 100%);
  color: #fff;
  pointer-events: none;
}

.p-cap-brand {
  display: block;
  font-family: 'Anton', 'Instrument Sans', system-ui, sans-serif;
  font-size: 17px;
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: 0.005em;
}

.p-cap-title {
  display: block;
  margin-top: 5px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.8);
}

.p-cap-kind {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ember);
}

@media (hover: hover) and (pointer: fine) {
  .p-cap {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity var(--ease-base), transform var(--ease-base);
  }
  .p-item:hover .p-cap,
  .p-item:focus-visible .p-cap { opacity: 1; transform: none; }
}

/* badges */
.p-badge,
.p-status {
  position: absolute;
  top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}

.p-badge {
  left: 10px;
  background: rgba(14, 17, 20, 0.66);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
}

.p-badge svg { width: 8px; height: 8px; fill: var(--ember); }

.p-status {
  right: 10px;
  background: rgba(14, 17, 20, 0.66);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.85);
}

.p-status-client {
  background: var(--cobalt);
  color: #fff;
}

/* ==========================================================================
   PROCESS
   ========================================================================== */
.p-process {
  padding: clamp(48px, 7vw, 80px) var(--section-pad-h);
  border-top: 1px solid var(--rule);
  background-color: var(--paper);
}

.p-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  list-style: none;
}

.p-step {
  padding: 26px 24px 32px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.p-step-num {
  display: block;
  font-family: 'Anton', 'Instrument Sans', system-ui, sans-serif;
  font-size: 40px;
  line-height: 1;
  color: var(--cobalt);
  margin-bottom: 16px;
}

.p-step h3 {
  font-family: 'Anton', 'Instrument Sans', system-ui, sans-serif;
  font-weight: 400;
  font-size: 21px;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  line-height: 1.02;
  color: var(--char);
  margin-bottom: 10px;
}

.p-step p {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--char-soft);
}

/* ==========================================================================
   CLOSING CTA
   ========================================================================== */
.p-cta {
  background-color: var(--cobalt-deep);
  border-top: 1px solid var(--rule);
}

.p-cta-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding: 32px var(--section-pad-h) 38px;
}

.p-cta-p {
  max-width: 520px;
  font-size: 16px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.p-footer {
  max-width: var(--content-max);
  margin: 20px auto 0;
  padding: 22px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--char-soft);
}

.p-footer a { color: var(--char-soft); }
.p-footer a:hover { color: var(--cobalt); }

/* ==========================================================================
   PLAYER
   ========================================================================== */
.p-lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: rgba(14, 17, 20, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.p-lightbox.is-open { display: flex; }
body.p-locked { overflow: hidden; }

.p-lb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 100%;
  max-height: 100%;
}

.p-lb-media {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: calc(100vh - 190px);
}

.p-lb-media video {
  display: block;
  max-width: min(88vw, 1100px);
  max-height: calc(100vh - 190px);
  width: auto;
  height: auto;
  border-radius: 3px;
  background: #000;
}

.p-lb-info { text-align: center; max-width: 560px; }

.p-lb-brand {
  font-family: 'Anton', 'Instrument Sans', system-ui, sans-serif;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  color: #fff;
}

.p-lb-title {
  margin-top: 5px;
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.78);
}

.p-lb-meta {
  margin-top: 9px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ember);
}

.p-lb-close,
.p-lb-btn {
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: background var(--ease-fast), border-color var(--ease-fast);
}

.p-lb-close:hover,
.p-lb-btn:hover { background: var(--cobalt); border-color: var(--cobalt); }

.p-lb-btn { width: 46px; height: 46px; font-size: 26px; }

.p-lb-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  font-size: 26px;
  line-height: 1;
  z-index: 2;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .portfolio-shell { padding: 16px 16px 24px; }
  .p-page { border-radius: 14px; }

  .p-hero-copy,
  .p-cta-copy,
  .p-clients,
  .p-services,
  .p-process,
  .p-work-head,
  .p-filters,
  .p-grid { padding-left: 24px; padding-right: 24px; }

  .p-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .p-stat {
    padding: 20px 24px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }

  .p-stat:nth-child(2n) { border-right: 0; }
  .p-stat:not(:first-child) { padding-left: 24px; }

  .p-grid { columns: 2 150px; }

  /* the brand name is the point of the tile, so on narrow screens the caption
     stays put instead of waiting for a hover that may never come */
  .p-cap { opacity: 1; transform: none; padding: 38px 12px 11px; }

  .p-hero-copy,
  .p-cta-copy { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .p-grid { columns: 1; }
  .p-hero-actions { flex-direction: column; align-items: flex-start; gap: 14px; }
  .p-logo { flex-basis: 100%; }
  .p-lb-btn { width: 38px; height: 38px; font-size: 22px; }
  .p-lightbox { padding: 12px; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .p-item { opacity: 1; transform: none; transition: none; }
  .p-item:hover img { transform: none; }
}
