/* Biban Agency — brand layer on top of the Webflow base styles */

/* Arabic glyphs fall back to Noto Kufi Arabic wherever Montserrat is used */
@font-face {
  font-family: Montserrat;
  src: url(/assets/fonts/noto-kufi-arabic-400.woff2) format("woff2"), url(/assets/fonts/noto-kufi-arabic-400.woff) format("woff");
  font-weight: 300 500;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: Montserrat;
  src: url(/assets/fonts/noto-kufi-arabic-700.woff2) format("woff2"), url(/assets/fonts/noto-kufi-arabic-700.woff) format("woff");
  font-weight: 600 800;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF;
}

.brand-logo img.custom-logo,
.brand-logo img.l-logo {
  max-width: 128px !important;
  max-height: 38px !important;
}

/* Three links in the left nav: size columns to their labels so none get clipped */
.left-nav,
.right-nav {
  grid-auto-columns: auto;
}

.nav-link { white-space: nowrap; }

body:has([data-namespace='crew']) .header {
  background: linear-gradient(180deg, rgba(12, 12, 12, 0.92) 55%, rgba(12, 12, 12, 0));
}

/* Contact: stack each service (title, subtitle, links) on one centred axis.
   The page's WebGL text layer reads text-align, so set it explicitly. */
body:has([data-namespace='contact']) .representatives-content {
  grid-auto-flow: row;
  justify-items: center;
}

body:has([data-namespace='contact']) .c-rep { max-width: none; }

body:has([data-namespace='contact']) .c-link-item {
  align-items: center;
  text-align: center;
}

.biban-proverb {
  text-align: center;
  margin: 1.5rem 0 0;
  font-family: Montserrat, sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.6;
  color: var(--brand-red);
}

/* ------------------------------------------------------------ Crew page */
body:has([data-namespace='crew']) .c-bg { opacity: 0.55 !important; }

.crew-page {
  position: relative;
  z-index: 2;
  padding: 11rem 4vw 8rem;
  color: var(--brand-cream);
}

.crew-hero {
  position: relative;
  max-width: 62rem;
  margin: 0 auto 6rem;
  text-align: center;
}

.crew-sfx {
  position: absolute;
  inset: -4rem 0 auto;
  font-family: Montserrat, sans-serif;
  font-weight: 800;
  font-size: clamp(6rem, 18vw, 16rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px rgba(179, 20, 28, 0.55);
  transform: rotate(-6deg);
  pointer-events: none;
  user-select: none;
}

.crew-kicker {
  position: relative;
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.7;
}

.crew-h1 {
  position: relative;
  font-family: Biban Display, Arial, sans-serif;
  font-size: clamp(3.5rem, 10vw, 9rem);
  line-height: 0.95;
}

.crew-lede {
  position: relative;
  max-width: 34rem;
  margin: 1.5rem auto 0;
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1.5;
}

.crew-hero .biban-proverb { position: relative; color: var(--brand-cream); opacity: 0.85; }

.crew-posters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4vw;
  max-width: 84rem;
  margin: 0 auto;
}

/* Wanted posters: parchment from the brand book's sand texture, studded bands from its door panels */
.wanted { transform: rotate(var(--tilt, 0deg)); transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.wanted:hover { transform: rotate(0deg) translateY(-0.5rem); }

.wanted-paper {
  position: relative;
  padding: 1.2rem 1.6rem 1.4rem;
  color: #3A2316;
  text-align: center;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255, 248, 230, 0.55), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(120, 80, 40, 0.18), transparent 55%),
    #D9C4A0;
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.45), inset 0 0 3rem rgba(90, 55, 25, 0.35);
}

.wanted-studs {
  height: 0.9rem;
  margin: 0 -0.6rem;
  background: radial-gradient(circle at 50% 50%, #4a4a4a 0 0.22rem, #111 0.3rem, transparent 0.34rem) 0 50% / 1.2rem 0.9rem repeat-x;
}

.wanted-title {
  margin: 0.6rem 0 0.4rem;
  font-family: Biban Serif, Georgia, serif;
  font-size: clamp(2.6rem, 4.6vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0.04em;
}

.wanted-photo {
  border: 0.35rem solid #3A2316;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #2a1b12;
}

.wanted-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.18) contrast(1.04);
}

.wanted-sub {
  margin: 0.6rem 0 0;
  font-family: Biban Serif, Georgia, serif;
  font-style: italic;
  font-size: 1.1rem;
}

.wanted-name {
  margin: 0.1rem 0 0;
  font-family: Biban Display, Arial, sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.05;
  text-transform: uppercase;
}

.wanted-bounty {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.4rem 0 0.6rem;
  font-family: Biban Serif, Georgia, serif;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.wanted-bounty .berry { font-family: Montserrat, sans-serif; font-weight: 700; }
.wanted-bounty .dash { opacity: 0.6; }

.wanted-seal {
  display: block;
  width: 3.4rem;
  height: auto;
  margin: 0 0 0.6rem auto;
  opacity: 0.9;
}

.wanted-info { padding: 1.6rem 0.4rem 0; }

.wanted-epithet {
  margin: 0;
  font-family: Biban Serif, Georgia, serif;
  font-style: italic;
  font-size: 1.6rem;
  color: var(--brand-cream);
}

.wanted-real {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #E05A4F;
}

.wanted-bio { margin: 0.8rem 0 0; font-weight: 300; line-height: 1.55; opacity: 0.85; }

.wanted-links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; margin-top: 1rem; }

.wanted-links a {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(222, 215, 209, 0.4);
  padding-bottom: 0.2rem;
}

.crew-log { max-width: 62rem; margin: 9rem auto 0; }

.crew-h2 {
  font-family: Biban Display, Arial, sans-serif;
  font-size: clamp(2.4rem, 6vw, 5rem);
  text-transform: uppercase;
  line-height: 1;
}

.arcs { list-style: none; margin: 2.5rem 0 0; padding: 0; border-top: 1px solid rgba(222, 215, 209, 0.25); }

.arc {
  display: grid;
  grid-template-columns: 7rem 16rem 1fr;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.6rem 0;
  border-bottom: 1px solid rgba(222, 215, 209, 0.25);
}

.arc-n { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: #E05A4F; }
.arc-t { margin: 0; font-family: Biban Serif, Georgia, serif; font-size: 2rem; font-weight: 400; line-height: 1.1; }
.arc-p { margin: 0; font-weight: 300; line-height: 1.55; opacity: 0.85; }

.crew-cta {
  display: inline-block;
  margin-top: 3rem;
  padding: 1.1rem 2rem;
  background: var(--brand-red);
  color: var(--brand-cream);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background-color 0.2s ease;
}

.crew-cta:hover { background: var(--brand-accent); color: var(--brand-cream) !important; }

@media screen and (max-width: 991px) {
  .crew-posters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem 2rem; }
  .arc { grid-template-columns: 1fr; gap: 0.4rem; }
}

@media screen and (max-width: 640px) {
  .crew-page { padding: 8rem 16px 6rem; }
  .crew-posters { grid-template-columns: 1fr; max-width: 26rem; }
  .crew-sfx { inset: -2rem 0 auto; }
}

/* ------------------------------------------------------------ Crew: One Piece flourishes
   Chapter card, DON!! impact, speed lines, posters pinned up, one signature
   move per character, bounty stamp. Reveals wait for .is-in (set by biban.js);
   without the script, or with reduced motion, everything simply shows. */

.crew-chapter {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-content: center;
  gap: 0.6rem;
  text-align: center;
  background: var(--brand-dark);
  color: var(--brand-cream);
  pointer-events: none;
  animation: chapter-out 0.7s cubic-bezier(0.7, 0, 0.3, 1) 0.9s forwards;
}

.crew-chapter::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-55deg, transparent 0 2.2rem, rgba(131, 0, 0, 0.35) 2.2rem 2.5rem);
  animation: chapter-lines 0.9s linear both;
}

.crew-chapter-k {
  position: relative;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: #E05A4F;
  animation: chapter-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) 0.1s both;
}

.crew-chapter-t {
  position: relative;
  font-family: Biban Display, Arial, sans-serif;
  font-size: clamp(3rem, 9vw, 8rem);
  line-height: 1;
  text-transform: uppercase;
  animation: chapter-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) 0.2s both;
}

@keyframes chapter-in { from { opacity: 0; transform: translateY(1.5rem) skewY(4deg); } }
@keyframes chapter-lines { from { background-position: 0 0; } to { background-position: 12rem 0; } }
@keyframes chapter-out { to { clip-path: inset(0 0 100% 0); visibility: hidden; } }

/* Manga speed lines radiating behind the title */
.crew-burst {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 160vmax;
  height: 160vmax;
  margin: -80vmax 0 0 -80vmax;
  background: repeating-conic-gradient(from 0deg, rgba(222, 215, 209, 0.09) 0deg 1.1deg, transparent 1.1deg 6.5deg);
  -webkit-mask-image: radial-gradient(circle, transparent 9%, #000 22%, transparent 48%);
  mask-image: radial-gradient(circle, transparent 9%, #000 22%, transparent 48%);
  pointer-events: none;
  animation: burst-pop 0.6s ease-out 1.25s both, burst-spin 90s linear 1.25s infinite;
}

@keyframes burst-pop { from { opacity: 0; transform: scale(0.4); } }
@keyframes burst-spin { to { transform: rotate(360deg); } }

/* The DON!! lettering slams in, the title takes the hit, then the lettering breathes */
.crew-sfx { animation: don-slam 0.55s cubic-bezier(0.2, 1.5, 0.35, 1) 1.2s both, don-idle 3.6s ease-in-out 1.9s infinite; }
.crew-h1 { animation: impact-shake 0.45s linear 1.42s both; }

@keyframes don-slam {
  from { opacity: 0; transform: rotate(-16deg) scale(2.8); }
  to { opacity: 1; transform: rotate(-6deg) scale(1); }
}
@keyframes don-idle {
  0%, 100% { transform: rotate(-6deg) scale(1); }
  50% { transform: rotate(-4deg) scale(1.04); -webkit-text-stroke-color: rgba(224, 90, 79, 0.75); }
}
@keyframes impact-shake {
  15% { transform: translate(-0.5rem, 0.25rem); }
  30% { transform: translate(0.45rem, -0.3rem); }
  45% { transform: translate(-0.3rem, -0.15rem); }
  60% { transform: translate(0.2rem, 0.2rem); }
  80% { transform: translate(-0.1rem, 0); }
}

/* Posters get pinned up: drop, swing, settle on their tilt */
.biban-js .wanted:not(.is-in),
.biban-js .arc:not(.is-in) { opacity: 0; }

.wanted.is-in { animation: poster-pin 1s cubic-bezier(0.3, 1.4, 0.45, 1) calc(var(--i, 0) * 0.16s) backwards; }

@keyframes poster-pin {
  0% { opacity: 0; transform: translateY(-5rem) rotate(calc(var(--tilt, 0deg) - 10deg)); }
  45% { opacity: 1; transform: translateY(0.4rem) rotate(calc(var(--tilt, 0deg) + 4deg)); }
  70% { transform: translateY(0) rotate(calc(var(--tilt, 0deg) - 2deg)); }
  to { transform: rotate(var(--tilt, 0deg)); }
}

.wanted-photo { position: relative; }

.wanted-fx {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.wanted-fx span { position: absolute; display: block; opacity: 0; }

/* Django — Santoryu: three blade flashes cross the portrait */
.wanted[data-power="slash"] .wanted-fx span {
  left: -30%;
  width: 160%;
  height: 0.28rem;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95) 45%, #E05A4F 55%, transparent);
  box-shadow: 0 0 0.8rem rgba(255, 255, 255, 0.8);
  transform: rotate(var(--r, -32deg)) translateX(-110%);
}
.wanted[data-power="slash"] .wanted-fx span:nth-child(1) { top: 30%; }
.wanted[data-power="slash"] .wanted-fx span:nth-child(2) { top: 50%; --r: 28deg; --d: 0.12s; }
.wanted[data-power="slash"] .wanted-fx span:nth-child(3) { top: 70%; --d: 0.24s; }

.wanted[data-power="slash"].is-in .wanted-fx span { animation: slash 0.5s cubic-bezier(0.6, 0, 0.2, 1) calc(1s + var(--d, 0s)) both; }
.wanted[data-power="slash"].is-in:hover .wanted-fx span { animation: slash-loop 1.6s cubic-bezier(0.6, 0, 0.2, 1) var(--d, 0s) infinite; }

@keyframes slash {
  0% { opacity: 1; transform: rotate(var(--r, -32deg)) translateX(-110%); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--r, -32deg)) translateX(110%); }
}
@keyframes slash-loop {
  0% { opacity: 1; transform: rotate(var(--r, -32deg)) translateX(-110%); }
  25% { opacity: 1; }
  32%, 100% { opacity: 0; transform: rotate(var(--r, -32deg)) translateX(110%); }
}

/* D_Bingo — Gear 5: rubbery bounce and cloud puffs */
.wanted[data-power="gear5"]:hover .wanted-paper { animation: rubber 0.8s cubic-bezier(0.3, 1.6, 0.5, 1); }

.wanted[data-power="gear5"] .wanted-fx span {
  bottom: -1.5rem;
  width: 5rem;
  height: 3rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 1.8rem -0.8rem 0 0.3rem #fff, -1.6rem -0.5rem 0 0.1rem #fff, 0.4rem -1.6rem 0 0 #fff;
  filter: blur(1px) drop-shadow(0 0 0.6rem rgba(255, 255, 255, 0.7));
}
.wanted[data-power="gear5"] .wanted-fx span:nth-child(1) { left: -1rem; }
.wanted[data-power="gear5"] .wanted-fx span:nth-child(2) { left: 40%; --d: 0.15s; }
.wanted[data-power="gear5"] .wanted-fx span:nth-child(3) { right: -1rem; --d: 0.3s; }

.wanted[data-power="gear5"].is-in .wanted-fx span { animation: cloud-pop 1.6s cubic-bezier(0.3, 1.5, 0.5, 1) calc(1.1s + var(--d, 0s)) both; }
.wanted[data-power="gear5"].is-in:hover .wanted-fx span { animation: cloud-bob 1.4s ease-in-out var(--d, 0s) infinite; }

@keyframes rubber {
  25% { transform: scale(1.1, 0.88); }
  45% { transform: scale(0.92, 1.1); }
  65% { transform: scale(1.04, 0.97); }
}
@keyframes cloud-pop {
  0% { opacity: 0; transform: scale(0.2) translateY(2rem); }
  40% { opacity: 0.95; transform: scale(1.1) translateY(0); }
  100% { opacity: 0; transform: scale(1.3) translateY(-1.5rem); }
}
@keyframes cloud-bob {
  0%, 100% { opacity: 0.9; transform: translateY(0) scale(1); }
  50% { opacity: 0.95; transform: translateY(-0.8rem) scale(1.08); }
}

/* Zaki — the gentleman: smoke drifting up the portrait */
.wanted[data-power="smoke"] .wanted-fx span {
  bottom: -2rem;
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(235, 235, 235, 0.55), transparent 70%);
  filter: blur(6px);
}
.wanted[data-power="smoke"] .wanted-fx span:nth-child(1) { left: 10%; }
.wanted[data-power="smoke"] .wanted-fx span:nth-child(2) { left: 42%; --d: 0.5s; }
.wanted[data-power="smoke"] .wanted-fx span:nth-child(3) { left: 68%; --d: 1s; }

.wanted[data-power="smoke"].is-in .wanted-fx span { animation: smoke 3s ease-out calc(1.1s + var(--d, 0s)) both; }
.wanted[data-power="smoke"].is-in:hover .wanted-fx span { animation: smoke 3s ease-out var(--d, 0s) infinite; }

@keyframes smoke {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  25% { opacity: 0.8; }
  100% { opacity: 0; transform: translate(1.5rem, -22rem) scale(2.4); }
}

/* Bounty: numbers spin (biban.js), then PRICELESS gets stamped */
.bounty-roll { display: inline-block; min-width: 7ch; font-variant-numeric: tabular-nums; }
.bounty-roll.is-stamped { animation: stamp 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both; color: #7A0F12; }

@keyframes stamp {
  from { opacity: 0; transform: scale(2.2) rotate(-8deg); }
  to { opacity: 1; transform: scale(1) rotate(-3deg); }
}

/* The Log: arcs turn in like manga pages */
.arc.is-in { animation: page-turn 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) calc(var(--i, 0) * 0.14s) backwards; transform-origin: left center; }
.arc.is-in .arc-n { animation: ink 0.6s ease-out calc(0.2s + var(--i, 0) * 0.14s) backwards; }

@keyframes page-turn {
  from { opacity: 0; transform: perspective(60rem) rotateY(-22deg) translateX(-3rem); }
}
@keyframes ink { from { clip-path: inset(0 100% 0 0); } }

@media (prefers-reduced-motion: reduce) {
  .crew-chapter { display: none; }
  .crew-burst, .crew-sfx, .crew-h1, .wanted.is-in, .arc.is-in, .arc.is-in .arc-n,
  .wanted-fx span, .wanted .wanted-paper, .bounty-roll.is-stamped { animation: none !important; }
}
