/* =========================================================
   BytesTribe — Our Work / Portfolio
   ========================================================= */

body.is-work,
body:has(.work-page) {
  background: #ffffff !important;
  background-image: none !important;
}

body.is-work::before,
body:has(.work-page)::before {
  opacity: 0.012;
}

body.is-work .bt-header,
body:has(.work-page) .bt-header {
  background: rgba(255, 255, 255, 0.82);
}

body.is-work .bt-header.is-scrolled,
body:has(.work-page) .bt-header.is-scrolled {
  background: rgba(255, 255, 255, 0.94);
}

body.is-work .bt-footer,
body:has(.work-page) .bt-footer {
  margin-top: 0;
}

.work-page {
  --w-ink: #0b1220;
  --w-teal: #0d9488;
  --w-mint: #2dd4bf;
  --w-coral: #ff4e32;
  --w-coral-2: #ff7a4d;
  --w-muted: #64748b;
  --w-line: rgba(11, 18, 32, 0.08);
  --w-soft: #f3f7f9;
  --w-display: 'Syne', sans-serif;
  --w-body: 'Instrument Sans', sans-serif;
  --w-ease: cubic-bezier(0.22, 1, 0.36, 1);
  overflow: clip;
  background: #fff;
  color: var(--w-ink);
  font-family: var(--w-body);
}

.work-page * { box-sizing: border-box; }

[data-work-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--w-ease), transform 0.8s var(--w-ease);
}

[data-work-reveal].is-in {
  opacity: 1;
  transform: none;
}

.work-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--w-teal);
  margin-bottom: 0.65rem;
}

.work-kicker::before {
  content: '';
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--w-teal), var(--w-coral));
}

.work-kicker--light {
  color: var(--w-mint);
}

.work-kicker--light::before {
  background: linear-gradient(90deg, var(--w-mint), var(--w-coral-2));
}

.work-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0.85rem 1.55rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.94rem;
  border: 1.5px solid transparent;
  transition: transform 0.35s var(--w-ease), box-shadow 0.35s ease, background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.work-btn i { transition: transform 0.3s ease; }
.work-btn:hover i { transform: translateX(4px); }

.work-btn--primary {
  background: linear-gradient(135deg, var(--w-coral), var(--w-coral-2));
  color: #fff;
  box-shadow: 0 14px 32px rgba(255, 78, 50, 0.32);
}

.work-btn--primary:hover { color: #fff; }

.work-btn--ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

.work-btn--ghost:hover {
  color: #fff;
  border-color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

/* ---------- Hero ---------- */
.work-hero {
  position: relative;
  min-height: min(42vh, 360px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #fff;
  background: #071018;
}

.work-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.work-hero__mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 50% at 78% 28%, rgba(45, 212, 191, 0.28), transparent 58%),
    radial-gradient(ellipse 45% 40% at 12% 78%, rgba(255, 78, 50, 0.22), transparent 55%),
    linear-gradient(160deg, #061018 0%, #0b1c28 48%, #0a1620 100%);
}

.work-hero__glow {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(circle at 70% 35%, rgba(45, 212, 191, 0.18), transparent 40%),
    radial-gradient(circle at 25% 60%, rgba(255, 122, 77, 0.14), transparent 42%);
  animation: work-glow 9s ease-in-out infinite alternate;
}

.work-hero__grid {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}

@keyframes work-glow {
  from { opacity: 0.7; transform: translate(0, 0); }
  to { opacity: 1; transform: translate(-2%, 2%); }
}

.work-hero__inner {
  position: relative;
  z-index: 2;
  padding: 4.75rem 0 2.25rem;
  max-width: 760px;
}

.work-hero__crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.7rem;
}

.work-hero__crumb a { color: #fff; }
.work-hero__crumb a:hover { color: var(--w-mint); }

.work-hero h1 {
  font-family: var(--w-display);
  font-size: clamp(1.65rem, 3.4vw, 2.45rem);
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin: 0 0 0.65rem;
  color: #fff;
}

.work-hero__lead {
  margin: 0;
  max-width: 48ch;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.98rem;
  line-height: 1.55;
}

/* ---------- Sections ---------- */
.work-section {
  padding: clamp(2.75rem, 6vw, 4.75rem) 0;
}

.work-section--soft {
  background:
    radial-gradient(ellipse 60% 45% at 100% 0%, rgba(45, 212, 191, 0.08), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(255, 78, 50, 0.05), transparent 50%),
    var(--w-soft);
}

.work-head {
  max-width: 560px;
  margin-bottom: 1.75rem;
}

.work-head--center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.work-head--center .work-kicker {
  justify-content: center;
}

.work-head h2 {
  font-family: var(--w-display);
  font-size: clamp(1.75rem, 3.6vw, 2.65rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin: 0 0 0.55rem;
}

.work-head p {
  margin: 0 auto;
  color: var(--w-muted);
  font-size: 1.02rem;
  line-height: 1.6;
  max-width: 46ch;
}

/* ---------- Uniform project grid ---------- */
.work-grid {
  display: grid;
  gap: 1.15rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .work-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.work-item {
  position: relative;
  display: block;
  border-radius: 22px;
  overflow: hidden;
  background: #0b1220;
  color: #fff;
  text-decoration: none;
  isolation: isolate;
  aspect-ratio: 16 / 11;
  min-height: 240px;
  box-shadow: 0 14px 34px rgba(11, 18, 32, 0.08);
  transform-style: preserve-3d;
  transition:
    opacity 0.4s var(--w-ease),
    transform 0.45s var(--w-ease),
    box-shadow 0.4s ease;
}

.work-item__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.work-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.75s var(--w-ease), filter 0.45s ease;
  will-change: transform;
  filter: saturate(1.05);
}

.work-item:hover .work-item__media img {
  transform: scale(1.08);
  filter: saturate(1.12) contrast(1.04);
}

.work-item__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 16, 24, 0.05) 20%, rgba(6, 16, 24, 0.88) 100%),
    linear-gradient(90deg, rgba(6, 16, 24, 0.35) 0%, transparent 50%);
  opacity: 0.95;
  transition: opacity 0.4s ease;
}

.work-item:hover .work-item__shade {
  opacity: 1;
}

.work-item__body {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 0.85rem;
  padding: 1.2rem 1.2rem 1.25rem;
}

.work-item__num {
  font-family: var(--w-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--w-mint);
  padding-bottom: 0.35rem;
}

.work-item__body h3 {
  font-family: var(--w-display);
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  letter-spacing: -0.025em;
  margin: 0 0 0.2rem;
  color: #fff;
  line-height: 1.2;
}

.work-item__tag {
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
}

.work-item__go {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  flex-shrink: 0;
  transition: background 0.3s ease, transform 0.35s var(--w-ease), border-color 0.3s ease;
}

.work-item:hover .work-item__go {
  background: linear-gradient(135deg, var(--w-coral), var(--w-coral-2));
  border-color: transparent;
  transform: translateX(3px);
}

.work-item:hover {
  box-shadow: 0 24px 48px rgba(11, 18, 32, 0.18);
}

/* ---------- CTA ---------- */
.work-cta {
  padding: clamp(2.5rem, 5vw, 4rem) 0 0.75rem;
}

.work-cta__panel {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  padding: clamp(2.25rem, 5.5vw, 3.75rem);
  text-align: center;
  color: #fff;
  background:
    radial-gradient(ellipse 50% 60% at 85% 20%, rgba(45, 212, 191, 0.28), transparent 55%),
    radial-gradient(ellipse 40% 50% at 10% 90%, rgba(255, 78, 50, 0.22), transparent 50%),
    linear-gradient(135deg, #071018 0%, #0d2430 55%, #0a1a22 100%);
  box-shadow: 0 28px 60px rgba(11, 18, 32, 0.16);
}

.work-cta__orb {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  right: -60px;
  top: -80px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.35), transparent 68%);
  animation: work-orb 8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes work-orb {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-24px, 18px) scale(1.12); }
}

.work-cta__panel .work-kicker {
  justify-content: center;
}

.work-cta__panel h2 {
  font-family: var(--w-display);
  font-size: clamp(1.75rem, 3.6vw, 2.7rem);
  letter-spacing: -0.04em;
  color: #fff;
  margin: 0 0 0.6rem;
}

.work-cta__panel > p {
  margin: 0 auto 1.5rem;
  max-width: 40ch;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1.05rem;
  line-height: 1.55;
}

.work-cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 699px) {
  .work-hero {
    min-height: 36vh;
    align-items: center;
  }

  .work-hero__inner {
    padding: 4.25rem 0 1.85rem;
  }

  .work-item__body {
    grid-template-columns: 1fr auto;
  }

  .work-item__num {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .work-page *,
  .work-page *::before,
  .work-page *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-work-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .work-item__media img {
    transform: none !important;
  }
}
