/* Work — cinematic portfolio (matcher hero / why-us / final-cta) */
.work-page {
  --w-ink: #0a0a0a;
  --hero-red: #d92323;
  --w-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  background-color: #d92323;
  color: #fff;
}

/* Eksplicit rød main — undgår at hvid body fra header.css vises bag video-grid */
.work-page > main {
  background-color: #d92323;
}

/* Header forbliver hvid bjælke med mørk tekst (som about) */
.work-page .site-header,
.work-page .nav-mobile {
  color: var(--color-ink);
}

/* —— Hero — samme flade rød som forsiden (.page-hero) —— */
.work-hero {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  color: #fff;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1rem, 4vw, 1.75rem)
    clamp(1rem, 2.5vw, 1.5rem);
  background-color: var(--hero-red);
  background-image: none;
  -webkit-font-smoothing: antialiased;
}

.work-hero__inner {
  position: relative;
  z-index: 2;
  max-width: 50rem;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.work-hero__title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(1.65rem, 4.5vw, 3.35rem);
  line-height: 1.06;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
  color: #fff;
  animation: work-title-in 0.75s var(--w-ease) 0.06s both;
}

@keyframes work-title-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Showcase — samme røde flade som hero —— */
.work-page .work-showcase {
  position: relative;
  overflow: hidden;
  background-color: #d92323;
  background-image: none;
  padding: clamp(0.5rem, 1.5vw, 1rem) clamp(1rem, 4vw, 2rem)
    clamp(2.5rem, 6vw, 4rem);
}

.work-page .work-showcase::before,
.work-page .work-showcase::after {
  display: none;
}

/* Portfolio-knap under video-grid */
.work-portfolio-cta {
  background: var(--hero-red);
  padding: 0 clamp(1rem, 4vw, 2rem) clamp(2.75rem, 7vw, 4.5rem);
}

.work-portfolio-cta__inner {
  max-width: min(72rem, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

.work-portfolio-cta__btn {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  padding: 14px 36px;
  border-radius: 100px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.work-portfolio-cta__btn:hover,
.work-portfolio-cta__btn:focus-visible {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.5);
}

.work-portfolio-cta__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.work-page .work-showcase__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(72rem, 100%);
  margin: 0 auto;
  background: transparent;
}

/* ~40% mindre end fuld indre bredde (60%), samme række-layout; ekstra luft */
.work-page .work-bento {
  --work-pair-gap: clamp(0.85rem, 2vw, 1.35rem);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(1.2rem, 2.8vw, 2rem);
  width: 60%;
  max-width: 43.2rem; /* 60% af 72rem — cap hvis parent er bredere end forventet */
  margin-inline: auto;
  box-sizing: border-box;
  background: transparent;
}

.work-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  animation: work-tile-in 0.65s var(--w-ease) both;
}

.work-row:nth-child(1) {
  animation-delay: 0.04s;
}
.work-row:nth-child(2) {
  animation-delay: 0.08s;
}
.work-row:nth-child(3) {
  animation-delay: 0.12s;
}
.work-row:nth-child(4) {
  animation-delay: 0.16s;
}
.work-row:nth-child(5) {
  animation-delay: 0.2s;
}
.work-row:nth-child(6) {
  animation-delay: 0.24s;
}
.work-row:nth-child(7) {
  animation-delay: 0.28s;
}
.work-row:nth-child(8) {
  animation-delay: 0.32s;
}
.work-row:nth-child(9) {
  animation-delay: 0.36s;
}

@keyframes work-tile-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.work-row--phones {
  gap: var(--work-pair-gap);
  flex-wrap: nowrap;
}

.work-row--phones .work-tile {
  flex: 1 1 calc((100% - var(--work-pair-gap)) / 2);
  min-width: 0;
}

.work-row--phones .work-tile__frame--916 {
  width: 100%;
  max-width: none;
}

.work-row--wide .work-tile--fill {
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
}

.work-row--wide .work-tile__frame--169 {
  width: 100%;
}

.work-row--squares {
  width: 100%;
  max-width: 100%;
  gap: var(--work-pair-gap);
  box-sizing: border-box;
}

.work-row--squares .work-tile {
  flex: 1 1 0;
  min-width: 0;
}

.work-row--squares .work-tile__frame--11 {
  width: 100%;
}

.work-tile {
  min-width: 0;
}

.work-tile--fill {
  width: 100%;
}

.work-tile__frame {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #050505;
  border: 1px solid rgba(10, 10, 10, 0.12);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08),
    0 20px 48px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateZ(0);
  transition: transform 0.45s var(--w-ease), box-shadow 0.45s var(--w-ease),
    border-color 0.35s ease;
}

.work-tile__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.12) 0%,
    transparent 40%,
    transparent 60%,
    rgba(0, 0, 0, 0.28) 100%
  );
  opacity: 0.88;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.work-tile:hover .work-tile__frame,
.work-tile:focus-within .work-tile__frame {
  transform: translateY(-5px);
  border-color: rgba(10, 10, 10, 0.2);
  box-shadow: 0 10px 16px rgba(0, 0, 0, 0.12),
    0 32px 64px rgba(0, 0, 0, 0.16),
    0 0 0 1px rgba(0, 0, 0, 0.04);
}

.work-tile:hover .work-tile__frame::after,
.work-tile:focus-within .work-tile__frame::after {
  opacity: 0.62;
}

.work-page .work-tile__frame {
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

.work-page .work-tile:hover .work-tile__frame,
.work-page .work-tile:focus-within .work-tile__frame {
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.work-tile__frame--169 {
  aspect-ratio: 16 / 9;
}

.work-tile__frame--916 {
  aspect-ratio: 9 / 16;
}

.work-tile__frame--11 {
  aspect-ratio: 1 / 1;
}

.work-tile__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  z-index: 0;
}

.work-tile__frame--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.04);
  border: 1px dashed rgba(10, 10, 10, 0.18);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.work-page .work-tile__frame--placeholder {
  background: rgba(255, 255, 255, 0.1);
  border: 1px dashed rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.work-tile__frame--placeholder::after {
  opacity: 0.35;
}

.work-tile__placeholder-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(10, 10, 10, 0.4);
  pointer-events: none;
}

.work-page .work-tile__placeholder-label {
  color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 640px) {
  .work-page .work-bento {
    width: 100%;
    max-width: none;
  }

  .work-row--phones {
    flex-wrap: wrap;
    gap: 1.25rem;
  }

  .work-row--phones .work-tile {
    flex: 1 1 100%;
    max-width: min(13rem, 88vw);
    margin-inline: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .work-hero__title,
  .work-row {
    animation: none;
  }

  .work-tile__frame {
    transition: none;
  }

  .work-tile:hover .work-tile__frame,
  .work-tile:focus-within .work-tile__frame {
    transform: none;
  }
}
